/* ==========================================================================
   AllOnlineCalcs — shared stylesheet
   Components: .calc (tool card), .field, .field-row, .input-group, .seg,
   .tabs, .btn, .result-hero, .result-grid/.stat, table.data, .chart,
   .content (prose), .faq, .tool-grid/.tool-card, .note
   ========================================================================== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e2e6ef;
  --text: #161a2b;
  --muted: #5d6479;
  --primary: #4f46e5;
  --primary-ink: #ffffff;
  --primary-soft: #eef0ff;
  --accent: #0ea5a4;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --c1: #4f46e5; --c2: #0ea5a4; --c3: #f59e0b; --c4: #ec4899; --c5: #64748b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 18px rgba(16,24,40,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d1020;
  --surface: #151a2e;
  --surface-2: #1c2238;
  --border: #2a3150;
  --text: #e8ebf7;
  --muted: #9aa3bf;
  --primary: #8b85ff;
  --primary-ink: #0d1020;
  --primary-soft: #23264a;
  --accent: #2dd4bf;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --c1: #8b85ff; --c2: #2dd4bf; --c3: #fbbf24; --c4: #f472b6; --c5: #94a3b8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h2 { font-size: 1.4rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.3em; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* Header ---------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo svg { color: var(--primary); }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-size: .92rem; white-space: nowrap; font-weight: 500; }
.main-nav a:hover, .main-nav a.active { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 9px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; flex: none; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; gap: 6px 12px; }
  .main-nav { order: 3; width: 100%; margin: 0 -6px; }
  .theme-toggle { margin-left: auto; }
}

/* Breadcrumb / tool head --------------------------------------------------- */
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 18px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.tool-head { margin-bottom: 18px; max-width: 820px; }
.lead { color: var(--muted); font-size: 1.05rem; }

/* Calculator card -------------------------------------------------------- */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; }
.calc.single { grid-template-columns: minmax(0, 1fr); }
.calc-form { padding: 24px; }
.calc-result { padding: 24px; background: var(--surface-2); border-left: 1px solid var(--border); }
.calc.single .calc-result { border-left: 0; border-top: 1px solid var(--border); }
.calc-result:empty::before { content: "Enter your values to see the result."; color: var(--muted); }
@media (max-width: 820px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-result { border-left: 0; border-top: 1px solid var(--border); }
  .calc-form, .calc-result { padding: 18px; }
}
.calc + .calc, .calc + .content, .calc + .ad-slot { margin-top: 24px; }

/* Form fields ------------------------------------------------------------ */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 12px; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
textarea { min-height: 110px; resize: vertical; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select, table.inputs select, .input-group > select { padding-right: 28px !important; text-overflow: ellipsis; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
input[type="number"]::-webkit-inner-spin-button { opacity: .5; }
input[type="range"] { width: 100%; accent-color: var(--primary); margin-top: 8px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 17px; height: 17px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; margin-bottom: 10px; }

/* Input with prefix/suffix units: <div class="input-group"><span>$</span><input><span>%</span></div> */
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.input-group input, .input-group select { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; flex: 1; }
.input-group > span { display: grid; place-items: center; padding: 0 11px; color: var(--muted); background: var(--surface-2); font-size: .9rem; white-space: nowrap; }
.input-group > select { flex: 0 0 auto; width: auto; background-color: var(--surface-2); border-left: 1px solid var(--border); }

/* Segmented control: <div class="seg"><input type="radio" id="a" name="n"><label for="a">A</label>...</div> */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--muted); user-select: none; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--primary); }

/* Tabs: <div class="tabs" role="tablist"><button class="tab" aria-selected="true" data-tab="p1">…</button></div><div class="tab-panel" id="p1">…</div> */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel[hidden] { display: none; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .95rem; border-radius: var(--radius-sm); padding: 10px 18px; min-height: 44px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .05s, background .15s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 4px 0; min-height: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; font-size: 1.1rem; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--bad); }

