/* ============================================================
   CALCORA — Free Online Calculators
   Google Material-inspired light theme. No frameworks.
   Palette: #FFFFFF / #F8F9FA / #1A73E8 / #202124 / #5F6368 / #DADCE0
   ============================================================ */

/* ---------- CSS variables ---------- */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F8F9FA;
  --blue: #1A73E8;
  --blue-hover: #3081EA;
  --blue-dark: #1765CC;
  --blue-chip: #3C88EB;
  --blue-tint: #EAF3FE;
  --blue-focus: #C0D9F9;
  --tint-lavender: #EFEDFC;
  --tint-mint: #E6F4EC;
  --tint-peach: #FDEFE3;
  --text: #202124;
  --muted: #5F6368;
  --border: #DADCE0;
  --border-soft: #E8EAED;
  --gold-bg: #FEF7E0;
  --gold-text: #B06000;
  --error: #D93025;
  --success: #188038;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --container: 1360px;
  --container-narrow: 880px;
  --header-h: 64px;
  --shadow-soft: 0 2px 8px rgba(60, 64, 67, .08);
  --shadow-card: 0 8px 30px rgba(60, 64, 67, .12);
  --shadow-search: 0 4px 20px rgba(60, 64, 67, .12);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .6em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.5rem; font-weight: 600; }

p { margin-bottom: 1em; color: var(--muted); }
p.lead { font-size: 1.125rem; color: var(--muted); }

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

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

::selection { background: rgba(26, 115, 232, .18); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: .85rem 1.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 115, 232, .3);
}
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
  background: #fff;
  color: var(--blue);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--blue); background: var(--blue-tint); }

/* legacy ghost buttons (copy-result) → light secondary style */
.btn-ghost {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--border);
  padding: .6rem 1.25rem;
  font-size: .925rem;
}
.btn-ghost:hover { border-color: var(--blue); background: var(--blue-tint); }
.btn-ghost:disabled { opacity: .6; cursor: default; }

.btn-block { width: 100%; }
/* .btn-shine kept for compatibility; no shine in the restrained light theme */
.btn-shine { position: relative; }

