/* =====================================================================
   Layout system
   - Mobile first (phones, up to 767px)
   - Tablet (768 to 1023px): one centred column, two-up grids
   - Web (1024px and up): designed at 1440px. Left rail + a centred 1160px workspace
   Everything sits on an 8-point scale: 4 8 12 16 24 32 48 64. Cards share one padding
   token, one gap token and one radius token, so edges line up across every screen.
   ===================================================================== */

/* Fonts are self-hosted (see /fonts) so the privacy promise holds: no Google Fonts calls. */
@font-face { font-family: 'Playfair Display'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/playfair-display-500.woff2') format('woff2'); }
@font-face { font-family: 'Google Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/google-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/space-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Google Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/google-sans-500.woff2') format('woff2'); }

:root {
  /* Palette (ten pastels + teal + purple). The old names stay and now hold the new pastels: thistle = Mauve, petal = Cotton Rose, pink = Pink Orchid,
     icy = Baby Blue Ice, sky = Frosted Blue; lemon, peach, aqua, aquamarine and celadon are new. Teal is the PMOS awareness colour: done, progress,
     streak. Pastels never carry text; text on them is the deep purple, or --teal-text, a deeper teal. */
  --thistle: #CFBAF0; --petal: #FFCFD2; --pink: #F1C0E8; --icy: #A3C4F3; --sky: #90DBF4;
  --lemon: #FBF8CC; --peach: #FDE4CF; --aqua: #8EECF5; --aquamarine: #98F5E1; --celadon: #B9FBC0;
  --teal: #008080; --teal-text: #00605F; --on-teal: #FFFFFF;
  --cream: #FBF7FD; --surface: #FFFFFF; --sand: #EFE6F5; --line: #E3D5EC;
  --plum: #4B2E63; --ink: #35223F; --muted: #6E5A7B; --accent: #9E1D55;
  --ring-track: #6B4A86; --hero-text: #F6EEFB;

  --ok-bg: #D1FBF2;    --ok-fg: #00504F;
  --watch-bg: #FDE9D0; --watch-fg: #633806;
  --act-bg: #FFE1E3;   --act-fg: #A32020;

  --ring-nat: #C81E3A; --ring-wd: #2F6DB5;

  /* tokens that let the dark theme restyle things that used to be fixed colours */
  --plum-solid: #4B2E63; --plum-solid-hover: #3b2350; --hero-bg: #4B2E63; --accent-solid: #A8205A;
  --white: #FFFFFF; --on-icy: #17406B; --fert-bg: #DCE8FB; --pre-bg: #EBAEDF;
  --st-good-bg: #E6F4EA; --st-good-fg: #1E6B3A; --st-good-line: #BFE0C9;
  --st-same-bg: #FFF6E0; --st-same-fg: #7A5A00; --st-same-line: #F0DCA0;
  --st-bad-bg: #FDECEC; --st-bad-fg: #8E1A4C; --st-bad-line: #F3C4D4;
  --love-a: #FFE0E3; --love-b: #FFF3F4; --love-c: #F5E6F3; --love-line: #F4CBE9;
  --si-g1: #F3F8FF; --si-g2: #FBF3FA; --si-g3: #FBF7FD;
  --si-card: rgba(255, 255, 255, .94); --si-how-bg: rgba(255, 255, 255, .6); --si-how-line: rgba(255, 255, 255, .85); --rail-hover: rgba(255, 255, 255, .7);
  --si-card-line: rgba(255, 255, 255, .9); --si-card-shine: rgba(255, 255, 255, .8);
  --on-hero-accent: #FFCFD2; --on-hero-pink: #F1C0E8; --on-hero-aqua: #8EECF5; --on-hero-lemon: #FBF8CC; --on-hero-mint: #98F5E1; /* pastels used as TEXT or lines on the purple header: the same in light and dark */
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); /* the phone's status bar and gesture bar */
  color-scheme: light;

  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-tag: 'Space Grotesk', 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; /* the small tags and labels */
  --font-nav: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; /* the navigation labels */

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --gutter: 16px;       /* page side padding */
  --gap: 16px;          /* space between cards, always */
  --pad: 16px;          /* card padding, always */
  --radius: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* patterns, as inline SVG so they cost no requests */
  --pat-page: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%234B2E63' fill-opacity='.05'%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3Ccircle cx='44' cy='44' r='2.4'/%3E%3Cpath d='M46 6c3 3 3 9 0 12-3-3-3-9 0-12zM18 42c3 3 3 9 0 12-3-3-3-9 0-12z'/%3E%3C/g%3E%3C/svg%3E");
  --pat-sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 12l2 6 6 2-6 2-2 6-2-6-6-2 6-2z' fill='white' fill-opacity='.08'/%3E%3C/svg%3E");
  --pat-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 0h28a14 14 0 0 1-28 0z' fill='%234B2E63'/%3E%3C/svg%3E");
  --pat-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='3' r='1.4' fill='%234B2E63' fill-opacity='.10'/%3E%3C/svg%3E");
  --pat-petals: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23CDB4DB' stroke-opacity='.55' stroke-width='1.3'%3E%3Cpath d='M60 60c-10-14-10-32 0-42 10 10 10 28 0 42zM60 60c14-10 32-10 42 0-10 10-28 10-42 0zM60 60c10 14 10 32 0 42-10-10-10-28 0-42zM60 60c-14 10-32 10-42 0 10-10 28-10 42 0z'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream) var(--pat-page); color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; margin: 0; color: var(--plum); line-height: 1.2; }
h2 { font-size: 19px; margin-bottom: var(--s3); }
p { margin: 0; }
ul, ol { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: var(--s5); }
.label { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
/* a heading followed by a paragraph: tidy the join */
h2 + p, h2 + .small { margin-top: calc(var(--s1) * -1); }

/* ============================ shell ============================ */
.app { min-height: 100vh; min-height: 100dvh; }
.rail { display: none; }
.content { max-width: 560px; margin: 0 auto; padding-bottom: 112px; }
main { padding: var(--s5) var(--gutter) var(--s2); }
.panel-stack { display: grid; gap: var(--gap); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad); }
.card > :last-child { margin-bottom: 0; }
.card h3 { font-size: 16px; }

/* ============================ hero ============================ */
.hero {
  position: relative; background: var(--hero-bg); color: var(--hero-text);
  padding: var(--s5) var(--gutter) var(--s5); padding-top: max(var(--s5), var(--safe-top));
  border-radius: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4);
}
.hero::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; margin-top: -1px; background: var(--pat-scallop) repeat-x; pointer-events: none; }
.hero > * { position: relative; }
.hero > .hero-art { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: var(--pat-sparkle); pointer-events: none; }
.botanical { position: absolute !important; right: -6px; bottom: -8px; width: 150px; height: auto; color: var(--on-hero-pink); opacity: .3; pointer-events: none; }
.hero-art::before { content: ''; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(255,255,255,.10); box-shadow: 0 0 0 26px rgba(255,255,255,.03), 0 0 0 52px rgba(255,255,255,.02); }
.ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.ring { width: 100%; height: 100%; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--ring-track); }
.ring .bar { stroke: var(--on-hero-pink); stroke-linecap: round; }
.ring-wrap span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 19px var(--font-head); color: var(--hero-text); }
.hero-main { flex: 1 1 200px; min-width: 0; }
.greet { font-size: 15px; font-weight: 500; color: var(--on-hero-accent); }
.hero h1 { color: var(--hero-text); font-size: 26px; margin-top: var(--s1); }
.hero .affirm { font-size: 14px; margin-top: var(--s2); }
.pills { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; background: var(--pink); color: var(--ink); }
.pill.ghost { background: transparent; color: var(--hero-text); border: 1px solid var(--ring-track); }

/* level card */
.hero-level { flex: 1 1 100%; background: rgba(255,255,255,.08); border: 1px solid var(--ring-track); border-radius: 16px; padding: var(--s4); }
.lv-top { display: flex; align-items: center; gap: var(--s3); }
.lv-top strong { display: block; font-weight: 500; font-size: 15px; }
.lv-top small { font-size: 12px; opacity: .85; }
.lv-badge { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: var(--ink); flex: none; }
.lv-badge .ic { width: 20px; height: 20px; }
.lv-bar { height: 8px; border-radius: 9999px; background: var(--ring-track); margin: var(--s3) 0 var(--s2); overflow: hidden; }
.lv-bar i { display: block; height: 100%; background: var(--pink); border-radius: 9999px; transition: width .6s var(--ease); }
.lv-sub { font-size: 12px; opacity: .85; }

.banner { background: var(--act-bg); color: var(--act-fg); padding: var(--s3) var(--s4); font-size: 14px; text-align: center; }

/* ============================ navigation ============================ */
.dock {
  position: fixed; left: var(--s3); right: var(--s3); z-index: 5; bottom: max(10px, var(--safe-bottom));
  max-width: 536px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1);
  background: var(--sand); border: 1px solid var(--line); border-radius: 9999px; padding: 5px;
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border: 0; border-radius: 9999px; background: transparent; color: var(--ink);
  font-weight: 500; font-size: 11px; transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.navbtn[aria-current="page"] { background: var(--pink); color: var(--ink); }
.navbtn:active { transform: scale(.94); }

.foot { padding: var(--s2) var(--gutter) var(--s3); color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.foot p + p { margin-top: var(--s1); }

/* ============================ icons and effects ============================ */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic .f { fill: currentColor; fill-opacity: .2; }
.ic.solid .f { fill-opacity: 1; }
.ic.nat { color: var(--ring-nat); }
.ic.wd { color: var(--ring-wd); }
.ic.inline { width: 18px; height: 18px; vertical-align: -3px; }
.bloom { display: block; }
.badge-ic {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg, var(--sand)); color: var(--fg, var(--plum));
}
.pip { position: absolute; right: -4px; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); color: var(--fg); border: 1.5px solid var(--fg); font-size: 11px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.pfx { position: fixed; z-index: 60; width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; pointer-events: none; }
.pfx.fall { width: 9px; height: 13px; }

#toasts { position: fixed; z-index: 40; left: 0; right: 0; bottom: calc(96px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none; padding: 0 var(--gutter); }
.toast { pointer-events: auto; max-width: 420px; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: 16px; background: var(--plum-solid); color: #fff; font-size: 14px; font-weight: 500; border: 1px solid var(--ring-track); box-shadow: 0 8px 24px rgba(53, 34, 63, .28); }
.toast.win { background: var(--pink); color: var(--ink); border-color: var(--petal); }
.toast.nudge { background: var(--white); color: var(--ink); border-color: var(--thistle); }
.toast.nudge .ic { color: var(--accent); width: 26px; height: 26px; }
.toast-x { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sand); color: var(--plum); font-size: 20px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.toast-x:hover { background: var(--thistle); }
.toast.nudge span { flex: 1; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }

/* ============================ buttons and form controls ============================ */
.btnrow { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }
.btn { min-height: 48px; padding: var(--s2) var(--s5); border-radius: 9999px; border: 1px solid var(--plum-solid); background: var(--plum-solid); color: #fff; font-weight: 500; transition: background-color .2s, transform .15s var(--ease), box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--plum); }
.btn.danger { background: var(--surface); color: var(--act-fg); border-color: var(--act-fg); }
.btn.danger.armed, .btn.armed { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; flex: none; transition: background-color .2s, color .2s; }
.iconbtn:hover { background: var(--act-bg); color: var(--act-fg); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); align-content: start; }
.field + .field { margin-top: var(--s4); }
.field label { font-weight: 500; }
input[type="date"], input[type="password"], input[type="text"], input[type="time"], input[type="number"], input[type="search"],
input[type="email"], input[type="tel"], input[type="month"], input[type="url"], select, textarea {
  min-height: 48px; font-size: 16px; line-height: 1.4; width: 100%; padding: var(--s2) var(--s4); border: 1.5px solid var(--line); border-radius: 16px; background: var(--cream);
  -webkit-appearance: none; appearance: none; box-shadow: inset 0 1px 2px rgba(75, 46, 99, .06);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236E5A7B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
input[type="date"], input[type="time"], input[type="month"] { text-align: left; }
/* Every place you type shares one look: soft rounded box, same border, same focus glow. 16px stops iPhones zooming in. */
textarea { display: block; min-height: 96px; padding: var(--s3) var(--s4); line-height: 1.55; resize: vertical; overflow: auto; }
textarea[readonly] { background: var(--sand); box-shadow: none; }
textarea#code, textarea#restore { word-break: break-all; }
input[type="search"] {
  padding-left: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236E5A7B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center; background-size: 20px;
}
input[type="search"]:focus-visible { background-color: var(--surface); }
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-right: -4px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236E5A7B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="date"], input[type="time"], input[type="month"] { display: block; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:hover, textarea:hover, select:hover { border-color: var(--thistle); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--plum); background-color: var(--surface); box-shadow: 0 0 0 4px rgba(205, 180, 219, .55);
}
input:disabled, textarea:disabled, select:disabled { opacity: .6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--plum); }
.msg { margin-top: var(--s2); font-size: 13px; min-height: 1.2em; }
.msg.err { color: var(--act-fg); font-weight: 500; }
.timegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s4); }
.timegrid .field { min-width: 0; }
.timegrid input { min-width: 0; }
.timegrid .field + .field { margin-top: 0; }

.chips { display: grid; gap: var(--s2); }
.chips.four { grid-template-columns: repeat(2, 1fr); }
.chips.five { grid-template-columns: repeat(5, 1fr); gap: var(--s2); }
.chips.rounds, .chips.rf, .chips.remchips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 48px; padding: 6px var(--s4); border-radius: 9999px; border: 1px solid var(--line); background: var(--cream); color: var(--ink); font-weight: 500; font-size: 14px; transition: background-color .2s, transform .15s var(--ease); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.chips.four .chip { display: flex; align-items: center; justify-content: center; gap: var(--s2); }
.chips.five .chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 6px 2px; font-size: 13px; }
.chips.five .chip .ic { width: 26px; height: 26px; }
.chips.rounds .chip, .chips.rf .chip { min-height: 40px; padding: 4px 14px; font-size: 13px; }
.chips.remchips .chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; }
.chips.rf { margin-bottom: var(--s4); }
.chips.rounds { margin-bottom: var(--s4); }

/* ============================ Today ============================ */
.datenav { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s4); }
.datenav .mid { text-align: center; }
.datenav .mid strong { font: 500 18px var(--font-head); color: var(--plum); display: block; }
.datenav .mid span { font-size: 13px; color: var(--muted); }
.arrow { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; color: var(--plum); transition: background-color .2s, transform .15s var(--ease); }
.arrow:disabled { opacity: .35; cursor: default; }
.arrow:not(:disabled):active { transform: scale(.92); }

.notices { display: grid; gap: var(--gap); margin-bottom: var(--s5); }
.notice { display: flex; gap: var(--s4); align-items: flex-start; background: var(--white); border: 1.5px solid var(--thistle); }
.notice > .ic { width: 30px; height: 30px; color: var(--accent); margin-top: 2px; }
.notice h2 { font-size: 17px; margin-bottom: var(--s2); }
.notice .btnrow { margin-top: var(--s3); }
.notice.round { background: var(--sand); }

.today-grid { display: flex; flex-direction: column; gap: var(--gap); }
.col { display: contents; }
.col > .bloomcard { order: 1; }
.col > .rituals { order: 2; }
.col > .encourage { order: 3; }
.col > .myrem { order: 4; }
.col > .weekcard { order: 5; }
.col > .bento { order: 6; }
.col > .bleed { order: 7; }
.col > .mood { order: 8; }

.rituals { display: grid; gap: var(--s3); }
.ritual {
  display: flex; align-items: center; gap: var(--s4); width: 100%; min-height: 68px; padding: var(--s3) var(--s4);
  border: 0; border-radius: 18px; text-align: left; background: var(--bg); color: var(--fg); font-weight: 500;
  transition: background-color .25s, color .25s, transform .2s var(--ease);
}
.ritual .badge-ic { background: var(--fg); color: var(--bg); transition: background-color .25s, color .25s; }
.ritual.done { background: var(--fg); color: var(--bg); }
.ritual.done .badge-ic { background: var(--bg); color: var(--fg); }
.ritual:active { transform: scale(.985); }
.encourage { display: flex; align-items: flex-start; gap: var(--s3); border: 1.5px dashed var(--thistle); background: var(--sand); font-family: var(--font-head); font-size: 16px; color: var(--plum); }
.encourage .ic { color: var(--accent); width: 26px; height: 26px; margin-top: 1px; }

.bloomcard { display: flex; align-items: center; gap: var(--s5); background: var(--surface) var(--pat-dots); }
.bigbloom { width: 112px; flex: none; }
.bigbloom .bloom { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(75, 46, 99, .12)); }
.bloomtxt strong { display: block; font: 500 30px/1.1 var(--font-head); color: var(--accent); }
.bloomtxt strong small { font: 500 14px var(--font-body); color: var(--muted); }
.bloomtxt .small { margin-top: var(--s1); }

.weekhead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.weekhead .label { margin-bottom: var(--s3); }
.weekhead strong { font-weight: 500; font-size: 14px; color: var(--plum); }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); margin: 0 0 var(--s4); }
.weekdays .wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; border-radius: 12px; background: transparent; font-size: 11px; font-weight: 500; color: var(--muted); }
.weekdays .wd .bloom { width: 80%; max-width: 38px; height: auto; }
.weekdays .wd:disabled { opacity: .35; cursor: default; }
.weekdays .wd.today { background: var(--sand); color: var(--plum); }
.weekdays .wd.good span { color: var(--ok-fg); }
.goalbar { height: 8px; border-radius: 9999px; background: var(--sand); overflow: hidden; margin-bottom: var(--s3); }
.goalbar i { display: block; height: 100%; background: var(--pink); border-radius: 9999px; transition: width .6s var(--ease); }

.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: var(--s4); }
.stat .k { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat strong { display: block; font: 500 28px/1.15 var(--font-head); color: var(--accent); margin-top: var(--s1); }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.ok { background: var(--ok-bg); border-color: var(--ok-bg); } .stat.ok strong, .stat.ok .sub { color: var(--ok-fg); }
.stat.watch { background: var(--watch-bg); border-color: var(--watch-bg); } .stat.watch strong, .stat.watch .sub { color: var(--watch-fg); }
.stat.act { background: var(--act-bg); border-color: var(--act-bg); } .stat.act strong, .stat.act .sub { color: var(--act-fg); }
.stat .bar { height: 6px; border-radius: 9999px; background: var(--sand); margin-top: var(--s2); overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--pink); border-radius: 9999px; }

