/*
 * FERTILE: the tool's own components, styled in the site's design language (7 Oct 2026, on the UltraCompress Pro template,
 * after the Life Discipline Tracker). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle,
 * focus rings) and /libs/shared-nav.css (the site's header and footer). This file holds only what the tool itself needs:
 * the fertility colours (period red, three greens for the fertile window, the ovulation green), the toolbar with the status
 * pill and the pill tabs, the dashboard's cycle ring, week view and event lists, the month calendar and its legend, the Log
 * card with its segmented tabs, choice buttons, symptom grid, mucus scale and tables, the Insights tiles, chart boxes and
 * due-date result, the Settings switches, PIN rows and share box, the windows, toasts, the information sections and a print
 * sheet for the Insights report. Light is the default; dark applies when <html> has no data-theme.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --ok: #166534; --warn: #92400e; --bad: #b91c1c;
    --period: #ef4444; --period-dim: rgba(239, 68, 68, 0.16); --period-text: #b91c1c;
    --ovulation: #15803d; --ovulation-dim: rgba(21, 128, 61, 0.18);
    --fertile-high: #86efac; --fertile-medium: #bbf7d0; --fertile-low: #dcfce7; --fertile-text: #14532d;
    --predicted-edge: #9ca3af;
    --peak: #15803d; --high: #16a34a; --medium: #65a30d; --low: #a16207; --safe: #6b7280;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
    --period: #f87171; --period-dim: rgba(248, 113, 113, 0.22); --period-text: #fca5a5;
    --ovulation: #4ade80; --ovulation-dim: rgba(74, 222, 128, 0.22);
    --fertile-high: rgba(74, 222, 128, 0.5); --fertile-medium: rgba(74, 222, 128, 0.32); --fertile-low: rgba(74, 222, 128, 0.16); --fertile-text: #dcfce7;
    --predicted-edge: #6b7280;
    --peak: #4ade80; --high: #4ade80; --medium: #a3e635; --low: #fbbf24; --safe: #9ca3af;
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- Tools back link above the header, as on every other tool ----- */
body { padding-top: 0; }
.back-bar { height: 48px; display: flex; align-items: center; padding: 0 var(--zdu-gutter, 24px); }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: calc(90px + var(--bar-offset, 48px)); }
@media (max-width: 768px) { .theme-toggle { top: calc(75px + var(--bar-offset, 48px)); } }
.hidden-input { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }
.app-note { margin: -1.5rem 0 2.5rem; font-size: 0.85rem; color: var(--text-3); line-height: 1.55; max-width: 70ch; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm { padding: 8px 15px; }
.btn-icon.btn-sm { width: 38px; height: 38px; padding: 0; }
.btn-icon.btn-sm svg { width: 17px; height: 17px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-stack--top { margin-top: 14px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 200px; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); }
.status-sub { font-size: 0.72rem; color: var(--text-3); }
.header-date { display: flex; flex-direction: column; line-height: 1.2; }
.date-day { font-weight: 700; font-size: 0.9rem; color: var(--text-strong); }
.date-full { font-size: 0.78rem; color: var(--text-3); }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; overflow-x: auto; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.app-shell.is-shared .app-toolbar .toolbar-right { display: none; }

/* ----- Cards ----- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.card-grid:last-child { margin-bottom: 0; }
.card--wide { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-note { font-size: 0.8125rem; color: var(--text-3); }
.card-body { padding: 16px 20px 20px; flex: 1; }
.card-text { color: var(--text-2); margin: 0 0 14px; line-height: 1.55; font-size: 0.95rem; }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }
.mini-title { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin: 0 0 10px; }
.eyebrow { margin: 0 0 4px; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }

/* ----- Dashboard: cycle ring and fertility ----- */
.overall-body { display: flex; align-items: center; gap: 28px; }
.overall-ring { position: relative; width: 180px; height: 180px; flex-shrink: 0; }
.overall-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-progress { fill: none; stroke: url(#cycleGradient); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.overall-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.overall-number { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 3rem; font-weight: 700; line-height: 1; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 2px 0; }
.overall-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.overall-text { min-width: 0; }
.overall-text h2 { margin: 0 0 4px; font-size: 1.5rem; }
.overall-text p { margin: 0 0 12px; color: var(--text-2); }
.fert-chance { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong) !important; }
.fert-chance:empty { display: none; }
.fert-status[data-status="peak"], .fert-status[data-status="high"] { color: var(--high); }
.fert-status[data-status="medium"] { color: var(--medium); }
.fert-status[data-status="low"], .fert-status[data-status="safe"] { color: var(--low); }
.fert-status[data-status="period"] { color: var(--period-text); }
.fert-status[data-status="late"] { color: var(--warn); }
.streak-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.streak-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9999px; background: var(--chip); border: 1px solid var(--chip-border); font-size: 0.82rem; font-weight: 600; color: var(--text-strong); }
.streak-chip.is-muted { font-weight: 500; color: var(--text-2); }

/* ----- Week view ----- */
.week-view { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; border-radius: 12px; background: var(--surface-2); color: var(--text); min-width: 0; }
.week-day .wd-name { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.week-day .wd-num { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.week-day .wd-chance { font-size: 0.68rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.week-day.is-today { outline: 2px solid var(--brand); outline-offset: -2px; }
.week-day.fertile-low { background: var(--fertile-low); color: var(--fertile-text); }
.week-day.fertile-medium { background: var(--fertile-medium); color: var(--fertile-text); }
.week-day.fertile-high { background: var(--fertile-high); color: var(--fertile-text); }
.week-day.ovulation { background: var(--ovulation); color: #fff; }
.week-day.period { background: var(--period-dim); color: var(--period-text); }
.week-day.fertile-low .wd-name, .week-day.fertile-medium .wd-name, .week-day.fertile-high .wd-name, .week-day.fertile-low .wd-chance, .week-day.fertile-medium .wd-chance, .week-day.fertile-high .wd-chance, .week-day.period .wd-name, .week-day.period .wd-chance { color: inherit; opacity: 0.8; }
.week-day.ovulation .wd-name, .week-day.ovulation .wd-chance { color: #fff; opacity: 0.85; }

/* ----- Event and recent lists ----- */
.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.9rem; }
.event-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; width: 28px; text-align: center; }
.event-text { flex: 1; min-width: 0; color: var(--text); line-height: 1.35; }
.event-text small { display: block; color: var(--text-3); font-size: 0.78rem; }
.event-value { font-weight: 700; color: var(--link); flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: 0.85rem; text-align: right; }
.event-item.is-reminder { background: var(--tint-brand); border: 1px solid var(--tint-brand-border); }
.event-item.is-period .event-value { color: var(--period-text); }
.event-item.is-ovulation .event-value { color: var(--ovulation); }
.event-empty { color: var(--text-3); font-size: 0.9rem; margin: 0; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--chip-border); background: var(--surface); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); }
.icon-btn.is-danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Quick log ----- */
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--surface-border); background: var(--surface-2); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-strong); cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.quick-btn span { font-size: 1.4rem; line-height: 1; }
.quick-btn:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--link); }
.quick-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Calendar ----- */
.month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.month-label { font-weight: 700; min-width: 140px; text-align: center; color: var(--text-strong); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; font-size: 0.72rem; text-align: center; color: var(--text-3); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day { position: relative; aspect-ratio: 1; border-radius: 10px; border: 0; padding: 0; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.cal-day:hover { transform: translateY(-2px); box-shadow: var(--surface-shadow); }
.cal-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cal-day.is-static { cursor: default; }
.cal-day.is-static:hover { transform: none; box-shadow: none; }
.cal-day.other-month { background: transparent; color: var(--text-3); font-weight: 400; cursor: default; }
.cal-day.other-month:hover { transform: none; box-shadow: none; }
.cal-day.is-today { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-day.is-selected { box-shadow: 0 0 0 3px var(--ring); }
.cal-day.period { background: var(--period); color: #fff; }
.cal-day.period.flow-light { background: var(--period-dim); color: var(--period-text); }
.cal-day.fertile-low { background: var(--fertile-low); color: var(--fertile-text); }
.cal-day.fertile-medium { background: var(--fertile-medium); color: var(--fertile-text); }
.cal-day.fertile-high { background: var(--fertile-high); color: var(--fertile-text); }
.cal-day.ovulation { background: var(--ovulation); color: #fff; }
.cal-day.predicted { box-shadow: inset 0 0 0 2px var(--predicted-edge); background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, 0.35) 6px 8px); }
.cal-day.predicted.period { background-color: var(--period-dim); color: var(--period-text); box-shadow: inset 0 0 0 2px var(--period); }
.cal-day.predicted.fertile-low, .cal-day.predicted.fertile-medium, .cal-day.predicted.fertile-high { box-shadow: inset 0 0 0 2px var(--high); }
.cal-day.predicted.ovulation { box-shadow: inset 0 0 0 2px var(--ovulation); }
.cal-day .dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.cal-day.ovulation .dot, .cal-day.period:not(.flow-light):not(.predicted) .dot { background: #fff; }
.cal-day .dot.dot-2 { transform: translateX(-50%) translateX(-4px); }
.cal-day .dot.dot-3 { transform: translateX(-50%) translateX(4px); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 0.8rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.legend-swatch.period { background: var(--period); }
.legend-swatch.fertile { background: var(--fertile-medium); }
.legend-swatch.ovulation { background: var(--ovulation); }
.legend-swatch.predicted { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--predicted-edge); }
.legend-swatch.logged { background: var(--surface-2); position: relative; }
.legend-swatch.logged::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--brand); }

/* ----- Log ----- */
.log-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; overflow-x: auto; }
.log-tab { padding: 7px 14px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease; }
.log-tab:hover { color: var(--link); }
.log-tab.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--surface-shadow); }
.log-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.log-panel[hidden] { display: none; }
.log-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; }
.log-form, .log-list { min-width: 0; }
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.form-input { width: 100%; min-width: 0; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.form-input::placeholder { color: var(--placeholder); }
textarea.form-input { resize: vertical; min-height: 60px; }
select.form-input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
select.form-input option { color: #0a0a14; background: #fff; }
.select-sm { width: auto; padding: 8px 32px 8px 14px; font-size: 0.85rem; border-radius: 9999px; font-weight: 600; }
.form-error { margin: 0 0 10px; font-size: 0.8rem; color: var(--danger); }
.form-error:empty { display: none; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.choice-btn:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.choice-btn[aria-checked="true"], .choice-btn[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.choice-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-icon { font-size: 1rem; line-height: 1; letter-spacing: -0.15em; }
.symptom-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.symptom-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.75rem; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: center; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.symptom-btn span:first-child { font-size: 1.4rem; line-height: 1; }
.symptom-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.symptom-btn[aria-pressed="true"] { background: var(--tint-brand); border-color: var(--brand); color: var(--link); }
.symptom-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mucus-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mucus-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; color: var(--text-2); cursor: pointer; text-align: center; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.mucus-option .m-icon { font-size: 1.5rem; line-height: 1; color: var(--brand); }
.mucus-option .m-name { font-size: 0.82rem; font-weight: 700; color: var(--text-strong); }
.mucus-option .m-fert { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.mucus-option .m-hint { font-size: 0.72rem; line-height: 1.35; color: var(--text-3); }
.mucus-option:hover { border-color: var(--brand); transform: translateY(-1px); }
.mucus-option[aria-checked="true"] { background: var(--tint-brand); border-color: var(--brand); }
.mucus-option:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.brand-range { width: 100%; height: 6px; border-radius: 3px; appearance: none; -webkit-appearance: none; background: linear-gradient(to right, #8B5CF6 0%, #EC4899 var(--fill, 44%), var(--surface-2) var(--fill, 44%)); outline: none; margin: 8px 0 4px; }
.brand-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #8B5CF6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); cursor: pointer; }
.brand-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #8B5CF6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); cursor: pointer; }
.brand-range:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.range-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-3); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th { text-align: left; padding: 8px 10px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); border-bottom: 1px solid var(--surface-border); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--surface-border); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.data-table .muted { color: var(--text-3); }
.data-table .is-current td { background: var(--tint-brand); }

/* ----- Insights ----- */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); min-width: 0; }
.stat-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1.1; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 700; font-size: 0.9rem; color: var(--text-strong); }
.stat-sub { font-size: 0.75rem; color: var(--text-3); }
.chart-box { position: relative; height: 300px; }
.chart-box--short { height: 180px; margin-bottom: 14px; }
.chart-note { margin: 12px 0 0; font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }
.chart-note:empty { display: none; }
.due-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--surface-border); }
.due-result[hidden] { display: none; }
.due-date { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.6rem; font-weight: 700; margin: 0 0 12px; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.due-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.due-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.due-grid strong { font-size: 0.9rem; color: var(--text-strong); }
.xp-progress-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.xp-progress-fill { height: 100%; width: 0; border-radius: 5px; background: var(--gradient-brand); transition: width 0.5s ease; }
.xp-progress-text { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ----- Settings ----- */
.card-grid--three .card { grid-column: auto; }
.switch-list { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--surface-border); }
.switch-list .switch-row:last-child { border-bottom: 0; }
.switch-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font-weight: 600; font-size: 0.92rem; color: var(--text-strong); }
.switch-hint { font-size: 0.75rem; color: var(--text-3); }
.toggle { position: relative; width: 46px; height: 26px; flex-shrink: 0; border-radius: 9999px; border: 0; padding: 0; background: var(--chip-border); cursor: pointer; transition: background 0.2s ease; }
.toggle .toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.toggle[aria-checked="true"] { background: var(--gradient-brand); }
.toggle[aria-checked="true"] .toggle-knob { transform: translateX(20px); }
.toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.share-box { display: flex; gap: 8px; margin-top: 12px; }
.share-box[hidden] { display: none; }
.share-box .form-input { font-size: 0.8rem; }
.pin-row { display: flex; gap: 10px; justify-content: center; }
.pin-digit { width: 52px; height: 60px; text-align: center; font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.6rem; font-weight: 700; padding: 0; border-radius: 14px; }
.pin-digit::-webkit-outer-spin-button, .pin-digit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin-digit[type=number] { -moz-appearance: textfield; appearance: textfield; }
.lock-overlay .modal { max-width: 380px; }
body.is-locked .app-shell { visibility: hidden; }
.welcome-list { text-align: left; margin: 0; padding: 0 0 0 1.2rem; color: var(--text-2); font-size: 0.92rem; line-height: 1.5; }
.welcome-list li { margin-bottom: 8px; }
.welcome-list strong { color: var(--text-strong); }