/* ---------- Header ---------- */
.site-header {
  position: static;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 16px rgba(60, 64, 67, .1); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  font-weight: 800;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.beta-tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: 6px;
  padding: .1rem .45rem;
  vertical-align: super;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.main-nav a {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }

.header-cta { flex-shrink: 0; }
.header-cta .btn { padding: .6rem 1.4rem; font-size: .95rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Homepage hero ---------- */
.hero {
  padding: 6rem 0 4.5rem;
  text-align: center;
  background: #fff;
}
.hero-inner { max-width: 860px; margin-inline: auto; }

.hero-badge {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: .35rem 1rem;
  margin-bottom: 1.25rem;
}

.hero h1 { margin-bottom: 1rem; }
.hero h1 .accent { color: var(--blue); }
.hero-sub {
  font-size: 1.125rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto 1.75rem;
}
.search-wrap > svg {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#toolSearch {
  width: 100%;
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1rem 1.5rem 1rem 3.25rem;
  box-shadow: var(--shadow-search);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#toolSearch::placeholder { color: #9AA0A6; }
#toolSearch:focus {
  border-color: var(--blue);
  box-shadow: 0 4px 24px rgba(26, 115, 232, .18);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.75rem;
  font-size: .95rem;
  color: var(--muted);
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.trust-item svg { color: var(--blue); flex-shrink: 0; }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section.band { background: var(--bg-alt); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.section-head h2 { margin-bottom: .5rem; }
.section-sub { font-size: 1.05rem; margin-bottom: 0; }

/* ---------- Tool cards ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.tool-card {
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:nth-child(4n+1) { background: var(--blue-tint); }
.tool-card:nth-child(4n+2) { background: var(--tint-lavender); }
.tool-card:nth-child(4n+3) { background: var(--tint-mint); }
.tool-card:nth-child(4n+4) { background: var(--tint-peach); }
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.tool-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.tool-card-link:hover { text-decoration: none; }

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  color: var(--blue);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.1rem;
}
.tool-card h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.tool-card p { font-size: .95rem; margin-bottom: 1rem; flex-grow: 1; }
.tool-cta {
  color: var(--blue);
  font-weight: 600;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0 0;
  font-size: 1.05rem;
}

/* ---------- Steps ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.step-card {
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
}
.step-card:nth-child(3n+1) { background: var(--blue-tint); }
.step-card:nth-child(3n+2) { background: var(--tint-lavender); }
.step-card:nth-child(3n+3) { background: var(--tint-mint); }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1rem;
}
.step-card h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.step-card p { font-size: .95rem; margin-bottom: 0; }

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.feature { text-align: left; }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-tint);
  margin-bottom: 1rem;
}
.features-grid .feature:nth-child(2) .feature-icon { background: var(--tint-lavender); }
.features-grid .feature:nth-child(3) .feature-icon { background: var(--tint-mint); }
.features-grid .feature:nth-child(4) .feature-icon { background: var(--tint-peach); }
.feature h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.feature p { font-size: .93rem; margin-bottom: 0; }

/* ---------- FAQ accordion ---------- */
.faq-wrap { max-width: var(--container-narrow); margin-inline: auto; }
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem .25rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid var(--blue);
  border-bottom: 2.5px solid var(--blue);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-item summary:hover { color: var(--blue); }
.faq-item .faq-answer { padding: 0 .25rem 1.5rem; }
.faq-item .faq-answer p { margin-bottom: 0; }
.faq-item > p { padding: 0 .25rem 1.5rem; margin-bottom: 0; color: var(--muted); }

/* ---------- CTA panel ---------- */
.cta-panel {
  background: var(--blue-tint);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  max-width: var(--container-narrow);
  margin-inline: auto;
}
.cta-panel h2 { margin-bottom: .5rem; }
.cta-panel p { margin-bottom: 1.75rem; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  padding: 4rem 0 2rem;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand p { font-size: .93rem; margin-top: 1rem; margin-bottom: 0; }
.site-footer nav h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.site-footer nav ul { list-style: none; }
.site-footer nav li { margin-bottom: .55rem; }
.site-footer nav ul a { color: var(--muted); font-size: .95rem; }
.site-footer nav ul a:hover { color: var(--blue); text-decoration: none; }
.footer-note {
  font-size: .85rem;
  color: #9AA0A6;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
  margin-bottom: .75rem;
}
.copyright { font-size: .85rem; color: #9AA0A6; margin-bottom: 0; }

/* ---------- Breadcrumb + calculator page hero ---------- */
.breadcrumb {
  padding-top: 1.5rem;
  font-size: .9rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb [aria-current="page"] { color: var(--text); }

.page-hero {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  padding: 2.5rem 1.5rem 3rem;
}
.cat-pill {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: .35rem 1rem;
  margin-bottom: 1rem;
}
.page-hero h1 { margin-bottom: .75rem; }
.page-hero .lead { margin-bottom: 0; }

/* ---------- Calculator card ---------- */
.calc-band { padding: 0 0 5rem; }
.calc-band-inner {
  border-radius: var(--radius-lg);
  padding: 3.5rem 1.5rem;
}
.calc-band-blue .calc-band-inner { background: var(--blue-tint); }
.calc-band-lavender .calc-band-inner { background: var(--tint-lavender); }

.calc-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.calc-form { margin-bottom: 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.form-grid .field:only-child { grid-column: 1 / -1; }

.field label,
.field-label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .45rem;
}
.field input,
.field select {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-focus);
}
.field input.invalid,
.field select.invalid { border-color: var(--error); }
.field-error {
  font-size: .85rem;
  color: var(--error);
  margin-top: .4rem;
  margin-bottom: 0;
  min-height: 1.25em;
}
.field-error[hidden] { display: none; }

/* radio pills (unit toggles) */
.radio-group { display: flex; flex-wrap: wrap; gap: .6rem; }
.radio {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .65rem 1.25rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  margin-bottom: 0;
}
.radio input { accent-color: var(--blue); width: 1rem; height: 1rem; margin: 0; }
.radio:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-tint);
  color: var(--blue-dark);
  font-weight: 600;
}
.radio:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--blue-focus); }

.disclaimer {
  font-size: .85rem;
  color: #9AA0A6;
  margin-top: 1.5rem;
  margin-bottom: 0;
  text-align: center;
}

/* ---------- Result panel ---------- */
.result-panel {
  margin-top: 1.75rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.result-panel[hidden] { display: none; }
.result-panel.pop { animation: pop-in .35s ease; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.result-body { margin-bottom: 1.25rem; }
.result-score {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--blue);
  line-height: 1.1;
  margin-bottom: .5rem;
}
.result-grade { margin-bottom: 1rem; display: inline-block; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .8rem .25rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row .k { color: var(--muted); font-size: .95rem; }
.stat-row .v { font-weight: 600; color: var(--text); text-align: right; }

.pill {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: .3rem .9rem;
}
.pill-gold { background: var(--gold-bg); color: var(--gold-text); }

/* ---------- How it works / related ---------- */
.how-it-works { padding: 4rem 0; }
.how-it-works .hiw-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 2.5rem;
  max-width: var(--container-narrow);
  margin-inline: auto;
}
.how-it-works h2 { text-align: center; margin-bottom: 1.5rem; }
.how-it-works p:last-child { margin-bottom: 0; }
.how-it-works ul { margin: 0 0 1.25rem 1.25rem; color: var(--muted); }
.how-it-works li { margin-bottom: .6rem; }
.how-it-works li strong, .how-it-works p strong { color: var(--text); }

.related { padding: 0 0 5rem; }
.related h2 { text-align: center; margin-bottom: 2rem; }
.related .tools-grid { grid-template-columns: repeat(3, 1fr); }
.mini-card {
  display: block;
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
}
.mini-card:nth-child(3n+1) { background: var(--blue-tint); }
.mini-card:nth-child(3n+2) { background: var(--tint-lavender); }
.mini-card:nth-child(3n+3) { background: var(--tint-mint); }
.mini-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-card); }
.mini-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.mini-card p { font-size: .9rem; margin-bottom: 0; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 90;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--blue-tint); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(60, 64, 67, .12);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .main-nav.open { max-height: 320px; }
  .main-nav a {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-soft);
    font-size: 1rem;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 640px) {
  .container { padding-inline: 1.25rem; }
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 3.5rem 0; }
  .tools-grid, .steps-grid, .related .tools-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .form-grid { grid-template-columns: 1fr; }
  .calc-card { padding: 1.5rem; }
  .calc-band-inner { padding: 2rem 1rem; border-radius: var(--radius); }
  .how-it-works .hiw-card { padding: 1.5rem; }
  .cta-panel { padding: 2.5rem 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .result-score { font-size: 2.75rem; }
  .trust-row { gap: .5rem 1rem; font-size: .88rem; }
  .tab-list { flex-wrap: wrap; }
  .tab-btn { font-size: .85rem; }
}

