/* Tech Tools design system, shared by the PHP pages and the React tools.
   Direction: a repair bench. Quiet paper surfaces, ink text, one bench-green accent,
   and a perforated "inspection ticket" edge as the only signature detail.
   Spacing sits on a 4px grid. Weights are 400, 500 and 600. */
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-latin-wght-normal.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: "Jakarta"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f5f5f1;
  --surface: #ffffff;
  --soft: #ecede7;
  --line: rgb(22 28 24 / 0.10);
  --line-strong: rgb(22 28 24 / 0.20);
  --ink: #161c18;
  --text: #333c36;
  --muted: #616a63;
  --on-ink: #f5f5f1;

  --primary: #0b6e4f;
  --primary-dark: #085a40;
  --primary-soft: #e3f0ea;
  --on-primary: #ffffff;

  --green: #15803d;
  --green-dark: #11632f;
  --green-soft: #e4f3e8;
  --amber: #8a4b07;
  --amber-soft: #fbefd9;
  --red: #b42318;
  --red-soft: #fbe9e7;
  --focus: #d97706;

  /* Older names still used by the tool stylesheets. */
  --navy: var(--ink);
  --navy-text: var(--ink);
  --gradient: var(--primary);

  --radius: 14px;
  --radius-small: 10px;
  --shadow: 0 1px 2px rgb(22 28 24 / 0.05);
  --shadow-hover: 0 8px 24px rgb(22 28 24 / 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabbar: 0px;
  --font: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111412;
  --surface: #181c19;
  --soft: #222824;
  --line: rgb(236 240 234 / 0.10);
  --line-strong: rgb(236 240 234 / 0.22);
  --ink: #eceee9;
  --text: #c6ccc6;
  --muted: #939c95;
  --on-ink: #121512;
  --primary: #4fc79b;
  --primary-dark: #74d6b1;
  --primary-soft: #173128;
  --on-primary: #08150f;
  --green: #4cc38a;
  --green-dark: #6fd3a2;
  --green-soft: #16301f;
  --amber: #f0b65a;
  --amber-soft: #33270f;
  --red: #ff8a80;
  --red-soft: #3a1b18;
  --shadow: none;
  --shadow-hover: 0 8px 24px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 600; margin: 32px 0 8px; overflow-wrap: break-word; }
