/* ============================================================
   Siti Sihat — design system
   Mobile-first. Everything is a token so the six features can
   each own a colour without re-writing any component.
   ============================================================ */

:root {
  /* ---- brand gradients, one per feature ---- */
  --g-water:  linear-gradient(135deg, #3fc4ff 0%, #5b6cff 100%);
  --g-sugar:  linear-gradient(135deg, #ff7eb3 0%, #ff5f6d 100%);
  --g-jaw:    linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  --g-thigh:  linear-gradient(135deg, #2dd4bf 0%, #10b981 100%);
  --g-tummy:  linear-gradient(135deg, #ffb340 0%, #ff7a45 100%);
  --g-cycle:  linear-gradient(135deg, #ff8fd0 0%, #c026d3 100%);
  --g-brand:  linear-gradient(135deg, #ff8fd0 0%, #7c6bff 55%, #3fc4ff 100%);

  --c-water:  #3fa9ff;
  --c-sugar:  #ff5f8f;
  --c-jaw:    #8b5cf6;
  --c-thigh:  #10b981;
  --c-tummy:  #ff8a3d;
  --c-cycle:  #d946a8;

  /* ---- surfaces ---- */
  --bg:          #fff6fb;
  --surface:     rgba(255,255,255,.78);
  --surface-2:   rgba(255,255,255,.55);
  --surface-sol: #ffffff;
  --line:        rgba(24,16,40,.08);
  --line-strong: rgba(24,16,40,.14);

  /* ---- text ---- */
  --ink:      #221836;
  --ink-2:    #5b5070;
  --ink-3:    #8b83a0;
  --on-accent:#ffffff;

  /* ---- shape & motion ---- */
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --pad:  18px;
  --shadow-1: 0 2px 10px rgba(80,40,120,.06);
  --shadow-2: 0 10px 30px rgba(96,48,140,.12);
  --shadow-3: 0 18px 44px rgba(96,48,140,.20);
  --ease: cubic-bezier(.22,1,.36,1);

  --tabbar-h: 74px;
  --topbar-h: 66px;

  color-scheme: light;
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg:          #14101d;
    --surface:     rgba(40,32,58,.72);
    --surface-2:   rgba(40,32,58,.45);
    --surface-sol: #211a30;
    --line:        rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.16);
    --ink:      #f4effb;
    --ink-2:    #c2b8d6;
    --ink-3:    #8e84a6;
    --shadow-1: 0 2px 10px rgba(0,0,0,.30);
    --shadow-2: 0 10px 30px rgba(0,0,0,.42);
    --shadow-3: 0 18px 44px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:          #14101d;
  --surface:     rgba(40,32,58,.72);
  --surface-2:   rgba(40,32,58,.45);
  --surface-sol: #211a30;
  --line:        rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --ink:      #f4effb;
  --ink-2:    #c2b8d6;
  --ink-3:    #8e84a6;
  --shadow-1: 0 2px 10px rgba(0,0,0,.30);
  --shadow-2: 0 10px 30px rgba(0,0,0,.42);
  --shadow-3: 0 18px 44px rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ============================================================
   base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { font-family: "Baloo 2", "Plus Jakarta Sans", system-ui, sans-serif; margin: 0; line-height: 1.15; letter-spacing: -.01em; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }   /* beats the display: grid below */
input, select, textarea { font: inherit; color: inherit; }

svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   animated background
   ============================================================ */

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; display: block;
  width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(70px); opacity: .45;
  animation: drift 26s var(--ease) infinite alternate;
}
.b1 { background: #ff9ad5; top: -26vmax; left: -22vmax; }
.b2 { background: #8ad7ff; top: -14vmax; right: -28vmax; animation-delay: -6s; animation-duration: 32s; }
.b3 { background: #c4b5fd; bottom: -30vmax; left: -18vmax; animation-delay: -12s; animation-duration: 30s; }
.b4 { background: #ffd58a; bottom: -34vmax; right: -22vmax; animation-delay: -18s; animation-duration: 36s; }

:root[data-theme="dark"] .blob { opacity: .22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .blob { opacity: .22; } }

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(6vmax, 8vmax, 0) scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   app shell
   ============================================================ */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  min-height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar__titles { flex: 1; min-width: 0; }
.topbar__eyebrow { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.topbar__title {
  font-size: 24px; font-weight: 800;
  background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__title.plain { background: none; color: var(--ink); }

.topbar__back, .topbar__avatar {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease);
}
.topbar__back:active, .topbar__avatar:active { transform: scale(.92); }
.topbar__avatar { background: var(--g-brand); color: #fff; font-weight: 800; font-size: 17px; border: 0; }

.screen {
  flex: 1;
  padding: 6px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
  outline: none;
  animation: screenIn .34s var(--ease) both;
}
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   tab bar
   ============================================================ */

.tabbar {
  position: fixed; z-index: 40;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 496px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-sol) 84%, transparent);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}

.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px;
  border-radius: 19px;
  color: var(--ink-3);
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  transition: color .2s, background .25s var(--ease), transform .2s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab:active { transform: scale(.9); }
.tab.is-active { color: var(--on-accent); background: var(--g-brand); box-shadow: 0 6px 16px rgba(124,107,255,.35); }
.tab[data-route="water"].is-active  { background: var(--g-water);  box-shadow: 0 6px 16px rgba(63,169,255,.38); }
.tab[data-route="sugar"].is-active  { background: var(--g-sugar);  box-shadow: 0 6px 16px rgba(255,95,143,.38); }
.tab[data-route="move"].is-active   { background: var(--g-tummy);  box-shadow: 0 6px 16px rgba(255,138,61,.38); }
.tab[data-route="cycle"].is-active  { background: var(--g-cycle);  box-shadow: 0 6px 16px rgba(217,70,168,.38); }

/* ============================================================
   building blocks
   ============================================================ */

.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad);
  box-shadow: var(--shadow-2);
}
.card + .card, .stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 9px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 22px 2px 11px;
  font-size: 17px; font-weight: 800; color: var(--ink);
  font-family: "Baloo 2", system-ui, sans-serif;
}
.section-title .link { font-family: "Plus Jakarta Sans", sans-serif; font-size: 13px; font-weight: 700; color: var(--ink-3); }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny  { font-size: 11.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.pill--hot { background: rgba(255,95,143,.14); color: #e0356f; border-color: rgba(255,95,143,.22); }
.pill--ok  { background: rgba(16,185,129,.14); color: #059669; border-color: rgba(16,185,129,.22); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: var(--r-md);
  font-weight: 700; font-size: 15px;
  background: var(--surface-sol); border: 1px solid var(--line-strong); color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease), box-shadow .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn--block { width: 100%; }
.btn--primary { color: #fff; border: 0; background: var(--g-brand); box-shadow: 0 10px 24px rgba(124,107,255,.34); }
.btn--water  { color:#fff; border:0; background: var(--g-water); box-shadow: 0 10px 24px rgba(63,169,255,.34); }
.btn--sugar  { color:#fff; border:0; background: var(--g-sugar); box-shadow: 0 10px 24px rgba(255,95,143,.34); }
.btn--jaw    { color:#fff; border:0; background: var(--g-jaw);   box-shadow: 0 10px 24px rgba(139,92,246,.34); }
.btn--thigh  { color:#fff; border:0; background: var(--g-thigh); box-shadow: 0 10px 24px rgba(16,185,129,.34); }
.btn--tummy  { color:#fff; border:0; background: var(--g-tummy); box-shadow: 0 10px 24px rgba(255,138,61,.34); }
.btn--cycle  { color:#fff; border:0; background: var(--g-cycle); box-shadow: 0 10px 24px rgba(217,70,168,.34); }
.btn--ghost  { background: var(--surface-2); box-shadow: none; }
.btn--sm { padding: 9px 14px; font-size: 13.5px; border-radius: 13px; }
.btn--danger { color: #e11d48; border-color: rgba(225,29,72,.3); background: rgba(225,29,72,.08); box-shadow:none; }

/* form controls */
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.input, select.input {
  width: 100%; padding: 13px 14px;
  background: var(--surface-sol); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); font-size: 15.5px; font-weight: 600;
  appearance: none; -webkit-appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b83a0' stroke-width='2.4' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 38px;
}
.input:focus, select.input:focus { outline: 2px solid color-mix(in srgb, var(--c-jaw) 55%, transparent); outline-offset: 1px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch__label { font-weight: 600; font-size: 14.5px; }
.switch__label small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  flex: none; width: 50px; height: 30px; border-radius: 999px;
  background: var(--line-strong); position: relative; transition: background .25s var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .25s var(--ease);
}
.switch input:checked + .switch__track { background: var(--g-brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

/* segmented control */
.segmented { display: grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 15px; }
.segmented button { padding: 9px 4px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-3); transition: all .2s var(--ease); }
.segmented button.is-on { background: var(--surface-sol); color: var(--ink); box-shadow: var(--shadow-1); }

/* progress bar */
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; width: 0; transition: width .6s var(--ease); background: var(--g-brand); }

/* ============================================================
   home
   ============================================================ */

.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: 20px;
  color: #fff;
  background: var(--g-brand);
  box-shadow: 0 16px 38px rgba(124,107,255,.34);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.35), transparent 60%);
  pointer-events: none;
}
.hero__top { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.hero__text { flex: 1; min-width: 0; }
.hero h2 { font-size: 21px; font-weight: 800; }
.hero p { margin: 4px 0 0; font-size: 13.5px; opacity: .92; }
.hero__streak {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 20px;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.32);
  backdrop-filter: blur(6px);
}
.hero__streak b { font-size: 22px; font-weight: 800; line-height: 1; font-family: "Baloo 2", sans-serif; }
.hero__streak span { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; opacity: .9; text-transform: uppercase; }

.rings { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring svg { width: 68px; height: 68px; stroke: none; }
.ring__label { font-size: 11px; font-weight: 700; opacity: .92; }
.ring__val { font-size: 14px; font-weight: 800; font-family: "Baloo 2", sans-serif; }
.ring text { font-family: "Baloo 2", sans-serif; }

/* feature grid */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature {
  position: relative; overflow: hidden; text-align: left;
  padding: 15px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transition: transform .2s var(--ease), box-shadow .2s;
  display: flex; flex-direction: column; gap: 9px; min-height: 124px;
}
.feature:active { transform: scale(.96); }
.feature__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 14px; color: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}
.feature__icon svg { width: 23px; height: 23px; }
.feature h3 { font-size: 15.5px; font-weight: 800; }
.feature p { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--ink-3); line-height: 1.35; }
.feature__glow { position: absolute; right: -28px; top: -28px; width: 92px; height: 92px; border-radius: 50%; opacity: .16; filter: blur(6px); }
:root[data-theme="dark"] .feature__glow { opacity: .10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feature__glow { opacity: .10; } }
.feature--wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.feature--wide .feature__body { flex: 1; min-width: 0; }

.i-water { background: var(--g-water); }  .g-water { background: var(--g-water); }
.i-sugar { background: var(--g-sugar); }  .g-sugar { background: var(--g-sugar); }
.i-jaw   { background: var(--g-jaw); }    .g-jaw   { background: var(--g-jaw); }
.i-thigh { background: var(--g-thigh); }  .g-thigh { background: var(--g-thigh); }
.i-tummy { background: var(--g-tummy); }  .g-tummy { background: var(--g-tummy); }
.i-cycle { background: var(--g-cycle); }  .g-cycle { background: var(--g-cycle); }

/* ============================================================
   water
   ============================================================ */

.bottle-wrap { display: grid; place-items: center; padding: 6px 0 2px; }
.bottle {
  position: relative; width: 148px; height: 232px;
  border-radius: 58px 58px 34px 34px;
  background: var(--surface-2);
  border: 3px solid color-mix(in srgb, var(--c-water) 38%, transparent);
  overflow: hidden;
  box-shadow: inset 0 2px 18px rgba(63,169,255,.14), var(--shadow-2);
}
.bottle__water {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, #62d0ff 0%, #3f7dff 100%);
  transition: height .9s var(--ease);
}
.bottle__wave {
  position: absolute; left: -50%; width: 200%; height: 16px; top: -8px;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, #62d0ff 60%, transparent 62%) 0 0/40px 16px repeat-x;
  animation: wave 3.4s linear infinite;
}
.bottle__wave--b { top: -5px; opacity: .45; animation-duration: 4.6s; animation-direction: reverse; }
@keyframes wave { to { transform: translateX(40px); } }
.bottle__ticks { position: absolute; inset: 0; pointer-events: none; }
.bottle__ticks i { position: absolute; right: 0; width: 18px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--c-water) 32%, transparent); }
.bottle__read {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-family: "Baloo 2", sans-serif; text-shadow: 0 1px 10px rgba(255,255,255,.7);
}
:root[data-theme="dark"] .bottle__read { text-shadow: 0 1px 10px rgba(0,0,0,.65); }
.bottle__read b { display: block; font-size: 34px; font-weight: 800; line-height: 1; }
.bottle__read span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

.cups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.cup {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; border-radius: var(--r-md);
  background: var(--surface-sol); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1); transition: transform .16s var(--ease);
}
.cup:active { transform: scale(.92); }
.cup svg { width: 26px; height: 26px; color: var(--c-water); }
.cup b { font-size: 12.5px; font-weight: 800; }
.cup span { font-size: 10px; font-weight: 600; color: var(--ink-3); }

/* mini bar chart */
.chart { display: flex; align-items: flex-end; gap: 7px; height: 108px; padding-top: 6px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart__track { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 10px; background: var(--line); overflow: hidden; }
.chart__bar { width: 100%; border-radius: 10px; min-height: 4px; transition: height .6s var(--ease); background: var(--g-brand); }
.chart__lbl { font-size: 10px; font-weight: 700; color: var(--ink-3); }
.chart__col.is-today .chart__lbl { color: var(--ink); }

/* log list */
.loglist { max-height: 210px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.logitem { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.logitem:first-child { border-top: 0; }
.logitem__dot { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.logitem__dot svg { width: 17px; height: 17px; }
.logitem b { font-size: 14px; font-weight: 700; }
.logitem .muted { font-size: 11.5px; }
.logitem__del { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.logitem__del svg { width: 17px; height: 17px; }
.logitem__del:active { background: rgba(225,29,72,.12); color: #e11d48; }

.empty { padding: 26px 10px; text-align: center; color: var(--ink-3); }
.empty svg { width: 38px; height: 38px; opacity: .45; margin-bottom: 8px; }
.empty p { margin: 0; font-size: 13.5px; font-weight: 600; }

/* ============================================================
   sugar
   ============================================================ */

.gauge { position: relative; display: grid; place-items: center; padding: 4px 0; }
.gauge svg { width: 218px; height: 138px; stroke: none; overflow: visible; }
.gauge__read { position: absolute; bottom: 4px; text-align: center; font-family: "Baloo 2", sans-serif; }
.gauge__read b { display: block; font-size: 38px; font-weight: 800; line-height: 1; }
.gauge__read span { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 999px;
  background: var(--surface-sol); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease);
}
.chip:active { transform: scale(.93); }
.chip em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--c-sugar); }
.chip__emoji { font-size: 15px; }

/* ============================================================
   move / exercise
   ============================================================ */

.routine {
  position: relative; overflow: hidden; text-align: left; width: 100%;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-2); display: flex; gap: 14px; align-items: center;
  transition: transform .2s var(--ease);
}
.routine:active { transform: scale(.975); }
.routine__icon { flex: none; width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.routine__icon svg { width: 27px; height: 27px; }
.routine__body { flex: 1; min-width: 0; }
.routine h3 { font-size: 16.5px; font-weight: 800; }
.routine p { margin: 3px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.routine__meta { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.routine__go { flex: none; color: var(--ink-3); }

.weekdots { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; }
.weekdot { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.82); }
.weekdot i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-size: 14px; font-weight: 800;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.34); color: transparent; }
.weekdot.is-done i { background: #fff; border-color: #fff; color: #ff7a45; }
.weekdot.is-today { color: #fff; }
.weekdot.is-today i { box-shadow: 0 0 0 3px rgba(255,255,255,.34); }

/* the player */
.player { display: flex; flex-direction: column; gap: 16px; }
.player__stage {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 22px 18px 24px;
  color: #fff; text-align: center;
  box-shadow: var(--shadow-3);
  min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.player__stage::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.3), transparent 62%);
  pointer-events: none;
}
.player__stage.is-rest { filter: saturate(.72); }
.player__step { position: relative; z-index: 1; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .88; }
.player__name { position: relative; z-index: 1; font-size: 27px; font-weight: 800; }
.player__figure { position: relative; z-index: 1; font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.2)); animation: bob 1.8s var(--ease) infinite alternate; }
@keyframes bob { from { transform: translateY(-5px) scale(.98); } to { transform: translateY(5px) scale(1.02); } }
.player__timer { position: relative; z-index: 1; display: grid; place-items: center; }
.player__timer svg { width: 172px; height: 172px; stroke: none; }
.player__count { position: absolute; font-family: "Baloo 2", sans-serif; font-size: 50px; font-weight: 800; line-height: 1; }
.player__count small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.player__cue { position: relative; z-index: 1; font-size: 13.5px; font-weight: 600; opacity: .95; max-width: 34ch; }

.player__controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; align-items: center; }
.player__list { list-style: none; margin: 0; padding: 0; }
.player__list li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.player__list li:first-child { border-top: 0; }
.player__list li.is-now { color: var(--ink); font-weight: 800; }
.player__list li.is-done { color: var(--ink-3); }
.player__num { flex: none; width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); }
.player__list li.is-now .player__num { color: #fff; border: 0; }
.player__list li.is-done .player__num { color: #fff; border: 0; background: #10b981; }

/* ============================================================
   cycle
   ============================================================ */

.cyclehero {
  position: relative; overflow: hidden; text-align: center;
  border-radius: var(--r-xl); padding: 24px 18px;
  color: #fff; background: var(--g-cycle);
  box-shadow: 0 16px 38px rgba(217,70,168,.34);
}
.cyclehero::after { content:""; position:absolute; inset:0; background: radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.34), transparent 62%); pointer-events:none; }
.cyclehero__dial { position: relative; z-index: 1; display: grid; place-items: center; }
.cyclehero__dial svg { width: 208px; height: 208px; stroke: none; }
.cyclehero__read { position: absolute; text-align: center; font-family: "Baloo 2", sans-serif; }
.cyclehero__read b { display: block; font-size: 44px; font-weight: 800; line-height: 1; }
.cyclehero__read span { font-size: 12.5px; font-weight: 700; opacity: .92; letter-spacing: .03em; }
.cyclehero__phase { position: relative; z-index: 1; margin-top: 12px; font-size: 19px; font-weight: 800; font-family: "Baloo 2", sans-serif; }
.cyclehero__sub { position: relative; z-index: 1; margin: 4px 0 0; font-size: 13px; opacity: .93; }

.cal__head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal__head span { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--ink-3); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__day {
  position: relative; aspect-ratio: 1; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: transparent; transition: transform .15s var(--ease);
}
.cal__day:active { transform: scale(.88); }
.cal__day.is-out { opacity: .3; }
.cal__day.is-today { outline: 2px solid var(--c-cycle); outline-offset: -2px; }
.cal__day.is-period { background: var(--g-cycle); color: #fff; }
.cal__day.is-predicted { background: rgba(217,70,168,.16); color: var(--c-cycle); border: 1.5px dashed rgba(217,70,168,.5); }
.cal__day.is-fertile { background: rgba(45,212,191,.18); color: #0d9488; }
.cal__day.is-ovulation { background: var(--g-thigh); color: #fff; }
.cal__day .cal__mark { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.legend i { width: 12px; height: 12px; border-radius: 4px; }

.symptoms { display: flex; flex-wrap: wrap; gap: 8px; }
.symptom {
  padding: 9px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--surface-sol); border: 1px solid var(--line-strong); color: var(--ink-2);
  transition: transform .15s var(--ease);
}
.symptom:active { transform: scale(.93); }
.symptom.is-on { background: var(--g-cycle); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(217,70,168,.3); }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flowbtn { padding: 12px 4px; border-radius: var(--r-md); background: var(--surface-sol); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.flowbtn .drops { letter-spacing: -2px; font-size: 15px; }
.flowbtn.is-on { background: var(--g-cycle); color: #fff; border-color: transparent; }

/* ============================================================
   sheet / modal
   ============================================================ */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,12,34,.42); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .22s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(100%, 520px);
  max-height: 88dvh; overflow-y: auto;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 48px rgba(40,10,60,.3);
  animation: sheetUp .32s var(--ease) both;
}
@keyframes sheetUp { from { transform: translateY(26px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 42px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }

/* ============================================================
   toast + confetti
   ============================================================ */

.toasts {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(calc(100% - 40px), 420px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 17px; border-radius: 999px;
  background: rgba(30,20,48,.92); color: #fff;
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-3);
  animation: toastIn .3s var(--ease) both;
}
.toast svg { width: 18px; height: 18px; }
.toast.is-out { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.94); } }

.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* ============================================================
   misc
   ============================================================ */

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--c-jaw) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-jaw) 18%, transparent);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.5;
}
.note svg { flex: none; width: 19px; height: 19px; color: var(--note-c, var(--c-jaw)); margin-top: 1px; }
.note b { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.stat b { display: block; font-family: "Baloo 2", sans-serif; font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }

@media (min-width: 430px) {
  .screen { padding-left: 20px; padding-right: 20px; }
}
