/* Carvico Cars — the data portal.
   Deliberately NOT the app site's stylesheet. The marketing pages are dark,
   rounded and gradient-heavy because they are selling something. This is a
   reference tool: white, dense, hairline rules, tabular figures, and one accent
   colour used sparingly. If a border needs a radius or a panel needs a
   gradient, the layout is wrong. */

:root {
  --paper: #ffffff;
  --tint: #f7f8f7;
  --ink: #16181a;
  --ink-2: #43474c;
  --ink-3: #767b82;
  --rule: #e3e5e6;
  --rule-strong: #c8ccce;
  --accent: #1f7a3c;
  --warm: #b4531a;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ---- chrome ---------------------------------------------------------- */

header.portal { border-bottom: 1px solid var(--rule); background: var(--paper); }
header.portal .wrap { display: flex; align-items: center; justify-content: space-between; height: 54px; gap: 20px; }
.wordmark { display: flex; align-items: baseline; gap: 7px; color: var(--ink); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
header.portal nav { display: flex; gap: 20px; font-size: 0.88rem; }
header.portal nav a { color: var(--ink-2); }
header.portal nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

footer.portal { border-top: 1px solid var(--rule); margin-top: 52px; padding: 24px 0 40px; font-size: 0.84rem; color: var(--ink-3); }
footer.portal .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; justify-content: space-between; }
footer.portal a { color: var(--ink-3); }
footer.portal nav { display: flex; flex-wrap: wrap; gap: 18px; }

.crumbs { font-size: 0.8rem; color: var(--ink-3); padding: 18px 0 0; }
.crumbs a { color: var(--ink-3); }
.crumbs i { font-style: normal; padding: 0 6px; color: var(--rule-strong); }

/* ---- page head ------------------------------------------------------- */

.head { padding: 10px 0 20px; border-bottom: 1px solid var(--rule); }
h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
.kicker { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); margin-top: 7px; }
.lede { color: var(--ink-2); margin-top: 12px; max-width: 66ch; }
.lede a { border-bottom: 1px solid rgba(31, 122, 60, 0.3); }

/* ---- stat row: hairlines between figures, never boxes ---------------- */

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); border-bottom: 1px solid var(--rule); }
.fig { padding: 18px 20px 18px 0; border-right: 1px solid var(--rule); }
.fig:last-child { border-right: none; }
.fig b { display: block; font-size: 1.95rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.fig b i { font-style: normal; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }
.fig u { display: block; text-decoration: none; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); margin-top: 9px; }
.fig s { display: block; text-decoration: none; font-size: 0.8rem; color: var(--ink-3); opacity: 0.8; }

/* ---- sections -------------------------------------------------------- */

h2 {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
p { margin-bottom: 13px; max-width: 72ch; color: var(--ink-2); }
p strong { color: var(--ink); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.86em; color: var(--ink); background: var(--tint); padding: 1px 5px; }

/* ---- tables ---------------------------------------------------------- */

.scroll { overflow-x: auto; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
th, td { text-align: right; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; border-bottom-color: var(--rule-strong); }
td { color: var(--ink-2); }
td:first-child { color: var(--ink); font-weight: 600; }
tbody tr:hover td { background: var(--tint); }
.note { font-size: 0.82rem; color: var(--ink-3); margin-bottom: 24px; }

/* ---- calculator ------------------------------------------------------ */

.calc { border-bottom: 1px solid var(--rule); padding-bottom: 18px; margin-bottom: 18px; }
.calc .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px 20px; }
.calc label { display: block; font-family: var(--mono); font-size: 0.63rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.calc input, .calc select {
  display: block; width: 100%; margin-top: 5px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 7px 8px; font-size: 0.95rem; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.calc select { padding: 6px 4px; }
.calc input:focus, .calc select:focus { border-color: var(--accent); outline: none; }

.answer { padding: 4px 0 22px; }
.answer .big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.answer .big b { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--accent); }
.answer .big span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); }
.answer p { margin: 14px 0 0; }
.answer p:first-of-type { margin-top: 16px; }

/* ---- contribute ------------------------------------------------------ */

button {
  margin-top: 16px; background: var(--ink); color: var(--paper);
  border: none; border-radius: 2px; padding: 9px 20px;
  font-size: 0.88rem; font-weight: 600; font-family: inherit; cursor: pointer;
}
button:hover { background: var(--accent); }
.form-note { font-size: 0.82rem; color: var(--ink-3); margin: 11px 0 0; }

/* ---- index ----------------------------------------------------------- */

.index-table td:first-child a { font-weight: 600; }

@media (max-width: 620px) {
  h1 { font-size: 1.5rem; }
  .fig { border-right: none; border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .fig:last-child { border-bottom: none; }
  .figures { grid-template-columns: 1fr 1fr; }
  .fig:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 16px; }
}
