/* aedtoinr.online — v2 (docs/09 §3): mobile-first, modern, clean.
 * Base styles target phones; min-width queries scale up. Cards are flat,
 * radii 16px, generous padding, tabular numbers for every rate. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-base);
  border-bottom: 1px solid var(--card-stroke);
}
.bar { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand {
  font-weight: 800; font-size: 17px; color: var(--text-primary);
  letter-spacing: 0.2px; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-arrow { color: var(--accent); margin: 0 1px; }

.nav { display: none; margin-left: auto; }
.nav a {
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { color: var(--text-primary); text-decoration: none; background: var(--card); }
.nav a.on { color: var(--text-primary); background: var(--card); }

.nav-toggle {
  margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--card-sticker); cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 2px; background: var(--text-primary); border-radius: 2px;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.nav.open {
  display: flex; flex-direction: column; gap: 2px;
  position: absolute; top: 56px; left: 0; right: 0;
  background: var(--card); border-bottom: 1px solid var(--card-stroke);
  border-radius: 0 0 16px 16px;
  padding: 10px 12px 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}
.nav.open a { padding: 12px 14px; font-size: 15px; border-radius: 10px; }
.nav.open a.on { background: var(--accent-tint); color: var(--accent-strong); }
.nav.open a:active { background: var(--card-sticker); }

.theme-toggle {
  width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--card-sticker); color: var(--text-primary); cursor: pointer; padding: 0;
  display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- main ---------- */
main.wrap { padding: 20px 16px 56px; }

/* ---------- hero rate card ---------- */
.hero {
  background: var(--card); border: 1px solid var(--card-stroke);
  border-radius: 16px; padding: 24px 20px; margin-bottom: 16px;
}
.hero .pair { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin: 0; }
.hero .rate {
  font-size: clamp(40px, 9vw, 60px); font-weight: 800; letter-spacing: -1px;
  margin: 2px 0 10px; font-variant-numeric: tabular-nums; line-height: 1.05;
}
.hero .rate small { font-size: 0.38em; font-weight: 700; color: var(--text-secondary); letter-spacing: 0; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 10px; font-size: 13px; font-weight: 700;
  background: var(--card-sticker); color: var(--text-primary); white-space: nowrap;
}
.pill.up { color: var(--positive); }
.pill.down { color: var(--negative); }

/* ---------- converter (modern card) ---------- */
.conv-card { margin-bottom: 16px; }
.conv-grid {
  display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}
.conv-field { min-width: 0; }
.conv-field label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 6px; font-weight: 600;
}
.conv-input {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--card-stroke); border-radius: 14px;
  background: var(--bg-base); padding: 0 12px; height: 56px;
  transition: border-color 0.15s ease;
}
.conv-input:focus-within { border-color: var(--accent); }
.conv-input .cur { font-size: 13px; font-weight: 700; color: var(--text-secondary); flex: none; }
.conv-input input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 22px; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums; height: 100%;
}
.conv-input input::-webkit-outer-spin-button,
.conv-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-swap {
  justify-self: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--card-stroke); background: var(--card); color: var(--text-primary);
  cursor: pointer; display: grid; place-items: center; transition: transform 0.2s ease, border-color 0.15s;
}
.conv-swap:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  border: 1px solid var(--card-stroke); background: var(--card); color: var(--text-primary);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.conv-result { margin-top: 12px; font-size: 15px; }
.conv-result strong { font-variant-numeric: tabular-nums; }

/* ---------- generic card + headings ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-stroke);
  border-radius: 16px; padding: 20px 16px; margin-bottom: 16px;
}
.card > h2 { margin: 0 0 4px; font-size: clamp(19px, 2.4vw, 22px); font-weight: 700; line-height: 1.3; }
.card > .sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 14px; }

/* ---------- prose content (SEO sections) ---------- */
.content { max-width: 68ch; }
.content h3 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; line-height: 1.35; }
.content p { margin: 0 0 14px; color: var(--text-secondary); }
.content p strong, .content li strong { color: var(--text-primary); }
.content ul, .content ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-secondary); }
.content li { margin-bottom: 6px; }
.content a { font-weight: 600; }

.amounts { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 16px; }
.amounts th, .amounts td { padding: 10px 12px; border-bottom: 1px solid var(--card-stroke); text-align: left; }
.amounts th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.amounts td:last-child, .amounts th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.amounts tr:last-child td { border-bottom: 0; }

/* ---------- chart ---------- */
.chart-box { margin: 4px 0 10px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }

.range-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.range-btn {
  border: 1px solid var(--card-stroke); background: var(--card); color: var(--text-secondary);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.range-btn:hover { border-color: var(--accent); color: var(--accent); }
.range-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

.stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card-sticker); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.stat .v { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- houses table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table.houses { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.houses th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--card-stroke); white-space: nowrap;
}
table.houses th.num, table.houses td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.houses td { padding: 10px; border-bottom: 1px solid var(--card-stroke); white-space: nowrap; }
table.houses tr:last-child td { border-bottom: 0; }
table.houses td.name { font-weight: 600; white-space: normal; }
table.houses .best td { background: var(--accent-tint); }
table.houses .best td.name::after {
  content: "Best"; margin-left: 8px; font-size: 10px; font-weight: 800; color: var(--accent-strong);
  border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; vertical-align: middle;
}
.vs-pos { color: var(--positive); font-weight: 700; }
.vs-neg { color: var(--negative); font-weight: 700; }
.fresh { color: var(--text-secondary); font-size: 12px; font-weight: 500; }
a.house-link { font-weight: 700; font-size: 13px; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--card-stroke); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  font-weight: 700; cursor: pointer; font-size: 15px; padding: 13px 0;
  list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 18px; color: var(--text-secondary); flex: none; font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--text-secondary); font-size: 14px; }

/* ---------- app CTA + play badge ---------- */
.cta {
  background: var(--accent-tint); border: 1px solid var(--accent);
  border-radius: 16px; padding: 24px 16px; text-align: center; margin-bottom: 16px;
}
.cta h2 { margin: 0 0 6px; font-size: 19px; }
.cta p { margin: 0 0 14px; color: var(--text-secondary); font-size: 14px; }
.play-badge { display: inline-block; }
.play-badge img { display: block; height: 48px; width: auto; }
.play-badge:hover { text-decoration: none; opacity: 0.92; }

/* ---------- ad slots (reserved, docs/09 §4) ---------- */
.ad-slot { margin: 16px 0; min-height: 90px; display: flex; align-items: center; justify-content: center; }

/* ---------- legal / calculators / about ---------- */
.legal { max-width: 72ch; }
.legal h1 { font-size: clamp(24px, 4vw, 30px); margin: 0 0 4px; line-height: 1.25; }
.legal .updated { color: var(--text-secondary); font-size: 13px; margin: 0 0 18px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; }
.legal h3 { font-size: 16px; margin: 20px 0 6px; color: var(--text-primary); }
.legal p, .legal li { font-size: 15px; color: var(--text-secondary); }
.legal ul { padding-left: 22px; }
.legal strong { color: var(--text-primary); }

.calc-form { display: grid; gap: 12px; margin: 14px 0; }
.calc-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.calc-form input, .calc-form select {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600; padding: 11px 12px;
  border-radius: 12px; border: 1px solid var(--card-stroke);
  background: var(--bg-base); color: var(--text-primary);
}
.calc-result {
  background: var(--accent-tint); border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; margin: 4px 0 14px; font-size: 15px;
}
.calc-result .big { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- calculator cards (hub + cross-links) ---------- */
.calc-cards { display: grid; gap: 12px; }
.calc-card {
  display: flex; flex-direction: column; padding: 16px;
  border: 1px solid var(--card-stroke); border-radius: 14px; background: var(--card-sticker);
}
.calc-card:hover { border-color: var(--accent); text-decoration: none; }
.calc-card h3 { margin: 0 0 6px; font-size: 16px; color: var(--text-primary); }
.calc-card p { margin: 0 0 10px; font-size: 14px; color: var(--text-secondary); }
.calc-card .go { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--accent); }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { font-weight: 600; }

/* ---------- footer (minimal, docs/09 §3) ---------- */
.foot { border-top: 1px solid var(--card-stroke); padding: 22px 0 34px; margin-top: 12px; }
.fbar { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.fbrand { font-weight: 800; color: var(--text-primary); }
.fbrand:hover { text-decoration: none; color: var(--accent); }
.fnav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.fnav a { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.fnav a:hover { color: var(--accent); }

/* ---------- 404 ---------- */
.nf { text-align: center; padding: 56px 0; }
.nf h1 { font-size: 52px; margin: 0 0 8px; }
.nf p { color: var(--text-secondary); }

/* ---------- tablet / desktop ---------- */
@media (min-width: 720px) {
  .wrap { padding: 0 24px; }
  main.wrap { padding: 28px 24px 64px; }
  .nav-toggle { display: none; }
  .nav { display: flex; }
  .hero { padding: 32px; }
  .card { padding: 26px 24px; }
  .conv-grid { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; }
  .conv-swap { margin-bottom: 8px; }
  .stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cta { padding: 32px 24px; }
  .fbar { flex-direction: row; justify-content: space-between; text-align: left; }
  .calc-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .calc-form .full { grid-column: 1 / -1; }
  .calc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  body { font-size: 16.5px; }
  .nav { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