/* ---------- Tabs (sleep calculator) ---------- */
.tab-list {
  display: flex;
  gap: .5rem;
  background: var(--bg-alt);
  border-radius: 12px;
  padding: .35rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  flex: 1;
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: .7rem .5rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: var(--shadow-soft);
}
.tab-hint { font-size: .95rem; margin-bottom: 1.25rem; }
.tab-panel[hidden] { display: none; }

/* ---------- Hints, tips lists, size tables ---------- */
.hint {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-top: .4rem;
}
.tips-list { margin: 0 0 1.25rem 1.25rem; color: var(--muted); }
.tips-list li { margin-bottom: .7rem; }
.tips-list li strong { color: var(--text); }
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.size-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.size-table caption {
  font-weight: 700;
  color: var(--text);
  text-align: left;
  padding: .9rem 1rem;
  background: var(--blue-tint);
  caption-side: top;
}
.size-table th, .size-table td {
  padding: .7rem 1rem;
  text-align: left;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
}
.size-table thead th {
  background: var(--bg-alt);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-top: 0;
}
.size-table tbody tr:nth-child(even) { background: var(--bg-alt); }
.size-table tbody td:first-child { color: var(--text); font-weight: 600; }

/* ---------- Misc card helpers ---------- */
.card-title { font-size: 1.35rem; margin-bottom: 1.25rem; }
.field-action { display: flex; align-items: flex-end; }
.field-action .btn { width: 100%; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Baby gender predictor ---------- */
.gender-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.gender-card.girl { background: #FCE4EC; }
.gender-card.boy { background: #E3F2FD; }
.gender-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .75rem; }
.gender-title { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.gender-card.girl .gender-title { color: #C2185B; }
.gender-card.boy .gender-title { color: #1565C0; }
.gender-sub { color: var(--muted); font-size: .9rem; margin-top: .25rem; margin-bottom: 0; }
.chance-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chance-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem 1.1rem;
  text-align: center;
  background: #fff;
}
.chance-box strong { display: block; font-size: 1.3rem; margin-bottom: .15rem; }
.chance-box span:last-child { color: var(--muted); font-size: .85rem; }
.chance-box.winner { border-color: var(--blue); background: var(--blue-tint); box-shadow: var(--shadow-soft); }
.chart-badge {
  position: absolute;
  top: -.72rem; left: 50%;
  transform: translateX(-50%);
  background: var(--blue); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .22rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Period & ovulation calendar ---------- */
.pd-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.pd-chip { background: var(--blue-tint); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.pd-chip .k {
  display: block; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin-bottom: .2rem;
}
.pd-chip .v { font-weight: 700; }
.pd-cal { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem; background: #fff; }
.pd-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.pd-cal-head strong { font-size: 1.1rem; letter-spacing: -.01em; }
.pd-nav {
  width: 2.5rem; height: 2.5rem; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-size: 1.4rem; line-height: 1;
  cursor: pointer;
}
.pd-nav:hover { border-color: var(--blue); background: var(--blue-tint); }
.pd-weekdays, .pd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pd-weekdays { margin-bottom: 4px; }
.pd-weekdays span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: .25rem 0; }
.pd-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; border-radius: 8px; color: var(--text);
}
.pd-blank { visibility: hidden; }
.pd-period { background: #FADBD8; color: #B3261E; font-weight: 600; }
.pd-ov { background: var(--blue); color: #fff; font-weight: 700; }
.pd-high { background: #FDEFC3; color: #7A4A00; font-weight: 600; }
.pd-low { color: var(--muted); }
.pd-today { outline: 2px solid var(--blue); outline-offset: -2px; }
.pd-legend {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .5rem .75rem; margin-top: 1rem;
  font-size: .85rem; color: var(--muted);
}
.pd-leg { display: inline-flex; align-items: center; gap: .4rem; }
.pd-legend .dot { color: var(--border); }
.sw { width: .9rem; height: .9rem; border-radius: 4px; display: inline-block; flex: none; }
.sw-period { background: #FADBD8; }
.sw-low { background: var(--border-soft); }
.sw-high { background: #FDEFC3; }
.sw-ov { background: var(--blue); }

@media (max-width: 560px) {
  .pd-chips { grid-template-columns: 1fr; }
  .pd-day { font-size: .72rem; border-radius: 6px; }
  .pd-cal { padding: .75rem; }
  .gender-title { font-size: 1.6rem; }
}

/* ---------- Try-on viewer ---------- */
.tryon { margin: 1.5rem auto 0; max-width: 340px; }
.tryon-tabs { justify-content: center; margin-bottom: .75rem; }
.tryon-stage { position: relative; background: var(--blue-tint); border-radius: var(--radius); padding: 1rem .5rem .5rem; }
.tryon-stage svg { display: block; width: 100%; max-width: 290px; height: auto; margin: 0 auto; }
.tryon-badge { position: absolute; top: .9rem; left: 50%; transform: translateX(-50%); background: #fff; box-shadow: var(--shadow-soft); white-space: nowrap; }
.tryon-note { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }

/* ---------- Color swatches ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch { position: relative; cursor: pointer; margin: 0; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .sw-dot { display: block; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border); transition: transform .15s ease, box-shadow .15s ease; }
.swatch input:checked + .sw-dot { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--blue); transform: scale(1.08); }
.swatch input:focus-visible + .sw-dot { box-shadow: 0 0 0 3px var(--blue-focus); }

/* ---------- Bikini type option cards ---------- */
.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .75rem; }
.type-card { position: relative; margin: 0; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-card .tc-body { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .9rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; transition: border-color .15s ease, background .15s ease; text-align: center; height: 100%; box-sizing: border-box; }
.type-card .tc-body svg { width: 44px; height: 44px; color: var(--blue-dark); }
.type-card .tc-name { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.type-card input:checked + .tc-body { border-color: var(--blue); background: var(--blue-tint); box-shadow: var(--shadow-soft); }
.type-card input:focus-visible + .tc-body { box-shadow: 0 0 0 3px var(--blue-focus); }

/* ---------- Tip line ---------- */
.tip-line { margin-top: 1rem; font-size: .9rem; color: var(--text); background: var(--gold-bg); border-radius: var(--radius); padding: .9rem 1rem; text-align: left; margin-bottom: 0; }

@media (max-width: 560px) {
  .tryon { max-width: 300px; }
  .type-cards { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .6rem; }
}

/* ---------- 3D try-on viewer (Three.js) ---------- */
.tryon3d-stage { position: relative; height: 440px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #EAF3FE 0%, #F8F9FA 78%); touch-action: pan-y; }
.tryon3d-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.tryon3d-stage canvas:active { cursor: grabbing; }
.tryon3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(100deg, #EAF3FE 30%, #F3F7FD 50%, #EAF3FE 70%); background-size: 200% 100%;
  animation: tryon3d-shimmer 1.4s linear infinite; color: var(--muted); font-size: .9rem; }
@keyframes tryon3d-shimmer { to { background-position: -200% 0; } }
@media (max-width: 560px) { .tryon3d-stage { height: 380px; } }
@media (prefers-reduced-motion: reduce) { .tryon3d-loading { animation: none; } }

/* ---------- 18+ notice (sex / penis calculators) ---------- */
.age-notice {
  display: inline-block;
  margin-top: .75rem;
  padding: .5rem .9rem;
  background: var(--gold-bg);
  color: var(--gold-text);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .9rem;
}

/* ---------- Print: results only ---------- */
@media print {
  .site-header, .site-footer, .back-to-top, .tool-search, .search-wrap,
  .tryon, .tryon3d-stage, .breadcrumb, .related, .faq { display: none !important; }
  body { background: #fff; color: #000; }
  .result-panel, .calc-card, .hiw-card { box-shadow: none !important; border: 1px solid #000; color: #000; background: #fff !important; }
  a { color: #000; text-decoration: underline; }
}
