/* ============================================================================
   Luna · Ciklusnaptár — "the quiet cycle calendar for two"
   The design system of the sister sites (Kedves · Curio): a dark, premium,
   softly-lit scene where every accent derives from a single hue --h — here the
   hue follows the CURRENT CYCLE PHASE (rose → mint → gold → violet).
   Bilingual (HU/EN). No build step, no framework — HTML, CSS and vanilla JS.
   All data lives on the visitor's device.
   ========================================================================== */

/* Self-hosted fonts (SIL OFL) — no third-party requests, the privacy promise holds */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* the live phase hue — a registered <number> so JS can tween it smoothly */
@property --h { syntax: '<number>'; inherits: true; initial-value: 348; }

:root {
  --h: 348;

  --bg:      #0c0d12;
  --bg-deep: #08090d;
  --bg-2:    #101119;
  --surface: #14151f;
  --surface-2: #191b26;

  --ink:    #ecebf2;
  --ink-2:  #c4c2cf;
  --muted:  #8b8898;
  --faint:  #828090;   /* AA-contrast floor on the card surfaces — dimmer than --muted, but readable */
  --hairline: rgba(236, 235, 242, 0.10);
  --hairline-2: rgba(236, 235, 242, 0.16);

  --heart:  #e5556b;

  /* the four phase hues (also assigned per-element from JS) */
  --hue-menstrual: 348;
  --hue-follicular: 152;
  --hue-ovulation: 38;
  --hue-luteal: 268;

  /* everything accent-y derives from the single hue --h */
  --accent:      hsl(var(--h) 68% 70%);
  --accent-2:    hsl(var(--h) 55% 62%);
  --accent-deep: hsl(var(--h) 60% 46%);
  --accent-dim:  hsl(var(--h) 40% 40%);
  --glow:        hsl(var(--h) 80% 60% / 0.28);
  --glow-soft:   hsl(var(--h) 75% 60% / 0.14);
  --wash:        hsl(var(--h) 60% 55% / 0.07);

  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-press: cubic-bezier(0.34, 1.4, 0.64, 1);

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* the phase hue (--h) is tweened in JS, not via a CSS transition:
     a CSS transition on a registered <number> property gets pinned to its
     initial-value in Chromium and never settles. */
}

* { box-sizing: border-box; }
html { height: 100%; }
/* the hidden attribute must always win, even over author display values */
[hidden] { display: none !important; }

body {
  margin: 0; min-height: 100svh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(130% 100% at 50% -10%, #14151d 0%, var(--bg) 46%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  opacity: 0;
  transition: opacity 800ms ease;
}
body.is-ready { opacity: 1; }

/* ---- slow ambient aurora, tinted by --accent ------------------------------ */
.aurora {
  position: fixed; inset: -20% -10% 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at 22% 28%, hsl(var(--h) 70% 55% / 0.22), transparent 70%),
    radial-gradient(34% 40% at 82% 72%, hsl(calc(var(--h) + 40) 65% 55% / 0.16), transparent 70%),
    radial-gradient(30% 34% at 65% 12%, hsl(calc(var(--h) - 35) 60% 55% / 0.12), transparent 70%);
  filter: blur(24px) saturate(1.05);
  opacity: 0.9;
  animation: aurora-drift 42s ease-in-out infinite;
  will-change: transform;
}
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(2.4vw, -1.6vh, 0) scale(1.06); }
  66%      { transform: translate3d(-1.8vw, 1.8vh, 0) scale(1.03); }
}

/* ---- fine paper grain ----------------------------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.045; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- giant moon glyph, bleeding off the corner ---------------------------- */
.glyph {
  position: fixed; right: -0.06em; bottom: -0.22em; z-index: 1; pointer-events: none;
  font-family: var(--font-serif); font-weight: 500; font-style: normal;
  font-size: 56vh; line-height: 0.8;
  color: hsl(var(--h) 45% 66% / 0.06);
  user-select: none; will-change: transform;
  animation: glyph-drift 50s ease-in-out infinite;
}
@keyframes glyph-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-1.2vmax, -0.8vmax) rotate(-3deg); }
}

