/* Ovulation Calculator shared design system */
:root {
  --bg: #fff8f5;
  --surface: #ffffff;
  --surface-soft: #fff1ec;
  --ink: #29233d;
  --muted: #6d6577;
  --rose: #d94d79;
  --rose-dark: #8f234c;
  --lavender: #efe8fa;
  --peach: #ffe5dc;
  --gold: #f6b24f;
  --line: #eadde0;
  --focus: #8b3158;
  --shadow: 0 18px 45px rgb(73 37 58 / 8%);
  color-scheme: light dark;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--bg); }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--rose-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 20; padding: 10px 14px; border-radius: 8px; color: #fff; background: var(--rose-dark); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.breadcrumb { display: flex; gap: 9px; margin-bottom: 24px; color: var(--muted); font-size: .9rem; }
.breadcrumb a { color: var(--rose-dark); }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px max(20px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 248 245 / 92%);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: .94rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"], .text-link { color: var(--rose-dark); }
.site-nav button, .menu-toggle { font: inherit; }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 8px; color: var(--ink); background: transparent; cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.theme-toggle:hover { background: var(--lavender); }
.menu-toggle { display: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--ink); background: var(--surface); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 450px); gap: clamp(32px, 7vw, 72px); align-items: center; padding: 76px 0 70px; }
.hero h1, .article h1 { margin: 12px 0 20px; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.02; letter-spacing: -.055em; }
.article { max-width: 780px; padding-top: 72px; padding-bottom: 72px; }
.article h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
.article h2 { margin-top: 2.2em; }
.article p, .article li { max-width: 68ch; }
.article > ul, .article > ol { margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.article > ul li, .article > ol li { position: relative; margin: .55rem 0; padding: .8rem 1rem .8rem 2.65rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.article > ul li::before { content: ""; position: absolute; top: 1.15rem; left: 1rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 4px var(--peach); }
.article > ol { counter-reset: article-list; }
.article > ol li { counter-increment: article-list; }
.article > ol li::before { content: counter(article-list); position: absolute; top: .65rem; left: .7rem; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; color: var(--on-accent); background: var(--accent); font-size: .78rem; font-weight: 800; }
.article-toc { position: relative; isolation: isolate; overflow: hidden; margin: 2.5rem 0 3.25rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid color-mix(in srgb, var(--rose) 28%, var(--line)); border-radius: 22px; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%); box-shadow: 0 16px 42px rgb(73 37 58 / 9%); }
.article-toc::before { content: ""; position: absolute; z-index: -1; top: -4.5rem; right: -3.5rem; width: 13rem; aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--rose) 20%, transparent); border-radius: 50%; box-shadow: 0 0 0 18px color-mix(in srgb, var(--rose) 5%, transparent), 0 0 0 38px color-mix(in srgb, var(--rose) 4%, transparent); }
.article-toc h2#toc-heading { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.25rem; font-size: clamp(1.35rem, 2.5vw, 1.7rem); letter-spacing: -.025em; }
.article-toc h2#toc-heading::before { content: ""; width: .3rem; height: 1.5em; border-radius: 99px; background: linear-gradient(var(--rose), var(--accent)); }
.article > ul.toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0; padding: 0; list-style: none; counter-reset: toc-entry; }
.article > ul.toc-list li { min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; counter-increment: toc-entry; }
.article > ul.toc-list li::before { display: none; }
.article > ul.toc-list a { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: .65rem; min-height: 3.3rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: .94rem; font-weight: 650; line-height: 1.35; text-decoration: none; transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.article > ul.toc-list a::before { content: counter(toc-entry, decimal-leading-zero); display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 9px; color: var(--rose-dark); background: var(--peach); font-size: .72rem; font-variant-numeric: tabular-nums; font-weight: 850; }
.article > ul.toc-list a:hover { transform: translateY(-2px); border-color: var(--rose); background: var(--surface); box-shadow: 0 8px 18px rgb(73 37 58 / 8%); }
.article > ul.toc-list a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.article h2[id] { scroll-margin-top: 100px; }
.article strong { color: var(--rose-dark); font-weight: 800; }
.article em { text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: .08em; text-underline-offset: .18em; }
.article u { text-decoration-color: var(--rose); text-decoration-thickness: .12em; text-underline-offset: .2em; }
.article table { display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; border-spacing: 0; background: var(--surface); }
.article table caption { padding: .9rem 1rem; color: var(--muted); font-weight: 750; text-align: left; }
.article table th, .article table td { min-width: 9rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
.article table th { color: var(--rose-dark); background: var(--surface-soft); font-size: .9rem; font-weight: 800; }
.article table tr:last-child td { border-bottom: 0; }
.article table tbody tr:nth-child(even) { background: var(--surface-soft); }
.article table tbody tr:hover { background: var(--lavender); }
.eyebrow, .card-label { margin: 0; color: var(--rose-dark); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.lede { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.2rem; }
.hero-art { width: 100%; margin-top: 22px; }

.calculator-card, .result-summary, .cycle-card { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.calculator-card { padding: 30px; }
.calculator-card h2 { margin: 5px 0 22px; }
label { display: grid; gap: 7px; margin: 16px 0; font-weight: 650; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d9cbd0; border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; min-height: 18px; accent-color: var(--rose); }
.form-status { min-height: 1.6em; color: var(--rose-dark); }
.privacy-note { margin: 15px 0 0; color: var(--muted); font-size: .86rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 17px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--rose); background: var(--surface-soft); }
.button--primary { border-color: var(--rose-dark); color: #fff; background: var(--rose-dark); }
.button--primary:hover { border-color: var(--rose-dark); background: var(--rose-dark); }
.button--quiet { border-color: transparent; color: var(--muted); background: transparent; }
.install-button { margin-top: 12px; }
.install-hint { color: var(--muted); font-size: .8rem; }

.results { padding-bottom: 74px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { margin: 4px 0; }
.result-summary { padding: 28px; }
.results #calendar-view { margin-top: 20px; }
.summary-kicker { color: var(--muted); font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.summary-grid > div { padding: 14px; border-radius: 14px; background: var(--lavender); }
.summary-grid span, .date-list dt { display: block; color: var(--muted); font-size: .86rem; }
.summary-grid strong { display: block; margin-top: 4px; }
.notice { padding: 12px 15px; border-left: 4px solid var(--gold); background: var(--surface-soft); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 24px; }
.cycle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cycle-card { padding: 22px; box-shadow: none; }
.cycle-card__heading { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-weight: 800; }
.cycle-card__month { color: var(--muted); font-weight: 500; }
.date-list { margin: 14px 0 0; }
.date-list div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.date-list dd { margin: 0; text-align: right; font-weight: 700; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-bottom: 56px; }
.content-section { padding-bottom: 56px; }
.toc { margin-bottom: 64px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.toc .eyebrow { margin-bottom: 10px; }
.toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; margin: 0; padding-left: 22px; }
.toc li { padding-left: 4px; }
.article-content { max-width: 800px; }
.article-section { scroll-margin-top: 100px; margin-bottom: 64px; }
.article-section h2 { margin-top: 0; }
.article-section h3 { margin-top: 28px; }
.article-section p, .article-section li { max-width: 72ch; }
.article-section .data-table { overflow-x: auto; }
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.hub-card { display: flex; flex-direction: column; gap: 7px; min-height: 130px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
.hub-card:hover { border-color: var(--rose); transform: translateY(-2px); }
.hub-card strong { color: var(--rose-dark); }
.hub-card span { color: var(--muted); font-size: .9rem; }
.data-table { margin-top: 12px; }
.data-table th, .data-table td { text-align: left; vertical-align: top; }
.data-table caption { padding: 0 0 8px; color: var(--muted); font-size: .9rem; font-weight: 700; text-align: left; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.faq-list summary { cursor: pointer; font-weight: 750; }
.content-grid article { padding: 28px; border-radius: 20px; background: var(--lavender); }
.content-grid article + article { background: var(--peach); }
.disclaimer { margin-bottom: 64px; padding: 18px 20px; border-left: 4px solid var(--rose); color: var(--muted); background: var(--surface-soft); }
.site-footer { display: flex; justify-content: space-between; gap: 32px; padding: 34px max(20px, calc((100% - 1120px) / 2)); border-top: 1px solid var(--line); color: var(--muted); }
.site-footer p { margin: 8px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 22px; align-content: flex-start; }
.footer-links a, .site-footer > a { color: var(--muted); text-decoration: none; }

table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; }
th { color: var(--muted); font-size: .8rem; }
td span { display: grid; place-items: center; min-height: 34px; border-radius: 50%; }
td.period span { color: var(--rose-dark); background: var(--peach); }
td.fertile span { background: var(--lavender); }
td.ovulation span { color: var(--on-accent); background: var(--accent); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 18px; color: var(--muted); font-size: .86rem; }
.calendar-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; border-radius: 50%; vertical-align: -1px; background: var(--lavender); }
.calendar-legend i.period { background: var(--peach); }
.calendar-legend i.ovulation { background: var(--rose); }

html[data-theme="dark"] { --bg: #201c2a; --surface: #2a2536; --surface-soft: #352535; --ink: #f8eef1; --muted: #d0c5d1; --line: #55485b; --lavender: #403653; --peach: #55363e; --rose: #f0749d; --rose-dark: #ffb0c9; --focus: #ffd1df; --shadow: 0 18px 45px rgb(0 0 0 / 24%); }
html[data-theme="light"] { --accent: #8f234c; --on-accent: #fff; color-scheme: light; }
html[data-theme="dark"] { --accent: #f0749d; --on-accent: #201c2a; color-scheme: dark; }
html[data-theme="dark"] .site-header { background: rgb(32 28 42 / 92%); }
html[data-theme="dark"] input, html[data-theme="dark"] select { border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { --bg: #201c2a; --surface: #2a2536; --surface-soft: #352535; --ink: #f8eef1; --muted: #d0c5d1; --line: #55485b; --lavender: #403653; --peach: #55363e; --rose: #f0749d; --rose-dark: #ffb0c9; --accent: #f0749d; --on-accent: #201c2a; --focus: #ffd1df; --shadow: 0 18px 45px rgb(0 0 0 / 24%); }
  html:not([data-theme="light"]) .site-header { background: rgb(32 28 42 / 92%); }
  html:not([data-theme="light"]) input, html:not([data-theme="light"]) select { border-color: var(--line); }
}

@media (max-width: 760px) {
  .site-header { padding-block: 12px; }
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; right: 20px; left: 20px; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
  .site-nav[data-open] { display: flex; }
  .site-nav a, .site-nav button { padding: 10px; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero h1, .article h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .field-row, .summary-grid, .cycle-grid, .content-grid, .hub-grid, .toc ol { grid-template-columns: 1fr; }
  .toc { padding: 20px; }
  .article-toc { margin-block: 2rem 2.5rem; border-radius: 18px; }
  .article > ul.toc-list { grid-template-columns: 1fr; gap: .5rem; }
  .article-section { margin-bottom: 48px; }
  .article-section .data-table { display: block; overflow-x: auto; white-space: normal; }
  .site-footer { flex-direction: column; }
}
@media print {
  .site-header, .site-footer, .hero, .toc, .article-content, .result-actions, .content-grid { display: none !important; }
  body, .results, .container { width: 100%; margin: 0; padding: 0; color: #000; background: #fff; }
  .result-summary, .cycle-card { box-shadow: none; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
