/* ---------- Tokens ----------
   Design v3, modelled on a soft fintech app: warm light-grey canvas, white rounded cards, pastel accent cards
   (sage, lavender, periwinkle), big tight numbers, pill controls (selected = raised white pill, or blue for chips),
   blue pill buttons, purple chart line. Chart colours (--d1..--d5) are a validated categorical order per mode. */
:root {
  --bg: #EFEEEA;
  --rail: #E6E5E0;
  --side: #EFEEEA;
  --surface: #FBFBF9;
  --surface-2: #F1F0EC;
  --border: rgba(20, 20, 20, 0.07);
  --grid: #E7E5E0;
  --text: #141414;
  --text-2: #4B4B4B;
  --muted: #8A8A86;
  --navy: #2563EB;          /* the "selected" colour: blue, like the reference's active nav and buttons */
  --on-navy: #FFFFFF;
  --here: #FFFFFF;          /* selected item in the section menu: a raised white pill */
  --pill: #E4E3DE;
  --pill-text: #1E1E1E;
  --amber: #2563EB;         /* primary action: blue pill */
  --green: #2563EB;
  --link: #2563EB;
  --gold: #6E4A00;
  --gold-soft: #F4ECD5;
  --sage: #DFE7C9;          /* pastel accent cards */
  --lavender: #EADCF3;
  --periwinkle: #DDE4F4;
  --peach: #F5E3D7;
  --up: #188038;
  --down: #D93025;
  --up-soft: #E2F2E6;
  --down-soft: #FCE6E4;
  --line-official: #141414;
  --line-market: #A9A79E;
  --d1: #7B3FB4;
  --d2: #1F9E8F;
  --d3: #C97A00;
  --d4: #2563EB;
  --d5: #D0397F;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.05);
  --radius: 28px;
  --font: "Inter", "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #121315; --rail: #1A1B1F; --side: #121315; --surface: #1C1E22; --surface-2: #25272C;
    --border: rgba(255, 255, 255, 0.08); --grid: #2B2E33; --text: #F2F2F0; --text-2: #C4C5C7; --muted: #8E9196;
    --navy: #4F86F0; --on-navy: #FFFFFF; --here: #2B2E34; --pill: #2A2C31; --pill-text: #E9E9E7;
    --amber: #4F86F0; --green: #4F86F0; --link: #7EA8F5; --gold: #F2C46B; --gold-soft: #3A3120;
    --sage: #2E3526; --lavender: #33293B; --periwinkle: #262D3D; --peach: #3A2D25;
    --up: #4CC26A; --down: #F0717A; --up-soft: #173222; --down-soft: #3A1F22;
    --line-official: #ECEBE6; --line-market: #6F6D66;
    --d1: #9B6FD9; --d2: #1F9C8C; --d3: #B8760A; --d4: #4F86F0; --d5: #E0559A;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --rail: #1A1B1F; --side: #121315; --surface: #1C1E22; --surface-2: #25272C;
  --border: rgba(255, 255, 255, 0.08); --grid: #2B2E33; --text: #F2F2F0; --text-2: #C4C5C7; --muted: #8E9196;
  --navy: #4F86F0; --on-navy: #FFFFFF; --here: #2B2E34; --pill: #2A2C31; --pill-text: #E9E9E7;
  --amber: #4F86F0; --green: #4F86F0; --link: #7EA8F5; --gold: #F2C46B; --gold-soft: #3A3120;
  --sage: #2E3526; --lavender: #33293B; --periwinkle: #262D3D; --peach: #3A2D25;
  --up: #4CC26A; --down: #F0717A; --up-soft: #173222; --down-soft: #3A1F22;
  --line-official: #ECEBE6; --line-market: #6F6D66;
  --d1: #9B6FD9; --d2: #1F9C8C; --d3: #B8760A; --d4: #4F86F0; --d5: #E0559A;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }
.num { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px; display: grid; gap: 28px; }
main > * { min-width: 0; } /* let wide rows (e.g. scrollable button groups) scroll instead of widening the page */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-body { padding: 20px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head p { font-size: 14px; color: var(--muted); margin-top: 2px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.seg button:focus-visible, .chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }

/* ---------- Live dot ---------- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.live-dot.on { background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.hero-main { padding: 24px 28px; }
.hero-label { font-size: 13px; color: var(--muted); }
.hero-label .live-dot { margin-right: 6px; vertical-align: 1px; }
.hero-prices { display: flex; flex-wrap: wrap; gap: 12px 44px; margin: 10px 0 16px; }
.hero-price .k { font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.hero-price .v { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero-price .v small { font-size: 18px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.hero-story { font-size: 16px; line-height: 1.6; color: var(--text-2); max-width: 62ch; }
.hero-story b { color: var(--text); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.pill.up { background: var(--up-soft); }
.pill.down { background: var(--down-soft); }
.pill.flat { background: var(--surface-2); color: var(--text-2); }
.hero-foot { margin-top: 14px; font-size: 13px; color: var(--muted); }

.drivers { border-left: 1px solid var(--border); padding: 22px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; align-content: start; }
.drivers h3 { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-weight: 600; }
.driver .l { font-size: 13px; color: var(--text-2); }
.driver .v { font-size: 20px; font-weight: 700; }
.driver .c { font-size: 13px; font-weight: 600; margin-left: 6px; }
.driver .d { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- Where to buy / sell ---------- */
.where-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.tile .l { font-size: 13px; color: var(--text-2); }
.tile .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.tile .s { font-size: 13px; color: var(--text-2); }
.tile.good { background: var(--up-soft); }
.tile.good .l { color: var(--up); font-weight: 700; }

.ladder { display: grid; gap: 2px; }
.ladder-head, .rung { display: grid; grid-template-columns: 200px minmax(0, 1fr) 112px 112px; align-items: center; gap: 16px; }
.ladder-head { font-size: 12px; color: var(--muted); padding: 0 10px 6px; }
.ladder-head .r, .rung .r { text-align: right; }
.rung { padding: 10px; border-radius: 10px; }
.rung:hover { background: var(--surface-2); }
.rung .who { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rung .who a { text-decoration: none; font-weight: 600; }
.rung .who a:hover { text-decoration: underline; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.badge.good { background: var(--up-soft); color: var(--up); }
.badge.old { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.rung .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.rung .price.best { color: var(--up); }
.rung .price .na { color: var(--muted); font-weight: 400; }
.rung .price .approx { color: var(--muted); font-weight: 400; }

/* Range track: the gap between "you get" and "you pay", against the official price. */
.track { position: relative; height: 24px; }
.track .rail { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid); }
.track .ref { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; background: var(--line-official); opacity: 0.45; border-radius: 1px; }
.track .ref.market { background: var(--line-market); opacity: 1; }
.track .bar { position: absolute; top: 50%; height: 6px; transform: translateY(-50%); background: var(--c); opacity: 0.35; border-radius: 3px; }
.track .dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.track .dot.get { background: var(--surface); border: 3px solid var(--c); }
.scale-note { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); margin: 14px 10px 0; align-items: center; }
.scale-note .k { display: inline-flex; align-items: center; gap: 6px; }
.k-pay { width: 10px; height: 10px; border-radius: 50%; background: var(--text-2); }
.k-get { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-2); }
.k-ref { width: 2px; height: 14px; background: var(--line-official); opacity: 0.5; }
.k-mkt { width: 2px; height: 14px; background: var(--line-market); }
details.older { margin-top: 8px; border-top: 1px solid var(--border); }
details.older summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 10px 10px 4px; }
details.older .rung { opacity: 0.65; }

/* ---------- History ---------- */
.history-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.charts { display: grid; gap: 16px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 5px 12px 5px 10px; font-size: 13px; cursor: pointer;
}
.chip .sw { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.chip[aria-pressed="false"] { color: var(--muted); background: transparent; text-decoration: line-through; }
.chip[aria-pressed="false"] .sw { background: var(--grid); }
.side-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 4px; }
.side-toggle .seg button { display: inline-flex; align-items: center; gap: 8px; }
.side-help { font-size: 13px; color: var(--muted); flex: 1; min-width: 240px; }
.side-help b { color: var(--text-2); }
.lk-solid { width: 18px; height: 2.5px; background: currentColor; display: inline-block; border-radius: 2px; }
.lk-dot { width: 18px; height: 2.5px; background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px); display: inline-block; }

