.header {
    margin-bottom: 14px;
}

.top-nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.top-nav a {
    text-decoration: none;
}

.facts-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.facts-toolbar .field {
    margin: 0;
    min-width: 140px;
    flex: 1;
}

.fact-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.fact-card input[type="checkbox"] {
    margin-top: 4px;
}

.fact-main {
    flex: 1;
}

.fact-actions {
    display: flex;
    gap: 6px;
}

.note {
    font-size: 13px;
}

.status {
    margin-top: 10px;
    font-size: 13px;
}

.map-card {
    width: 100%;
}

.map-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 10px;
}

.map-title {
    font-weight: 800;
    font-size: 14px;
}

.map-list {
    margin: 10px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.person-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 0;
}

.person-name {
    font-size: 16px;
    font-weight: 800;
}

.person-head-toggle {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.person-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.person-expanded {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 12px;
}

.person-summary {
    margin-top: 6px;
    line-height: 1.5;
}

.person-extra-actions {
    margin-top: 2px;
    flex-wrap: wrap;
}

.fact-card-mini {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.fact-card-mini .fact-actions {
    display: flex;
    gap: 6px;
}

.graph-wrap {
    position: relative;
    height: clamp(420px, 56vh, 860px);
    margin-top: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 30% 20%, rgba(38, 161, 123, 0.12) 0, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(42, 60, 89, 0.18) 0, transparent 55%),
        var(--surface-strong);
    overflow: hidden;
}

.graph-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.graph-edge {
    stroke: rgba(151, 162, 173, 0.35);
    stroke-width: 1.5;
    pointer-events: none;
}

.graph-edge-hit {
    stroke: transparent;
    stroke-width: 18;
    pointer-events: stroke;
}

.graph-edge-secondary {
    stroke: rgba(38, 161, 123, 0.28);
    stroke-dasharray: 4 6;
}

.graph-node circle {
    fill: rgba(18, 22, 26, 0.92);
    stroke: rgba(38, 161, 123, 0.7);
    stroke-width: 2;
}

.graph-node-me circle {
    fill: rgba(38, 161, 123, 0.9);
    stroke: rgba(38, 161, 123, 1);
}

.graph-label {
    font-size: 12px;
    font-weight: 800;
    fill: var(--text);
    opacity: 0.95;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(11, 13, 15, 0.85);
    stroke-width: 3;
    stroke-linejoin: round;
}

.graph-tooltip {
    position: absolute;
    z-index: 5;
    max-width: 340px;
    min-width: 220px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(18, 22, 26, 0.95);
    box-shadow: var(--shadow);
    padding: 10px 12px;
    pointer-events: none;
}

.graph-tooltip-title {
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 6px;
}

.graph-tooltip-facts {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.graph-tooltip-fact {
    line-height: 1.35;
}

@media (max-width: 640px) {
    .title {
        font-size: 22px;
    }

    .section {
        padding: 14px;
    }

    .row {
        flex-direction: column;
    }

    .fact-card {
        flex-direction: column;
    }

    .fact-actions {
        width: 100%;
    }

    .person-head {
        flex-direction: column;
    }

    .person-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .fact-card-mini {
        flex-direction: column;
    }

    .graph-wrap {
        height: clamp(360px, 54vh, 760px);
    }
}
