:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5a6072;
  --accent: #2563eb;
  --border: #e6e8ec;
  --card-bg: #fafbfc;
  --input-bg: #ffffff;
  --code-bg: #ffffff;
  --banner-bg: #1a1a1a;
  --banner-fg: #ffffff;
  --on-accent: #ffffff;
  --shadow-soft: 0 8px 16px rgba(0,0,0,0.06);
  --shadow-elev: 0 4px 16px rgba(0,0,0,0.15);
  --callout-bg: #fff7e6;
  --callout-border: #f59e0b;
  --success-bg: #f0fdf4;
  --success-fg: #15803d;
  --success-border: #bbf7d0;
  --error-bg: #fef2f2;
  --error-fg: #b91c1c;
  --error-border: #fecaca;
  --warn-bg: #fff8c5;
  --warn-fg: #59330b;
  --warn-border: #d4a72c;
  --chip-bg: #ddf4ff;
  --chip-fg: #0969da;
  --chip-border: #54aeff;
  --max-w: 1080px;
}
.theme-dark {
  --bg: #0f1419;
  --fg: #e6e8ec;
  --muted: #8b94a8;
  --accent: #60a5fa;
  --border: #2a3140;
  --card-bg: #1a1f2b;
  --input-bg: #131823;
  --code-bg: #131823;
  --banner-bg: #1e293b;
  --banner-fg: #f1f5f9;
  --on-accent: #0f1419;
  --shadow-soft: 0 8px 16px rgba(0,0,0,0.4);
  --shadow-elev: 0 4px 16px rgba(0,0,0,0.5);
  --callout-bg: #2a230f;
  --callout-border: #d97706;
  --success-bg: #0f2a1a;
  --success-fg: #4ade80;
  --success-border: #166534;
  --error-bg: #2a0f12;
  --error-fg: #f87171;
  --error-border: #7f1d1d;
  --warn-bg: #2a2410;
  --warn-fg: #fbbf24;
  --warn-border: #a16207;
  --chip-bg: #0f2438;
  --chip-fg: #93c5fd;
  --chip-border: #1e40af;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { border-bottom: 1px solid var(--border); padding: 0.15rem 0; position: relative; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-img { display: block; height: 50px; width: auto; max-height: 100%; }
.brand-img-light { display: block; }
.brand-img-dark { display: none; }
.theme-dark .brand-img-light { display: none; }
.theme-dark .brand-img-dark { display: block; }
@media (max-width: 480px) { .brand-img { height: 50px; } }
.primary-nav-wrap { display: flex; align-items: center; gap: 1.25rem; flex: 1; }
.primary-nav { display: flex; gap: 1rem; flex: 1; align-items: center; }
.primary-nav a { color: var(--fg); }
/* ===== Language switcher (native <details>/<summary>) ===== */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #ced4da);
  border-radius: 0.375rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.lang-summary::-webkit-details-marker { display: none; }
.lang-summary::marker { content: ''; }
.lang-summary:focus-visible {
  outline: 0;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.lang-caret {
  font-size: 0.75rem;
  transition: transform 0.15s;
}
.lang-switcher[open] .lang-caret {
  transform: rotate(180deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
}

.lang-list li { margin: 0; padding: 0; }

.lang-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 6px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 6px;
}
.lang-link:hover,
.lang-link:focus {
  background: var(--card-bg);
  filter: brightness(0.96);
  outline: none;
  text-decoration: none;
}
.lang-link.is-current {
  background: oklch(0.95 0.05 254);
  color: var(--accent, #2563eb);
  font-weight: 600;
}
.lang-link.is-current::before {
  content: '';
}

/* Flag emoji — used in trigger summary and each list row */
.lang-flag {
  display: inline-block;
  margin-right: 8px;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
}
.lang-link .lang-flag { margin-right: 0; }
.lang-current { display: inline-flex; align-items: center; gap: 0; }
.lang-current-label { vertical-align: middle; }

/* Dark theme */
.theme-dark .lang-summary {
  background: var(--card-bg);
  color: var(--fg);
  border-color: var(--border);
}
.theme-dark .lang-list {
  background: var(--card-bg);
  border-color: var(--border);
}
.theme-dark .lang-link { color: var(--fg); }
.theme-dark .lang-link:hover,
.theme-dark .lang-link:focus { filter: brightness(1.15); }
.theme-dark .lang-link.is-current {
  background: oklch(0.3 0.08 254);
  color: var(--accent-ink, #93c5fd);
}

/* Theme toggle switch (sun + moon visible both modes) */
.theme-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 28px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--surface-alt, #e5e7eb);
  border: 1px solid var(--border, #d1d5db);
  transition: background 0.2s, border-color 0.2s;
  box-sizing: border-box;
}
.theme-toggle-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  z-index: 1;
  transition: color 0.2s;
}
.theme-toggle-icon.icon-sun { color: #f59e0b; }
.theme-toggle-icon.icon-moon { color: #6366f1; }
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, background 0.2s;
  z-index: 2;
}
.theme-dark .theme-toggle-thumb {
  transform: translateX(28px);
  background: #1e293b;
}
.theme-toggle:hover .theme-toggle-track { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: none; }
.theme-toggle:focus-visible .theme-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  /* Mobile: full-width segmented control (active half highlighted) */
  .theme-toggle { width: 100%; padding: 0; }
  .theme-toggle-track {
    width: 100%;
    height: 44px;
    padding: 4px;
    border-radius: 12px;
    justify-content: space-around;
  }
  .theme-toggle-thumb {
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: 36px;
    border-radius: 8px;
  }
  .theme-dark .theme-toggle-thumb { transform: translateX(100%); }
  .theme-toggle-icon { width: 18px; height: 18px; }
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none; margin-left: auto; background: transparent;
  border: 1px solid var(--border); border-radius: 0.375rem;
  padding: 0.45rem 0.55rem; cursor: pointer; line-height: 0;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle-bar {
  display: block; width: 22px; height: 2px; margin: 4px 0;
  background: var(--fg); border-radius: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Mobile nav (<768px) ===== */
@media (max-width: 767px) {
  .header-inner { gap: 0.75rem; }
  .nav-toggle { display: inline-block; }
  .primary-nav-wrap {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 0.5rem 1.25rem 1rem 1.25rem; z-index: 50;
  }
  body.nav-open .primary-nav-wrap { display: flex; }
  body.nav-open { overflow: hidden; }
  .primary-nav { flex-direction: column; gap: 0; align-items: stretch; width: 100%; }
  .primary-nav a {
    display: block; padding: 0.85rem 0;
    border-bottom: 1px solid var(--border); font-weight: 500;
  }
  .primary-nav a:last-of-type { border-bottom: 0; }
  .primary-nav-wrap .lang-switcher {
    padding-top: 0.85rem; border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    display: block; width: 100%;
  }
  .primary-nav-wrap .lang-summary { width: 100%; }
}

/* Mobile: lang switcher list inline (no popup positioning) */
@media (max-width: 480px) {
  .lang-switcher { display: block; width: 100%; }
  .lang-summary {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  .lang-list {
    position: static;
    width: 100%;
    max-height: 50vh;
    margin-top: 6px;
    box-shadow: none;
  }
  .lang-link {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 15px;
  }
}

/* ===== Form select (native <details>/<summary>) — replaces <select> on mobile ===== */
/* Mirrors the lang-switcher pattern. The hidden native <select> stays in
   the DOM for form submission + a11y fallback; the <details> wrapper drives
   the visible UI and a small JS shim keeps both in sync. */
.form-select-wrap { position: relative; display: block; width: 100%; }
.form-select-native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.form-select {
  position: relative;
  display: block;
  width: 100%;
}
.form-select-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #ced4da);
  border-radius: 0.375rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
  min-height: 40px;
}
.form-select-summary::-webkit-details-marker { display: none; }
.form-select-summary::marker { content: ''; }
.form-select-summary:focus-visible {
  outline: 0;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.form-select-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-select-caret {
  font-size: 0.75rem;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.form-select[open] .form-select-caret {
  transform: rotate(180deg);
}
.form-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 60vh;
  overflow-y: auto;
}
.form-select-list li { margin: 0; padding: 0; list-style: none; }
.form-select-option {
  display: block;
  width: 100%;
  margin: 2px 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.form-select-option:hover,
.form-select-option:focus {
  background: var(--card-bg);
  filter: brightness(0.96);
  outline: none;
}
.form-select-option.is-current {
  background: oklch(0.95 0.05 254);
  color: var(--accent, #2563eb);
  font-weight: 600;
}
@media (max-width: 767px) {
  .form-select-option {
    font-size: 16px;
    padding: 14px 16px;
    margin: 2px 4px;
    line-height: 1.4;
  }
  .form-select-summary {
    font-size: 16px;
    padding: 0.85rem 1rem;
    min-height: 48px;
  }
  .form-select-list {
    max-height: 70vh;
    padding: 6px 0;
  }
}
.theme-dark .form-select-summary {
  background: var(--card-bg);
  color: var(--fg);
  border-color: var(--border);
}
.theme-dark .form-select-list {
  background: var(--card-bg);
  border-color: var(--border);
}
.theme-dark .form-select-option { color: var(--fg); }
.theme-dark .form-select-option:hover,
.theme-dark .form-select-option:focus { filter: brightness(1.15); }
.theme-dark .form-select-option.is-current {
  background: oklch(0.3 0.08 254);
  color: var(--accent-ink, #93c5fd);
}
/* Mobile: list inline (no popup positioning) */
@media (max-width: 480px) {
  .form-select-summary {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  .form-select-list {
    position: static;
    width: 100%;
    max-height: 50vh;
    margin-top: 6px;
    box-shadow: none;
  }
  .form-select-option {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 15px;
  }
}

main.container { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }

.hero h1 { font-size: 2rem; margin: 0 0 0.5rem 0; }
.hero .lead { color: var(--muted); font-size: 1.125rem; margin: 0 0 2rem 0; }

.tools h2 { font-size: 1.25rem; margin: 0 0 1rem 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.tool-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--fg);
}
.tool-card:hover { border-color: var(--accent); text-decoration: none; }
.tool-card h3 { margin: 0 0 0.4rem 0; }
.tool-card p { margin: 0 0 0.4rem 0; color: var(--muted); }
.tool-card .example { font-size: 0.875rem; color: var(--fg); }
.tool-card .example-label { color: var(--muted); }
.tool-card .example-value { font-weight: 600; }

/* Species-count badge on /pet-age/ group cards (Browse by pet group).
   Pill — sits below the card summary, before the arrow CTA. Theme-aware
   via existing tokens; no new CSS variables introduced. */
.group-count-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--card-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.theme-light .group-count-badge {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #1a1a1a;
}
.theme-dark .group-count-badge {
  background: rgba(255,255,255,0.06);
}

.hub-calculator-card { margin: 1rem 0 1.5rem 0; }
.tool-card-primary {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  border: 2px solid var(--accent, #2f7df0);
  border-radius: 0.75rem;
  background: var(--card-bg);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-card-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  text-decoration: none;
}
.tool-card-primary .tool-card-body { flex: 1; }
.tool-card-primary h3 { margin: 0 0 0.35rem 0; font-size: 1.25rem; }
.tool-card-primary p { margin: 0 0 0.5rem 0; color: var(--muted); }
.tool-card-cta {
  display: inline-block;
  font-weight: 600;
  color: var(--accent, #2f7df0);
}

.prose { max-width: 720px; }
.prose h1 { font-size: 1.875rem; margin: 0 0 1rem 0; }
.prose h2 { margin-top: 2rem; }

.contact-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 520px; }
.contact-form label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 500; }
.contact-form input, .contact-form textarea { padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 0.375rem; font: inherit; background: var(--input-bg, #fff); color: var(--fg); }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); }
.contact-form button { padding: 0.65rem 1rem; border: 0; border-radius: 0.375rem; background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; }
.contact-form button:hover { filter: brightness(1.05); }

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0; color: var(--muted); }
.footer-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); }
.copyright { margin: 0; font-size: 0.875rem; }

.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem;
  background: var(--banner-bg); color: var(--banner-fg); padding: 0.85rem 1rem;
  border-radius: 0.5rem; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-elev);
  max-width: var(--max-w); margin: 0 auto;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner:not([hidden]) { display: flex; }
.cookie-banner p { margin: 0; flex: 1; }
.cookie-banner button { background: var(--accent); color: var(--on-accent); border: 0; padding: 0.45rem 0.9rem; border-radius: 0.375rem; cursor: pointer; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 0.875rem; color: var(--muted); margin: 0 0 1.25rem 0; max-width: 100%; word-break: break-word; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; max-width: 100%; }
.breadcrumb li { min-width: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--border); margin-right: 0.35rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ===== Hub page ===== */
.hub { max-width: 820px; }
.hub-header h1 { font-size: 1.875rem; margin: 0 0 0.5rem 0; line-height: 1.2; }
.hub-header .lead { color: var(--muted); font-size: 1.0625rem; margin: 0 0 2rem 0; }
.hub-intro { margin: 0 0 2rem 0; }
.hub-intro p { margin: 0; }
.hub-tools { margin: 0 0 2.5rem 0; }
.hub-tools h2 { font-size: 1.25rem; margin: 0 0 1rem 0; }
.hub-compare { margin: 0 0 2.5rem 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.compare-table th, .compare-table td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th[scope="col"] { background: var(--card-bg); font-weight: 600; }
.compare-table th[scope="row"] { font-weight: 500; color: var(--fg); }

/* ===== Calculator page ===== */
.calc-page { max-width: min(720px, 100%); box-sizing: border-box; }
.calc-page, .calc-tool, .calc, .calc-field, .calc-input-wrap { max-width: 100%; box-sizing: border-box; }
.calc-input-wrap input, .calc-field input, .calc-field select { max-width: 100%; box-sizing: border-box; }
.calc-header h1 { font-size: 1.75rem; margin: 0 0 0.5rem 0; line-height: 1.2; }
.calc-header .lead { color: var(--muted); margin: 0 0 1.5rem 0; }

.callout {
  background: var(--callout-bg); border-left: 4px solid var(--callout-border);
  padding: 0.85rem 1rem; border-radius: 0.375rem; margin: 0 0 1.5rem 0;
}
.callout p { margin: 0; }

.calc-tool {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 0.5rem; padding: 1.25rem; margin: 0 0 2rem 0;
  min-width: 0;
  overflow: hidden;
}

/* ===== 2-column layout: form left, result right (calculator page) ===== */
.calc-tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.calc-tool-grid .calc-form-col,
.calc-tool-grid .calc-result-col { min-width: 0; max-width: 100%; }
.calc-tool-grid .calc-tool-fullspan { grid-column: 1 / -1; min-width: 0; }

@media (min-width: 768px) {
  .pet-age-dog .calc-page,
  .pet-age-cat .calc-page { max-width: min(1080px, 100%); }
  .calc-tool-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2rem;
  }
}

/* ===== Result panel — prominent treatment ===== */
.petage-result-prominent {
  margin-top: 0;
  padding: 1.5rem 1.25rem;
  border-top: 0;
  border: 2px solid var(--accent);
  border-radius: 0.75rem;
  background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.petage-result-prominent .age-big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  padding: 0 0 1rem 0;
  border-bottom: 1px solid var(--border);
}
.petage-result-prominent .age-big .age-years {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 3rem;
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
}
.petage-result-prominent .age-big .age-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}
.petage-result-prominent .result-row {
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: baseline;
}
.petage-result-prominent .result-row:first-of-type { border-top: 0; }
.petage-result-prominent .result-row .result-label {
  flex: 0 0 auto;
  font-size: 0.875rem;
  color: var(--muted);
}
.petage-result-prominent .result-row .result-value {
  flex: 1 1 auto;
  text-align: right;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}
.petage-result-prominent .copy-link {
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .petage-result-prominent {
    position: sticky;
    top: 1rem;
    padding: 1.75rem 1.5rem;
  }
  .petage-result-prominent .age-big .age-years { font-size: 3.5rem; }
  .petage-result-prominent .age-big .age-unit { font-size: 1.125rem; }
}

@media (max-width: 480px) {
  .petage-result-prominent { padding: 1.25rem 1rem; }
  .petage-result-prominent .age-big .age-years { font-size: 2.5rem; }
}

/* ===== Calc form ===== */
.calc { display: flex; flex-direction: column; gap: 1rem; max-width: 100%; }
.calc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.calc-field label { font-weight: 600; font-size: 0.9375rem; color: var(--fg); }
.calc-input-wrap { position: relative; display: block; }
.calc-input-wrap input {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 0.375rem;
  background: var(--input-bg); color: var(--fg);
  -webkit-appearance: none; appearance: none;
  -moz-appearance: textfield;
  color-scheme: light;
  box-shadow: none;
}
.theme-dark .calc-input-wrap input { color-scheme: dark; }
.calc-input-wrap input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.calc-input-wrap input::-webkit-outer-spin-button,
.calc-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input-suffix { position: relative; }
.calc-input-suffix::after {
  content: attr(data-suffix); position: absolute; right: 0.85rem; top: 50%;
  transform: translateY(-50%); color: var(--muted); pointer-events: none;
  font-weight: 600;
}
.calc-input-suffix input { padding-right: 2rem; }

/* Select inside calc forms — match input styling, kill UA dark-bar bug under
   color-scheme: light dark by forcing scheme + custom chevron. */
.calc-input-wrap select,
.multi-pet-form select,
.calc select {
  width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.8rem;
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background-color: var(--input-bg);
  color: var(--fg);
  -webkit-appearance: none;
  appearance: none;
  color-scheme: light;
  box-shadow: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 12px;
  cursor: pointer;
}
.theme-dark .calc-input-wrap select,
.theme-dark .multi-pet-form select,
.theme-dark .calc select {
  color-scheme: dark;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.calc-input-wrap select:focus,
.multi-pet-form select:focus,
.calc select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.calc-input-wrap select option,
.multi-pet-form select option,
.calc select option {
  background-color: var(--input-bg);
  color: var(--fg);
}
.calc-field-help {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted, #888);
}

/* Compare-pets grid layout — 1 col mobile, 3 col desktop */
.multi-pet-form { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) {
  .multi-pet-form { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .multi-pet-form > button[type="submit"] { grid-column: 1 / -1; justify-self: start; }
}
.multi-pet-form .pet-slot {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}
.multi-pet-form .pet-slot legend {
  font-weight: 600;
  padding: 0 0.4rem;
  color: var(--fg);
}
.multi-pet-form .calc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ===== Result panel ===== */
.calc-result { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #b161ff; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.4rem 0; gap: 1rem; flex-wrap: wrap; }
.result-row .result-label { color: var(--muted); font-size: 0.9375rem; }
.result-row .result-value { font-size: 1.125rem; font-weight: 700; color: var(--fg); }
.result-row.result-final .result-value { font-size: 1.5rem; color: var(--accent); }
.formula {
  margin: 0.85rem 0 1rem 0; font-size: 0.8125rem; color: var(--muted);
  word-break: break-all;
}
.formula code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  background: var(--code-bg); border: 1px solid var(--border);
  padding: 0.25rem 0.5rem; border-radius: 0.25rem;
  display: inline-block;
}

/* ===== Buttons ===== */
.btn-primary {
  padding: 0.7rem 1.1rem; border: 0; border-radius: 0.375rem;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  padding: 0.55rem 0.9rem; background: var(--bg); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 0.375rem;
  font: inherit; font-weight: 600; cursor: pointer; position: relative;
}
.btn-ghost:hover { background: var(--accent); color: var(--on-accent); }
.copy-link { display: inline-flex; align-items: center; vertical-align: middle; margin-top: 0.75rem; }
.copy-link .copy-link-done { display: none; }
.copy-link.copied .copy-link-default { display: none; }
.copy-link.copied .copy-link-done { display: inline; color: var(--success-fg); }
.copy-link.copied { background: var(--success-bg); border-color: var(--success-fg); color: var(--success-fg); }

/* ===== Calc intro & why-use ===== */
.calc-intro { margin: 0 0 2rem 0; }
.calc-intro h2, .why-use h2 { font-size: 1.25rem; margin: 0 0 0.75rem 0; }
.why-use { margin: 0 0 2rem 0; }
.why-list { padding-left: 1.25rem; margin: 0; }
.why-list li { margin: 0 0 0.5rem 0; }

/* ===== Email capture ===== */
.email-capture {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 0.5rem; padding: 1.25rem; margin: 0 0 2rem 0;
}
.email-capture h3 { margin: 0 0 0.4rem 0; font-size: 1.125rem; }
.email-capture .ec-sub { margin: 0 0 0.85rem 0; color: var(--muted); font-size: 0.9375rem; }
.ec-form { display: flex; flex-direction: column; gap: 0.5rem; }
.ec-row { display: flex; flex-direction: column; gap: 0.5rem; }
.ec-row input[type="email"] {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border);
  border-radius: 0.375rem; font: inherit; background: var(--input-bg); color: var(--fg);
}
.ec-row input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ec-row button {
  padding: 0.65rem 1rem; border: 0; border-radius: 0.375rem;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer;
}
.ec-row button:hover { filter: brightness(1.05); }
.ec-fineprint { margin: 0.4rem 0 0 0; font-size: 0.8125rem; color: var(--muted); }
.ec-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ec-flash { margin: 0 0 0.85rem 0; padding: 0.6rem 0.85rem; border-radius: 0.375rem; font-size: 0.9375rem; }
.ec-flash[hidden] { display: none; }
.ec-flash-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid var(--success-border); }
.ec-flash-error { background: var(--error-bg); color: var(--error-fg); border: 1px solid var(--error-border); }

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .ec-row { flex-direction: row; align-items: stretch; }
  .ec-row input[type="email"] { flex: 1; }
}
@media (min-width: 768px) {
  .calc-header h1, .hub-header h1 { font-size: 2rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .calc-page { padding-left: 0; padding-right: 0; }
  .calc-tool { padding: 1rem; }
  .compare-table { font-size: 0.875rem; }
  .compare-table th, .compare-table td { padding: 0.5rem 0.6rem; }
  .result-row.result-final .result-value { font-size: 1.25rem; }
  .formula { font-size: 0.75rem; }
}

/* ===== FAQ ===== */
.faq { margin: 2.5rem 0; }
.faq h2 { font-size: 1.375rem; margin: 0 0 1rem 0; }
.faq details {
  border-bottom: 1px solid var(--border); padding: 0.85rem 0;
}
.faq details summary {
  cursor: pointer; font-weight: 600; color: var(--fg); list-style: none;
  padding-right: 1.5rem; position: relative;
}
.faq details summary::-webkit-details-marker { display: none; }
.faq details summary::after {
  content: "+"; position: absolute; right: 0; top: 0;
  font-size: 1.25rem; line-height: 1; color: var(--muted);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0.6rem 0 0 0; color: var(--muted); }

/* M3 age */
.age-result .age-big {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 1rem;
  padding: 0.4rem 0 1rem 0; border-bottom: 1px solid var(--border); margin: 0 0 0.5rem 0;
}
.age-result .age-years { font-size: 2rem; color: var(--accent); line-height: 1.1; }
.age-result .age-years .age-unit { font-size: 1rem; color: var(--muted); font-weight: 600; margin-left: 0.25rem; }
.age-result .age-inline { font-size: 1rem; color: var(--fg); font-weight: 600; }
.calc-empty, .calc-error { margin: 0; padding: 0.5rem 0; color: var(--muted); font-size: 0.9375rem; }
.calc-error { color: var(--error-fg); }

/* ===== Variant pages (/discount/{N}-percent-off/) ===== */
.variant-context, .variant-howto, .variant-examples, .variant-siblings { margin: 2rem 0; }
.variant-context h2, .variant-howto h2, .variant-examples h2, .variant-siblings h2 {
  font-size: 1.25rem; margin: 0 0 0.75rem 0;
}
.variant-context p, .variant-howto p { margin: 0; color: var(--fg); }
.examples-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9375rem; }
.examples-table th, .examples-table td {
  padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right;
}
.examples-table th:first-child, .examples-table td:first-child { text-align: left; }
.examples-table thead th { color: var(--muted); font-weight: 600; font-size: 0.875rem; }
.sibling-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.sibling-list a {
  display: inline-block; padding: 0.5rem 1rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 0.375rem; color: var(--fg);
}
.sibling-list a:hover { border-color: var(--accent); text-decoration: none; }

/* ===== Wave 5a — Convert pages (/convert/{pair}/) ===== */
.convert-page .convert-header h1 { margin: 0 0 0.5rem 0; }
.convert-tool .converter-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1rem; align-items: end;
}
.convert-tool .calc-field-precision select {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border);
  border-radius: 0.375rem; background: var(--card-bg); color: var(--fg);
  font-size: 1rem;
}
.convert-tool .calc-field-swap .swap-button {
  display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center;
  padding: 0.55rem 0.85rem; border: 1px solid var(--border);
  border-radius: 0.375rem; background: var(--card-bg); color: var(--fg);
  text-decoration: none; font-weight: 600;
}
.convert-tool .calc-field-swap .swap-button:hover {
  border-color: var(--accent); text-decoration: none;
}
/* Wave 10 Phase 2B — kitchen ingredient (density-aware) dropdown */
.convert-tool .calc-field-ingredient select {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border);
  border-radius: 0.375rem; background: var(--card-bg); color: var(--fg);
  font-size: 1rem;
}
.convert-tool .density-note {
  display: block; width: 100%; margin: 0.5rem 0 1rem 0;
  font-size: 0.875rem; color: var(--muted); font-style: italic;
}
.convert-result { margin-top: 1rem; }
.convert-result .result-value { font-size: 1.75rem; color: var(--accent); }

.convert-formula, .convert-usecase, .convert-history,
.convert-table-section, .convert-related { margin: 2rem 0; }
.convert-formula h2, .convert-usecase h2, .convert-history h2,
.convert-table-section h2, .convert-related h2 {
  font-size: 1.25rem; margin: 0 0 0.75rem 0;
}
.conversion-table {
  width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9375rem;
}
.conversion-table th, .conversion-table td {
  padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right;
}
.conversion-table tbody tr:nth-child(odd) { background: var(--card-bg); }
.conversion-table thead th { color: var(--muted); font-weight: 600; font-size: 0.875rem; }

.convert-hub .convert-hub-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.convert-hub .convert-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1rem 1.1rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 0.5rem;
  color: var(--fg); text-decoration: none;
  position: relative;
}
.convert-hub .convert-card:hover { border-color: var(--accent); text-decoration: none; }
.convert-hub .convert-card .category-icon {
  width: 36px; height: 36px; border-radius: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.convert-hub .convert-card .category-icon svg { width: 22px; height: 22px; }
.convert-hub .convert-card .convert-card-body { flex: 1; }
.convert-hub .convert-card .convert-card-body h3 {
  margin: 0 0 0.25rem 0; font-size: 1rem; font-weight: 600;
}
.convert-hub .convert-card .convert-card-body p {
  margin: 0; font-size: 0.875rem; color: var(--muted); line-height: 1.45;
}
.convert-hub .convert-card .convert-card-units {
  display: flex; align-items: center; gap: 0.5rem;
  padding-top: 0.55rem; border-top: 1px solid var(--border);
  font-size: 0.875rem; font-weight: 600; color: var(--accent);
}
.convert-hub .convert-card .convert-card-units .unit-from,
.convert-hub .convert-card .convert-card-units .unit-to {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
}
.convert-hub .convert-card .convert-card-units .unit-arrow {
  width: 16px; height: 16px; color: var(--muted); flex-shrink: 0;
}
@media (max-width: 480px) {
  .convert-hub .convert-card { padding: 0.85rem 0.95rem; }
  .convert-hub .convert-card .convert-card-body h3 { font-size: 0.95rem; }
  .convert-hub .convert-card .convert-card-units { font-size: 0.8125rem; }
}

/* ===== Tables: left-align all cells (override per-table right/center) ===== */
table th,
table td { text-align: left; }
.compare-table th, .compare-table td,
.examples-table th, .examples-table td,
.examples-table th:first-child, .examples-table td:first-child,
.conversion-table th, .conversion-table td,
.amort-table th, .amort-table td,
.amort-table .col-month,
.table-scroll th, .table-scroll td,
.table-scroll > table th, .table-scroll > table td { text-align: left; }

/* Discount hub: quick % variant cards */
.hub-variants { margin: 0 0 2.5rem 0; }
.hub-variants h2 { font-size: 1.25rem; margin: 0 0 0.5rem 0; }
.hub-variants-lead { color: var(--muted); margin: 0 0 1rem 0; font-size: 0.9375rem; }
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}
.variant-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem 0.5rem; min-height: 88px;
  border: 1px solid var(--border); border-radius: 0.5rem;
  background: var(--card-bg); color: var(--fg);
  text-decoration: none; transition: border-color 120ms, transform 120ms;
}
.variant-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.variant-card-n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--accent); }
.variant-card-label { font-size: 0.8125rem; color: var(--muted); margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Age hub: tools subtitle */
.hub-tools-lead { color: var(--muted); margin: 0 0 1rem 0; font-size: 0.9375rem; }

/* Convert root: category grid */
.convert-root .hub-categories { margin: 0 0 2.5rem 0; }
.convert-root .hub-categories h2 { font-size: 1.25rem; margin: 0 0 1rem 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.category-card {
  display: block; padding: 1rem 1.1rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 0.5rem;
  color: var(--fg); text-decoration: none; position: relative;
}
.category-card.category-live:hover { border-color: var(--accent); text-decoration: none; }
.category-card h3 { margin: 0 0 0.35rem 0; font-size: 1rem; }
.category-card p { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.category-coming { opacity: 0.55; cursor: not-allowed; }
.category-coming:hover { border-color: var(--border); }
.category-badge {
  display: inline-block; margin-top: 0.6rem;
  font-size: 0.75rem; padding: 0.15rem 0.45rem;
  border: 1px solid var(--border); border-radius: 0.25rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}

/* ====================================================================== */
/* Direction A — Playful Toolbox home (scoped under .nu-home)             */
/* Tokens scoped to .nu-home so other pages keep current accent palette.  */
/* ====================================================================== */
.nu-home {
  --hue: 254;
  --nu-bg: oklch(0.985 0.006 var(--hue));
  --nu-surface: oklch(1 0.003 var(--hue));
  --nu-surface-alt: oklch(0.965 0.008 var(--hue));
  --nu-text: oklch(0.18 0.02 var(--hue));
  --nu-muted: oklch(0.45 0.02 var(--hue));
  --nu-subtle: oklch(0.62 0.02 var(--hue));
  --nu-line: oklch(0.9 0.008 var(--hue));
  --nu-accent: #2563eb;
  --nu-accent-ink: oklch(0.32 0.18 var(--hue));
  --nu-shadow-card: 0 1px 2px rgba(20, 18, 16, 0.04), 0 6px 18px rgba(20, 18, 16, 0.06);
  --nu-shadow-card-hover: 0 2px 4px rgba(20, 18, 16, 0.06), 0 12px 28px rgba(20, 18, 16, 0.10);
}
.theme-dark .nu-home {
  --nu-bg: oklch(0.18 0.012 var(--hue));
  --nu-surface: oklch(0.22 0.014 var(--hue));
  --nu-surface-alt: oklch(0.26 0.018 var(--hue));
  --nu-text: oklch(0.97 0.01 var(--hue));
  --nu-muted: oklch(0.74 0.02 var(--hue));
  --nu-subtle: oklch(0.55 0.02 var(--hue));
  --nu-line: oklch(0.32 0.014 var(--hue));
  --nu-accent-ink: oklch(0.95 0.05 var(--hue));
  --nu-shadow-card: 0 1px 2px rgba(0,0,0,0.30), 0 6px 18px rgba(0,0,0,0.35);
  --nu-shadow-card-hover: 0 2px 4px rgba(0,0,0,0.35), 0 12px 28px rgba(0,0,0,0.45);
}

/* ----- Hero ----- */
.nu-home .home-hero {
  position: relative;
  text-align: center;
  padding: 3.25rem 0 2rem;
  overflow: visible;
}
.nu-home .home-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 820px;
  margin: 0 auto 1rem;
  color: var(--nu-text);
}
.nu-home .home-hero .home-intro {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--nu-muted);
  text-align: center;
}
.nu-home .home-hero .home-intro a {
  color: var(--nu-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.nu-home .home-hero .home-intro a:hover { text-decoration-thickness: 2.5px; }

/* Decorative SVG stickers floating around hero */
.nu-home .home-hero-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.nu-home .home-sticker {
  position: absolute;
  width: 56px;
  height: 56px;
  opacity: 0.85;
  filter: drop-shadow(0 6px 14px rgba(20, 18, 16, 0.08));
}
.theme-dark .nu-home .home-sticker { opacity: 0.5; }
.nu-home .home-sticker--1 { top: 10%; left: 6%; transform: rotate(-12deg); }
.nu-home .home-sticker--2 { top: 18%; right: 7%; transform: rotate(10deg); }
.nu-home .home-sticker--3 { bottom: 10%; left: 12%; transform: rotate(8deg); width: 48px; height: 48px; }
.nu-home .home-sticker--4 { bottom: 8%; right: 14%; transform: rotate(-8deg); width: 50px; height: 50px; }
.nu-home .home-hero h1,
.nu-home .home-hero .home-intro,
.nu-home .home-hero .home-filter { position: relative; z-index: 2; }

/* Mobile: hide decorative stickers + boost H1 readability (≤640px) */
@media (max-width: 640px) {
  .nu-home .home-hero-stickers { display: none; }
  .nu-home .home-hero { padding: 2.25rem 0 1.5rem; }
  .nu-home .home-hero h1 {
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.1;
  }
}
.theme-dark .nu-home .home-hero h1 {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ----- Hero search filter ----- */
.nu-home .home-filter {
  position: relative;
  margin: 0 auto;
  max-width: 640px;
}
.nu-home .home-filter-icon {
  position: absolute;
  left: 18px;
  top: 15px;
  width: 20px;
  height: 20px;
  color: var(--nu-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.nu-home .home-filter-icon svg { width: 20px; height: 20px; }
.nu-home #home-filter-input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--nu-text);
  background: var(--nu-surface);
  border: 1.5px solid var(--nu-line);
  border-radius: 16px;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 160ms, box-shadow 160ms;
}
.nu-home #home-filter-input::placeholder { color: var(--nu-subtle); opacity: 1; }
.nu-home #home-filter-input:focus {
  outline: none;
  border-color: var(--nu-accent);
  box-shadow: 0 0 0 4px oklch(0.5 0.13 var(--hue) / 0.25);
}
.nu-home .home-filter-empty {
  text-align: center;
  margin: 1rem 0;
  color: var(--nu-muted);
  font-size: 0.95rem;
}

/* ----- Hero search result panel (mode B — search index dropdown) ----- */
.nu-home .home-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nu-surface);
  border: 1px solid var(--nu-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  text-align: left;
}
.nu-home .home-search-results[hidden] { display: none !important; }

.nu-home .home-search-result {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--nu-text);
  border-radius: 8px;
  margin: 1px 0;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.nu-home .home-search-result:hover,
.nu-home .home-search-result.is-active,
.nu-home .home-search-result:focus {
  background: var(--nu-surface-alt);
  outline: none;
}

.nu-home .home-search-result-category {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--nu-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.nu-home .home-search-result-title {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--nu-text);
}

.nu-home .home-search-result-desc {
  font-size: 12.5px;
  color: var(--nu-muted);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dark theme — surface + heavier shadow */
.theme-dark .nu-home .home-search-results {
  background: var(--nu-surface);
  border-color: var(--nu-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.theme-dark .nu-home .home-search-result:hover,
.theme-dark .nu-home .home-search-result.is-active {
  background: var(--nu-surface-alt);
}

/* Mobile — inline flow (no absolute overlay on small screens) */
@media (max-width: 480px) {
  .nu-home .home-search-results {
    position: static;
    box-shadow: none;
    border: 1px solid var(--nu-line);
    margin-top: 6px;
    max-height: 70vh;
  }
}

/* ----- Section heading bar (kicker + title + rule) ----- */
.nu-home .home-cat-head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}
.nu-home .home-cat-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nu-subtle);
  flex: 0 0 auto;
}
.nu-home .home-cat-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--nu-text);
  flex: 0 0 auto;
}
.nu-home .home-cat-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--nu-line);
  transform: translateY(-3px);
}