/* ============================ Progress ============================ */
.progress-grid { display: flex; flex-direction: column; gap: var(--gap); }
.pcol { display: contents; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.tile { background: var(--sand); border-radius: 18px; padding: var(--s4) var(--s2); text-align: center; }
.tile strong { display: block; font: 500 28px/1.1 var(--font-head); color: var(--accent); margin-bottom: var(--s1); }
.tile span { font-size: 12px; color: var(--muted); }
.alert { border-radius: var(--radius); padding: var(--pad); border: 1px solid transparent; }
.alert h2 { color: inherit; font-size: 17px; margin-bottom: var(--s2); }
.alert p + p { margin-top: var(--s2); }
.alert.none  { background: var(--sand); color: var(--ink); border-color: var(--line); }
.alert.ok    { background: var(--ok-bg); color: var(--ok-fg); }
.alert.watch { background: var(--watch-bg); color: var(--watch-fg); }
.alert.act   { background: var(--act-bg); color: var(--act-fg); }

.grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.cell { position: relative; aspect-ratio: 1; min-width: 0; padding: 1px; border: 0; border-radius: 50%; background: transparent; transition: background-color .2s, transform .2s var(--ease); }
.cell .bloom { display: block; width: 100%; height: 100%; }
.cell.today { outline: 2px solid var(--plum); outline-offset: 0; background: var(--white); }
.cell:disabled { opacity: .3; cursor: default; }
.cell:not(:disabled):hover { background: var(--sand); transform: scale(1.18); z-index: 1; }
.legend { display: grid; gap: var(--s3); margin-top: var(--s4); font-size: 13px; }
.legend .row { display: flex; align-items: center; gap: var(--s3); }
.legend .bloom { width: 34px; height: 34px; flex: none; }
.key { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2) var(--s4); font-size: 12px; color: var(--muted); }
.key span { display: flex; align-items: center; gap: var(--s2); }
.key i { width: 12px; height: 12px; border-radius: 50%; flex: none; }

.garden { background: var(--surface) var(--pat-petals) no-repeat right -24px top -24px / 150px; }
.ladder { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s3); }
.ladder li { display: flex; align-items: center; gap: var(--s3); font-size: 14px; color: var(--muted); }
.ladder .lvdot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--sand); color: var(--muted); flex: none; }
.ladder li.done .lvdot { background: var(--ok-bg); color: var(--ok-fg); }
.ladder li.now { color: var(--plum); font-weight: 500; }
.ladder li.now .lvdot { background: var(--pink); color: var(--ink); }
.ladder small { font-weight: 400; color: var(--muted); }

.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.badge { display: flex; align-items: center; gap: var(--s3); border: 1px dashed var(--line); border-radius: 16px; padding: var(--s3); background: var(--cream); color: var(--muted); }
.badge .bloom { width: 38px; height: 38px; flex: none; }
.badge:not(.earned) .bloom { opacity: .7; }
.badge strong { display: block; font-size: 14px; line-height: 1.25; }
.badge span { font-size: 12px; }
.badge.earned { background: var(--pink); border: 1px solid var(--pink); color: var(--ink); }
.badgecard h2 small { font: 400 13px var(--font-body); }

/* ============================ Cycle ============================ */
.panel-grid { display: grid; gap: var(--gap); align-items: start; }
.calnav { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.calnav h2 { margin: 0; font-size: 18px; text-align: center; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dow { text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 2px 0 var(--s2); }
.cal-day { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 3px 0 2px; border: 0; border-radius: 12px; background: transparent; transition: background-color .2s, transform .2s var(--ease); }
.cal-day .bloom { width: 78%; height: auto; flex: none; }
.cal-day .n { margin-top: 1px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day:disabled { opacity: .3; cursor: default; }
.cal-day:not(:disabled):hover { background: var(--sand); transform: scale(1.06); }
.cal-day.today { outline: 2px solid var(--plum); outline-offset: -1px; background: var(--white); }
.cal-day.today .n { color: var(--plum); font-weight: 700; }
.cal-blank { aspect-ratio: 1; }
.clist, .wdlist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s4); }
.crow .ctop { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; font-size: 14px; }
.crow .ctop strong { font-weight: 500; }
.cbar { height: 10px; border-radius: 9999px; background: var(--sand); margin: var(--s2) 0 var(--s1); overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: 9999px; background: var(--pink); }
.cbar.watch i { background: #E8B04A; }
.cbar.act i { background: #D6574F; }
.cbar.ongoing i { background: repeating-linear-gradient(90deg, var(--pink) 0 8px, var(--petal) 8px 12px); }
.crow.now .ctop strong::after { content: ' \00b7  now'; color: var(--accent); }
.wdlist { gap: var(--s3); }
.wdlist li { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.wdlist li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ============================ Remedies ============================ */
.remedies { display: grid; gap: var(--gap); }
.planside { display: grid; gap: var(--gap); min-width: 0; }
.safe-note { display: flex; gap: var(--s4); background: var(--watch-bg); border-color: var(--watch-bg); color: var(--watch-fg); }
.safe-note > .ic { width: 30px; height: 30px; margin-top: 2px; color: var(--watch-fg); }
.safe-note h2 { color: var(--watch-fg); font-size: 17px; }
.safe-note ul { padding-left: 18px; font-size: 14px; display: grid; gap: var(--s2); }
details.safe-note { display: block; }
.safe-note > summary { color: var(--watch-fg); font-size: 17px; }
.safe-note > summary > .ic { width: 24px; height: 24px; flex: none; }
.safe-note > summary > span { flex: 1; text-align: left; margin-left: var(--s3); }
.safe-note > summary::after { color: var(--watch-fg); }
.safe-note[open] > summary { margin-bottom: var(--s3); }
.addown { margin-top: var(--s2); }

.planlist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s4); }
.planrow { display: flex; align-items: center; gap: var(--s4); }
.planrow .pr-t { flex: 1; min-width: 0; }
.planrow .pr-t strong { display: block; font-weight: 500; }
.planrow .pr-t small { color: var(--muted); font-size: 12px; }
.planrow .goalbar { margin: var(--s2) 0 0; height: 6px; }
.myplan h2 small { font: 400 13px var(--font-body); }
.addown { margin-top: var(--s5); }
.addrow { display: flex; gap: var(--s2); }
.addrow .btn { min-height: 48px; padding: 0 var(--s5); }

.library-head .searchbox { display: block; margin: var(--s4) 0; }
.library-head .label { margin-top: var(--s4); }
.liblist { display: grid; gap: var(--s3); }
details.rem { padding: 0; overflow: hidden; }
details.rem summary { list-style: none; display: flex; align-items: center; gap: var(--s4); padding: var(--s4); cursor: pointer; min-height: 72px; }
details.rem summary::-webkit-details-marker { display: none; }
details.rem summary::after { content: '\203A'; margin-left: auto; font-size: 22px; color: var(--muted); transition: transform .2s var(--ease); }
details.rem[open] summary::after { transform: rotate(90deg); }
.rem-t { flex: 1; min-width: 0; }
.rem-t strong { display: block; font-weight: 500; line-height: 1.25; }
.rem-t small { color: var(--muted); font-size: 12px; }
.rem-tags { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.ev { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 3px 10px; border-radius: 9999px; background: var(--sand); color: var(--muted); }
.ev-strong { background: var(--ok-bg); color: var(--ok-fg); }
.ev-moderate { background: var(--icy); color: var(--on-icy); }
.ev-limited { background: var(--watch-bg); color: var(--watch-fg); }
.ev-early { background: var(--sand); color: var(--muted); }
.inplan { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok-fg); font-size: 13px; font-weight: 700; flex: none; }
.rem-body { padding: 0 var(--s4) var(--s4); border-top: 1px solid var(--line); }
.rem-body > p { margin-top: var(--s4); }
.rem-body dl { margin: var(--s2) 0 0; display: grid; gap: var(--s1); }
.rem-body dt { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: var(--s3); }
.rem-body dd { margin: 0; font-size: 14px; }
.wherelist { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wherelist span { background: var(--sand); border-radius: 9999px; padding: 2px 10px; font-size: 12px; }
.caution { margin-top: var(--s4); background: var(--watch-bg); color: var(--watch-fg); border-radius: 14px; padding: var(--s3) var(--s4); font-size: 14px; }

.remedy { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); align-items: center; }
.remedy .badge-ic { grid-row: 1; }
.remedy p { grid-column: 1 / -1; font-size: 14px; }
.remedy-list { display: grid; gap: var(--s3); }
ol.steps { margin: var(--s2) 0 0; padding-left: 20px; }
ol.steps li + li { margin-top: var(--s1); }
details.card > summary { cursor: pointer; font: 500 16px var(--font-head); color: var(--plum); min-height: 28px; }
details.card[open] > summary { margin-bottom: var(--s3); }
/* My health: the BMI box. Calm colours, no alarm: it is a rough guide, never a verdict. */
.bmibox { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--watch-bg); color: var(--watch-fg); }
.bmibox.healthy { background: var(--ok-bg); color: var(--ok-fg); }
.bmibox > div { min-width: 0; }
.bmibox strong, .bmibox small { display: block; }
.bmibox small { font-size: 13px; opacity: .9; }
.bmi-n { display: block; font: 600 32px/1 var(--font-head); }
.bmibox > div:first-child { text-align: center; flex: none; }
.bmibox > div:first-child small { margin-top: 2px; }

/* Today: the coaching line, the food diary, the cycle check-in */
.coach { display: flex; gap: var(--s4); align-items: flex-start; }
.coach > .ic { flex: none; width: 28px; height: 28px; margin-top: 2px; color: var(--plum); }
.coach > div { min-width: 0; }
.coach .label { margin-bottom: var(--s1); }
.coach-t { margin: 0 0 var(--s2); font-weight: 500; }
.coach.against { background: var(--watch-bg); color: var(--watch-fg); border-color: transparent; }
.coach.against .ic, .coach.against .label { color: var(--watch-fg); }
.coach.together { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.coach.together .ic, .coach.together .label { color: var(--ok-fg); }
.fslot + .fslot { margin-top: var(--s3); }
.flist { list-style: none; margin: var(--s1) 0 0; padding: 0; display: grid; gap: var(--s1); }
.flist li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s1) var(--s3); border-radius: 14px; background: var(--sand); }
.flist .iconbtn { width: 36px; height: 36px; min-height: 36px; flex: none; }
.ovmini { margin: var(--s2) 0 var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--sand); }
.ovmini strong, .ovmini small { display: block; }
.ovmini small { font-size: 13px; color: var(--muted); }
.ovmini.fertile, .ovmini.suspected, .ovmini.confirmed { background: var(--ok-bg); color: var(--ok-fg); }
.ovmini.fertile small, .ovmini.suspected small, .ovmini.confirmed small { color: inherit; }
.ovmini.approaching, .ovmini.late { background: var(--watch-bg); color: var(--watch-fg); }
.ovmini.approaching small, .ovmini.late small { color: inherit; }

/* Cycle: today's ovulation status */
.ovcard h2 { margin-bottom: var(--s2); }
.ovcard.fertile, .ovcard.suspected, .ovcard.confirmed { border-color: var(--ok-fg); }
.ovcard.approaching, .ovcard.late { border-color: var(--watch-fg); }
.ovfacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s3) 0; }
.ovfacts > div { text-align: center; padding: var(--s3) var(--s2); border-radius: 16px; background: var(--sand); min-width: 0; }
.ovfacts strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.ovfacts .num { font: 600 26px/1.1 var(--font-head); }
.ovfacts small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ovpast { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); font-size: 14px; }
.ovpast li { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s3); }
.ovpast li small { grid-column: 1 / -1; color: var(--muted); }