h1 { font-size: clamp(1.875rem, 4.2vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; margin-top: 8px; }
h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); letter-spacing: -0.01em; }
h3 { font-size: 1.0625rem; }
strong, b { font-weight: 600; }
h1, h2, h3 { text-wrap: balance; }
p, ul, ol { margin: 0 0 16px; }
code { padding: 2px 6px; border-radius: 4px; background: var(--soft); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--primary); color: var(--on-primary); }
a, button, summary, label, input, select, textarea { touch-action: manipulation; }
a, button, summary, .choice { -webkit-tap-highlight-color: rgb(11 110 79 / 0.14); }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.container--narrow { width: min(820px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 16px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted, .note { color: var(--muted); }
.note { font-size: 0.875rem; }
.center { text-align: center; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; stroke-width: 1.6; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 16px; min-height: 64px; position: relative; }
.logo { display: flex; align-items: center; margin-right: auto; }
.logo img { display: block; width: auto; height: 28px; }
.logo__dark, :root[data-theme="dark"] .logo__light { display: none !important; }
:root[data-theme="dark"] .logo__dark { display: block !important; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; }
.nav a:not(.button) { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.9rem; }
.nav a:not(.button):hover { background: var(--soft); color: var(--ink); }
.nav a:not(.button)[aria-current="page"] { color: var(--ink); background: var(--soft); }
.nav__cta { margin-left: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.icon-button:hover { border-color: var(--line-strong); }
.search-button { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 12px; font: inherit; font-size: 0.875rem; color: var(--muted); }
kbd { display: inline-block; min-width: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); font: 500 0.75rem/1.6 var(--font); text-align: center; }
.theme-moon, :root[data-theme="dark"] .theme-sun { display: block; }
.theme-sun, :root[data-theme="dark"] .theme-moon { display: none; }
.menu-button { display: none; }

/* ---------- Buttons and forms ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 20px; border: 1px solid transparent; border-radius: var(--radius-small); background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease); }
.button:hover { background: var(--primary-dark); color: var(--on-primary); }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.button--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button--ghost:hover { background: var(--soft); color: var(--ink); }
.button--accent { background: var(--ink); color: var(--on-ink); }
.button--accent:hover { background: var(--ink); color: var(--on-ink); opacity: 0.88; }
.button--light { background: var(--surface); color: var(--ink); }
.button--light:hover { background: var(--soft); color: var(--ink); }
.button--large { min-height: 48px; padding: 12px 24px; font-size: 1rem; }
.button--small { min-height: 36px; padding: 4px 14px; font-size: 0.8125rem; border-radius: 8px; }
.button--wide { width: 100%; }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }
.input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); font: inherit; background: var(--surface); color: var(--ink); transition: border-color 150ms var(--ease); }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -1px; }
.input--short { max-width: 144px; }
textarea.input { resize: vertical; }
.field { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.field__label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--ink); padding: 0; }
.field__optional { font-weight: 400; color: var(--muted); font-size: 0.875rem; }
.field__help { margin-top: 8px; font-size: 0.875rem; color: var(--muted); }
.field__help summary { cursor: pointer; color: var(--primary); font-weight: 500; }
.field__help p { margin: 4px 0 0; }
.field__error { color: var(--red); font-size: 0.875rem; font-weight: 500; margin: 4px 0 0; }
.field__error:empty { display: none; }
.field--error .input, .field--error .choice { border-color: var(--red); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); cursor: pointer; background: var(--surface); transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.choice:hover { border-color: var(--primary); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice--on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice__title { font-weight: 600; color: var(--ink); font-size: 0.9375rem; }
.choice__hint { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.slider { width: 100%; accent-color: var(--primary); height: 32px; }

.alert { border-radius: var(--radius-small); padding: 12px 16px; margin: 16px 0; font-weight: 500; font-size: 0.9375rem; border: 1px solid transparent; }
.alert p { margin: 0 0 8px; }
.alert p:last-child { margin: 0; }
.alert--error { background: var(--red-soft); color: var(--red); }
.alert--success { background: var(--green-soft); color: var(--green-dark); }
.alert--warning { background: var(--amber-soft); color: var(--amber); }
.loading { padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Cards, grids, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
fieldset.card { min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); }
.grid .card { margin: 0; }
.grid--small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
a.card { display: block; text-decoration: none; color: inherit; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
a.card:hover { border-color: var(--primary); color: inherit; }
a.card h3 { margin: 0 0 4px; font-size: 1rem; }
a.card p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.tag { display: inline-block; font-size: 0.8125rem; font-weight: 500; color: var(--primary); margin-bottom: 4px; }
.price { display: block; font-size: 1.25rem; font-weight: 600; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
th { font-weight: 600; color: var(--ink); }
thead th { font-size: 0.8125rem; font-weight: 500; color: var(--muted); background: var(--soft); }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.pos { color: var(--green-dark); }
.neg { color: var(--red); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill--high, .pill--ok { background: var(--green-soft); color: var(--green-dark); }
.pill--medium, .pill--warning { background: var(--amber-soft); color: var(--amber); }
.pill--low, .pill--failing { background: var(--red-soft); color: var(--red); }
.chart { position: relative; height: 280px; }
.approx { font-size: max(0.65em, 0.72rem); font-weight: 500; color: var(--muted); }

/* ---------- Brand logos ---------- */
.brand-logo { display: block; width: 40px; height: 40px; object-fit: contain; }
.brand-logo--samsung, .brand-logo--oppo, .brand-logo--vivo, .brand-logo--honor, .brand-logo--sony, .brand-logo--infinix, .brand-logo--tecno, .brand-logo--realme { width: 104px; }
.brand-logo--lg { width: 70px; }
.brand-logo--itel, .brand-logo--poco { width: 62px; }
.brand-logo--poco { border-radius: 6px; }
.brand-logo--text { display: inline-flex; align-items: center; width: auto; height: 40px; font-weight: 600; font-size: 1rem; color: var(--ink); }
/* Logo files are drawn for light backgrounds, so they keep one in the dark theme. */
:root[data-theme="dark"] img.brand-logo, :root[data-theme="dark"] img.brand-tile__logo { background: #f5f5f1; border-radius: 6px; padding: 3px; }
.brand-logo--head { height: 48px; width: 48px; margin-bottom: 8px; }
.brand-logo--head.brand-logo--samsung, .brand-logo--head.brand-logo--oppo, .brand-logo--head.brand-logo--vivo, .brand-logo--head.brand-logo--honor, .brand-logo--head.brand-logo--sony, .brand-logo--head.brand-logo--infinix, .brand-logo--head.brand-logo--tecno, .brand-logo--head.brand-logo--realme { width: 132px; }
.brand-logo--head.brand-logo--text { width: auto; font-size: 1.5rem; }
.brand-card .brand-logo { margin-bottom: 12px; }
.phone-card .brand-logo { margin-bottom: 12px; height: 28px; width: 28px; }
.phone-card .brand-logo--itel, .phone-card .brand-logo--poco { width: 48px; }
.phone-card .brand-logo--samsung, .phone-card .brand-logo--oppo, .phone-card .brand-logo--vivo, .phone-card .brand-logo--honor, .phone-card .brand-logo--sony, .phone-card .brand-logo--infinix, .phone-card .brand-logo--tecno, .phone-card .brand-logo--realme { width: 80px; }
.phone-card .brand-logo--text { width: auto; font-size: 0.875rem; }
.phone-card__basis { font-size: 0.75rem !important; }

/* ---------- The signature: a perforated inspection ticket ---------- */
.ticket { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ticket__tear { position: relative; height: 0; margin: 0; border: 0; border-top: 2px dashed var(--line-strong); }
.ticket__tear::before, .ticket__tear::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.ticket__tear::before { left: -9px; clip-path: inset(0 0 0 50%); }
.ticket__tear::after { right: -9px; clip-path: inset(0 50% 0 0); }

/* ---------- Home ---------- */
.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 48px; }
.hero h1 { font-size: clamp(2.125rem, 4.4vw, 3.125rem); line-height: 1.06; letter-spacing: -0.03em; margin: 0 0 20px; }
.hero__lead { max-width: 34rem; font-size: 1.125rem; color: var(--muted); margin-bottom: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__points { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 24px 0 0; font-size: 0.875rem; color: var(--muted); }
.hero__points li { display: flex; align-items: center; gap: 8px; }
.hero__points .icon, .check-list .icon { color: var(--primary); stroke-width: 2.2; }

.bench { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; padding: 32px; border-radius: 20px; background-color: var(--primary-soft); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
.bench__phone { width: 200px; max-width: none; filter: drop-shadow(0 12px 16px rgb(0 0 0 / 0.18)); position: relative; z-index: 1; }
.bench__ticket { transform: rotate(1.5deg); box-shadow: var(--shadow-hover); }
.bench__ticket header { padding: 16px 20px 12px 40px; }
.bench__ticket header span { display: block; font-size: 0.75rem; color: var(--muted); }
.bench__ticket header strong { color: var(--ink); }
.bench__ticket ul { list-style: none; margin: 0; padding: 4px 20px 12px 40px; font-size: 0.875rem; }
.bench__ticket li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bench__ticket li:last-child { border-bottom: 0; }
.bench__total { padding: 16px 20px 20px 40px; }
.bench__total span { display: block; font-size: 0.75rem; color: var(--muted); }
.bench__total strong { display: block; font-size: 1.75rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.3; }

.brand-strip { border-bottom: 1px solid var(--line); background: var(--surface); padding: 16px 0; }
.brand-strip p { font-size: 0.8125rem; color: var(--muted); margin-bottom: 8px; }
.brand-strip ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.brand-strip a { position: relative; display: grid; place-items: center; min-width: 84px; height: 52px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-small); text-decoration: none; transition: border-color 150ms var(--ease); }
.brand-strip a:hover { border-color: var(--primary); }
.brand-strip .brand-logo { width: 28px; height: 28px; }
.brand-strip .brand-logo--itel, .brand-strip .brand-logo--poco { width: 48px; }
.brand-strip .brand-logo--samsung, .brand-strip .brand-logo--oppo, .brand-strip .brand-logo--vivo, .brand-strip .brand-logo--honor, .brand-strip .brand-logo--sony, .brand-strip .brand-logo--infinix, .brand-strip .brand-logo--tecno, .brand-strip .brand-logo--realme { width: 76px; }
.brand-strip .brand-logo--text { width: auto; font-size: 0.875rem; }

.section { padding: 56px 0 0; }
.section__head { margin-bottom: 24px; max-width: 40rem; }
.section__head h2 { margin: 0 0 4px; }
.section__head p { margin: 0; color: var(--muted); }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: none; }
.section h2:first-child { margin-top: 0; }
.icon-box { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-small); background: var(--primary-soft); color: var(--primary); margin-bottom: 12px; flex: none; }
.icon-box .icon { width: 20px; height: 20px; }
.icon-box--large { width: 48px; height: 48px; }
.icon-box--large .icon { width: 24px; height: 24px; }

/* One large tool, two medium ones, then a compact list. */
.toolbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.toolbox__item { display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; transition: border-color 150ms var(--ease); }
.toolbox__item:hover { border-color: var(--primary); color: inherit; }
.toolbox__item h3 { margin: 0 0 4px; font-size: 1.125rem; }
.toolbox__item p { color: var(--muted); font-size: 0.9375rem; flex: 1; }
.toolbox__item--main { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; background: var(--ink); border-color: var(--ink); }
.toolbox__item--main h3 { color: var(--on-ink); font-size: 1.375rem; }
.toolbox__item--main p { color: var(--on-ink); opacity: 0.75; margin: 0; }
.toolbox__item--main > div { flex: 1; }
.toolbox__item--main .icon-box { margin: 0; background: var(--primary); color: var(--on-primary); }
.toolbox__item--main .button { flex: none; }
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 32px; margin: 16px 0 0; padding: 0; list-style: none; }
.rows a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.rows a:hover strong { color: var(--primary); }
.rows strong { display: block; color: var(--ink); font-size: 0.9375rem; }
.rows small { display: block; color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.rows .icon { width: 20px; height: 20px; color: var(--muted); }
.rows__end { margin-left: auto; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.steps-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps-list li { counter-increment: step; position: relative; padding: 0 0 24px 48px; }
.steps-list li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.875rem; }
.steps-list h3 { margin: 4px 0; }
.steps-list p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-list li .icon { margin-top: 4px; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 64px 0 0; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--ink); }
.cta-band h2 { color: var(--on-ink); margin: 0 0 4px; }
.cta-band p { margin: 0; color: var(--on-ink); opacity: 0.75; }
.cta-band .actions .button--ghost { background: transparent; color: var(--on-ink); border-color: var(--on-ink); }

/* Tools page */
.tool-feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); margin-bottom: 16px; }
.tool-feature .tag { display: block; }
.tool-feature h2, .tool-feature h3 { margin: 0 0 8px; }
.tool-feature h2 a { color: inherit; text-decoration: none; }
.tool-feature .check-list li { padding: 8px 0; font-size: 0.9375rem; }

