:root {
    --bg: #10120e;
    --bg-raise: #181b15;
    --bg-sink: #0c0e0b;
    --ink: #f3ecdf;
    --muted: #a39886;
    --faint: #6f675c;
    --line: rgba(243, 236, 223, 0.12);
    --gold: #e4b15a;
    --gold-dim: rgba(228, 177, 90, 0.16);
    --rust: #e07a4c;
    --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
    --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --person: #f3ecdf;
    --foundation: #e07a4c;
    --organization: #7ea196;
    --company: #e4d7bc;
    --academic: #8aa0d4;
    --media: #b09ad4;
    --pac: #c4493a;
    --campaign: #d15b73;
    --event: #d2ae6a;
    --other: #9a9286;
    --artifact: #c8bba4;
    --grant: #8d9a78;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--gold); }

.shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.page {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.site-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1rem calc(1.35rem + env(safe-area-inset-right)) calc(1.15rem + env(safe-area-inset-bottom)) calc(1.35rem + env(safe-area-inset-left));
    border-top: 1px solid rgba(228, 177, 90, 0.35);
    background: #161910;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.site-footer .strap {
    margin: 0 0 0 auto;
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink);
    text-align: right;
}

.site-footer nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem 1.35rem;
    flex: 0 0 auto;
}

.site-footer a {
    display: inline-flex;
    white-space: nowrap;
    font-size: 0.98rem;
}

.site-footer a[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.app {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.top {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: calc(0.75rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) 0.7rem calc(1rem + env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #161910 0%, var(--bg) 100%);
}

.top-row, .tool-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.tool-row { flex-wrap: wrap; }

.tool-row-top { align-items: flex-start; }

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    text-decoration: none;
    color: inherit;
    flex: 0 0 auto;
}

.brand-sorrow {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 560;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.brand-boss {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    font-weight: 640;
    color: var(--gold);
}

.kingpins {
    display: flex;
    gap: 0.35rem;
    min-width: 0;
    overflow-x: auto;
}

.kingpin-link {
    text-decoration: none;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    white-space: nowrap;
    background: transparent;
}

.kingpin-link.active {
    color: var(--ink);
    border-color: rgba(228, 177, 90, 0.7);
    background: var(--gold-dim);
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.share-wrap {
    position: relative;
    z-index: 6;
}

.share-dismiss {
    position: fixed;
    inset: 0;
    z-index: 5;
    border: 0;
    padding: 0;
    background: transparent;
}

.share-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 6;
    width: min(22rem, 70vw);
    max-width: min(22rem, calc(100vw - 1.5rem));
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    background: #161910;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.share-panel p {
    margin: 0 0 0.35rem;
    min-width: 0;
    color: var(--ink);
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.share-panel a,
.share-panel button {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--gold);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.share-panel a:hover,
.share-panel button:hover { text-decoration: underline; }

.stats {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.35rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.stats strong { color: var(--gold); font-weight: 520; }

.stat-fixed { flex: 0 0 auto; }

.stat-subject { color: var(--ink); }

.stat-rotator {
    position: relative;
    display: inline-block;
    min-width: 0;
    max-width: min(36rem, 46vw);
    vertical-align: bottom;
}

.stat-fact {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-fact-in { animation: stat-in 0.9s ease; }

.stat-fact-out {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    animation: stat-out 0.9s ease forwards;
    pointer-events: none;
}

@keyframes stat-in {
    from { opacity: 0; transform: translateY(0.35em); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes stat-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-0.35em); }
}

@media (prefers-reduced-motion: reduce) {
    .stat-fact-in, .stat-fact-out { animation: none; }
}

.search {
    flex: 1 1 16rem;
    min-width: 14rem;
    background: var(--bg-sink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    outline: none;
}

.search:focus { border-color: rgba(228, 177, 90, 0.7); }

.tool, .chip, .drawer-toggle, .filters-toggle {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}

.tool[aria-pressed="true"], .chip[aria-pressed="true"], .filters-toggle[aria-pressed="true"] {
    color: var(--bg);
    background: var(--gold);
    border-color: var(--gold);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    min-width: 0;
}

.place-filters {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 18rem;
}

.chips-end { justify-content: flex-end; }

.date-row { gap: 0.65rem; }

.date-label, .date-bound {
    color: var(--muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.date-slider {
    position: relative;
    flex: 1 1 16rem;
    height: 1.75rem;
    min-width: 10rem;
}

.date-track, .date-fill {
    position: absolute;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    pointer-events: none;
}

.date-track {
    left: 0;
    right: 0;
    background: rgba(243, 236, 223, 0.18);
}

.date-fill { background: var(--gold); }

.date-slider input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1.75rem;
    margin: 0;
    background: none;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.date-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.date-slider input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
    border: 0;
}

.date-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--ink);
    border: 2px solid var(--gold);
    cursor: grab;
}

.date-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ink);
    border: 2px solid var(--gold);
    cursor: grab;
}

.date-slider input#founded-from { z-index: 3; }
.date-slider input#founded-to { z-index: 4; }

.place-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.place-filter select {
    background: var(--bg-sink);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    max-width: min(16rem, 70vw);
}

.sector-filter,
.country-filter {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.sector-filter input,
.country-filter input {
    background: var(--bg-sink);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.32rem 1.85rem 0.32rem 0.75rem;
    width: 13.5rem;
    max-width: min(18rem, 70vw);
}

.filter-clear {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 0.28rem;
    transform: translateY(-50%);
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--faint);
    font-size: 1.05rem;
    line-height: 1;
    padding: 0;
}

.filter-clear:hover,
.filter-clear:focus-visible {
    color: var(--ink);
    background: rgba(243, 236, 223, 0.08);
}

.sector-filter.active input,
.country-filter.active input { border-color: var(--gold); }

.sector-menu,
.country-menu {
    position: absolute;
    z-index: 6;
    top: calc(100% + 0.3rem);
    right: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(22rem, 80vw);
    max-height: 16rem;
    overflow: auto;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.sector-menu button,
.country-menu button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: inherit;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}

.sector-menu button span,
.country-menu button span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.sector-menu button:hover,
.sector-menu button:focus,
.country-menu button:hover,
.country-menu button:focus { background: rgba(243, 236, 223, 0.06); }

.sector-empty,
.country-empty {
    color: var(--muted);
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
}

.chip { display: inline-flex; align-items: center; gap: 0.35rem; }

.chip-count {
    font-variant-numeric: tabular-nums;
    opacity: 0.72;
}

.swatch {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--other);
    display: inline-block;
}

.swatch[data-type="person"] { background: var(--person); }
.swatch[data-type="foundation"] { background: var(--foundation); }
.swatch[data-type="organization"] { background: var(--organization); }
.swatch[data-type="company"] { background: var(--company); }
.swatch[data-type="academic"] { background: var(--academic); }
.swatch[data-type="media"] { background: var(--media); }
.swatch[data-type="pac"] { background: var(--pac); }
.swatch[data-type="campaign"] { background: var(--campaign); }
.swatch[data-type="individual_grant"] { background: var(--grant); }
.swatch[data-type="event"] { background: var(--event); }
.swatch[data-type="artifact"] { background: var(--artifact); }

.workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr) 360px;
}

