/* Shared MapKAI foundation. Page layouts and meaningful visualization colors stay local. */
:root, html body[data-mapkai-page] {
  --ink:#0f172a; --muted:#64748b; --muted-soft:#8290a2;
  --paper:#fffdf8; --surface:#fff; --surface-soft:#f1f5f9; --line:#e2e7ed;
  --blue:#2563eb; --blue-dark:#1d4ed8; --green:var(--blue); --green-dark:var(--ink);
  --ocean:var(--blue); --violet:#6366f1; --purple:#8b5cf6; --coral:#6366f1; --cyan:#38bdf8; --rust:var(--muted);
  --shadow:0 8px 24px #0f172a08;
  --site-font:-apple-system,BlinkMacSystemFont,"SF Pro Display","Inter","Segoe UI","PingFang SC",sans-serif;
}
html body[data-theme="dark"] {
  --ink:#e8eef7; --muted:#a7b5c8; --muted-soft:#8b9bb2;
  --paper:#101722; --surface:#172130; --surface-soft:#1e2b3c; --line:#334155;
  --blue:#8bb8ff; --blue-dark:#b6d2ff; --green:var(--blue); --green-dark:var(--ink);
  --ocean:var(--blue); --violet:#a5b4fc; --purple:#c4b5fd; --coral:#a5b4fc; --cyan:#7dd3fc; --rust:var(--muted);
  --shadow:0 8px 24px #0002; color-scheme:dark;
}
html body[data-mapkai-page] { background:var(--paper); color:var(--ink); font-family:var(--site-font); font-size:16px; line-height:1.6; }
html body[data-theme="light"] {color-scheme:light}
html body[data-mapkai-page]::before,html body[data-mapkai-page] .home-minimal::before,html body[data-mapkai-page] .home-minimal::after{display:none}
html body[data-mapkai-page] .page {background:var(--paper);color:var(--ink);font-family:var(--site-font)}
html body[data-mapkai-page] :is(h1,h2,h3,h4){color:var(--ink);font-family:var(--site-font);font-weight:650;letter-spacing:-.025em}
html body[data-mapkai-page] .eyebrow {color:var(--muted);font-size:12px;letter-spacing:.1em;font-weight:600}
html body[data-mapkai-page] :is(a,button,input,textarea,select):focus-visible{outline:2px solid var(--blue);outline-offset:3px}
html body[data-mapkai-page] :is(.button,.pdc-page .button,.pdc-entry-page .button){border-radius:8px;min-height:44px;padding:10px 18px;font-weight:600;box-shadow:none;transition:background .15s,border-color .15s}
html body[data-mapkai-page] :is(.button.primary,.pdc-page .button.primary,.pdc-entry-page .button.primary){border:1px solid #2563eb;background:#2563eb;color:#fff;box-shadow:none}
html body[data-mapkai-page] :is(.button.primary,.pdc-page .button.primary,.pdc-entry-page .button.primary):hover{background:#1d4ed8;border-color:#1d4ed8;box-shadow:none;transform:none}
html body[data-mapkai-page] :is(.button.secondary,.pdc-page .button.secondary,.pdc-entry-page .button.secondary){border:1px solid var(--line);background:var(--surface);color:var(--ink);box-shadow:none}
html body[data-mapkai-page] :is(.button.secondary,.pdc-page .button.secondary,.pdc-entry-page .button.secondary):hover{background:var(--surface-soft);transform:none}
html body[data-mapkai-page] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select){background:var(--surface);color:var(--ink);border-color:var(--line);font-family:var(--site-font);border-radius:8px}
html body[data-mapkai-page] :is(.panel,.module-card,.category-card,.category-button,.passport-panel,.tree-panel,.preview-band,.quick-mirror-card,.challenge-card,.reflection-panel,.reflection-summary-card,.deep-prompt-panel,.story-card,.field-card,.mission-card,.area-card,.legal-block,.pdc-entry-hero,.pdc-entry-demo,.pdc-access-card,.pdc-card,.pdc-result,.pdc-feedback,.pdc-council-room,.pdc-roster-panel,.pdc-dialogue-panel,.pdc-advanced-audit,.finance-course-hero,.finance-day-hero,.finance-completion-card,.finance-outline-card,.finance-course-nav,.finance-media-panel,.finance-concept-card,.finance-practical-example,.finance-knowledge-check){background:var(--surface);border-color:var(--line);border-radius:12px;box-shadow:none}
html body[data-mapkai-page] :is(.home-minimal,.stories-hero){background:transparent;box-shadow:none;border:0}
html body[data-mapkai-page] .home-minimal{min-height:440px;padding-block:60px}
html body[data-mapkai-page] :is(.hero-copy,.hero-microcopy,.about-product-promise,.footer-product-promise,.finance-course-subtitle){color:var(--muted)}
html body[data-mapkai-page] .home-page .hero-microcopy{color:var(--muted)!important;font-weight:500}
html body[data-mapkai-page] .speaking-recommendation{background:var(--surface);border-color:var(--line);border-radius:12px}
html body[data-mapkai-page] .speaking-recommendation .recommend-orb{box-shadow:none}
html body[data-mapkai-page] .site-footer{border-color:var(--line);background:transparent;color:var(--muted)}
html body[data-mapkai-page] :is(.content-label,.transparency-notice,.interaction-disclosure){background:var(--surface-soft);border-color:var(--line);color:var(--muted)}
/* One header, including the independently built tools. */
html body[data-mapkai-page] .topbar{position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:74px;padding:14px clamp(20px,5vw,64px);background:var(--surface);border-bottom:1px solid var(--line);box-shadow:none;backdrop-filter:none}
html body[data-mapkai-page] .topbar .brand{display:flex;flex:0 0 auto}
html body[data-mapkai-page] .topbar .brand img{display:block;width:140px;height:auto;max-width:none;object-fit:contain}
html body[data-theme="dark"] .topbar .brand img{filter:brightness(0) invert(1);opacity:.92}
html body[data-mapkai-page] .topbar .nav-panel{display:flex;align-items:center;justify-content:flex-end;gap:24px;flex:1}
html body[data-mapkai-page] .topbar .nav-links{display:flex;align-items:center;gap:22px;margin:0;font-size:13px;font-weight:550}
html body[data-mapkai-page] .topbar .nav-links>a,html body[data-mapkai-page] .nav-learning-trigger{display:block;padding:8px 0;color:var(--muted);white-space:nowrap;border-radius:0;background:none;text-decoration:none}
html body[data-mapkai-page] .topbar .nav-links a:is(:hover,.is-current,[aria-current=page]){color:var(--blue);background-image:none;box-shadow:none}
html body[data-mapkai-page] .nav-preferences{display:flex;align-items:center;gap:18px;flex:0 0 auto}
html body[data-mapkai-page] :is(.language-switch,.theme-switch){display:flex;align-items:center;gap:8px;margin:0;border:0;background:none;color:var(--muted);font-size:12px;white-space:nowrap}
html body[data-mapkai-page] :is(.language-switch,.theme-switch) :is(button,a){display:inline-flex;align-items:center;min-height:36px;border:0;background:none;padding:5px 0;font:inherit;color:var(--muted);border-radius:0;cursor:pointer}
html body[data-mapkai-page] :is(.language-switch,.theme-switch) :is([aria-pressed=true],[aria-current]){color:var(--blue);font-weight:650}
html body[data-mapkai-page] .nav-toggle{display:none;width:42px;min-height:42px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);cursor:pointer}
html body[data-mapkai-page] .nav-toggle span{display:block;height:2px;width:20px;background:currentColor;margin:4px 0;transition:transform .15s,opacity .15s}
html body[data-mapkai-page] .nav-toggle[aria-expanded=true] span:nth-child(1){transform:translateY(6px) rotate(45deg)}
html body[data-mapkai-page] .nav-toggle[aria-expanded=true] span:nth-child(2){opacity:0}
html body[data-mapkai-page] .nav-toggle[aria-expanded=true] span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
html body[data-mapkai-page] .nav-learning-menu{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow)}
/* Map chrome shares the site; cartography retains its geographic palette. */
html body[data-mapkai-page] #map{--atlas-paper:var(--paper);--atlas-panel:var(--surface);--atlas-ink:var(--ink);--atlas-muted:var(--muted);--atlas-line:var(--line);background:var(--paper)}
html body[data-mapkai-page] #map .intro-copy h1{font-family:var(--site-font);font-size:clamp(34px,4vw,54px);font-weight:650;color:var(--ink)}
html body[data-mapkai-page] #map .intro-copy p:not(.eyebrow){font-size:15px;color:var(--muted)}
html body[data-mapkai-page] :is(.atlas-directory-heading h2,#map .map-focus-name){font-family:var(--site-font);font-weight:600;color:var(--ink)}
html body[data-mapkai-page] #map :is(.hero-actions .primary,.map-focus-open){background:#2563eb;border-color:#2563eb;border-radius:8px;color:#fff;box-shadow:none}
html body[data-mapkai-page] #map .hero-actions .primary::after{content:none}
html body[data-mapkai-page] #map .hero-actions .secondary{color:var(--muted)}
html body[data-mapkai-page] #map .map-stage{border-radius:12px;box-shadow:none}
html body[data-mapkai-page] #map :is(.map-control,.map-preview){min-height:36px}
html body[data-mapkai-page] #map :is(button,a):focus-visible{outline-color:var(--blue)}
html body[data-mapkai-page] .atlas-fields button{border-radius:8px;font-size:12px}
html body[data-mapkai-page] .atlas-fields button:is(:hover,[aria-pressed=true]){background:var(--surface-soft);border-color:var(--blue)}
/* PDC and retained course URLs share surfaces and controls without changing access. */
html body[data-mapkai-page] :is(.pdc-entry-page,.pdc-page){--pdc-ink:var(--ink);--pdc-muted:var(--muted);--pdc-blue:var(--blue);--pdc-blue-dark:var(--blue-dark);--pdc-border:var(--line);--pdc-shadow:none;--pdc-card:var(--surface);--pdc-card-strong:var(--surface-soft)}
html body[data-mapkai-page] .pdc-entry-page .pdc-entry-demo article,html body[data-mapkai-page] .pdc-page :is(.pdc-mode-option,.pdc-table-topic,.pdc-dialogue-board li,.pdc-phase-guidance,.pdc-vote-snapshot,.pdc-recap-section,.pdc-radio-group label){background:var(--surface);border-color:var(--line);box-shadow:none;color:var(--ink)}
html body[data-mapkai-page] .finance-course-final{background:var(--surface-soft);border:1px solid var(--line);color:var(--ink)}
html body[data-mapkai-page] :is(.finance-story-content p,.finance-knowledge-chain p,.finance-framework div){color:var(--ink)}
html body[data-mapkai-page] .finance-framework div{background:var(--surface-soft)}
html body[data-mapkai-page] :is(.finance-audience-grid article,.finance-method-grid li,.finance-video-grid article){background:var(--surface);border-color:var(--line);box-shadow:none}
html body[data-mapkai-page] .finance-decision-question{background:var(--surface-soft);border-left-color:var(--blue)}
/* Toolbox uses the same tokens in both themes. */
html body[data-mapkai-page=toolbox] :is(.tool-card,dialog){background:var(--surface);border-color:var(--line);color:var(--ink)}
html body[data-mapkai-page=toolbox] .tool-card.featured{border-top-color:var(--blue)}
html body[data-mapkai-page=toolbox] .add-card{background:transparent}
html body[data-mapkai-page=toolbox] :is(.tool-description,.card-label,.card-bottom,.form-hint,.muted,.collection-note,footer){color:var(--muted);border-color:var(--line)}
html body[data-mapkai-page=toolbox] .favorite.selected,html body[data-mapkai-page=toolbox] .tool-icon{color:var(--blue)}
html body[data-mapkai-page=toolbox] .filters button{color:var(--muted)}
html body[data-mapkai-page=toolbox] .filters button[aria-pressed=true]{color:var(--blue);border-bottom-color:var(--blue)}
html body[data-mapkai-page=toolbox] .card-actions button{color:var(--muted)}
@media(max-width:1060px){
 html body[data-mapkai-page] .topbar{flex-wrap:wrap;gap:0;align-items:center}
 html body[data-mapkai-page] .topbar .nav-toggle{display:block;margin-left:auto}
 html body[data-mapkai-page] .topbar .nav-panel{display:none;position:static;flex-basis:100%;width:100%;padding:18px 0 4px;margin-top:12px;border:0;border-top:1px solid var(--line);border-radius:0;background:var(--surface);box-shadow:none}
 html body[data-mapkai-page] .topbar .nav-panel.is-open{display:flex;align-items:stretch;flex-direction:column;gap:18px}
 html body[data-mapkai-page] .topbar .nav-links{display:grid;grid-template-columns:1fr 1fr;gap:6px 20px;width:100%;align-items:start}
 html body[data-mapkai-page] .topbar .nav-links>a,html body[data-mapkai-page] .nav-learning-trigger{min-height:42px;padding:9px 0;font-size:14px}
 html body[data-mapkai-page] .nav-learning-menu{display:none}
 html body[data-mapkai-page] .nav-preferences{flex-direction:row;flex-wrap:wrap;gap:12px 28px;align-items:center}
 html body[data-mapkai-page] :is(.language-switch,.theme-switch){gap:12px;font-size:13px}
 html body[data-mapkai-page] :is(.language-switch,.theme-switch) :is(button,a){min-height:44px}
}
@media(min-width:1061px){html body[data-mapkai-page] .topbar .nav-panel{position:static;width:auto;margin:0;padding:0;border:0;background:none;box-shadow:none}}
@media(max-width:600px){
 html body[data-mapkai-page] .topbar{padding:12px 20px;min-height:68px}
 html body[data-mapkai-page] .topbar .brand img{width:120px}
 html body[data-mapkai-page] .page{padding:32px 20px 48px}
 html body[data-mapkai-page] .home-minimal{min-height:auto;padding:26px 0 32px}
 html body[data-mapkai-page] .home-page .hero h1{font-size:clamp(34px,9vw,48px)}
 html body[data-mapkai-page] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select){font-size:16px}
 html body[data-mapkai-page] .button{min-height:44px}
 html body[data-mapkai-page] #map .intro-copy p:not(.eyebrow){font-size:14px}
}
@media(prefers-reduced-motion:reduce){html body[data-mapkai-page] .nav-toggle span{transition:none}}

