/* Observatory's shared visual system. Loaded after page-specific layouts. */
:root {
    --bg: #f4f6f8; --bg-soft: #edf1f4; --surface: #fff; --surface-muted: #edf2f5;
    --ink: #182b3b; --ink-soft: #334b5d; --muted: #627585; --faint: #748693;
    --border: #dde5eb; --border-strong: #bccdd9;
    --accent: #12796c; --accent-strong: #096657; --accent-soft: #e1f2eb;
    --header-bg: #ffffffed; --header-border: #dde5eb;
    --panel-bg: var(--surface); --card-bg: var(--surface); --glass: var(--surface);
    --button-bg: #173b3d; --button-bg-hover: #235453; --button-ink: #fff;
    --nav-active-bg: #e1f2eb; --nav-active-ink: #096657;
    --radius: 14px; --shadow-sm: 0 2px 5px #182b3b04; --shadow-md: 0 16px 40px #182b3b0a;
    --chart-grid: #182b3b12; --chart-previous: #97a8b4;
}
:root[data-theme="dark"] {
    --bg: #101b24; --bg-soft: #14232e; --surface: #172733; --surface-muted: #1d303d;
    --ink: #edf4f7; --ink-soft: #c2d2dd; --muted: #a1b5c3; --faint: #8ba2b3;
    --border: #2b414f; --border-strong: #446372;
    --accent: #80d8bb; --accent-strong: #a0e8cc; --accent-soft: #213f3d;
    --header-bg: #101b24f2; --header-border: #2b414f;
    --button-bg: #9ce0c7; --button-bg-hover: #b5ecd9; --button-ink: #102a29;
    --nav-active-bg: #213f3d; --nav-active-ink: #a0e8cc;
    --chart-grid: #c2d2dd14; --chart-previous: #6b8596;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #101b24; --bg-soft: #14232e; --surface: #172733; --surface-muted: #1d303d;
        --ink: #edf4f7; --ink-soft: #c2d2dd; --muted: #a1b5c3; --faint: #8ba2b3;
        --border: #2b414f; --border-strong: #446372;
        --accent: #80d8bb; --accent-strong: #a0e8cc; --accent-soft: #213f3d;
        --header-bg: #101b24f2; --header-border: #2b414f;
        --button-bg: #9ce0c7; --button-bg-hover: #b5ecd9; --button-ink: #102a29;
        --nav-active-bg: #213f3d; --nav-active-ink: #a0e8cc;
        --chart-grid: #c2d2dd14; --chart-previous: #6b8596;
    }
}
body { background: var(--bg); font-size: 14px; }
h1,h2,h3 { letter-spacing: -.035em; }
button,a,input,select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.srOnly { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skipLink { position:fixed; top:8px; left:16px; transform:translateY(-150%); z-index:100; padding:12px 20px; background:var(--surface); border:2px solid var(--accent); border-radius:8px; }
.skipLink:focus { transform:none; }
.siteHeaderRow { min-height:80px; gap:26px; }
.logoImg { width:190px; height:auto; }
.navLinks { gap:4px; border-radius:12px; flex-shrink:0; max-width:100%; box-sizing:border-box; }
.navLinks a { flex-shrink:0; }
.navLinks a { border-radius:8px; font-size:13px; font-weight:650; padding:9px 12px; min-height:38px; }
.headerRight { gap:12px; }
.headerRight > .muted { display:none; }
.headerAccountLink { min-height:38px; border-radius:8px; background:var(--button-bg); color:var(--button-ink); border-color:transparent; padding:0 16px; }
.headerAccountLink:hover { color:var(--button-ink); background:var(--button-bg-hover); text-decoration:none; }
.themeControl { border:0; background:var(--surface-muted); padding:3px; border-radius:8px; }
.themeButton,.siteHeader button.themeButton:not(.navToggle) { min-height:30px; font-size:11px; border-radius:6px; padding:0 8px; }
.homeShell { padding-top:30px; }
.homeIntro { grid-template-columns:minmax(0,1.65fr) minmax(230px,1fr); align-items:center; gap:35px; padding:40px 0 48px; border-bottom:0; }
.homeEyebrow,.playersKicker,.townsKicker,.nationsKicker,.accountKicker { display:block; color:var(--accent-strong); text-transform:uppercase; font-size:10px; font-weight:750; letter-spacing:.15em; margin-bottom:16px; }
.atlasDot { display:inline-block; width:7px; height:7px; margin-right:8px; border-radius:50%; background:var(--accent); }
.homeTitle { font-size:clamp(38px,4.7vw,62px); letter-spacing:-.055em; line-height:1.09; font-weight:650; }
.homeTitle em { font-style:normal; color:var(--accent-strong); }
.homeCopy { max-width:470px; font-size:16px; line-height:1.75; margin-top:20px; }
.atlasSearch { display:flex; align-items:center; gap:8px; max-width:580px; padding:7px; margin-top:28px; border:1px solid var(--border-strong); border-radius:12px; background:var(--surface); box-shadow:var(--shadow-md); }
.atlasSearch select { max-width:110px; border:0; border-right:1px solid var(--border); border-radius:0; padding:10px; background:transparent; color:var(--ink); }
.atlasSearch input { width:100%; min-width:0; padding:10px 4px; border:0; background:transparent; color:var(--ink); }
.atlasSearch button { border:0; border-radius:8px; background:var(--button-bg); color:var(--button-ink); padding:12px 18px; font-weight:650; cursor:pointer; white-space:nowrap; }
.atlasSearch button span { margin-left:14px; }
.atlasSearchHint { color:var(--muted); font-size:12px; margin-top:14px; }
.atlasSearchHint a { text-decoration:underline; }
.atlasSearch { position:relative; }
.atlasSuggestions { position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:20; margin:0; padding:6px; list-style:none; border:1px solid var(--border-strong); border-radius:12px; background:var(--surface); box-shadow:var(--shadow-md); }
.atlasSuggestions[hidden] { display:none; }
.atlasSuggestions { max-height:40vh; overflow-y:auto; }
.atlasSuggestions li { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:46px; padding:10px 14px; border-radius:7px; cursor:pointer; color:var(--ink); }
.atlasSuggestions li:hover,.atlasSuggestions li[aria-selected="true"] { background:var(--accent-soft); }
.atlasSuggestions li span { min-width:0; overflow:hidden; text-overflow:ellipsis; font-weight:650; }
.atlasSuggestions small { flex-shrink:0; color:var(--muted); font-size:11px; }
.atlasIllustration { position:relative; max-width:350px; justify-self:center; color:var(--accent); }
.atlasIllustration svg { display:block; width:100%; stroke:var(--border-strong); stroke-width:1; transform:rotate(-16deg); }
.atlasIllustration .atlasOrbit { stroke:var(--muted); opacity:.45; }
.atlasIllustration .atlasRoute { stroke:var(--accent); stroke-width:2; }
.atlasIllustration .atlasMarker { stroke:var(--surface); stroke-width:4; fill:var(--accent); }
.atlasCoordinate { display:block; text-align:center; font-family:var(--mono); font-size:9px; letter-spacing:.1em; color:var(--muted); margin-top:18px; }
.homePulse { grid-template-columns:1fr; padding:28px; gap:24px; margin:0 0 38px; border-radius:18px; background:var(--surface); }
.homePulseHeader { margin-bottom:20px; }
.homePulseHeader .homeEyebrow { margin-bottom:8px; }
.homePulseHeader h2,.homeSectionHeader h2 { font-size:25px; font-weight:650; }
.homePulseHeader p { font-size:12px; }
.homePulseStatus { max-width:220px; white-space:normal; text-align:right; }
.playerChartCanvas { height:220px; }
.playerChartFrame { min-height:0; }
.homePulseStats { grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; border-top:1px solid var(--border); padding-top:22px; }
.homePulseStat { border:0; border-right:1px solid var(--border); border-radius:0; padding:0 24px; background:transparent; }
.homePulseStat:first-child { padding-left:0; }
.homePulseStat:last-child { border-right:0; }
.homePulseStat strong { font-size:30px; letter-spacing:-.05em; font-variant-numeric:tabular-nums; font-weight:600; margin-top:8px; }
.homePulseStat:first-child strong { color:var(--accent-strong); }
.homeGrid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.sectionCard { min-height:220px; border-radius:14px; padding:25px; transition:transform .18s,border-color .18s,box-shadow .18s; }
.sectionCard:hover { transform:translateY(-4px); border-color:var(--accent); box-shadow:var(--shadow-md); }
.sectionCardKicker { text-transform:uppercase; letter-spacing:.12em; font-size:10px; margin-bottom:24px; }
.sectionCard h3 { font-size:25px; font-weight:600; }
.sectionCard p { font-size:13px; line-height:1.75; max-width:280px; }
.sectionCardFooter { padding-top:22px; font-size:11px; }
.sectionCardAction { color:var(--accent-strong); }
.botInstallPanel { background:var(--surface); border:1px solid var(--border); margin:42px 0 0; padding:30px; border-radius:16px; box-shadow:none; }
.botInstallKicker { color:var(--accent-strong); font-size:10px; letter-spacing:.15em; }
.botInstallCopy h2 { font-size:23px; font-weight:650; }
.botInstallCopy p { font-size:13px; }
.botInstallButton { background:var(--button-bg); color:var(--button-ink); border-color:transparent; box-shadow:none; }
.botInstallButton:hover { background:var(--button-bg-hover); color:var(--button-ink); border-color:transparent; }
.botInstallAction p { font-size:11px; text-align:center; }
.botCommandList span { border-radius:6px; background:var(--surface-muted); border:0; font-size:11px; }
.wrap,.accountShell { padding-top:40px; }
.playersHero,.townsHero,.nationsHero,.accountHero { gap:30px; padding-bottom:30px; }
.playersTitle,.townsTitle,.nationsTitle,.accountTitle { font-size:46px; letter-spacing:-.055em; font-weight:650; }
.playersCopy,.townsCopy,.nationsCopy,.accountCopy { font-size:15px; line-height:1.75; color:var(--muted); }
.playersSearchPanel,.townsSearchPanel,.nationsSearchPanel { border-radius:14px; box-shadow:none; background:var(--surface); padding:20px; }
.playersPanel,.townsPanel,.nationsPanel,.accountPanel,.profile { border-radius:16px; box-shadow:var(--shadow-sm); overflow:hidden; }
.playersPanelHeader,.townsPanelHeader,.nationsPanelHeader { padding:24px; }
.playerTableHead,.townTableHead,.nationTableHead { background:var(--surface-muted); color:var(--muted); font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
.playerItem,.townItem,.nationItem { transition:background .15s; }
.playerItem:hover,.townItem:hover,.nationItem:hover { background:var(--accent-soft); }
.segmentBtn { border-radius:7px; }
.accountShell { width:min(1120px,calc(100% - 40px)); }
.accountPanel { padding:24px; }
.accountPanel h2 { font-size:19px; margin-bottom:12px; }
.accountGrid { gap:20px; grid-template-columns:1fr 1fr; }
.accountSteps { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin:0 0 28px; padding:22px 0; border-block:1px solid var(--border); list-style:none; }
.accountSteps li { display:flex; gap:12px; align-items:start; }
.accountSteps b { display:grid; place-items:center; width:28px; height:28px; flex-shrink:0; background:var(--accent-soft); color:var(--accent-strong); border-radius:8px; font-size:12px; }
.accountSteps strong { display:block; font-size:13px; margin:1px 0 4px; }
.accountSteps span { font-size:12px; color:var(--muted); line-height:1.6; }
.accountLoginNotice { padding:14px 18px; border:1px solid var(--border-strong); background:var(--accent-soft); border-radius:10px; margin-bottom:24px; }
.accountLoginNotice:empty { display:none; }
.accountButton { min-height:42px; border-radius:8px; }
.accountGrid .flagManagement { grid-column:1 / -1; }
.territoryCard { padding:20px; background:var(--bg-soft); }
.siteFooter { margin-top:20px; background:var(--bg); }
.siteFooterInner { padding-block:30px; }
.siteFooter .footerTheme { display:none; }
@media (max-width:1100px) {
    .siteHeaderRow { gap:14px; }
    .logoImg { width:155px; }
    .navLinks a { padding-inline:9px; }
}
@media (max-width:900px) {
    .siteHeaderRow { min-height:68px; padding:12px 0; }
    .headerRight { width:auto; order:2; margin-left:auto; flex-wrap:nowrap; }
    .navToggle { order:3; }
    .navLinks { order:4; }
    .navLinks.open { width:100%; padding:8px; }
    .homeIntro { grid-template-columns:1fr; padding-top:24px; }
    .atlasIllustration { display:none; }
    .homeTitle { font-size:48px; }
    .homeCopy { max-width:530px; }
    .homePulseStat { padding-inline:14px; }
    .homePulseStat strong { font-size:25px; }
    .accountSteps { gap:14px; }
}
@media (max-width:600px) {
    .siteHeaderRow { gap:10px; width:calc(100% - 28px); }
    .logoImg { width:145px; }
    .headerRight { gap:7px; }
    .headerAccountLink { padding:0 10px; font-size:12px; }
    .themeControl { width:auto; }
    .themeButton,.siteHeader button.themeButton:not(.navToggle) { padding:0 6px; font-size:10px; }
    .headerRight .themeControl { display:none; }
    .siteFooter .themeControl { display:inline-grid; width:auto; margin-top:14px; }
    .homeIntro { padding:20px 0 30px; }
    .homeTitle { font-size:39px; }
    .homeCopy { font-size:14px; }
    .atlasSearch { gap:3px; }
    .atlasSearch select { width:87px; padding-inline:5px; font-size:12px; }
    .atlasSearch input { font-size:13px; }
    .atlasSearch button { padding:12px; font-size:12px; }
    .atlasSearch button span { display:none; }
    .homePulse { padding:20px; }
    .homePulseHeader { display:block; }
    .homePulseStatus { text-align:left; margin-top:10px; max-width:none; }
    .homePulseStats { grid-template-columns:repeat(2,1fr); gap:22px 0; }
    .homePulseStat { padding:0 14px; }
    .homePulseStat:nth-child(odd) { padding-left:0; }
    .homePulseStat:nth-child(even) { border-right:0; }
    .homeGrid { grid-template-columns:1fr; gap:12px; }
    .sectionCard { min-height:180px; padding:22px; }
    .sectionCardKicker { margin-bottom:14px; }
    .sectionCard p { max-width:none; }
    .botInstallPanel { padding:22px; grid-template-columns:1fr; }
    .playersTitle,.townsTitle,.nationsTitle,.accountTitle { font-size:36px; }
    .accountGrid,.accountSteps { grid-template-columns:1fr; }
    .accountPanel { padding:20px; }
    .accountGrid .flagManagement { grid-column:auto; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