/* ---------- Guide cards ---------- */
a.guide-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.guide-card__cover { display: block; border-bottom: 1px solid var(--line); background: var(--soft); }
.guide-card__cover svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; }
.guide-card__body { display: block; padding: 16px 20px 20px; }
@media (min-width: 981px) { .section > .grid:has(.guide-card) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cover__grid { stroke: var(--line); stroke-width: 1; fill: none; }
.cover__body { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.cover__line { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.cover__accent { fill: var(--primary); }
.cover__mark { fill: none; stroke: var(--on-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Price search and list ---------- */
.search-bar { display: flex; gap: 8px; max-width: 520px; margin-top: 24px; }
.search-bar .input { flex: 1; min-width: 0; margin: 0; }
.search-bar .button { flex: none; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: center; margin-top: 20px; }
.filter-bar .input { width: 100%; margin: 0; }
.filter-bar__check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; color: var(--text); cursor: pointer; }
.filter-bar__check input { width: 18px; height: 18px; accent-color: var(--primary); }
.result-count { color: var(--muted); font-size: 0.9375rem; }
.result-count strong { color: var(--ink); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 16px; }
.price-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: border-color 150ms var(--ease); }
.price-card:hover { border-color: var(--line-strong); }
.price-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.price-card__head .brand-logo { flex-shrink: 0; width: 44px; height: 28px; }
.price-card__head .brand-logo--lg, .price-card__head .brand-logo--sony, .price-card__head .brand-logo--infinix, .price-card__head .brand-logo--tecno, .price-card__head .brand-logo--realme, .price-card__head .brand-logo--itel, .price-card__head .brand-logo--poco { width: 44px; }
.price-card__head .brand-logo--text { width: 44px; height: 28px; justify-content: center; font-size: 0.75rem; overflow: hidden; }
.price-card h3 { margin: 0; font-size: 1rem; }
.price-card h3 a { color: inherit; text-decoration: none; }
.price-card h3 a:hover { color: var(--primary); }
.price-card__head p { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.price-card__table { font-size: 0.875rem; margin-bottom: 12px; }
.price-card__table th, .price-card__table td { padding: 8px 4px; }
.price-card__table thead th { background: none; font-size: 0.75rem; padding-top: 0; white-space: normal; }
.price-card__table tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.price-card__table td { text-align: right; white-space: nowrap; font-weight: 600; color: var(--ink); }
.price-card__table td + td { font-weight: 500; color: var(--muted); }
.price-card__table thead th:not(:first-child) { text-align: right; }
.price-card__table .approx { display: block; line-height: 1.2; }
.price-card__table tbody tr:last-child > * { border-bottom: 0; }
.price-card__empty { color: var(--muted); font-size: 0.875rem; }
.price-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.875rem; }
[data-loading] { opacity: 0.55; transition: opacity 150ms var(--ease); }

/* Search suggestions */
[data-suggest] { position: relative; }
.suggest { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); max-height: 360px; overflow-y: auto; text-align: left; }
.suggest[hidden] { display: none; }
.suggest a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-small); text-decoration: none; color: var(--ink); }
.suggest a:hover, .suggest [aria-selected="true"] a { background: var(--soft); }
.suggest strong { display: block; font-size: 0.9375rem; }
.suggest small { display: block; color: var(--muted); font-size: 0.75rem; }
.suggest span:last-child { font-weight: 600; font-size: 0.8125rem; white-space: nowrap; }