.chart-panel { padding: 16px 16px 8px; }
.chart-head { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; flex-wrap: wrap; }
.chart-head .last { margin-left: auto; font-size: 13px; color: var(--text-2); }
.chart-wrap { position: relative; }
.chart { height: 300px; }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); padding: 10px 12px; font-size: 13px; display: none;
}
.tooltip .t-date { font-weight: 700; margin-bottom: 6px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tooltip .t-row .sw { width: 12px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.tooltip .t-row .sw.dot { background: repeating-linear-gradient(90deg, var(--c) 0 2px, transparent 2px 4px); }
.tooltip .t-row .n { color: var(--text-2); flex: 1; }
.tooltip .t-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.tooltip .t-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 6px 0 1px; }
.tooltip .t-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ---------- Day panel ---------- */
.day { padding: 20px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.day-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.day .eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.day .date { font-size: 17px; font-weight: 700; margin-top: 2px; }
.day .price { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 10px; }
.day section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.day h4 { margin: 0 0 10px; font-size: 14px; }
.day p { font-size: 14px; color: var(--text-2); }
.split-bars { display: grid; gap: 10px; margin-bottom: 10px; }
.split-row { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.split-row .bar-area { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; }
.split-row .bar-area::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: 0.6; }
.split-row .fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.split-row .fill.up { background: var(--up); }
.split-row .fill.down { background: var(--down); }
.split-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
#hourly { height: 130px; }
.placeholder { background: var(--gold-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--text-2); }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv td { padding: 6px 0; border-bottom: 1px solid var(--border); }
table.kv tr:last-child td { border-bottom: 0; }
table.kv td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.kv td.r.c { width: 70px; font-weight: 600; }

/* ---------- Help & footer ---------- */
details.help summary { padding: 16px 20px; cursor: pointer; font-weight: 600; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; padding: 0 20px 20px; font-size: 14px; color: var(--text-2); }
.help-grid b { color: var(--text); display: block; }
footer { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 12px; }

/* ---------- Motion ---------- */
.flash { animation: flash 1.6s ease-out; border-radius: 6px; }
@keyframes flash { 0% { background: var(--gold-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on, .flash { animation: none; } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; padding: 28px; }
.login h1 { margin: 16px 0 4px; font-size: 22px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.login input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit;
}
.login button {
  width: 100%; margin-top: 20px; padding: 10px; border: 0; border-radius: 8px;
  background: var(--gold); color: #1c1b18; font: inherit; font-weight: 700; cursor: pointer;
}
.error { color: var(--down); font-size: 14px; margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .history-grid { grid-template-columns: 1fr; }
  .day { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .drivers { border-left: 0; border-top: 1px solid var(--border); }
  .where-top { grid-template-columns: 1fr; }
  .ladder-head { display: none; }
  .rung { grid-template-columns: 1fr 1fr; gap: 8px 12px; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 4px; }
  .rung .who { grid-column: 1 / -1; }
  .rung .track { grid-column: 1 / -1; margin: 4px 0; }
  .rung .r { text-align: left; }
  .rung .r::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
}
@media (max-width: 640px) {
  main { padding: 16px; gap: 22px; }
  .hero-main, .drivers { padding: 18px; }
  .hero-price .v { font-size: 30px; }
  .driver .c { display: block; margin-left: 0; }
  .chart { height: 240px; }
  .panel-body { padding: 16px; }
}

/* ---------- Home ---------- */
a.brand { text-decoration: none; color: inherit; }
.welcome h1 { font-size: 26px; margin: 4px 0 2px; letter-spacing: -0.02em; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-card { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.home-card:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); transform: translateY(-1px); }
.home-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hc-head { display: flex; align-items: center; gap: 10px; }
.hc-head h2 { font-size: 20px; }
.hc-go { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--gold); }
.hc-icon { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.hc-icon.gold { background: linear-gradient(135deg, #f2c75c, #a8740a); }
.hc-icon.land { background: linear-gradient(135deg, #7fc98f, #2e7d4f); }
.hc-big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hc-big small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.hc-line { font-size: 15px; color: var(--text-2); }
.hc-line b { color: var(--text); }
.hc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hc-fact { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.hc-fact .l { font-size: 12px; color: var(--muted); }
.hc-fact .v { font-size: 16px; font-weight: 700; }
.spark { height: 90px; margin-top: auto; }
.hc-foot { font-size: 12px; }
.soon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.soon-card { padding: 16px 20px; display: grid; gap: 2px; font-size: 14px; opacity: 0.85; }
.compare-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; margin-bottom: 12px; }
.compare-bars { display: grid; gap: 10px; }
.cbar { display: grid; grid-template-columns: 210px minmax(0, 1fr) 80px; gap: 12px; align-items: center; font-size: 14px; }
.cbar .track2 { height: 14px; background: var(--surface-2); border-radius: 7px; position: relative; overflow: hidden; }
.cbar .fill2 { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--c); }
.cbar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Land ---------- */
.land-hero { padding: 24px 28px; }
.land-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 16px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.kpi .l { font-size: 13px; color: var(--text-2); }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; }
.kpi .s { font-size: 13px; color: var(--muted); }
.search {
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-width: 260px;
}
.search:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.toolbar-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.seg.scroll { max-width: 100%; overflow-x: auto; }
.seg.scroll button { white-space: nowrap; }
.area-list { display: grid; }
.area-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 130px 96px 96px; gap: 14px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.area-row:last-child { border-bottom: 0; }
.area-row.head { font-size: 12px; color: var(--muted); padding-top: 0; }
.area-row .name { font-weight: 600; }
.area-row .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.area-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.area-row .price { font-weight: 700; }
.hbar { height: 10px; background: var(--surface-2); border-radius: 5px; position: relative; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--d1); }
.empty { color: var(--muted); padding: 16px 6px; }

.listing-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 120px 160px; gap: 16px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.listing-row:last-child { border-bottom: 0; }
.listing-row.head { font-size: 12px; color: var(--muted); padding-top: 0; }
.listing-row .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.listing-row .name { font-weight: 600; text-transform: capitalize; }
.listing-row .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; text-transform: none; }
.listing-row .track .bar { background: var(--d1); opacity: 0.3; }
.listing-row .track .dot { background: var(--d1); }
.listing-note { font-size: 12px; color: var(--muted); margin: 12px 6px 0; }

.trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin: 0 4px 8px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.legend-row i.thick { height: 4px; }
.chart-note { font-size: 12px; color: var(--muted); margin: 8px 4px 4px; }

@media (max-width: 960px) {
  .home-grid, .soon-grid, .trend-grid { grid-template-columns: 1fr; }
  .land-kpis { grid-template-columns: 1fr; }
  .area-row { grid-template-columns: minmax(0, 1fr) 110px 70px; }
  .area-row .hbar, .area-row .since, .area-row .bar-h { display: none; }
  .listing-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .listing-row .track { grid-column: 1 / -1; order: 3; }
  .listing-row .range, .listing-row .track-h { display: none; }
  .cbar { grid-template-columns: 1fr 70px; }
  .cbar .track2 { grid-column: 1 / -1; order: 3; }
  .hc-facts { grid-template-columns: 1fr 1fr; }
  .search { min-width: 0; width: 100%; }
}

/* ---------- Land map ---------- */
.map-toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 12px; }
.select-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.select-wrap select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 0;
  border-radius: 10px; padding: 7px 12px;
}
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.map-panel { overflow: hidden; position: relative; }
#land-map { height: 620px; background: var(--surface-2); }
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); max-width: calc(100% - 24px);
}
.map-legend .t { font-weight: 700; margin-bottom: 4px; }
.map-legend .bins { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.map-legend .bin { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text-2); }
.map-legend .sw { width: 14px; height: 10px; border-radius: 3px; background: var(--c); }
.map-tip { font: 13px/1.45 system-ui, sans-serif; padding: 8px 10px; border-radius: 10px; }
.map-tip b { font-size: 14px; }
.leaflet-container { font-family: system-ui, -apple-system, sans-serif; }
.map-side { padding: 18px; max-height: 620px; overflow-y: auto; }
.map-side h3 { font-size: 17px; }
.map-side .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.radius-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 13px; }
.radius-row input[type="range"] { width: 100%; accent-color: var(--gold); }
.radius-row b { font-size: 15px; min-width: 44px; text-align: right; }
.radius-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 0 52px 12px 58px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 700; }
.area-line { font-size: 13px; color: var(--text-2); background: var(--gold-soft); border-radius: 10px; padding: 8px 11px; margin-bottom: 10px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 14px 0 6px; }
.list-head select { font: inherit; font-size: 13px; background: var(--surface-2); color: var(--text); border: 0; border-radius: 8px; padding: 5px 8px; }
.ad-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.ad-row a { font-weight: 600; font-size: 14px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ad-row a:hover { text-decoration: underline; }
.ad-row .meta { font-size: 12px; color: var(--muted); grid-column: 1; }
.ad-row .p { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ad-row .p small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.src { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); margin-right: 4px; }
.more-btn { width: 100%; margin-top: 10px; }
.top-list { display: grid; gap: 2px; margin-top: 8px; }
.top-list button { display: flex; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; text-align: left; }
.top-list button:hover { background: var(--surface-2); }
.top-list .v { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 1060px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-side { max-height: none; }
  #land-map { height: 480px; }
}
@media (max-width: 640px) {
  #land-map { height: 400px; }
  .map-legend { font-size: 11px; }
}
.leaflet-tooltip.map-tip { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.leaflet-tooltip.map-tip::before { display: none; }
.leaflet-tooltip.map-tip .muted { color: var(--muted); }
@media (max-width: 640px) {
  /* On phones the legend sits under the map instead of covering it. */
  .map-legend { position: static; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; max-width: none; }
}
.map-toolbar-2 { margin-top: -4px; }
.place-search { position: relative; display: flex; gap: 6px; flex: 1; min-width: 240px; max-width: 420px; }
.place-search input { flex: 1; font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.place-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.place-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1000; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; display: grid; gap: 2px;
}
.place-results button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.place-results button:hover { background: var(--surface-2); }
.place-results small { display: block; color: var(--muted); font-size: 12px; }
.place-results p { padding: 6px 8px; }
#map-opacity { width: 110px; accent-color: var(--gold); }
.place-results[hidden] { display: none; }

/* ---------- Land page v2 ---------- */
html { scroll-behavior: smooth; }
.anchor { scroll-margin-top: 120px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1c1b18; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.05); background: var(--gold); }
.btn.tiny { padding: 2px 9px; font-size: 12px; }
.tool-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool-group[hidden] { display: none; }
.money-input { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 0 10px; color: var(--text-2); }
.money-input input { width: 76px; border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 700; color: var(--text); padding: 7px 0; }
.money-input input:focus-visible { outline: none; }
.money-input:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.mode-switch button { font-weight: 600; }
.section-head .place-search { max-width: 380px; }

.map-style { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); font: 13px system-ui, sans-serif; color: var(--text); }
.map-style-toggle { border: 0; background: none; padding: 7px 11px; cursor: pointer; font-weight: 600; }
.map-style-body { padding: 0 10px 10px; display: grid; gap: 8px; width: 250px; }
.map-style-body[hidden] { display: none; }
.map-style-body label { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.map-style-body input[type="range"] { flex: 1; accent-color: var(--gold); }
.map-style-body p { margin: 0; font-size: 11px; color: var(--muted); }
.seg.small button { padding: 4px 8px; font-size: 12px; }

.steps { margin: 12px 0 4px; padding-left: 20px; font-size: 14px; color: var(--text-2); display: grid; gap: 2px; }
.headline { margin: 6px 0 10px; }
.headline .big { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.headline .big small { font-size: 14px; font-weight: 500; color: var(--muted); }
.afford { border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 4px 0 10px; }
.afford.yes { background: var(--up-soft); }
.afford.near { background: color-mix(in srgb, #fab219 22%, var(--surface)); }
.afford.no { background: var(--down-soft); }

.compare-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
.crumbs { font-size: 14px; }
.link { border: 0; background: none; color: var(--gold); font-weight: 600; cursor: pointer; padding: 0; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 100px 90px 70px 80px 70px; gap: 14px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: 14px; }
.cmp-row.head { font-size: 12px; color: var(--muted); padding-top: 2px; }
.cmp-row.clickable { cursor: pointer; border-radius: 8px; }
.cmp-row.clickable:hover, .cmp-row.clickable:focus-visible { background: var(--surface-2); outline: none; }
.cmp-row .name { font-weight: 600; }
.cmp-row .name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.cmp-row .name small.warn { color: var(--down); }
.cmp-row .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-row .price { font-weight: 700; }
.cmp-row .track .bar { background: var(--d1); opacity: 0.3; }
.cmp-row .track .dot { background: var(--d1); width: 11px; height: 11px; }
.cmp-row .chev { color: var(--muted); font-size: 18px; margin-left: 6px; }

.chart-panel .q { font-size: 16px; font-weight: 700; margin: 2px 4px 2px; }
.chart-panel .a { font-size: 14px; color: var(--text-2); margin: 0 4px 10px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.guide-card { padding: 14px 16px; font-size: 14px; color: var(--text-2); }
.guide-card b { color: var(--text); display: block; margin-bottom: 2px; }

@media (max-width: 860px) {
  .cmp-row { grid-template-columns: minmax(0, 1fr) 96px 56px; }
  .cmp-row .track { grid-column: 1 / -1; order: 5; }
  .cmp-row .hide-sm { display: none; }
  .cmp-row.head .track, .cmp-row.head span:nth-child(2) { display: none; }
  .section-head .place-search { max-width: none; width: 100%; }
}
@media (max-width: 640px) {
  .anchor { scroll-margin-top: 140px; }
}

/* Keep Leaflet's layers (z-index 400-1000) inside the map panel so they never cover the sticky header. */
.map-panel { isolation: isolate; }
.load-error { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 6px 0; font-size: 14px; }

/* ---------- Map / Grid tabs ---------- */
.view-tabs { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.view-tabs [role="tab"] { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.view-tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.view-tabs [role="tab"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#view-map[hidden], #view-grid[hidden] { display: none; }
.map-toolbar .place-search { flex: 0 1 340px; min-width: 220px; }

/* ---------- Grid ---------- */
.grid-filters { padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 12px; }
.gf-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.gf-row select, .grid-filters .search { font: inherit; font-size: 14px; background: var(--surface-2); color: var(--text); border: 0; border-radius: 10px; padding: 8px 12px; }
.gf-row select:disabled { opacity: .55; }
.grid-filters .search.grow { flex: 1 1 260px; min-width: 200px; border: 1px solid var(--border); background: var(--surface); }
.gf-row.chips { gap: 6px; }
.gf-row.chips .chip { padding: 4px 11px; }
.gf-row.chips .chip[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--text); font-weight: 600; text-decoration: none; }
.gf-foot .spacer { flex: 1; }
.grid-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 4px 2px 10px; font-size: 15px; }
.grid-summary .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.on { background: var(--surface-2); text-decoration: none; }
.ads-table-wrap { overflow-x: auto; }
.ads-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ads-table.loading { opacity: .5; transition: opacity .15s; }
.ads-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.ads-table th button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.ads-table th button:hover { color: var(--text); }
.ads-table th[aria-sort="ascending"], .ads-table th[aria-sort="descending"] { color: var(--text); }
.ads-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ads-table tr:last-child td { border-bottom: 0; }
.ads-table tbody tr:hover { background: var(--surface-2); }
.ads-table .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ads-table .strong { font-weight: 700; }
.ads-table td small { display: block; color: var(--muted); font-size: 12px; }
.ads-table td.ad { min-width: 280px; max-width: 460px; }
.ads-table td.ad a { font-weight: 600; text-decoration: none; }
.ads-table td.ad a:hover { text-decoration: underline; }
.ads-table .meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; font-size: 12px; }
.ads-table .type { color: var(--text-2); font-size: 13px; max-width: 160px; }
.badge.warn { background: var(--down-soft); color: var(--down); }
.pager { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; margin: 14px 0 0; font-size: 14px; }
.pager .btn:disabled { opacity: .4; cursor: default; }

@media (max-width: 860px) {
  /* Table rows become cards on small screens. */
  .ads-table thead { display: none; }
  .ads-table, .ads-table tbody, .ads-table tr, .ads-table td { display: block; width: 100%; }
  .ads-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .ads-table td { border: 0; padding: 2px 0; }
  .ads-table td.ad { grid-column: 1 / -1; max-width: none; min-width: 0; }
  .ads-table td.r { text-align: left; }
  .ads-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .ads-table td.hide-sm { display: none; }
  .gf-row select { flex: 1 1 140px; }
}
.gf-row.chips .chip[aria-pressed="false"] { text-decoration: none; color: var(--text-2); background: var(--surface); }
.gf-row.chips .chip[aria-pressed="false"]:hover { background: var(--surface-2); }

/* ---------- Ad pins on the map ---------- */
.pin-icon span {
  display: block; width: 18px; height: 18px; background: var(--gold); border: 2px solid #fff;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.pin-icon:hover span { background: #d99a12; }
.grp-icon span {
  display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text);
  border: 3px solid var(--gold); font: 700 12px/1 system-ui, sans-serif; box-shadow: 0 1px 6px rgba(0,0,0,.3); box-sizing: border-box;
}
.grp-icon:hover span { background: var(--gold-soft); }
.ad-popup .leaflet-popup-content-wrapper, .ad-popup .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.ad-popup .leaflet-popup-content { margin: 12px 14px; font: 13px/1.45 system-ui, -apple-system, sans-serif; }
.pop .muted { color: var(--muted); }
.pop-title { display: block; font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; margin-bottom: 4px; }
.pop-title:hover { text-decoration: underline; }
.pop-price { font-size: 18px; font-weight: 700; }
.pop-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pop-meta { color: var(--text-2); font-size: 12px; }
.pop-open { display: inline-block; margin-top: 8px; text-decoration: none; }
.pop-head { margin-bottom: 6px; }
.pop-rows { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; margin: 0 -4px; }
.pop-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.pop-row a { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-row a:hover { text-decoration: underline; }
.pop-row .v { font-weight: 700; text-align: right; white-space: nowrap; }
.pop-row .v small { font-weight: 400; color: var(--muted); }
.pop-row .small { grid-column: 1 / -1; font-size: 11px; }
.pop-all { margin-top: 8px; width: 100%; }
.ad-row .locate { display: block; margin: 4px 0 0 auto; font-size: 11px; }
.key-pin { display: inline-block; width: 10px; height: 10px; background: var(--gold); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); margin: 0 2px; }
.key-grp { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--gold); font-size: 9px; font-weight: 700; margin: 0 2px; }
.pin-cluster span {
  display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #1c1b18;
  font: 700 12px/1 system-ui, sans-serif; border: 3px solid color-mix(in srgb, var(--gold) 35%, #fff);
  box-shadow: 0 1px 6px rgba(0,0,0,.35); box-sizing: border-box;
}
.pin-cluster:hover span { filter: brightness(1.08); }

/* ---------- Why this price / outlook ---------- */
details.why { border-top: 1px solid var(--border); padding: 10px 0 4px; margin-top: 10px; }
details.why summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: revert; }
details.why .small { margin: 6px 0; }
.drv { margin: 8px 0; }
.drv-top { display: flex; justify-content: space-between; font-size: 13px; }
.drv-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; margin: 3px 0; }
.drv-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .6; }
.drv-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.drv-bar i.up { background: var(--up); }
.drv-bar i.down { background: var(--down); }
.drv-text { font-size: 12px; color: var(--muted); }
.drv-flat { font-size: 12px; color: var(--muted); margin: 6px 0; }
.gap { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; margin: 8px 0 4px; }
.gap.good { background: var(--up-soft); }
.tiny { font-size: 11px; }
.proj-mini { font-size: 13px; margin: 6px 0; }
.st { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 6px; background: var(--surface-2); color: var(--text-2); }
.st-under_construction { background: #e3f3e7; color: #0a7a2f; }
.st-approved { background: #e1edfb; color: #1c5cab; }
.st-proposed { background: #f6ecd2; color: #7a5608; }
.st-stalled, .st-cancelled { background: var(--down-soft); color: var(--down); }
.score { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.score-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 80px; }
.score-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.conf { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.conf-high { background: var(--up-soft); color: var(--up); }
.conf-medium { background: var(--gold-soft); color: var(--text-2); }
.conf-low { background: var(--surface-2); color: var(--muted); }
.reasons { margin: 6px 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }

.outlook-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col-title { font-size: 15px; margin: 0 0 8px; }
#outlook-areas { display: grid; gap: 10px; }
.watch { padding: 14px 16px; }
.watch-head { display: flex; align-items: center; gap: 10px; }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.watch-name { flex: 1; display: grid; }
.parts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.parts b { color: var(--text); margin-left: 3px; }
.research-note { font-size: 13px; background: var(--gold-soft); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.research-note code { font-size: 12px; }
.proj { border-top: 1px solid var(--border); padding: 12px 0; }
.proj:first-of-type { border-top: 0; }
.proj-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.proj .type { font-size: 12px; color: var(--muted); }
.proj p { margin: 4px 0; }
.srcs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.srcs a { color: var(--gold); }
.proj-icon span { display: block; width: 14px; height: 14px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); background: #7a5608; }
.proj-icon.st-under_construction span { background: #0a7a2f; }
.proj-icon.st-approved span { background: #1c5cab; }
.proj-icon.st-proposed span { background: #c9971f; }
@media (max-width: 1060px) { .outlook-grid { grid-template-columns: 1fr; } }

/* ---------- Currency page ---------- */
.sub-h { font-size: 15px; margin: 22px 0 10px; }
.fx-why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-why h3 { font-size: 15px; margin-bottom: 8px; }
.why-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.cause { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.cause-global { background: color-mix(in srgb, var(--d1) 16%, transparent); color: var(--d1); }
.cause-local { background: color-mix(in srgb, var(--d2) 16%, transparent); color: var(--d2); }
.cause-mixed { background: color-mix(in srgb, var(--d4) 18%, transparent); color: var(--text); }
.fx-why .split-bars { margin: 14px 0 6px; }
.fx-why .split-row { grid-template-columns: 110px 1fr 64px; }
.peer-table { margin-top: 10px; font-size: 14px; }
.peer-table summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; }
.peer-table table { margin-top: 6px; }
.factor-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 12px; font-size: 14px; }
.factors li { list-style: none; margin-left: -18px; }
.eff { font-size: 11px; font-weight: 700; margin-right: 4px; white-space: nowrap; }
.eff-weakens { color: var(--down); }
.eff-strengthens { color: var(--up); }
.moves { display: grid; }
.move { display: grid; grid-template-columns: 170px 150px 190px 170px minmax(0, 1fr); align-items: center; gap: 8px 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.move:last-child { border-bottom: 0; }
.move .when { display: flex; flex-direction: column; }
.where-top.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-scroll { overflow-x: auto; margin: 0 -4px; }
.bank-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.bank-table th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.bank-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.bank-table tr:last-child td { border-bottom: 0; }
.bank-table .r { text-align: right; }
.bank-table td.best { color: var(--up); font-weight: 700; background: var(--up-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 4px 8px; font-size: 13px; color: var(--text-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg i { width: 14px; height: 3px; border-radius: 2px; }
.infl-hero { margin-bottom: 16px; }
.infl-hero .hero-prices { align-items: center; }
.infl-month { border-bottom: 1px solid var(--border); padding: 10px 16px; }
.infl-month:last-child { border-bottom: 0; }
.infl-month summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.infl-month summary b { min-width: 140px; }
.infl-month summary .n { font-weight: 700; min-width: 48px; font-variant-numeric: tabular-nums; }
.infl-month p { margin: 8px 0 4px; color: var(--text-2); max-width: 90ch; }
@media (max-width: 960px) {
  .fx-why, .factor-cols { grid-template-columns: 1fr; }
  .where-top.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .move { grid-template-columns: 1fr auto; }
  .move > :nth-child(n+3) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .where-top.four { grid-template-columns: 1fr; }
}
#fx-hero .drivers .pill { white-space: nowrap; }
@media (max-width: 640px) { #fx-hero .drivers .pill { font-size: 14px; padding: 1px 8px; } }
.my-bank { border: 2px solid var(--d1); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.my-bank-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.my-bank-head h3 { font-size: 16px; }
.my-bank select { margin-left: 6px; font: inherit; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.my-bank-rates { display: flex; flex-wrap: wrap; gap: 12px 36px; margin-bottom: 8px; }
.my-bank-rates .l { font-size: 13px; color: var(--text-2); }
.my-bank-rates .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.my-bank-rates .s { font-size: 13px; color: var(--muted); }
.bank-table tr.mine td { box-shadow: inset 0 1px 0 var(--d1), inset 0 -1px 0 var(--d1); }
.bank-table tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--d1), inset 0 1px 0 var(--d1), inset 0 -1px 0 var(--d1); }

/* ---------- Housing page ---------- */
.hs-plan { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.hs-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; position: sticky; top: 120px; }
.hs-form .wide { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.fld input, .fld select { font: inherit; font-size: 15px; color: var(--text); padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.fld.check { flex-direction: row; align-items: center; gap: 8px; }
.fld.check input { width: auto; }
.fld .seg { align-self: flex-start; }
.fld .seg button:disabled { opacity: .4; cursor: not-allowed; }
.hs-form.is-apartment .house-only, .hs-form:not(.is-build) .build-only, .hs-form:not(.is-buy) .buy-only { display: none; }
.hs-form .more summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.hs-result { display: grid; gap: 16px; }
.hs-result.loading { opacity: .5; transition: opacity .15s; }
.hs-result h3 { font-size: 15px; margin-bottom: 8px; }
.hs-where { font-size: 15px; margin-bottom: 8px; }
.hs-big { display: flex; flex-direction: column; margin: 4px 0 8px; }
.hs-big .k { font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.hs-big .v { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hs-big .v small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.hs-verdict { font-size: 15px; line-height: 1.6; color: var(--text-2); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.hs-verdict b { color: var(--text); }
table.kv tr.total td { border-top: 2px solid var(--border); padding-top: 8px; }
.hs-tiles { margin: 14px 0 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hs-proj td small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.hs-comp-head { padding: 12px 16px 0; color: var(--text-2); }
.hs-comp-table td a { font-weight: 600; text-decoration: none; }
.hs-comp-table td a:hover { text-decoration: underline; }
.hs-comp-table td:first-child { min-width: 260px; max-width: 460px; }
.hs-town-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hs-town-tools select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.hs-town-table tbody tr { cursor: pointer; }
.hs-town-table tbody tr:hover, .hs-town-table tbody tr:focus-visible { background: var(--surface-2); }
.hs-market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.hs-market-grid h3 { font-size: 15px; margin-bottom: 8px; }
.legend .lg i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
@media (max-width: 960px) {
  .hs-plan, .hs-market-grid { grid-template-columns: 1fr; }
  .hs-form { position: static; }
}
@media (max-width: 640px) {
  .hs-big .v { font-size: 32px; }
}
.hs-form input, .hs-form select, .hs-form .btn { width: 100%; box-sizing: border-box; }
.hs-form .fld.check input { width: auto; }
.hs-form .btn.wide { padding: 10px; font-size: 15px; }
.hs-note { margin-top: 16px; }
.hs-note h3 { font-size: 15px; margin-bottom: 8px; }
.eff-mixed { color: var(--text-2); }
.hs-form, .more-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 960px) { .hs-plan { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
}
.hs-result { grid-template-columns: minmax(0, 1fr); }
.hs-warn { background: var(--gold-soft); border-radius: 8px; padding: 8px 10px; color: var(--text-2); margin-top: 6px; }

/* ---------- Housing: market today, history, buying ---------- */
.rise { color: var(--text); }
.fall { color: var(--text); }
.pill.rise, .pill.fall { background: var(--surface-2); }
.hs-today { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.today-main { padding: 22px 26px; }
.today-h { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 6px 0 8px; letter-spacing: -0.01em; }
.today-h b { font-weight: 800; }
.today-side { border-left: 1px solid var(--border); padding: 22px 24px; }
.today-side h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.kpi .l { font-size: 12px; color: var(--text-2); }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .c { font-size: 13px; font-weight: 600; }
.kpi .s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ev-mini { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.linkish { all: unset; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; border-radius: 8px; padding: 6px; font-size: 14px; line-height: 1.4; }
.linkish:hover, .linkish:focus-visible { background: var(--surface-2); outline: none; }
.ev-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-2); color: var(--text-2); }
.hs-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small-seg button { padding: 4px 10px; font-size: 13px; }
.seg[hidden] { display: none; }
.section-head.sub { margin-top: 22px; }
.section-head.sub .sub-h { margin: 0; }
.hx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: stretch; }
.chart.tall { height: 380px; }
.hx-note { margin: 8px 4px 2px; }
.hx-events { display: flex; flex-direction: column; min-height: 0; max-height: 520px; }
.hx-events-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.hx-events-head h3 { font-size: 15px; }
.ev-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.ev { border-radius: 10px; padding: 10px; cursor: pointer; border: 1px solid transparent; }
.ev:hover { background: var(--surface-2); }
.ev.on { background: var(--surface-2); border-color: var(--border); }
.ev:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.ev-n { width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); color: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.ev.on .ev-n { background: var(--text); }
.ev-scope { font-weight: 600; }
.ev-scope.global { color: var(--d1); }
.ev-scope.local { color: var(--d2); }
.ev-eff { margin-left: auto; }
.ev-title { display: block; font-size: 14px; margin-top: 4px; }
.ev-body { display: none; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.ev.on .ev-body { display: block; }
.ev-body p { margin: 0 0 6px; line-height: 1.5; }
.yy-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.yy-plot { position: relative; height: 240px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 8px 0 6px; }
.yy-zero { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--muted); opacity: .5; pointer-events: none; }
.yy-col { all: unset; position: relative; display: flex; flex-direction: column; cursor: pointer; border-radius: 6px; }
.yy-col:hover, .yy-col:focus-visible { background: var(--surface-2); }
.yy-col.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.yy-bars2 { position: relative; flex: 1; display: flex; justify-content: center; gap: 2px; }
.yb { position: relative; width: 38%; max-width: 14px; display: block; }
.yb { position: absolute; }
.yb.rs { left: calc(50% - 38% - 1px); background: var(--d1); border-radius: 3px 3px 0 0; }
.yb.us { left: calc(50% + 1px); background: var(--d2); border-radius: 3px 3px 0 0; }
.yb.neg { border-radius: 0 0 3px 3px; }
.yb.none { display: none; }
.yy-lab { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.yy-col.on .yy-lab { color: var(--text); font-weight: 700; }
.yy-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.yy-year { font-size: 22px; font-weight: 800; }
.yy-why h4 { font-size: 13px; margin: 12px 0 6px; color: var(--muted); }
.buy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.buy-grid h3 { font-size: 15px; margin-bottom: 10px; }
.buy-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.buy-head h3 { margin: 0; }
.hbar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.hbar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar-row.loan { grid-template-columns: 170px minmax(0, 1fr) 64px 44px; }
.hbar-row .n small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row.mine { background: color-mix(in srgb, var(--d1) 10%, transparent); border-radius: 8px; padding: 5px 6px; margin: 0 -6px; }
.hbar-row.mine .badge { background: var(--d1); color: #fff; }
.loan-list { margin-bottom: 6px; }
.plan-seg { flex-wrap: wrap; }
.loan-box { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; min-width: 0; }
.loan-box legend { font-size: 13px; color: var(--text-2); padding: 0 4px; }
.hs-form:not(.is-loan) .loan-only, .hs-form:not(.is-rent) .rent-only { display: none; }
.loan-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 6px; }
.loan-sum > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.loan-sum .l { font-size: 12px; color: var(--text-2); }
.loan-sum b { font-size: 18px; font-variant-numeric: tabular-nums; }
.loan-sum small { font-size: 11px; color: var(--muted); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 8px 0; }
.vs-side { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.vs-side .l { font-size: 13px; color: var(--text-2); }
.vs-side .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vs-side .v small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.vs-side .s { font-size: 12px; color: var(--muted); }
.vs-mid { color: var(--muted); font-weight: 700; }
.hs-cash { border-radius: 8px; padding: 8px 10px; margin-top: 8px; background: var(--surface-2); }
.hs-town-table .bar-col { width: 22%; min-width: 80px; }
@media (max-width: 1060px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-grid { grid-template-columns: minmax(0, 1fr); }
  .hx-events { max-height: 420px; }
}
@media (max-width: 960px) {
  .hs-today, .yy-grid, .buy-grid { grid-template-columns: minmax(0, 1fr); }
  .today-side { border-left: 0; border-top: 1px solid var(--border); }
  .loan-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .today-main, .today-side { padding: 16px; }
  .today-h { font-size: 19px; }
  .chart.tall { height: 300px; }
  .hbar-row { grid-template-columns: 110px minmax(0, 1fr) 76px; }
  .hbar-row.loan { grid-template-columns: 120px minmax(0, 1fr) 56px 40px; }
  .loan-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vs { grid-template-columns: minmax(0, 1fr); }
  .vs-mid { text-align: center; }
  .yy-plot { height: 180px; }
  .hs-town-table .bar-col { display: none; }
}
.hs-town-table .hbar, .hbar-row .hbar { display: block; }
.hs-controls select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
#loans-all { margin: 4px 0 8px; }

/* ---------- Housing: every area, rents, building costs ---------- */
.ar-table .bar-col { min-width: 160px; }
.ar-table .bar-col .hbar { display: inline-block; width: calc(100% - 52px); vertical-align: middle; }
.ar-table .bar-col small { margin-left: 6px; font-weight: 600; }
.neg-cell { color: var(--muted); }
#ar-search { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0; }
.rent-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rent-grid h3, .rent-grid h4 { font-size: 15px; margin-bottom: 8px; }
.rent-grid h4 { font-size: 13px; color: var(--muted); margin-top: 12px; }
.chart.short { height: 240px; }
.rt-growth { display: grid; gap: 4px; margin: 8px 4px 2px; color: var(--text-2); }
.rt-growth span { white-space: nowrap; }
#rt-track { margin-top: 8px; }
.bc-hero .today-main { padding: 22px 26px; }
.bc-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.bc-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chart-head .bc-unit { margin-left: auto; }
.bc-calc h3 { font-size: 15px; margin-bottom: 10px; }
.bc-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.bc-inputs input, .bc-inputs select { width: 100%; box-sizing: border-box; }
.bc-t td { padding: 7px 0; }
.mt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mt-card { padding: 12px 14px 10px; display: flex; flex-direction: column; }
.mt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mt-top b { font-size: 14px; line-height: 1.3; }
.mt-ch { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-sub { font-size: 11px; }
.mt-spark { height: 56px; margin: 6px 0; }
.mt-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; color: var(--text-2); font-size: 12px; }
.mt-more summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 4px; }
.mt-more p { margin: 4px 0; }
td.heat { background: color-mix(in srgb, var(--d2) var(--h), transparent); font-variant-numeric: tabular-nums; }
td.heat.neg { background: color-mix(in srgb, var(--d1) var(--h), transparent); }
.bc-years td.why { min-width: 260px; max-width: 420px; color: var(--text-2); }
@media (max-width: 960px) {
  .rent-grid, .bc-grid, .bc-grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .bc-inputs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bc-hero .today-main { padding: 16px; }
  .mt-grid { grid-template-columns: minmax(0, 1fr); }
}
.mt-more-btn { grid-column: 1 / -1; }
.section-head > div, .hs-controls { min-width: 0; max-width: 100%; }
.hs-controls .seg.scroll { flex: 1 1 auto; }
@media (max-width: 640px) { .bc-t td:nth-child(2) { display: none; } .bc-t td { white-space: nowrap; } .bc-t td:first-child { white-space: normal; } }
.mt-groups { margin-bottom: 10px; max-width: 100%; }
.mt-years td { vertical-align: middle; }
.mt-years td:first-child { min-width: 220px; max-width: 320px; }
.mt-years th.sortable { cursor: pointer; }
.mt-years th.sortable:hover { color: var(--text); }
.mt-years th.sortable.on { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
td.heat.strong { font-weight: 700; }
.mt-trend { display: block; }
.mt-foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mt-yrs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; font-size: 12px; font-weight: 600; text-align: center; margin: 4px 0; font-variant-numeric: tabular-nums; }
.mt-yrs small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.mt-yrs .neg { color: var(--d1); }
.mt-years th.est-h { font-style: italic; }
.mt-years th small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); font-style: normal; }
td.heat.est, td.est-none { font-style: italic; outline: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); outline-offset: -4px; }
td.est-none { color: var(--muted); font-size: 12px; }
.mt-yrs { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.mt-yrs .est { font-style: italic; color: var(--text-2); }

/* ---------- Agriculture page ---------- */
.ag-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 16px; }
.ag-controls .wide { grid-column: 1 / -1; }
.ag-size { display: flex; gap: 6px; }
.ag-size input { flex: 1 1 60px; width: 0; }
.ag-cat { font: inherit; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.ag-cat.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ag-zone { font-size: 14px; color: var(--text-2); margin: 0; }
.ag-z { display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 1px 9px; font-size: 13px; margin: 2px 0; }
.ag-z.on { background: var(--up-soft); color: var(--up); font-weight: 600; }
.ag-list-panel { overflow: hidden; }
.ag-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px; align-items: center; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; width: 100%;
  text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
button.ag-row:hover { background: var(--surface-2); }
.ag-row.on { background: var(--gold-soft); }
.ag-row small { display: block; font-size: 12px; color: var(--muted); }
.ag-row .r { text-align: right; }
.ag-row .r small { display: inline; }
.ag-head { cursor: default; font-size: 12px; color: var(--muted); position: sticky; top: 0; background: var(--surface); }
.ag-head .r small { display: block; }
.ag-name b { font-weight: 650; }
.ag-risk { color: var(--down); }
.ag-first small { display: block; }
#ag-crop.loading { opacity: .5; }
.ag-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: flex-start; margin-bottom: 16px; }
.ag-hero-num { display: flex; flex-direction: column; text-align: right; }
.ag-hero-num .k { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.ag-hero-num b { font-size: 32px; letter-spacing: -0.02em; }
.ag-hero-num small { color: var(--muted); }
.ag-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ag-facts b { font-size: 15px; font-weight: 600; }
.ag-where { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin-bottom: 8px; }
.ag-where h3, .ag-money h3, .ag-prices h3, .ag-threat h3 { font-size: 16px; margin: 18px 0 8px; }
.ag-where h3 { margin-top: 0; }
.ag-sys { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; margin: 2px 0; background: var(--surface-2); }
.ag-sys small { color: var(--muted); }
.ag-sys.best { background: var(--up-soft); color: var(--up); font-weight: 600; }
.ag-table-wrap { overflow-x: auto; }
.ag-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.ag-t th { font-size: 12px; color: var(--muted); font-weight: 500; text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ag-t th:first-child, .ag-t td:first-child { text-align: left; }
.ag-t td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.ag-t td small { color: var(--muted); }
.ag-t td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ag-t tr.strong td { font-weight: 650; background: var(--surface-2); }
.ag-warn { color: var(--down); margin-top: 8px; }
.ag-more { margin-top: 12px; }
.ag-more summary { cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 14px; }
.ag-years { display: flex; gap: 4px; align-items: flex-end; height: 140px; margin: 12px 0 6px; }
.ag-yr { flex: 1; display: flex; gap: 2px; align-items: flex-end; height: 100%; position: relative; padding-bottom: 16px; }
.ag-yr small { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.ag-yb { flex: 1; border-radius: 4px 4px 0 0; min-height: 1px; }
.ag-yb.cost { background: var(--d2); }
.ag-yb.inc { background: var(--d3); }
.ag-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ag-tv { font-size: 20px; font-weight: 700; margin: 2px 0; }
.ag-tv small, .ag-row small.u { font-size: 12px; color: var(--muted); font-weight: 400; }
.ag-chart-panel { padding: 8px 0; }
.ag-months { display: flex; gap: 4px; align-items: flex-end; height: 90px; margin-top: 12px; }
.ag-mo { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.ag-mo span { background: var(--d1); opacity: .45; border-radius: 4px 4px 0 0; }
.ag-mo.hi span, .ag-mo.lo span { opacity: 1; }
.ag-mo small { text-align: center; font-size: 11px; color: var(--muted); }
.ag-threats { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ag-threats li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.ag-tk { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; flex: none; min-width: 58px; text-align: center; }
.ag-tk.risk, .ag-tk.market { background: var(--down-soft); color: var(--down); }
.ag-tk.pest { background: var(--gold-soft); color: var(--gold); }
.ag-tk.disease { background: var(--surface-2); color: var(--text-2); }
.ag-src { margin-top: 18px; overflow-wrap: anywhere; }
.ag-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ag-movers h3 { font-size: 15px; margin-bottom: 8px; }
.ag-mv { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 10px; width: 100%; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--border);
  background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.ag-mv:hover { background: var(--surface-2); }
.ag-mv .num:last-child { text-align: right; }
.ag-mv small { color: var(--muted); }
.ag-method a { color: inherit; }
@media (max-width: 960px) {
  .ag-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ag-head { display: none; }
  .ag-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; }
  .ag-name, .ag-first { grid-column: 1 / -1; }
  .ag-row .r { text-align: left; }
  .ag-row .r::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); }
  .ag-where, .ag-movers { grid-template-columns: 1fr; }
  .ag-hero-num { text-align: left; }
  .ag-t { font-size: 13px; }
}
.ag-controls .fld { min-width: 0; }
.ag-controls select, .ag-controls input { width: 100%; }
.ag-size select { width: auto; flex: none; }
#crop, #finder, .ag-money, .ag-prices { min-width: 0; }
.ag-freq { font-weight: 600; color: var(--text-2); }
.ag-harvest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ag-harvest h3 { font-size: 16px; margin-bottom: 8px; }
.ag-h-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: start; }
.ag-h-row:last-child { border-bottom: 0; }
.ag-h-f { font-weight: 600; font-size: 14px; padding-top: 4px; }
.ag-h-cs { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-h-c { font: inherit; font-size: 13px; text-align: left; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 4px 10px; cursor: pointer; }
.ag-h-c:hover { border-color: var(--text-2); }
.ag-h-c small { display: block; font-size: 11px; color: var(--muted); }
.ag-h-c small:empty { display: none; }
.ag-h-c sup { color: var(--gold); }
.ag-h-c.off { opacity: .35; }
@media (max-width: 960px) { .ag-harvest { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ag-h-row { grid-template-columns: 1fr; gap: 6px; } }
.ag-h-c small.ag-pick { color: var(--up); font-weight: 600; }
.ag-h-c small.ag-pick.down { color: var(--down); }

/* =====================================================================
   App shell (Hootsuite-style): icon rail · section sidebar · top bar
   ===================================================================== */
body { display: grid; grid-template-columns: 104px 300px minmax(0, 1fr); min-height: 100vh; }
.side-closed body { grid-template-columns: 104px minmax(0, 1fr); }
.ico { width: 24px; height: 24px; display: block; }

/* Icon rail */
.app-rail { position: sticky; top: 0; height: 100vh; background: var(--rail); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 6px; z-index: 30; overflow-y: auto; scrollbar-width: none; }
.rail-logo { display: grid; place-items: center; margin-bottom: 14px; text-decoration: none; }
.owl { width: 52px; height: 52px; border-radius: 50%; background: #0e2a3b; display: flex; align-items: center; justify-content: center; gap: 5px; }
.owl i { width: 14px; height: 14px; border-radius: 50%; background: #ffca6e; box-shadow: inset 0 0 0 4px #0e2a3b; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 0; background: none; cursor: pointer;
  text-decoration: none; color: var(--text); font-size: 14px; border-radius: 12px; font-family: inherit; }
.rail-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.rail-item:hover .rail-ico { background: var(--surface-2); }
.rail-item.on .rail-ico { background: var(--navy); color: var(--on-navy); }
.rail-item.on .rail-label { font-weight: 700; }
.rail-item.soon { opacity: .5; cursor: default; }
.rail-item:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
.rail-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; }
.rail-avatar { width: 44px; height: 44px; border-radius: 50%; background: #c9c7c1; position: relative; overflow: hidden; }
.rail-avatar::before { content: ""; position: absolute; left: 50%; top: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #2b2b2b; }
.rail-avatar::after { content: ""; position: absolute; left: 50%; top: 27px; width: 30px; height: 24px; margin-left: -15px; border-radius: 50% 50% 0 0; background: #2b2b2b; }

/* Section sidebar */
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--border);
  padding: 22px 0 20px; display: flex; flex-direction: column; min-width: 0; }
.side-closed .side { display: none; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 22px 0 32px; margin-bottom: 26px; }
.side-title { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
.side-sub { font-size: 17px; color: var(--text-2); }
.side-label { font-size: 15px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); padding: 0 52px 10px; }
.subnav { display: flex; flex-direction: column; gap: 0; }
.subnav a { display: block; padding: 13px 52px; font-size: 19px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subnav a:hover { background: color-mix(in srgb, var(--here) 35%, transparent); }
.subnav a.on { background: var(--here); color: #1c1c1c; font-weight: 700; }
.side-card { margin: 28px 52px 0; padding-top: 22px; border-top: 1px solid var(--border); font-size: 16px; color: var(--text-2); display: grid; gap: 12px; }
.side-card b { display: block; color: var(--text); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--pill); }
.icon-btn .ico { width: 20px; height: 20px; }

/* Top bar */
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1100; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .open-side { display: none; }
.side-closed .topbar .open-side { display: grid; }
.back { width: 56px; height: 56px; border-radius: 50%; background: var(--pill); color: var(--pill-text); display: grid; place-items: center; flex: none; }
.back:hover { filter: brightness(.96); }
.topbar-sep { width: 1px; height: 28px; background: var(--border); }
.topbar-title { font-size: 34px; font-weight: 600; letter-spacing: -0.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-amber, .btn-green { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; padding: 11px 18px; font: inherit; font-size: 18px;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-amber { background: var(--amber); color: #1c1c1c; }
.btn-green { background: var(--green); color: #fff; }
.btn-amber:hover, .btn-green:hover { filter: brightness(1.05); }
.top-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 18px; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.top-link:hover { background: var(--surface-2); color: var(--text); }

main { max-width: 1440px; width: 100%; margin: 0; padding: 24px 28px 40px; gap: 28px; }
.anchor { scroll-margin-top: 104px; }
.day { top: 100px; max-height: calc(100vh - 116px); }
.hs-form { top: 100px; }

/* =====================================================================
   Components restyled to the same system
   ===================================================================== */
h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 17px; font-weight: 700; }
.section-head p { font-size: 16px; color: var(--text-2); }
.panel { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; }
.panel-body { padding: 22px 24px; }
/* Card titles read like Hootsuite's: bold, uppercase in chart cards */
.chart-head h3, .panel > h3:first-child, .panel-body > h3:first-child { text-transform: uppercase; letter-spacing: .02em; font-size: 16px; }

/* Toggle groups: grey-blue pill with a navy selected segment (like 1D | 7D) */
.seg { background: var(--pill); border-radius: 999px; padding: 0; overflow: hidden; }
.seg button { border-radius: 0; color: var(--pill-text); font-weight: 600; padding: 8px 16px; font-size: 15px; }
.seg button.on { background: var(--navy); color: var(--on-navy); box-shadow: none; }
.seg button:first-child { padding-left: 20px; }
.seg button:last-child { padding-right: 20px; }
.seg.small button { padding: 5px 10px; font-size: 13px; }

/* Buttons and selects */
.btn { border: 1px solid var(--pill-text); color: var(--pill-text); background: var(--surface); border-radius: 4px; font-weight: 700; padding: 7px 14px; font-size: 15px; }
.btn:hover { background: var(--pill); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #1c1c1c; }
.btn.primary:hover { background: var(--amber); filter: brightness(1.05); }
.btn.tiny { padding: 2px 9px; font-size: 13px; }
.link { color: var(--link); text-decoration: underline; }
select, .fld select, .fld input, .select-wrap select, .gf-row select, .list-head select {
  font-family: inherit; border-radius: 999px; background: var(--pill); color: var(--pill-text); border: 0; font-weight: 600; padding: 9px 14px; }
.fld { font-size: 15px; font-weight: 600; color: var(--text-2); }
.search, .grid-filters .search { border-radius: 4px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; }
.chip { border-radius: 999px; font-family: inherit; }
.ag-cat { font-family: inherit; font-weight: 600; border-radius: 999px; background: var(--pill); color: var(--pill-text); border: 0; padding: 7px 14px; font-size: 14px; }
.ag-cat.on { background: var(--navy); color: var(--on-navy); border: 0; }

/* KPI and tiles: big numbers, small uppercase labels, change underneath */
.tile, .kpi, .hc-fact { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.kpi .v, .tile .v { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.hero-price .v { font-size: 52px; font-weight: 700; }
.hero-price .k, .hs-big .k, .ag-hero-num .k { color: var(--text-2); letter-spacing: .04em; }
.pill { border-radius: 999px; }
.tooltip { font-family: var(--font); border-radius: 6px; }

/* Links inside text read as links */
.hero-story a, .help-grid a, .ag-src a, .listing-note a { color: var(--link); }
.hc-go { color: var(--link); }

/* Tables */
.ag-t th, .ads-table th, .bank-table th { font-size: 14px; font-weight: 700; color: var(--text-2); text-transform: none; }
.ag-row, .cmp-row, .area-row, .rung { font-size: 16px; }
.ag-row.on { background: color-mix(in srgb, var(--here) 40%, var(--surface)); }
.ag-head { font-size: 14px; font-weight: 700; color: var(--text-2); }
.ag-row small, .cmp-row .name small { font-size: 14px; }

/* Home: the welcome line lives in the top bar now */
.welcome h1 { font-size: 26px; }

/* =====================================================================
   Narrow screens: rail becomes a bottom tab bar, sidebar a scrolling strip
   ===================================================================== */
@media (max-width: 1180px) {
  body { grid-template-columns: 96px 240px minmax(0, 1fr); }
  .side-head { padding: 0 16px 0 22px; }
  .side-label { padding: 0 22px 8px; }
  .subnav a { padding: 11px 22px; font-size: 17px; }
  .side-card { margin: 24px 22px 0; }
  .side-title { font-size: 28px; }
}
@media (max-width: 900px) {
  body, .side-closed body { display: block; padding-bottom: 76px; }
  .app-rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border); overflow-x: auto; gap: 0; }
  .rail-logo, .rail-item.soon { display: none; }
  .rail-foot { margin: 0; padding: 0; display: flex; }
  .rail-item { flex: 1 0 64px; padding: 4px 2px; font-size: 12px; gap: 2px; }
  .rail-ico { width: 36px; height: 36px; }
  .rail-ico .ico { width: 20px; height: 20px; }
  .rail-avatar { width: 32px; height: 32px; }
  .rail-avatar::before { top: 6px; width: 12px; height: 12px; margin-left: -6px; }
  .rail-avatar::after { top: 20px; width: 22px; height: 18px; margin-left: -11px; }
  .side, .side-closed .side { display: block; position: fixed; top: 64px; left: 0; right: 0; height: auto; z-index: 1000; padding: 0; border-right: 0;
    border-bottom: 1px solid var(--border); overflow: visible; }
  body:has(.side .subnav) main { padding-top: 66px; }
  .side-head, .side-label, .side-card { display: none; }
  .side:not(:has(.subnav)) { display: none; }
  .subnav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px 10px; gap: 4px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; overflow: visible; padding: 7px 14px; font-size: 15px; border-radius: 999px; }
  .topbar { min-height: 64px; padding: 8px 16px; gap: 10px; }
  .topbar .open-side, .side-closed .topbar .open-side { display: none; }
  .back { width: 40px; height: 40px; }
  .topbar-title { font-size: 22px; }
  .topbar-actions .top-link span { display: none; }
  main { padding: 16px; }
  .anchor { scroll-margin-top: 124px; }
  .day, .hs-form { top: 124px; }
}
.explore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.explore { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text-2); font-size: 16px; }
.explore b { color: var(--text); font-size: 18px; }
.explore .btn { margin-top: auto; align-self: flex-start; padding: 10px 22px; font-size: 16px; }
@media (max-width: 960px) { .explore-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .explore-grid { grid-template-columns: 1fr; } }
.ag-controls .ag-size input { flex: 1 1 70px; width: auto; min-width: 64px; }
.ag-controls .ag-size select { flex: 0 1 auto; width: auto; min-width: 0; }
/* Agriculture: beginner explanations and month-by-month money */
.ag-explain, .ag-monthly, .ag-grow { margin-top: 8px; }
.ag-explain h3, .ag-monthly h3, .ag-grow h3 { font-size: 18px; margin: 22px 0 8px; }
.ag-explain p { font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 80ch; margin-bottom: 8px; }
.ag-explain b { color: var(--text); }
.ag-plan-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 14px; }
.ag-plan-kpis { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.ag-plan-kpis .kpi { padding: 12px 16px; min-width: 190px; flex: 1; }
.ag-plan-kpis .kpi .v { font-size: 26px; }
.ag-mbars { display: flex; gap: 6px; align-items: flex-end; height: 150px; margin: 8px 0 6px; }
.ag-mb { flex: 1; display: flex; gap: 2px; align-items: flex-end; height: 100%; position: relative; padding-bottom: 18px; }
.ag-mb small { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.ag-mb-in, .ag-mb-out { flex: 1; border-radius: 4px 4px 0 0; min-height: 1px; }
.ag-mb-in { background: var(--d4); }
.ag-mb-out { background: var(--d2); }
.ag-plan tr.harvest td { background: color-mix(in srgb, var(--d4) 8%, transparent); }
.ag-plan td:nth-child(2) { text-align: left; min-width: 260px; }
.ag-callout { background: var(--gold-soft); border-radius: 8px; padding: 12px 14px; margin-top: 12px; font-size: 16px; }
.ag-guide { display: grid; gap: 6px; }
.ag-guide details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; background: var(--surface); }
.ag-guide summary { cursor: pointer; font-weight: 700; }
.ag-guide p { margin-top: 6px; color: var(--text-2); font-size: 16px; line-height: 1.55; }
.ag-gloss dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; margin: 10px 0 0; font-size: 16px; }
.ag-gloss dt { font-weight: 700; }
.ag-gloss dd { margin: 0; color: var(--text-2); }
@media (max-width: 640px) { .ag-gloss dl { grid-template-columns: 1fr; } .ag-gloss dd { margin-bottom: 6px; } .ag-plan-kpis .kpi { min-width: 0; } }
.ag-plan th:nth-child(2) { text-align: left; }
@media (max-width: 640px) {
  .ag-plan-kpis { display: grid; grid-template-columns: 1fr; width: 100%; }
  .ag-plan-top .fld { width: 100%; }
  .ag-plan td:nth-child(2) { min-width: 180px; }
}

/* ---------- Gold: where the price is heading ---------- */
.go-kpis { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.go-kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.go-kpi .l { font-size: 14px; font-weight: 700; color: var(--text-2); }
.go-kpi .v { font-size: 30px; }
.go-kpi .s { font-size: 14px; color: var(--text-2); }
.go-kpi.now { background: var(--surface); border-color: var(--navy); }
.go-chance { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.go-chance .bar { flex: 0 0 60px; height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.go-chance .bar i { display: block; height: 100%; background: var(--d1); }
.go-claude-mini { margin-top: 6px; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.go-sc { border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: 12px; }
.go-sc.down, .go-s.down .go-s-bar i { background: var(--down-soft); color: var(--down); }
.go-sc.base { background: color-mix(in srgb, var(--d1) 15%, transparent); color: var(--d1); }
.go-sc.up { background: var(--up-soft); color: var(--up); }
.go-fan-panel { margin-bottom: 16px; }
.go-fan-wrap { position: relative; }
#go-fan { display: block; width: 100%; }
.go-grid { stroke: var(--grid); stroke-width: 1; }
.go-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.go-b80 { fill: var(--d1); opacity: .14; }
.go-b50 { fill: var(--d1); opacity: .26; }
.go-mid { fill: none; stroke: var(--d1); stroke-width: 2; stroke-dasharray: 5 4; }
.go-hist { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.go-today { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.go-hover { stroke: var(--muted); stroke-width: 1; }
.go-sc-bar { stroke-width: 4; stroke-linecap: round; }
.go-sc-bar.down { stroke: var(--down); }
.go-sc-bar.base { stroke: var(--d5); }
.go-sc-bar.up { stroke: var(--up); }
.go-sw50 { background: color-mix(in srgb, var(--d1) 40%, var(--surface)); }
.go-sw80 { background: color-mix(in srgb, var(--d1) 18%, var(--surface)); }
.go-mid-k { color: var(--d1); }
.go-sc-k { display: inline-flex; align-items: center; gap: 3px; }
.go-sc-k i { width: 4px; height: 12px; border-radius: 2px; display: inline-block; }
.go-sc-k i.down { background: var(--down); } .go-sc-k i.base { background: var(--d5); } .go-sc-k i.up { background: var(--up); }
#go-claude { margin-bottom: 16px; }
.go-c-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.go-summary { font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 90ch; margin-bottom: 16px; }
.go-scen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.go-s { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--c, var(--d1)); }
.go-s.down { --c: var(--down); } .go-s.base { --c: var(--d5); } .go-s.up { --c: var(--up); }
.go-s-top { display: flex; justify-content: space-between; align-items: baseline; }
.go-s-chance { font-size: 26px; font-weight: 700; }
.go-s-chance small { font-size: 13px; font-weight: 400; color: var(--muted); }
.go-s-bar { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.go-s-bar i { display: block; height: 100%; background: var(--c); }
.go-s-rng { display: flex; justify-content: space-between; font-size: 15px; border-bottom: 1px solid var(--border); padding: 4px 0; }
.go-s-rng span { color: var(--muted); }
.go-s p { font-size: 15px; color: var(--text-2); }
.go-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin-bottom: 14px; }
.go-two h4 { font-size: 16px; margin: 0 0 8px; }
.go-two ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; color: var(--text-2); }
.go-drivers, .go-dates { list-style: none; padding-left: 0 !important; }
.go-drivers li b, .go-dates li b { color: var(--text); }
.go-push { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 8px; margin-right: 6px; }
.go-push.up { background: var(--up-soft); color: var(--up); } .go-push.down { background: var(--down-soft); color: var(--down); } .go-push.mixed { background: var(--surface-2); color: var(--text-2); }
.go-dates li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.go-date { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.go-src a { color: var(--link); }
.go-grid-2, .go-grid { }
#outlook-sec .go-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.go-an { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.go-an .kpi { padding: 12px 14px; }
.go-an .kpi .l { font-size: 13px; font-weight: 700; color: var(--text-2); }
.go-an .kpi .s { font-size: 13px; color: var(--muted); }
#go-events, #go-track { margin-bottom: 16px; }
#go-reliab h3, #go-analog h3, #go-events h3, #go-track h3, #go-claude h3 { margin-bottom: 6px; }
.go-ev tr.sub th { font-size: 12px; }
.go-callout { background: var(--gold-soft); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
@media (max-width: 1100px) { .go-kpis { grid-template-columns: 1fr 1fr; } .go-scen { grid-template-columns: 1fr; } }
@media (max-width: 760px) { #outlook-sec .go-grid, .go-two { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .go-kpis { grid-template-columns: 1fr; } .go-kpi .v { font-size: 26px; } }
#outlook-sec .go-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#outlook-sec .go-grid > * { min-width: 0; }
@media (max-width: 760px) { #outlook-sec .go-grid, .go-two { grid-template-columns: minmax(0, 1fr); } }
.go-ev td:nth-child(2), .go-ev td:nth-child(3), .go-ev th:nth-child(2), .go-ev th:nth-child(3) { text-align: left; }
#go-track .ag-t td:nth-child(2), #go-track .ag-t td:nth-child(3), #go-track .ag-t th:nth-child(2), #go-track .ag-t th:nth-child(3),
#go-track .ag-t td:nth-child(5), #go-track .ag-t td:nth-child(6), #go-track .ag-t th:nth-child(5), #go-track .ag-t th:nth-child(6) { text-align: left; }
#go-track .ag-t td:nth-child(3) { min-width: 260px; }
#go-fan-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
#go-fan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.go-key { display: inline-block; width: 18px; border-radius: 2px; }
.bank-table tr.stale td { color: var(--muted); }
.bank-table tr.stale td b { color: var(--text-2); }
/* Claude's outlook as scannable points */
.go-bottom { background: var(--gold-soft); border-left: 4px solid var(--amber); border-radius: 8px; padding: 14px 18px; margin: 4px 0 14px; }
.go-bottom-k { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.go-bottom p { font-size: 18px; line-height: 1.5; margin-top: 4px; color: var(--text); }
.go-bottom .go-bottom-sub { font-size: 15px; color: var(--text-2); }
.go-h4 { font-size: 16px; margin: 0 0 6px; }
.go-pts { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.go-pts li::marker { color: var(--muted); }
.go-key-pts { font-size: 16px; margin-bottom: 18px; max-width: 95ch; }
.pts b.pt-n { color: var(--text); font-weight: 700; }
.pts b.pt-k, .go-d b.pt-k, .go-bottom b.pt-k, .pt-k { color: var(--text); background: color-mix(in srgb, var(--amber) 22%, transparent); border-radius: 3px; padding: 0 2px; }
.go-d b.pt-n, .go-bottom b.pt-n { color: var(--text); }
.go-s-sec { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.go-s .go-pts { font-size: 14px; gap: 4px; }
.go-trig li::marker { content: "→ "; color: var(--c); }
.go-drivers li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.go-drivers .go-push { text-align: center; margin: 2px 0 0; }
.go-d { display: block; font-size: 14px; color: var(--text-2); margin-top: 2px; }
.go-two .go-pts { font-size: 15px; }
@media (max-width: 640px) { .go-bottom p { font-size: 16px; } .go-bottom { padding: 12px 14px; } }
/* Point form everywhere: short bullets, key facts in bold */
.pts { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 5px; line-height: 1.5; color: var(--text-2); }
.pts li::marker { color: var(--muted); }
.pts b { color: var(--text); }
.pts.small { font-size: 14px; gap: 3px; }
.pts.muted { color: var(--muted); }
.section-head .pts { font-size: 16px; margin-top: 4px; }
.section-head .pts li { max-width: 110ch; }
.listing-note .pts, .chart-note .pts { margin-top: 2px; }
.note-pts { font-size: 16px; margin-bottom: 10px; }
.note-h { font-size: 15px; margin: 14px 0 2px; }
.note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
@media (max-width: 640px) { .note-grid { grid-template-columns: minmax(0, 1fr); } }
.help-grid .pts b, .help-grid .pts li b { display: inline; }
.help-grid .pts { margin-top: 2px; }
.guide-card .pts b { display: inline; margin: 0; }
.hero-pts { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 4px 0 8px; gap: 6px; }
.hero-pts b { color: var(--text); }
.hs-warn .pts { margin: 0; }
@media (max-width: 640px) { .hero-pts { font-size: 16px; } }

/* ---------- Agriculture: My land ---------- */
.ml-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.ml-map-panel { overflow: hidden; isolation: isolate; min-height: 380px; }
#ml-map { height: 100%; min-height: 380px; }
.ml-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-head h3 { font-size: 20px; }
.ml-where { color: var(--text-2); margin: 4px 0 8px; }
.ml-zones { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ml-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.ml-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.ml-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ml-tiles .kpi { padding: 12px 14px; }
.ml-tiles .kpi .l { font-size: 13px; font-weight: 700; color: var(--text-2); }
.ml-tiles .kpi .v { font-size: 24px; }
.ml-tiles .kpi .s { font-size: 13px; color: var(--muted); }
.ml-spark { height: 80px; }
.ml-income { background: var(--up-soft); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.ml-inc-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ml-inc-main .k { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--up); width: 100%; }
.ml-inc-main b { font-size: 30px; }
.ml-est { font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: 0 6px; }
.ml-threats { font-size: 15px; line-height: 2; }
.ml-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 8px; }
.ml-form .wide { grid-column: 1 / -1; }
.ml-in { display: flex; align-items: center; gap: 6px; }
.ml-in input { flex: 1; min-width: 0; width: 100%; }
.ml-sep { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.ml-actions { display: flex; align-items: center; gap: 10px; }
.ml-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.ml-ads td:nth-child(2), .ml-ads th:nth-child(2), .ml-ads td:nth-child(6), .ml-ads th:nth-child(6) { text-align: left; }
.ml-ads td:nth-child(2) { min-width: 220px; }
@media (max-width: 1100px) { .ml-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ml-top, .ml-two { grid-template-columns: minmax(0, 1fr); } .ml-map-panel, #ml-map { min-height: 300px; } }
@media (max-width: 480px) { .ml-form { grid-template-columns: minmax(0, 1fr); } .ml-tiles { grid-template-columns: minmax(0, 1fr); } .ml-tiles.four { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Learn: growing guides ---------- */
.lr-head { display: grid; gap: 14px; }
.lr-title h2 { font-size: 28px; }
.lr-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.lr-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.lr-progress { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }
.lr-bar { width: 240px; max-width: 50%; height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.lr-bar i { display: block; height: 100%; background: var(--up); }
.lr-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.lr-outline { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 12px 8px; }
.lr-ch { margin-bottom: 10px; }
.lr-ch-t { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; }
.lr-ch-t span { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-size: 12px; letter-spacing: 0; }
.lr-ol { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 8px 7px 12px; border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }
.lr-ol:hover { background: var(--surface-2); }
.lr-ol.on { background: var(--here); color: #1c1c1c; font-weight: 700; }
.lr-ol span { flex: 1; }
.lr-tick { color: var(--up); font-weight: 800; }
.lr-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lr-lv-beginner { --lv: var(--d4); }
.lr-lv-intermediate { --lv: var(--d1); }
.lr-lv-expert { --lv: var(--d5); }
.lr-dot { background: var(--lv); }
.lr-badge { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--lv); border: 1.5px solid var(--lv); border-radius: 999px; padding: 2px 10px; }
.lr-levels .ag-cat.on { background: var(--navy); color: var(--on-navy); }
.lr-main { display: grid; gap: 16px; min-width: 0; }
.lr-count { font-size: 14px; color: var(--muted); }
.lr-card { padding: 26px 30px; display: grid; gap: 14px; scroll-margin-top: 110px; }
.lr-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lr-chap { font-size: 14px; font-weight: 700; color: var(--muted); }
.lr-card-title { font-size: 28px; line-height: 1.2; }
.lr-pts { font-size: 18px; gap: 10px; color: var(--text-2); }
.lr-pts b { color: var(--text); }
.lr-t { max-width: 760px; }
.lr-t td, .lr-t th { text-align: left; }
.lr-tip { background: var(--gold-soft); border-left: 4px solid var(--amber); border-radius: 8px; padding: 12px 16px; }
.lr-tip > b { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); }
.lr-tip .pts { list-style: none; padding-left: 0; font-size: 16px; color: var(--text); }
.lr-src { display: flex; flex-direction: column; gap: 4px; font-size: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.lr-src span { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lr-src a { color: var(--link); }
.lr-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.lr-card-foot .btn:disabled { opacity: .4; cursor: default; }
.lr-learned { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.lr-learned input { width: 20px; height: 20px; accent-color: var(--up); }
@media (max-width: 960px) {
  .lr-body { grid-template-columns: minmax(0, 1fr); }
  .lr-outline { position: static; max-height: none; }
  .lr-card { padding: 20px; }
  .lr-card-title { font-size: 24px; }
  .lr-pts { font-size: 17px; }
}
/* the rail holds 8 sections now: keep it on one laptop screen */
.app-rail { gap: 0; padding-top: 12px; padding-bottom: 12px; }
.app-rail .rail-item { padding: 5px 2px; gap: 2px; }
.app-rail .rail-ico { width: 42px; height: 42px; }
.app-rail .rail-logo { margin-bottom: 8px; }
.app-rail .owl { width: 46px; height: 46px; }
.app-rail .rail-avatar { width: 38px; height: 38px; }
@media (max-width: 900px) { .app-rail .rail-ico { width: 36px; height: 36px; } }
.ag-guide-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.ag-guide-link .btn { text-decoration: none; }

/* =====================================================================
   Design v3: soft fintech (warm grey canvas, white rounded cards, pastel accents,
   pill controls, floating pill nav with circle icons). Overrides the blocks above.
   ===================================================================== */
body { background: var(--bg); font-family: var(--font); letter-spacing: -0.005em; }
h1, h2, h3, .topbar-title, .side-title { letter-spacing: -0.02em; }
h2 { font-size: 24px; font-weight: 700; }

/* Cards: big radius, no border, soft lift */
.panel { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.panel-body { padding: 24px 26px; }
.chart-head h3, .panel > h3:first-child, .panel-body > h3:first-child { text-transform: none; letter-spacing: -0.01em; font-size: 18px; }

/* Number tiles: pastel cards with big tight numbers, cycling sage / lavender / periwinkle / peach */
.tile, .kpi, .hc-fact { border: 0; border-radius: 22px; background: var(--surface-2); padding: 16px 18px; }
:is([class*="kpis"], [class*="tiles"], .hc-facts, .kpi-row) > :is(.kpi, .tile, .hc-fact, .go-kpi):nth-child(4n+1) { background: var(--sage); }
:is([class*="kpis"], [class*="tiles"], .hc-facts, .kpi-row) > :is(.kpi, .tile, .hc-fact, .go-kpi):nth-child(4n+2) { background: var(--lavender); }
:is([class*="kpis"], [class*="tiles"], .hc-facts, .kpi-row) > :is(.kpi, .tile, .hc-fact, .go-kpi):nth-child(4n+3) { background: var(--periwinkle); }
:is([class*="kpis"], [class*="tiles"], .hc-facts, .kpi-row) > :is(.kpi, .tile, .hc-fact, .go-kpi):nth-child(4n+4) { background: var(--peach); }
.tile.good { background: var(--up-soft); }
.kpi .v, .tile .v { font-weight: 700; letter-spacing: -0.03em; }
.kpi .l, .tile .l { color: var(--text-2); font-weight: 500; }
.hero-price .v { font-size: 56px; font-weight: 700; letter-spacing: -0.04em; }
.hero-price .k, .hs-big .k, .ag-hero-num .k { color: var(--muted); font-weight: 600; letter-spacing: 0; }

/* Home: the first two cards are pastel feature cards, the explore links are pastel tiles */
.home-card { border-radius: var(--radius); }
.home-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(20, 20, 20, 0.08); }
.home-grid > .home-card:nth-child(1), .home-cards > .home-card:nth-child(1) { background: var(--sage); }
.home-grid > .home-card:nth-child(2), .home-cards > .home-card:nth-child(2) { background: var(--lavender); }
.explore { background: var(--surface); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); transition: transform .15s; }
.explore:hover { transform: translateY(-2px); }
.explore:nth-child(4n+1) { background: var(--periwinkle); }
.explore:nth-child(4n+2) { background: var(--sage); }
.explore:nth-child(4n+3) { background: var(--lavender); }
.explore:nth-child(4n+4) { background: var(--peach); }
.explore .btn { align-self: flex-start; margin-top: auto; }

/* Toggle groups: soft grey track, the selected option is a raised white pill (like 1W) */
.seg { background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; overflow: visible; }
.seg button { border-radius: 999px; color: var(--muted); font-weight: 600; padding: 7px 16px; font-size: 14px; }
.seg button:first-child, .seg button:last-child { padding-left: 16px; padding-right: 16px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--here); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06); }
.seg.small button { padding: 5px 11px; font-size: 13px; }

/* Filter chips: soft pills, the selected one blue (like All) */
.ag-cat, .chip { border: 0; background: var(--surface-2); color: var(--text-2); font-weight: 600; border-radius: 999px; }
.ag-cat { padding: 8px 16px; }
.ag-cat:hover, .chip:hover { color: var(--text); }
.ag-cat.on, .chip.on { background: var(--navy); color: var(--on-navy); text-decoration: none; }

/* Buttons: white pills; primary actions are blue pills (like Get Started) */
.btn { border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600; padding: 9px 18px; font-size: 14px; }
.btn:hover { background: var(--pill); }
.btn.primary, .btn-amber, .btn-green { background: var(--navy); color: var(--on-navy); border: 0; border-radius: 999px; font-weight: 600; }
.btn.primary:hover, .btn-amber:hover, .btn-green:hover { background: var(--navy); filter: brightness(1.08); }
.btn.tiny { padding: 3px 10px; font-size: 12px; }
.btn-amber, .btn-green { padding: 11px 22px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: default; }
select, .fld select, .fld input, .select-wrap select, .gf-row select, .list-head select { background: var(--surface-2); color: var(--text); border-radius: 999px; }
.search, .grid-filters .search { border-radius: 999px; border: 0; background: var(--surface-2); padding-left: 16px; }
:is(.seg button, .chip, .btn, .ag-cat):focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Chart tooltips: white rounded bubbles */
.tooltip { border: 0; border-radius: 16px; box-shadow: 0 10px 30px rgba(20, 20, 20, 0.14); padding: 12px 14px; }

/* Rows and tables: soft pastel-free rows with rounded hover */
.ag-row.on { background: var(--periwinkle); }
.ag-t th, .ads-table th, .bank-table th { color: var(--muted); font-weight: 600; }

/* ---------- Shell ---------- */
/* Floating pill nav: white rounded column, grey circle icons, the current one a blue circle */
.app-rail { top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px; background: var(--surface); border: 0; border-radius: 40px;
  box-shadow: var(--shadow); padding: 14px 6px; gap: 2px; }
.rail-logo { margin-bottom: 10px; }
.owl { background: var(--text); }
.owl i { background: var(--bg); box-shadow: inset 0 0 0 4px var(--text); }
.rail-item { color: var(--muted); font-size: 12px; font-weight: 500; }
.rail-ico { background: var(--surface-2); color: var(--text); }
.app-rail .rail-ico { width: 44px; height: 44px; }
.rail-item:hover .rail-ico { background: var(--pill); }
.rail-item.on .rail-ico { background: var(--navy); color: var(--on-navy); box-shadow: 0 4px 12px color-mix(in srgb, var(--navy) 35%, transparent); }
.rail-item.on .rail-label { color: var(--text); font-weight: 600; }
.rail-avatar { background: var(--lavender); }
.rail-avatar::before, .rail-avatar::after { background: var(--d1); }
body { grid-template-columns: 104px 280px minmax(0, 1fr); }
.side-closed body { grid-template-columns: 104px minmax(0, 1fr); }

/* Section menu: plain canvas, items are pills, the current one a raised white pill */
.side { background: transparent; border-right: 0; padding-top: 28px; }
.side-head { padding: 0 18px 0 24px; }
.side-title { font-size: 30px; font-weight: 700; }
.side-sub { font-size: 15px; color: var(--muted); }
.side-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 28px 8px; letter-spacing: .06em; }
.subnav { gap: 2px; padding: 0 14px; }
.subnav a { padding: 11px 16px; font-size: 16px; font-weight: 500; border-radius: 999px; color: var(--text-2); }
.subnav a:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
.subnav a.on { background: var(--here); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.side-card { margin: 24px 14px 0; padding: 18px; border-top: 0; border-radius: 24px; background: var(--periwinkle); font-size: 14px; }
.icon-btn { background: var(--surface); box-shadow: var(--shadow); width: 44px; height: 44px; }
.icon-btn:hover { background: var(--surface-2); }

/* Top bar: canvas colour, round white icon buttons, greeting with avatar on the right */
.topbar { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 0; min-height: 88px; }
.back { width: 48px; height: 48px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.topbar-sep { display: none; }
.topbar-title { font-size: 30px; font-weight: 700; }
.live-status { background: var(--surface); border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); font-size: 13px; }
.top-link { font-size: 15px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); padding: 9px 16px; }
.hello { display: flex; align-items: center; gap: 10px; padding-left: 6px; text-decoration: none; color: var(--text); }
.hello-av { width: 44px; height: 44px; border-radius: 50%; background: var(--lavender); color: var(--d1); display: grid; place-items: center;
  font-weight: 700; font-size: 17px; flex: none; }
.hello-t { display: grid; line-height: 1.2; }
.hello-t small { color: var(--muted); font-size: 12px; }
.hello-t b { font-size: 15px; font-weight: 600; text-transform: capitalize; }

/* Progress bars: coloured, rounded */
.lr-bar { border-radius: 999px; background: var(--surface-2); }
.lr-bar i { border-radius: 999px; background: var(--d1); }

@media (max-width: 1180px) { .hello-t { display: none; } }
@media (max-width: 900px) {
  body, .side-closed body { grid-template-columns: minmax(0, 1fr); }
  /* Floating pill tab bar at the bottom */
  .app-rail { position: fixed; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; height: auto;
    border-radius: 999px; padding: 6px 8px; box-shadow: 0 8px 28px rgba(20, 20, 20, .14); }
  .app-rail .rail-ico { width: 38px; height: 38px; }
  .rail-item .rail-label { display: none; }
  .side, .side-closed .side { background: var(--bg); }
  .subnav { flex-direction: row; padding: 8px 12px; }
  .subnav a { padding: 8px 14px; font-size: 14px; }
  .topbar-title { font-size: 22px; }
  .back { width: 40px; height: 40px; }
  .hello { display: none; }
  main { padding-bottom: 96px; }
}
.explore .btn, .home-card .btn, [class*="tiles"] > * .btn { background: var(--surface); box-shadow: var(--shadow); }
.live-status { display: inline-flex; align-items: center; gap: 8px; }
/* Tiles sitting inside a pastel card are white, so the two pastels never clash */
.home-card :is(.tile, .kpi, .hc-fact), .explore :is(.tile, .kpi) { background: color-mix(in srgb, var(--surface) 75%, transparent) !important; }
.live-status { white-space: nowrap; }
@media (max-width: 900px) {
  .app-rail { overflow: hidden; justify-content: space-between; gap: 0; }
  .rail-foot { display: contents; }
  .app-rail .rail-item { flex: 1 1 0; min-width: 0; padding: 2px 0; }
  .app-rail .rail-ico { width: 36px; height: 36px; }
  .app-rail .rail-avatar { width: 30px; height: 30px; }
  .topbar-title { font-size: 20px; }
  .live-status { padding: 6px 10px; font-size: 12px; }
}
.lr-bar { background: var(--pill); }
.kpi .v, .tile .v { white-space: nowrap; font-size: clamp(20px, 1.7vw, 28px); }
input[type="search"], input.search, .lm-search input { border-radius: 999px; }

/* ---------- Currency: where the dollar rate is heading ---------- */
.fo-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.fo-top .go-fan-panel { margin-bottom: 0; }
.fo-two { gap: 16px; margin-bottom: 16px; }
.fo-two > .panel { min-width: 0; }
#fo-events { margin-bottom: 8px; }
#fo-mine, #fo-risk, #fo-press, #fo-reliab, #fo-analog, #fo-events { display: flex; flex-direction: column; gap: 10px; }
.fo-amt { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); }
.fo-amt input { width: 140px; font: inherit; font-size: 18px; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); }
.fo-now { display: flex; flex-direction: column; gap: 2px; background: var(--sage); border-radius: 20px; padding: 14px 16px; font-size: 14px; }
.fo-now > b { font-size: 30px; letter-spacing: -0.03em; }
.fo-press { display: grid; gap: 10px; }
.fo-ch { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); color: var(--text-2); margin-left: 4px; white-space: nowrap; }
@media (max-width: 1100px) { .fo-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .fo-two { grid-template-columns: minmax(0, 1fr); } }
.fo-press li { display: block; }
.fo-press .go-d { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.fo-rng { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.fo-ev td:nth-child(-n+3), .fo-ev th:nth-child(-n+3) { text-align: left; }
#fo-mine .ag-t td { vertical-align: top; }
/* Fan-chart tooltip keys: the same colours as the shading and lines */
.tooltip .t-row .sw.fan-80, .tooltip .t-row .sw.fan-50 { height: 10px; width: 14px; border-radius: 3px; }
.tooltip .t-row .sw.fan-80 { background: color-mix(in srgb, var(--d1) 18%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--d1) 30%, transparent); }
.tooltip .t-row .sw.fan-50 { background: color-mix(in srgb, var(--d1) 40%, var(--surface)); }
.tooltip .t-row .sw.fan-mid { width: 14px; height: 0; border-top: 2px dashed var(--d1); background: none; }
.tooltip .t-row .sw.fan-hist { width: 14px; background: var(--text); }
/* Dates to watch */
.fo-cal { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.fo-cal-list { display: grid; gap: 6px; }
.fo-ev-item { background: var(--surface-2); border-radius: 18px; padding: 10px 16px; }
.fo-ev-item[open] { background: var(--periwinkle); }
.fo-ev-item summary { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.fo-ev-item summary::-webkit-details-marker { display: none; }
.fo-ev-item > .pts { margin: 8px 0 2px 142px; }
.fo-ev-item > .fo-src { margin: 2px 0 4px 142px; }
.fo-ev-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.fo-ev-title { display: grid; gap: 1px; }
.fo-ev-title small { font-size: 13px; }
.fo-yes { color: var(--up); } .fo-no { color: var(--down); }
.fo-src a { color: var(--link); }
.fo-forces { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.fo-force { background: var(--lavender); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.fo-force:nth-child(2) { background: var(--peach); } .fo-force:nth-child(3) { background: var(--sage); } .fo-force:nth-child(4) { background: var(--periwinkle); }
.fo-force-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.fo-ev-item .pill.flat, .fo-force .pill.flat { background: var(--surface); color: var(--text-2); }
.fo-mark line { stroke: var(--muted); stroke-width: 1; }
.fo-mark circle { fill: var(--surface); stroke: var(--text-2); stroke-width: 2; }
.fo-mark.down circle { stroke: var(--down); } .fo-mark.up circle { stroke: var(--up); }
.fo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--text-2); vertical-align: -1px; }
@media (max-width: 640px) {
  .fo-ev-item summary { grid-template-columns: minmax(0, 1fr) auto; }
  .fo-ev-date { grid-column: 1 / -1; }
  .fo-ev-item > .pts, .fo-ev-item > .fo-src { margin-left: 0; }
}
.fo-pill { white-space: nowrap; font-size: 13px; }
.fo-ev-item summary:has(.fo-path) { grid-template-columns: 130px minmax(0, 1fr) auto auto; }
.fo-path { display: flex; align-items: center; gap: 8px; }
.fo-spark .z { stroke: var(--grid); stroke-width: 1; }
.fo-spark .ev { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.fo-spark path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.fo-spark path.wk { stroke: var(--down); } .fo-spark path.st { stroke: var(--up); } .fo-spark path.fl { stroke: var(--text-2); }
.fo-spark-l { font-size: 12px; font-weight: 700; line-height: 1.2; min-width: 74px; }
.fo-spark-l small { font-weight: 400; color: var(--muted); }
.fo-out { font-size: 14px; color: var(--text); }
.fo-note { margin: 8px 0 0 142px; font-size: 14px; font-weight: 600; }
.fo-hist { margin: 2px 0 0 142px; }
.fo-new { display: inline-block; font-size: 11px; font-weight: 700; background: var(--navy); color: var(--on-navy); border-radius: 999px; padding: 0 7px; vertical-align: 2px; }
.fo-gone { opacity: .6; } .fo-gone .fo-ev-title b { text-decoration: line-through; }
@media (max-width: 640px) {
  .fo-ev-item summary:has(.fo-path) { grid-template-columns: minmax(0, 1fr) auto; }
  .fo-note, .fo-hist { margin-left: 0; }
}
/* Dates to watch v2: one list by date; Expected · What really happened · Why */
.fo-card { background: var(--surface-2); border-radius: 22px; padding: 14px 18px 12px; display: flex; flex-direction: column; gap: 8px; }
.fo-card.passed { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); border: 1px solid var(--border); }
.fo-card-h { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.fo-status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.fo-status.upcoming { background: var(--navy); color: var(--on-navy); }
.fo-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fo-col { background: var(--surface); border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 14px; }
.fo-col h5 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fo-col .pill { align-self: flex-start; }
.fo-col p { margin: 0; }
.fo-col .pts { margin: 0; }
.fo-verdict { font-size: 14px; }
.fo-card .fo-note, .fo-card .fo-hist, .fo-card .fo-src { margin: 0; }
.fo-today { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; font-weight: 700; color: var(--navy); }
.fo-today::before, .fo-today::after { content: ""; flex: 1; height: 2px; background: var(--navy); border-radius: 2px; }
.fo-today span { background: color-mix(in srgb, var(--navy) 12%, var(--surface)); border-radius: 999px; padding: 4px 12px; }
.fo-cal-list { gap: 10px; }
@media (max-width: 900px) { .fo-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .fo-card-h { grid-template-columns: minmax(0, 1fr) auto; } .fo-card-h .fo-ev-date { grid-column: 1 / -1; } }

/* ---------- Sign-in page (same soft design as the app) ---------- */
body.page-login { display: block; min-height: 100vh; }
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; padding: 20px; max-width: 1280px; margin: 0 auto; align-items: stretch; }
.si-show { background: var(--surface); border-radius: 36px; box-shadow: var(--shadow); padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.si-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.si-brand .owl { width: 44px; height: 44px; }
.si-hello { font-size: 44px; line-height: 1.08; letter-spacing: -0.04em; font-weight: 800; margin: 24px 0 0; }
.si-sub { font-size: 17px; color: var(--text-2); max-width: 44ch; }
.si-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: auto; }
.si-card { border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.si-card span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.si-card b { font-size: 26px; letter-spacing: -0.03em; margin-top: auto; }
.si-card small { font-size: 13px; color: var(--text-2); }
.si-card.sage { background: var(--sage); } .si-card.lavender { background: var(--lavender); }
.si-card.periwinkle { background: var(--periwinkle); } .si-card.peach { background: var(--peach); }
.si-form { align-self: center; justify-self: center; width: 100%; max-width: 420px; background: var(--surface); border-radius: 36px; box-shadow: var(--shadow);
  padding: 40px 36px; display: flex; flex-direction: column; }
.si-brand-small { display: none; margin-bottom: 18px; }
.si-form h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0; }
.si-muted { color: var(--muted); margin: 6px 0 14px; }
.si-form label { font-size: 14px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.si-form input { font: inherit; font-size: 16px; padding: 14px 18px; border-radius: 999px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); outline: none; }
.si-form input:focus { border-color: var(--navy); background: var(--surface); }
.si-form button { margin-top: 24px; font: inherit; font-size: 16px; font-weight: 700; padding: 15px; border: 0; border-radius: 999px; background: var(--navy); color: var(--on-navy); cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--navy) 30%, transparent); }
.si-form button:hover { filter: brightness(1.08); }
.si-form button:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.si-error { margin: 12px 0 0; padding: 10px 14px; border-radius: 16px; background: var(--down-soft); color: var(--down); font-size: 14px; font-weight: 600; }
.si-foot { margin: 22px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .signin { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .si-show { display: none; }
  .si-brand-small { display: flex; }
  .si-form { padding: 32px 24px; }
}

/* ---------- Loading indicators: one look everywhere ---------- */
@keyframes ld-spin { to { transform: rotate(360deg); } }
@keyframes ld-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.ld { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 96px; padding: 20px; color: var(--text-2); font-size: 15px; font-weight: 500; text-align: center; }
.ld-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--navy) 18%, transparent); border-top-color: var(--navy); animation: ld-spin .8s linear infinite; flex: none; }
.ld.ld-err { flex-wrap: wrap; color: var(--down); background: var(--down-soft); border-radius: 18px; margin: 4px; }
.ld.ld-err .btn { background: var(--surface); }
/* Charts, maps and SVG charts: the loader sits over the (still empty) drawing area */
[data-ld-mode="overlay"] { position: relative; }
[data-ld-mode="overlay"] > .ld { position: absolute; inset: 0; z-index: 500; min-height: 0; background: color-mix(in srgb, var(--surface) 85%, transparent); border-radius: inherit; }
.chart[data-ld-mode="overlay"], #land-map, #ml-map { min-height: 220px; }
.spark[data-loading] > .ld { min-height: 60px; padding: 8px; font-size: 13px; }
/* A section refreshing (new range, new search): the same spinner over the old content */
.loading { position: relative; }
.loading > * { opacity: .45; transition: opacity .15s; }
.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--navy) 18%, transparent); border-top-color: var(--navy); animation: ld-spin .8s linear infinite; z-index: 5; }
.ads-table.loading, .hs-result.loading, #ag-crop.loading { opacity: 1; }
/* Thin bar at the very top while anything is being fetched */
html.net-busy body::after { content: ""; position: fixed; top: 0; left: 0; width: 40%; height: 3px; z-index: 3000; pointer-events: none; border-radius: 0 3px 3px 0;
  background: var(--navy); animation: ld-bar 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ld-spin, .loading::after, html.net-busy body::after { animation-duration: 2.4s; } }
.ld { grid-column: 1 / -1; width: 100%; }

/* ---------- Collapsible sections ---------- */
.sec > .section-head { align-items: flex-start; }
.sec-title { cursor: pointer; }
.sec-title:hover { color: var(--navy); }
.sec-toggle { margin-left: auto; order: 99; display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; border-radius: 999px; padding: 8px 12px 8px 14px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sec-toggle:hover { color: var(--text); background: var(--surface-2); }
.sec-toggle:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.sec-toggle svg { width: 16px; height: 16px; transform: rotate(180deg); transition: transform .2s; }
.sec-closed .sec-toggle svg { transform: none; }
.sec-closed .sec-toggle { background: var(--navy); color: var(--on-navy); }
.sec-closed > .sec-body { display: none; }
/* Closed: only the title row stays, as a slim card */
.sec-closed > .section-head { background: var(--surface); border-radius: 22px; padding: 14px 16px 14px 22px; box-shadow: var(--shadow); align-items: center; margin-bottom: 0; }
.sec-closed > .section-head > :not(:first-child):not(.sec-toggle) { display: none; }
.sec-closed > .section-head > :first-child > :not(h2) { display: none; }
.sec-closed > .section-head h2 { margin: 0; font-size: 20px; }
.sec-all { display: flex; gap: 6px; padding: 10px 14px 0; }
.sec-all button { flex: 1; border: 0; border-radius: 999px; padding: 7px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); cursor: pointer; }
.sec-all button:hover { color: var(--text); }
@media (max-width: 900px) { .sec-all { display: none; } .sec-toggle span { display: none; } .sec-toggle { padding: 8px; } }

/* ---------- Users page ---------- */
.um-add { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.um-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.um-grid label, .um-dlg label:not(.um-check) { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.um-grid input, .um-grid select, .um-dlg input:not([type=radio]), .um-dlg select { font: inherit; font-size: 15px; padding: 11px 16px; border-radius: 999px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); }
.um-grid input:focus, .um-dlg input:focus { border-color: var(--navy); outline: none; background: var(--surface); }
.um-pw { display: flex; gap: 8px; } .um-pw input { flex: 1; min-width: 0; }
.um-actions { display: flex; justify-content: flex-end; gap: 8px; }
.um-t td { vertical-align: middle; }
.um-who { display: flex; align-items: center; gap: 10px; }
.um-who > span:last-child { display: grid; } .um-who small { color: var(--muted); font-size: 13px; }
.um-av { width: 36px; height: 36px; border-radius: 50%; background: var(--lavender); color: var(--d1); display: grid; place-items: center; font-weight: 700; flex: none; }
.um-you { background: var(--navy); color: var(--on-navy); border-radius: 999px; padding: 0 7px; font-size: 11px; vertical-align: 2px; }
.um-role, .um-pend-role { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); }
.um-status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.um-status.on { background: var(--up-soft); color: var(--up); } .um-status.off { background: var(--surface-2); color: var(--muted); }
.um-off td { opacity: .65; }
.um-act { white-space: nowrap; text-align: right; } .um-act .btn { margin-left: 4px; }
.btn.um-danger { color: var(--down); }
.um-matrix th { text-align: center; vertical-align: bottom; } .um-matrix th:first-child { text-align: left; }
.um-matrix th small, .um-matrix td small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.um-cell { text-align: center; } .um-cell input { width: 20px; height: 20px; accent-color: var(--navy); cursor: pointer; }
.um-save-row td { text-align: center; border-bottom: 0; }
.um-dialog { border: 0; border-radius: 28px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); width: min(440px, calc(100vw - 32px)); }
.um-dialog::backdrop { background: rgba(20, 20, 20, .35); }
.um-dlg { padding: 24px; display: flex; flex-direction: column; gap: 14px; } .um-dlg h3 { margin: 0; font-size: 20px; }
.um-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); cursor: pointer; }
.um-check span { display: grid; } .um-check small { color: var(--muted); }
.um-toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 12px 20px; font-weight: 600; z-index: 4000; box-shadow: var(--shadow); }
.um-toast.show { opacity: 1; transform: translate(-50%, 0); } .um-toast.bad { background: var(--down); color: #fff; }
@media (max-width: 760px) { .um-grid { grid-template-columns: minmax(0, 1fr); } .um-act .btn { margin: 2px 0; } .um-toast { bottom: 90px; } }
.um-matrix th:not(:first-child), .um-matrix td:not(:first-child) { text-align: center !important; width: 120px; }
.um-matrix td:first-child, .um-matrix th:first-child { text-align: left !important; }

/* ---------- My wealth ---------- */
.me-hero { padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.me-hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.me-k { font-size: 14px; font-weight: 600; color: var(--muted); }
.me-big { font-size: 52px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.me-month { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; }
.me-month > div { background: var(--surface-2); border-radius: 18px; padding: 10px 16px; display: grid; min-width: 150px; }
.me-month span { font-size: 12px; color: var(--muted); font-weight: 600; } .me-month b { font-size: 20px; letter-spacing: -0.02em; }
.me-month .good { background: var(--up-soft); } .me-month .bad { background: var(--down-soft); }
.me-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.me-empty { background: var(--periwinkle); border-radius: 18px; padding: 12px 16px; margin: 0; }
.me-upd { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.me-upd .ld-spin { width: 12px; height: 12px; border-width: 2px; }
.me-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.me-item { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.me-item header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.me-item header b { font-size: 17px; }
.me-item-act { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.me-badge { margin-left: 8px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--lavender); color: var(--d1); vertical-align: 2px; }
.me-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: 14px; padding: 5px 0; border-top: 1px solid var(--border); }
.me-row > span { color: var(--muted); }
.me-row small { display: block; color: var(--muted); font-size: 12px; }
.me-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-top: 4px; } .me-links a { color: var(--link); }
.me-notes { white-space: pre-wrap; }
.me-none { display: flex; justify-content: space-between; align-items: center; color: var(--muted); grid-column: 1 / -1; }
.me-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.me-f { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); min-width: 0; }
.me-f[hidden] { display: none; }
.me-f small { font-weight: 400; color: var(--muted); font-size: 12px; }
.me-f:has(textarea) { grid-column: 1 / -1; }
.me-in { display: flex; align-items: center; gap: 8px; }
.me-in input, .me-in select, .me-in textarea { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 16px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); }
.me-in input, .me-in select { border-radius: 999px; }
.me-in :focus { border-color: var(--navy); outline: none; background: var(--surface); }
.me-unit { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.me-err { color: var(--down); background: var(--down-soft); border-radius: 14px; padding: 8px 12px; margin: 0; font-weight: 600; font-size: 14px; }
.me-form { display: flex; flex-direction: column; gap: 14px; }
.me-costs-body { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.me-cost-add { display: grid; grid-template-columns: 140px 1fr 1.4fr 110px auto; gap: 6px; }
.me-cost-add input, .me-cost-add select { font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); min-width: 0; }
.me-bars > div { display: grid; grid-template-columns: 150px 1fr 80px; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.me-bars i { display: block; height: 8px; border-radius: 999px; background: var(--d1); }
.me-bars b { text-align: right; }
.me-adv-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.me-alloc { display: grid; gap: 10px; }
.me-al { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.me-al > small { grid-column: 2; }
.me-al-bars { display: grid; gap: 4px; }
.me-al-bars span { position: relative; height: 20px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.me-al-bars i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--d4) 45%, var(--surface)); border-radius: 999px; }
.me-al-bars .sug i { background: var(--d1); }
.me-al-bars small { position: relative; padding-left: 10px; font-size: 12px; font-weight: 600; line-height: 20px; }
.me-al-bars .sug small { color: #fff; mix-blend-mode: normal; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.me-actions, .me-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.me-act, .me-idea { background: var(--surface-2); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.me-idea { background: var(--sage); }
.me-act-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.me-n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.me-risk { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.me-risk.low { background: var(--up-soft); color: var(--up); } .me-risk.medium { background: var(--gold-soft); color: var(--gold); } .me-risk.high { background: var(--down-soft); color: var(--down); }
/* "Yours" box on section pages */
.my-card { padding: 18px 22px; margin-bottom: 18px; background: var(--lavender); }
.my-card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.my-card-h h3 { margin: 0; font-size: 18px; }
.my-card-h .btn { background: var(--surface); }
.my-card-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; }
.my-card-list a { color: var(--link); }
.my-card-adv { margin-top: 10px; background: var(--surface); border-radius: 18px; padding: 10px 14px; }
.my-card-adv > span { font-size: 12px; font-weight: 700; color: var(--d1); text-transform: uppercase; letter-spacing: .04em; }
/* Profile */
.pf { display: grid; gap: 16px; max-width: 720px; }
.pf-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pf-who { display: flex; gap: 14px; align-items: center; } .pf-who h2 { margin: 0; } .pf-who p { margin: 2px 0 0; }
.pf-av { width: 56px; height: 56px; font-size: 22px; }
.pf-form { display: flex; flex-direction: column; gap: 12px; } .pf-form h3 { margin: 0; }
.pf-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.pf-form input { font: inherit; font-size: 15px; padding: 11px 16px; border-radius: 999px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); }
.pf-form input:focus { border-color: var(--navy); outline: none; background: var(--surface); }
@media (max-width: 1100px) { .me-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .me-month { grid-template-columns: 1fr; width: 100%; } .me-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-big { font-size: 38px; } .me-grid { grid-template-columns: minmax(0, 1fr); } .me-list { grid-template-columns: minmax(0, 1fr); }
  .me-cost-add { grid-template-columns: 1fr 1fr; } .me-al { grid-template-columns: minmax(0, 1fr); } .me-al > small { grid-column: 1; }
  .me-row { grid-template-columns: 110px minmax(0, 1fr); }
}
.me-f[hidden] { display: none !important; }
.me-cost-add { grid-template-columns: 150px minmax(0, 1fr); }
.me-cost-add input[name=description] { grid-column: 1 / -1; }
.me-cost-add input[name=amount] { grid-column: 1; } .me-cost-add button { grid-column: 2; justify-self: start; }
.me-costs-body .ag-t td, .me-costs-body .ag-t th { text-align: left; } .me-costs-body .ag-t td.num { text-align: right; }
.side-label:has(+ .side-card) { display: none; }
.section-head > .btn.primary { margin-left: auto; }
.section-head > .btn.primary + .sec-toggle { margin-left: 8px; }
.me-qa { display: flex; flex-direction: column; gap: 10px; }
.me-qa-row { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.me-qa-row textarea { font: inherit; font-size: 14px; font-weight: 400; padding: 10px 14px; border-radius: 16px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); resize: vertical; }
.me-qa-row textarea:focus { border-color: var(--navy); outline: none; background: var(--surface); }
.me-saved { font-weight: 600; font-size: 11px; color: var(--up); background: var(--up-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.um-actions:has(> .small) { justify-content: space-between; align-items: center; }
/* Goals */
.me-list[data-kind="goal"] { grid-template-columns: minmax(0, 1fr); }
.me-goal-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-end; }
.me-goal-top > div:first-child { display: grid; }
.me-goal-big { font-size: 34px; letter-spacing: -0.03em; }
.me-goal-prog { flex: 1; min-width: 220px; max-width: 420px; display: grid; gap: 4px; }
.me-goal-prog span { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.me-goal-prog i { display: block; height: 100%; background: var(--up); border-radius: 999px; }
.me-need { display: grid; gap: 6px; }
.me-need-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.me-need-row > div { background: var(--periwinkle); border-radius: 16px; padding: 10px 12px; display: grid; }
.me-need-row > div.zero { background: var(--surface-2); }
.me-need-row small { color: var(--text-2); font-size: 12px; } .me-need-row b { font-size: 18px; letter-spacing: -0.02em; }
.me-plan { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.me-mix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.me-mix > div { background: var(--surface-2); border-radius: 18px; padding: 12px 14px; display: grid; gap: 4px; }
.me-mix-h { display: flex; justify-content: space-between; gap: 8px; } .me-mix-h span { font-weight: 800; color: var(--d1); }
.me-mix-bar { height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; } .me-mix-bar i { display: block; height: 100%; background: var(--d1); }
.me-mix small { font-size: 12px; }
.me-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: st; }
.me-steps > li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; background: var(--surface-2); border-radius: 16px; padding: 10px 14px; }
.me-when { font-weight: 800; color: var(--navy); font-size: 14px; }
.me-amt { font-size: 12px; font-weight: 700; background: var(--sage); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.me-steps .pts { margin: 4px 0 0; }
.me-ms { width: 100%; height: auto; max-height: 230px; }
.me-ms path { fill: none; stroke: var(--d1); stroke-width: 2.5; stroke-linejoin: round; }
.me-ms circle { fill: var(--surface); stroke: var(--d1); stroke-width: 2; }
.me-ms .tg { stroke: var(--up); stroke-width: 1.5; stroke-dasharray: 5 4; }
.me-ms text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.me-opt td { vertical-align: top; } .me-opt td small { display: block; font-size: 12px; margin-top: 2px; }
.me-opt td:first-child, .me-opt th:first-child, .me-opt td:last-child, .me-opt th:last-child, .me-opt td:nth-child(3), .me-opt td:nth-child(4) { text-align: left; }
.me-opt td:last-child { min-width: 260px; }
@media (max-width: 760px) { .me-need-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .me-steps > li { grid-template-columns: minmax(0, 1fr); } }
.me-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.me-opt-c { background: var(--surface-2); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.me-opt-c a { color: var(--link); }
.me-opt-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.me-opt-h > div:first-child { display: grid; } .me-opt-h small { color: var(--muted); }
.me-opt-rate { font-size: 22px; font-weight: 800; color: var(--d1); text-align: right; line-height: 1.1; white-space: nowrap; }
.me-opt-rate small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.me-opt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.me-opt-tags span:not(.me-risk) { font-size: 11px; background: var(--surface); border-radius: 999px; padding: 1px 8px; }
.me-reach { border-radius: 18px; padding: 12px 16px; display: grid; gap: 6px; }
.me-reach.ok { background: var(--up-soft); } .me-reach.warn { background: var(--gold-soft); } .me-reach.bad { background: var(--down-soft); }
.me-reach-h { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.me-reach-h > b { font-size: 17px; } .me-reach.ok .me-reach-h > b { color: var(--up); } .me-reach.bad .me-reach-h > b { color: var(--down); } .me-reach.warn .me-reach-h > b { color: var(--gold); }