/* ----- Windows ----- */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.lock-overlay { background: rgba(10, 10, 20, 0.86); backdrop-filter: blur(14px); z-index: 1100; }
.modal { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); width: 100%; max-width: 520px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; transform: translateY(12px); transition: transform 0.25s ease; }
.modal--narrow { max-width: 420px; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 1.15rem; }
.modal-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, color 0.2s ease; }
.modal-close:hover { border-color: var(--brand); color: var(--link); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-footer--center { justify-content: center; }
.confirm-message { margin: 0; color: var(--text); }
.result-body { text-align: center; }
.result-icon { font-size: 3.2rem; line-height: 1; margin-bottom: 8px; animation: pop 0.4s ease; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-message { color: var(--text-2); margin: 6px 0 14px; }

/* ----- Toasts ----- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast { background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 400px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast-icon { font-size: 1.1rem; line-height: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left-color: #4ade80; } .toast.error { border-left-color: #f87171; } .toast.warning { border-left-color: #fbbf24; } .toast.info { border-left-color: #38bdf8; }
.toast.leaving { opacity: 0; transform: translateX(40px); }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section > p { max-width: 70ch; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-section article:not(.info-card) p { color: var(--text-2); max-width: 70ch; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ----- Tablets ----- */
@media (max-width: 1023px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card--wide { grid-column: span 2; }
    .card-grid--three .card:last-child:nth-child(odd) { grid-column: span 2; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .log-columns { grid-template-columns: 1fr; gap: 20px; }
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-three { grid-template-columns: 1fr; }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-note { margin-top: -1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { flex: 1; min-width: 0; }
    .header-date { display: none; }
    .view-tabs { width: 100%; }
    .view-tab { flex: 1; padding: 8px 4px; font-size: 0.76rem; text-align: center; }
    .card-grid { grid-template-columns: 1fr; gap: 14px; }
    .card--wide, .card-grid--three .card:last-child:nth-child(odd) { grid-column: auto; }
    .card-header { padding-left: 16px; padding-right: 16px; }
    .card-body { padding: 14px 16px 16px; }
    .overall-body { flex-direction: column; text-align: center; gap: 16px; }
    .overall-ring { width: 150px; height: 150px; }
    .overall-number { font-size: 2.4rem; }
    .streak-badges { justify-content: center; }
    .week-view { gap: 4px; }
    .week-day { padding: 8px 1px; border-radius: 8px; }
    .week-day .wd-num { font-size: 1rem; }
    .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cal-grid, .cal-weekdays { gap: 4px; }
    .cal-day { font-size: 0.78rem; border-radius: 8px; }
    .month-label { min-width: 0; }
    .log-tabs { width: 100%; }
    .log-tab { flex: 1; padding: 7px 4px; font-size: 0.74rem; text-align: center; }
    .form-row, .form-row--three { grid-template-columns: 1fr; }
    .symptom-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mucus-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mucus-option:last-child { grid-column: span 2; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-tile { padding: 14px; }
    .stat-value { font-size: 1.6rem; }
    .chart-box { height: 240px; }
    .due-grid { grid-template-columns: 1fr; }
    .share-box { flex-direction: column; }
    .pin-digit { width: 46px; height: 54px; }
    .modal-overlay { padding: 8px; }
    .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
    .toast-container { bottom: 16px; right: 16px; left: 16px; align-items: flex-end; }
    .toast { min-width: 0; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .modal, .toast, .toggle .toggle-knob, .ring-progress, .xp-progress-fill, .result-icon, .cal-day, .choice-btn, .symptom-btn, .mucus-option, .quick-btn { transition: none; animation: none; }
}

/* ----- Print: the Insights report ----- */
@media print {
    .back-bar, header, .theme-toggle, .app-hero, .app-toolbar, .info-section, footer, .modal-overlay, .toast-container, .app-note, #zdu-cookie-banner { display: none !important; }
    body { background: #fff; color: #000; }
    .container.app-container { max-width: none; padding: 0; margin: 0; }
    .view { display: block !important; }
    .view[hidden] { display: none !important; }
    .card, .stat-tile { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .card-grid { display: block; }
    .card { margin-bottom: 14px; }
    .chart-box { height: 260px; }
    .btn, .form-group, .select-sm { display: none !important; }
    .stat-value, .due-date { color: #000; background: none; -webkit-text-fill-color: #000; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026) */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
    div#recentList.event-list > p.event-empty,
    div#upcomingList.event-list > p.event-empty,
    div.card-body > p.form-hint,
    main#main-content.container.app-container > p.app-note { font-size: 1rem; }
}