/* Site search */
.finder { width: min(600px, 100% - 24px); max-height: min(640px, 100% - 48px); margin: 8vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 0.3); }
.finder::backdrop { background: rgb(10 14 12 / 0.55); }
.finder__bar { position: sticky; top: 0; display: flex; gap: 8px; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.finder__results { padding: 4px 12px 12px; }
.finder h2 { margin: 12px 4px 4px; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.finder ul { list-style: none; margin: 0; padding: 0; }
.finder li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; }
.finder li a:hover, .finder li a:focus-visible, .finder li a.is-active { background: var(--soft); }
.finder li small { color: var(--muted); white-space: nowrap; }
.finder__empty { padding: 16px 4px; color: var(--muted); }

/* Direct answer on model pages */
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); margin-bottom: 24px; }
.answer h2 { margin: 0 0 8px; font-size: 1.25rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: var(--soft); border-radius: var(--radius-small); padding: 12px; }
.facts dt { font-size: 0.8125rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Budgets, topics, article helpers */
.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.budget { display: block; padding: 16px; border-radius: var(--radius-small); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color 150ms var(--ease); }
.budget:hover { border-color: var(--primary); color: var(--ink); }
.budget strong { display: block; font-size: 0.9375rem; }
.budget span { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.8125rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 0.875rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.chip small { color: var(--muted); }
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip--on, .chip--on:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip--on small { color: inherit; opacity: 0.7; }
.summary { background: var(--primary-soft); border-radius: var(--radius-small); padding: 12px 16px; }
.toc { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px 20px; margin: 16px 0 8px; }
.toc summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2 240px; }
.toc a { text-decoration: none; font-size: 0.9375rem; }
.prose h2[id] { scroll-margin-top: 80px; }
.read-progress { position: fixed; z-index: 50; left: 0; top: 0; height: 3px; width: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); }
.to-top { position: fixed; z-index: 30; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + var(--tabbar) + env(safe-area-inset-bottom)); }
.to-top[hidden] { display: none; }

