:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --ink: #15201d;
  --ink-2: #3d4a46;
  --muted: #6a7672;
  --line: #e1e6e3;
  --brand: #0f766e;
  --brand-2: #115e59;
  --brand-soft: #e6f4f1;
  --good: #15803d;
  --good-soft: #e8f6ec;
  --mid: #a16207;
  --mid-soft: #fdf5e2;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 8px 24px rgba(16, 24, 20, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.65; font-size: 17px; }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 1080px; }
.logo { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--ink); font-size: 19px; margin: 0; }
.logo span:last-child { font-weight: 500; color: var(--brand); margin-left: 2px; }
.logo-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 15px; margin-right: 8px; }
.logo.small { font-size: 17px; }
.menu-btn { font: inherit; font-size: 15px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.menu-btn[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand); }
.site-nav { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.site-nav.open { display: block; }
.nav-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; padding-top: 16px; padding-bottom: 16px; max-width: 1080px; }
.nav-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 5px 0; text-decoration: none; color: var(--ink-2); font-size: 15px; }
.nav-group a:hover, .nav-group a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* Page head */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); }
.page-head { padding: 22px 0 8px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 10px; }
.lede { font-size: 19px; color: var(--ink-2); margin: 0; max-width: 720px; }

/* Calculator */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 22px 0 34px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; background: var(--bg); padding: 5px; border-radius: 12px; }
.tab { flex: 1 1 auto; font: inherit; font-size: 14.5px; font-weight: 600; border: 0; background: transparent; color: var(--ink-2); padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--brand-2); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel[hidden] { display: none; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 16px; }
.field label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .unit { position: absolute; color: var(--muted); font-size: 15px; pointer-events: none; }
.input-wrap .unit.pre { left: 12px; }
.input-wrap .unit.post { right: 12px; }
.field input, .field select { width: 100%; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid #cfd7d3; border-radius: 10px; background: #fff; color: var(--ink); }
.field input.has-pre { padding-left: 28px; }
.field input.has-post { padding-right: 34px; }
.field input:focus, .field select:focus { outline: 3px solid rgba(15,118,110,.22); border-color: var(--brand); }
.result { margin-top: 20px; border-radius: 12px; background: var(--brand-soft); padding: 16px 18px; min-height: 84px; }
.result .big { font-size: clamp(30px, 6vw, 42px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.result .big small { font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.result .label { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.result p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; }
.result .empty { color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: rgba(255,255,255,.75); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.verdict { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.verdict.good { background: var(--good-soft); color: var(--good); }
.verdict.mid { background: var(--mid-soft); color: var(--mid); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.calc-note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

/* Content */
.content { max-width: 720px; }
.content h2 { font-size: clamp(22px, 3.6vw, 28px); line-height: 1.25; letter-spacing: -.015em; margin: 42px 0 12px; }
.content h3 { font-size: 19px; margin: 26px 0 8px; }
.content p, .content li { color: var(--ink-2); }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 6px 0; }
.formula { font-family: var(--mono); font-size: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 16px; margin: 14px 0; overflow-x: auto; color: var(--ink); }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 18px 0; }
.callout strong:first-child { color: var(--brand-2); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f1f4f2; font-size: 13.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* FAQ */
.faq { max-width: 720px; margin-top: 46px; }
.faq h2 { font-size: clamp(22px, 3.6vw, 28px); margin: 0 0 14px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 22px; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding-bottom: 14px; color: var(--ink-2); }
.faq-a p { margin: 0 0 10px; }

/* Related */
.related { margin-top: 46px; }
.related h2 { font-size: clamp(20px, 3.2vw, 24px); margin: 0 0 14px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.related-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.related-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.related-card strong { display: block; color: var(--brand-2); }
.related-card span { font-size: 14.5px; color: var(--muted); }
.updated { font-size: 14px; color: var(--muted); margin: 34px 0 0; }

/* Home tool grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 18px 0; }

/* Footer */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0 22px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer-row p { margin: 4px 0; max-width: 380px; font-size: 15px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.copy { font-size: 13.5px; margin-top: 18px; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .calc { padding: 16px; }
  .tab { font-size: 13.5px; padding: 8px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Channel comparison under the CTR result */
.compare { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.compare .field { max-width: 360px; }
.compare-out:empty { display: none; }
.compare-out { margin-top: 10px; }
.compare-out p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; }

/* Who built this / sources */
.about-box { max-width: 720px; margin-top: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-size: 15px; color: var(--ink-2); }
.about-box p { margin: 0 0 10px; }
.about-box .about-title { font-weight: 700; color: var(--ink); }
.about-box ol { margin: 6px 0 0; padding-left: 20px; }
.about-box li { margin: 4px 0; }
.faq summary h3 { display: inline; font-size: inherit; font-weight: inherit; margin: 0; }

/* Simple top navigation (used while only the homepage and site pages are live) */
.top-links { display: flex; gap: 4px; }
.top-links a { text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.top-links a:hover { color: var(--brand-2); background: var(--brand-soft); }
.top-links a[aria-current="page"] { color: var(--brand-2); background: var(--brand-soft); }
@media (max-width: 480px) { .top-links a:first-child { display: none; } .top-links a { padding: 6px 9px; font-size: 14px; } }