/* ----- Tool grid ----- */
.nu-home .home-tools { margin-top: 2.5rem; }
.nu-home .home-tools .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ----- Tool card ----- */
.nu-home .home-tools .tool-card {
  --card-hue: 18;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--nu-line);
  border-radius: 18px;
  background: var(--nu-surface);
  color: var(--nu-text);
  text-decoration: none;
  box-shadow: var(--nu-shadow-card);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
/* tool-card-body wrapper — flex column ใช้พื้นที่ที่เหลือ ให้ tool-cta ดันลงก้นด้วย margin-top: auto */
.nu-home .home-tools .tool-card .tool-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  align-self: stretch;
}
.nu-home .home-tools .tool-card:hover {
  transform: translateY(-2px);
  border-color: oklch(0.7 0.14 var(--card-hue) / 0.5);
  box-shadow: var(--nu-shadow-card-hover);
  text-decoration: none;
}
.nu-home .home-tools .tool-card .tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: oklch(0.92 0.07 var(--card-hue));
  color: oklch(0.32 0.18 var(--card-hue));
  margin-bottom: 14px;
}
.theme-dark .nu-home .home-tools .tool-card .tool-icon {
  background: oklch(0.32 0.08 var(--card-hue));
  color: oklch(0.88 0.12 var(--card-hue));
}
.nu-home .home-tools .tool-card .tool-icon svg { width: 26px; height: 26px; }
/* Section 01 (money) + Section 02 (numbers) + Section 03 (conversions) — emoji icons, no background, larger glyph */
.nu-home .home-tools[data-cat="money"] .tool-card .tool-icon,
.nu-home .home-tools[data-cat="numbers"] .tool-card .tool-icon,
.nu-home .home-tools[data-cat="conversions"] .tool-card .tool-icon {
  background: transparent;
  width: auto;
  height: auto;
  font-size: 44px;
  line-height: 1;
}
.theme-dark .nu-home .home-tools[data-cat="money"] .tool-card .tool-icon,
.theme-dark .nu-home .home-tools[data-cat="numbers"] .tool-card .tool-icon,
.theme-dark .nu-home .home-tools[data-cat="conversions"] .tool-card .tool-icon {
  background: transparent;
}
@media (max-width: 768px) {
  .nu-home .home-tools[data-cat="money"] .tool-card .tool-icon,
  .nu-home .home-tools[data-cat="numbers"] .tool-card .tool-icon,
  .nu-home .home-tools[data-cat="conversions"] .tool-card .tool-icon {
    font-size: 36px;
  }
}
.nu-home .home-tools .tool-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nu-text);
}
.nu-home .home-tools .tool-card p {
  margin: 0;
  color: var(--nu-muted);
  font-size: 13.5px;
  line-height: 1.5;
  flex: 1 0 auto;
}
/* Tool card arrow — color follows card --card-hue, shape uniform circle across all cards */
.tool-cta,
.nu-home .home-tools .tool-card .tool-cta,
.nu-home .tool-cta {
  /* SHAPE: uniform circle, force same dimensions on every card */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  flex-shrink: 0;
  flex-grow: 0;
  align-self: flex-start;
  padding: 0;
  /* KEY: push arrow to bottom of flex column (tool-card-body มี flex: 1 → arrow stretch ลงก้น) */
  margin-top: auto;
  margin-bottom: 0;
  border-radius: 999px;
  border: none;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  /* COLOR: themed by card --card-hue (light theme defaults) */
  background: oklch(0.92 0.07 var(--card-hue, 220));
  color: oklch(0.32 0.18 var(--card-hue, 220));
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.theme-dark .tool-cta,
.theme-dark .nu-home .home-tools .tool-card .tool-cta,
.theme-dark .nu-home .tool-cta {
  background: oklch(0.32 0.08 var(--card-hue, 220));
  color: oklch(0.88 0.12 var(--card-hue, 220));
}
.tool-card:hover .tool-cta,
.nu-home .home-tools .tool-card:hover .tool-cta { transform: translateX(3px); }

/* ----- Why Nulumia ----- */
.nu-home .home-why { margin-top: 3rem; }
.nu-home .home-why-card {
  padding: 32px;
  border: 1px solid var(--nu-line);
  border-radius: 20px;
  background: var(--nu-surface);
  box-shadow: var(--nu-shadow-card);
}
.nu-home .home-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.nu-home .home-why-list li {
  position: relative;
  padding-left: 36px;
  color: var(--nu-text);
  font-size: 0.97rem;
  line-height: 1.55;
  min-height: 24px;
}
.nu-home .home-why-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: oklch(0.92 0.07 var(--hue));
  /* checkmark via inline svg data-uri using mask */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>") center/14px 14px no-repeat, linear-gradient(#000,#000);
  -webkit-mask-composite: source-over;
}
.nu-home .home-why-list li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: oklch(0.92 0.07 var(--hue));
}
.nu-home .home-why-list li::before {
  background: transparent;
  border-radius: 0;
  -webkit-mask: none;
  mask: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2410c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  z-index: 1;
}
.theme-dark .nu-home .home-why-list li::after { background: oklch(0.32 0.08 var(--hue)); }
.theme-dark .nu-home .home-why-list li::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fdba74' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>");
}

