/* SwiftToolBox — global styles
   Light/dark theme, responsive layout, no external fonts or CSS frameworks. */

:root {
  --bg: #f4f7fb;
  --bg-soft: #eaf0f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dbe4ef;
  --text: #10203a;
  --muted: #55637a;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #e6f4f1;
  --accent: #b45309;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --shadow: 0 1px 2px rgba(16, 32, 58, 0.06), 0 8px 24px rgba(16, 32, 58, 0.06);
  --shadow-lg: 0 2px 6px rgba(16, 32, 58, 0.08), 0 18px 44px rgba(16, 32, 58, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", "Noto Sans", "DejaVu Sans", FreeSans, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f1a2d;
  --surface: #121c2e;
  --surface-2: #17233a;
  --border: #26344f;
  --text: #e7eef9;
  --muted: #a0b0c8;
  --brand: #2dd4bf;
  --brand-strong: #5eead4;
  --brand-soft: #10322f;
  --accent: #fbbf24;
  --danger: #f87171;
  --danger-soft: #2a1418;
  --ok: #4ade80;
  --ok-soft: #10281b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 22px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
  box-shadow: var(--shadow);
}
.skip-link:focus { left: 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #0e7490);
  color: #fff;
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
html[data-theme="dark"] .brand-mark { color: #06211f; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-soft); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 44px;
  background:
    radial-gradient(900px 380px at 12% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 65%),
    radial-gradient(700px 320px at 92% 0%, color-mix(in srgb, #6366f1 12%, transparent), transparent 65%);
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.6vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 20ch;
}
.hero .lede {
  margin: 0 0 26px;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--muted);
  max-width: 62ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.btn:hover { background: var(--brand-strong); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-soft); color: var(--text); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }
html[data-theme="dark"] .btn { color: #06211f; }
html[data-theme="dark"] .btn:hover { color: #06211f; }

/* ---------- Tool grid ---------- */

.section { padding: 44px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); max-width: 66ch; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--text);
}
.tool-card h3 { margin: 0; font-size: 1.06rem; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.tool-card .card-arrow { margin-top: auto; color: var(--brand); font-size: 0.9rem; font-weight: 700; }
.tool-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  flex: none;
}
.tool-icon svg { width: 23px; height: 23px; }
html[data-theme="dark"] .tool-icon { color: var(--brand); }

/* ---------- Tool page ---------- */

.breadcrumbs {
  padding-top: 18px;
  font-size: 0.86rem;
  color: var(--muted);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--border); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }

.tool-hero { padding: 20px 0 26px; }
.tool-hero h1 { margin: 0 0 12px; font-size: clamp(1.75rem, 3.4vw, 2.45rem); letter-spacing: -0.03em; line-height: 1.15; }
.tool-hero .lede { margin: 0; color: var(--muted); max-width: 72ch; font-size: 1.04rem; }

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.panel + .panel { margin-top: 20px; }
.panel-title { margin: 0 0 4px; font-size: 1.05rem; }
.panel-sub { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.tool-layout .side-stack { display: grid; gap: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.9rem; font-weight: 700; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field .unit-input { position: relative; }
.field input[type="number"],
.field input[type="text"],
.field input[type="date"],
.field input[type="datetime-local"],
.field select,
.field input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.field .error-text { font-size: 0.8rem; color: var(--danger); display: none; }
.field.has-error .error-text { display: block; }

input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 32px; }

.check-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.94rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.result-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.schedule-wrap.collapsed tbody tr:nth-child(n+11) { display: none; }
.result-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
}
.result-card .label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.result-card .value { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.result-card .sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.result-card.primary { background: linear-gradient(135deg, var(--brand), #0e7490); border-color: transparent; color: #fff; }
html[data-theme="dark"] .result-card.primary { background: linear-gradient(135deg, #0f766e, #0e7490); }
.result-card.primary .label, .result-card.primary .sub { color: rgba(255,255,255,0.82); }

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}
.result-line:last-child { border-bottom: 0; }
.result-line strong { font-variant-numeric: tabular-nums; }

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: var(--bg-soft);
  border-radius: 12px;
  margin-bottom: 20px;
}
.tabs button {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(16, 32, 58, 0.12);
}
.tab-panel[hidden] { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 12px 14px; font-weight: 700; color: var(--muted); font-size: 0.86rem; }
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }

.chart-wrap { margin-top: 20px; }
.chart-wrap canvas { width: 100%; height: 220px; display: block; }

/* Ad slots — reserved space so ads never shift the layout */
.ad-slot {
  display: grid;
  place-items: center;
  min-height: 100px;
  margin: 26px 0;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 12px, color-mix(in srgb, var(--border) 40%, transparent) 12px, color-mix(in srgb, var(--border) 40%, transparent) 13px);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ad-slot[data-format="rectangle"] { min-height: 250px; max-width: 336px; margin-left: auto; margin-right: auto; }
.ad-slot:has(ins.adsbygoogle) { border-color: transparent; background: none; }
.ad-slot:has(ins.adsbygoogle) > span { display: none; }
.ad-slot[data-format="sidebar"] { min-height: 250px; }

/* ---------- Prose content ---------- */

.prose { max-width: 78ch; }
.prose h2 { margin: 38px 0 12px; font-size: 1.42rem; letter-spacing: -0.02em; }
.prose h3 { margin: 26px 0 8px; font-size: 1.1rem; }
.prose p { margin: 0 0 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--text); }
.prose li { margin: 6px 0; }
.prose .muted { color: var(--muted); }

.callout {
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }

.formula {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  overflow-x: auto;
}

.example-table { margin: 16px 0; }

/* FAQ */
.faq { margin-top: 20px; display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 46px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--brand);
  font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 18px 16px; color: var(--muted); }
.faq .faq-body p { margin: 0; }

/* Related tools */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 18px; }
.related-grid a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.related-grid a:hover { border-color: var(--brand); color: var(--brand); }
.related-grid svg { width: 18px; height: 18px; color: var(--brand); flex: none; }

/* Info grid on home */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature h3 { margin: 12px 0 8px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.feature .tool-icon { width: 38px; height: 38px; border-radius: 10px; }
.feature .tool-icon svg { width: 20px; height: 20px; }

/* ---------- Legal / generic pages ---------- */

.page-hero { padding: 46px 0 22px; }
.page-hero h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -0.03em; }
.page-hero .lede { margin: 0; color: var(--muted); max-width: 70ch; }
.page-body { padding: 10px 0 50px; }
.page-body h2 { margin-top: 32px; }
.meta-note { font-size: 0.86rem; color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 22px 0; }
.contact-card { padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.contact-card h3 { margin: 0 0 8px; font-size: 1rem; }
.contact-card p { margin: 0 0 10px; color: var(--muted); font-size: 0.94rem; }
.contact-card a { font-weight: 700; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 56px;
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
.footer-brand p { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 34ch; }
.footer-col h3 { margin: 0 0 12px; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--text); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---------- Misc ---------- */

.note {
  font-size: 0.85rem;
  color: var(--muted);
}
.error-summary {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  color: var(--danger);
  font-size: 0.9rem;
}
.error-summary.show { display: block; }

.copy-status { font-size: 0.86rem; color: var(--ok); font-weight: 600; }
.char-progress { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 10px; }
.char-progress > span { display: block; height: 100%; background: var(--brand); width: 0; }

.output-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  word-break: break-all;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.output-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 52px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.chip strong { color: var(--brand); }

.strength-meter { display: flex; gap: 4px; margin-top: 10px; }
.strength-meter span { height: 7px; flex: 1; border-radius: 999px; background: var(--border); }
.strength-meter.weak span:nth-child(-n+1) { background: var(--danger); }
.strength-meter.fair span:nth-child(-n+2) { background: #d97706; }
.strength-meter.good span:nth-child(-n+3) { background: #2563eb; }
.strength-meter.strong span:nth-child(-n+4) { background: var(--ok); }

.qr-holder { display: grid; place-items: center; padding: 10px; background: #fff; border-radius: 12px; min-height: 240px; }
.qr-holder canvas { width: 100%; max-width: 260px; height: auto; image-rendering: pixelated; }
.qr-empty { color: #64748b; font-size: 0.85rem; }

@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 10px 20px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { display: block; padding: 11px 12px; }
  .nav-toggle { display: inline-flex; }
  .header-inner { gap: 12px; }
  .hero { padding: 42px 0 30px; }
  .panel { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .result-grid,
  .result-grid.four { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .result-grid,
  .result-grid.four { grid-template-columns: 1fr; }
  .brand span.brand-text { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { box-shadow: none; border-color: #ccc; }
}