/* Results ---------------------------------------------------------------- */
.result-label { font-size: .85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.result-hero { font-size: clamp(1.9rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 6px; color: var(--primary); word-break: break-word; }
.result-sub { color: var(--muted); margin-bottom: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; min-width: 0; }
.stat .k { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat .v { display: block; font-size: 1.12rem; font-weight: 700; word-break: break-word; }
.stat.hl { border-color: var(--primary); background: var(--primary-soft); }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.badge.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.note { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; color: var(--text); margin: 12px 0; }
.error-msg { color: var(--bad); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.copy-btn { margin-top: 10px; }

/* Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin: 12px 0; max-height: 460px; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data.left td, table.data.left th { text-align: left; }
table.inputs td { padding: 6px 6px; text-align: left; }
table.inputs input, table.inputs select { min-height: 40px; padding: 8px 10px; }

/* Charts ----------------------------------------------------------------- */
.chart { width: 100%; margin: 10px 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--border); }

/* Content / prose --------------------------------------------------------- */
.content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px clamp(18px, 4vw, 40px); margin-top: 28px; }
.content > :first-child { margin-top: 0; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .35em; }
.content code, .formula { font-family: var(--mono); background: var(--surface-2); border-radius: 6px; padding: 2px 6px; font-size: .9em; }
.formula { display: block; padding: 12px 16px; margin: 10px 0 16px; overflow-x: auto; white-space: pre-wrap; }
.content table { border-collapse: collapse; width: 100%; margin: 10px 0 18px; font-size: .93rem; }
.content table th, .content table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.content table th { background: var(--surface-2); }

/* FAQ -------------------------------------------------------------------- */
.faq { margin-top: 28px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding: 0 18px 14px; color: var(--muted); }
.faq-a p:last-child { margin: 0; }

/* Tool grid (home + related) -------------------------------------------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tool-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card strong { display: block; font-size: .98rem; }
.tool-card small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: 2px; }
.tool-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); font-size: 1.25rem; }
.tool-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.related { margin-top: 32px; }

/* Home ------------------------------------------------------------------- */
.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero p { color: var(--muted); font-size: 1.12rem; max-width: 620px; margin: 0 auto 24px; }
.search-box { max-width: 560px; margin: 0 auto; position: relative; }
.search-box input { padding: 14px 18px 14px 46px; font-size: 1.05rem; border-radius: 999px; min-height: 54px; box-shadow: var(--shadow); }
.search-box svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cat-section { margin-top: 36px; scroll-margin-top: 80px; }
.cat-section h2 { display: flex; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chips a { background: var(--surface); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; font-size: .88rem; color: var(--text); }
.chips a:hover { border-color: var(--primary); text-decoration: none; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

/* Footer ----------------------------------------------------------------- */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--border); padding-top: 36px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 24px; }
.footer-grid h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 5px; }
.footer-grid a { color: var(--text); }
.footer-grid p { color: var(--muted); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; padding-bottom: 8px; color: var(--muted); }
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--muted); }
.disclaimer { color: var(--muted); font-size: .8rem; padding-bottom: 24px; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* Ads -------------------------------------------------------------------- */
.ad-slot { margin: 24px 0; min-height: 90px; text-align: center; }

/* Keypad calculators (online / scientific) -------------------------------- */
.keypad-calc { max-width: 520px; margin: 0 auto; padding: 20px; }
.calc-display { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; text-align: right; margin-bottom: 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc-display .expr { font-family: var(--mono); color: var(--muted); font-size: 1rem; min-height: 1.4em; word-break: break-all; }
.calc-display .out { font-family: var(--mono); font-size: 2.1rem; font-weight: 700; word-break: break-all; line-height: 1.2; }
.calc-display input.expr-input { border: 0; background: transparent; text-align: right; font-family: var(--mono); font-size: 1.1rem; padding: 0; min-height: 32px; box-shadow: none; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keys.sci { grid-template-columns: repeat(5, 1fr); }
.key { font: inherit; font-size: 1.1rem; font-weight: 600; min-height: 54px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background .1s, transform .05s; }
.keys.sci .key { font-size: .95rem; min-height: 46px; }
.key:hover { background: var(--surface-2); }
.key:active { transform: scale(.97); }
.key.op { background: var(--primary-soft); color: var(--primary); }
.key.fn { background: var(--surface-2); color: var(--muted); font-size: .9rem; }
.key.eq { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.key.wide { grid-column: span 2; }
.history { margin-top: 14px; font-family: var(--mono); font-size: .88rem; color: var(--muted); max-height: 160px; overflow-y: auto; }
.history div { padding: 4px 0; border-bottom: 1px dashed var(--border); cursor: pointer; text-align: right; }

/* Utility ---------------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media print {
  .site-header, .site-footer, .related, .faq, .ad-slot, .btn, .breadcrumb { display: none !important; }
  body { background: #fff; }
  .calc { box-shadow: none; }
}

/* ==========================================================================
   v2 additions: AEO answer box, sticky results, mobile result bar,
   view transitions, deferred rendering, pSEO + intl components
   ========================================================================== */
:root { accent-color: var(--primary); }
input, select, textarea, button { font-size: max(1rem, 1em); }
.btn-sm, .key.fn, .keys.sci .key, .tab, .seg label { font-size: .9rem; }

/* Page meta + quick answer (answer-first layout for AI overviews / featured snippets) */
.page-meta { color: var(--muted); font-size: .85rem; margin: -2px 0 12px; }
.page-meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.quick-answer { border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-soft); border-radius: var(--radius); padding: 14px 18px; margin: 4px 0 14px; }
.quick-answer .qa-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: 2px; }
.quick-answer p { margin: 0; font-size: 1.02rem; }

/* Desktop: result panel stays in view while the form scrolls (two-column form pattern) */
@media (min-width: 821px) {
  .calc:not(.single) { align-items: start; background: linear-gradient(to right, var(--surface) calc(50% - .5px), var(--border) calc(50% - .5px) calc(50% + .5px), var(--surface-2) calc(50% + .5px)); }
  .calc:not(.single) > .calc-result { border-left: 0; background: transparent; }
  .calc-result.is-sticky { position: sticky; top: 74px; }
}

/* Phones: compact result bar pinned to the bottom while the result is off-screen */
.result-bar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; border: 0; background: var(--primary); color: var(--primary-ink); font: inherit; box-shadow: 0 8px 30px rgba(0,0,0,.25); cursor: pointer; text-align: left; }
.result-bar span { font-size: .78rem; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.result-bar strong { margin-left: auto; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
@media (min-width: 821px) { .result-bar { display: none !important; } }

/* Cross-document view transitions (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}

/* Skip rendering below-the-fold sections until needed */
.faq, .related, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 700px; }

/* Footer: six category columns */
.footer-grid { grid-template-columns: 1.3fr repeat(6, 1fr); }
@media (max-width: 1060px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }

/* pSEO components */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.link-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; padding: 0; list-style: none; }
.link-cloud a { display: inline-block; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .86rem; color: var(--text); }
.link-cloud a:hover { border-color: var(--primary); text-decoration: none; }
.link-cloud a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.cta-tool { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 18px 0; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0; }
.svg-plot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.svg-plot svg { display: block; width: 100%; height: auto; }
.svg-plot .ax { stroke: var(--muted); stroke-width: 1.2; }
.svg-plot .gl { stroke: var(--border); stroke-width: 1; }
.svg-plot .fn { stroke: var(--primary); stroke-width: 2.5; fill: none; }
.svg-plot text { fill: var(--muted); font: 11px var(--font); }

/* Embeds */
.embed-box { margin-top: 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 16px; }
.embed-box summary { cursor: pointer; font-weight: 600; }
.embed-box textarea { font-family: var(--mono); font-size: .8rem; min-height: 96px; margin: 8px 0; }
.is-embed { background: transparent; }
.is-embed main.container { padding: 12px; max-width: none; }
.is-embed .content, .is-embed .ad-slot, .is-embed .copy-btn { display: none !important; }
.embed-title { font-size: 1.2rem; margin: 0 0 10px; }
.embed-credit { text-align: center; font-size: .8rem; margin: 8px 0 4px; }
.embed-credit a { color: var(--muted); }

/* Cookie consent banner */
.consent { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-inline: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 16px 18px; font-size: .92rem; }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.footer-bottom nav { row-gap: 6px; }
.disclaimer a { color: var(--muted); text-decoration: underline; }