/* Progress and My plan: the weekly focus and weeks of food */
.focuscard { border-color: var(--accent); }
.focuscard h2 { margin-bottom: var(--s2); }
.fweek { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.fweek:first-of-type { border-top: 0; }
.fweek p { margin: var(--s1) 0 0; }
.planwrap > .seg { display: flex; gap: var(--s2); margin: 0 0 var(--gap); }
.planwrap > .seg .chip { flex: 1; min-height: 52px; font-size: 16px; }
.nutrition h3 { margin: var(--s3) 0 var(--s1); font-size: 15px; }
.nuchips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.nutrition .field + .field { margin-top: var(--s4); }
.tiny { font-size: 11px; margin-top: var(--s3); }
.nutrition .pill.ghost { color: var(--ink); border-color: var(--muted); margin-left: var(--s2); vertical-align: middle; white-space: nowrap; }
.nulist { list-style: none; margin: 0; padding: 0; }
.nulist li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.nulist li:first-child { border-top: 0; }
.nulist li > .nuchips { margin-top: 0; justify-content: flex-end; }
.nutrition .nu-meals details.guide > summary > span { display: block; min-width: 0; }
.nutrition .nu-meals details.guide > summary small { display: block; margin-bottom: 2px; font-family: inherit; font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.nutrition .nu-meals details.guide > summary > span > span { display: block; }
.foodguide > .small { margin: var(--s1) 0 var(--s3); }
.guidegrid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 640px) { .guidegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide.cut { background: var(--act-bg); border-color: var(--act-bg); color: var(--act-fg); }
.guide.more { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-fg); }
.guide > summary, .guide .doc > summary, .guide .small, .guide small, .guide strong { color: inherit; }
.guide .doc, .guide .helpitem { border-top: 1px solid currentColor; }
.guide .doc, .guide .helpitem { border-top-color: color-mix(in srgb, currentColor 30%, transparent); }
.guide .helpitem small, .guide .small.muted { color: inherit; opacity: .85; }
.guide > .doc-body { padding-bottom: 0; }
.guide > summary::after { color: inherit; }
.helpitem { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.helpitem:first-of-type { margin-top: var(--s2); }
.helpitem strong, .helpitem small { display: block; }
.helpitem small { color: var(--muted); font-size: 13px; }
.helpitem p { margin: var(--s1) 0 0; }

/* the food picker sheet */
.sheet .searchbox { display: block; }
.sheet .chips.rf { margin-bottom: var(--s2); }
.sheet .label { margin: var(--s3) 0 var(--s2); }
.daylist.plain li { display: flex; justify-content: space-between; gap: var(--s3); }

/* Doctor: prepare my visit */
.rpsections { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.rpsec { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border-radius: 16px; background: var(--sand); cursor: pointer; }
.rpsec strong, .rpsec small { display: block; }
.rpsec small { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Dropdowns: the same look as the text fields, opening the app's own picker. The chosen row carries the app's check mark. */
.dd { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; min-height: 48px; padding: var(--s2) var(--s4); border: 1.5px solid var(--line); border-radius: 16px; background: var(--cream); color: var(--ink); font-size: 16px; line-height: 1.4; text-align: left; cursor: pointer; box-shadow: inset 0 1px 2px rgba(75, 46, 99, .06); transition: border-color .2s, background-color .2s; }
.dd > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd.empty > span { color: var(--muted); }
.dd-ch { flex: none; color: var(--muted); }
.dd:hover { border-color: var(--thistle); }
.dd:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
.ddlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.ddopt { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; min-height: 56px; padding: var(--s3) var(--s4); border: 1.5px solid transparent; border-radius: 16px; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.35; text-align: left; cursor: pointer; transition: background-color .15s; }
.ddopt:hover { background: var(--sand); }
.ddopt.on { background: var(--sand); border-color: var(--thistle); font-weight: 600; }
.ddopt .ic { flex: none; width: 22px; height: 22px; color: var(--plum); stroke-width: 2.6; }
.ddsheet .sheet-head h2 { font-size: 19px; line-height: 1.3; }

/* Checkboxes: the same rounded box and check mark as the rest of the app, never the browser's own */
.ck-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ck-ui { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; border: 2px solid var(--thistle); background: var(--surface); display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.ck-ui .ic { width: 16px; height: 16px; color: #fff; stroke-width: 3.2; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease); }
.ck-in:checked + .ck-ui { background: var(--plum-solid); border-color: var(--plum-solid); }
.ck-in:checked + .ck-ui .ic { opacity: 1; transform: none; }
.ck-in:focus-visible + .ck-ui { outline: 3px solid var(--plum); outline-offset: 2px; }

/* Questions: a clear sentence, then the answer. Yes / No buttons, tick lists, and follow-ups that only appear after "Yes". */
.label.ask { font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); margin: var(--s5) 0 var(--s2); line-height: 1.35; }
.label.ask::before { display: none; }
.card > .label.ask:first-child, .card > .label:first-child + .label.ask { margin-top: var(--s2); }
.field.q { margin-top: var(--s4); }
.field.q > .label.ask { margin-top: 0; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.yn-b { min-height: 52px; font-size: 16px; }
.ticks { display: grid; gap: var(--s2); margin: var(--s2) 0; }
.tickrow { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: var(--s2) var(--s3); border-radius: 16px; border: 1.5px solid var(--line); background: var(--cream); color: var(--ink); font-size: 16px; text-align: left; cursor: pointer; transition: background-color .15s, border-color .15s; }
.tickrow:hover { border-color: var(--thistle); }
.tickrow.on { background: var(--sand); border-color: var(--thistle); }
.tickrow.on .ck-ui { background: var(--plum-solid); border-color: var(--plum-solid); }
.tickrow.on .ck-ui .ic { opacity: 1; transform: none; }
.tickrow:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }

/* Help and about: the policies and sources, all in one card, each one folding open */
.docs details.doc { border-top: 1px solid var(--line); }
.docs details.doc:first-of-type { margin-top: var(--s3); }
.docs details.doc:last-of-type { border-bottom: 1px solid var(--line); }
.doc > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); cursor: pointer; min-height: 52px; padding: var(--s2) 0; font: 500 16px var(--font-head); color: var(--plum); }
.doc > summary::-webkit-details-marker { display: none; }
.doc > summary::after { content: '\203A'; font-size: 22px; color: var(--muted); transition: transform .2s var(--ease); }
.doc[open] > summary::after { transform: rotate(90deg); }
.doc-body { padding: 0 0 var(--s4); display: grid; gap: var(--s2); }
.doc-body h3 { margin: var(--s3) 0 0; font-size: 15px; }
.doc-body p, .doc-body ul { margin: 0; }
.doc-body ul:not(.sources) { padding-left: 18px; display: grid; gap: var(--s1); }
.disclaimer { background: var(--sand); border-color: var(--sand); font-size: 14px; }
.sources { margin: var(--s2) 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: var(--s1); }

/* ============================ Settings ============================ */
.settings-menu { display: grid; gap: var(--gap); }
.profile { display: flex; align-items: center; gap: var(--s4); }
.profile strong { display: block; font: 500 20px var(--font-head); color: var(--plum); }
.profile small { color: var(--muted); font-size: 13px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--plum-solid); display: grid; place-items: center; padding: 8px; flex: none; }
.avatar svg { width: 100%; height: 100%; }
.menu { padding: var(--s2); overflow: hidden; }
.menu-row { position: relative; display: flex; align-items: center; gap: var(--s4); width: 100%; padding: var(--s4); border: 0; border-radius: 16px; background: transparent; text-align: left; transition: background-color .2s; }
/* the divider is a short line inside the row, so the hover can be a rounded shape that follows the item */
.menu-row + .menu-row::before { content: ''; position: absolute; top: 0; left: var(--s4); right: var(--s4); height: 1px; background: var(--line); }
.menu-row:hover { background: var(--cream); }
.menu-row:hover::before, .menu-row:hover + .menu-row::before { background: transparent; }
.mr-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--sand); color: var(--plum); display: grid; place-items: center; flex: none; }
.mr-t { flex: 1; min-width: 0; }
.mr-t strong { display: block; font-weight: 500; }
.mr-t small { display: block; color: var(--muted); font-size: 13px; }
.chev { font-size: 24px; color: var(--muted); }
.page-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h2 { margin: 0; font-size: 22px; }
.back { border: 0; background: var(--sand); color: var(--plum); border-radius: 9999px; min-height: 44px; padding: 0 var(--s4); font-weight: 500; }
.settings-grid { display: grid; gap: var(--gap); align-items: start; }
.settings-grid > * { min-width: 0; }
.settings-grid input[type="number"], .settings-grid input[type="text"], .settings-grid input[type="date"] { min-width: 0; max-width: 100%; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); cursor: pointer; }
.sr-t strong { display: block; font-weight: 500; }
.sr-t small { color: var(--muted); font-size: 13px; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ui { position: relative; width: 52px; height: 30px; border-radius: 9999px; background: var(--line); flex: none; transition: background-color .2s; }
.sw-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch-row input:checked + .sw-ui { background: var(--plum-solid); }
.switch-row input:checked + .sw-ui::after { transform: translateX(22px); }
.switch-row input:focus-visible + .sw-ui { outline: 3px solid var(--plum); outline-offset: 2px; }
.status { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s3); }
.status li { display: flex; justify-content: space-between; gap: var(--s4); align-items: baseline; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.status li:last-child { border-bottom: 0; padding-bottom: 0; }
.status strong { text-align: right; font-weight: 500; }
.status .good { color: var(--ok-fg); }
.status .warn { color: var(--watch-fg); }
.howto { margin-top: var(--s4); }
.howto summary { cursor: pointer; font-weight: 500; color: var(--plum); min-height: 28px; }

/* ============================ welcome and lock ============================ */
.welcome { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.welcome .hero { flex-direction: column; align-items: flex-start; padding-bottom: var(--s6); padding-top: max(40px, var(--safe-top)); gap: var(--s2); }
.welcome .hero h1 { font-size: 30px; }
.welcome .hero p { max-width: 34ch; }
.welcome .botanical { width: 190px; }
.welcome main { padding-top: var(--s6); padding-bottom: calc(var(--s7) + var(--safe-bottom)); } /* room under the last button, above the phone's gesture bar */
.welcome .panel-stack { gap: var(--s3); }
.welcome-bloom { position: relative !important; width: 84px; height: 84px; margin-bottom: var(--s2); }
.welcome-bloom svg { width: 100%; height: 100%; }
.promise strong { display: block; font: 500 16px var(--font-head); color: var(--plum); margin-bottom: var(--s1); }
.welcome .btn { width: 100%; }
.welcome .btn + .btn { margin-top: var(--s2); }

#lock { position: fixed; inset: 0; z-index: 70; background: var(--hero-bg) var(--pat-sparkle); color: var(--hero-text); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s5); text-align: center; }
#lock[hidden] { display: none; }
#lock h1 { color: var(--hero-text); font-size: 26px; margin-bottom: var(--s2); }
#lock form { width: 100%; max-width: 280px; margin-top: var(--s4); display: grid; gap: var(--s3); }
#lock input { text-align: center; letter-spacing: .3em; color: var(--ink); }
#lock .btn { background: var(--pink); border-color: var(--pink); color: var(--ink); }
#lock .msg { color: var(--on-hero-accent); }
#lock .foot { color: var(--hero-text); opacity: .85; margin-top: var(--s5); max-width: 320px; }

/* ============================ motion ============================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3) rotate(-6deg); } 100% { transform: scale(1); } }
  @keyframes petalglow { 0% { opacity: .15; filter: brightness(1.6); } 100% { opacity: 1; filter: none; } }
  @keyframes ringin { from { stroke-dashoffset: 170; } }
  @keyframes barin { from { width: 0; } }
  @keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

  main.enter > *, main.enter .col > *, main.enter .pcol > *, main.enter .panel-stack > *, main.enter .settings-grid > * { animation: rise .55s var(--ease) both; }
  main.enter .col > :nth-child(2), main.enter .pcol > :nth-child(2), main.enter .panel-stack > :nth-child(2), main.enter .settings-grid > :nth-child(2) { animation-delay: .06s; }
  main.enter .col > :nth-child(3), main.enter .pcol > :nth-child(3), main.enter .panel-stack > :nth-child(3), main.enter .settings-grid > :nth-child(3) { animation-delay: .12s; }
  main.enter .col > :nth-child(4), main.enter .pcol > :nth-child(4), main.enter .panel-stack > :nth-child(4) { animation-delay: .18s; }
  main.enter .col > :nth-child(5), main.enter .pcol > :nth-child(5) { animation-delay: .24s; }
  main.enter .col > :nth-child(n+6) { animation-delay: .3s; }
  main.enter .ritual { animation: rise .5s var(--ease) both; }
  main.enter .ritual:nth-child(2) { animation-delay: .05s; } main.enter .ritual:nth-child(3) { animation-delay: .1s; }
  main.enter .ritual:nth-child(4) { animation-delay: .15s; } main.enter .ritual:nth-child(5) { animation-delay: .2s; } main.enter .ritual:nth-child(6) { animation-delay: .25s; }
  .entering .ring .bar { animation: ringin 1s var(--ease) .1s both; }
  .entering .lv-bar i, main.enter .goalbar i, main.enter .cbar i { animation: barin .9s var(--ease) .2s both; }
  .badge-ic.pop { animation: pop .5s var(--ease); }
  .petal.grow { animation: petalglow .7s var(--ease); }
  .toast { animation: toastin .35s var(--ease); }
  .welcome-bloom { animation: floaty 5s ease-in-out infinite; }
  .bigbloom .bloom { transition: transform .4s var(--ease); }
  .bigbloom:hover .bloom { transform: rotate(18deg) scale(1.04); }
  @media (hover: hover) {
    .card, .ritual, .stat, .tile, .menu-row, .badge { transition: transform .25s var(--ease), box-shadow .25s, background-color .25s, color .25s; }
    .ritual:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(75, 46, 99, .14); }
    details.rem:hover, .stat:hover, .tile:hover, .badge.earned:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(75, 46, 99, .10); }
    .btn:hover { box-shadow: 0 6px 14px rgba(75, 46, 99, .22); }
    .navbtn:not([aria-current="page"]):hover { background: var(--line); }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===================================================================
   Tablet (768px to 1023px): one centred column with two-up grids
   =================================================================== */
@media (min-width: 768px) {
  :root { --gutter: 32px; --gap: 20px; --pad: 20px; }
  .content { max-width: 720px; }
  .dock { max-width: 640px; }
  .rituals { grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
  .settings-grid, .panel-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid > .span, .panel-grid > .span { grid-column: 1 / -1; }
  .hero h1 { font-size: 30px; }
  .badges { grid-template-columns: repeat(3, 1fr); }
}

/* ===================================================================
   Web (1024px and up). Designed at 1440px wide:
   280px rail + a centred 1160px workspace, 48px page padding, 24px gaps.
   Every card uses 24px padding and 24px gaps, so edges and columns line up.
   =================================================================== */
@media (min-width: 1024px) {
  :root { --gutter: 48px; --gap: 24px; --pad: 24px; --radius: 24px; --rail: 280px; }
  body { font-size: 16px; }
  h2 { font-size: 22px; margin-bottom: var(--s4); }
  .label { font-size: 12px; }
  .small { font-size: 14px; }

  .app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
  .dock, .foot { display: none; }
  .welcome .foot { display: block; }
  #toasts { bottom: var(--s6); left: var(--rail); }

  .rail {
    display: flex; flex-direction: column; gap: var(--s5);
    position: sticky; top: 0; height: 100vh; padding: var(--s6) var(--s4) var(--s5);
    background: var(--sand) var(--pat-dots); border-right: 1px solid var(--line); overflow-y: auto;
  }
  .brand { display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s2) var(--s2); font: 500 19px/1.2 var(--font-head); color: var(--plum); }
  .brand svg { width: 44px; height: 44px; flex: none; }
  .rail nav { display: grid; gap: var(--s2); }
  .rail .navbtn { flex-direction: row; justify-content: flex-start; gap: var(--s4); min-height: 52px; padding: 0 var(--s4); font-size: 16px; }
  .rail .navbtn .ic { width: 22px; height: 22px; }
  .rail .navbtn:not([aria-current="page"]):hover { background: var(--rail-hover); }
  .rail .hero-level { flex: none; background: var(--white); border-color: var(--line); color: var(--ink); }
  .rail .lv-bar { background: var(--sand); }
  .rail .lv-bar i { background: var(--accent-solid); }
  .rail .lv-badge { background: var(--sand); color: var(--plum); }
  .safety { margin-top: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: var(--s4); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
  .safety p + p { margin-top: var(--s2); }

  .content { max-width: 1160px; width: 100%; margin: 0 auto; padding: var(--s6) var(--gutter) var(--s8); }
  main { padding: var(--s6) 0 0; }

  /* hero banner: ring, greeting, level card on one aligned row */
  .hero { display: grid; grid-template-columns: auto minmax(0, 1fr) 300px; gap: var(--s6); align-items: center; border-radius: 28px; padding: var(--s6) var(--s7) var(--s6) var(--s6); min-height: 208px; }
  .hero::after { display: none; }
  .ring-wrap { width: 112px; height: 112px; }
  .ring-wrap span { font-size: 30px; }
  .hero .greet { font-size: 17px; }
  .hero h1 { font-size: 44px; margin-top: var(--s1); }
  .hero .affirm { font-size: 17px; margin-top: var(--s2); }
  .pills { margin-top: var(--s4); gap: var(--s2); }
  .pill { font-size: 13px; padding: 6px 16px; }
  .hero-level { padding: var(--s4) var(--s5); border-radius: 20px; }
  .hero-level .lv-top strong { font-size: 17px; }
  .botanical { width: 230px; right: 10px; opacity: .26; }

  /* Today: rituals and tracking on the left (7), the day's numbers on the right (5) */
  .notices { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: var(--s6); }
  .datenav { justify-content: flex-start; gap: var(--s4); margin-bottom: var(--s5); }
  .datenav .mid { min-width: 160px; text-align: left; }
  .datenav .mid strong { font-size: 24px; }
  .today-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s5); align-items: start; }
  .col { display: flex; flex-direction: column; gap: var(--s5); }
  .col > * { order: 0 !important; }
  .rituals { grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
  .ritual { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: var(--s4); min-height: 120px; padding: var(--s5); border-radius: 22px; font-size: 16px; }
  .ritual .badge-ic { width: 48px; height: 48px; }
  .encourage { font-size: 19px; padding: var(--s5); }
  .bloomcard { padding: var(--s5); gap: var(--s5); }
  .bigbloom { width: 150px; }
  .bloomtxt strong { font-size: 38px; }
  .bento { grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
  .stat.day { display: none; }
  .stat { padding: var(--s5) var(--s4); border-radius: 20px; }
  .stat strong { font-size: 32px; }
  .stat .sub { font-size: 12.5px; }
  .chips.five .chip { min-height: 76px; }
  .weekdays .wd .bloom { max-width: 44px; }
  .chip { font-size: 15px; }

  /* Progress */
  .progress-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
  .pcol { display: flex; flex-direction: column; gap: var(--s5); }
  .pcol > * { order: 0 !important; }
  .pcol.heatcol { grid-column: 1; grid-row: 1; }
  .pcol.sidecol { grid-column: 2; grid-row: 1; }
  .grid { gap: var(--s2); }
  .tile { padding: var(--s5) var(--s2); }
  .tile strong { font-size: 32px; }
  .badges { grid-template-columns: repeat(2, 1fr); }

  /* Cycle */
  .panel-grid.cycle { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s5); }
  .cal-day .n { font-size: 12px; }

  /* Remedies: her plan and her saved-for-later list stack on the left, the library sits on the right. Nothing is sticky:
     a pinned column cut off the saved list and the page jumped while she scrolled. */
  .remedies { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s5); align-items: start; }
  .remedies > * { grid-column: 1 / -1; }
  .remedies > .planside { grid-column: 1 / span 5; grid-row: 2 / span 2; }
  .remedies > .library-head { grid-column: 6 / -1; grid-row: 2; }
  .remedies > .liblist { grid-column: 6 / -1; grid-row: 3; }
  .remedy-list { grid-template-columns: repeat(2, 1fr); }

  /* Settings and everything built on grids */
  /* the Settings cards follow the page width, like the other tabs (they used to stop at 720px) */
  .settings-grid, .panel-grid { gap: var(--s5); }
  .page-head { margin-bottom: var(--s6); }
  .welcome { max-width: 560px; }
  .welcome-bloom { width: 96px; height: 96px; }
}

/* Very small phones */
@media (max-width: 359px) {
  .chips.five { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: 1fr; }
}

/* ============================ setup, symptoms, periods, insights ============================ */
.stackcards { display: grid; gap: var(--gap); }
.symchips { display: grid; gap: var(--s3); }
.chip.sym {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); text-align: left;
  min-height: 64px; padding: var(--s3) var(--s4); border-radius: 18px; font-weight: 400; white-space: normal;
}
.chip.sym strong { font-weight: 500; font-size: 15px; line-height: 1.3; }
.chip.sym small { color: var(--muted); font-size: 12.5px; line-height: 1.4; opacity: 1; }
.chip.sym span { font-size: 13.5px; line-height: 1.45; }
.chip.sym[aria-pressed="true"] small { color: var(--ink); }
.symgroup h2 { font-size: 17px; }
.chips.remchips .chip { text-align: left; white-space: normal; }
.mysym .chip { min-height: 44px; }
.col > .mysym { order: 4; }

.setup .hero { padding-bottom: var(--s6); }
.setup .stepnav { justify-content: space-between; margin-top: var(--s2); }
.setup .stepnav .btn { flex: 1; }
.setup .skip { width: 100%; border-color: transparent; background: transparent; }
.dots { display: inline-flex; align-items: center; gap: var(--s2); margin-left: var(--s2); vertical-align: middle; }
.dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--ring-track); }
.dots i.on { width: 22px; border-radius: 9999px; background: var(--pink); }
.dots i.done { background: var(--petal); }

.periodlist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); }
.periodlist li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.periodlist li:last-child { border-bottom: 0; padding-bottom: 0; }

.inslist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); }
.ins { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: 16px; background: var(--sand); font-size: 14px; }
.ins .ic { margin-top: 1px; color: var(--plum); }
.ins.tip { background: var(--watch-bg); color: var(--watch-fg); } .ins.tip .ic { color: var(--watch-fg); }
.ins.doctor { background: var(--act-bg); color: var(--act-fg); } .ins.doctor .ic { color: var(--act-fg); }
.ev.match { background: var(--pink); color: var(--ink); }
.ev.care { background: var(--watch-bg); color: var(--watch-fg); }
.caution.personal { margin-top: var(--s2); }
/* a personal warning under a plan remedy is a block of its own, so it never runs into the evidence line above it */
.planrow .pr-t .caution { display: block; margin: var(--s2) 0 0; font-size: 13px; line-height: 1.4; color: var(--watch-fg); }

@media (min-width: 768px) {
  .symchips { grid-template-columns: 1fr 1fr; }
  .symchips.drivers { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .welcome.setup { max-width: 720px; }
  .symchips { gap: var(--s4); }
}

/* =====================================================================
   Decorative layer: patterns so no card is a flat block.
   Each ritual has its own motif in its own colour. Every card gets a soft petal corner,
   a leaf bullet on small labels and a three-dot accent under headings.
   ===================================================================== */
:root {
  --pat-sparkle-plum: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 12l2.2 7 7 2.2-7 2.2-2.2 7-2.2-7-7-2.2 7-2.2z' fill='%234B2E63' fill-opacity='.07'/%3E%3C/svg%3E");
}

/* ---- ritual tiles: a motif each, a big soft ring in the corner ---- */
.ritual { position: relative; overflow: hidden; background-color: var(--bg); background-image: var(--pat); background-repeat: repeat; }
.ritual.done { background-color: var(--fg); background-image: var(--patd); }
.ritual > * { position: relative; z-index: 1; }
.ritual::before, .ritual::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; border: 2px solid currentColor; opacity: .10; }
.ritual::before { width: 120px; height: 120px; right: -38px; top: -42px; }
.ritual::after { width: 190px; height: 190px; right: -74px; top: -78px; opacity: .06; }