/* ----- Quick links ----- */
.nu-home .home-quick { margin-top: 3rem; }
.nu-home .home-quick .quick-block { margin-bottom: 1.5rem; }
.nu-home .home-quick .quick-block:last-child { margin-bottom: 0; }
.nu-home .home-quick .quick-block-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nu-subtle);
  margin: 0 0 0.65rem;
}
.nu-home .quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nu-home .chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--nu-line);
  border-radius: 999px;
  background: var(--nu-surface);
  color: var(--nu-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 160ms, border-color 160ms, color 160ms;
}
.nu-home .chip:hover { text-decoration: none; }
.nu-home .chip-discount {
  font-weight: 600;
}
.nu-home .chip-discount:hover {
  background: oklch(0.95 0.05 18);
  border-color: oklch(0.78 0.13 18);
  color: oklch(0.32 0.18 18);
}
.theme-dark .nu-home .chip-discount:hover {
  background: oklch(0.32 0.08 18);
  border-color: oklch(0.55 0.14 18);
  color: oklch(0.92 0.10 18);
}
.nu-home .chip-convert:hover {
  background: oklch(0.95 0.05 165);
  border-color: oklch(0.72 0.12 165);
  color: oklch(0.32 0.14 165);
}
.theme-dark .nu-home .chip-convert:hover {
  background: oklch(0.30 0.07 165);
  border-color: oklch(0.50 0.13 165);
  color: oklch(0.90 0.10 165);
}

