/* ============================================================
   SleepTimeCalc.org — mobile-first. Base rules target a ~375px
   phone; min-width queries add room for tablets and desktop.
   Every interactive control is at least 48px tall, and every
   form control uses a 16px+ font so iOS never zooms on focus.
   ============================================================ */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Inter-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/Inter-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/Inter-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/InterTight-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/InterTight-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

html { color-scheme: light; }
:root {
  --night: #0d1a30;
  --night-2: #15284a;
  --night-line: rgba(255, 255, 255, .12);
  --moon: #f3c969;
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #131722;
  --text: #3b414d;
  --muted: #5f6573;
  --line: #e2dfd7;
  --line-strong: #8a857b;
  --btn: #1c3d73;
  --btn-hover: #15305c;
  --btn-ink: #ffffff;
  --link: #1c3d73;
  --field: #ffffff;
  --tab-on: #ffffff;
  --verdict-good: #0a4d44;
  --verdict-warn: #5f3e00;
  --verdict-bad: #6f1f1f;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6573' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  --good: #0c6b5e;
  --good-bg: #e6f3f0;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --bad: #9b2c2c;
  --bad-bg: #fbe9e9;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --gutter: 16px;
  --max: 1080px;
  --measure: 680px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(13, 26, 48, .06), 0 12px 32px -12px rgba(13, 26, 48, .28);
}

/* ---------- Dark theme ----------
   Applies when the phone is in dark mode (unless the visitor picked light),
   or when they picked dark with the header toggle. Every text/background pair
   is AA (4.5:1) or better; checked with scripts/contrast.js. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { 
    color-scheme: dark;
    --bg: #0a1322; --card: #121e33; --field: #0f1a2d; --tab-on: #1c2b47;
    --ink: #eef2f8; --text: #c8d1df; --muted: #9ba8bd;
    --line: #23324d; --line-strong: #6b7fa6;
    --btn: #f3c969; --btn-hover: #f7d68a; --btn-ink: #0d1a30; --link: #9fc0ff;
    --good: #5fd3bf; --good-bg: #0f2e2b; --warn: #f0c060; --warn-bg: #33270d; --bad: #ff9a9a; --bad-bg: #3a1a1d;
    --verdict-good: #bff0e6; --verdict-warn: #fbe3b0; --verdict-bad: #ffd4d4;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7);
    --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ba8bd' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
   }
}
:root[data-theme="dark"] { 
    color-scheme: dark;
    --bg: #0a1322; --card: #121e33; --field: #0f1a2d; --tab-on: #1c2b47;
    --ink: #eef2f8; --text: #c8d1df; --muted: #9ba8bd;
    --line: #23324d; --line-strong: #6b7fa6;
    --btn: #f3c969; --btn-hover: #f7d68a; --btn-ink: #0d1a30; --link: #9fc0ff;
    --good: #5fd3bf; --good-bg: #0f2e2b; --warn: #f0c060; --warn-bg: #33270d; --bad: #ff9a9a; --bad-bg: #3a1a1d;
    --verdict-good: #bff0e6; --verdict-warn: #fbe3b0; --verdict-bad: #ffd4d4;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7);
    --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ba8bd' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
   }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 8vw, 48px); font-weight: 700; }
h2 { font-size: clamp(23px, 5.5vw, 30px); font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 19px; font-weight: 600; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.measure { max-width: var(--measure); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible, .free-band :focus-visible { outline-color: var(--moon); }

/* ---------- Header ---------- */
.site-header { background: var(--night); color: #fff; position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding-top: env(safe-area-inset-top); }
.logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font: 700 18px/1 var(--font-display); letter-spacing: -.01em; min-height: 48px; }
.logo svg { flex: none; }
.logo span b { color: var(--moon); font-weight: 700; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { appearance: none; background: transparent; border: 1px solid var(--night-line); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.nav { position: relative; }
.nav-toggle { appearance: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--night-line); font-weight: 600; font-size: 15px; color: #fff; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.nav-toggle svg { transition: transform .2s; }
.nav.open .nav-toggle svg { transform: rotate(180deg); }
.nav-menu { display: none; }
.nav.open .nav-menu { display: block; }
.nav-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px; margin: 0; list-style: none; }
.nav-menu a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--bg); }
.nav-menu .nav-free { font-size: 13px; color: var(--muted); padding: 8px 14px 4px; }