.register, .detail {
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-raise);
}

.register { border-right: 1px solid var(--line); }
.detail { border-left: 1px solid var(--line); }

.pane-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem 0.4rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 0.4rem 1rem;
}

.node-row, .flow-row, .tie-name {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: inherit;
}

.node-row, .flow-row { padding: 0.45rem 0.5rem; }

.node-row {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    align-items: center;
}

.node-row .swatch { grid-row: span 2; }

.node-row strong, .flow-row strong, .tie-name {
    font-weight: 520;
    font-size: 0.92rem;
}

.node-row span, .flow-meta, .meta {
    color: var(--muted);
    font-size: 0.75rem;
}

.node-row.selected, .flow-row:hover, .node-row:hover, .tie-name:hover {
    background: rgba(243, 236, 223, 0.05);
}

.node-row.selected { background: var(--gold-dim); }

.stage {
    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: 0;
    background:
        radial-gradient(ellipse at center, rgba(228, 177, 90, 0.05), transparent 55%),
        var(--bg);
}

.view {
    display: none;
    position: absolute;
    inset: 0;
}

.view.active { display: block; }

.atlas {
    position: absolute;
    inset: 0;
    z-index: 0;
    isolation: isolate;
    background: #12140f;
    touch-action: none;
}

.gold-dot, .sage-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
    background: var(--gold);
}

.sage-dot { background: var(--organization); }

.atlas canvas.globe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

.atlas canvas.globe:active { cursor: grabbing; }

.atlas-nav {
    position: absolute;
    z-index: 2;
    top: 0.7rem;
    left: 0.7rem;
}