/* steam waves for the two cups of tea */
.ritual:nth-child(1), .ritual:nth-child(2) {
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='40'%3E%3Cg fill='none' stroke='%2317406B' stroke-opacity='.16' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M9 34c5-6-5-9 0-15M25 22c5-6-5-9 0-15'/%3E%3C/g%3E%3C/svg%3E");
  --patd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='40'%3E%3Cg fill='none' stroke='%23BDE0FE' stroke-opacity='.20' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M9 34c5-6-5-9 0-15M25 22c5-6-5-9 0-15'/%3E%3C/g%3E%3C/svg%3E");
}
/* leaves for the greens */
.ritual:nth-child(3) {
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%230B3F5E' stroke-opacity='.17' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M8 30c0-10 7-16 18-17 0 11-7 17-16 17zM8 30c4-6 8-10 14-12'/%3E%3C/g%3E%3C/svg%3E");
  --patd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23A2D2FF' stroke-opacity='.22' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M8 30c0-10 7-16 18-17 0 11-7 17-16 17zM8 30c4-6 8-10 14-12'/%3E%3C/g%3E%3C/svg%3E");
}
/* beans and pods for the legumes */
.ritual:nth-child(4) {
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg fill='%237A1F4A' fill-opacity='.12'%3E%3Cellipse cx='12' cy='13' rx='7' ry='3.8' transform='rotate(-32 12 13)'/%3E%3Cellipse cx='30' cy='30' rx='7' ry='3.8' transform='rotate(-32 30 30)'/%3E%3Ccircle cx='31' cy='9' r='1.6'/%3E%3Ccircle cx='8' cy='33' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  --patd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg fill='%23FFC8DD' fill-opacity='.16'%3E%3Cellipse cx='12' cy='13' rx='7' ry='3.8' transform='rotate(-32 12 13)'/%3E%3Cellipse cx='30' cy='30' rx='7' ry='3.8' transform='rotate(-32 30 30)'/%3E%3Ccircle cx='31' cy='9' r='1.6'/%3E%3Ccircle cx='8' cy='33' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
/* a heartbeat line for movement */
.ritual:nth-child(5) {
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='36'%3E%3Cpath d='M0 20h12l4-10 6 20 4-10h22' fill='none' stroke='%236B1840' stroke-opacity='.16' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --patd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='36'%3E%3Cpath d='M0 20h12l4-10 6 20 4-10h22' fill='none' stroke='%23FFAFCC' stroke-opacity='.22' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* moons and stars for sleep */
.ritual:nth-child(6) {
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52'%3E%3Cg fill='%233F2358' fill-opacity='.13'%3E%3Cpath d='M16 10a8 8 0 1 0 8 11 6.5 6.5 0 0 1-8-11z'/%3E%3Cpath d='M40 30l1.6 4.4 4.4 1.6-4.4 1.6L40 42l-1.6-4.4-4.4-1.6 4.4-1.6z'/%3E%3Ccircle cx='38' cy='9' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  --patd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52'%3E%3Cg fill='%23CDB4DB' fill-opacity='.20'%3E%3Cpath d='M16 10a8 8 0 1 0 8 11 6.5 6.5 0 0 1-8-11z'/%3E%3Cpath d='M40 30l1.6 4.4 4.4 1.6-4.4 1.6L40 42l-1.6-4.4-4.4-1.6 4.4-1.6z'/%3E%3Ccircle cx='38' cy='9' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- every card: soft petal corner, leaf bullet on labels, three-dot accent under headings ---- */
.card { position: relative; }
.card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; background: var(--pat-petals) no-repeat right -36px bottom -36px / 124px; opacity: .9; }
.card > * { position: relative; z-index: 1; }
.card.garden::after, .card.bloomcard::after { display: none; }
.label::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50% 0 50% 0; background: var(--pink); vertical-align: middle; }
.card > h2::after { content: ''; display: block; width: 10px; height: 4px; margin-top: 10px; border-radius: 9999px; background: var(--pink); box-shadow: 14px 0 0 var(--petal), 28px 0 0 var(--thistle); }
.card > h2 { margin-bottom: var(--s4); }

/* ---- small stat cards and tiles ---- */
.stat, .tile { position: relative; overflow: hidden; }
.stat::after, .tile::after { content: ''; position: absolute; right: -6px; top: -6px; width: 64px; height: 64px; background: var(--pat-dots); pointer-events: none; border-radius: 0 0 0 100%; }
.stat > *, .tile > * { position: relative; z-index: 1; }
.stat.ok::after, .stat.watch::after, .stat.act::after { opacity: .6; }

/* ---- the encouragement card gets sparkles ---- */
.encourage { background-image: var(--pat-sparkle-plum); }

/* ---- the big bloom sits in its own soft halo ---- */
.bigbloom { position: relative; z-index: 1; }
.bigbloom::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; background: var(--sand); opacity: .75; z-index: -1; }
.bigbloom::after { content: ''; position: absolute; inset: -24px; border-radius: 50%; border: 1.5px dashed var(--thistle); z-index: -1; }
.bigbloom .bloom { position: relative; }

/* ---- menu rows and progress bars: a hint of colour ---- */
.menu-row .mr-ic { transition: background-color .2s, color .2s; }
.menu-row:hover .mr-ic { background: var(--pink); color: var(--ink); }
.weekcard .goalbar i, .myplan .goalbar i { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }

/* give the bloom halo room inside its card */
.bigbloom { margin: 14px 14px 14px 20px; }
.bigbloom::before { inset: -12px; }
.bigbloom::after { inset: -20px; }

/* ============================ forecast and "is it working?" ============================ */
.forecast { background-color: var(--surface); border: 1.5px solid var(--thistle); }
.forecast.late { border-color: #E8B04A; }
.fc-label { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fc-big { font: 500 34px/1.15 var(--font-head); color: var(--accent); margin-top: var(--s1); }
.forecast.late .fc-big { color: var(--watch-fg); }
.fc-sub { font-size: 14px; margin-top: var(--s2); }
.fc-conf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s4) 0 var(--s2); }
.conf { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .02em; padding: 4px 12px; border-radius: 9999px; }
.conf-high { background: var(--ok-bg); color: var(--ok-fg); }
.conf-medium { background: var(--icy); color: var(--on-icy); }
.conf-low { background: var(--watch-bg); color: var(--watch-fg); }
.fclist { list-style: none; margin: var(--s4) 0; padding: 0; display: grid; gap: var(--s2); }
.fclist li { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s3); padding: var(--s3) var(--s4); border-radius: 14px; background: var(--sand); font-size: 14px; }
.fclist li strong { font-weight: 500; text-align: right; }
.fclist li small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.fclist li.ov { background: var(--icy); }
.fclist li.ov small { color: var(--on-icy); }
.fc-steps { display: flex; gap: var(--s2); margin-top: var(--s3); }
.fc-steps i { width: 36px; height: 8px; border-radius: 9999px; background: var(--sand); }
.fc-steps i.on { background: var(--pink); }

.rp .ins { margin-top: var(--s3); }
.ins.good { background: var(--ok-bg); color: var(--ok-fg); } .ins.good .ic { color: var(--ok-fg); }
.rpcompare { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.rptop { display: flex; justify-content: space-between; gap: var(--s3); font-size: 14px; }
.rptop strong { font-weight: 500; }
.rplist { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s3); }
.rplist li { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s3); font-size: 14px; }
.rplist .goalbar { grid-column: 1 / -1; height: 6px; margin: 0; }

/* calendar markers for the forecast */
.cal-day.pred-window { background: var(--act-bg); }
.cal-day.pred-mid { background: var(--act-bg); outline: 2px dashed var(--ring-nat); outline-offset: -2px; }
.cal-day.pred-fertile { background: var(--fert-bg); }
.cal-day:disabled.pred { opacity: 1; cursor: default; }
.cal-day.pred:disabled .bloom { opacity: .35; }
.pk { display: inline-block; width: 22px; height: 22px; border-radius: 8px; flex: none; margin: 0 6px; }
.pk.mid { background: var(--act-bg); outline: 2px dashed var(--ring-nat); outline-offset: -2px; }
.pk.window { background: var(--act-bg); }
.pk.fertile { background: var(--fert-bg); }

/* ============================ her own cost, and saved for later ============================ */
.costfield { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); font-size: 12px; color: var(--muted); }
.costfield input { width: 104px; min-height: 40px; padding: 4px 10px; border-radius: 12px; font-size: 16px; }
.plancost { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: 14px; background: var(--sand); font-size: 14px; }
.inplan.later { background: var(--petal); color: var(--accent); }
.wishcard .planrow { flex-wrap: wrap; }
.wishcard .planrow .btn { min-height: 40px; padding: 4px var(--s4); }