/* ---------- Hero + calculator ---------- */
.hero { background: radial-gradient(120% 90% at 85% 0%, var(--night-2) 0%, var(--night) 60%); color: #d7deeb; padding: 16px 0 84px; position: relative; overflow: hidden; }
.hero::before { /* stars */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(1.2px 1.2px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 32% 68%, #fff, transparent), radial-gradient(1.4px 1.4px at 58% 18%, #fff, transparent), radial-gradient(1px 1px at 78% 58%, #fff, transparent), radial-gradient(1.2px 1.2px at 90% 30%, #fff, transparent), radial-gradient(1px 1px at 46% 40%, #fff, transparent), radial-gradient(1px 1px at 6% 80%, #fff, transparent);
}
.hero .wrap { position: relative; }
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero-lede { font-size: 16px; line-height: 1.5; color: #c3cde0; margin: 0 0 14px; max-width: 560px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pills li { font-size: 13px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid var(--night-line); border-radius: 999px; padding: 5px 11px; display: inline-flex; align-items: center; gap: 6px; }
.pills li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--moon); }
.hero--tool { padding-bottom: 88px; }
.hero--text { padding-bottom: 36px; }
.partner-safety { font-size: 14px; color: var(--muted); }
.partner a:not(.btn) { color: var(--link); }
fieldset.field { border: 0; padding: 0; min-width: 0; }
legend.field-label { padding: 0; }
.crumbs { font-size: 14px; margin: 0 0 8px; color: #9fb0cc; }
.crumbs a { color: #c3cde0; }

.calc-wrap { margin-top: -68px; position: relative; z-index: 2; }
.calc { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 16px 20px; max-width: 640px; margin: 0 auto; }
.calc-title { font: 600 15px/1.3 var(--font); color: var(--muted); margin: 0 0 12px; text-align: center; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.tab { appearance: none; border: 0; background: transparent; min-height: 48px; border-radius: 11px; font: 600 15px/1.15 var(--font); white-space: nowrap; color: var(--muted); cursor: pointer; padding: 4px 6px; -webkit-tap-highlight-color: transparent; }
.tab[aria-selected="true"] { background: var(--tab-on); color: var(--ink); box-shadow: 0 1px 3px rgba(13, 26, 48, .14); }

.field { margin: 0 0 16px; }
.field > label, .field-label { display: block; font-weight: 600; color: var(--ink); font-size: 16px; margin: 0 0 8px; }
.field-hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

/* Time picker: three native selects. Native selects open the OS wheel on
   iOS and Android, which beats any custom picker for one-thumb use. */
.tp { display: flex; align-items: center; gap: 6px; }
.tp .sep { font: 700 26px/1 var(--font-display); color: var(--ink); }
select, input[type="number"] {
  appearance: none; -webkit-appearance: none;
  font: 600 18px/1.2 var(--font); color: var(--ink);
  background: var(--field) var(--arrow) no-repeat right 12px center;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  min-height: 56px; padding: 0 34px 0 14px; width: 100%;
  -webkit-tap-highlight-color: transparent;
}
input[type="number"] { background-image: none; padding-right: 14px; }
.tp select { font-size: 24px; text-align: center; text-align-last: center; padding: 0 26px 0 10px; background-position: right 9px center; }
.tp select.ampm { font-size: 19px; }
select:focus-visible, input:focus-visible { border-color: var(--link); outline: 3px solid var(--link); outline-offset: 1px; }

.row-2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }

.stepper { display: flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--field); }
.stepper button { appearance: none; border: 0; background: var(--bg); width: 56px; min-height: 52px; font: 600 24px/1 var(--font); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stepper button:active { background: var(--line); }
.stepper output { flex: 1; text-align: center; font: 600 18px/1 var(--font); color: var(--ink); }

.btn { appearance: none; border: 0; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 22px; border-radius: 14px; background: var(--btn); color: var(--btn-ink); font: 600 17px/1 var(--font); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background .15s, transform .1s; }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(.985); }
.btn--ghost { background: transparent; color: var(--link); border: 1.5px solid var(--line-strong); }
.btn--ghost:hover { background: var(--bg); }
.btn--sub { margin: -4px 0 16px; min-height: 48px; font-size: 16px; }
.btn--inline { display: inline-flex; width: auto; }
.btn--moon { background: var(--moon); color: var(--night); }
.btn--moon:hover { background: #eab94a; }
.btn-row { display: grid; gap: 10px; }

.settings { margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.settings summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted); list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: '+'; margin-left: auto; font-size: 22px; font-weight: 400; }
.settings[open] summary::after { content: '\2212'; }
.settings .field { margin-top: 6px; }

.panel[hidden] { display: none; }
.now-clock { text-align: center; font: 700 44px/1 var(--font-display); color: var(--ink); margin: 6px 0 4px; letter-spacing: -.02em; }
.now-note { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 16px; }

.more-tools { text-align: center; margin: 14px 0 0; font-size: 15px; font-weight: 600; }
.more-tools a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }

/* ---------- Results ---------- */
.results { max-width: 640px; margin: 20px auto 0; scroll-margin-top: 16px; }
.results[hidden] { display: none; }
.results-head { font: 700 21px/1.25 var(--font-display); color: var(--ink); margin: 0 0 4px; }
.results-sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.times { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.time-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: rise .35s ease-out both; }
.time-card:nth-child(2) { animation-delay: .05s; } .time-card:nth-child(3) { animation-delay: .1s; } .time-card:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.time-card .t { font: 700 30px/1 var(--font-display); color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.time-card .m { font-size: 14px; color: var(--muted); text-align: right; line-height: 1.35; }
.time-card .m strong { display: block; color: var(--ink); font-size: 15px; }
.time-card.best { border-color: var(--good); background: linear-gradient(0deg, var(--good-bg), var(--card) 70%); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 3px 8px; margin-top: 4px; }
.time-card.best .badge { background: var(--card); }
.results-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.results-actions .btn { min-height: 50px; font-size: 15px; }
.results-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.stat { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.stat dt { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.stat dd { margin: 0; font: 700 26px/1.1 var(--font-display); color: var(--ink); letter-spacing: -.015em; }
.stat--wide { grid-column: 1 / -1; }
.verdict { border-radius: var(--r-md); padding: 14px 16px; margin: 12px 0 0; font-size: 16px; }
.verdict strong { display: block; font-size: 17px; margin-bottom: 2px; }
.verdict--good { background: var(--good-bg); color: var(--verdict-good); }
.verdict--warn { background: var(--warn-bg); color: var(--verdict-warn); }
.verdict--bad { background: var(--bad-bg); color: var(--verdict-bad); }
.plan { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.plan li { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.plan li b { color: var(--ink); }

.nights { display: grid; gap: 8px; }
.night { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; }
.night span { font-weight: 600; color: var(--ink); }

/* ---------- Content ---------- */
main { display: block; }
.section { padding: 36px 0; }
.section--tight { padding: 20px 0; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 1.2em; background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.prose th, .prose td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--night); color: #fff; font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.2em; }
.table-scroll table { margin: 0; }
.prose td { font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .prose table { font-size: 15px; } .prose th, .prose td { padding: 10px 12px; } }

.free-band { background: var(--night); color: #d7deeb; border-radius: var(--r-lg); padding: 22px 18px; }
.free-band h2 { color: #fff; margin-top: 0; }
.free-band p { color: #c3cde0; }

.tool-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.tool-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px; text-decoration: none; color: var(--text); min-height: 76px; transition: border-color .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.tool-card:hover { border-color: var(--link); }
.tool-card:active { transform: scale(.99); }
.tool-card .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--night); color: var(--moon); display: grid; place-items: center; }
.tool-card .tx { flex: 1; min-width: 0; }
.tool-card .tn { display: block; font: 600 17px/1.25 var(--font-display); color: var(--ink); }
.tool-card .td { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.tool-card .go { flex: none; color: var(--muted); }
.free-band .tool-card { border-color: transparent; }

/* Titan callout — editorial, labelled as a partner */
.partner { background: var(--card); border: 1.5px solid var(--line); border-left: 4px solid var(--moon); border-radius: var(--r-md); padding: 16px; margin: 20px auto 0; max-width: 640px; font-size: 16px; }
.partner-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 6px; }
.partner p { margin: 0 0 .6em; }
.partner p:last-child { margin: 0; }
.partner .btn { margin-top: 10px; min-height: 50px; font-size: 16px; }

/* Sponsored banners (Titan Recovery) */
.ad { margin: 28px auto; max-width: 760px; }
.ad-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ad-link { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.ad-link:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.ad picture { display: block; }
.ad img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 533; background: var(--line); }

/* FAQ */
.faq { max-width: var(--measure); }
.faq details { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); margin: 0 0 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; min-height: 56px; display: flex; align-items: center; font-weight: 600; color: var(--ink); position: relative; font-size: 16px; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: '\2212'; }
.faq .a { padding: 0 16px 14px; }
.faq .a p:last-child { margin: 0; }

.sources { font-size: 14px; color: var(--muted); max-width: var(--measure); }
.sources ol { padding-left: 1.2em; }
.disclaimer { font-size: 14px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; max-width: var(--measure); }

/* ---------- Blog ---------- */
.post-meta { font-size: 14px; color: #9fb0cc; margin: 12px 0 0; }
.post-meta a { color: #c3cde0; }
.post-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.post-card { display: flex; flex-direction: column; gap: 6px; height: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 16px; text-decoration: none; color: var(--text); transition: border-color .15s; -webkit-tap-highlight-color: transparent; }
.post-card:hover { border-color: var(--link); }
.pc-t { font: 700 19px/1.25 var(--font-display); color: var(--ink); letter-spacing: -.01em; }
.pc-d { font-size: 15px; line-height: 1.5; }
.pc-m { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: auto; }
.more-tools--left { text-align: left; }
.prose h2 { scroll-margin-top: 16px; }
.prose > p:first-child { font-size: 1.06em; color: var(--ink); }
.tool-cta { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1.5px solid var(--link); border-radius: var(--r-md); padding: 14px; margin: 20px 0 8px; text-decoration: none; color: var(--text); -webkit-tap-highlight-color: transparent; }
.tool-cta .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--night); color: var(--moon); display: grid; place-items: center; }
.tool-cta .tx { flex: 1; min-width: 0; }
.tc-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tool-cta .tn { display: block; font: 700 18px/1.25 var(--font-display); color: var(--ink); }
.tool-cta .td { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.tool-cta .go { flex: none; color: var(--link); }
.partner--post { margin: 32px 0 0; max-width: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--night-line); background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chips a span { color: var(--moon); }
.blog-group { scroll-margin-top: 8px; }
.blog-group h2 { margin-top: .6em; }
@media (min-width: 760px) { .chips { flex-wrap: wrap; justify-content: center; overflow: visible; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #aebad0; padding: 36px 0 calc(28px + env(safe-area-inset-bottom)); margin-top: 40px; font-size: 15px; }
.site-footer a { color: #e3e8f2; text-decoration: none; display: inline-flex; min-height: 40px; align-items: center; }
.site-footer a:hover { text-decoration: underline; }
.foot-grid { display: grid; gap: 24px; }
.foot-grid h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--moon); margin: 0 0 6px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-free { font: 600 17px/1.4 var(--font-display); color: #fff; margin: 10px 0 0; }
.foot-legal { border-top: 1px solid var(--night-line); margin-top: 24px; padding-top: 16px; font-size: 13px; line-height: 1.5; }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .calc { padding: 24px 24px 26px; }
  .row-2 { grid-template-columns: 1fr 1fr; }
  .tool-grid, .post-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat--wide { grid-column: auto; }
  .tab { font-size: 15px; }
}
@media (min-width: 760px) {
  body { font-size: 18px; }
  .hero { padding: 40px 0 104px; text-align: center; }
  .hero-lede, .hero .pills { margin-left: auto; margin-right: auto; justify-content: center; }
  .calc-wrap { margin-top: -80px; }
  .section { padding: 56px 0; }
  .free-band { padding: 32px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .times { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: none; }
  .nav-menu, .nav.open .nav-menu { position: static; width: auto; background: none; box-shadow: none; padding: 0; display: flex; gap: 2px; }
  .nav-menu li:nth-child(n+6) { display: none; }
  .nav-menu .nav-free { display: none; }
  .nav-menu li.nav-blog { display: block; }
  .nav-menu a { color: #d7deeb; min-height: 40px; font-size: 15px; padding: 0 12px; }
  .nav-menu a:hover, .nav-menu a[aria-current="page"] { background: rgba(255, 255, 255, .08); color: #fff; }
}
@media (min-width: 1000px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