/* ---- topbar --------------------------------------------------------------- */
.topbar {
  position: relative; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 15px clamp(16px, 4vw, 44px) 10px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  font-size: 18px;
  color: var(--accent);
  background: linear-gradient(160deg, hsl(var(--h) 45% 22% / 0.6), hsl(var(--h) 45% 14% / 0.35));
  border: 1px solid hsl(var(--h) 50% 60% / 0.28);
  box-shadow: 0 0 22px -6px var(--glow), inset 0 1px 0 rgba(255,255,255,0.08);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 18px; letter-spacing: 0.01em; color: var(--ink); }
.brand-tag  { font-family: var(--font-sans); font-weight: 400; font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

/* ---- tabs (view switcher) -------------------------------------------------- */
/* desktop: a floating segmented control under the brand · phones: a fixed,
   app-like bottom bar with stacked icon + label (see the media block below) */
.tabs {
  position: relative; z-index: 45;
  padding: 6px clamp(16px, 4vw, 44px) 14px;   /* no band, no veil, no shadow — the pill group stands alone */
}
.tabs-inner {
  position: relative;                     /* anchors the sliding pill */
  display: flex; gap: 4px; max-width: 980px; margin: 0 auto;
  border: 1px solid var(--hairline); border-radius: 999px; padding: 4px;
  background: rgba(236, 235, 242, 0.03);  /* the quiet unifying strip behind the pills */
}
/* the pill that glides behind the active tab (positioned from JS via CSSOM) */
.tab-slider {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; z-index: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px -6px var(--glow), inset 0 1px 0 rgba(255,255,255,0.25);
  /* transform/width only — a background transition on a var(--h) color sticks (see .tab note) */
}
.tab-slider.is-live { transition: transform 420ms var(--ease-soft), width 420ms var(--ease-soft); }
.tab {
  appearance: none; cursor: pointer; border: 0; background: transparent;
  position: relative; z-index: 1;
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--muted); font-family: var(--font-sans); font-weight: 600; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 9px 6px; border-radius: 999px; line-height: 1; white-space: nowrap;
  /* NO background/border/shadow transition on var(--h)-derived colors: while the
     hue tweens, such a transition gets stuck mid-value in Chromium ("the .tab note") */
  transition: color 260ms;
}
.tab-ico { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.45; margin: -0.2em 0; }  /* room for Á/Í accents inside the clip */
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: #14151f; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- views ---------------------------------------------------------------- */
.views {
  position: relative; z-index: 10;
  max-width: 980px; margin: 0 auto;
  padding: clamp(14px, 2.5vw, 24px) clamp(16px, 4vw, 44px) 60px;
}
.view { display: none; }
.view.is-active { display: block; animation: view-in 480ms var(--ease-soft); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
}

/* gentle staggered entrance for the Today hero (replays when the view returns) */
.hero > * { animation: rise-in 700ms var(--ease-soft) backwards; }
.hero > :nth-child(1) { animation-delay: 60ms; }
.hero > :nth-child(2) { animation-delay: 180ms; }
.hero > :nth-child(3) { animation-delay: 260ms; }
.hero > :nth-child(4) { animation-delay: 260ms; }
.hero > :nth-child(5) { animation-delay: 340ms; }
.today-topics { animation: rise-in 700ms var(--ease-soft) 430ms backwards; }

/* the wheel draws itself on arrival (segment delays come from JS via CSSOM) */
@keyframes seg-in { from { opacity: 0; } }
.wheel.is-anim .wheel-seg { animation: seg-in 480ms ease backwards; }
@keyframes marker-in { from { opacity: 0; transform: scale(0.4); } }
.wheel.is-anim .wheel-marker { animation: marker-in 500ms var(--ease-press) 600ms backwards; transform-box: fill-box; transform-origin: center; }
/* a quiet, endlessly breathing halo around today's dot */
@keyframes ring-pulse {
  0%   { opacity: 0.55; transform: scale(0.8); }
  70%  { opacity: 0;    transform: scale(1.9); }
  100% { opacity: 0;    transform: scale(1.9); }
}
.wheel-ring { animation: ring-pulse 3.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }

/* calendar cells cascade in on month change (delays from JS via CSSOM) */
@keyframes cell-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
.cal-grid.is-anim .cal-cell { animation: cell-in 380ms var(--ease-out) backwards; }