/* ============================ period calendar (tap days like a cycle app) ============================ */
.pcal .calnav { margin-top: var(--s4); }
.pgrid { gap: 4px; }
.pc-day, .pc-blank { aspect-ratio: 1; min-width: 0; }
.pc-day {
  border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); font-weight: 500; font-size: 15px;
  font-variant-numeric: tabular-nums; min-height: 40px; transition: background-color .15s, color .15s, transform .15s var(--ease);
}
.pc-day:not(:disabled):hover { background: var(--sand); transform: scale(1.06); }
.pc-day:active { transform: scale(.92); }
.pc-day:disabled { opacity: .3; cursor: default; }
.pc-day.nat { background: var(--accent-solid); color: #fff; }
.pc-day.nat:not(:disabled):hover { background: #8E1A4C; }
.pc-day.wd { background: var(--white); color: var(--ring-wd); box-shadow: inset 0 0 0 2px var(--ring-wd); }
.pc-day.today { box-shadow: inset 0 0 0 2px var(--plum); }
.pc-day.nat.today { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--plum); }
.pc-day.anchor { outline: 3px dashed var(--plum); outline-offset: 2px; }
.pc-hint { margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: 14px; background: var(--sand); }
.pc-actions { align-items: center; }
.monthjump { margin-left: auto; }
.monthjump input { min-height: 44px; min-width: 150px; }
.pc-legend { grid-template-columns: 1fr; margin-top: var(--s4); }
.pk.pdot { background: var(--accent-solid); border-radius: 50%; }
.pk.wdot { background: var(--white); box-shadow: inset 0 0 0 2px var(--ring-wd); border-radius: 50%; }
@media (min-width: 1024px) { .pc-day { font-size: 16px; min-height: 44px; } }

/* ============================ weekly check-in ============================ */
.weekly { border: 1.5px solid var(--thistle); }
.wkrow { margin-top: var(--s4); }
.wk-t { display: block; font-weight: 500; margin-bottom: var(--s2); font-size: 14px; }
.wkchips { gap: var(--s2); }
.wkchips .chip { min-height: 40px; padding: 4px 12px; font-size: 13px; }
.col > .weekly { order: 5; }

/* ============================ sign in ============================ */


.how-steps { list-style: none; counter-reset: how; margin: var(--s3) 0; padding: 0; display: grid; gap: var(--s3); }
.how-steps li { counter-increment: how; display: grid; grid-template-columns: 32px 1fr; column-gap: var(--s3); align-items: start; }
.how-steps li::before { content: counter(how); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--thistle); color: var(--ink, #2b2433); }
.how-steps strong { display: block; }

/* ============================ calendar sizing: right-sized for every device ============================ */
/* Phones use the full card width (cells come out around 40px). Bigger screens cap the calendar so
   it never balloons: about 52px cells on tablets and 58px on large screens, centred in its card. */
:root { --cal-max: 100%; }
@media (min-width: 560px) { :root { --cal-max: 380px; } }
@media (min-width: 1024px) { :root { --cal-max: 420px; } }
.cal .calnav, .cal .calgrid, .cal .legend, .pcal .calnav, .pcal .calgrid, .pcal .legend, .pcal .pc-hint {
  max-width: var(--cal-max); margin-inline: auto;
}
.cal-day .bloom { width: min(78%, 44px); }
.cal-day { min-height: 0; }
.pgrid .pc-day { max-height: 56px; }
.pc-day { font-size: clamp(13px, 3.6vw, 16px); }
@media (min-width: 560px) { .pc-day { font-size: 15px; } }
.calnav .arrow { flex: none; }

.badges > *, .badge { min-width: 0; }

/* ============================ doctor visits ============================ */
.visit { display: grid; gap: var(--s2); }
.visit .weekhead { align-items: baseline; }
.rxlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.rxlist li { padding: 8px 12px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); font-size: 14px; }
.rxkind { font-style: normal; font-size: 12px; color: var(--plum); background: var(--sand); border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.rxform { padding: var(--s3); margin-top: var(--s3); border: 1px dashed var(--thistle); border-radius: 16px; display: grid; gap: var(--s3); }
.rxform .timegrid { margin-top: 0; }
.rxprog { list-style: none; margin: var(--s3) 0; padding: 0; display: grid; gap: 8px; }
.rxprog li { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 0; border-bottom: 1px solid var(--line); }
.small-h { font-size: 15px; margin: var(--s4) 0 var(--s1); }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: 13px; }
.docplan { border: 1.5px solid var(--thistle); }
.chip small { display: block; font-size: 11px; opacity: .8; font-weight: 400; }
.visitform .btnrow { margin-top: var(--s3); }

/* suggested period days: lighter until she taps Done */
.pc-day.nat.pre { background: var(--pre-bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.pc-day.nat.pre.anchor { background: var(--accent-solid); color: #fff; }

/* doctor feedback in progress */
.docstatus { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--plum); border: 1px solid var(--line); }
.docstatus.better { background: var(--st-good-bg); color: var(--st-good-fg); border-color: var(--st-good-line); }
.docstatus.same { background: var(--st-same-bg); color: var(--st-same-fg); border-color: var(--st-same-line); }
.docstatus.worse { background: var(--st-bad-bg); color: var(--st-bad-fg); border-color: var(--st-bad-line); }
.docfeed-list { list-style: none; margin: var(--s3) 0; padding: 0; display: grid; gap: var(--s3); }
.docfeed-list li { padding: var(--s3); border: 1px solid var(--line); border-radius: 14px; background: var(--cream); display: grid; gap: var(--s2); }
.docfeed-list .weekhead { align-items: center; }
.lbl { font-weight: 500; }

/* ============================ sign in (redesigned) ============================ */
.si { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip; }
.si-sky {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 12% 8%, rgba(162, 210, 255, .55), transparent 70%),
    radial-gradient(55% 45% at 92% 12%, rgba(255, 200, 221, .6), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(205, 180, 219, .45), transparent 72%),
    linear-gradient(180deg, var(--si-g1) 0%, var(--si-g2) 55%, var(--si-g3) 100%);
}
.si-sky::after { content: ''; position: absolute; inset: 0; background: var(--pat-dots); opacity: .7; }
.si-grid {
  position: relative; z-index: 1; width: 100%; max-width: 1080px; margin: 0 auto; flex: 1;
  padding: calc(var(--safe-top) + var(--s5)) var(--gutter) var(--s5);
  display: grid; gap: var(--s5); align-content: start; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "brand" "card" "how";
}
.si-brand { grid-area: brand; text-align: center; display: grid; gap: var(--s3); justify-items: center; }
.si-name { display: inline-flex; align-items: center; gap: var(--s3); font-family: var(--font-head); font-size: 20px; color: var(--plum); }
.si-mini { width: 34px; height: 34px; }
.si-h { font-size: clamp(26px, 7vw, 40px); line-height: 1.15; color: var(--plum); margin: 0; max-width: 18ch; }
.si-lead { margin: 0; color: var(--muted); max-width: 40ch; }

.si-card {
  grid-area: card; width: 100%; max-width: 440px; margin: 0 auto; padding: 28px 24px 22px; text-align: center;
  background: var(--si-card);
  border: 1px solid var(--si-card-line); border-radius: 28px;
  box-shadow: 0 24px 60px rgba(75, 46, 99, .14), 0 2px 0 var(--si-card-shine) inset;
  display: grid; gap: var(--s3);
}
.si-tile { width: 64px; height: 64px; margin: -52px auto 4px; border-radius: 20px; background: var(--white); display: grid; place-items: center; box-shadow: 0 10px 26px rgba(75, 46, 99, .18); }
.si-tile svg { width: 40px; height: 40px; }
.si-title { margin: 0; font-size: 26px; color: var(--plum); }
.si-sub { margin: 0 auto; color: var(--muted); font-size: 14px; max-width: 34ch; }
.si-sub strong { color: var(--ink); word-break: break-all; }
.si-field { position: relative; display: block; text-align: left; }
.si-field .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.si-field input { padding-left: 46px; min-height: 52px; border-radius: 16px; font-size: 16px; }
.si-field:focus-within .ic { color: var(--plum); }
.si-btn {
  min-height: 52px; border: 0; border-radius: 16px; background: var(--plum-solid); color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .01em;
  box-shadow: 0 10px 22px rgba(75, 46, 99, .28); transition: transform .15s var(--ease), box-shadow .2s, background-color .2s;
}
.si-btn:hover:not(:disabled) { background: var(--plum-solid-hover); transform: translateY(-1px); }
.si-btn:active:not(:disabled) { transform: scale(.98); }
.si-btn:disabled { opacity: .6; box-shadow: none; }
.si-links { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.si-link { background: none; border: 0; padding: 8px 4px; min-height: 40px; color: var(--plum); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.si-link:disabled { opacity: .5; }
.si-card .msg { margin: 0; min-height: 1.2em; }
.si-or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-top: var(--s2); }
.si-or::before, .si-or::after { content: ''; flex: 1; border-top: 1px dashed rgba(75, 46, 99, .25); }
.si-trust { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.si-trust li { display: grid; justify-items: center; gap: var(--s2); padding: 12px 6px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--plum); }
.si-trust .ic { width: 22px; height: 22px; }
.si-fine { margin: 0; font-size: 12px; color: var(--muted); }

.si-how { grid-area: how; width: 100%; max-width: 440px; margin: 0 auto; padding: 22px; border-radius: 24px; background: var(--si-how-bg); border: 1px solid var(--si-how-line); }
.si-how h2 { margin: 0 0 var(--s3); color: var(--plum); }
.si-foot { position: relative; z-index: 1; padding: var(--s4) var(--gutter) calc(var(--s5) + var(--safe-bottom)); text-align: center; font-size: 12px; color: var(--muted); max-width: 640px; margin: 0 auto; }
.si-foot p { margin: 4px 0; }

/* web: story on the left, sign-in card on the right */
@media (min-width: 900px) {
  .si-grid { grid-template-columns: minmax(0, 1fr) 440px; grid-template-areas: "brand card" "how card"; gap: var(--s6) 72px; align-content: center; align-items: start; padding-block: 56px; }
  .si-brand { text-align: left; justify-items: start; padding-top: 24px; }
  .si-h { font-size: 44px; max-width: 14ch; }
  .si-lead { font-size: 17px; }
  .si-how { max-width: none; margin: 0; background: transparent; border: 0; padding: 0; }
  .si-card { margin: 0; align-self: center; grid-row: 1 / span 2; padding: 36px 32px 26px; }
  .si-tile { margin-top: -66px; width: 72px; height: 72px; }
}
@media (max-width: 380px) { .si-card { padding-inline: 18px; } .si-trust li { font-size: 11px; } }
@media (prefers-reduced-motion: no-preference) { .si-card { animation: si-in .5s var(--ease) both; } @keyframes si-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } } }
.si-brand { padding-bottom: 34px; }
@media (min-width: 900px) { .si-brand { padding-bottom: 0; } }


/* ============================ spacing system: one scale, used everywhere ============================ */
/*  4px  tight (icon to text)
    8px  a label or heading to what it introduces; chips and small items
   12px  between blocks inside a card; between buttons
   16px  before a row of buttons; between cards; card padding on phones
   24px  card padding and gaps on large screens (the --gap and --pad tokens step up by screen size)
   Cards that lay themselves out with flex or grid are left alone and use the same gap values. */
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > * + * { margin-top: var(--s3); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > :is(h2, h3, .label, .weekhead) + * { margin-top: var(--s2); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > * + :is(h2, h3) { margin-top: var(--s4); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > * + .btnrow { margin-top: var(--s4); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > .field + .field { margin-top: var(--s4); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > * + .msg { margin-top: var(--s2); }
.card:where(:not(.bloomcard, .encourage, .notice, .profile, .remedy, .safe-note, .visit)) > :first-child { margin-top: 0; }
/* a notice keeps its icon beside a column of text: same rhythm inside the column */
.notice > div > * + * { margin-top: var(--s2); }
.notice > div > * + .btnrow { margin-top: var(--s3); }
.card.visit { gap: var(--s3); }
.liblist { gap: var(--gap); }
.field { gap: var(--s2); }
.timegrid, .remchips, .chips { gap: var(--s2); }
.btnrow .btn { margin: 0; }
/* a row with no buttons in it takes no space at all */
/* a visit card spaces itself with a grid gap, so its button row only needs the extra 4px to make 16 */
.card.visit > .btnrow { margin-top: var(--s1); }
/* cards that sit side by side in Settings are the same height */
.settings-grid { align-items: stretch; }

/* the welcome and setup banners stack top to bottom at every screen size (the three-column banner is for the main app header) */
.welcome .hero { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: var(--s2); min-height: 0; border-radius: 0 0 28px 28px; padding: max(40px, var(--safe-top)) var(--gutter) var(--s6); }
.welcome .hero::after { display: block; }
.welcome .hero .greet { font-size: 16px; }
.welcome .hero h1 { font-size: 30px; margin-top: 0; }
@media (min-width: 1024px) { .welcome .hero { padding-inline: var(--s6); } .welcome .hero h1 { font-size: 34px; } }
/* on tablets and desktops the welcome and setup banner is a rounded card with space above it, not flush with the top edge */
@media (min-width: 600px) {
  .welcome { padding-top: var(--s7); }
  .welcome .hero { border-radius: 28px; }
  .welcome .hero::after { display: none; }
}

/* tablet: the app header is a rounded card with space above it, like the phone-to-desktop sizes either side */
@media (min-width: 600px) and (max-width: 1023px) {
  .content > .hero { margin: var(--s5) var(--gutter) var(--s4); border-radius: 28px; }
  .content > .hero::after { display: none; }
}
/* the period calendar days always fit their column (a fixed minimum height was forcing them wider and overlapping) */
.pc-day { min-height: 0; min-width: 0; width: 100%; }
@media (min-width: 1024px) { .pc-day { min-height: 0; } }

/* between 1024 and 1279px the side menu leaves little room: the header keeps ring + greeting side by side and puts the level card on its own row */
@media (min-width: 1024px) and (max-width: 1279px) {
  .content > .hero { grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); padding: var(--s6); }
  .content > .hero > .hero-level { grid-column: 1 / -1; }
  .content > .hero h1 { font-size: 36px; }
}

/* badges on phones: icon above the text, so the description gets the whole card width instead of a ~60px column */
@media (max-width: 480px) {
  .badge { flex-direction: column; align-items: center; text-align: center; gap: var(--s2); }
  .badge > div { width: 100%; }
}

/* remedy rows on phones: the evidence tags drop to their own line so the remedy name keeps its width */
@media (max-width: 480px) {
  details.rem summary { flex-wrap: wrap; row-gap: var(--s2); }
  details.rem summary::after { order: 2; }
  details.rem .rem-tags { order: 3; flex: 1 0 100%; justify-content: flex-start; }
}
/* badges fit as many columns as their card allows (a narrow side column gets one, never a 40px text column) */
.badges { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 768px) { .badges { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* sign-in on phones: a clean plain background, no coloured wash at the top or bottom */
@media (max-width: 899px) {
  .si-sky { background: var(--cream); }
  .si-sky::after { display: none; }
  .si-grid { padding-bottom: calc(var(--s6) + var(--safe-bottom)); }
}

/* the reminders list */
.remlist { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.remrow { display: grid; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.remrow input[type="time"] { max-width: 180px; }
.gcal-more summary { cursor: pointer; font-weight: 500; color: var(--plum); min-height: 32px; }
.gcal-more[open] summary { margin-bottom: var(--s3); }

/* her daily message */
.lovecard { background: linear-gradient(135deg, var(--love-a), var(--love-b) 60%, var(--love-c)); border-color: var(--love-line); }
.lovecard .lovetext { font-family: var(--font-head); font-size: 20px; line-height: 1.4; color: var(--plum); margin: 0; }
.col > .lovecard { order: 0; }
.lovelist { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); }
.lovelist li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3); border-radius: 14px; background: var(--cream); border: 1px solid var(--line); }
@media (min-width: 1024px) { .lovecard .lovetext { font-size: 22px; } }

.linkbtn { background: none; border: 0; padding: 0; color: var(--plum); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Phones: the purple header is a rounded card with cream above it, so the phone's top bar stays one calm colour. */
@media (max-width: 599px) {
  .content > .hero { margin: calc(var(--safe-top) + var(--s3)) var(--gutter) var(--s4); border-radius: 24px; padding-top: var(--s5); }
  .content > .hero::after { display: none; }
  .welcome { padding-top: calc(var(--safe-top) + var(--s3)); }
  .welcome .hero { margin-inline: var(--gutter); border-radius: 24px; padding: var(--s6) var(--s5); }
  .welcome .hero::after { display: none; }
}

/* The Android app only: a plain cream strip behind the clock and the bottom gesture bar, so page content never
   shows through them as it scrolls. The website and iPhone are not affected (the class is only set in the app). */
html.native body::before, html.native body::after { content: ''; position: fixed; left: 0; right: 0; z-index: 40; background: var(--cream); pointer-events: none; }
html.native body::before { top: 0; height: var(--safe-top); }
html.native body::after { bottom: 0; height: var(--safe-bottom); }

/* Android app: the "update is ready" banner */
.updatebar { margin: var(--s3) var(--gutter) 0; padding: var(--s4); border-radius: 20px; background: var(--surface); border: 1.5px solid var(--thistle); box-shadow: 0 6px 20px rgba(75, 46, 99, .10); display: grid; gap: var(--s3); }
.updatebar strong { display: block; font-weight: 600; margin-bottom: 2px; }
.updatebar span { color: var(--muted); font-size: 14px; }
.updatebar .btnrow { margin-top: 0; }
@media (min-width: 600px) { .updatebar { max-width: 560px; margin-inline: auto; } }

/* ===== Dark theme =====
   Follows the phone (prefers-color-scheme), unless she picks Light or Dark in Settings (data-theme on <html>).
   Everything that is a colour comes from the tokens above, so this block only restates the tokens. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #17101D; --surface: #221A2C; --sand: #2C2237; --line: #3F3250;
    --thistle: #54447A; --petal: #4D2A38; --pink: #5E3560; --icy: #233E69; --sky: #1F4D63;
  --lemon: #3B3718; --peach: #44301F; --aqua: #174D55; --aquamarine: #15493F; --celadon: #21502B;
  --teal: #19A5A2; --teal-text: #7FE3DA; --on-teal: #06201F;
    --plum: #E2CCF0; --ink: #F1E7F7; --muted: #B9A8C8; --accent: #FF8FB8;
    --ring-track: #6B4A86; --hero-text: #F6EEFB;
    --ok-bg: #123A38; --ok-fg: #86E8DC; --watch-bg: #3A2C12; --watch-fg: #F0C987; --act-bg: #3A1A24; --act-fg: #FF9AA4;
    --ring-nat: #FF6F8A; --ring-wd: #78AEEF;
    --plum-solid: #6B4399; --plum-solid-hover: #7D52AE; --hero-bg: #34204A; --accent-solid: #C2306E;
    --white: #2B2037; --on-icy: #BFDDFB; --fert-bg: #1F3550; --pre-bg: #7A3558;
    --st-good-bg: #12332B; --st-good-fg: #8FE0C3; --st-good-line: #1F5A48;
    --st-same-bg: #3A2C12; --st-same-fg: #F0C987; --st-same-line: #5A4620;
    --st-bad-bg: #3A1A24; --st-bad-fg: #FF9AA4; --st-bad-line: #5E2A3A;
    --love-a: #3A2036; --love-b: #2E1E33; --love-c: #271C3A; --love-line: #5A3552;
    --si-g1: #1B1630; --si-g2: #231A2E; --si-g3: #17101D;
  --si-card: rgba(34, 26, 44, .94); --si-how-bg: rgba(34, 26, 44, .6); --si-how-line: rgba(255, 255, 255, .08); --rail-hover: rgba(255, 255, 255, .08);
  --si-card-line: #3F3250; --si-card-shine: rgba(255, 255, 255, .04);
    --pat-page: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='white' fill-opacity='.035'%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3Ccircle cx='44' cy='44' r='2.4'/%3E%3Cellipse cx='44' cy='12' rx='2.2' ry='4.6'/%3E%3Cellipse cx='12' cy='44' rx='2.2' ry='4.6'/%3E%3C/g%3E%3C/svg%3E");
    --pat-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 0h28a14 14 0 0 1-28 0z' fill='%2334204A'/%3E%3C/svg%3E");
    --pat-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='3' r='1.4' fill='white' fill-opacity='.07'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); }
  :root:not([data-theme="light"]) input[type="search"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
  :root:not([data-theme="light"]) input[type="search"]::-webkit-search-cancel-button { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
  :root:not([data-theme="light"]) .hero::after { background-image: var(--pat-scallop); }
  :root:not([data-theme="light"]) .sw-ui { background: #4A3D5A; }
  :root:not([data-theme="light"]) .btn.ghost, :root:not([data-theme="light"]) .btn.danger { background: var(--surface); }
:root:not([data-theme="light"]) .ritual { background-color: color-mix(in srgb, var(--bg) 22%, var(--surface)); color: var(--bg); }
:root:not([data-theme="light"]) .ritual.done { background-color: var(--bg); color: var(--fg); }
:root:not([data-theme="light"]) .ritual .badge-ic { background: var(--bg); color: var(--fg); }
:root:not([data-theme="light"]) .ritual.done .badge-ic { background: var(--fg); color: var(--bg); }

}
:root[data-theme="dark"] {
  --cream: #17101D; --surface: #221A2C; --sand: #2C2237; --line: #3F3250;
  --thistle: #54447A; --petal: #4D2A38; --pink: #5E3560; --icy: #233E69; --sky: #1F4D63;
  --lemon: #3B3718; --peach: #44301F; --aqua: #174D55; --aquamarine: #15493F; --celadon: #21502B;
  --teal: #19A5A2; --teal-text: #7FE3DA; --on-teal: #06201F;
  --plum: #E2CCF0; --ink: #F1E7F7; --muted: #B9A8C8; --accent: #FF8FB8;
  --ring-track: #6B4A86; --hero-text: #F6EEFB;
  --ok-bg: #123A38; --ok-fg: #86E8DC; --watch-bg: #3A2C12; --watch-fg: #F0C987; --act-bg: #3A1A24; --act-fg: #FF9AA4;
  --ring-nat: #FF6F8A; --ring-wd: #78AEEF;
  --plum-solid: #6B4399; --plum-solid-hover: #7D52AE; --hero-bg: #34204A; --accent-solid: #C2306E;
  --white: #2B2037; --on-icy: #BFDDFB; --fert-bg: #1F3550; --pre-bg: #7A3558;
  --st-good-bg: #12332B; --st-good-fg: #8FE0C3; --st-good-line: #1F5A48;
  --st-same-bg: #3A2C12; --st-same-fg: #F0C987; --st-same-line: #5A4620;
  --st-bad-bg: #3A1A24; --st-bad-fg: #FF9AA4; --st-bad-line: #5E2A3A;
  --love-a: #3A2036; --love-b: #2E1E33; --love-c: #271C3A; --love-line: #5A3552;
  --si-g1: #1B1630; --si-g2: #231A2E; --si-g3: #17101D;
  --si-card: rgba(34, 26, 44, .94); --si-how-bg: rgba(34, 26, 44, .6); --si-how-line: rgba(255, 255, 255, .08); --rail-hover: rgba(255, 255, 255, .08);
  --si-card-line: #3F3250; --si-card-shine: rgba(255, 255, 255, .04);
  --pat-page: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='white' fill-opacity='.035'%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3Ccircle cx='44' cy='44' r='2.4'/%3E%3Cellipse cx='44' cy='12' rx='2.2' ry='4.6'/%3E%3Cellipse cx='12' cy='44' rx='2.2' ry='4.6'/%3E%3C/g%3E%3C/svg%3E");
  --pat-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 0h28a14 14 0 0 1-28 0z' fill='%2334204A'/%3E%3C/svg%3E");
  --pat-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='3' cy='3' r='1.4' fill='white' fill-opacity='.07'/%3E%3C/svg%3E");
  color-scheme: dark;
}
:root[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] input[type="search"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23B9A8C8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .hero::after { background-image: var(--pat-scallop); }
:root[data-theme="dark"] .sw-ui { background: #4A3D5A; }
:root[data-theme="dark"] .btn.ghost, :root[data-theme="dark"] .btn.danger { background: var(--surface); }
:root[data-theme="dark"] .ritual { background-color: color-mix(in srgb, var(--bg) 22%, var(--surface)); color: var(--bg); }
:root[data-theme="dark"] .ritual.done { background-color: var(--bg); color: var(--fg); }
:root[data-theme="dark"] .ritual .badge-ic { background: var(--bg); color: var(--fg); }
:root[data-theme="dark"] .ritual.done .badge-ic { background: var(--fg); color: var(--bg); }


/* Today: her remedy plan is the daily checklist */
.planlist { display: grid; gap: var(--s3); }
.planlist .weekhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.planedit { margin-top: 0; }
.plancta { border-color: var(--thistle); background: linear-gradient(135deg, var(--love-a), var(--love-b) 60%, var(--love-c)); }
.plancta h2 { margin-bottom: var(--s2); }
.plancta .btnrow { margin: var(--s4) 0 var(--s3); }

/* Save my day */
.saveday { margin-top: var(--gap); }
.saveday h2 { margin-bottom: var(--s2); }
.saveday .btnrow { margin-top: var(--s4); }
.saveday.saved { background: var(--ok-bg); border-color: var(--st-good-line); }
.saveday.saved h2 { color: var(--ok-fg); margin-bottom: 2px; }
.saveday.saved .small { color: var(--ok-fg); }
.saveday.saved .small.muted { color: var(--muted); margin-top: var(--s3); }
.savehead { display: flex; align-items: center; gap: var(--s3); }
.savetick { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ok-fg); color: var(--ok-bg); }
.savetick .ic { width: 22px; height: 22px; stroke-width: 2.4; }

/* Progress: what she logged on one day, as a bottom sheet (a centred card on bigger screens) */
body.sheet-open { overflow: hidden; }
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(23, 16, 29, .5); animation: sheetfade .2s ease; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 28px 28px 0 0;
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .28); padding-bottom: var(--safe-bottom); animation: sheetup .26s var(--ease);
}
.sheet-grab { width: 44px; height: 5px; border-radius: 9999px; background: var(--line); margin: var(--s3) auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4) var(--s2); flex: none; }
.sheet-head h2 { margin: 0; font-size: 21px; }
.sheet-date { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.sheet-head .small { margin-top: var(--s1); }
.sheet-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; padding: 0 var(--s4) var(--s3); display: grid; gap: var(--s4); align-content: start; -webkit-overflow-scrolling: touch; }
.sheet-bloom { display: flex; align-items: center; gap: var(--s3); }
.sheet-bloom svg { width: 76px; height: 76px; flex: none; }
.dayrow { display: grid; gap: var(--s2); }
.dayrow p { margin: 0; }
.daylist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.daylist li { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: 14px; background: var(--cream); border: 1px solid var(--line); font-weight: 500; }
.daylist li.didnt { color: var(--muted); font-weight: 400; }
.daytick { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); }
.daylist li.did .daytick { background: var(--ok-fg); border-color: var(--ok-fg); color: var(--ok-bg); }
.daytick .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.daymood { display: flex; align-items: center; gap: var(--s2); font-weight: 500; }
.daymood .ic { width: 26px; height: 26px; }
.daynote { padding: var(--s3); border-radius: 14px; background: var(--cream); border: 1px solid var(--line); font-style: italic; }
.chip.static { min-height: 36px; padding: 4px var(--s3); font-size: 13.5px; cursor: default; }
.sheet-foot { display: flex; gap: var(--s3); padding: var(--s3) var(--s4) var(--s4); flex: none; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
@keyframes sheetup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetfade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 768px) {
  .sheet { top: 50%; bottom: auto; border-radius: 28px; max-height: 82vh; max-height: 82dvh; transform: translateY(-50%); padding-bottom: 0; animation: sheetpop .22s var(--ease); }
  @keyframes sheetpop { from { opacity: 0; transform: translateY(-48%); } to { opacity: 1; transform: translateY(-50%); } }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back { animation: none; } }

/* Progress: how she is doing with her plan */
.adlist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); }
.adhead { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; font-size: 14.5px; }
.adhead strong { font-weight: 600; color: var(--plum); white-space: nowrap; }
.adlist .goalbar { margin: var(--s1) 0 0; height: 8px; }

/* Today: optional side effects */
.sidefx .small.muted { margin-top: var(--s3); }
.saveday .label { margin: var(--s3) 0 var(--s2); }

/* ---------- Doctor: the record as an infographic ---------- */
.rec-h { margin: var(--s5) 0 var(--s3); }
.record { display: grid; gap: var(--s4); min-width: 0; }
.rec-head { background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius); padding: var(--s5) var(--pad); display: grid; gap: var(--s3); }
.rec-head h4 { margin: 0; font: 600 20px/1.25 var(--font-head); color: var(--hero-text); }
.rec-head > p { margin: 0; font-size: 14px; color: var(--on-hero-accent); }
.rec-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.rec-tile { background: rgba(255, 255, 255, .12); border-radius: 16px; padding: var(--s3) var(--s4); display: grid; gap: 2px; min-width: 0; }
.rec-tile strong { font: 600 24px/1.1 var(--font-head); color: var(--hero-text); overflow-wrap: anywhere; }
.rec-tile span { font-size: 13px; color: var(--hero-text); }
.rec-tile small { font-size: 12px; color: var(--on-hero-accent); }

.rec-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: var(--s4); display: grid; gap: var(--s3); min-width: 0; }
.rec-sec h4 { margin: 0; font: 600 17px var(--font-head); color: var(--plum); }
.rec-sec p { margin: 0; }

.rec-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); }
.rec-fact { background: var(--sand); border-radius: 14px; padding: var(--s3); display: grid; gap: 2px; min-width: 0; }
.rec-fact strong { font: 600 20px/1.15 var(--font-head); color: var(--plum); overflow-wrap: anywhere; }
.rec-fact span { font-size: 13px; color: var(--ink); }
.rec-fact small { font-size: 12px; color: var(--muted); }

.rbars { display: grid; gap: var(--s2); }
.rbar { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: 14px; }
.rb-l { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.rb-t { height: 12px; border-radius: 9999px; background: var(--sand); overflow: hidden; }
.rb-t i { display: block; height: 100%; border-radius: 9999px; background: var(--plum-solid); }
.rbar.ok .rb-t i { background: var(--ok-fg); }
.rbar.watch .rb-t i { background: var(--watch-fg); }
.rbar strong { font-weight: 600; color: var(--plum); white-space: nowrap; }

.rec-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.rec-chips span { background: var(--sand); color: var(--ink); border-radius: 9999px; padding: 6px 12px; font-size: 13px; overflow-wrap: anywhere; }

.rtable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.rtable { border-collapse: collapse; width: 100%; font-size: 13px; }
.rtable th { position: sticky; top: 0; background: var(--sand); color: var(--plum); text-align: left; font-weight: 600; padding: 8px 10px; white-space: nowrap; }
.rtable td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; min-width: 70px; }
.rtable td:first-child { white-space: nowrap; font-weight: 500; }
.rec-daily > .doc-body { display: grid; gap: var(--s3); }
.rec-foot { text-align: center; }
@media (max-width: 420px) { .rbar { grid-template-columns: minmax(0, 1fr) auto; } .rbar .rb-t { grid-column: 1 / -1; order: 3; } }

