/* FABM App v0.2 -- mobile-app aesthetic
 * Warm cycle-aware palette (coral / sage / cream).
 * Bottom tab bar, hero status card, big tap targets.
 */

:root {
  --ink: #1f1419;
  --ink-2: #4a3640;
  --muted: #8a7480;
  --bg: #fdf6f2;
  --bg-2: #f6e1d3;
  --card: #ffffff;
  --line: #efdfd5;
  --line-2: #e3cdbf;
  --accent: #b56576;          /* dusty rose -- primary brand */
  --accent-2: #e29578;        /* warm peach -- gradient end */
  --accent-ink: #ffffff;
  --fertile: #c0506b;         /* fertile status -- muted rose */
  --fertile-bg: #fbe4e5;
  --fertile-ink: #6b2a3a;
  --dry: #047857;
  --dry-bg: #d1fae5;
  --dry-ink: #064e3b;
  --unknown: #6b7280;
  --unknown-bg: #f3f4f6;
  --unknown-ink: #374151;
  --danger: #b91c1c;
  --shadow: 0 2px 8px rgba(31, 20, 25, 0.05), 0 1px 2px rgba(31, 20, 25, 0.03);
  --shadow-hi: 0 8px 20px rgba(181, 101, 118, 0.18), 0 2px 6px rgba(181, 101, 118, 0.10);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --tap: 52px;
  --pad: 20px;
  --tabbar-h: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(at 0% 0%, var(--bg-2) 0%, transparent 50%);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
/* Tap rows: inset focus ring so it isn't clipped by the parent qgroup's overflow */
.checkrow:focus-within {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--accent);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding-top: calc(env(safe-area-inset-top) + 18px);
  padding-bottom: 22px;
  /* Background stays edge-to-edge; text content aligns with .wrap's content column on desktop */
  padding-inline: max(var(--pad), calc((100vw - 480px) / 2));
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-hi);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero .brand {
  display: flex;
  align-items: center;
  margin: 0 0 12px;
}
.hero .brand img {
  height: 26px;
  width: auto;
  opacity: 0.98;
}
.hero .eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 6px;
}
.hero h1,
.hero .status-h {
  font-size: clamp(40px, 9vw, 60px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.02;
}
.hero h1 { margin: 0 0 4px; }
.hero .date {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero .status-detail {
  margin: 10px 0 0;
  font-size: 15px;
  opacity: 0.88;
  font-weight: 500;
}
.hero .status-detail.actionable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-top: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.20);
  color: inherit;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 1;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, transform 120ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero .status-detail.actionable:hover { background: rgba(255, 255, 255, 0.28); }
.hero .status-detail.actionable:active { transform: scale(0.97); }
.hero .status-detail.actionable::after {
  content: "→";
  opacity: 0.85;
  font-weight: 700;
}

/* ===== Bottom-sheet dialog ===== */
dialog.sheet {
  border: 0;
  padding: 0;
  max-width: 520px;
  width: 100%;
  margin: auto auto 0 auto;
  background: var(--bg);
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 60px rgba(31, 20, 25, 0.30);
  overflow: visible;
}
dialog.sheet[open] {
  animation: sheet-up 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
dialog.sheet::backdrop {
  background: rgba(31, 20, 25, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: sheet-fade 260ms ease;
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes sheet-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
dialog.sheet form {
  padding: 28px 22px max(22px, env(safe-area-inset-bottom));
}
dialog.sheet h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
dialog.sheet .sheet-date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}
dialog.sheet .sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--bg-2);
  color: var(--ink-2);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
dialog.sheet .sheet-close:hover { background: var(--line-2); }
dialog.sheet .sheet-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 14px;
}
dialog.sheet .sheet-actions .btn { margin-top: 0; }

/* Drag-handle pull tab at top of sheet (visual cue) */
dialog.sheet::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 4px;
  background: var(--line-2);
  border-radius: 999px;
  transform: translateX(-50%);
}

@media (min-width: 540px) {
  dialog.sheet {
    margin: auto;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(31, 20, 25, 0.30);
  }
  dialog.sheet[open] { animation: sheet-pop 320ms cubic-bezier(0.22, 1, 0.36, 1); }
  @keyframes sheet-pop {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
  }
  dialog.sheet::before { display: none; }
}

/* ===== Page wrap ===== */
.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px var(--pad) 24px;
}
.wrap--flush { padding-top: 0; }

