/* TheMacroMarket.com — styles. Brand: navy #05234B, greens #4DE13B #34CA41 #1CA849 #005B3D, slate #7F8A9A */
:root {
  --navy: #05234B; --navy-2: #0B3366; --navy-3: #13447f;
  --g1: #4DE13B; --g2: #34CA41; --g3: #1CA849; --g4: #005B3D;
  --slate: #7F8A9A; --ink: #0E1B2E; --muted: #55657A; --line: #DCE3EC; --line-2: #EEF2F7;
  --bg: #F4F7FA; --card: #FFFFFF; --tint: #EAF8EE;
  --boom: #12A150; --expansion: #1CA849; --slowdown: #D9930D; --recession: #E0662B; --depression: #B42318;
  --stagflation: #7A3E9D; --hyper: #C2185B; --deflation: #2C7BE5; --bubble: #D65A9B;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(5,35,75,.06), 0 4px 16px rgba(5,35,75,.06);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", "Public Sans", system-ui, sans-serif;
  --fs: 16px;
}
*,*::before,*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 var(--fs)/1.6 var(--font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
body.projector { --fs: 20px; }
img { max-width: 100%; height: auto; }
a { color: var(--navy-3); text-underline-offset: 2px; }
a:hover { color: var(--g4); }
h1,h2,h3,h4 { font-family: var(--display); color: var(--navy); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.small { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 860px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: 8px 12px; z-index: 999; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--g2); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-notice { background: var(--g4); color: #fff; text-align: center; font-size: .9rem; padding: 6px 12px; }
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { border-radius: 9px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; line-height: 1; color: #fff; }
.wordmark b { font-weight: 800; }
.wordmark b + b { color: var(--g1); }
.wordmark i { font-style: normal; font-weight: 500; color: #9AA6B6; }
.site-nav { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: space-between; }
.site-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { display: block; color: #D6E0EE; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.site-nav ul a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav ul a.active { color: #fff; background: rgba(77,225,59,.16); box-shadow: inset 0 -2px 0 var(--g1); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user a { color: #fff; text-decoration: none; font-size: .92rem; }
.nav-small { opacity: .85; }
.nav-admin { background: var(--g4); padding: 4px 10px; border-radius: 6px; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 5px 10px; font: 600 .85rem var(--font); cursor: pointer; }
.btn-ghost:hover { border-color: var(--g1); }
body.projector .projector-btn { background: var(--g3); border-color: var(--g3); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }
@media (max-width: 1060px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; border-top: 1px solid rgba(255,255,255,.1); }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .nav-user { flex-wrap: wrap; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
}

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--g3); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font: 700 .97rem var(--font); text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--g4); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: .88rem; border-radius: 8px; }
.btn-navy { background: var(--navy); } .btn-navy:hover { background: var(--navy-3); }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-outline:hover { background: var(--line-2); color: var(--navy); border-color: var(--slate); }
.btn-danger { background: #B42318; } .btn-danger:hover { background: #8f1c13; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.form label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 14px; color: var(--navy); }
.form input[type=month], .form input[type=file], .form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=number], .form input:not([type]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; font: 400 1rem var(--font); background: #fff; color: var(--ink); }
.form textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.form textarea.prose { font-family: var(--font); font-size: 1rem; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--g3); outline: none; box-shadow: 0 0 0 3px rgba(28,168,73,.15); }
.form .help { font-weight: 400; color: var(--muted); font-size: .83rem; display: block; margin-top: 4px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 14px 0; border: 1px solid; }
.flash-info { background: #EAF2FD; border-color: #B9D3F7; color: #0B3366; }
.flash-success { background: var(--tint); border-color: #A9E3BC; color: var(--g4); }
.flash-error { background: #FDECEA; border-color: #F5B7B1; color: #8f1c13; }

/* ---------- Cards & sections ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.section { padding-top: 48px; padding-bottom: 48px; }
.section-tight { padding-top: 28px; padding-bottom: 28px; }
.page-head { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 40px 0 34px; position: relative; overflow: hidden; }
.page-head h1 { color: #fff; margin-bottom: .3em; }
.page-head p { color: #C9D5E6; max-width: 760px; font-size: 1.08rem; margin: 0; }
.page-head::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 300px; height: 160px; background:
  linear-gradient(var(--g1),var(--g1)) 0 100%/18% 35% no-repeat, linear-gradient(var(--g2),var(--g2)) 27% 100%/18% 55% no-repeat,
  linear-gradient(var(--g3),var(--g3)) 54% 100%/18% 75% no-repeat, linear-gradient(var(--g4),var(--g4)) 81% 100%/18% 100% no-repeat; opacity: .22; }
.eyebrow { display: inline-block; font: 700 .76rem var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--g1); margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.tile-link { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.tile-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(5,35,75,.12); color: inherit; }
.tile-link .icon { font-size: 1.8rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--line-2); color: var(--navy); }
.pill-green { background: var(--tint); color: var(--g4); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose li { margin-bottom: .35em; }
.callout { border-left: 4px solid var(--g3); background: var(--tint); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 18px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; background: #fff; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--line-2); color: var(--navy); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- Ads & resources ---------- */
.ad-slot { margin: 16px auto; text-align: center; max-width: 1320px; padding: 0 20px; }
.ad-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); margin-bottom: 4px; }
.resources h3 { margin-bottom: 10px; }
.resources ul { list-style: none; padding: 0; margin: 0; }
.resources li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.resources li img { width: 52px; height: 70px; object-fit: cover; border-radius: 4px; }
.resources li p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.resources a { font-weight: 700; }
.disclosure { font-size: .74rem; color: var(--slate); margin: 10px 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #B8C5D8; margin-top: 60px; padding: 46px 0 20px; font-size: .93rem; }
.site-footer a { color: #DCE6F3; text-decoration: none; }
.site-footer a:hover { color: var(--g1); }
.site-footer h4 { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer .small { color: #8E9DB3; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.brand-footer { margin-bottom: 12px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 16px; font-size: .85rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* =========================================================
   SIMULATOR
   ========================================================= */
.sim-hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 26px 0 80px; }
.sim-hero h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 6px; }
.sim-hero p { color: #C9D5E6; margin: 0; max-width: 820px; }
.sim-hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.sim-wrap { margin-top: -62px; }
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .sim-layout { grid-template-columns: 1fr; } }
.sim-stage { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1100px) { .sim-stage { position: static; } }

.status-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.status-badge { display: inline-flex; align-items: center; gap: 8px; font: 800 1.05rem var(--display); color: #fff; padding: 8px 14px; border-radius: 10px; background: var(--expansion); white-space: nowrap; transition: background .3s; }
.status-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.status-text { flex: 1; font-size: .93rem; color: var(--muted); line-height: 1.4; }
.status-text b { color: var(--ink); }
.status-more { flex-shrink: 0; }
.st-boom { background: var(--boom); } .st-expansion { background: var(--expansion); } .st-slowdown { background: var(--slowdown); }
.st-recession { background: var(--recession); } .st-depression { background: var(--depression); } .st-stagflation { background: var(--stagflation); }
.st-hyperinflation { background: var(--hyper); } .st-deflation { background: var(--deflation); } .st-overheating { background: #E0662B; } .st-bubble { background: var(--bubble); }
.flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #fff; cursor: pointer; border: 0; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kc, var(--g3)); }
.kpi .k-label { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-val { font: 800 1.45rem var(--display); color: var(--navy); line-height: 1.15; }
.kpi .k-delta { font-size: .78rem; font-weight: 700; }
.k-up { color: var(--g3); } .k-down { color: var(--recession); } .k-flat { color: var(--slate); }
.k-bad.k-up { color: var(--recession); } .k-bad.k-down { color: var(--g3); }

.chart-card { padding: 16px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-head h2 { font-size: 1.15rem; margin: 0; }
.chart-tabs { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; }
.chart-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: 700 .84rem var(--font); color: var(--muted); cursor: pointer; }
.chart-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.chart-box { position: relative; height: 380px; }
@media (max-width: 700px) { .chart-box { height: 300px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: 600 .8rem var(--font); color: var(--ink); cursor: pointer; }
.legend button i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend button.off { opacity: .45; text-decoration: line-through; }
.chart-note { font-size: .78rem; color: var(--slate); margin: 6px 0 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: 600 .9rem var(--font); background: #fff; color: var(--navy); }

/* Control panel */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--navy); color: #fff; gap: 8px; }
.panel-head h2 { color: #fff; font-size: 1.05rem; margin: 0; }
.panel-head .btn-ghost { font-size: .8rem; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--line-2); }
.panel-tabs button { flex: 1; border: 0; background: transparent; padding: 10px 6px; font: 700 .84rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.panel-tabs button.on { color: var(--navy); border-bottom-color: var(--g3); background: #fff; }
.panel-body { max-height: calc(100vh - 200px); overflow-y: auto; }
@media (max-width: 1100px) { .panel-body { max-height: none; } }
.group { border-bottom: 1px solid var(--line-2); }
.group > summary { list-style: none; cursor: pointer; padding: 12px 16px; font: 700 .93rem var(--display); color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: "▾"; color: var(--slate); transition: transform .2s; }
.group:not([open]) > summary::after { transform: rotate(-90deg); }
.group > summary .g-sub { font: 500 .78rem var(--font); color: var(--slate); margin-left: 8px; }
.ctrl { padding: 8px 16px 12px; border-top: 1px dashed var(--line-2); }
.ctrl:first-of-type { border-top: 0; }
.ctrl.disabled .ctrl-main { opacity: .38; }
.ctrl-top { display: flex; align-items: center; gap: 6px; }
.ctrl-name { font-weight: 700; font-size: .9rem; flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ctrl-name .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ctrl-val { font: 800 .98rem var(--display); color: var(--navy); min-width: 64px; text-align: right; }
.ctrl-val.changed { color: var(--g4); }
.ico-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; font-size: .82rem; color: var(--muted); padding: 0; flex-shrink: 0; }
.ico-btn:hover { border-color: var(--slate); color: var(--navy); }
.ico-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ico-btn.lock.on { background: #F2B807; border-color: #E0A800; color: var(--navy); }
.ico-btn.power.on { background: var(--g3); border-color: var(--g3); color: #fff; }
.ctrl-main { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ctrl-desc { font-size: .78rem; color: var(--muted); margin: 3px 0 0; line-height: 1.35; }
.ctrl-scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--slate); margin-top: -2px; }
.ctrl.output .ctrl-name::after { content: "result"; font: 700 .62rem var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--slate); background: var(--line-2); padding: 1px 6px; border-radius: 4px; }
.ctrl.output.pinned .ctrl-name::after { content: "locked"; background: #FFF3C4; color: #7a5b00; }
.ctrl.auto .ctrl-name::after { content: "auto"; font: 700 .62rem var(--font); text-transform: uppercase; color: var(--g4); background: var(--tint); padding: 1px 6px; border-radius: 4px; }

/* Range input */
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
input[type=range].slider:focus { outline: none; }
input[type=range].slider::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--g3) 0, var(--g3) var(--p, 50%), #D9E1EA var(--p, 50%)); }
input[type=range].slider::-moz-range-track { height: 6px; border-radius: 6px; background: #D9E1EA; }
input[type=range].slider::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--g3); }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
input[type=range].slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); }
input[type=range].slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(28,168,73,.35); }
.output input[type=range].slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, #7F8A9A 0, #7F8A9A var(--p, 50%), #E3E8EF var(--p, 50%)); }
.output.pinned input[type=range].slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, #E0A800 0, #E0A800 var(--p, 50%), #F6EBC4 var(--p, 50%)); }
.output input[type=range].slider::-webkit-slider-thumb { border-color: var(--slate); }
.output.pinned input[type=range].slider::-webkit-slider-thumb { border-color: #B98A00; }
.baseline-tick { position: relative; height: 0; }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-row button { border: 1.5px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; padding: 7px 12px; border-radius: 9px; font: 600 .85rem var(--font); cursor: pointer; }
.preset-row button:hover { border-color: var(--g1); background: rgba(77,225,59,.12); }

.adas-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .adas-wrap { grid-template-columns: 1fr; } }
.mini-chart { position: relative; height: 250px; }
.explain-list { margin: 0; padding-left: 18px; font-size: .9rem; }
.explain-list li { margin-bottom: 6px; }
.explain-list b { color: var(--navy); }
.chain { font-size: .92rem; line-height: 1.55; }
.chain .arrow { color: var(--g3); font-weight: 800; }

/* Modal / popups */
.modal-bg { position: fixed; inset: 0; background: rgba(5,20,45,.55); display: none; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 580px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { padding: 18px 22px; color: #fff; border-radius: 16px 16px 0 0; display: flex; align-items: center; gap: 12px; }
.modal-head h3 { color: #fff; margin: 0; font-size: 1.35rem; }
.modal-head .m-icon { font-size: 1.8rem; }
.modal-body { padding: 18px 22px 22px; }
.modal-body h4 { margin: 14px 0 6px; }
.modal-close { margin-left: auto; background: rgba(255,255,255,.15); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 150; max-width: 360px; background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(5,35,75,.25); overflow: hidden; transform: translateY(140%); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
.toast.show { transform: none; }
.toast-head { color: #fff; padding: 10px 14px; font: 800 1rem var(--display); display: flex; align-items: center; gap: 8px; }
.toast-body { padding: 10px 14px 12px; font-size: .88rem; }
.toast-body button { margin-top: 6px; }
.toast-x { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; }
.tip { position: absolute; z-index: 300; max-width: 300px; background: var(--navy); color: #fff; padding: 10px 12px; border-radius: 10px; font-size: .84rem; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }

/* Home sections */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature-grid .card h3 { margin-top: 8px; }
.how-steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; padding: 0; list-style: none; }
.how-steps li { counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 16px 58px; position: relative; }
.how-steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--g3); color: #fff; font: 800 1rem var(--display); display: grid; place-items: center; }

/* =========================================================
   HISTORY
   ========================================================= */
.era-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.era { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; text-decoration: none; display: block; }
.era:hover { border-color: var(--g3); box-shadow: var(--shadow); color: inherit; }
.era.on { border-color: var(--g3); background: var(--tint); }
.era b { display: block; color: var(--navy); font-family: var(--display); }
.era span { font-size: .8rem; color: var(--muted); }
.replay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--navy); border-radius: 12px; color: #fff; }
.replay-bar .date-big { font: 800 1.6rem var(--display); min-width: 130px; color: var(--g1); }
.replay-bar input[type=range] { flex: 1; min-width: 160px; }
.replay-bar button { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 9px; padding: 8px 12px; font: 700 .9rem var(--font); cursor: pointer; }
.replay-bar button.primary { background: var(--g3); border-color: var(--g3); }
.replay-bar select { background: var(--navy-2); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 8px; font: 600 .85rem var(--font); }
.range-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.range-form label { font-weight: 700; font-size: .85rem; color: var(--navy); }
.range-form input { display: block; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: 600 .95rem var(--font); }
.event-feed { max-height: 330px; overflow-y: auto; padding-right: 4px; }
.event-feed .ev { border-left: 3px solid var(--line); padding: 4px 0 8px 12px; font-size: .9rem; opacity: .5; transition: opacity .3s, border-color .3s; }
.event-feed .ev.past { opacity: 1; border-color: var(--g3); }
.event-feed .ev.now { border-color: var(--recession); background: #FFF6F1; }
.event-feed .ev time { font-weight: 800; color: var(--navy); font-size: .8rem; display: block; }
.whatif { background: #FFF9E6; border: 1px solid #F1D98A; }
.whatif h3 { color: #7a5b00; }

/* =========================================================
   QUIZ
   ========================================================= */
.quiz-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.facts { background: var(--line-2); border-radius: 12px; padding: 14px 18px 14px 36px; margin: 0 0 16px; }
.facts li { margin: 4px 0; }
.predict { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.predict .q { font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-row label { flex: 1; min-width: 110px; }
.choice-row input { position: absolute; opacity: 0; }
.choice-row span { display: block; text-align: center; border: 2px solid var(--line); border-radius: 10px; padding: 10px 8px; font-weight: 700; cursor: pointer; transition: all .12s; }
.choice-row input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.choice-row input:focus-visible + span { outline: 3px solid var(--g2); }
.predict.correct { border-color: var(--g3); background: var(--tint); }
.predict.wrong { border-color: #F5B7B1; background: #FDF3F2; }
.result-line { margin-top: 8px; font-size: .92rem; }
.score-big { font: 800 3rem var(--display); color: var(--g3); line-height: 1; }

/* =========================================================
   LABS
   ========================================================= */
.lab-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .lab-layout { grid-template-columns: 1fr; } }
.lab-chart { position: relative; height: 440px; }
@media (max-width: 700px) { .lab-chart { height: 330px; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: var(--line-2); border-radius: 10px; padding: 8px 12px; }
.stat .k-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.stat .k-val { font: 800 1.25rem var(--display); color: var(--navy); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: #fff; padding: 7px 12px; font: 700 .84rem var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* Glossary */
.gloss-index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.gloss-index a { padding: 4px 10px; border-radius: 7px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.term { padding: 14px 0; border-bottom: 1px solid var(--line); }
.term h3 { margin-bottom: 4px; }
dl.gloss dt { font: 700 1.05rem var(--display); color: var(--navy); margin-top: 16px; }
dl.gloss dd { margin: 4px 0 0; }

/* Teachers */
.embed-code { width: 100%; font: .85rem ui-monospace, Menlo, Consolas, monospace; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--line-2); min-height: 90px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* Account / admin */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-nav { background: var(--navy); border-radius: var(--radius); padding: 10px; position: sticky; top: 80px; }
.admin-nav a { display: block; color: #D6E0EE; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: .93rem; }
.admin-nav a.on, .admin-nav a:hover { background: rgba(77,225,59,.16); color: #fff; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-cards .card { padding: 14px 16px; }
.stat-cards .num { font: 800 1.9rem var(--display); color: var(--navy); }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 6px; margin: 0 0 18px; background: #fff; }
.fieldset legend { font: 700 1rem var(--display); color: var(--navy); padding: 0 6px; }
.auth-box { max-width: 460px; margin: 40px auto; }
.inline-form { display: inline; }

/* Embed */
body.embed { background: #fff; }
body.embed .sim-wrap { margin-top: 0; }
.embed-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--navy); color: #fff; font-size: .85rem; }
.embed-bar a { color: var(--g1); font-weight: 700; text-decoration: none; }

@media print {
  .site-header, .site-footer, .panel, .ad-slot, .toolbar, .nav-toggle { display: none !important; }
  .sim-layout { grid-template-columns: 1fr; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Forecast strip */
.wx-strip { display: flex; gap: 2px; flex: 1; min-width: 200px; }
.wx-strip .wx { flex: 1; height: 16px; border: 0; border-radius: 3px; cursor: pointer; padding: 0; opacity: .85; }
.wx-strip .wx:nth-child(4n) { margin-right: 4px; }
.wx-strip .wx.on { outline: 2px solid var(--navy); outline-offset: 1px; opacity: 1; }
.seg button[data-view] { padding: 6px 12px; }

/* Layout variants & small-screen fixes */
.sim-layout > * { min-width: 0; }
.sim-layout.side-360 { grid-template-columns: minmax(0, 1fr) 360px; }
.sim-layout.side-300 { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .sim-layout.side-360, .sim-layout.side-300 { grid-template-columns: 1fr; } .side-300 > aside { position: static !important; } }
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .status-bar { flex-wrap: wrap; gap: 10px; }
  .status-text { flex-basis: 100%; }
  .chart-head { flex-direction: column; align-items: flex-start; }
  .chart-tabs { max-width: 100%; overflow-x: auto; }
  .chart-tabs button { white-space: nowrap; }
  .replay-bar .date-big { min-width: 0; font-size: 1.3rem; }
  .replay-bar input[type=range] { flex-basis: 100%; }
  .toolbar .small { flex-basis: 100%; }
  .panel-tabs button { font-size: .8rem; }
  .learn-toc ol { columns: 1 !important; }
  .page-head::after { display: none; }
}