/* ---------- Content pages ---------- */
.page-banner { background: var(--surface); border-bottom: 1px solid var(--line); padding: 32px 0; margin-bottom: 24px; }
.page-banner h1 { margin: 0 0 8px; }
.page-banner p { color: var(--muted); margin: 0; max-width: 40rem; font-size: 1.0625rem; }
.page-head { padding-top: 8px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 40px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); }
.prose > table { display: block; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-small); }
.article-meta { color: var(--muted); font-size: 0.875rem; }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 48px; align-items: start; }
.sidebar { position: sticky; top: 88px; }
.sidebar ul { list-style: none; padding: 0; }
.sidebar li { margin-bottom: 8px; font-size: 0.9375rem; }
.sidebar a:not(.button) { text-decoration: none; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 12px 0 8px; font-size: 0.8125rem; color: var(--muted); }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.breadcrumbs a { text-decoration: none; color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs:has(+ .page-banner) { margin-bottom: 0; background: var(--surface); width: 100%; padding-inline: max(16px, (100% - 1120px) / 2); }
.breadcrumbs:has(+ .page-banner) ol { margin-bottom: 0; }
.breadcrumbs + .page-banner { padding-top: 16px; }
.pagination { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 32px 0; }
.link-list { columns: 3 220px; padding: 0; list-style: none; }
.link-list li { break-inside: avoid; margin-bottom: 8px; }
.error-page { text-align: center; padding: 80px 0; }
.error-page__code { font-size: 4rem; font-weight: 600; line-height: 1; color: var(--muted); }

/* Buying checklist */
.checker__bar { position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--line); }
.checker__bar p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 0.875rem; }
.meterline { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.meterline span { display: block; height: 100%; width: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); transition: transform 300ms var(--ease); }
.checker fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 8px 16px; margin: 24px 0 0; min-width: 0; }
.checker legend { padding: 0 8px; font-weight: 600; color: var(--ink); }
.checker label { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checker label:last-child { border-bottom: 0; }
.checker input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.checker input:checked + span { color: var(--muted); text-decoration: line-through; }
.checker small { display: block; color: var(--muted); }

/* ---------- Estimator wizard ---------- */
.wizard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 4vw, 32px); margin-bottom: 32px; }
.tool-shell { min-height: 420px; }
.wizard__head { outline: none; scroll-margin-top: 80px; }
.wizard__title { margin: 16px 0 20px; font-size: 1.25rem; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; list-style: none; padding: 0; margin: 0; }
.steps__item button { width: 100%; border: 0; background: none; padding: 12px 0 0; text-align: left; font: inherit; font-size: 0.75rem; color: var(--muted); cursor: pointer; position: relative; }
.steps__item button::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 2px; background: var(--soft); }
.steps__item button:disabled { cursor: default; }
.steps__item--current button { color: var(--ink); font-weight: 600; }
.steps__item--current button::before, .steps__item--done button::before { background: var(--primary); }
.steps__item--done button::before { opacity: 0.5; }
.steps__number { display: none; }
.wizard__actions { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--primary-soft); border-radius: var(--radius-small); padding: 12px 16px; margin-bottom: 20px; }
.picked__label { display: block; font-size: 0.75rem; color: var(--muted); }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.brand-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 12px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); font: inherit; font-weight: 500; font-size: 0.875rem; color: var(--ink); cursor: pointer; transition: border-color 150ms var(--ease); }
.brand-tile:hover { border-color: var(--primary); }
.brand-tile--on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.brand-tile__logo { width: 32px; height: 32px; object-fit: contain; }
.brand-tile__logo.brand-logo--samsung, .brand-tile__logo.brand-logo--oppo, .brand-tile__logo.brand-logo--vivo, .brand-tile__logo.brand-logo--honor, .brand-tile__logo.brand-logo--sony, .brand-tile__logo.brand-logo--infinix, .brand-tile__logo.brand-logo--tecno, .brand-tile__logo.brand-logo--realme { width: 84px; }
.brand-tile__initial { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--on-ink); }
.model-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px; }
.model-list__item { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); font: inherit; font-weight: 500; font-size: 0.9375rem; color: var(--ink); cursor: pointer; }
.model-list__item:hover { border-color: var(--primary); }
.model-list__item small { color: var(--muted); font-weight: 400; }