/* ---------- the day in review (no coloured borders: blocks are told apart by their tint) ---------- */
.dayreview { display: grid; gap: var(--s4); }
.dayreview h2, .dayreview h3, .dayreview p, .dayreview ul { margin: 0; }
.dr-head { font: 500 17px/1.4 var(--font-head); color: var(--plum); }
.dr-block { border-radius: 16px; padding: var(--s4); display: grid; gap: var(--s3); }
.dr-block h3 { font: 600 15px var(--font-head); }
.dr-block ul { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.dr-block li { display: grid; gap: 2px; }
.dr-block li + li { padding-top: var(--s3); border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, currentColor 25%, transparent); }
.dr-block .small, .dr-block small { color: inherit; opacity: .9; }
.dr-block.helped { background: var(--ok-bg); color: var(--ok-fg); }
.dr-block.cut { background: var(--watch-bg); color: var(--watch-fg); }
.dr-next { background: var(--sand); border-radius: 16px; padding: var(--s4); }
.dr-cut { display: grid; gap: var(--s2); }
.dr-cut h3 { font: 600 15px var(--font-head); color: var(--plum); }

/* ---------- patterns in her logs ---------- */
.patterns .goalbar { margin: var(--s2) 0; }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.plist li { background: var(--sand); border-radius: 14px; padding: var(--s3) var(--s4); display: grid; gap: var(--s1); }
.plist p { margin: 0; }
.nuic { width: 28px; height: 28px; flex: none; color: var(--plum); }
.nutoday { display: flex; align-items: center; gap: var(--s3); }
.nuadj { display: flex; gap: var(--s2); flex: none; }
.nuadj .chip { min-height: 40px; min-width: 40px; padding: 0 var(--s3); font-size: 18px; }
.nulist li > .chip { text-align: left; flex: 1; justify-content: flex-start; }
.nustarters { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: var(--s3); }
@media (min-width: 1100px) { .nustarters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nuh { margin-top: var(--s4); }
.nubadges { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s1) 0 var(--s2); }
.nutrition .nubadges .pill.ghost { margin-left: 0; }
.nusample li { padding: var(--s2) 0; }
.nuhr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
.nustarter h3, .nustarter h4 { margin: 0 0 var(--s1); }
.nulook { margin-top: var(--gap); }
/* settings rows sit edge to edge: the site-wide 12px gap between a card's children is for stacked blocks, not for list rows */
.menu > .menu-row + .menu-row { margin-top: 0; }
/* meal pairings: one even rhythm (the 12px between a card's children), no extra gap on top of it */
.nutrition .card > h3:first-child { margin: 0; }
.nutrition section.card ul.small { margin: var(--s3) 0 0; padding-left: var(--s5); }

/* ---------- soft gradients, built from the existing tokens so light and dark both follow ---------- */
.btn:not(.ghost):not(.danger):not(.armed) { background-image: linear-gradient(135deg, var(--plum-solid) 0%, var(--plum-solid-hover) 100%); }
.btn:not(.ghost):not(.danger):not(.armed):hover { background-image: linear-gradient(135deg, var(--plum-solid-hover) 0%, var(--plum-solid) 100%); }
.btn.armed { background-image: linear-gradient(135deg, var(--accent-solid) 0%, color-mix(in srgb, var(--accent-solid) 80%, #000) 100%); }
.chip[aria-pressed="true"], .navbtn[aria-current="page"] { background-image: linear-gradient(135deg, var(--petal) 0%, var(--pink) 100%); }
/* hover: a soft wash that stays inside the shape of the thing being hovered (rows, options and nav buttons all have their own rounded corners) */
.menu-row:hover, .ddopt:hover, .navbtn:not([aria-current="page"]):hover { background-image: linear-gradient(135deg, var(--cream) 0%, var(--sand) 100%); }
.nustarters .card, .nutrition section.card { background-image: linear-gradient(160deg, var(--surface) 0%, var(--cream) 100%); }

/* ---------- Meal pairings tab: one steady rhythm between its parts ---------- */
.nutrition { display: grid; gap: var(--s4); align-content: start; min-width: 0; }
.nutrition > * { margin: 0; min-width: 0; }
.nutrition > h2:first-child { margin-bottom: calc(var(--s2) * -1); }
.nutrition > .tiny { margin-top: var(--s2); }
.nutrition > .field + .field { margin-top: 0; }
.nutrition .field > label { display: block; margin-bottom: var(--s2); }
.nutrition .nuchips { margin-top: 0; }

/* ---------- Meal pairings: cards that open, and a grid that follows the room it is given (container queries) ---------- */
.nutrition { container: nutri / inline-size; }
.pairgrid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@container nutri (min-width: 620px) { .pairgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nutrition .guidegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* browsers without container queries still get a sensible grid from the screen width */
@supports not (container-type: inline-size) {
  @media (min-width: 700px) { .pairgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}
.pairing { container: pair / inline-size; display: block; padding: 0; overflow: hidden; background-image: linear-gradient(160deg, var(--surface) 0%, var(--cream) 100%); transition: transform .25s var(--ease), box-shadow .25s, background-color .25s; }
.pairing > summary { display: grid; gap: var(--s3); padding: var(--s4); margin: 0; min-height: 0; list-style: none; cursor: pointer; border-radius: inherit; color: var(--ink); font: inherit; -webkit-tap-highlight-color: transparent; }
.pairing > summary::-webkit-details-marker { display: none; }
.pairing > summary::after { content: none; }
.pairing[open] > summary { margin-bottom: 0; }
.pairing > summary:focus-visible { outline: 2px solid var(--plum); outline-offset: -3px; }
.pr-head { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.pr-title { display: grid; min-width: 0; }
.pr-title small { font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.pr-title strong { font: 500 clamp(16px, 0.5vw + 14px, 19px)/1.25 var(--font-head); color: var(--plum); overflow-wrap: anywhere; }
.pr-parts { display: grid; gap: var(--s2); }
.pr-part { display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.pr-k { font-size: 13px; color: var(--muted); }
.pr-v { font-size: 14px; overflow-wrap: anywhere; }
.pr-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--plum); }
.pr-chev { font-size: 22px; line-height: 1; transition: transform .2s var(--ease); }
.pairing[open] .pr-chev { transform: rotate(90deg); }
.pr-more { display: grid; gap: var(--s3); padding: 0 var(--s4) var(--s4); }
.pr-more > * { margin: 0; }
.pr-more ul { padding-left: var(--s5); }
.pr-h { font: 500 14px var(--font-head); color: var(--plum); }
@container pair (max-width: 270px) { .pr-part { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
/* lift and press follow the card's own rounded shape; only on devices that can hover */
@media (hover: hover) { .pairing:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(75, 46, 99, .12); } }
.pairing:active { transform: scale(.992); }
@media (prefers-reduced-motion: reduce) { .pairing, .pr-chev { transition: none; } .pairing:hover, .pairing:active { transform: none; } }
/* pairing card header: the meal time and name on the left, the icon on the right */
.pr-head { justify-content: space-between; align-items: flex-start; }
.pr-title { flex: 1 1 auto; text-align: left; }
.pr-head .nuic { width: 32px; height: 32px; margin-left: var(--s3); }

/* ---------- Space Grotesk for the tags: meal time, food-job labels, the open row, filter chips, pills and filter titles ---------- */
.nutrition .chip, .nutrition .pill, .nutrition .field > label, .pr-title small, .pr-k, .pr-toggle, .pr-h { font-family: var(--font-tag); font-weight: 500; }
.pr-title small { letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.pr-k { letter-spacing: .01em; }
.nutrition .chip { letter-spacing: .005em; }
/* a pairing card's summary holds the whole card, so it must not inherit the heading font that other card summaries use */
details.pairing > summary { font: 400 15px/1.5 var(--font-body); color: var(--ink); min-height: 0; }
.pr-v { font-weight: 400; }

/* ---------- Space Grotesk for every tag across the site: chips, pills, evidence and status tags, small uppercase labels, nav labels and small captions ---------- */
/* Only the medium weight is installed, so none of these asks for another weight (the browser would fake a bold). */
.label:not(.ask), .stat .k, .dow, .rem-body dt, .fc-label, .si-or, .pill, .ev, .chip, .navbtn, .docstatus, .tile > span, .badge span, .lv-sub, .cal-day .n { font-family: var(--font-tag); font-weight: 500; }

/* ---------- pairing colours (PAIRING-COLOURS-START) ---------- */
/* Colour comes from the information on the card: the meal time tints it, the main food colours the icon, each job has a dot, allergens are
   warm tags. Fills and small tags only: no coloured borders or side stripes. Every colour is an existing token, so dark mode follows. */
.pairing[data-slot="bk"] { --tint: var(--lemon); --tint2: var(--peach); --tint-fg: var(--watch-fg); }
.pairing[data-slot="sn"] { --tint: var(--petal); --tint2: var(--pink); --tint-fg: var(--accent); }
.pairing[data-slot="ln"] { --tint: var(--celadon); --tint2: var(--aquamarine); --tint-fg: var(--teal-text); }
.pairing[data-slot="dn"] { --tint: var(--icy); --tint2: var(--sky); --tint-fg: var(--on-icy); }
.pairing[data-slot] { background-image: linear-gradient(160deg, color-mix(in srgb, var(--tint) 35%, var(--surface)) 0%, color-mix(in srgb, var(--tint2, var(--tint)) 65%, var(--surface)) 100%); }
.pr-time { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 9999px; background: var(--tint); color: var(--tint-fg); font-family: var(--font-tag); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s1); }
.pr-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; margin-left: var(--s3); background: var(--ic-bg, var(--sand)); color: var(--ic-fg, var(--plum)); }
.pr-ic .nuic { width: 24px; height: 24px; margin: 0; color: inherit; }
.ic-egg { --ic-bg: var(--peach); --ic-fg: var(--watch-fg); }
.ic-drop { --ic-bg: var(--sky); --ic-fg: var(--on-icy); }
.ic-bean { --ic-bg: var(--pink); --ic-fg: var(--accent); }
.ic-leaf { --ic-bg: var(--celadon); --ic-fg: var(--teal-text); }
.ic-sun { --ic-bg: var(--lemon); --ic-fg: var(--watch-fg); }
.ic-sprout { --ic-bg: var(--aquamarine); --ic-fg: var(--teal-text); }
.pr-k::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--dot, var(--muted)); }
.pr-k[data-role="protein"] { --dot: var(--ring-nat); }
.pr-k[data-role="legumes"] { --dot: var(--accent); }
.pr-k[data-role="milk"] { --dot: var(--on-icy); }
.pr-k[data-role="vegetables"] { --dot: var(--ok-fg); }
.pr-k[data-role="starch"] { --dot: var(--watch-fg); }
.pr-k[data-role="fruit"] { --dot: var(--pre-bg); }
.pr-k[data-role="fats"] { --dot: var(--thistle); }
.pr-k[data-role="drink"] { --dot: var(--ring-wd); }
.pr-allergens { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.pr-al-k { font-family: var(--font-tag); font-weight: 500; font-size: 12px; color: var(--muted); }
.pr-al { padding: 2px 10px; border-radius: 9999px; background: var(--watch-bg); color: var(--watch-fg); font-family: var(--font-tag); font-weight: 500; font-size: 12px; }
.pr-brings { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); font-size: 14px; }
.pr-brings li { display: grid; gap: var(--s1); }
.pr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-tag { padding: 2px 10px; border-radius: 9999px; background: var(--sand); color: var(--plum); font-family: var(--font-tag); font-weight: 500; font-size: 12px; }
/* the meal time buttons wear the same colours as the cards when pressed */
.nuchips .chip[data-action="pslot"][data-v="bk"][aria-pressed="true"] { background-image: linear-gradient(135deg, var(--lemon), var(--peach)); color: var(--watch-fg); border-color: transparent; }
.nuchips .chip[data-action="pslot"][data-v="sn"][aria-pressed="true"] { background-image: linear-gradient(135deg, var(--petal), var(--pink)); color: var(--accent); border-color: transparent; }
.nuchips .chip[data-action="pslot"][data-v="ln"][aria-pressed="true"] { background-image: linear-gradient(135deg, var(--celadon), var(--aquamarine)); color: var(--teal-text); border-color: transparent; }
.nuchips .chip[data-action="pslot"][data-v="dn"][aria-pressed="true"] { background-image: linear-gradient(135deg, var(--icy), var(--sky)); color: var(--on-icy); border-color: transparent; }
/* (PAIRING-COLOURS-END) */

/* ---------- Google Sans for the navigation items (the side bar on the web and the bottom bar on phones) ---------- */
/* Only the medium weight is installed. This comes after the tag rule, so it wins for nav items. */
.navbtn, .rail .navbtn { font-family: var(--font-nav); font-weight: 500; }

/* ---------- card colours across the site (CARD-COLOURS-START) ---------- */
/* Every plain card gets a soft tinted fill that runs from one pastel to its neighbour, and each part of the app has its own pair: Today rose to
   orchid, Progress celadon to aquamarine, Cycle baby blue to frosted blue, My plan lemon to peach, Settings mauve to orchid. Cards that already
   mean something (status cards, the love card, the pairing cards) keep their own colours. Fills only: no coloured borders or side stripes.
   All colours are tokens, so dark mode follows. */
.content[data-tab="today"] { --card-tint: var(--petal); --card-tint2: var(--pink); }
.content[data-tab="progress"] { --card-tint: var(--celadon); --card-tint2: var(--aquamarine); }
.content[data-tab="cycle"] { --card-tint: var(--icy); --card-tint2: var(--sky); }
.content[data-tab="remedies"] { --card-tint: var(--lemon); --card-tint2: var(--peach); }
.content[data-tab="settings"] { --card-tint: var(--thistle); --card-tint2: var(--pink); }
.card:not(.notice, .encourage, .bloomcard, .safe-note, .coach, .lovecard, .plancta, .forecast, .pairing, .saveday.saved) {
  background-image: linear-gradient(160deg, color-mix(in srgb, var(--card-tint, var(--sand)) 22%, var(--surface)) 0%, color-mix(in srgb, var(--card-tint2, var(--card-tint, var(--sand))) 42%, var(--surface)) 100%);
}
/* the three kinds of number tile on Progress each get a soft colour of their own */
.tiles .tile:nth-child(3n + 1) { background-color: color-mix(in srgb, var(--petal) 55%, var(--surface)); }
.tiles .tile:nth-child(3n + 2) { background-color: color-mix(in srgb, var(--sky) 55%, var(--surface)); }
.tiles .tile:nth-child(3n) { background-color: color-mix(in srgb, var(--celadon) 60%, var(--surface)); }
/* (CARD-COLOURS-END) */

/* ---------- Today: the bloom in the purple bar, and the logs as the main part of the page (TODAY-LOGS-START) ---------- */
/* Colours are existing tokens only, so dark mode follows. Fills and small tags: no coloured borders or side stripes. */

/* the bloom in the purple bar */
.hero-bloom { flex: 1 1 140px; min-width: 0; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid var(--ring-track); }
.hero.has-bloom .hero-level { flex: 1 1 140px; }
.hero.has-bloom .hero-main { flex-basis: calc(100% - 96px); }
.hero-bloom .bigbloom { width: 52px; margin: 0; padding: 6px; border-radius: 50%; background: var(--surface); flex: none; }
.hero-bloom .bigbloom::before, .hero-bloom .bigbloom::after { display: none; }
.hero-bloom .bigbloom .bloom { filter: none; }
.hero-bloom .bloomtxt { min-width: 0; }
.hero-bloom .lv-sub { display: block; font-size: 12px; opacity: .85; }
.hero-bloom strong { display: block; font: 500 22px/1.15 var(--font-head); color: var(--hero-text); }
.hero-bloom strong small { font: 500 12px var(--font-body); color: inherit; opacity: .85; }
.hero-bloom .hb-note { display: none; margin: var(--s1) 0 0; font-size: 12.5px; line-height: 1.4; opacity: .9; }
@media (max-width: 480px) { .hero.has-bloom .lv-badge { display: none; } }
@media (min-width: 600px) { .hero-bloom .hb-note { display: block; } .hero-bloom .bigbloom { width: 64px; } .hero-bloom strong { font-size: 26px; } }
@media (min-width: 1024px) {
  .hero.has-bloom { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hero.has-bloom > .hero-level { grid-column: 1 / -1; }
  .hero-bloom { flex: none; padding: var(--s4) var(--s5); border-radius: 20px; gap: var(--s4); }
  .hero-bloom .bigbloom { width: 84px; padding: 8px; }
  .hero-bloom strong { font-size: 32px; }
  .hero-bloom .lv-sub { font-size: 13px; }
  .hero-bloom .hb-note { max-width: 22ch; }
}
@media (min-width: 1280px) {
  /* with room to spare, the bloom sits above the level card in the right column and the ring and greeting span both rows */
  .hero.has-bloom { grid-template-columns: auto minmax(0, 1fr) 300px; grid-template-rows: auto auto; row-gap: var(--s3); }
  .hero.has-bloom > .ring-wrap { grid-row: 1 / 3; }
  .hero.has-bloom > .hero-main { grid-row: 1 / 3; }
  .hero.has-bloom > .hero-bloom { grid-column: 3; grid-row: 1; padding: var(--s3) var(--s4); gap: var(--s3); }
  .hero.has-bloom > .hero-level { grid-column: 3; grid-row: 2; }
  .hero-bloom .bigbloom { width: 68px; padding: 7px; }
  .hero-bloom strong { font-size: 28px; }
  .hero-bloom .hb-note { max-width: none; }
}

/* section headings on Today */
.logs, .support { container: logs / inline-size; }
.logs { margin-top: var(--s5); }
.support { margin-top: var(--s7); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s4); }
.sec-h { margin: 0; font: 500 24px/1.2 var(--font-head); color: var(--plum); }

/* every log has its own colour pair; the strip, the icon tile and the card tint all read from it */
.lg-rem { --lgb: var(--petal); --lgb2: var(--pink); --lgf: var(--accent); }
.lg-food { --lgb: var(--celadon); --lgb2: var(--aquamarine); --lgf: var(--teal-text); }
.lg-rx { --lgb: var(--aquamarine); --lgb2: var(--aqua); --lgf: var(--teal-text); }
.lg-body { --lgb: var(--sky); --lgb2: var(--aqua); --lgf: var(--on-icy); }
.lg-mood { --lgb: var(--lemon); --lgb2: var(--peach); --lgf: var(--watch-fg); }
.lg-bleed { --lgb: var(--pink); --lgb2: var(--petal); --lgf: var(--accent); }
.lg-cycle { --lgb: var(--icy); --lgb2: var(--sky); --lgf: var(--on-icy); }
.lg-sym { --lgb: var(--peach); --lgb2: var(--lemon); --lgf: var(--watch-fg); }
.lg-fx { --lgb: var(--thistle); --lgb2: var(--pink); --lgf: var(--plum); }

/* the strip of logs, with a tick on each one that has something in it */
.logstrip { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 2px var(--s2); margin-bottom: var(--s2); scroll-snap-type: x proximity; scrollbar-width: none; }
.logstrip::-webkit-scrollbar { display: none; }
.lstep { flex: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 14px 0 7px; border: 0; border-radius: 9999px; scroll-snap-align: start; cursor: pointer;
  background: color-mix(in srgb, var(--lgb, var(--sand)) 55%, var(--surface)); color: var(--ink); font: 500 13px var(--font-tag); transition: background-color .2s, transform .15s var(--ease); }
.lstep:active { transform: scale(.97); }
.ls-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--lgf, var(--plum)); }
.ls-ic .ic { width: 17px; height: 17px; }
.ls-s { color: var(--muted); }
.lstep.on { background: var(--ok-bg); color: var(--ok-fg); }
.lstep.on .ls-ic { background: var(--ok-fg); color: var(--ok-bg); }
.lstep.on .ls-s { color: inherit; opacity: .85; }
@media (min-width: 700px) { .logstrip { flex-wrap: wrap; overflow: visible; } }
@media (hover: hover) { .lstep:hover { background: color-mix(in srgb, var(--lgb, var(--sand)) 85%, var(--surface)); } .lstep.on:hover { background: color-mix(in srgb, var(--ok-bg) 80%, var(--ok-fg)); } }

/* the log cards */
.card.logcard { padding: var(--s5); border-radius: 22px; scroll-margin-top: var(--s4);
  background-image: linear-gradient(160deg, color-mix(in srgb, var(--lgb, var(--sand)) 26%, var(--surface)) 0%, color-mix(in srgb, var(--lgb2, var(--lgb, var(--sand))) 52%, var(--surface)) 100%); }
.card.logcard.lgkey { padding: var(--s5) var(--s5) var(--s6);
  background-image: linear-gradient(160deg, color-mix(in srgb, var(--lgb) 42%, var(--surface)) 0%, color-mix(in srgb, var(--lgb2, var(--lgb)) 82%, var(--surface)) 100%); }
.card.logcard.docplan { border: 1px solid var(--line); }
.lg-head { display: flex; align-items: center; gap: var(--s3); }
.lg-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--lgf, var(--plum)); }
.lg-ic .ic { width: 22px; height: 22px; }
.lg-t { flex: 1 1 auto; min-width: 0; margin: 0; font: 500 18px/1.25 var(--font-head); color: var(--plum); }
.lg-st { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 9999px; background: var(--surface); color: var(--plum); font: 500 12px var(--font-tag); }
.lg-st .ic { width: 12px; height: 12px; }
.lg-st.on { background: var(--ok-bg); color: var(--ok-fg); }
.logcard.lgkey .lg-ic { width: 48px; height: 48px; }
.logcard.lgkey .lg-ic .ic { width: 26px; height: 26px; }
.logcard.lgkey .lg-t { font-size: 21px; }