/* ---- generic card --------------------------------------------------------- */
.card {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: clamp(18px, 3vw, 26px);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
  background:
    linear-gradient(180deg, hsl(var(--h) 30% 12% / 0.28), rgba(20, 21, 31, 0.55)),
    var(--surface);
  border: 1px solid var(--hairline-2);
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 38px 70px -30px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
}
.card::before {  /* top accent hairline */
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--h) 68% 70% / 0.8), transparent);
  opacity: 0.55;
}
.card-title {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px;
  font-family: var(--font-serif); font-weight: 600; font-size: clamp(17px, 2.2vw, 20px); letter-spacing: 0.01em; color: var(--ink);
}
.card-title__emoji { font-size: 0.95em; line-height: 1; }
.card-subtitle {
  margin: 16px 0 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.card-body { margin: 0 0 8px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.card-body:last-child { margin-bottom: 0; }
.card-body--muted { color: var(--muted); }
.card-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.card-list li {
  position: relative; padding-left: 18px;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
}
.card-list li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 999px;
  background: hsl(var(--h) 62% 62% / 0.85);
}
.card-list--dim li { color: var(--muted); }
.card-list--dim li::before { background: var(--faint); }

/* today: one topic at a time */
.today-topics { max-width: 640px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 14px; }
.topics {
  display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap;
  overflow-x: auto; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topics::-webkit-scrollbar { display: none; }
.topic {
  appearance: none; cursor: pointer; font: inherit; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
  color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0.03em; white-space: nowrap;
  transition: color 200ms, transform 130ms var(--ease-out);   /* no bg/border transition — see .tab note */
}
.topic__emoji { font-size: 14px; line-height: 1; }
.topic:hover { color: var(--ink-2); }
.topic.is-active { color: var(--ink); border-color: hsl(var(--h) 55% 60% / 0.55); background: hsl(var(--h) 50% 40% / 0.16); }
.topic:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic:active { transform: scale(0.95); }

.topic-card { animation: view-in 420ms var(--ease-soft); }
.card-lead { margin-bottom: 14px; font-size: 13px; }

/* the calm one-liner + details-on-demand under the wheel */
.pred-line {
  max-width: 52ch; margin: 2px 0 0; text-align: center;
  font-family: var(--font-serif); font-weight: 500; font-size: clamp(15px, 2.2vw, 17.5px);
  line-height: 1.55; color: var(--ink-2); text-wrap: balance;
}
.disclose {
  appearance: none; cursor: pointer; background: transparent; border: 0;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--faint); font-family: var(--font-sans); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 8px; border-radius: 8px;
  transition: color 200ms;
}
.disclose:hover { color: var(--muted); }
.disclose:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.disclose svg { transition: transform 240ms var(--ease-out); }
.disclose.is-open svg { transform: rotate(180deg); }
.pred-detail { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pred-detail:not([hidden]) { animation: rise-in 420ms var(--ease-soft); }
.pred-note { max-width: 46ch; margin: 0; text-align: center; color: var(--faint); font-size: 11.5px; line-height: 1.6; letter-spacing: 0.02em; }

/* short explainer on top of a view */
.view-lead { max-width: 62ch; margin: 2px 2px 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---- onboarding ------------------------------------------------------------ */
.onboard { text-align: center; padding: clamp(28px, 5vw, 46px); }
.onboard-glyph { display: block; font-family: var(--font-serif); font-size: 44px; color: var(--accent); opacity: 0.7; margin-bottom: 10px; }
.onboard .card-title { justify-content: center; font-size: clamp(20px, 3vw, 26px); }
.onboard-text { max-width: 52ch; margin: 0 auto 20px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.onboard-row { display: flex; justify-content: center; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.onboard-hint { margin: 18px auto 0; max-width: 46ch; color: var(--faint); font-size: 11.5px; line-height: 1.6; letter-spacing: 0.02em; }

/* ---- hero: the cycle wheel ------------------------------------------------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.wheel-wrap { position: relative; width: min(320px, 78vw); }
.wheel { display: block; width: 100%; height: auto; }
.wheel-seg { transition: stroke 600ms var(--ease-out), opacity 600ms; }
.wheel-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; pointer-events: none;
}
.wheel-name {
  font-family: var(--font-serif); font-weight: 500; font-size: 14px; color: var(--accent); letter-spacing: 0.02em;
  min-height: 18px;
}
.wheel-label { font-family: var(--font-sans); font-weight: 600; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.wheel-num {
  font-family: var(--font-serif); font-weight: 600; font-size: 64px; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px var(--glow);
}
.phase-chip {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: hsl(var(--h) 45% 30% / 0.22);
  border: 1px solid hsl(var(--h) 55% 62% / 0.34);
  color: hsl(var(--h) 70% 76%);
  font-family: var(--font-sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
}
.phase-chip__emoji { font-size: 13px; line-height: 1; }

/* prediction pills */
.pred-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 640px; }
.pred {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 16px; border-radius: 13px;
  background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
}
.pred-k { font-family: var(--font-sans); font-weight: 600; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.pred-v { font-family: var(--font-serif); font-weight: 500; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pred-v .hi { color: var(--accent); }
.pred--late .pred-v .hi { color: #e8b04b; }

.quick-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---- buttons (shared with the sisters) ------------------------------------- */
.icon-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0; border-radius: 12px;
  background: rgba(236, 235, 242, 0.015); border: 1px solid var(--hairline); color: var(--muted);
  transition: color 200ms, border-color 200ms, background 200ms, transform 130ms var(--ease-out);
}
.icon-btn:hover { color: var(--ink-2); border-color: var(--hairline-2); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn--sm { width: 38px; height: 38px; border-radius: 10px; }

.btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 22px; border-radius: 12px; white-space: nowrap;
  font-family: var(--font-sans); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: rgba(236, 235, 242, 0.015); border: 1px solid var(--hairline);
  transition: color 200ms, border-color 200ms, background 200ms, box-shadow 240ms, transform 130ms var(--ease-out);
}
.btn:hover { color: var(--ink); border-color: var(--hairline-2); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* soft attention pulse while the period is due/late and today isn't marked yet */
@keyframes attn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.btn--attn { animation: attn 2.4s ease-in-out infinite; }
.btn--primary {
  color: #14151f;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 10px 30px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn--primary:hover { color: #0f1017; box-shadow: 0 14px 38px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn--danger { color: #d98a97; border-color: color-mix(in srgb, var(--heart) 35%, transparent); }
.btn--danger:hover { color: #fff; border-color: var(--heart); background: color-mix(in srgb, var(--heart) 14%, transparent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.mini-btn {
  appearance: none; cursor: pointer; background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
  color: var(--muted); height: 32px; padding: 0 12px; border-radius: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  transition: color 200ms, border-color 200ms, background 200ms, transform 130ms var(--ease-out);
}
.mini-btn:hover { color: var(--ink); border-color: var(--hairline-2); }
.mini-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* one unified press for every button */
.icon-btn:active, .btn:active, .mini-btn:active, .tab:active,
.overlay-close:active, .chip-btn:active, .seg-btn:active, .period-toggle:active, .cal-cell:active { transform: scale(0.95); }

/* message card */
.card--msg .msg-text {
  min-height: 130px; display: grid; place-items: center;
  margin: 10px 0 6px; padding: 8px clamp(4px, 3vw, 28px);
  text-align: center;
  font-family: var(--font-serif); font-weight: 500; font-size: clamp(20px, 3.2vw, 27px); line-height: 1.6; color: var(--ink);
  text-wrap: balance;
}

/* ---- calendar --------------------------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { flex: 1 1 auto; margin: 0; text-align: center; font-family: var(--font-serif); font-weight: 600; font-size: clamp(18px, 2.6vw, 24px); color: var(--ink); }
.cal-title::first-letter { text-transform: uppercase; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dow span { text-align: center; font-family: var(--font-sans); font-weight: 600; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-cell {
  --ch: var(--h);
  appearance: none; font: inherit; cursor: pointer; position: relative;
  aspect-ratio: 1 / 1.04; min-width: 0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(236, 235, 242, 0.015); border: 1px solid var(--hairline);
  color: var(--ink-2);
  transition: border-color 200ms, background 200ms, color 200ms, transform 130ms var(--ease-out);
}
.cal-cell:hover { border-color: var(--hairline-2); background: rgba(236, 235, 242, 0.045); }
.cal-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-cell__num { font-family: var(--font-sans); font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1; }
.cal-cell__marks { display: flex; gap: 3px; min-height: 5px; }
.cal-cell__marks i { width: 5px; height: 5px; border-radius: 999px; }
.cal-cell--out { opacity: 0.32; }
.cal-cell--future { color: var(--muted); }

.cal-cell--today { border-color: hsl(var(--h) 60% 62% / 0.65); box-shadow: 0 0 0 1px hsl(var(--h) 60% 62% / 0.35), 0 0 18px -6px var(--glow); }
.cal-cell--period {
  background: linear-gradient(180deg, hsl(348 55% 44% / 0.4), hsl(348 55% 34% / 0.28));
  border-color: hsl(348 60% 58% / 0.55); color: var(--ink);
}
.cal-cell--pred { border-style: dashed; border-color: hsl(348 55% 58% / 0.45); background: hsl(348 50% 45% / 0.08); }
.cal-cell--fertile { background: hsl(152 45% 40% / 0.12); border-color: hsl(152 45% 52% / 0.3); }
.cal-cell--ov { border-color: hsl(38 70% 58% / 0.6); background: hsl(38 60% 45% / 0.14); }
.mark--note { background: hsl(var(--h) 60% 66%); }
.mark--flow { background: hsl(348 70% 62%); }

.cal-hint { margin: 14px 2px 6px; color: var(--faint); font-size: 11.5px; letter-spacing: 0.03em; }

.legend { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; letter-spacing: 0.03em; }
.legend-dot { width: 10px; height: 10px; border-radius: 4px; border: 1px solid transparent; }
.legend-dot--period { background: hsl(348 55% 44% / 0.55); border-color: hsl(348 60% 58% / 0.6); }
.legend-dot--pred { border: 1px dashed hsl(348 55% 58% / 0.6); background: hsl(348 50% 45% / 0.1); }
.legend-dot--fertile { background: hsl(152 45% 40% / 0.2); border-color: hsl(152 45% 52% / 0.45); }
.legend-dot--ov { background: hsl(38 60% 45% / 0.2); border-color: hsl(38 70% 58% / 0.7); }
.legend-dot--note { background: hsl(var(--h) 60% 66%); border-radius: 999px; width: 7px; height: 7px; margin: 0 1.5px; }

/* ---- stats ------------------------------------------------------------------ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  border-radius: 16px; padding: 16px 18px;
  background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-k { font-family: var(--font-sans); font-weight: 600; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.stat-v { font-family: var(--font-serif); font-weight: 600; font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-v small { font-size: 13px; color: var(--muted); font-family: var(--font-sans); font-weight: 500; margin-left: 4px; }

.view > .card { margin-bottom: 14px; }

.cycle-list { display: flex; flex-direction: column; gap: 9px; }
.cycle-row { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; align-items: center; gap: 12px; }
.cycle-row__date { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cycle-row__bar { position: relative; height: 10px; border-radius: 999px; background: rgba(236, 235, 242, 0.05); overflow: hidden; min-width: 60px; }
.cycle-row__bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, hsl(348 60% 52% / 0.9), hsl(var(--h) 60% 58% / 0.7)); }
.cycle-row__bar b { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: hsl(348 70% 62%); }
.cycle-row__len { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cycle-row__len .hi { color: var(--ink-2); font-weight: 600; }

.sym-stats { display: flex; flex-direction: column; gap: 9px; }
.sym-row { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; align-items: center; gap: 12px; }
.sym-row__name { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sym-row__bar { position: relative; height: 10px; border-radius: 999px; background: rgba(236, 235, 242, 0.05); overflow: hidden; }
.sym-row__bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, hsl(var(--h) 55% 50% / 0.85), hsl(var(--h) 65% 62% / 0.65)); }
.sym-row__n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- settings --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.field--check { flex-direction: row; align-items: flex-start; gap: 10px; cursor: pointer; }
.field-label { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.input {
  appearance: none; font: inherit; color: var(--ink);
  background: rgba(8, 9, 13, 0.5); border: 1px solid var(--hairline-2); border-radius: 11px;
  padding: 11px 13px; font-size: 14px; min-width: 0;
  transition: border-color 200ms, background 200ms, box-shadow 200ms;
}
.input:focus { outline: none; border-color: hsl(var(--h) 55% 60% / 0.6); box-shadow: 0 0 0 3px hsl(var(--h) 60% 55% / 0.12); }
.input::placeholder { color: var(--faint); }
.input--num { width: 88px; text-align: center; font-variant-numeric: tabular-nums; }
.input--area { width: 100%; resize: vertical; min-height: 74px; line-height: 1.55; }
input[type="date"].input { color-scheme: dark; }
.check {
  appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid var(--hairline-2); background: rgba(8, 9, 13, 0.5);
  display: grid; place-items: center;    /* no bg/border transition — see .tab note */
}
.check:checked { background: hsl(var(--h) 62% 58%); border-color: hsl(var(--h) 62% 58%); }
.check:checked::after { content: "✓"; font-size: 13px; font-weight: 700; color: #14151f; line-height: 1; }
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- overlays (shared shell) --------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6, 7, 11, 0.7);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 360ms var(--ease-out);
}
.overlay[hidden] { display: none; }
.overlay.is-open { opacity: 1; }
.overlay-panel {
  display: flex; flex-direction: column;
  width: min(680px, 100%); margin: 0 auto; height: 100%;
  padding: clamp(18px, 5vh, 48px) clamp(18px, 5vw, 48px) clamp(16px, 4vh, 36px);
  transform: translateY(18px); opacity: 0;
  transition: transform 460ms var(--ease-soft), opacity 460ms var(--ease-soft);
}
.overlay.is-open .overlay-panel { transform: none; opacity: 1; }

.overlay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.overlay-title { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: clamp(20px, 3vw, 26px); color: var(--ink); letter-spacing: 0.01em; }
.overlay-title::first-letter { text-transform: uppercase; }
.overlay-sub { margin: 14px 2px 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.overlay-sub--tight { margin: 5px 0 0; }
.overlay-close {
  appearance: none; cursor: pointer; background: transparent; border: 1px solid var(--hairline);
  color: var(--muted); width: 38px; height: 38px; border-radius: 10px; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  transition: color 200ms, border-color 200ms, transform 130ms var(--ease-out);
}
.overlay-close:hover { color: var(--ink); border-color: var(--hairline-2); }
.overlay-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- day sheet -------------------------------------------------------------- */
.sheet-grab { display: none; }             /* only shown on the phone bottom-sheet */
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--hairline-2) transparent; }
body.is-sheet-open { overflow: hidden; }   /* no background scroll while the sheet is up */
.sheet-body::-webkit-scrollbar { width: 8px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 8px; }
.sheet-block { display: flex; flex-direction: column; gap: 10px; }
.sheet-label { font-family: var(--font-sans); font-weight: 600; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.period-toggle {
  appearance: none; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 13px; text-align: left;
  background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: border-color 200ms, background 200ms, color 200ms, transform 130ms var(--ease-out);
}
.period-toggle__dot {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid var(--hairline-2);
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}
.period-toggle[aria-pressed="true"] { border-color: hsl(348 60% 58% / 0.55); background: hsl(348 55% 44% / 0.16); color: var(--ink); }
.period-toggle[aria-pressed="true"] .period-toggle__dot { background: hsl(348 70% 58%); border-color: hsl(348 70% 62%); box-shadow: 0 0 14px -2px hsl(348 80% 60% / 0.5); }
.period-toggle:disabled { opacity: 0.45; cursor: not-allowed; }
.period-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.flow-row { display: flex; flex-direction: column; gap: 10px; }
.seg { display: inline-flex; gap: 4px; border: 1px solid var(--hairline); border-radius: 11px; padding: 4px; background: rgba(236, 235, 242, 0.02); align-self: flex-start; }
.seg-btn {
  appearance: none; cursor: pointer; border: 0; background: transparent;
  color: var(--muted); font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: 0.05em;
  padding: 8px 14px; border-radius: 8px; line-height: 1;
  transition: color 200ms, background 240ms var(--ease-out);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.is-active { color: #14151f; background: hsl(348 65% 64%); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-btn {
  appearance: none; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(236, 235, 242, 0.02); border: 1px solid var(--hairline);
  color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1;
  transition: color 200ms, transform 130ms var(--ease-out);  /* no bg/border transition — see .tab note */
}
.chip-btn .em { font-size: 14px; line-height: 1; }
.chip-btn:disabled, .seg-btn:disabled, .mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.input:disabled { opacity: 0.45; cursor: not-allowed; }
.chip-btn:hover:not(:disabled) { color: var(--ink-2); border-color: var(--hairline-2); }
.chip-btn.is-on { color: var(--ink); border-color: hsl(var(--h) 55% 60% / 0.55); background: hsl(var(--h) 50% 40% / 0.14); }
.chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sheet-foot { display: flex; justify-content: flex-end; padding-bottom: 4px; }

/* ---- loader --------------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: var(--bg-deep); transition: opacity 600ms ease;
}
body.is-ready .loader { opacity: 0; pointer-events: none; }
.loader-mark { font-family: var(--font-serif); font-size: 44px; color: var(--accent); opacity: 0.5; animation: breathe 2.4s ease-in-out infinite; }
body.is-ready .loader-mark { animation: none; }
@keyframes breathe { 0%, 100% { opacity: 0.24; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.08); } }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 760px) {
  .brand-tag { display: none; }
  .cycle-row { grid-template-columns: minmax(96px, auto) 1fr auto; gap: 9px; }
  .cycle-row__date { font-size: 11.5px; }
  .topics { justify-content: flex-start; }

  /* the view switcher becomes an app-like bottom bar: stacked icon + label,
     safe-area aware, always in thumb reach */
  .tabs {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 60;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(10, 11, 16, 0.82), rgba(8, 9, 13, 0.95));
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid var(--hairline);
  }
  .views { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .tabs-inner { border: 0; background: transparent; padding: 3px; }   /* the bottom bar is the background here */
  .tab-slider { top: 0; bottom: 0; }
  .tab { flex-direction: column; gap: 5px; padding: 8px 4px 7px; font-size: 9px; letter-spacing: 0.05em; }
  .tab-ico { width: 19px; height: 19px; stroke-width: 1.7; }

  /* the day editor becomes a bottom sheet: solid surface, rounded top, grab bar */
  .day-overlay { display: flex; flex-direction: column; }
  .overlay-panel--sheet {
    height: auto; max-height: calc(94dvh - env(safe-area-inset-top));
    margin: auto 0 0; width: 100%;
    border-radius: 22px 22px 0 0;
    background:
      linear-gradient(180deg, hsl(var(--h) 25% 13% / 0.5), rgba(16, 17, 25, 0)),
      var(--surface-2);
    border-top: 1px solid var(--hairline-2);
    box-shadow: 0 -34px 90px -30px rgba(0, 0, 0, 0.85);
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(9vh);
  }
  .overlay.is-open .overlay-panel--sheet { transform: none; }
  .sheet-grab {
    display: block; flex: 0 0 auto;
    width: 42px; height: 4px; margin: 0 auto 12px; border-radius: 999px;
    background: var(--hairline-2);
  }
}
@media (max-width: 460px) {
  .brand-name { font-size: 16px; }
  .tab { font-size: clamp(8.5px, 2.6vw, 10px); letter-spacing: 0.02em; padding: 8px 3px; }
  .cal-grid, .cal-dow { gap: 4px; }
  .cal-cell { border-radius: 9px; }
  .cal-cell__num { font-size: 12px; }
  .wheel-num { font-size: 54px; }
  .quick-row { align-self: stretch; }
  .quick-row .btn { flex: 1 1 0; padding: 0 10px; letter-spacing: 0.04em; }
}

/* ===========================================================================
   Reduced motion — collapse to a single quiet crossfade
   =========================================================================== */
@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  body, .loader { transition: none !important; }
  .aurora, .glyph, .loader-mark { animation: none !important; }
  .view.is-active, .hero > *, .today-topics, .topic-card, .pred-detail:not([hidden]),
  .cal-grid.is-anim .cal-cell, .wheel.is-anim .wheel-seg, .wheel.is-anim .wheel-marker,
  .wheel-ring, .btn--attn { animation: none !important; }
  .tab-slider.is-live { transition: none !important; }
  .card, .btn { transition-property: color, border-color; }
  .overlay-panel { transform: none !important; transition: opacity 200ms ease !important; }
}