/* ===== Headings ===== */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 28px 0 12px; }
h3 { font-size: 16px; font-weight: 700; margin: 12px 0 6px; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-2); font-size: 15px; }
.fine { color: var(--muted); font-size: 13px; margin-top: 24px; line-height: 1.5; }

/* ===== Card ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}

/* ===== Form help text ===== */
.form-help {
  font-size: 13px;
  color: var(--muted);
  margin: 0 4px 10px;
}

/* ===== Tap-to-mark check rows (with Context Transition) ===== */
.checkrow, .qgroup {
  overflow: hidden;
  max-height: 120px;
  transform-origin: top center;
  transition:
    max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 320ms cubic-bezier(0.22, 1, 0.36, 1),
    padding-top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    padding-bottom 320ms cubic-bezier(0.22, 1, 0.36, 1),
    background 220ms ease,
    border-color 220ms ease;
}
.qgroup { max-height: 260px; padding: 0; background: none; box-shadow: none; }
.checkrow.is-hidden, .qgroup.is-hidden {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
}
.checkrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  user-select: none;
  -webkit-user-select: none;
}
.checkrow:active { transform: scale(0.99); }
.checkrow input[type="checkbox"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.checkrow .cb {
  flex: 0 0 auto;
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2.5px solid var(--line-2);
  background: var(--bg);
  transition: background 200ms ease, border-color 200ms ease, transform 160ms ease;
}
.checkrow .cb::after {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  transition: opacity 180ms ease;
}
.checkrow:has(input:checked) {
  background: linear-gradient(110deg, rgba(181,101,118,0.07), rgba(226,149,120,0.05));
  border-color: rgba(181,101,118,0.22);
}
.checkrow:has(input:checked) .cb {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.04);
}
.checkrow:has(input:checked) .cb::after {
  content: "✓";
  opacity: 1;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}
.checkrow .q-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

/* ===== "Day saved" reward card ===== */
.done {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 22px;
  margin: 18px 0 6px;
  background: linear-gradient(135deg, var(--dry-bg) 0%, #e6f4eb 50%, #fae8de 100%);
  color: var(--dry-ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.14), 0 2px 6px rgba(4, 120, 87, 0.08);
  max-height: 140px;
  transition:
    max-height 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 320ms,
    padding 320ms;
}
.done.is-hidden {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
}
.done.is-celebrating { animation: done-pop 1100ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes done-pop {
  0%   { transform: translateY(0) scale(1); }
  18%  { transform: translateY(-6px) scale(1.04); }
  40%  { transform: translateY(-1px) scale(1.015); }
  100% { transform: translateY(0) scale(1); }
}

/* Sustained shimmer sweep across the done card while celebrating */
.done.is-celebrating::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: done-shimmer 1500ms 200ms ease-out;
  pointer-events: none;
}
@keyframes done-shimmer {
  to { transform: translateX(100%); }
}

/* Shockwave ring radiating from the checkmark */
.done-icon { position: relative; }
.done.is-celebrating .done-icon::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 3px solid var(--dry);
  opacity: 0;
  animation: shockwave 1100ms 380ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
  pointer-events: none;
}
@keyframes shockwave {
  0%   { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Hero celebratory flash */
.hero.is-celebrating::after {
  animation: hero-flash 1400ms ease-out;
}
@keyframes hero-flash {
  0%   { background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%); }
  20%  { background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 70%); }
  100% { background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%); }
}

/* Status H1 quick bounce */
.hero.is-celebrating .status-h {
  animation: status-bounce 800ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes status-bounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.08); }
  60%  { transform: scale(0.99); }
  100% { transform: scale(1); }
}
.done-icon {
  flex: 0 0 56px;
  color: var(--dry);
  filter: drop-shadow(0 2px 4px rgba(4, 120, 87, 0.18));
}
.done-icon .checkmark { display: block; width: 56px; height: 56px; }
.checkmark .check-bg {
  stroke-dasharray: 164;
  stroke-dashoffset: 164;
}
.checkmark .check-path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}
.done.is-celebrating .check-bg {
  animation: dash-circle 520ms 80ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.done.is-celebrating .check-path {
  animation: dash-check 360ms 480ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes dash-circle { to { stroke-dashoffset: 0; } }
@keyframes dash-check { to { stroke-dashoffset: 0; } }
/* Static state after celebration (and on page reload where day is already complete) */
.done:not(.is-celebrating) .check-bg,
.done:not(.is-celebrating) .check-path { stroke-dashoffset: 0; }

.done-text { flex: 1; min-width: 0; }
.done-text h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dry-ink);
  margin: 0 0 2px;
}
.done-streak { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.done-streak .streak-n {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--dry);
  line-height: 1;
}
.done-streak .streak-l {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dry-ink);
  opacity: 0.75;
}