/* layout: Remedies and Food first, then the other logs, then the support cards */
.logs-key, .logs-grid { display: grid; gap: var(--gap); margin-top: var(--s4); }
.logs-grid { display: flex; flex-direction: column; }
.lcol { display: contents; }
.logs-grid .lg-rx { order: 0; } .logs-grid .lg-body { order: 1; } .logs-grid .lg-mood { order: 2; } .logs-grid .lg-bleed { order: 3; }
.logs-grid .lg-cycle { order: 4; } .logs-grid .lg-sym { order: 5; } .logs-grid .lg-fx { order: 6; }
.logs-key { align-items: stretch; }
.logs-key > .card { margin: 0; }
.fooddiary.logcard { display: flex; flex-direction: column; }
.fooddiary.logcard > .btnrow { margin-top: auto; padding-top: var(--s4); }
.logcard.lgkey .rituals { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3); }
.logcard.lgkey .ritual { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 68px; padding: var(--s3) var(--s4); border-radius: 18px; font-size: 15px; }
.logcard.lgkey .ritual .badge-ic { width: 40px; height: 40px; }
.logcard.lgkey .planedit { margin-top: var(--s4); }
@container logs (min-width: 640px) {
  .logs-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .lcol { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
  .logs-grid .card { order: 0 !important; }
}
@supports not (container-type: inline-size) {
  @media (min-width: 700px) {
    .logs-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .lcol { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
    .logs-grid .card { order: 0 !important; }
  }
}

/* the support cards keep their own order in the page */
.support .col > * { order: 0 !important; }
.support .today-grid { margin-top: var(--s4); }
.logs ~ .saveday, .saveday ~ .dayreview { margin-top: var(--s5); }
/* before saving, the progress cards wait; a quiet line says why */
.glance-hint { display: flex; align-items: flex-start; gap: var(--s3); margin: 0; padding: var(--s4); border-radius: 18px; background: color-mix(in srgb, var(--aquamarine) 35%, var(--surface)); color: var(--teal-text); }
.glance-hint .ic { flex: none; width: 22px; height: 22px; color: var(--teal); }
.glance-hint span { color: var(--teal-text); font-size: 14px; line-height: 1.5; }
/* phones: the strip wraps instead of scrolling sideways, and the two bar tiles match in height */
@media (max-width: 699px) { .logstrip { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 480px) { .lstep .ls-s { display: none; } .lstep { flex: 1 1 auto; justify-content: flex-start; } .hero.has-bloom > .hero-bloom, .hero.has-bloom > .hero-level { align-self: stretch; } }
/* (TODAY-LOGS-END) */

/* ---------- teal: the PMOS awareness colour, for done, progress and the streak (TEAL-START) ---------- */
/* Teal only ever means "done" or "going well". Warnings stay amber and red. Tokens only, so dark mode follows. */
.hero .pill:not(.ghost) { background: var(--teal); color: var(--on-teal); }
.lv-bar i { background: var(--on-hero-aqua); }
.rail .lv-bar i, .goalbar i { background: var(--teal); }
.ck-in:checked + .ck-ui, .tickrow.on .ck-ui { background: var(--teal); border-color: var(--teal); }
.ck-ui .ic { color: var(--on-teal); }
.lg-st.on, .lstep.on { background: var(--ok-bg); color: var(--ok-fg); }
.lstep.on .ls-ic { background: var(--teal); color: var(--on-teal); }
.ribbon { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; color: var(--teal); }
/* (TEAL-END) */

/* ---------- Settings: full width (SETTINGS-WIDE-START) ---------- */
/* The arrow sits in a small round tile so it stays tied to its row when the row is wide. */
.menu-row .chev { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sand); color: var(--plum); font-size: 20px; line-height: 1; }
@media (hover: hover) { .menu-row:hover .chev { background: var(--pink); color: var(--ink); } }
/* (SETTINGS-WIDE-END) */

/* ---------- Progress: what her own logs show, with no petals (PROGRESS-START) ---------- */
/* Tokens only, so dark mode follows. Fills and small tags: no coloured borders or side stripes. Teal is only used for "done". */
.po { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.psum > .label { display: block; margin-bottom: var(--s2); }
.pworks .small-h, .pconf .small-h { margin: var(--s4) 0 var(--s2); font: 500 16px var(--font-head); color: var(--plum); }

/* lists of what helped, what worked against her, and the pairs that do not add up */
.plist2 { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s3); }
.plist2 li { display: grid; gap: var(--s1); padding: var(--s3) var(--s4); border-radius: 16px; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.plist2.helped li { background: color-mix(in srgb, var(--ok-bg) 80%, var(--surface)); }
.plist2.cut li { background: color-mix(in srgb, var(--watch-bg) 80%, var(--surface)); }
.plist2.pairs li { background: color-mix(in srgb, var(--peach) 70%, var(--surface)); }
.plist2.flags li { background: color-mix(in srgb, var(--surface) 72%, transparent); }
.plist2 p { margin: 0; }
.pl-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.pl-meta { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ptags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.ptag { display: inline-block; padding: 2px 10px; border-radius: 9999px; background: var(--surface); color: var(--plum); font: 500 12px var(--font-tag); white-space: nowrap; }
.ptag.on { background: var(--ok-bg); color: var(--ok-fg); }
.ptag.pend { background: var(--lemon); color: var(--watch-fg); }
.okline { display: flex; align-items: center; gap: var(--s2); color: var(--teal-text); }
.okline .ic { flex: none; color: var(--teal); }

/* bar charts: weight by week, cycle lengths, and mood, sleep and energy by day */
.wtrend, .cbars { display: flex; align-items: stretch; gap: var(--s2); height: 150px; margin: var(--s3) 0; }
.wt, .cb { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; text-align: center; gap: 2px; }
.wt i, .cb i { align-self: end; width: 100%; max-width: 30px; min-height: 8px; border-radius: 9px 9px 4px 4px; }
.wt i { background: linear-gradient(180deg, color-mix(in srgb, var(--sky) 62%, var(--on-icy)), color-mix(in srgb, var(--icy) 70%, var(--on-icy))); }
.cb i { background: linear-gradient(180deg, color-mix(in srgb, var(--pink) 60%, var(--accent)), color-mix(in srgb, var(--petal) 70%, var(--accent))); }
.wt strong, .cb strong { font: 500 13px var(--font-head); color: var(--plum); }
.wt small, .cb small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* symptoms over the weeks */
.sylist { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s3); }
.sylist li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sy-n { font-size: 14px; min-width: 0; }
.sy-dots { display: flex; gap: 6px; flex: none; }
.sy-dots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 14%, transparent); }
.sy-dots .lvx { background: color-mix(in srgb, var(--sand) 80%, transparent); box-shadow: none; }
.sy-dots .lv0 { background: color-mix(in srgb, var(--celadon) 75%, var(--surface)); }
.sy-dots .lv1 { background: var(--lemon); }
.sy-dots .lv2 { background: color-mix(in srgb, var(--peach) 70%, var(--watch-fg)); }
.sy-dots .lv3 { background: color-mix(in srgb, var(--pink) 55%, var(--accent)); }

/* the period check inside My cycles */
.pcycles .alert { margin-top: var(--s4); padding: var(--s4); border-radius: 16px; }
.pcycles .alert h3 { margin: 0 0 var(--s1); font: 500 16px var(--font-head); color: inherit; }
.pcycles .alert.none { background: color-mix(in srgb, var(--sand) 85%, var(--surface)); }

/* My days: a plain grid with small marks for what she logged */
.grid { grid-template-columns: repeat(10, 1fr); gap: 3px; }
.cell { aspect-ratio: 1; padding: 0; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--sand) 70%, var(--surface)); }
.cell .dn { font: 500 11px var(--font-tag); color: var(--ink); margin-top: -3px; }
.cell.has { background: color-mix(in srgb, var(--aquamarine) 45%, var(--surface)); }
.cell .marks { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; }
.dt { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.dt.r { background: var(--teal); }
.dt.f { background: var(--on-icy); }
.dt.m { background: var(--accent); }
.bl { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.cell .bl { position: absolute; right: 3px; top: 3px; }
.bl.nat { background: var(--ring-nat); }
.bl.wd { background: var(--ring-wd); }
.bl.sp { background: var(--ink); }
.cell.today { background: var(--surface); }
.legend { display: grid; gap: var(--s2); margin-top: var(--s4); font-size: 13px; }
.legend .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); }
.legend .row .dt, .legend .row .bl { margin-right: -6px; }
/* (PROGRESS-END) */

/* ---------- My month: the feeling infographic (MY-MONTH-START) ---------- */
/* Tokens only, so dark mode follows. Fills and small tags: no coloured borders or side stripes. The animations only run when the phone
   allows motion, and only when the tab opens. */
.mm .mm-sec { margin-top: var(--s4); padding: var(--s4); border-radius: 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.mm .mm-sec h3 { margin: 0 0 var(--s3); font: 500 16px var(--font-head); color: var(--plum); }
.mm .e { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif; font-weight: 400; font-style: normal; line-height: 1; }

/* mood */
.mm-big { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.mm-face { font: 400 44px/1 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--accent) 22%, transparent)); }
.mm-big strong { display: block; font: 500 19px/1.25 var(--font-head); color: var(--plum); }
.mm-big small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.mm-head, .mm-cal, .mm-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mm-head, .mm-cal, .mm-wd { max-width: 460px; margin-inline: auto; }
.mm-head span { text-align: center; font: 500 11px var(--font-tag); color: var(--muted); }
.mm-cal { margin-top: 4px; }
.mm-d { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--sand) 60%, transparent); color: var(--muted); font-size: 22px; transition: transform .2s var(--ease), background-color .2s; }
.mm-d.has { background: color-mix(in srgb, var(--lemon) 55%, var(--surface)); }
.mm-d.off { background: transparent; }
.mm-d.today { background: var(--surface); box-shadow: 0 0 0 2px var(--plum); }
.mm-wd { margin-top: var(--s4); }
.mm-wd > div { display: grid; justify-items: center; gap: 2px; padding: var(--s2) 0; border-radius: 14px; background: color-mix(in srgb, var(--sand) 55%, transparent); }
.mm-wd .e { font-size: 22px; }
.mm-wd small { font: 500 11px var(--font-tag); color: var(--muted); }
.mm-wd .best { background: color-mix(in srgb, var(--lemon) 70%, var(--surface)); }
.mm-wd .best small { color: var(--watch-fg); }
.mm-best { margin: var(--s3) 0 0; color: var(--watch-fg); font-weight: 500; }

/* sleep */
.mm-sleeprow { display: flex; align-items: center; gap: var(--s4); }
.mm-ring { position: relative; width: 96px; height: 96px; flex: none; }
.mm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mm-ring circle { fill: none; stroke-width: 8; }
.mm-ring .track { stroke: color-mix(in srgb, var(--icy) 55%, var(--surface)); }
.mm-ring .arc { stroke: var(--teal); stroke-linecap: round; }
.mm-ringtxt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.mm-ringtxt strong { font: 500 24px/1 var(--font-head); color: var(--plum); }
.mm-ringtxt small { font-size: 11px; color: var(--muted); }
.mm-sleeptxt { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: 14px; }
.mm-sleeptxt li { display: flex; align-items: center; gap: var(--s2); }
.mm-sleeptxt strong { color: var(--plum); }
.mm-sb { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 2px; height: 52px; margin-top: var(--s4); }
.mm-sb i { display: block; border-radius: 3px; transform-origin: bottom; }
.mm-sb .good { background: color-mix(in srgb, var(--celadon) 50%, var(--teal)); }
.mm-sb .mid { background: color-mix(in srgb, var(--icy) 60%, var(--on-icy)); }
.mm-sb .short { background: color-mix(in srgb, var(--peach) 55%, var(--watch-fg)); }
.mm-sb .none { background: var(--muted); opacity: .22; }

/* energy, movement, period and pain */
.mm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.mm-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mm-tile { display: grid; justify-items: center; gap: 2px; padding: var(--s3) var(--s2); border-radius: 14px; background: color-mix(in srgb, var(--sand) 55%, transparent); text-align: center; }
.mm-tile .e { font-size: 26px; }
.mm-tile strong { font: 500 22px/1.1 var(--font-head); color: var(--plum); }
.mm-tile small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.mm-bat { width: 34px; height: 18px; color: var(--plum); }
.mm-bat .fill { fill: var(--teal); }
.mm-bat.l1 .fill { fill: color-mix(in srgb, var(--peach) 50%, var(--watch-fg)); }
.mm-bat.l2 .fill { fill: color-mix(in srgb, var(--icy) 50%, var(--on-icy)); }

/* a day that went well */
.mm-bright { position: relative; isolation: isolate; display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s4); border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--lemon) 75%, var(--surface)), color-mix(in srgb, var(--peach) 70%, var(--surface))); overflow: hidden; }
.mm-bright::before { content: ''; position: absolute; z-index: -1; width: 160px; height: 160px; left: -40px; top: -60px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--surface) 80%, transparent), transparent 70%); opacity: .7; }
.mm-bright .spark { font-size: 30px; }
.mm-bright div { flex: 1; min-width: 0; }
.mm-bright small { display: block; font-size: 12px; color: var(--watch-fg); }
.mm-bright strong { display: block; font: 500 17px var(--font-head); color: var(--plum); }
.mm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2) 0 0; }
.mm-chips span { padding: 2px 10px; border-radius: 9999px; background: var(--surface); color: var(--plum); font: 500 12px var(--font-tag); }

@media (hover: hover) {
  .mm-d:not(.off):hover { transform: translateY(-3px) scale(1.12); background: var(--surface); }
  .mm-tile { transition: transform .2s var(--ease); }
  .mm-tile:hover { transform: translateY(-2px); }
}

/* motion: only when allowed, and only when the tab opens */
@keyframes mm-pop { 0% { opacity: 0; transform: scale(.2) rotate(-14deg); } 60% { opacity: 1; transform: scale(1.2) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes mm-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mm-arc { from { stroke-dashoffset: var(--full); } }
@keyframes mm-glow { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: .85; transform: scale(1.12); } }
@media (prefers-reduced-motion: no-preference) {
  main.enter .mm-d .e, main.enter .mm-wd .e { animation: mm-pop .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 24ms + 120ms); }
  main.enter .mm-ring .arc { animation: mm-arc 1.1s var(--ease) .3s both; }
  main.enter .mm-sb i { animation: mm-grow .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms + 200ms); }
  main.enter .mm-tile { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 250ms); }
  .mm-face { animation: floaty 4.5s ease-in-out infinite; }
  .mm-bright::before { animation: mm-glow 3.6s ease-in-out infinite; }
}
/* (MY-MONTH-END) */

/* ---------- My days: a full-width row across the bottom of Progress (PROGRESS-DAYS-START) ---------- */
/* The grid follows the room it is given: 10 across on a phone, 15 on a tablet, 30 (one row a month) on the web. */
.pfull { container: pfull / inline-size; min-width: 0; }
@media (min-width: 1024px) { .pfull { grid-column: 1 / -1; } }
@container pfull (min-width: 560px) { .pfull .grid { grid-template-columns: repeat(15, minmax(0, 1fr)); } .pfull .legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); } }
@container pfull (min-width: 900px) { .pfull .grid { grid-template-columns: repeat(30, minmax(0, 1fr)); } }
@supports not (container-type: inline-size) { @media (min-width: 700px) { .pfull .grid { grid-template-columns: repeat(15, minmax(0, 1fr)); } } }
/* (PROGRESS-DAYS-END) */

/* ---------- Cycle page: most important first, balanced columns (CYCLE-START) ---------- */
/* Tokens only, so dark mode follows. Fills and small tags: no coloured borders or side stripes. */
.cycle-page { display: flex; flex-direction: column; gap: var(--gap); }
.cyc-cols, .cyc-col { display: contents; }
.cyc-full { container: cycfull / inline-size; min-width: 0; }
@media (min-width: 1024px) {
  .cycle-page { gap: var(--s5); }
  .cyc-cols { order: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s5); align-items: stretch; }
  .cyc-col { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
  .cyc-col > * { order: 0 !important; }
  .cyc-col > :last-child { flex: 1; }
}