html body[data-mapkai-page] #map.spatial-atlas .spatial-toolbar h1{color:var(--ink)}
html body[data-mapkai-page] #map.spatial-atlas .spatial-primary,html body[data-mapkai-page] .spatial-detail button[data-spatial-open]{background:#2563eb;border-color:#2563eb;color:#fff;border-radius:8px}
html body[data-mapkai-page] .spatial-world{border-radius:12px}
html body[data-mapkai-page] .chat-focused .conversation-panel{background:transparent;border:0}
html body[data-mapkai-page] .pdc-entry-subtitle{font-size:20px;font-weight:500;color:var(--muted)}
html body[data-mapkai-page] :is(.pdc-entry-hero,.about-opening,.section-heading,.legal-hero,.finance-course-hero,.finance-day-hero) h1{font-size:clamp(32px,4vw,52px);line-height:1.16}
html body[data-mapkai-page] .pdc-entry-page .pdc-entry-hero{padding:18px 0 28px;border:0;background:transparent;box-shadow:none}
html body[data-mapkai-page] .pdc-entry-page .pdc-entry-hero h1{max-width:820px}
html body[data-mapkai-page] .pdc-entry-page .pdc-entry-subtitle{font-size:20px;font-weight:500;color:var(--muted)}
html body[data-mapkai-page] .finance-progress-track i{background:#2563eb}