/* ----- Optimizer card (restyled to surface tokens) ----- */
.nu-home .home-optimizer { margin-top: 3rem; }
.nu-home .home-optimizer h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--nu-text);
}
.nu-home .optimizer-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 22px;
  border: 1px solid var(--nu-line);
  border-radius: 20px;
  background: var(--nu-surface);
  color: var(--nu-text);
  text-decoration: none;
  box-shadow: var(--nu-shadow-card);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.nu-home .optimizer-card:hover {
  transform: translateY(-2px);
  border-color: oklch(0.7 0.14 18 / 0.6);
  box-shadow: var(--nu-shadow-card-hover);
  text-decoration: none;
}
.nu-home .optimizer-card .optimizer-logo { flex: 0 0 64px; width: 64px; height: 64px; display: block; }
.nu-home .optimizer-card .optimizer-body { flex: 1 1 auto; min-width: 0; }
.nu-home .optimizer-card .optimizer-body h3 { margin: 0 0 0.3rem; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--nu-text); }
.nu-home .optimizer-card .optimizer-body p { margin: 0 0 0.5rem; color: var(--nu-muted); font-size: 14px; line-height: 1.5; }
.nu-home .optimizer-card .optimizer-cta { display: inline-block; color: var(--nu-accent); font-weight: 600; font-size: 14px; }

