/* Real Data IQ. Teal on cool paper, amber for emphasis. Light and dark follow the visitor's system setting. */
:root {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --fg: #10201F;
  --muted: #4A5C5A;
  --line: #D8E0DD;
  --accent: #0B5646;
  --accent-fg: #FFFFFF;
  --amber: #F2B23A;
  --amber-fg: #10201F;
  --warn: #8A4B00;
  --soft: #E8EFEC;
  --m1: #0B5646; --m2: #1F8A74; --m3: #5FB5A0; --m4: #A7D8CB; --m5: #F2B23A; --m6: #9AA9A6;
  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1817; --surface: #142320; --fg: #E8F0EE; --muted: #9FB3AF; --line: #26403B;
    --accent: #6CC5AE; --accent-fg: #08221C; --warn: #E7A55C; --soft: #1B2F2B;
    --m1: #7CD0BA; --m2: #4FAE97; --m3: #2F8470; --m4: #1B5E50; --m6: #6F8581;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-block: 28px 64px; display: flex; flex-direction: column; gap: 40px; }

/* header */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 22px; text-decoration: none; color: var(--fg); }
.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--fg); text-decoration: none; padding: 6px 0; }
.nav a:hover { color: var(--accent); text-decoration: underline; }

/* type */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5.4vw, 56px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; }
h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; }
p { margin: 0; }
.lede { color: var(--muted); font-size: 18px; max-width: 62ch; }
.meta { color: var(--muted); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }

/* forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"] { width: 100%; height: 54px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 2px solid var(--fg); border-radius: 14px; }
input[type="text"]::placeholder { color: var(--muted); }
.btn { height: 54px; padding: 0 24px; font: inherit; font-weight: 600; font-size: 16px; border-radius: 14px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-fg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn.small { height: 44px; padding: 0 18px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.chip { font: inherit; font-size: 14px; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.status { min-height: 22px; font-size: 14px; color: var(--accent); font-weight: 600; }

/* hero */
.hero { display: flex; flex-direction: column; gap: 22px; padding-top: 12px; }

/* cards and tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; align-items: start; }
.head { display: flex; flex-direction: column; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .k { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tile .v { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .v.na { font-size: 20px; color: var(--muted); font-weight: 600; }
.tile .s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--amber); color: var(--amber-fg); }

/* mix bar */
.mix { display: flex; flex-direction: column; gap: 12px; }
.bar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--soft); gap: 2px; }
.seg { min-width: 2px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 16px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .n { margin-left: auto; color: var(--muted); }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--warn); }

/* feature contrast */
.contrast { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.big { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.big .num { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big.accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.big.accent .eyebrow, .big.accent .meta { color: var(--accent-fg); opacity: 0.85; }

/* rankings */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
.rank a { font-weight: 500; text-decoration: none; color: var(--fg); overflow-wrap: anywhere; }
.rank a:hover { color: var(--accent); text-decoration: underline; }
.rank .val { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.rank .track { grid-column: 1 / -1; height: 8px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.rank .fill { height: 100%; border-radius: 6px; background: var(--m2); }
.rank .n { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.subhead { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* similar list */
.similar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.similar a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.similar a:hover { border-color: var(--accent); }
.similar .nm { font-weight: 600; }
.similar .sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.prose { max-width: 70ch; display: flex; flex-direction: column; gap: 14px; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot .wrap { padding-block: 28px 40px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.site-foot p { max-width: 84ch; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* calculators */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 14px; }
.tabs button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.pane { margin-top: 14px; }
select, .field input[type="number"] { height: 54px; width: 100%; padding: 0 14px; font: inherit; font-size: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); }
.check { display: flex; align-items: center; gap: 8px; height: 54px; font-size: 15px; color: var(--fg); font-weight: 500; }
.check input { width: 20px; height: 20px; }
.warn { color: var(--warn); font-weight: 600; margin: 0; }
.afford-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 14px; }
.afford-col h3 { margin: 0 0 8px; font-size: 18px; }
.afford-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.afford-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.afford-list li span { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.afford-list em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.rv-chart { width: 100%; max-width: 640px; height: auto; margin-top: 14px; }
.legend-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.legend-line i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* census table */
.tablewrap { overflow-x: auto; }
table.census { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.census th, table.census td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.census th:first-child, table.census thead th { text-align: left; }
table.census thead th { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
table.census tbody th { font-weight: 500; }
.rk { counter-reset: rk; }
@media (max-width: 520px) {
  table.census { font-size: 13px; }
  table.census th, table.census td { padding: 7px 5px; }
  table.census thead th { font-size: 10px; letter-spacing: 0.02em; }
  table.census tbody th { font-weight: 400; }
}
