/* Same system as the other Page Studio sites (type, fields, cards, footer); deep teal + coral on warm paper from the Canva mockup. */
:root {
  color-scheme: light;
  --paper: #FAF8F4;
  --panel: #FFFFFF;
  --ink: #17323A;
  --muted: #4E5B5F;
  --line: #E4DFD6;
  --field: #A9B3B2;
  --accent: #0B4F5A;
  --accent-bg: #EAF1EE;
  --coral: #C2452B;
  --coral-line: #F0C2B6;
  --coral-chart: #E4684E;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; color: var(--accent); }
h1 { font-size: clamp(1.9rem, 6.4vw, 3rem); font-weight: 780; margin: 0 0 10px; }
h2 { font-size: 1.5rem; font-weight: 720; margin: 40px 0 12px; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 760; font-size: 1.15rem; color: var(--accent); text-decoration: none; }
.brand img { border-radius: 8px; }
.pill { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-bg); color: var(--accent); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 479px) { .pill { display: none; } }

.intro { padding: 20px 0 24px; text-align: center; max-width: 760px; margin: 0 auto; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; }
.lede { font-size: 1.125rem; color: var(--muted); margin: 0; }
.note { background: var(--accent-bg); padding: 10px 14px; border-radius: 8px; }

/* Calculator: one column on phones, form | results from 900px. */
.calc { display: grid; gap: 16px; }
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 20px; }
@media (min-width: 600px) { .card { padding: 22px 22px 24px; } }
.card h2 { font-size: 1.3rem; margin: 0 0 4px; }
.results:focus { outline: none; }

.grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.field { display: grid; gap: 6px; margin-top: 14px; min-width: 0; }
.field > label { font-weight: 600; font-size: 0.95rem; }
input, select { font: inherit; font-size: 1.0625rem; color: var(--ink); }
.field > input, select, .affix {
  width: 100%; min-height: 48px; border: 1px solid var(--field); border-radius: 8px; background: var(--panel);
}
.field > input, select { padding: 0 12px; font-variant-numeric: tabular-nums; }
select {
  appearance: none; padding-right: 36px; text-overflow: ellipsis;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317323A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
}
@media (max-width: 599px) { .field.model { grid-column: 1 / -1; } }
.field > input:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.affix { display: flex; align-items: center; }
.affix:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.affix input { flex: 1; min-width: 0; width: 100%; height: 46px; padding: 0 0 0 12px; border: 0; background: transparent; font-variant-numeric: tabular-nums; }
.affix input:focus { outline: none; }
.affix span { padding: 0 12px; color: var(--muted); }
.affix:has(input:disabled) { background: #F3F2EF; }
.hint { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }

.cache-row { margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; cursor: pointer; }
.switch input {
  appearance: none; flex: none; width: 46px; height: 26px; margin: 0; border-radius: 999px; background: var(--field);
  position: relative; cursor: pointer; transition: background 0.15s;
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }

.btn {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 650;
}
.btn:hover { background: #083C45; }
form .btn { width: 100%; margin-top: 20px; }
.btn.ghost { min-height: 40px; background: var(--panel); color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-bg); }

/* Results */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.tile { display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.tile span { font-weight: 650; font-size: 0.9rem; color: var(--accent); }
.tile b { font-size: clamp(1.5rem, 5.5vw, 2.1rem); font-weight: 780; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile small { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.tile.worst { border-color: var(--coral-line); }
.tile.worst span, .tile.worst b { color: var(--coral); }
@media (max-width: 479px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile:first-child { grid-column: 1 / -1; }
}
.month { margin: 14px 0 0; text-align: center; font-weight: 600; color: var(--muted); }
.month b { font-variant-numeric: tabular-nums; }
.month .t { color: var(--accent); }
.month .w { color: var(--coral); }
.warn { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--coral); background: #FCF0EC; border-radius: 6px; font-size: 0.9rem; }

.pair { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 600px) { .pair { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
.chart-box { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.chart-box figcaption { font-weight: 650; font-size: 0.95rem; color: var(--accent); }
.chart { aspect-ratio: 360 / 220; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart path { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.chart path.t { stroke: var(--accent); }
.chart path.w { stroke: var(--coral-chart); }
.chart circle.t { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart circle.w { fill: var(--coral-chart); stroke: #fff; stroke-width: 2; }
.chart .cap { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .k { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.legend .k.t { background: var(--accent); }
.legend .k.w { background: var(--coral-chart); }
.legend .k.cap { height: 0; border-top: 2px dashed var(--muted); }

.caps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.caps-head h3 { margin: 0; font-size: 1.05rem; }
#caps {
  margin: 10px 0 0; padding: 14px; border: 1px solid #D3E0DA; border-radius: 10px; background: var(--accent-bg);
  font: 600 0.9rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); overflow-x: auto;
}
.small { font-size: 0.875rem; color: var(--muted); margin: 8px 0 0; }
.foot-note { text-align: center; margin-top: 16px; }
#copy-status:empty { display: none; }

/* Reserved for ads later, so adding them shifts nothing. Empty until then. */
.ad-slot { min-height: 250px; margin: 16px 0; }

/* Article */
.guide, .faq, .disclaimer, .prose { max-width: 68ch; }
.guide { margin-top: 24px; }
.guide ul, .guide ol { padding-left: 1.2em; }
.guide li { margin-bottom: 10px; }
.formula {
  margin: 18px 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  font-weight: 650; font-variant-numeric: tabular-nums;
}
.formula span { display: block; }
.formula span + span { margin-top: 6px; }
.faq h2 { margin-top: 8px; }
.disclaimer { margin: 32px 0 48px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 0.95rem; }
.disclaimer p { margin: 0; }

.prose { padding-top: 28px; padding-bottom: 48px; }
.prose h1 { font-size: clamp(1.9rem, 6vw, 2.4rem); }
.prose ul { padding-left: 1.2em; }

.foot { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.95rem; padding: 18px 0 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
.foot .tools { margin-top: 4px; align-items: center; }
.foot .tools span { color: var(--muted); }
.foot p { margin: 8px 0 0; }