/* ---------- Report ---------- */
.result-hero { background: var(--ink); color: var(--on-ink); border-radius: var(--radius) var(--radius) 0 0; padding: clamp(24px, 5vw, 40px); text-align: center; }
.result-hero + .actions-row { border: 1px solid var(--line); border-top: 2px dashed var(--line-strong); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); padding: 16px; justify-content: center; }
.result-hero__brand { display: inline-grid; place-items: center; min-width: 56px; height: 56px; padding: 0 12px; margin-bottom: 12px; border-radius: var(--radius-small); background: #f5f5f1; color: #161c18; }
.result-hero__brand .brand-logo { width: 32px; height: 32px; }
.result-hero__brand .brand-logo--samsung, .result-hero__brand .brand-logo--oppo, .result-hero__brand .brand-logo--vivo, .result-hero__brand .brand-logo--honor, .result-hero__brand .brand-logo--sony, .result-hero__brand .brand-logo--infinix, .result-hero__brand .brand-logo--tecno, .result-hero__brand .brand-logo--realme { width: 88px; }
.result-hero__brand .brand-logo--text { width: auto; color: #161c18; }
.result-hero__label { display: block; font-size: 0.875rem; font-weight: 500; color: inherit; opacity: 0.75; margin: 0; text-transform: lowercase; }
.result-hero__label::first-letter { text-transform: uppercase; }
.result-hero__range { display: block; font-size: clamp(1.75rem, 7vw, 3rem); font-weight: 600; line-height: 1.2; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.result-hero__range .approx { display: block; font-size: 0.875rem; color: inherit; opacity: 0.75; }
.result-hero__note { display: block; margin-bottom: 12px; font-size: 0.8125rem; opacity: 0.75; }
.result-hero p { margin: 8px 0 0; opacity: 0.85; }
.badge { display: inline-block; background: #15803d; color: #fff; padding: 4px 12px; border-radius: 6px; font-weight: 600; font-size: 0.875rem; }
.badge--fair { background: #92500a; }
.badge--low { background: #b42318; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 8px; padding: 0; list-style: none; margin: 0 0 12px; }
.market-grid li { background: var(--soft); border-radius: var(--radius-small); padding: 12px 16px; }
.market-grid span { display: block; font-size: 0.8125rem; color: var(--muted); }
.market-grid strong { font-size: 1.125rem; color: var(--ink); }
.market-grid strong .pill { display: inline-block; font-size: 0.875rem; }
.market-grid .pill--high { color: var(--green-dark); }
.market-grid .pill--medium { color: var(--amber); }
.market-grid .pill--low { color: var(--red); }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.inline-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.inline-form div { display: flex; gap: 8px; max-width: 460px; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 0 32px; margin: 0; }
.answers div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }

/* "Test your phone" */
.test-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.test-cta > div { flex: 1 1 256px; }
.test-cta h2 { margin: 0 0 4px; font-size: 1.125rem; }
.test-cta p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.test-cta .icon-box { margin: 0; }
.popup { width: min(440px, 100% - 32px); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 24px 24px; text-align: center; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 0.3); }
.popup::backdrop { background: rgb(10 14 12 / 0.55); }
.popup h2 { margin: 8px 0; font-size: 1.25rem; }
.popup__close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.5rem; color: var(--muted); cursor: pointer; }
.popup__actions { display: flex; flex-direction: column; gap: 8px; }
.qr-hint { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.qr-hint img { background: #fff; border-radius: 6px; }
.qr-hint p { margin: 0; font-size: 0.875rem; }
@media (pointer: coarse) { .qr-hint { display: none; } }

/* Device Tester Hub */
.device-grid { margin: 8px 0 32px; }
.device-card { display: flex !important; flex-direction: column; align-items: flex-start; }
.device-card h2 { margin: 4px 0; font-size: 1.0625rem; }
.device-card p { flex: 1; color: var(--muted); font-size: 0.875rem; }
.device-card .link-arrow { margin-top: 12px; }
.device-nav { margin-top: 0; }

/* Ads: height is reserved to avoid layout shift */
.ad { min-height: 280px; margin: 24px auto; text-align: center; clear: both; }
.ad__label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.ad--sidebar { min-height: 620px; }

/* ---------- Footer, tab bar and consent ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 64px; padding-top: 48px; font-size: 0.875rem; padding-bottom: env(safe-area-inset-bottom); }
.footer img { width: auto; height: 28px; margin-bottom: 12px; }
.footer h2 { font-size: 0.875rem; margin: 0 0 12px; letter-spacing: 0; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a, .footer .link-button { color: var(--muted); text-decoration: none; }
.footer a:hover, .footer .link-button:hover { color: var(--ink); text-decoration: underline; }
.footer__about { max-width: 320px; color: var(--muted); }
.footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 32px; }
.footer__bottom { border-top: 1px solid var(--line); margin-top: 32px; padding-block: 20px; font-size: 0.8125rem; color: var(--muted); }
.footer__bottom p { margin: 0 0 4px; }
.tabbar { display: none; }
.consent { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(16px + var(--tabbar) + env(safe-area-inset-bottom)); max-width: 760px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 16px; display: flex; gap: 16px; align-items: center; }
.consent[hidden] { display: none; }
.consent p { margin: 4px 0 0; font-size: 0.875rem; }
.consent__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1180px) {
  .search-button span, .search-button kbd { display: none; }
  .search-button { width: 40px; padding: 0; justify-content: center; }
}
@media (min-width: 981px) and (max-width: 1100px) { .nav__cta { display: none; } }
@media (max-width: 980px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .ad--sidebar { min-height: 280px; }
  .menu-button { display: inline-grid; order: 3; }
  .header__inner { gap: 8px; }
  .nav { display: none; position: absolute; top: 100%; left: -16px; right: -16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; box-shadow: var(--shadow-hover); max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); overflow-y: auto; }
  .nav--open { display: flex; }
  .nav a:not(.button) { padding: 12px; font-size: 1rem; }
  .nav__cta { margin: 8px 0 0; }
  .hero__grid, .split, .tool-feature { grid-template-columns: minmax(0, 1fr); }
  .hero__grid { gap: 32px; }
  .split { gap: 8px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar__search, .filter-bar .button { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  :root { --tabbar: 60px; }
  body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; padding: 0; font: 500 0.6875rem/1.3 var(--font); color: var(--muted); text-decoration: none; cursor: pointer; }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--primary); }
  .hero { padding: 32px 0; }
  /* Swipe through the brands instead of stacking them. */
  .brand-strip ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .brand-strip li { flex: none; }
  .hero__lead { font-size: 1rem; }
  .hero .actions .button { flex: 1 1 100%; }
  .section { padding-top: 40px; }
  .bench { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .bench__phone { display: none; }
  .bench__ticket header, .bench__ticket ul, .bench__total { padding-left: 20px; }
  .toolbox { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .toolbox__item { padding: 16px; }
  .toolbox__item--main { flex-direction: column; align-items: flex-start; gap: 12px; }
  .toolbox__item--main .button { width: 100%; }
  .footer { margin-top: 48px; padding-top: 32px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer__about { grid-column: 1 / -1; }
  .consent { flex-direction: column; align-items: stretch; }
  .consent__actions { justify-content: flex-end; }
  .steps__name { display: none; }
  .steps__number { display: block; }
  .choices { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .search-bar { flex-direction: column; }
  .price-card { padding: 16px; }
  .checker__bar { top: 64px; }

  /* Fingers need roughly 44px to tap comfortably. */
  .footer li { margin-bottom: 0; }
  .footer li a, .footer .link-button { display: inline-flex; align-items: center; min-height: 40px; }
  .breadcrumbs a { display: inline-block; padding: 8px 0; }
  .faq summary, .toc summary, .field__help summary { padding-block: 8px; }
  .toc a, .sidebar li a:not(.button), .link-list a { display: inline-block; padding: 8px 0; }
  .link-list li { margin-bottom: 0; }
  .link-arrow { min-height: 40px; }
  .steps__item button { min-height: 44px; }
  .chip { min-height: 40px; }
  .logo { min-height: 44px; }
  input, select, textarea { font-size: max(16px, 1rem); }
  .table--stack th a, .tool-feature h2 a, .price-card__head h3 a, a[href^="mailto:"], main h3 > a { display: inline-block; min-height: 40px; padding-block: 8px; }

  /* Tables fit the screen */
  table { font-size: 0.875rem; }
  th, td { padding: 10px 8px; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack th, .table--stack td { padding: 4px 0; border: 0; text-align: right; overflow: hidden; }
  .table--stack th[scope="row"] { text-align: left; font-size: 1rem; }
  .table--stack td::before { content: attr(data-label); float: left; margin-right: 12px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
  .table--stack td:not([data-label]) { text-align: left; color: var(--muted); }

  /* Two columns keep long phone, brand and guide-topic lists short */
  .grid--small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid--small .card { padding: 12px; min-width: 0; overflow-wrap: anywhere; }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .device-card.card { padding: 12px; min-width: 0; }
  .device-card p { display: none; }
  .device-card .link-arrow { margin-top: 4px; min-height: 0; }
  /* One swipeable row instead of a tall block of buttons. */
  .device-nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .device-nav .chip { flex: none; }

  .actions-row .button { flex: 1 1 100%; }
  .share .button { flex: 1 1 136px; }
  .inline-form div { flex-direction: column; }

  /* Next, Back and Get my price stay within reach of the thumb */
  #ef-estimator .wizard__actions { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 20; background: var(--surface); margin-inline: -8px; padding: 12px 8px; }
  #ef-estimator .wizard__actions .button { flex: 1; }
  body:has(.wizard) .to-top { display: none; }
}
@media (max-width: 340px) {
  .grid--small, .choices { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media print {
  :root { --tabbar: 0px; }
  .header, .footer, .consent, .ad, .actions-row, .share, .to-top, .tabbar, .popup, .test-cta, .checker__bar button, .read-progress { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* ---------- Admin panel ---------- */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin__nav { background: var(--ink); color: var(--on-ink); padding: 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.admin__nav nav { display: flex; flex-direction: column; gap: 2px; }
.admin__nav a { color: inherit; opacity: 0.8; text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.admin__nav a:hover, .admin__nav a[aria-current='page'] { background: rgb(255 255 255 / 0.12); color: inherit; opacity: 1; }
.admin__nav .button--ghost { background: transparent; color: inherit; border-color: rgb(255 255 255 / 0.4); }
.admin__main { padding: 24px; min-width: 0; }
.admin-signin { max-width: 420px; margin: 8vh auto; display: grid; gap: 12px; }
.admin-field { display: grid; gap: 4px; font-size: 0.875rem; font-weight: 600; }
.admin-field--wide { grid-column: 1 / -1; margin: 8px 0; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 8px 0; }
.admin-row .input { width: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat strong { display: block; font-size: 1.5rem; color: var(--ink); }
.stat span { font-size: 0.8125rem; color: var(--muted); }
.checklist { list-style: none; padding: 0; }
.checklist .done { color: var(--green-dark); }
.reviews { list-style: none; padding: 0; }
.review { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-small); padding: 12px; margin-bottom: 8px; }
.review small, td small { display: block; color: var(--muted); }
.review__controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.review__controls .input { width: auto; max-width: 100%; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.tags li { background: var(--soft); border-radius: 6px; padding: 4px 4px 4px 12px; }
.tags button { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--muted); }
.preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius-small); background: #fff; margin-top: 12px; }
.secret { font-family: monospace; font-size: 1.1rem; background: var(--soft); padding: 12px; border-radius: 8px; word-break: break-all; }
.pre { white-space: pre-wrap; }
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .admin__nav nav { flex-direction: row; flex-wrap: wrap; }
  .admin__main { padding: 16px; }
}