/* ===== Confetti rain (falls from top of viewport) ===== */
.confetti-stage {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}
.confetti {
  position: absolute;
  top: -32px;
  left: var(--start-x, 50%);
  width: 9px; height: 14px;
  border-radius: 2px;
  pointer-events: none;
  --start-x: 50%; --drift: 0; --r: 360deg; --d: 0ms; --dur: 2800ms;
  animation: confetti-fall var(--dur) cubic-bezier(0.32, 0.05, 0.5, 1) var(--d) both;
  will-change: transform, opacity;
}
.confetti.round { width: 10px; height: 10px; border-radius: 50%; }
.confetti.streamer { width: 5px; height: 18px; }
@keyframes confetti-fall {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  4%   { opacity: 1; }
  100% {
    transform: translateY(110vh) translateX(calc(var(--drift) * 1px)) rotate(var(--r));
    opacity: 0.85;
  }
}

/* ===== Yes/No segmented control ===== */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.seg legend { display: none; }
.seg label {
  position: relative;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 16px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 120ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
  user-select: none;
}
.seg label:active { transform: scale(0.97); }
.seg input[type=radio] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.seg label:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(181, 101, 118, 0.28);
}
.seg .ico {
  width: 18px; height: 18px;
  display: inline-block;
}

/* ===== Single button style ===== */
.btn,
.primary {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 14px 20px;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, background 180ms ease;
}
.btn:active,
.primary:active { transform: scale(0.98); }
.btn:disabled,
.primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #991b1b; }

/* ===== History list ===== */
.day-list { list-style: none; padding: 0; margin: 0; }
.day {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.day:last-child { border-bottom: 0; }
.day .swatch {
  flex: 0 0 auto;
  width: 10px; height: 36px;
  border-radius: 5px;
  background: var(--unknown);
}
.day.fertile .swatch { background: var(--fertile); }
.day.dry .swatch { background: var(--dry); }
.day .body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.day .body .date {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.day .body .badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--unknown-bg);
  color: var(--unknown-ink);
}
.day.fertile .badge { background: var(--fertile-bg); color: var(--fertile-ink); }
.day.dry .badge { background: var(--dry-bg); color: var(--dry-ink); }

/* ===== Method picker ===== */
.methods { list-style: none; padding: 0; margin: 0; }
.method {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.method h2 { margin: 0 0 6px; font-size: 18px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.method p { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.method.active { border: 2px solid var(--accent); }
.method.active::before {
  content: "Active";
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-2);
  padding: 4px 10px;
  border-radius: 999px;
}
.method.disabled { opacity: 0.7; }
.method .tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--unknown-bg);
  color: var(--unknown-ink);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

/* ===== Bottom tab bar (icon-only) ===== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  /* Icons align with card content column on desktop */
  padding-inline: max(10px, calc((100vw - 480px) / 2));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  border-radius: 16px;
  min-height: 44px;
  transition: color 200ms ease, background 200ms ease, transform 160ms ease;
}
.tabbar a:active { transform: scale(0.94); }
.tabbar a svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar a[aria-current="page"] {
  color: var(--accent);
  background: var(--bg-2);
}
.tabbar a[aria-current="page"] svg { stroke-width: 2; }
.tab-label { /* hidden but kept in DOM for screen readers */
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--accent-ink);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.20);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Motion ===== */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
[hidden] { display: none !important; }

/* ===== Drill Transition (cross-document View Transitions) ===== */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: drill-out 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
::view-transition-new(root) {
  animation: drill-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes drill-out {
  to { transform: translateX(-24px); opacity: 0; }
}
@keyframes drill-in {
  from { transform: translateX(28px); opacity: 0; }
}

/* ===== Continuity Transition (shared elements persist + morph across pages) ===== */
.brand img { view-transition-name: brand; }
.tabbar { view-transition-name: tabbar; }

/* Status H1 morph within the Today page when answer changes "Dry today" -> "Fertile today" */
.hero .status-h { view-transition-name: status-h; }
.hero .status-detail { view-transition-name: status-detail; }
.hero { view-transition-name: hero; }

::view-transition-group(brand),
::view-transition-group(tabbar) {
  animation-duration: 320ms;
}
::view-transition-group(status-h),
::view-transition-group(status-detail) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