.atlas-card {
    position: absolute;
    z-index: 3;
    top: 0.7rem;
    right: 0.7rem;
    width: min(22rem, calc(100% - 1.4rem));
    max-height: calc(100% - 1.4rem);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.7rem 0.75rem 0.45rem;
    background: rgba(16, 18, 14, 0.94);
    border: 1px solid var(--line);
    border-radius: 12px;
    pointer-events: auto;
}

.atlas-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.atlas-card-head strong {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 1.25rem;
}

.atlas-card .scroll { max-height: 16rem; padding: 0; }

.atlas-card .tool { align-self: flex-start; }

.board {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    padding: 0.75rem 0.9rem 0.4rem;
}

.board-head > span {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.board-row {
    width: 100%;
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
}

.board-name { min-width: 0; }

.board-name strong, .board-row strong { display: block; font-weight: 520; overflow-wrap: anywhere; }

.board-row .rank, .board-row .board-metric, .board-row .amt {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.board-row .rank { color: var(--faint); }

.board-row .amt { color: var(--gold); }

.board-row.selected { background: var(--gold-dim); }

.board-row:hover { background: rgba(243, 236, 223, 0.05); }

.view-network { touch-action: none; }

.boot {
    position: absolute;
    z-index: 2;
    top: 52px;
    left: 28px;
    width: min(18rem, 46%);
    pointer-events: none;
}

.boot[hidden] { display: none; }

.boot-track {
    height: 3px;
    border-radius: 999px;
    background: rgba(243, 236, 223, 0.14);
    overflow: hidden;
}

.boot-track span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--gold);
}

.view-network canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

.view-network canvas.wires {
    z-index: 0;
    pointer-events: none;
}

.view-network canvas.ink {
    z-index: 1;
    background: transparent;
}

.view-network canvas:active { cursor: grabbing; }

.legend, .tip {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    background: rgba(16, 18, 14, 0.82);
    border: 1px solid var(--line);
    border-radius: 10px;
    backdrop-filter: blur(8px);
}