/* ----- Responsive ----- */
@media (max-width: 767px) {
  .nu-home .home-hero { padding: 2.25rem 0 1.5rem; }
  .nu-home .home-sticker { width: 40px; height: 40px; }
  .nu-home .home-sticker--3, .nu-home .home-sticker--4 { width: 36px; height: 36px; }
  .nu-home .home-tools .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .nu-home .home-tools .tool-card { padding: 16px; }
  .nu-home .home-tools .tool-card .tool-icon { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 12px; }
  .nu-home .home-tools .tool-card .tool-icon svg { width: 22px; height: 22px; }
  .nu-home .home-tools .tool-card h3 { font-size: 15px; }
  .nu-home .home-tools .tool-card p { font-size: 13px; }
  .nu-home .home-why-card { padding: 22px; }
}
@media (max-width: 480px) {
  .nu-home .home-hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .nu-home .home-tools .tool-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .nu-home .home-why-list { grid-template-columns: 1fr 1fr; gap: 14px 24px; }
}

/* ====================================================================== */
/* Wave 7 — Universal calculators (salary, date, loan)                    */
/* ====================================================================== */

/* Form field component */
.calc-form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.calc-form-field label { font-weight: 600; font-size: 0.9rem; }
.calc-form-field .calc-form-hint { font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.calc-form-field input,
.calc-form-field select { padding: 8px 12px; font-size: 1rem; border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg); color: var(--fg); }

/* Result card */
.result-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 8px 0; min-width: 0; overflow: hidden; }
.result-card h3 { margin: 0 0 8px; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; line-height: 1.2; min-height: 2.4em; }
.result-card .result-value { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 700; margin: 0; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; color: var(--fg); }

/* Inline error */
.error { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-fg); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }

/* Loan disclaimer (YMYL critical) */
.disclaimer { background: var(--warn-bg); border: 1px solid var(--warn-border); border-left: 4px solid var(--warn-border); padding: 12px 16px; margin-bottom: 16px; border-radius: 6px; color: var(--fg); }
.disclaimer strong { color: var(--warn-fg); }

/* Footer tools nav */
.footer-tools { margin-top: 0.5rem; }
/* Optimizer card legacy fallback (only applies if not inside .nu-home) */
.optimizer-card { color: var(--fg); text-decoration: none; }
.optimizer-card:hover { text-decoration: none; }
@media (max-width: 480px) {
  .nu-home .optimizer-card { flex-direction: column; align-items: flex-start; padding: 1rem; }
  .nu-home .optimizer-card .optimizer-logo { width: 48px; height: 48px; flex-basis: 48px; }
}

/* Salary 5-row breakdown grid */
.salary-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }

/* Hours preset chips */
.hours-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hours-presets .preset-chip { padding: 4px 10px; background: var(--chip-bg); border: 1px solid var(--chip-border); color: var(--chip-fg); border-radius: 16px; font-size: 0.85rem; cursor: pointer; text-decoration: none; }
.hours-presets .preset-chip:hover { background: var(--chip-border); color: var(--on-accent); }

/* Loan amortization table */
.amort-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.amort-table th,
.amort-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.amort-table th { background: var(--card-bg); text-align: center; color: var(--fg); }
.amort-table .col-month { text-align: center; }

/* Universal horizontal scroll wrapper for result tables on narrow viewports.
   KISS: no gradient overlay — caused white-stripe artifact on dark theme.
   Subtle border indicates table boundary; native scrollbar shows scroll affordance. */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.table-scroll > table { margin-top: 0; min-width: 100%; }
.table-scroll > table th,
.table-scroll > table td { white-space: nowrap; color: var(--fg); }
@media (max-width: 480px) {
  .table-scroll > table { font-size: 0.8125rem; }
  .table-scroll > table th,
  .table-scroll > table td { padding: 6px 8px; }
}

/* ===== Uniform table theme color =====
   Tables ต้องใช้สีเดียวกับ body (dark = ดำ, light = ขาว)
   ไม่มี zebra stripe, ไม่มี scope=col tint, ไม่มี first-column highlight.
   Override browser default (th { background: white }) + เก่า rules ที่ใช้ --card-bg. */
.conversion-table,
.compare-table,
.amort-table,
.examples-table { background: transparent; }
.conversion-table th,
.conversion-table td,
.compare-table th,
.compare-table td,
.amort-table th,
.amort-table td,
.examples-table th,
.examples-table td { background: transparent !important; color: var(--fg); }
.conversion-table tbody tr:nth-child(odd),
.conversion-table tbody tr:nth-child(even) { background: transparent !important; }
.table-scroll > table th,
.table-scroll > table td { background: transparent !important; }
.table-scroll > table tbody tr:nth-child(odd),
.table-scroll > table tbody tr:nth-child(even) { background: transparent !important; }

/* Back-to-top floating button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent, #2563eb);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, background 0.15s;
  z-index: 1000;
  padding: 0;
}
.back-to-top:hover { filter: brightness(1.1); }
.back-to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top svg { width: 20px; height: 20px; display: block; }
.theme-dark .back-to-top { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
@media (max-width: 480px) {
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  .back-to-top svg { width: 18px; height: 18px; }
}

/* Date result big number */
.date-result-big { font-size: 2rem; font-weight: 700; text-align: center; padding: 16px; background: var(--chip-bg); color: var(--chip-fg); border-radius: 8px; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.countdown-cell { text-align: center; padding: 12px; background: var(--card-bg); border-radius: 6px; color: var(--fg); }
.countdown-cell .num { font-size: 1.8rem; font-weight: 700; display: block; }
.countdown-cell .lbl { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.countdown-past { color: var(--error-fg); font-style: italic; margin-top: 8px; }

/* Week number dual display */
.week-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Hub item list */
.date-hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }

/* Related calculators block */
.related-calculators { margin-top: 32px; padding: 16px; background: var(--card-bg); border-radius: 8px; border: 1px solid var(--border); }
.related-calculators h3 { margin: 0 0 8px; font-size: 1rem; }
.related-calculators ul { margin: 0; padding-left: 20px; }
.related-calculators li { margin: 4px 0; }

@media (max-width: 540px) {
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
  .week-dual { grid-template-columns: 1fr; }
  .salary-breakdown { grid-template-columns: 1fr 1fr; }
}

/* Wave 8.6 — Datepicker */
.datepicker-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.datepicker-display {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}
.datepicker-display:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.datepicker-display:hover { border-color: var(--accent); }

.datepicker-popup {
  position: absolute;
  z-index: 100;
  background: #ffffff !important;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-elev);
  padding: 0.75rem;
  width: 18rem;
  font-family: inherit;
  color: var(--fg);
}
/* Light theme: ensure all internal surfaces inherit the popup white bg
   (no surface-alt tint, no layered grayish patches). Dark theme keeps
   its own rules below. */
.datepicker-nav,
.datepicker-grid,
.datepicker-grid-head,
.datepicker-month-grid,
.datepicker-year-grid {
  background: transparent !important;
}
.datepicker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.datepicker-nav-btn {
  background: #ffffff !important;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--fg);
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.datepicker-nav-btn:hover { background: #f3f4f6 !important; border-color: var(--accent); color: var(--accent); }
.datepicker-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.datepicker-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  background: #ffffff !important;
  border: 1px solid transparent;
  color: inherit;
  font-family: inherit;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: default;
}
.datepicker-title.is-clickable {
  cursor: pointer;
}
.datepicker-title.is-clickable:hover {
  background: #f3f4f6 !important;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}
.datepicker-title.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.datepicker-title:disabled {
  cursor: default;
  opacity: 1; /* keep readable when not clickable (year-range title) */
}
.datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.datepicker-month-grid,
.datepicker-year-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
  padding: 0.25rem 0;
}
.datepicker-month,
.datepicker-year {
  height: 2.5rem;
  font-size: 0.875rem;
  padding: 0 0.5rem;
  background: #ffffff !important;
  border: 1px solid transparent;
  color: var(--fg);
  border-radius: 0.375rem;
  cursor: pointer;
  font-family: inherit;
}
.datepicker-month:hover,
.datepicker-year:hover {
  background: #eff6ff !important;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.datepicker-month.is-selected,
.datepicker-year.is-selected {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-color: var(--accent);
  font-weight: 600;
}
.datepicker-grid-head { margin-bottom: 0.25rem; }
.datepicker-dow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.375rem 0;
  text-transform: uppercase;
  background: transparent !important;
}
.datepicker-day {
  background: #ffffff !important;
  border: 1px solid transparent;
  color: var(--fg);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.datepicker-day:hover {
  background: #eff6ff !important;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.datepicker-day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* Other-month cells: keep cell white (no opacity dim), only mute the text. */
.datepicker-day.is-other-month {
  background: #ffffff !important;
  color: var(--muted);
  opacity: 1;
}
.datepicker-day.is-today {
  border-color: var(--accent);
  font-weight: 600;
}
.datepicker-day.is-selected {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-color: var(--accent);
  font-weight: 600;
}
.datepicker-day.is-selected:hover {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
}

/* Dark theme: restore card-bg surface for popup + day cells.
   Light theme uses hardcoded #fff above for uniform white look. */
.theme-dark .datepicker-popup {
  background: var(--card-bg) !important;
}
.theme-dark .datepicker-day,
.theme-dark .datepicker-month,
.theme-dark .datepicker-year,
.theme-dark .datepicker-nav-btn,
.theme-dark .datepicker-title {
  background: transparent !important;
  color: var(--fg);
}
.theme-dark .datepicker-day.is-other-month {
  background: transparent !important;
  color: var(--muted);
}
.theme-dark .datepicker-day:hover,
.theme-dark .datepicker-month:hover,
.theme-dark .datepicker-year:hover,
.theme-dark .datepicker-nav-btn:hover,
.theme-dark .datepicker-title.is-clickable:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent) !important;
}
.theme-dark .datepicker-day.is-selected,
.theme-dark .datepicker-month.is-selected,
.theme-dark .datepicker-year.is-selected {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
}

@media (max-width: 480px) {
  /* Mobile: custom datepicker becomes a centered modal with backdrop.
     Wave 8.7 — was previously native-only on mobile, but devtools emulation
     and some Android browsers fail to open native picker inside scrollable
     forms. Custom picker on every viewport for consistent UX. */
  .datepicker-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    background: #ffffff !important;
  }
  .theme-dark .datepicker-popup {
    background: var(--card-bg) !important;
  }
  .datepicker-popup::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    margin: -50vh -50vw;
  }
  .datepicker-day {
    min-height: 40px;
    font-size: 15px;
  }
  .datepicker-nav-btn {
    min-width: 40px;
    min-height: 40px;
  }
}

/* ===== Birth time picker (slider only) ===== */
.birth-time-field { gap: 0.6rem; }

.time-picker { padding: 0.5rem 0; }