/* Right now */
.card.now { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: center; padding: var(--s5); border-radius: 24px; }
.now-ring { position: relative; width: 92px; height: 92px; }
.now-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.now-ring circle { fill: none; stroke-width: 8; }
.now-ring .track { stroke: color-mix(in srgb, var(--surface) 65%, transparent); }
.now-ring .arc { stroke: var(--now-c, var(--teal)); stroke-linecap: round; }
.now-ringtxt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.now-ringtxt strong { font: 500 30px/1 var(--font-head); color: var(--plum); }
.now-ringtxt small { font-size: 11px; color: var(--muted); }
.now-title { margin: 0; font: 500 12px var(--font-tag); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.now-head { display: block; margin-top: 4px; font: 500 24px/1.2 var(--font-head); color: var(--plum); }
.now-sub { margin: var(--s2) 0 0; font-size: 14px; }
.now-ov, .now-note { display: flex; align-items: flex-start; gap: var(--s2); margin: var(--s2) 0 0; font-size: 14px; }
.now-ov .ic, .now-note .ic { flex: none; margin-top: 2px; }
.now-ov .ic { color: var(--ring-nat); }
.now-note { padding: var(--s3) var(--s4); border-radius: 14px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.now-conf { margin: var(--s3) 0 0; }
.now-side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); }
.card.now.ok { --now-c: var(--teal); background-image: linear-gradient(135deg, color-mix(in srgb, var(--aquamarine) 55%, var(--surface)), color-mix(in srgb, var(--celadon) 55%, var(--surface))); }
.card.now.watch { --now-c: var(--watch-fg); background-image: linear-gradient(135deg, color-mix(in srgb, var(--lemon) 75%, var(--surface)), color-mix(in srgb, var(--peach) 75%, var(--surface))); }
.card.now.act { --now-c: var(--act-fg); background-image: linear-gradient(135deg, color-mix(in srgb, var(--petal) 70%, var(--surface)), color-mix(in srgb, var(--pink) 60%, var(--surface))); }
.card.now.none { --now-c: var(--on-icy); background-image: linear-gradient(135deg, color-mix(in srgb, var(--icy) 55%, var(--surface)), color-mix(in srgb, var(--sky) 55%, var(--surface))); }
@media (min-width: 700px) {
  .card.now { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s6); padding: var(--s5) var(--s6); }
  .now-ring { width: 118px; height: 118px; }
  .now-ringtxt strong { font-size: 36px; }
  .now-head { font-size: 30px; }
  .now-side { grid-column: auto; flex-direction: column; align-items: stretch; min-width: 210px; }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes now-arc { from { stroke-dashoffset: var(--full); } }
  main.enter .now-ring .arc { animation: now-arc 1.1s var(--ease) .25s both; }
}

/* cards that hold several parts: the parts are plain sections with a hairline between them, never cards inside cards */
.sub { min-width: 0; }
.expect > .sub, .shows > .sub { margin-top: var(--s4); }
.expect > .sub + .sub, .shows > .sub + .sub, .chist > .sub { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.sub h3 { margin: 0 0 var(--s2); font: 500 17px var(--font-head); color: var(--plum); }
.sub.forecast, .sub.forecast.late, .sub.ovcard, .sub.ovcard.fertile, .sub.ovcard.suspected, .sub.ovcard.confirmed, .sub.ovcard.approaching, .sub.ovcard.late { border: 0; background: none; padding: 0; }
.chist .tiles { margin: var(--s4) 0 0; }

/* calendar days: a plain mark for bleeding instead of a flower */
.cal-day .cm { width: 52%; max-width: 22px; height: auto; flex: none; margin-top: 2px; }
.cm.nat { color: var(--ring-nat); }
.cm.wd { color: var(--ring-wd); }
.cm.nat .f, .cm.wd .f { fill: currentColor; fill-opacity: .85; }
i.cm.sp { display: inline-block; width: 8px; height: 8px; max-width: none; border-radius: 50%; background: var(--ink); }
.cal-day i.cm.sp { margin-top: 7px; }
.legend .cm { width: 20px; height: 20px; flex: none; }
.legend i.cm.sp { margin: 0 6px; }

/* adding periods: a full-width row, with the list of periods beside the calendar */
.periodform .pf-list { padding: var(--s4); border-radius: 18px; background: color-mix(in srgb, var(--surface) 65%, transparent); }
@container cycfull (min-width: 860px) {
  .periodform { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .periodform > * + * { margin-top: 0; }
  .periodform .pf-list { align-self: stretch; }
}
.cyc-note { margin: 0; }
/* (CYCLE-END) */

/* ---------- Cycle page as the body hub, and the per-page header (HUB-START) ---------- */
/* Tokens only, so dark mode follows. Fills and small tags: no coloured borders or side stripes. */
.e { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif; font-weight: 400; font-style: normal; line-height: 1; }

/* the purple header on every tab except Today: a tile in place of the level card, and buttons on the Cycle tab */
.hero-tile .ht-big { display: block; margin: 4px 0; font: 500 22px/1.2 var(--font-head); color: var(--hero-text); }
.hero-tile .lv-sub { display: block; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.hero-actions .btn, .hero-actions .btn:not(.ghost):not(.danger):not(.armed) { min-height: 44px; background-image: none; background-color: var(--on-hero-pink); color: var(--hero-bg); border-color: transparent; }
.hero-actions .btn:not(.ghost):not(.danger):not(.armed):hover { background-image: none; background-color: color-mix(in srgb, var(--on-hero-pink) 80%, white); }
.hero-actions .btn.ghost { background-image: none; background-color: transparent; color: var(--hero-text); border: 1px solid var(--ring-track); }
.hero-avatar { width: 100%; height: 100%; display: grid; place-items: center; padding: 16%; border-radius: 50%; background: color-mix(in srgb, var(--hero-bg) 55%, white); }
.hero-avatar svg { width: 100%; height: 100%; }

/* the check-in and bleeding log sit side by side on the web, balanced */
.cyc-log, .cyc-logcard { display: contents; }
.cyc-logfor { margin: 0; }
/* on a phone the two log wrappers vanish, so the cards inside carry the order: check-in, bleeding */
.cyc-logcard:nth-of-type(1) > .card { order: 2; }
.cyc-logcard:nth-of-type(2) > .card:first-child { order: 3; }
@media (max-width: 599px) { .hero-cycle .pills .pill:nth-child(n + 4) { display: none; } }
@media (min-width: 1024px) {
  .cyc-log { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: stretch; order: 2; }
  .cyc-logfor { grid-column: 1 / -1; }
  .cyc-logcard { display: flex; flex-direction: column; gap: var(--s5); order: 0 !important; }
  .cyc-logcard > :last-child { flex: 1; }
  .cycle-page > .glance { order: 3 !important; }
  .cycle-page > .now { order: 1 !important; }
  .cyc-cols { order: 4; }
}

/* the signs chart: a row for each thing she tracks, a column for each day */
.glance { container: gl / inline-size; }
.bc-wrap { display: grid; gap: var(--s3); margin-top: var(--s4); }
.bc-label { display: flex; align-items: center; gap: var(--s2); margin: 0 0 4px; font: 500 12px var(--font-tag); color: var(--muted); }
.bc-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; }
.bc { position: relative; display: grid; place-items: center; min-height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--sand) 55%, transparent); }
.bc-temp .bc { min-height: 76px; }
.bc .cm { width: 70%; max-width: 18px; margin: 0; }
.bc i.cm.sp { margin: 0; }
.dc { display: block; width: 80%; height: 70%; min-height: 12px; border-radius: 4px; }
.dc.dry { background: var(--sand); }
.dc.sticky { background: var(--lemon); }
.dc.creamy { background: var(--peach); }
.dc.watery { background: color-mix(in srgb, var(--icy) 70%, var(--on-icy)); }
.dc.slippery { background: color-mix(in srgb, var(--sky) 55%, var(--on-icy)); }
.tp { position: absolute; left: 50%; bottom: calc(var(--y) * .85% + 4px); width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--accent); }
.ts { display: block; width: 82%; text-align: center; font: 700 13px/1.5 var(--font-tag); border-radius: 6px; }
.ts.pos { background: var(--ok-bg); color: var(--teal-text); }
.ts.neg { color: var(--muted); }
.ix::before { content: '\2665'; color: var(--accent); font-size: 15px; line-height: 1; }
.sg { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--on-icy); }
.sg.s2 { width: 11px; height: 11px; }
.sg.s3 { width: 14px; height: 14px; }
.pn { display: block; border-radius: 50%; width: 9px; height: 9px; background: color-mix(in srgb, var(--peach) 55%, var(--watch-fg)); }
.pn.p2 { width: 12px; height: 12px; background: color-mix(in srgb, var(--pink) 55%, var(--accent)); }
.pn.p3 { width: 15px; height: 15px; background: var(--accent); }
.bc-axis { display: flex; justify-content: space-between; font: 500 11px var(--font-tag); color: var(--muted); }
.bc-axis .ax-narrow { display: none; }
.bc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); margin-top: var(--s4); }
@container gl (max-width: 520px) {
  .bc.old { display: none; }
  .bc-row { grid-template-columns: repeat(var(--m), minmax(0, 1fr)); }
  .bc-axis .ax-wide { display: none; }
  .bc-axis .ax-narrow { display: inline; }
}
@media (prefers-reduced-motion: no-preference) {
  main.enter .bc > * { animation: mm-pop .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 14ms + 150ms); }
}

/* sexual health and the daily diary */
.sexh .mm-tiles { margin-top: var(--s3); }
.sx-desire { display: flex; gap: 2px; height: 12px; margin: var(--s3) 0 var(--s2); border-radius: 9999px; overflow: hidden; }
.sx-desire span { flex: var(--w) 1 0; min-width: 0; }
.sx-desire .lo { background: color-mix(in srgb, var(--icy) 70%, var(--on-icy)); }
.sx-desire .ok { background: var(--lemon); }
.sx-desire .hi { background: color-mix(in srgb, var(--pink) 55%, var(--accent)); }
.sx-key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0; }
.dy-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); }
.dy { width: 100%; display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3); border: 0; border-radius: 16px; background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--ink); text-align: left; transition: background-color .2s; }
@media (hover: hover) { .dy:hover { background: var(--surface); } }
.dy-d { flex: none; width: 44px; text-align: center; }
.dy-d strong { display: block; font: 500 20px/1.1 var(--font-head); color: var(--plum); }
.dy-d small { font-size: 11px; color: var(--muted); }
.dy-i { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dy-c { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; background: var(--surface); color: var(--plum); font: 500 12px var(--font-tag); }
.dy-c.k-bleed { background: color-mix(in srgb, var(--petal) 65%, var(--surface)); }
.dy-c.k-pain { background: color-mix(in srgb, var(--peach) 70%, var(--surface)); }
.dy-c.k-discharge, .dy-c.k-sleep { background: color-mix(in srgb, var(--icy) 60%, var(--surface)); }
.dy-c.k-test, .dy-c.k-symptom, .dy-c.k-move { background: color-mix(in srgb, var(--celadon) 60%, var(--surface)); }
.dy-c.k-sign, .dy-c.k-mood, .dy-c.k-energy { background: color-mix(in srgb, var(--lemon) 70%, var(--surface)); }
.dy-c.k-intimate, .dy-c.k-desire { background: color-mix(in srgb, var(--pink) 60%, var(--surface)); }
.dy-n { flex-basis: 100%; font-size: 13px; color: var(--muted); }
/* (HUB-END) */

/* ---------- One pattern for the purple header, and one size scale for the Cycle page (HEADER-START) ---------- */
/* Header: the page name small on top, the headline fact large, one supporting line, at most two chips, and one aside. */
.hero.has-tile .greet, .hero.has-bloom .greet { font: 500 12px var(--font-tag); letter-spacing: .08em; text-transform: uppercase; }
.hero.has-tile h1, .hero.has-bloom h1 { font-size: 26px; line-height: 1.2; }
.hero.has-tile .affirm, .hero.has-bloom .affirm { max-width: 58ch; font-size: 15px; line-height: 1.5; }
.hero > .hero-actions { flex: 1 1 100%; margin: 0; }
.hero > .hero-actions .btn { flex: 1 1 0; }
@media (min-width: 1024px) {
  .hero.has-tile h1, .hero.has-bloom h1 { font-size: 36px; }
  .hero > .hero-actions { flex: none; flex-direction: column; align-items: stretch; min-width: 0; }
  .hero > .hero-actions .btn { flex: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .content > .hero > .hero-actions { grid-column: 1 / -1; flex-direction: row; }
  .content > .hero > .hero-actions .btn { flex: 1 1 0; }
}

/* Cycle page sizes: card titles 20px, parts inside a card 16px, labels 12px, the big numbers 24px */
.cycle-page .card > h2, .cycle-page .calnav h2, .cycle-page .lg-t { font-size: 20px; line-height: 1.25; }
.cycle-page .sub h3, .cycle-page .sub > h2 { font-size: 16px; }
.cycle-page .mm-tile strong, .cycle-page .tile strong { font-size: 24px; }
/* (HEADER-END) */

/* ---------- The name stays with its heart; the week in moods in the Settings header (NAME-START) ---------- */
.nh-keep { white-space: nowrap; }
.hero-week .lv-sub { display: block; }
.hw-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin: var(--s2) 0; }
.hw { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 10px; }
.hw .e { font-size: 22px; }
.hw small { font: 500 10px var(--font-tag); opacity: .8; }
.hw.now { background: rgba(255, 255, 255, .12); }
.hw.now small { opacity: 1; font-weight: 700; }
/* My health leads the Settings menu, so it is picked out */
.menu-row[data-page="body"] { background: color-mix(in srgb, var(--pink) 24%, transparent); }
.menu-row[data-page="body"] .mr-ic { background: var(--surface); color: var(--accent); }
/* (NAME-END) */





/* ---------- One header on every page (HERO2-START) ---------- */
/* Coloured tags on top, the headline, then one row aligned to the top: a line and two tiles. Tokens only; the tag colours are the
   pastels that stay the same in light and dark so they read on the purple. No coloured borders or side stripes. */
.hero.hero2 { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: var(--s3); min-height: 0; container: hero / inline-size; }
.hero-tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.htag { display: inline-block; padding: 3px 12px; border-radius: 9999px; font: 500 12px var(--font-tag); letter-spacing: .04em; color: var(--hero-bg); }
.htag.t0 { background: var(--on-hero-accent); }
.htag.t1 { background: var(--on-hero-aqua); }
.htag.t2 { background: var(--on-hero-lemon); }
.htag.t3 { background: var(--on-hero-pink); }
.htag.t4 { background: var(--on-hero-mint); }
.hero2 h1 { margin: 0; font-size: 26px; line-height: 1.2; color: var(--hero-text); }
/* tags, headline and the row below all use the full width of the card */
.hero.hero2 > .hero-tags, .hero.hero2 > h1, .hero.hero2 > .hero-row { width: 100%; max-width: none; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); align-items: start; }
.hero-facts .affirm { margin: 0; font-size: 15px; line-height: 1.5; max-width: 52ch; }
.hero-facts .pills { margin-top: var(--s3); }
.hero-btn { margin-top: var(--s3); min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: 9999px; background: var(--on-hero-pink); color: var(--hero-bg); font: 500 14px var(--font-body); cursor: pointer; }
.hero-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
.ht { position: relative; min-width: 0; min-height: 112px; padding: var(--s3) var(--s4); border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid var(--ring-track); }
.hero-tiles .ht, .hero-row > .ht { align-self: stretch; }
.ht-l { display: block; font: 500 11px var(--font-tag); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ht-big { display: block; margin: 4px 0; font: 500 24px/1.15 var(--font-head); color: var(--hero-text); }
.ht-big small { font: 500 12px var(--font-body); color: inherit; opacity: .85; }
.ht-big.ht-text { font-size: 17px; line-height: 1.25; }
.ht-s { display: block; font-size: 12.5px; line-height: 1.4; opacity: .9; }
.ht-bar { height: 6px; margin: 6px 0; border-radius: 9999px; background: var(--ring-track); overflow: hidden; }
.ht-bar i { display: block; height: 100%; border-radius: 9999px; background: var(--on-hero-aqua); }
.ht-bloom .ht-l, .ht-bloom .ht-big, .ht-bloom .ht-s { padding-right: 62px; }
.ht-bloom .bigbloom { position: absolute; right: 12px; top: 12px; width: 52px; margin: 0; padding: 6px; border-radius: 50%; background: var(--surface); }
.ht-bloom .bigbloom::before, .ht-bloom .bigbloom::after { display: none; }
.ht-bloom .bigbloom .bloom { filter: none; }
.ht-week .hw .e { font-size: 17px; }
/* The header follows its own width, not the screen: four layouts.
   under 280px   tiles stack, one under the other (a small phone)
   280 to 559px  the line, then two compact tiles side by side (a phone)
   560 to 899px  the line, its chips and the button on one row, then two roomy tiles (a tablet, or the web with the side menu)
   900px and up  one row: the line and two tiles in three equal cells (the web) */
.hero2 h1 { font-size: clamp(24px, 5.4cqw, 38px); }
@container hero (min-width: 560px) {
  .hero-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
  .hero-facts .affirm { flex: 1 1 260px; }
  .hero-facts .pills, .hero-facts .hero-btn { margin: 0; }
  .ht { min-height: 118px; }
  .ht-week .hw .e { font-size: 20px; }
}
@container hero (min-width: 900px) {
  .hero2 h1 { font-size: 36px; }
  .hero-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
  .hero-facts { display: block; }
  .hero-facts .pills { margin-top: var(--s3); }
  .hero-facts .hero-btn { margin-top: var(--s3); }
  .hero-tiles { display: contents; }
  .ht { min-height: 124px; }
  .ht-week .hw .e { font-size: 22px; }
}
@container hero (max-width: 419px) {
  .hero-tiles { gap: var(--s2); }
  .ht { min-height: 104px; padding: 10px 12px; }
  .ht-l { font-size: 10px; letter-spacing: .04em; }
  .ht-big { font-size: 20px; }
  .ht-big.ht-text { font-size: 15px; }
  .ht-s { font-size: 11.5px; }
  .ht-bloom .ht-l, .ht-bloom .ht-big, .ht-bloom .ht-s { padding-right: 40px; }
  .ht-bloom .bigbloom { right: 8px; top: 8px; width: 34px; padding: 4px; }
  .ht-week .hw .e { font-size: 14px; }
  .hw small { font-size: 9px; }
  .htag { font-size: 11px; padding: 2px 10px; }
}
@container hero (max-width: 279px) {
  .hero-tiles { grid-template-columns: minmax(0, 1fr); }
  .ht { min-height: 0; }
}
@supports not (container-type: inline-size) {
  .hero2 h1 { font-size: 28px; }
  @media (min-width: 600px) {
    .hero-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
    .hero-facts .affirm { flex: 1 1 260px; }
    .hero-facts .pills, .hero-facts .hero-btn { margin: 0; }
  }
  @media (min-width: 1280px) {
    .hero2 h1 { font-size: 36px; }
    .hero-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
    .hero-facts { display: block; }
    .hero-tiles { display: contents; }
  }
}
/* (HERO2-END) */