.legend {
    left: 0.7rem;
    bottom: 0.7rem;
    padding: 0.55rem 0.7rem;
    color: var(--muted);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.legend b { color: var(--ink); font-weight: 520; }

.legend .key { display: flex; align-items: center; gap: 0.4rem; }

.gold-line, .sage-line {
    width: 1.4rem;
    height: 0;
    border-top: 2px solid var(--gold);
}

.sage-line { border-top-color: #7ea196; border-top-style: solid; opacity: 0.8; }

.tip {
    padding: 0.4rem 0.55rem;
    max-width: 240px;
    font-size: 0.82rem;
}

.tip small { display: block; color: var(--muted); }

.dossier {
    padding: 0.2rem 0.95rem 0.8rem;
    overflow: auto;
}

.detail .dossier:not(.intro) { max-height: 46%; }

.detail .intro { flex: 1; }

.dossier h1 {
    font-family: var(--serif);
    font-weight: 560;
    letter-spacing: -0.03em;
    font-size: 1.7rem;
    margin: 0.2rem 0 0.35rem;
    line-height: 1.15;
}

.intro h1 { font-size: 1.35rem; }

.lede, .role, .notes {
    color: var(--muted);
    line-height: 1.45;
    margin: 0.35rem 0 0.7rem;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.pill.money { color: var(--gold); border-color: rgba(228, 177, 90, 0.45); }
.pill.reported { color: #d2ae6a; }
.pill.created { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.pill.proxy { color: var(--ink); border-color: var(--rust); }

.money-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.money-pair div {
    background: var(--bg-sink);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
}

.money-pair span {
    display: block;
    color: var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.money-pair strong {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 560;
}

.section-label {
    margin: 0.8rem 0 0.35rem;
    color: var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tie {
    padding: 0.45rem 0.15rem 0.55rem;
    border-top: 1px solid var(--line);
}

.tie-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.tie-amount { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tie details { color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }

.tie summary { cursor: pointer; color: var(--faint); }

.sources { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.25rem; word-break: break-word; }

.sources a, .sources span { font-size: 0.75rem; }

.flow-row { display: flex; flex-direction: column; align-items: flex-start; }

.flow-row .amt { color: var(--gold); }

.flow-row.hop { padding-left: 1.35rem; }

.empty-state, .missing {
    margin: auto;
    max-width: 36rem;
    padding: 2rem 1.2rem;
}

.empty-state h1, .missing h1, .directory h1 {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
}

.directory {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.6rem 1.2rem 2.4rem;
}

.directory-list {
    list-style: none;
    margin: 1.4rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.directory-list a {
    font-family: var(--serif);
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.directory-list p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.legal {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.45rem 1.15rem 2.5rem;
}

.legal-inner {
    max-width: 44rem;
    margin: 0 auto;
}

.legal h1 {
    font-family: var(--serif);
    font-weight: 560;
    letter-spacing: -0.03em;
    font-size: 2.15rem;
    line-height: 1.1;
    margin: 0.15rem 0 0.35rem;
}

.legal h2 {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 1.22rem;
    letter-spacing: -0.02em;
    margin: 1.55rem 0 0.35rem;
}

.legal p,
.legal li {
    color: var(--muted);
    line-height: 1.5;
}

.legal p { margin: 0.45rem 0 0.7rem; }

.legal ul {
    margin: 0.25rem 0 0.85rem;
    padding-left: 1.15rem;
}

.legal li { margin: 0.22rem 0; }

.legal-meta {
    color: var(--faint);
    font-size: 0.82rem;
    margin-top: 0;
}

.liability-banner {
    border: 1px solid rgba(228, 177, 90, 0.45);
    background: var(--gold-dim);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin: 0.85rem 0 1.15rem;
}

.liability-banner p {
    color: var(--ink);
    margin: 0;
}

.legal-inner { overflow-x: auto; }

.legal table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.35rem 0 1rem;
    font-size: 0.88rem;
}

.legal th,
.legal td {
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--line);
    padding: 0.5rem 0.7rem 0.5rem 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.legal th {
    color: var(--faint);
    font-size: 0.72rem;
    font-weight: 520;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal code {
    font-size: 0.84em;
    color: var(--ink);
}

.legal-related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 1.7rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.drawer-toggle, .filters-toggle, .pane-close, .dossier-bar, .scrim { display: none; }

.pane-head-end {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.35rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--bg);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.filters-toggle[aria-pressed="true"] .filter-count {
    background: var(--bg);
    color: var(--gold);
}

.pane-close {
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blazor-error-boundary {
    background: #6e2e24;
    padding: 0.7rem 1rem;
    color: white;
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 540px) {
    .site-footer {
        flex-wrap: wrap;
        gap: 0.45rem 1rem;
        padding: 0.65rem calc(0.85rem + env(safe-area-inset-right)) calc(0.7rem + env(safe-area-inset-bottom)) calc(0.85rem + env(safe-area-inset-left));
        font-size: 0.84rem;
    }

    .site-footer nav { flex-wrap: wrap; gap: 0.3rem 0.85rem; }
    .site-footer a, .site-footer .strap { font-size: 0.84rem; }
    .site-footer .strap { flex: 1 1 100%; }

    .filters-toggle { display: inline-flex; align-items: center; order: 2; }
    .filter-extra { display: none; }
    .filters-open .filter-extra.tool-row,
    .filters-open .filter-extra.chips { display: flex; }
    .filters-open button.filter-extra { display: inline-block; }

    .top { min-height: 0; }
    .filters-open {
        max-height: 40dvh;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .top-row { flex-wrap: wrap; row-gap: 0.45rem; }
    .brand { margin-right: auto; order: 1; }
    .drawer-toggle { order: 2; }
    .kingpins { order: 3; flex: 1 1 100%; }
    .search { flex: 1 1 100%; min-width: 0; }
    .search,
    .sector-filter input,
    .country-filter input { font-size: 16px; }

    .sector-menu,
    .country-menu {
        position: fixed;
        top: auto;
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        left: 0.75rem;
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: min(50dvh, 22rem);
    }

    .atlas-card {
        top: auto;
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-height: 46%;
    }

    .atlas-card .scroll { max-height: none; flex: 1 1 auto; min-height: 0; }
}

@media (max-width: 980px) {
    .stats { display: none; }

    .workspace { grid-template-columns: minmax(0, 1fr); }

    .drawer-toggle, .pane-close, .dossier-bar { display: inline-flex; }
    .dossier-bar { display: flex; }

    .scrim.on {
        display: block;
        position: fixed;
        z-index: 4;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.4);
    }

    .register, .detail {
        position: fixed;
        z-index: 5;
        top: 0;
        bottom: 0;
        width: min(92vw, 380px);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        transition: transform 160ms ease;
        box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, 0.45);
    }

    .register { left: 0; transform: translateX(-105%); }
    .detail { right: 0; width: min(94vw, 420px); transform: translateX(105%); }
    .register.open, .detail.open { transform: none; }
}

@media (max-width: 640px) {
    .brand-sorrow { font-size: 1.2rem; }
    .tool-row { flex-wrap: wrap; }
    .date-row { flex-wrap: nowrap; }
    .legend { display: none; }
}