/* Slider */
.bt-slider-readout {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}
.bt-slider {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  margin: 0.25rem 0;
}
.bt-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bt-slider::-moz-range-thumb {
  width: 24px; height: 24px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bt-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bt-slider-ticks,
.bt-slider-ticks-min {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 2px;
  margin: 0.15rem 0 0.65rem;
  max-width: 100%;
  box-sizing: border-box;
}
.bt-slider-ticks span,
.bt-slider-ticks-min span { flex: 0 0 auto; }
.bt-slider-ticks span:first-child,
.bt-slider-ticks-min span:first-child { text-align: left; }
.bt-slider-ticks span:last-child,
.bt-slider-ticks-min span:last-child { text-align: right; }
.bt-slider-ticks-min { margin-bottom: 0; }

/* ===== Universal mobile-safe form controls ===== */
@media (max-width: 480px) {
  select,
  input[type="text"],
  input[type="time"],
  input[type="date"],
  input[type="number"],
  input[type="email"],
  input[type="search"],
  input[type="tel"],
  input[type="url"] {
    font-size: 16px;  /* prevent iOS zoom on focus */
    min-height: 44px;
    padding: 12px 16px;
  }
  select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
  }
  /* Birth-time slider mobile sizing */
  .bt-slider { height: 8px; }
  .bt-slider::-webkit-slider-thumb { width: 28px; height: 28px; }
  .bt-slider::-moz-range-thumb { width: 28px; height: 28px; }
  .bt-slider-readout { font-size: 2rem; }
}

/* Wave 9 home page styles superseded by Direction A scoped under .nu-home */

/* Percentage page — calc mode tab UI (4 modes selector) */
.calc-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--surface-alt, #f3f4f6);
  border-radius: 10px;
}

.calc-mode-tab {
  flex: 1 1 auto;
  min-width: max-content;
  padding: 10px 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted, #64748b);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.calc-mode-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.calc-mode-tab.is-active {
  background: var(--surface, #fff);
  color: var(--accent, #2563eb);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.theme-dark .calc-mode-tabs {
  background: var(--surface-alt);
}
.theme-dark .calc-mode-tab.is-active {
  background: var(--surface);
  color: var(--accent-ink, #93c5fd);
}
.theme-dark .calc-mode-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 480px) {
  .calc-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .calc-mode-tab {
    flex: none;
    min-width: 0;
    white-space: normal;
    line-height: 1.3;
    font-size: 12.5px;
    padding: 10px 8px;
  }
}

/* ====================================================================== */
/* Category icon — convert hub + sub-hub headers                           */
/* Inline SVG icons with per-category hue. No external deps.               */
/* ====================================================================== */
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: oklch(0.95 0.05 var(--icon-hue, 254));
  color: oklch(0.32 0.18 var(--icon-hue, 254));
  flex-shrink: 0;
  line-height: 0;
}
.category-icon svg {
  width: 60%;
  height: 60%;
  display: block;
}

/* Emoji icon — native OS-rendered glyph (v17 group icons — transparent + larger) */
.category-icon .emoji-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 38px;
  line-height: 1;
  font-family:
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    "Twemoji Mozilla",
    "EmojiOne Color",
    "Android Emoji",
    sans-serif;
  user-select: none;
  text-rendering: optimizeQuality;
  font-style: normal;
  font-weight: normal;
}

/* Larger emoji size in big icon contexts (96px wrappers etc.) — v18 bigger */
.hub-hero-with-icon .category-icon .emoji-icon,
.pet-age-hub-v2 .hub-groups .tool-card .category-icon .emoji-icon,
.pet-age-hub-v2 .hub-calculators .tool-card .category-icon .emoji-icon,
.petage-pettype-hub .hub-hero .category-icon .emoji-icon,
.petage-pettype-hub .hub-calculator-card .tool-card .category-icon .emoji-icon,
.calc-page .calc-header .category-icon .emoji-icon {
  font-size: 60px;
}

@media (max-width: 480px) {
  .category-icon .emoji-icon {
    font-size: 30px;
  }
  .hub-hero-with-icon .category-icon .emoji-icon,
  .pet-age-hub-v2 .hub-groups .tool-card .category-icon .emoji-icon,
  .pet-age-hub-v2 .hub-calculators .tool-card .category-icon .emoji-icon,
  .petage-pettype-hub .hub-hero .category-icon .emoji-icon,
  .petage-pettype-hub .hub-calculator-card .tool-card .category-icon .emoji-icon,
  .calc-page .calc-header .category-icon .emoji-icon {
    font-size: 45px;
  }
}

/* Per-category hues — distinct color per category */
.category-icon[data-category="length"]      { --icon-hue: 220; }  /* blue */
.category-icon[data-category="weight"]      { --icon-hue: 280; }  /* purple */
.category-icon[data-category="temperature"] { --icon-hue: 18; }   /* orange */
.category-icon[data-category="volume"]      { --icon-hue: 195; }  /* cyan */
.category-icon[data-category="area"]        { --icon-hue: 145; }  /* green */
.category-icon[data-category="speed"]       { --icon-hue: 5; }    /* red-orange */
.category-icon[data-category="kitchen"]     { --icon-hue: 35; }   /* warm yellow */

/* Age tools */
.category-icon[data-category="age-calculator"]              { --icon-hue: 18; }   /* warm orange — birthday */
.category-icon[data-category="age-days-between"]            { --icon-hue: 195; }  /* cyan */
.category-icon[data-category="age-days-from-today"]         { --icon-hue: 280; }  /* purple */
.category-icon[data-category="age-on-date"]                 { --icon-hue: 145; }  /* green */
.category-icon[data-category="age-business-days-between"]   { --icon-hue: 220; }  /* blue */

/* Date tools */
.category-icon[data-category="date-add-subtract"]   { --icon-hue: 35; }   /* warm yellow */
.category-icon[data-category="date-countdown"]      { --icon-hue: 18; }   /* orange */
.category-icon[data-category="date-working-days"]   { --icon-hue: 220; }  /* blue */
.category-icon[data-category="date-week-number"]    { --icon-hue: 280; }  /* purple */

/* Pet-age tools */
.category-icon[data-category="petage-dog"]   { --icon-hue: 35; }   /* warm yellow */
.category-icon[data-category="petage-cat"]   { --icon-hue: 280; }  /* purple */

/* Pet-age groups — 8 distinct hues */
.category-icon[data-category="petage-group-small-pets"]     { --icon-hue: 50; }   /* warm beige */
.category-icon[data-category="petage-group-birds"]          { --icon-hue: 220; }  /* sky blue */
.category-icon[data-category="petage-group-reptiles"]       { --icon-hue: 145; }  /* green */
.category-icon[data-category="petage-group-aquatic"]        { --icon-hue: 195; }  /* aqua */
.category-icon[data-category="petage-group-amphibians"]     { --icon-hue: 110; }  /* leafy */
.category-icon[data-category="petage-group-exotic"]         { --icon-hue: 18; }   /* warm rust */
.category-icon[data-category="petage-group-cultural-pets"]  { --icon-hue: 70; }   /* gold */
.category-icon[data-category="petage-group-invertebrates"]  { --icon-hue: 290; }  /* violet */

/* Pet-age icons v18 — transparent wrapper (no pastel frame) */
/* Covers all petage-* (dog/cat/hub + group-*) — emoji sits directly on card bg */
.category-icon[data-category^="petage-"] {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: inherit;
}

/* Tool card layout — icon บนสุด, title full-width (age + date hubs) */
.hub-tools .tool-card,
.date-hub-grid .tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.hub-tools .tool-card .category-icon,
.date-hub-grid .tool-card .category-icon {
  flex-shrink: 0;
  margin-bottom: 0;
}
.tool-card-body {
  width: 100%;
  flex: none;
  min-width: 0;
}
.tool-card-body h3 { margin: 0 0 0.4rem 0; }
.tool-card-body p { margin: 0; color: var(--muted); }

/* Convert root: category card layout — icon บนสุด, title full-width */
.convert-root .category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}
.convert-root .category-card .category-icon {
  flex-shrink: 0;
  margin-bottom: 0;
}
.category-card-body {
  display: block;
  width: 100%;
  flex: none;
  min-width: 0;
}
.category-card-body h3 { margin: 0 0 0.35rem 0; font-size: 1rem; }
.category-card-body p { margin: 0; font-size: 0.9375rem; color: var(--muted); }

/* Hub header: icon ข้าง H1 (convert sub-hub) */
.convert-hub .hub-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.convert-hub .hub-header .category-icon {
  width: 56px;
  height: 56px;
}
.hub-header-body {
  flex: 1;
  min-width: 0;
}
.hub-header-body h1 { font-size: 1.875rem; margin: 0 0 0.5rem 0; line-height: 1.2; }
.hub-header-body .lead { color: var(--muted); font-size: 1.0625rem; margin: 0; }

/* Dark theme — icon background + foreground swap */
.theme-dark .category-icon {
  background: oklch(0.32 0.08 var(--icon-hue, 254));
  color: oklch(0.85 0.12 var(--icon-hue, 254));
}

/* Pet-age icons v18 — transparent in dark theme too (all petage-* incl. dog/cat/hub) */
.theme-dark .category-icon[data-category^="petage-"] {
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
}

/* ====================================================================== */
/* Pet-age large icon variant — 80px wrapper (vs 48px default)             */
/* Scoped to: petage hub/calc cards + species hero + home pet section      */
/* Reason: pet illustrations need more canvas to render kawaii detail      */
/* ====================================================================== */
.pet-age-hub-v2 .hub-calculators .tool-card .category-icon,
.pet-age-hub-v2 .hub-groups .tool-card .category-icon,
.pet-age-hub-v2 .hub-tools .tool-card .category-icon,
.petage-pettype-hub .hub-hero .category-icon,
.petage-pettype-hub .hub-calculator-card .tool-card .category-icon,
.calc-page.pet-age-dog .calc-header .category-icon,
.calc-page.pet-age-cat .calc-header .category-icon,
.hub-hero-with-icon .category-icon,
.hub-calc-card .category-icon,
.nu-home .home-tools[data-cat="pet"] .tool-card .category-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
}
.pet-age-hub-v2 .hub-calculators .tool-card .category-icon svg,
.pet-age-hub-v2 .hub-groups .tool-card .category-icon svg,
.pet-age-hub-v2 .hub-tools .tool-card .category-icon svg,
.petage-pettype-hub .hub-hero .category-icon svg,
.petage-pettype-hub .hub-calculator-card .tool-card .category-icon svg,
.calc-page.pet-age-dog .calc-header .category-icon svg,
.calc-page.pet-age-cat .calc-header .category-icon svg,
.hub-hero-with-icon .category-icon svg,
.hub-calc-card .category-icon svg,
.nu-home .home-tools[data-cat="pet"] .tool-card .category-icon svg {
  width: 72%;
  height: 72%;
}

/* Mobile — slightly smaller icons */
@media (max-width: 480px) {
  .category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .convert-hub .hub-header .category-icon {
    width: 48px;
    height: 48px;
  }
  /* Pet large variant — slightly smaller on mobile but still hero-size */
  .pet-age-hub-v2 .hub-calculators .tool-card .category-icon,
  .pet-age-hub-v2 .hub-groups .tool-card .category-icon,
  .pet-age-hub-v2 .hub-tools .tool-card .category-icon,
  .petage-pettype-hub .hub-hero .category-icon,
  .petage-pettype-hub .hub-calculator-card .tool-card .category-icon,
  .calc-page.pet-age-dog .calc-header .category-icon,
  .calc-page.pet-age-cat .calc-header .category-icon,
  .hub-hero-with-icon .category-icon,
  .hub-calc-card .category-icon,
  .nu-home .home-tools[data-cat="pet"] .tool-card .category-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
  }
  .hub-header-body h1 { font-size: 1.5rem; }
  .hub-tools .tool-card,
  .date-hub-grid .tool-card,
  .convert-root .category-card {
    gap: 10px;
  }
}

