/* App controls and compact layouts. Exam chart artwork stays on white paper. */
.app-settings-trigger{display:grid;place-items:center;flex:0 0 36px;width:36px;height:38px;border:1px solid #c9d4f3;border-radius:8px;background:#fff;color:#202c45;cursor:pointer}
.app-settings-trigger svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round}
.app-settings-dialog{box-sizing:border-box;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 28px);margin:auto;padding:0;border:1px solid var(--fn-line);border-radius:14px;background:var(--fn-paper);color:var(--fn-ink);font:400 15px/1.7 var(--fn-sans);box-shadow:0 12px 55px #0005;overflow:hidden}
.app-settings-dialog::backdrop{background:#15253f99}.app-settings-dialog[open]{display:flex;flex-direction:column}
.app-settings-dialog>header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px 10px;gap:12px;flex-shrink:0}.app-settings-dialog h2{margin:0;font-size:22px}.app-settings-dialog small{font-size:12px;color:var(--fn-muted)}
.app-settings-dialog [data-close]{border:0;border-radius:8px;background:var(--fn-soft);color:var(--fn-ink);font-size:26px;width:38px;height:38px;cursor:pointer}
.app-settings-dialog>nav{display:flex;gap:6px;padding:0 20px 12px;border-bottom:1px solid var(--fn-line);flex-shrink:0}
.app-settings-dialog>nav button{flex:1;padding:8px 3px;min-height:40px;border:1px solid var(--fn-line);border-radius:8px;background:var(--fn-paper);color:var(--fn-ink);font:600 13px var(--fn-sans);cursor:pointer}
.app-settings-dialog>nav button[aria-pressed=true]{background:var(--fn-accent);color:white;border-color:var(--fn-accent)}
.app-settings-content{padding:18px 20px 22px;min-height:0;overflow:auto;overscroll-behavior:contain}.app-settings-content section[hidden]{display:none}
.app-settings-content :is(h3,h4){line-height:1.5;margin:20px 0 8px}.app-settings-content h3{font-size:18px;margin-top:0}.app-settings-content h4{font-size:15px}.app-settings-content p{font-size:14px;margin:8px 0 16px;overflow-wrap:anywhere}.app-settings-content li{margin:8px 0;font-size:14px}.app-settings-content ul{padding-left:20px}
.app-settings-content a,.app-info-page a{color:var(--fn-accent);text-decoration:underline;overflow-wrap:anywhere}.app-settings-content fieldset{border:0;padding:0;margin:0 0 18px}.app-settings-content legend{font-weight:600;margin-bottom:10px}
.theme-options{display:flex;gap:6px}.theme-options label{display:flex;align-items:center;justify-content:center;flex:1;gap:5px;font-size:13px;min-height:42px;border:1px solid var(--fn-line);border-radius:8px;background:var(--fn-bg)}
.theme-options input{accent-color:var(--fn-accent);margin:0}.app-settings-content fieldset p{font-size:12px;color:var(--fn-muted)}
.settings-install{width:100%;padding:10px;border:1px solid var(--fn-line);border-radius:8px;font:600 14px var(--fn-sans);background:var(--fn-soft);color:var(--fn-ink);cursor:pointer;margin-bottom:16px}.settings-install[hidden]{display:none}
.record-reset{border-top:1px solid var(--fn-line);padding-top:14px;margin-bottom:18px}.record-reset summary{cursor:pointer;min-height:32px;font-weight:600}.record-reset label{font-size:13px;display:flex;align-items:center;gap:8px}.record-reset [data-reset]{width:100%;margin-top:14px;padding:10px;border:1px solid #ab332c;border-radius:8px;color:#fff;background:#ab332c;font:600 14px var(--fn-sans);cursor:pointer}.record-reset [data-reset]:disabled{opacity:.45;cursor:not-allowed}#settings-status:empty{display:none}
.app-settings-trigger:focus-visible,.app-settings-dialog :is(button,a,input,summary):focus-visible{outline:3px solid #e96642;outline-offset:2px}
.app-info-page{max-width:760px;margin:20px auto;padding:24px;line-height:1.8;background:var(--fn-paper);color:var(--fn-ink);border:1px solid var(--fn-line);border-radius:12px}.app-info-page h1{font-size:25px}.app-info-page h3{font-size:19px}.app-info-page h4{margin-top:28px}.app-info-page p{overflow-wrap:anywhere}.app-info-page ul{padding-left:22px}
.mobile-city-photo{margin:10px 0}.mobile-city-photo>summary{display:none}.mobile-city-photo #city-visual{margin:0}
@media(max-width:1100px) and (min-width:701px){.fn-header{gap:8px;padding-inline:14px}.fn-nav{gap:3px}.fn-nav a{padding:7px 8px;gap:4px}.fn-nav a .fn-icon{width:20px;height:20px}.fn-brand{font-size:15px;gap:6px}.fn-brand img{width:32px;height:32px}.climate-install-button{padding-inline:7px}}
@media(max-width:700px){
 :root{--fn-header:56px;--app-bottom:calc(66px + env(safe-area-inset-bottom,0px))}
 .fn-header{height:56px;padding:8px 10px;gap:8px}.fn-header .climate-install-button{display:none}.fn-header .fn-scope{margin-left:auto}.fn-header .app-settings-trigger{width:34px;height:36px;flex-basis:34px}.fn-header .fn-brand img{width:29px;height:29px}
 .fieldnote-explorer .main-workspace{height:160px!important;min-height:160px!important;max-height:160px!important;margin:0!important}
 .fieldnote-explorer #map{height:160px!important;min-height:160px!important;max-height:160px!important}
 .fieldnote-explorer #detail-panel,.fieldnote-explorer.fn-has-detail #detail-panel{margin:0!important;border-radius:0!important;padding:12px 12px 16px!important;width:100%!important;box-sizing:border-box}
 .fieldnote-explorer .fn-detail-tools{padding-bottom:6px}.fieldnote-explorer #selected-city{font-size:22px!important;overflow-wrap:anywhere}.fieldnote-explorer .fn-detail-tabs{margin-top:8px;padding:2px;gap:2px}.fieldnote-explorer .fn-detail-tabs button{min-width:0;padding:8px 4px;font-size:12px}
 .mobile-city-photo{border:1px solid var(--fn-line);border-radius:8px;background:var(--fn-paper);margin:8px 0}.mobile-city-photo>summary{display:list-item;padding:9px 12px;cursor:pointer;font-size:12px;font-weight:600;min-height:36px;box-sizing:border-box}.mobile-city-photo:not([open])>#city-visual{display:none!important}.mobile-city-photo[open]>#city-visual{border:0!important;box-shadow:none;border-radius:0 0 8px 8px!important}
 .fieldnote-explorer #climate-summary{padding:7px 0}.fieldnote-explorer #climate-summary>div{padding:8px 6px}.fieldnote-explorer .fn-side-header{padding:12px!important}.fieldnote-explorer .fn-side-header h1{font-size:18px!important}
 .fieldnote-lab .lab-header{padding:10px 12px}.fieldnote-lab .lab-header h1{font-size:20px;margin:4px 0}.fieldnote-lab #scope-kicker{font-size:10px;margin:0}.fieldnote-lab .lab-layout{gap:10px;padding:10px}
 .fieldnote-lab .location-panel{padding:12px}.fieldnote-lab .location-panel h2{font-size:15px}.fieldnote-lab .selection-status{font-size:11px}.fieldnote-lab .selected-chips{gap:4px}.fn-lab-picker{margin-top:6px}.fn-lab-picker>summary{min-height:36px}
 .fieldnote-lab .result-panel{padding:12px}.fieldnote-lab .figure-toolbar{gap:6px;margin-top:6px}.fieldnote-lab .figure-toolbar label{font-size:12px;min-width:0}.fieldnote-lab .chart-card{padding:12px}.fieldnote-lab .chart-card h3{font-size:16px}.fieldnote-lab .chart-card>p{font-size:11px}
 .fn-game{padding:12px 12px 24px}.fn-game-head{padding:12px;margin-bottom:10px;gap:8px}.fn-game h1{font-size:23px;margin:4px 0}.fn-game-head small{display:none}.fn-game-head p{font-size:11px;margin:4px 0}.fn-game-setup{padding:16px;gap:14px}.fn-game-setup h2{font-size:20px}.fn-game-setup .fn-setting-help{margin:6px 0 12px}.fn-game-setup select{padding:10px}.fn-game-hud{padding:10px}.fn-game-stats strong{font-size:20px}.fn-score-rules{margin:6px 0 10px}
 .fn-bottom{padding-bottom:calc(9px + env(safe-area-inset-bottom,0px))}.fieldnote{padding-bottom:var(--app-bottom)}.fn-mobile-answer-dock{bottom:var(--app-bottom)}.fn-inverse-active{padding-bottom:calc(235px + env(safe-area-inset-bottom,0px))!important}
 .app-settings-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 24px);border-radius:12px}.app-settings-dialog>header{padding:12px 14px 8px}.app-settings-dialog>nav{padding:0 14px 10px}.app-settings-content{padding:14px}.app-info-page{margin:12px 10px;padding:16px}.app-info-page h1{font-size:22px}
}
/* Theme tokens are resolved before the app renders. Maps and exported charts retain source colors. */
:root[data-theme=dark]{color-scheme:dark;--fn-bg:#131c2b;--fn-paper:#1d293b;--fn-ink:#edf2f9;--fn-muted:#bec9d9;--fn-line:#43516a;--fn-accent:#8fb2ff;--fn-soft:#293c5a;--comic-yellow:#e2bd51;--comic-cyan:#294e61;--comic-mint:#2d514a;--fn-shadow:none}
[data-theme=dark] body.fieldnote{background-color:var(--fn-bg);background-image:none;color:var(--fn-ink)}
[data-theme=dark] .fn-header{background:#1d355e;border-color:#53627a}[data-theme=dark] .fn-header .fn-nav a{color:#edf2f9}[data-theme=dark] .fn-header .fn-nav a[aria-current=page]{background:#e2bd51;color:#19243c;border-color:#e2bd51}
[data-theme=dark] .fieldnote :is(.fn-bottom,.sidebar,#detail-panel,.fn-card,.fn-game-setup,.fn-game-setup form,.fn-game-hud,.fn-game-summary,.fn-history-card,.fn-recent-record,.location-panel,.result-panel,.fn-mobile-answer-dock,.climate-install-dialog){background:var(--fn-paper)!important;color:var(--fn-ink);border-color:var(--fn-line);box-shadow:none}
[data-theme=dark] .fieldnote :is(input,select,textarea,.fn-button,.fn-answer,.fn-game-progress,.fn-graph-tabs>button,.app-settings-trigger){background:var(--fn-paper);color:var(--fn-ink);border-color:var(--fn-line);box-shadow:none}
[data-theme=dark] .fn-bottom a{color:var(--fn-muted)}[data-theme=dark] .fn-bottom a[aria-current=page]{color:#18233a;background:#e2bd51}
[data-theme=dark] .fieldnote-explorer :is(.fn-side-header,.filter-panel,#city-list,#footer-panel,footer){background:var(--fn-paper)!important;color:var(--fn-ink)!important;border-color:var(--fn-line)!important}
[data-theme=dark] .fieldnote-explorer :is(.fn-side-header,.filter-panel,#city-list,#footer-panel,footer) :is(p,span,h1){color:inherit}
[data-theme=dark] .fieldnote-explorer #city-list>div{border-bottom-color:var(--fn-line)!important;color:var(--fn-ink)!important}[data-theme=dark] .fieldnote-explorer #city-list>.fn-city-selected{background:var(--fn-soft)!important}
[data-theme=dark] .fieldnote-explorer :is(#climate-traits-container>div,.fn-korea-traits,#content-natural,#content-human,#climate-summary>div,.world-summary-grid>div,#learning-panels section,.learning-row,.climate-story,#exam-region-detail){background:var(--fn-paper)!important;color:var(--fn-ink)!important;border-color:var(--fn-line)!important;box-shadow:none}
[data-theme=dark] .fieldnote-explorer :is(#climate-traits-container,#content-natural,#content-human,#learning-panels,.fn-korea-traits) :is(p,li,h3,h4,strong,span){color:var(--fn-ink)!important}
[data-theme=dark] .fieldnote-explorer :is(#city-photo-caption,#city-image-caption){background:var(--fn-paper);color:var(--fn-ink)}[data-theme=dark] .fn-photo-links a{color:var(--fn-accent)!important}
[data-theme=dark] .fieldnote-explorer .fn-detail-tabs{background:var(--fn-soft);border-color:var(--fn-line)}[data-theme=dark] .fn-detail-tabs button{color:var(--fn-ink)}[data-theme=dark] .fn-detail-tabs button[aria-selected=true]{background:#365f9e;color:white}
[data-theme=dark] .fn-game-head{background:#23416b;color:white;border-color:#526784;box-shadow:none}[data-theme=dark] .fn-game-head :is(h1,p,small){color:white}
[data-theme=dark] :is(.fn-climate-clue,.fn-comparison-head){background:var(--fn-soft)!important;color:var(--fn-ink)}[data-theme=dark] .fn-climate-clue :is(h2,p,li){color:var(--fn-ink)}
[data-theme=dark] .fn-game-stats>div{background:var(--fn-soft);color:var(--fn-ink);border-color:var(--fn-line)}[data-theme=dark] .fn-game-stats strong{color:var(--fn-ink)}
[data-theme=dark] :is(.fn-game-figure,.fn-graph-choice,.fn-graph-answer,.chart-card,.climograph-card,.world-climograph-card){background:#fff!important;color:#19243c!important}[data-theme=dark] :is(.fn-game-figure,.fn-graph-choice,.fn-graph-answer,.chart-card,.climograph-card,.world-climograph-card) :is(h3,p,.fn-game-label,.fn-choice-heading){color:#19243c!important}
[data-theme=dark] .app-settings-dialog>nav button[aria-pressed=true]{background:#345f9f;color:white}
[data-theme=dark] .exam-region-badge{background:#e6ca79;color:#19243c}[data-theme=dark] .exam-region-detail a{color:var(--fn-accent)}
[data-theme=dark] .fieldnote-home :is(.chapter,.hero-copy,.learning-guide,.status-panel,.notice-panel){background:var(--fn-paper);color:var(--fn-ink)}
.compact-location-picker>summary{display:none}
[data-theme=dark] .fn-scope{background:var(--fn-paper);border-color:var(--fn-line)}[data-theme=dark] .fn-scope a{color:var(--fn-ink)!important}[data-theme=dark] .fn-scope a[aria-current=page]{background:#e2bd51;color:#19243c!important}
[data-theme=dark] .fieldnote-explorer #k-symbol{color:#19243c!important}
@media(max-width:700px){
 .fn-header .climate-install-button:not([hidden])+.fn-scope{margin-left:auto}
 .compact-location-picker>summary{display:list-item;cursor:pointer;font-size:13px;font-weight:600;padding:2px 0;min-height:32px;line-height:32px}
 .compact-location-picker[open]>summary{margin-bottom:10px}.compact-location-picker .fn-lab-picker>summary{display:none}
 .compact-location-picker:not([open])>:not(summary){display:none!important}
 .fieldnote-lab .results-panel{padding:0;min-width:0}
}
[data-theme=dark] .fieldnote-lab :is(.anonymous-label,.figure-title-field label,.field-label,.selection-status,.selected-locations){color:var(--fn-ink)!important}
[data-theme=dark] .fieldnote-lab :is(.period-caution,.location-button,.location-item,.selected-locations button){background:var(--fn-soft)!important;color:var(--fn-ink)!important;border-color:var(--fn-line)!important}
[data-theme=dark] .fn-mobile-answer-dock button{background:var(--fn-soft);color:var(--fn-ink);border-color:var(--fn-line)}
[data-theme=dark] .fn-mobile-answer-dock button[aria-pressed=true]{background:#e2bd51;color:#19243c;border-color:#e2bd51}
[data-theme=dark] .fn-mobile-answer-dock .fn-game-submit:not(:disabled){background:#bd4639;color:white;border-color:#bd4639}
[data-theme=dark] .fn-dock-heading>strong{color:#ffbca8}
[data-theme=dark] .fn-mode-tag{background:var(--fn-soft);color:var(--fn-ink);border-color:var(--fn-line)}
[data-theme=dark] .fn-graph-answer .fn-choice-heading{color:#19243c!important}
.game-generation-help{font-size:12px;line-height:1.6;margin:8px 0}.game-generation-help summary{cursor:pointer;color:var(--fn-muted)}
@media(max-width:700px){
 .fn-game-head{padding:10px 12px}.fn-game-head p{display:none}.fn-game-head .fn-game-progress{margin:0;align-self:center}.fn-game-head{display:flex;flex-direction:row}.fn-game-head h1{font-size:22px;margin:0}
 .fn-game-setup{padding:12px;gap:10px}.fn-game-setup>div>.fn-mode-tag{display:none}.fn-game-setup h2{margin:0;font-size:18px}.fn-game-setup form{padding:12px}.fn-game-setup label{font-size:12px;margin-bottom:5px}.fn-game-setup select{min-height:40px;padding:8px}.fn-game-setup .fn-setting-help{font-size:11px;line-height:1.5;margin:5px 0 12px}.fn-game-setup .fn-record-note{font-size:11px;line-height:1.5}
 .fn-inverse-question .fn-graph-answer svg{max-height:var(--game-preview-height,clamp(160px,calc(100dvh - 540px),300px))}
 .fn-inverse-overview .fn-graph-answer svg{max-height:var(--game-overview-height,clamp(100px,calc((100dvh - 450px)/2),180px))}
}
@media(max-width:700px) and (max-height:650px){
 .fn-comparison-head{position:static}.fn-comparison-head .fn-climate-clue{max-height:none}.fn-mobile-answer-dock{position:static;margin-top:12px}.fn-inverse-active{padding-bottom:var(--app-bottom)!important}.fn-inverse-question .fn-graph-answer svg{max-height:250px}
 .app-settings-dialog{max-height:calc(100dvh - 16px)}.app-settings-dialog>header{padding-top:8px}.app-settings-dialog>nav{padding-bottom:8px}
}
[data-theme=dark] .fieldnote-explorer #exam-freq{color:#ffe09a!important}
[data-theme=dark] .fieldnote-home .analysis-card:nth-child(2){background:var(--fn-paper)}
[data-theme=dark] .fieldnote-home :is(.eyebrow,.scope-badge){color:#19243c;border-color:#e2bd51}
[data-theme=dark] .fieldnote-home .chapter-actions a:not(.primary-action){background:var(--fn-soft);color:var(--fn-ink);border-color:var(--fn-line);box-shadow:none}
[data-theme=dark] .fieldnote-home .factor-list li{background:var(--fn-soft);color:var(--fn-ink)}
[data-theme=dark] .fn-game-invite{background:var(--fn-soft);border-color:var(--fn-line)}[data-theme=dark] .fn-game-invite :is(h2,p){color:var(--fn-ink)}
[data-theme=dark] .fn-type-results{background:var(--fn-soft);color:var(--fn-ink)}
@media(max-width:700px){.fieldnote-home main{padding:12px 12px 20px}.fieldnote-home .intro{padding:8px 0 16px}.fieldnote-home .intro h1{font-size:28px;line-height:1.35;word-break:keep-all}.fieldnote-home .intro .eyebrow{display:inline-block;margin:0 0 8px;font-size:10px}.fieldnote-home .intro-copy{margin:8px 0 0}.fieldnote-home .analysis-card{padding:16px}.fieldnote-home .analysis-card h2{font-size:21px;margin:12px 0 8px}.fieldnote-home .analysis-card>p{font-size:12px;line-height:1.7}.fieldnote-home .chapter-actions{margin-top:12px}.fieldnote-home .factor-list{margin:10px 0}}
[data-theme=dark] .fn-graph-choices{--comic-cyan:#92e1e6;--comic-mint:#ccebc9}
[data-theme=dark] .fn-game-stats small{color:var(--fn-muted)}
[data-theme=dark] .fn-game-values{color:#34415b}

/* Keep explorer controls and the city title readable on narrow screens. */
.fieldnote-explorer #close-btn { color: #25364b !important; }
[data-theme=dark] .fieldnote-explorer :is(.exam-scope-note,.exam-coverage) { color: var(--fn-muted); }
@media (max-width:700px) {
    .fieldnote-explorer #reset-btn { flex-shrink: 0; white-space: nowrap; padding: 5px 9px !important; }
    .fieldnote-explorer .detail-panel-header {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px 10px;
        margin-bottom: 8px;
    }
    .fieldnote-explorer .detail-panel-header #selected-city { flex: 1 1 145px; min-width: 0; line-height: 1.25; }
    .fieldnote-explorer .detail-panel-header #close-btn { min-width: 0; min-height: 40px; margin: 0; white-space: nowrap; }
    .fieldnote-explorer .fn-detail-tools { padding-bottom: 4px; }
    .fieldnote-explorer .exam-quick-controls { margin: 5px 0; }
}

/* Explorer controls share the same baseline in both color modes. */
.fieldnote-explorer .region-search-field {
    position: relative;
    min-width: 0;
}
.fieldnote-explorer #search-input {
    display: block;
    min-height: 44px !important;
    padding: 0 12px 0 36px;
    line-height: 1.4;
}
.fieldnote-explorer .region-search-icon {
    position: absolute;
    inset: 50% auto auto 12px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--fn-muted);
    pointer-events: none;
}
.fieldnote-explorer #search-input:focus-visible {
    outline: 2px solid var(--fn-accent);
    outline-offset: 1px;
}
.fieldnote-explorer :is(#reset-btn,#close-btn) .fn-icon {
    flex: none;
    stroke: currentColor;
}
.fieldnote-explorer #reset-btn {
    min-height: 40px !important;
    color: var(--fn-ink) !important;
}
.fieldnote-explorer #mobile-filter-toggle {
    min-height: 44px;
    background: var(--fn-bg);
    color: var(--fn-ink);
    border-color: var(--fn-line);
}
.fieldnote-explorer #city-list > .city-card {
    display: block;
    width: 100%;
    padding: 9px 10px !important;
    text-align: start;
    box-shadow: none;
}
.fieldnote-explorer .station-card-head,
.fieldnote-explorer .station-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 8px;
}
.fieldnote-explorer .station-card-name {
    min-width: 0;
    color: var(--fn-ink);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.fieldnote-explorer .station-card-badges {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}
.fieldnote-explorer .station-card-meta {
    margin-top: 4px;
    color: var(--fn-muted);
    font-size: 10px;
}
.fieldnote-explorer .station-card-meta > :last-child { white-space: nowrap; }
.fieldnote-explorer .location-legend { color: var(--fn-muted); }

@media (max-width:700px) {
    .fieldnote-explorer .sidebar,
    .fieldnote-explorer .sidebar.detail-open {
        border-width: 1px 0 0;
        border-radius: 0;
        box-shadow: none;
    }
    .fieldnote-explorer .filter-panel { padding: 8px 12px 10px !important; }
    .fieldnote-explorer .sidebar #city-list { padding: 6px 12px 10px; }
    .fieldnote-explorer .sidebar :is(footer,#footer-panel) {
        padding: 6px 12px !important;
    }
    .fieldnote-explorer .fn-detail-tabs button { white-space: nowrap; }
    .fieldnote-explorer #climate-summary > div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
}

/* Keep the essential progress visible while the mobile question scrolls. */
.fn-game-mobile-status { display: none; }
@media (max-width:700px) {
    body.fieldnote-game { min-width: 0; }
    .fn-question-active { --game-status-height: 42px; }
    .fn-question-active .fn-game-mobile-status:not([hidden]) {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: var(--game-status-height);
        padding: 0 10px;
        border: 1px solid var(--fn-line);
        border-radius: 8px;
        background: var(--fn-paper);
        color: var(--fn-ink);
        font-size: 12px;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    .fn-game-mobile-status strong { color: var(--fn-accent); }
    .fn-game-mobile-status span:last-child { color: var(--fn-muted); }
    .fn-question-active :is(#game-stage,.fn-inverse-question) {
        scroll-margin-top: var(--game-status-height);
    }
    .fn-question-active .fn-comparison-head { top: var(--game-status-height); }
    .fn-question-active .fn-feedback { scroll-margin-top: calc(var(--game-status-height) + 8px); }
}

.settings-game-sound { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.fn-game-xp-profile {
    margin: 10px 0 14px;
    padding: 12px;
    border: 1px solid var(--fn-line);
    border-radius: 8px;
    background: var(--fn-paper);
}
.fn-xp-overview { display: flex; align-items: center; gap: 10px; }
.fn-xp-overview p { margin: 0; font-size: 12px; color: var(--fn-muted); }
.fn-xp-badge {
    display: grid;
    flex: 0 0 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: var(--fn-soft);
    font-size: 21px;
}
.fn-game-xp-profile summary { margin-top: 8px; cursor: pointer; font-size: 12px; color: var(--fn-accent); }
.fn-game-xp-profile details p { margin: 6px 0; font-size: 12px; }
.fn-game-xp-profile ol { list-style: none; max-height: 280px; overflow: auto; padding: 0; }
.fn-game-xp-profile li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-block: 3px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
}
.fn-xp-level-meta { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.fn-xp-level-state { padding: 0 6px; border-radius: 4px; font-weight: 700; }
.fn-game-xp-profile li[data-badge-state="earned"] { background: var(--fn-soft); }
.fn-game-xp-profile li[data-badge-state="earned"] .fn-xp-level-state { color: var(--fn-accent); }
.fn-game-xp-profile li[data-badge-state="current"] { border-color: var(--fn-accent); background: var(--fn-soft); font-weight: 700; }
.fn-game-xp-profile li[data-badge-state="current"] .fn-xp-level-state { color: #352400; background: #ffde76; }
.fn-game-xp-profile li[data-badge-state="locked"] { color: var(--fn-muted); }
.fn-game-xp-profile li[data-badge-state="locked"] .fn-xp-level-state { border: 1px solid var(--fn-line); }
.fn-xp-mobile-badge { font-weight: 700; white-space: nowrap; }
.fn-game-status-line { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; }
.fn-game-mobile-status.is-promoted .fn-xp-announcement {
    color: #352400;
    background: #ffde76;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
}
.fn-game-mobile-status .fn-xp-announcement span { color: inherit; }
@keyframes fn-badge-shine {
    0%, 100% { transform: scale(1); }
    42% { transform: scale(1.09); box-shadow: 0 0 11px #f5ba4dcc; }
}
@media (prefers-reduced-motion: no-preference) {
    .fn-game-xp-profile.is-promoted .fn-xp-badge,
    .fn-game-mobile-status.is-promoted .fn-xp-announcement { animation: fn-badge-shine 850ms ease-out; }
}
@media (max-width:700px) {
    .fn-question-active .fn-game-xp-profile { display: none; }
    .fn-question-active .fn-game-mobile-status:not([hidden]) { gap: 5px; font-size: 11px; }
    .fn-question-active:has(.fn-game-mobile-status.is-promoted) { --game-status-height: 72px; }
    .fn-question-active .fn-game-mobile-status.is-promoted:not([hidden]) {
        flex-direction: column;
        justify-content: center;
    }
    .fn-game-mobile-status.is-promoted .fn-xp-announcement { align-self: stretch; }

}
@media (min-width:701px) {
    .fn-question-active .fn-game-mobile-status.is-promoted:not([hidden]) {
        position: fixed;
        z-index: 6100;
        top: 12px;
        right: 16px;
        display: flex;
        align-items: center;
        flex-direction: column;
        gap: 5px;
        padding: 7px 10px;
        border: 1px solid var(--fn-line);
        border-radius: 8px;
        color: var(--fn-ink);
        background: var(--fn-paper);
        font-size: 13px;
    }
}

/* First comparison and the provenance of the displayed series. */
.fn-first-invite,.fn-first-activity,.fn-activity-evidence,.fn-comparison-sources,.fn-next-practice {
    background:var(--fn-paper);color:var(--fn-ink);border:1px solid var(--fn-line);border-radius:12px;
}
.fn-first-invite {
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    width:min(calc(100% - 28px),1320px);margin:10px auto;padding:10px 14px;border-left:4px solid var(--fn-accent);
}
.fieldnote-home .fn-first-invite {width:100%;margin:0 0 18px}
.fn-first-invite :is(small,strong),.fn-first-activity small {display:block}
.fn-first-invite small,.fn-first-activity small {font-size:12px;color:var(--fn-muted)}
.fn-first-invite strong {font-size:16px;line-height:1.4}
.fn-first-invite .fn-button {flex:none;min-height:40px;font-size:13px}
.fn-first-activity {width:min(calc(100% - 28px),1380px);margin:12px auto;padding:16px 18px;border-left:4px solid var(--fn-accent)}
.fn-first-activity h2 {font-size:clamp(21px,4vw,27px);margin:3px 0 6px}
.fn-first-activity p,.fn-activity-evidence p {font-size:14px;line-height:1.6;margin:6px 0}
.fn-activity-links {display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}
.fn-activity-links .fn-button {min-height:38px;font-size:12px}
.fn-chart-with-sources {display:grid;gap:12px;min-width:0}
.fn-chart-visual,.fn-comparison-sources {min-width:0}
.fn-comparison-sources {align-self:start;padding:10px 12px}
.fn-comparison-sources h4,.fn-activity-evidence h4 {margin:0 0 6px;font-size:14px}
.fn-comparison-sources ul {list-style:none;margin:0;padding:0;display:grid;gap:5px}
.fn-comparison-sources li {display:grid;gap:2px;padding-top:5px;border-top:1px solid var(--fn-line);overflow-wrap:anywhere}
.fn-comparison-sources li strong {font-size:12px}
.fn-comparison-sources li span,.fn-comparison-sources p {font-size:12px;line-height:1.55}
.fn-comparison-sources a {color:var(--fn-accent);text-decoration:underline}
.fn-comparison-sources .fn-source-warning {color:var(--fn-ink);background:var(--fn-soft);padding:2px 4px}
.fn-activity-evidence {margin:12px 0;padding:12px}
.fn-activity-evidence label {display:block;font-size:13px;font-weight:600;margin:10px 0 5px}
.fn-activity-evidence textarea {display:block;width:100%;box-sizing:border-box;padding:8px;color:var(--fn-ink);background:var(--fn-bg);border:1px solid var(--fn-line);border-radius:7px;font:inherit}
.fn-activity-evidence summary {cursor:pointer;font-size:13px;text-decoration:underline}
.fn-activity-evidence [aria-pressed=true] {outline:2px solid var(--fn-accent);outline-offset:1px}
.fn-activity-evidence [role=status]:empty {display:none}
#chart-title {scroll-margin-top:16px}
@media(min-width:1100px){.fn-chart-with-sources {grid-template-columns:minmax(0,1fr) minmax(155px,23%)}}
@media(max-width:700px){
    .fn-first-invite {padding:9px 10px}
    .fn-first-invite strong {font-size:14px}
    .fn-first-invite small {font-size:11px}
    body.fn-first-comparison-active .lab-layout {display:flex;flex-direction:column}
    body.fn-first-comparison-active .results-panel {order:-1}
    .fn-comparison-sources li {grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);align-items:baseline;gap:6px}
    .fn-first-activity .fn-button {min-height:44px}
}
.fn-comparison-target strong {margin-right:.35em}
.fn-comparison-help {font-size:12px;color:var(--fn-muted);margin:8px 0}
.fn-next-practice {padding:12px;text-align:left;margin:12px auto;max-width:540px}
.fn-next-practice h3 {margin:0;font-size:15px}
.fn-next-practice p {font-size:13px;margin:6px 0}
.fn-next-practice .fn-button {min-height:40px;font-size:13px}
@media(max-width:700px){
    .fn-statement-active .fn-statement-choices {display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
    .fn-statement-active .fn-statement-choices .fn-answer {font-size:13px;min-height:44px}
    .fn-statement-active .fn-mobile-answer-dock.fn-short-dock {padding-block:8px}
    .fn-statement-active .fn-game-actions .fn-feedback {scroll-margin-bottom:155px}
    .fn-statement-question .fn-comparison-head .fn-comparison-target {display:block;margin:0;font-size:12px;line-height:1.5}
    .fn-statement-question .fn-comparison-head .fn-climate-clue h2 {margin-bottom:4px}
    .fn-statement-question.fn-two-graphs.fn-inverse-overview .fn-graph-answer svg {height:auto;max-height:220px}
}
@media(max-width:700px) and (min-height:651px){
    body.fn-statement-active {padding-bottom:calc(var(--app-bottom) + 72px)!important}
}
.fn-candidate-reference {margin-top:8px;padding:8px;border:1px solid var(--fn-line);border-radius:7px;background:var(--fn-paper);color:var(--fn-ink)}
.fn-candidate-reference p {margin:4px 0}
.fn-candidate-reference a {display:block;color:var(--fn-accent);text-decoration:underline;margin-top:5px;overflow-wrap:anywhere}
.fn-station-crosscheck {display:inline-block}
.fieldnote-lab .chart-card .fn-activity-evidence :is(p,label,summary),
.fieldnote-lab .chart-card .fn-comparison-sources p {color:var(--fn-ink)!important}
@media(max-width:700px){
    .fn-chart-with-sources {display:flex;flex-direction:column}
    .fn-comparison-sources:not([hidden]) {order:-1;align-self:stretch}
}
.fn-source-diff {
    width: 100%;
    table-layout: fixed;
    margin-top: 8px;
    border-collapse: collapse;
    color: var(--fn-ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.fn-source-diff caption { text-align: left; margin-bottom: 4px; }
.fn-source-diff :is(th, td) { padding: 5px 3px; border-bottom: 1px solid var(--fn-line); text-align: right; }
.fn-source-diff th:first-child { width: 3.2em; text-align: left; }
.fn-source-diff td small { display: block; color: var(--fn-muted); }

/* Laboratory controls follow the shared app palette in both screen modes. */
.fieldnote-lab :is(.panel-heading button,.figure-toolbar button,.graph-type-field select){background:var(--fn-paper);color:var(--fn-ink);border:1px solid var(--fn-line);border-radius:8px;font:inherit;font-size:13px;min-height:42px}
.fieldnote-lab :is(.field-label,.graph-type-field label,.anonymous-label,.figure-title-field label){color:var(--fn-ink)}
.fieldnote-lab :is(.panel-help,.step-label,.selection-status,.metric-heading>p,.method-note>div,.export-status,.figure-title-field p){color:var(--fn-muted)}
.fieldnote-lab .location-option{border:1px solid transparent;border-radius:8px}
.fieldnote-lab .location-option[aria-pressed=true]{background:var(--fn-soft);border-color:var(--fn-accent);box-shadow:none}
.fieldnote-lab .location-option .check{border-color:var(--fn-line)}
.fieldnote-lab .location-option[aria-pressed=true] .check{background:var(--fn-accent);color:var(--fn-paper)}
.fieldnote-lab .selected-chip{background:var(--fn-soft);color:var(--fn-ink);border-color:var(--fn-accent);border-radius:6px;min-height:34px}
.fieldnote-lab .metric-table-wrap{background:var(--fn-paper);color:var(--fn-ink);border-color:var(--fn-line);border-radius:10px}
.fieldnote-lab .metric-table-wrap table{font-size:12px;line-height:1.6}
.fieldnote-lab .metric-table-wrap caption{color:var(--fn-ink);background:var(--fn-paper);padding:12px 14px}
.fieldnote-lab .metric-table-wrap th{background:var(--fn-soft);color:var(--fn-ink);padding:10px 12px}
.fieldnote-lab .metric-table-wrap td{background:var(--fn-paper);color:var(--fn-ink);border-color:var(--fn-line);padding:10px 12px}
.fieldnote-lab .metric-table-wrap tr:hover td{background:var(--fn-soft)}
.fieldnote-lab .method-note{color:var(--fn-ink);border-color:var(--fn-line)}
.fieldnote-lab :is(.compact-location-picker,.fn-lab-picker)>summary{color:var(--fn-ink)}
.fieldnote-lab .alias-key{color:var(--fn-ink);border-color:var(--fn-line)}
.fieldnote-lab .chart-card .figure-values{color:#19243c}
.fieldnote-lab .chart-card .figure-values :is(caption,td,th,summary){color:#19243c}
.fieldnote-lab :is(button,select,input,textarea,summary):focus-visible{outline:3px solid var(--fn-accent);outline-offset:3px}
/* A loaded city photo and its unavailable-photo notice are mutually exclusive. */
.fieldnote-explorer :is(#city-image-fallback,#city-photo-fallback).hidden{display:none!important}