/* Convert sub-hub hero illustration */
.convert-hero {
  margin: 16px 0 24px;
  padding: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: var(--text);
}
.convert-hero-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  max-height: 200px;
  display: block;
}
.theme-dark .convert-hero {
  background: var(--surface);
  border-color: var(--line);
}
@media (max-width: 480px) {
  .convert-hero {
    padding: 12px;
    margin: 12px 0 20px;
  }
}


/* ---------- Social share component ---------- */
.social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.social-share-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.social-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  background: var(--surface, #fff);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.social-share-btn:hover,
.social-share-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}
.social-share-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--focus, #4a90e2);
}
.social-share-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.social-share-facebook  { color: #1877f2; }
.social-share-x         { color: #000000; }
.social-share-line      { color: #06c755; }
.social-share-instagram { color: #e4405f; }
.social-share-telegram  { color: #229ed9; }
.social-share-whatsapp  { color: #25d366; }
.social-share-reddit    { color: #ff4500; }
.social-share-copy      { color: var(--accent, #2563eb); }
.social-share-facebook:hover     { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-share-x:hover            { background: #000;    color: #fff; border-color: #000; }
.social-share-line:hover         { background: #06c755; color: #fff; border-color: #06c755; }
.social-share-instagram:hover    { background: #e4405f; color: #fff; border-color: #e4405f; }
.social-share-telegram:hover     { background: #229ed9; color: #fff; border-color: #229ed9; }
.social-share-whatsapp:hover     { background: #25d366; color: #fff; border-color: #25d366; }
.social-share-reddit:hover       { background: #ff4500; color: #fff; border-color: #ff4500; }
.social-share-copy:hover         { background: var(--text); color: var(--surface, #fff); border-color: var(--text); }
.social-share-copy.copied        { background: #2ea44f; color: #fff; border-color: #2ea44f; }
.theme-dark .social-share-btn {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}
.theme-dark .social-share-facebook  { color: #1877f2; }
.theme-dark .social-share-x         { color: #ffffff; }
.theme-dark .social-share-line      { color: #06c755; }
.theme-dark .social-share-instagram { color: #e4405f; }
.theme-dark .social-share-telegram  { color: #229ed9; }
.theme-dark .social-share-whatsapp  { color: #25d366; }
.theme-dark .social-share-reddit    { color: #ff4500; }
.theme-dark .social-share-copy      { color: var(--accent, #93c5fd); }
@media (max-width: 767px) {
  .social-share-label {
    flex-basis: 100%;
    margin-right: 0;
    margin-bottom: 4px;
  }
  .social-share-btn {
    width: 40px;
    height: 40px;
  }
  .social-share-btn svg {
    width: 20px;
    height: 20px;
  }
}
@media (max-width: 480px) {
  .social-share {
    gap: 6px;
  }
  .social-share-btn {
    width: 34px;
    height: 34px;
  }
  .social-share-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ===== Pet-Age Reference Table + Sources ===== */
.reference-table-section {
  margin-top: 32px;
}

.reference-table-section .lead {
  margin-bottom: 16px;
  color: var(--muted);
}

.reference-table th,
.reference-table td {
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
}

.reference-table thead th {
  background: var(--card-bg);
  font-weight: 600;
}

.reference-table tbody th {
  font-weight: 600;
  color: var(--accent);
}

.table-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.sources-section {
  margin-top: 32px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.sources-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.sources-list li:last-child {
  border-bottom: none;
}

.sources-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.sources-list a:hover {
  text-decoration: underline;
}

.external-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85em;
  opacity: 0.7;
}

.disclaimer {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 480px) {
  .reference-table th,
  .reference-table td {
    padding: 6px 8px;
    font-size: 13px;
  }
}

/* Sprint 3 — petage compare + faq pages */
.compare-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-summary-table thead th {
  background: var(--surface-alt);
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid var(--accent);
  text-align: left;
}

.compare-summary-table thead th:first-child {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-summary-table thead th:not(:first-child) {
  color: var(--accent);
  font-size: 16px;
}

.compare-summary-table tbody tr:nth-child(even) {
  background: var(--surface-alt);
}

.compare-summary-table th[scope="row"] {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  width: 30%;
  text-align: left;
}

.compare-summary-table td {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.faq-answer .answer-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.faq-answer .answer-content p {
  margin: 0 0 12px 0;
}

.faq-related {
  margin-top: 32px;
  padding: 20px;
  background: var(--surface-alt, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
}

.related-list {
  list-style: disc;
  padding-left: 20px;
  margin: 12px 0 0 0;
}

.related-list li {
  padding: 6px 0;
}

.faq-cta {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.faq-cta h2 {
  margin-top: 0;
}

@media (max-width: 480px) {
  .cta-grid {
    grid-template-columns: 1fr;
  }
  .compare-summary-table th[scope="row"] {
    font-size: 11px;
    padding: 10px 8px;
  }
  .compare-summary-table td,
  .compare-summary-table thead th {
    padding: 10px 8px;
    font-size: 13px;
  }
  .compare-summary-table thead th:not(:first-child) {
    font-size: 14px;
  }
}

/* Sprint 4 — pet-age hub sitemap-style index + cross-link blocks */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.link-grid li a {
  display: block;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.link-grid li a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.age-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.age-list,
.compare-list,
.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.age-list li,
.compare-list li,
.faq-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.age-list li:last-child,
.compare-list li:last-child,
.faq-list li:last-child {
  border-bottom: none;
}

.age-list li a,
.compare-list li a,
.faq-list li a {
  color: var(--fg);
  text-decoration: none;
}

.age-list li a:hover,
.compare-list li a:hover,
.faq-list li a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.hub-section {
  margin: 0 0 2rem 0;
}

.hub-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

.hub-section-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px 0;
}

.age-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.age-nav a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
}

.age-nav a:hover {
  text-decoration: underline;
}

.related-section {
  margin-top: 32px;
}

.tool-card.compact {
  padding: 12px;
}

@media (max-width: 480px) {
  .age-grid {
    grid-template-columns: 1fr;
  }

  /* Featured/Similar breeds — force 2 cols + compact font on mobile */
  .age-featured-breeds .tool-grid,
  .petage-breed-page .related-section .tool-grid,
  .petage-breed-page .tool-grid,
  .related-section .tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .age-featured-breeds .tool-card,
  .age-featured-breeds .tool-card.compact,
  .petage-breed-page .tool-card,
  .petage-breed-page .tool-card.compact,
  .related-section .tool-card {
    padding: 10px 12px;
  }

  .age-featured-breeds .tool-card h3,
  .petage-breed-page .tool-card h3,
  .related-section .tool-card h3 {
    font-size: 13.5px;
    line-height: 1.25;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .age-featured-breeds .tool-card p,
  .petage-breed-page .tool-card p,
  .related-section .tool-card p {
    font-size: 11.5px;
    line-height: 1.3;
    margin: 0;
    color: var(--muted);
  }
}

/* ===========================================================
   Pet Age Hub v2 — card-based hero + see-more pattern
   =========================================================== */

.pet-age-hub-v2 .hub-hero {
  text-align: center;
  padding: 24px 16px 16px;
  margin-bottom: 16px;
}

/* Group-hub hero — icon + text side by side */
.hub-hero-with-icon {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.hub-hero-with-icon .category-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}
.hub-hero-with-icon h1 { margin: 0 0 0.4rem 0; font-size: clamp(24px, 4.5vw, 36px); line-height: 1.2; }
.hub-hero-with-icon .hub-hero-lead { margin: 0; color: var(--muted); }

.pet-age-hub-v2 .hub-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.pet-age-hub-v2 .hub-hero-lead {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.55;
}

/* 2 large CTA cards */
.hub-calculators {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .hub-calculators {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.hub-calc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.hub-calc-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.hub-calc-card .category-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.hub-calc-card h2 {
  margin: 8px 0 6px 0;
  font-size: 1.375rem;
}

.hub-calc-card p {
  color: var(--muted);
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.hub-calc-cta {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.hub-calc-cta::after {
  content: " \2192";
}

/* Stats row */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0 32px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.stat-num {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* Section pattern */
.pet-age-hub-v2 .hub-section {
  margin: 36px 0;
}

.hub-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.hub-section-head h2 {
  margin: 0;
  font-size: 1.375rem;
}

.hub-section-count {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.hub-section-sub {
  font-size: 1rem;
  margin: 20px 0 10px 0;
  color: var(--fg);
  font-weight: 600;
}

/* Breed cards */
.breed-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.breed-card-grid-more {
  margin-top: 4px;
}

.breed-card {
  display: block;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}

.breed-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.breed-name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 4px;
  line-height: 1.3;
  color: var(--accent);
}

.breed-meta {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.breed-meta li {
  margin: 0;
  color: var(--fg);
  line-height: 1.3;
}

/* Age pills */
.age-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.age-pill:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  text-decoration: none;
}

.age-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Comparison cards */
.compare-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.compare-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}

.compare-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.compare-pet {
  font-size: 1.125rem;
}

.vs-badge {
  background: var(--accent);
  color: var(--on-accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.compare-list li {
  border-bottom: 1px solid var(--border);
}

.compare-list li:last-child {
  border-bottom: none;
}

.compare-list a {
  display: block;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--fg);
}

.compare-list a:hover {
  color: var(--accent);
}

/* FAQ — clean list */
.faq-list-simple {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-list-simple li {
  border-bottom: 1px solid var(--border);
}

.faq-list-simple li:last-child {
  border-bottom: none;
}

.faq-list-simple li a {
  display: block;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--fg);
  transition: color 0.15s, padding-left 0.15s;
}

.faq-list-simple li a::before {
  content: "\203A";
  display: inline-block;
  margin-right: 12px;
  color: var(--accent);
  font-weight: 700;
}

.faq-list-simple li a:hover {
  color: var(--accent);
  padding-left: 8px;
}

/* See-more disclosure */
.hub-see-more {
  margin: 14px 0 0 0;
}

.hub-see-more summary {
  cursor: pointer;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  list-style: none;
  font-weight: 500;
  text-align: center;
  color: var(--accent);
  transition: background 0.15s, border-color 0.15s;
}

.hub-see-more summary:hover {
  border-color: var(--accent);
}

.hub-see-more summary::-webkit-details-marker { display: none; }
.hub-see-more summary::marker { content: ""; }

.hub-see-more[open] summary {
  margin-bottom: 14px;
}

/* Tablet */
@media (max-width: 768px) {
  .hub-stats {
    grid-template-columns: repeat(4, 1fr);
  }
  .stat-num { font-size: 1.375rem; }
}

/* Mobile */
@media (max-width: 480px) {
  .hub-calculators {
    grid-template-columns: 1fr;
  }

  .hub-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .hub-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hub-section-head h2 {
    font-size: 1.25rem;
  }

  .breed-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .compare-card-grid {
    grid-template-columns: 1fr;
  }

  .pet-age-hub-v2 .hub-hero {
    padding: 16px 8px 8px;
  }
}

/* Breed profile stats — semantic <dl> as 2-column aligned grid */
.breed-stats {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 0;
  margin: 16px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.breed-stats dt {
  padding: 12px 16px;
  background: var(--card-bg);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.breed-stats dd {
  padding: 12px 16px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.breed-stats dt:last-of-type,
.breed-stats dd:last-of-type {
  border-bottom: none;
}
@media (max-width: 480px) {
  .breed-stats {
    grid-template-columns: 1fr 1fr;
  }
  .breed-stats dt,
  .breed-stats dd {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* ===== Per-age CTA callout (petage_age.html) ===== */
.age-cta-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin: 32px 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.age-cta-callout .cta-text { flex: 1; min-width: 0; }
.age-cta-callout .cta-text h2 {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}
.age-cta-callout .cta-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.btn-primary.btn-large {
  flex-shrink: 0;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 0.75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  filter: brightness(1.05);
}
.btn-primary.btn-large:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-dark .age-cta-callout {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
@media (max-width: 640px) {
  .age-cta-callout {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 22px 20px;
    gap: 16px;
  }
  .age-cta-callout .btn-primary.btn-large {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
  }
}

/* ───────── Breed image (petage_breed.html) — left-aligned, constrained ───────── */
.breed-image {
  max-width: 720px;
  margin: 24px 0 32px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  display: block;
  background: transparent;
  border: 0;
}
.breed-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}
.breed-image figcaption {
  display: none;
}
@media (max-width: 480px) {
  .breed-image {
    max-width: 100%;
    margin: 16px 0 24px;
    border-radius: 12px;
  }
  .breed-image img { border-radius: 12px; }
}

/* Multi-pet compare (Sprint 7) — use project tokens (--card-bg, --border, --fg)
   so light/dark themes both inherit correctly. Earlier draft used undefined
   --surface-alt / --line which fell back to literal light hex, breaking dark theme. */
.multi-pet-form .pet-slot {
  margin: 16px 0;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg);
}
.multi-pet-form .pet-slot legend {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.multi-pet-form .pet-slot .calc-field label {
  color: var(--fg);
}
.multi-pet-form .calc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.compare-pets-table strong { color: var(--accent); }
.compare-pets-result { margin-top: 1.25rem; }
@media (max-width: 480px) {
  .multi-pet-form .calc-field-row { grid-template-columns: 1fr; }
}

/* ===== Sprint 7 — Aging Timeline (SSR SVG, no canvas, no JS) ===== */
.aging-timeline-section {
  margin: 24px 0;
}
.aging-timeline-section h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.aging-timeline {
  width: 100%;
  margin: 8px 0;
  overflow: hidden;
}
.aging-timeline-svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  font-family: inherit;
}
@media (max-width: 480px) {
  .aging-timeline-svg { max-width: 100%; }
  .aging-timeline-section h2 { font-size: 1rem; }
}
@media (max-width: 767px) {
  .aging-timeline-svg .aging-timeline-stage-label { font-size: 18px; }
  .aging-timeline-svg .aging-timeline-expected-label { font-size: 16px; }
  .aging-timeline-svg .aging-timeline-current-label { font-size: 20px; }
}

/* ===== Sprint 8 — Pet Age multi-species (39 species + 8 group hubs) ===== */
.petage-species .calc-helper {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  opacity: 0.72;
}
.petage-conditional-field { margin-top: 8px; }
.petage-warnings {
  margin: 12px 0 0;
  padding: 10px 14px;
  list-style: none;
  border-left: 3px solid oklch(0.78 0.16 75);
  background: oklch(0.98 0.04 95);
  border-radius: 6px;
  font-size: 0.92rem;
}
.petage-warnings .warning-item { margin: 2px 0; }
.theme-dark .petage-warnings {
  background: oklch(0.22 0.04 75);
  border-left-color: oklch(0.72 0.18 75);
  color: oklch(0.94 0.02 95);
}
.petage-lifespan-card {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
}
.petage-lifespan-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.petage-lifespan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.petage-lifespan-grid .lifespan-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  text-align: center;
  background: oklch(0.98 0.01 250);
  border-radius: 8px;
}
.theme-dark .petage-lifespan-grid .lifespan-cell { background: oklch(0.22 0.02 250); }
.petage-lifespan-grid .lifespan-label { font-size: 0.78rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; }
.petage-lifespan-grid .lifespan-num { font-size: 1.6rem; line-height: 1.1; margin: 4px 0; }
.petage-lifespan-grid .lifespan-unit { font-size: 0.82rem; opacity: 0.7; }
.petage-related { margin: 24px 0; }
.petage-related h2 { margin: 0 0 12px; font-size: 1.05rem; }
.petage-species-card .petage-species-meta {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  opacity: 0.72;
}
.hub-groups { margin-top: 24px; }
@media (max-width: 480px) {
  .petage-lifespan-grid { grid-template-columns: 1fr; }
  .hub-groups .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* Pet age hub — prose sections (intro, how-it-works, why-matters, methodology) */
.hub-intro { margin-top: 24px; }
.hub-intro p { margin: 8px 0 0; line-height: 1.7; color: var(--muted, var(--nu-text)); max-width: 72ch; }
.how-it-works-steps {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 14px;
}
.how-it-works-steps > li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.how-it-works-steps .step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--nu-surface-alt, rgba(255,255,255,0.08));
  color: var(--nu-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.theme-light .how-it-works-steps .step-num {
  background: rgba(0,0,0,0.06);
  color: #1a1a1a;
}
.how-it-works-steps .step-body { flex: 1; min-width: 0; }
.how-it-works-steps h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.how-it-works-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.hub-why-matters p { margin: 8px 0 0; line-height: 1.6; max-width: 72ch; }
.hub-why-list {
  margin: 12px 0 0;
  padding-left: 20px;
  max-width: 72ch;
}
.hub-why-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.hub-methodology p {
  margin: 8px 0 0;
  line-height: 1.7;
  max-width: 72ch;
}

/* ============================================================
 * Generic tool-card layout — uniform arrow alignment at bottom
 * ============================================================
 * Applies to ALL .tool-card variants outside .nu-home (pet-age hub,
 * group hubs, pet-type hubs, species, breed, age pages, related rails).
 * Same flex-column pattern as .nu-home .home-tools so .tool-cta
 * (margin-top: auto) is pushed to card bottom regardless of
 * description length. .nu-home rules above remain authoritative
 * within their scope; these are the fallback for everywhere else. */
.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-self: stretch;
}
.tool-card .tool-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
}
.tool-card .tool-card-body > p { flex: 1 0 auto; }
.tool-card > .tool-cta,
.tool-card .tool-cta { margin-top: auto; margin-bottom: 0; }

/* Pet-age group hub SEO sections (Wave 21).
 * Adds About, Lifespan stats, Care tips, Sources sections to /pet-age/{group}/
 * pages. Minimal styling that integrates with the existing dark theme via
 * CSS variables; no new color tokens introduced. */
.lifespan-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.lifespan-stats-grid .stat-card {
  background: var(--card-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
}
.lifespan-stats-grid .stat-card strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent, #6cb4ff);
  line-height: 1.1;
}
.lifespan-stats-grid .stat-card span {
  display: block;
  font-size: 13px;
  color: var(--muted, rgba(255,255,255,0.6));
  margin-top: 6px;
}
.lifespan-stats-note {
  font-size: 13px;
  color: var(--muted, rgba(255,255,255,0.6));
  margin-top: 12px;
}
.care-tips-list {
  margin-top: 12px;
  padding-left: 22px;
  list-style: disc;
}
.care-tips-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.health-concerns {
  margin-top: 12px;
}
.health-concerns dt {
  font-weight: 600;
  margin-top: 12px;
  color: var(--fg, #e8eef7);
}
.health-concerns dd {
  margin-left: 0;
  color: var(--muted, rgba(255,255,255,0.72));
  line-height: 1.6;
  margin-bottom: 8px;
}
.species-about p,
.species-aging p {
  line-height: 1.7;
}
.sources-list {
  padding-left: 22px;
  margin-top: 12px;
  list-style: disc;
}
.sources-list li { margin-bottom: 6px; }
.sources-list a {
  color: var(--accent, #6cb4ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.group-about p { line-height: 1.7; }

@media (max-width: 480px) {
  .lifespan-stats-grid { grid-template-columns: 1fr; }
}

/* /pet-age/ hub — quick species jump search bar.
   Mounted between hero and stats; reuses the static search index. */
.petage-search {
  max-width: 600px;
  margin: 20px auto 28px;
  padding: 0 16px;
}
.petage-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  transition: border-color 200ms, box-shadow 200ms;
}
.petage-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.theme-dark .petage-search-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.20);
}
.petage-search-icon {
  flex-shrink: 0;
  color: var(--muted);
  margin-right: 10px;
}
.petage-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 16px;
  color: var(--fg);
  outline: none;
  font-family: inherit;
  min-width: 0;
}
.petage-search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.petage-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  list-style: none;
  padding: 6px 0;
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-elev);
}
.petage-search-results[hidden] { display: none !important; }
.petage-search-results li { margin: 0; padding: 0; }
.petage-search-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: var(--fg);
  text-decoration: none;
}
.petage-search-results li:hover .petage-search-result,
.petage-search-results li.selected .petage-search-result {
  background: rgba(37, 99, 235, 0.08);
}
.theme-dark .petage-search-results li:hover .petage-search-result,
.theme-dark .petage-search-results li.selected .petage-search-result {
  background: rgba(96, 165, 250, 0.12);
}
.petage-search-result-title { font-weight: 600; }
.petage-search-sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .petage-search { margin: 12px 0 20px; padding: 0 12px; }
  .petage-search-input { font-size: 16px; padding: 12px 0; }
}

/* ── Pet save feature (petage_save.js) ─────────────────────────────── */
/* Inherits .btn-ghost (padding/border/radius/font/color) — keep only layout + icon spacing
   so it matches the sibling .copy-link button visually. */
.pet-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: background 0.15s ease, color 0.15s ease;
}
.pet-save-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pet-save-btn svg { flex-shrink: 0; }

.pet-save-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}
.pet-save-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-elev);
}
.pet-save-modal h3 {
  margin: 0 0 14px;
  color: var(--fg);
  font-size: 18px;
}
.pet-save-modal label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.pet-save-modal input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--fg);
  font-size: 16px;
  box-sizing: border-box;
}
.pet-save-modal input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.pet-save-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

.saved-pets-rail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0 24px;
}
.saved-pets-rail h2 {
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--fg);
  font-weight: 600;
}
.saved-pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.saved-pet-card {
  display: block;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s ease;
}
.saved-pet-card:hover { border-color: var(--accent); }
.saved-pet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.saved-pet-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-pet-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.saved-pet-remove:hover { color: var(--fg); background: var(--border); }
.saved-pet-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.saved-pet-meta {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.pet-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-elev);
  z-index: 999;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.pet-toast.fade { opacity: 0; }

@media (max-width: 480px) {
  .saved-pets-rail { margin: 12px 0 18px; padding: 14px; }
  .saved-pets-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .pet-toast { bottom: 16px; right: 16px; left: 16px; text-align: center; }
}
