/* Enforce [hidden] — WebKit's UA rule is not !important so author
   display:* declarations would otherwise override it.             */
[hidden] { display: none !important; }

/* ─────────────────────────────────────────────────────────────────
   Design tokens
   Edit variables here to retheme the entire app.
───────────────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:            #f8fafc;
  --card:          #ffffff;
  --ink:           #0f172a;
  --muted:         #64748b;
  --border:        #e2e8f0;
  --border-focus:  #0d9488;

  /* Brand */
  --primary:       #0d9488;
  --primary-dark:  #0f766e;
  --primary-light: #f0fdfa;
  --primary-text:  #0d9488;   /* teal — used as text on --primary-light backgrounds */

  /* Danger */
  --danger:        #dc2626;
  --danger-light:  #fef2f2;
  --danger-border: #fca5a5;

  /* Aliases */
  --ink-muted: #64748b;   /* same value as --muted; used where var(--ink-muted) is referenced */

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:    0 4px 16px rgba(15, 23, 42, 0.08);

  /* Radii */
  --r-sm:  6px;
  --r:     10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  22px;

  /* Type scale — change here to shift the whole app.
     rem values relative to root font-size (browser default 16px).
     Px equivalent shown in comments. */
  --font-3xs:   0.5rem;     /* 8px  */
  --font-2xs:   0.5625rem;  /* 9px  */
  --font-xs:    0.625rem;   /* 10px */
  --font-sm:    0.6875rem;  /* 11px */
  --font-md:    0.75rem;    /* 12px */
  --font-base:  0.8125rem;  /* 13px */
  --font-lg:    0.875rem;   /* 14px */
  --font-xl:    0.9375rem;  /* 15px */
  --font-input: 1rem;       /* 16px — ≥1rem prevents iOS WKWebView auto-zoom on input focus */
  --font-2xl:   1.0625rem;  /* 17px */
  --font-3xl:   1.125rem;   /* 18px */
  --font-4xl:   1.25rem;    /* 20px */
  --font-5xl:   1.375rem;   /* 22px */
  --font-6xl:   1.5rem;     /* 24px */
  --font-7xl:   1.75rem;    /* 28px */
}

/* ─────────────────────────────────────────────────────────────────
   Splash screen — shown from first paint, faded out once data loads
───────────────────────────────────────────────────────────────── */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-image: url('bg.png');
  background-size: cover;
  background-position: center center;
  background-color: #2d1a3a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.35s ease;
}
.app-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,10,35,0.50) 0%, rgba(10,5,20,0.60) 100%);
  pointer-events: none;
}
.app-splash.app-splash--out {
  opacity: 0;
  pointer-events: none;
}
.splash-wordmark {
  position: relative;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.75);
  margin: 0;
}
.wm-immun { color: #e8c96a; }
.wm-ally  { color: #c4a0d8; }
.splash-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.splash-icon svg {
  animation: platelet-breathe 2.2s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.splash-icon::after {
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192,38,211,0.35) 0%, transparent 70%);
  animation: platelet-glow-ring 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes platelet-breathe {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.09); }
}
@keyframes platelet-glow-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.9); opacity: 0;   }
  100% { transform: scale(1.9); opacity: 0;   }
}

/* ─────────────────────────────────────────────────────────────────
   Reset & base
───────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  /* Remove iOS/Android tap flash — we handle active states ourselves */
  -webkit-tap-highlight-color: transparent;
}

/* Ensure the HTML hidden attribute always wins over display rules in classes */
[hidden] { display: none !important; }

html {
  /* Anchor rem units to the iOS Dynamic Type body size.
     -apple-system-body is wired to the user's text-size preference in
     Settings → Display & Brightness → Text Size. When the user increases
     their preferred size, this value grows and all rem-based sizes follow.
     We immediately restore the font-family so only the size is inherited. */
  font: -apple-system-body;
  font-family: Inter, "Helvetica Neue", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  height: 100%;
  width: 100%;
  max-width: 100%;
  /* Prevent the viewport from scrolling — scroll happens inside .app-shell
     so that position:fixed bottom-nav doesn't jitter on iOS Safari */
  overflow: hidden;
  touch-action: manipulation;
}

body {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  touch-action: manipulation;
  padding-top: env(safe-area-inset-top, 0px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  /* Inter is loaded from the system stack; falls back to OS sans-serif */
  font-family: Inter, "Helvetica Neue", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--font-xl);
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

button, input, select {
  font: inherit;
}

/* ─────────────────────────────────────────────────────────────────
   Buttons
───────────────────────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--r);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

button:hover {
  background: var(--primary-dark);
}

button:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Ghost — used for secondary actions */
.ghost-btn {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.ghost-btn:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}

/* Chip-remove — destructive secondary action */
.chip-remove {
  background: var(--card);
  color: var(--danger);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.chip-remove:hover {
  background: var(--danger-light);
  border-color: var(--danger-border);
}

/* ─────────────────────────────────────────────────────────────────
   Inputs & labels
───────────────────────────────────────────────────────────────── */
input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem; /* ≥16px prevents iOS WKWebView auto-zoom on focus */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

input::placeholder {
  color: #94a3b8;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   Typography helpers
───────────────────────────────────────────────────────────────── */
.eyebrow,
.section-kicker,
.hero-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.header-subtitle,
.hero-text,
.muted-copy {
  color: var(--muted);
  line-height: 1.6;
}

.text-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.text-link:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────
   App shell — tracker & manage pages
───────────────────────────────────────────────────────────────── */
.app-shell {
  max-width: 720px;
  margin: 0 auto;
  height: 100%;
  overflow-x: hidden; /* prevent sliding views from creating a horizontal scrollbar */
  overflow-y: auto;
  /* Force a GPU compositing layer so overflow-x: hidden correctly clips
     translateX() animations on older iOS WebKit (avoids horizontal bleed) */
  transform: translateZ(0);
  /* Smooth momentum scroll on iOS; tells the browser this is the scroll container */
  -webkit-overflow-scrolling: touch;
  /* Allow vertical touch scrolling in WKWebView (Capacitor iOS) */
  touch-action: pan-y;
  /* Prevent overscroll chaining to the viewport */
  overscroll-behavior-y: contain;
  padding: 0 1rem calc(80px + env(safe-area-inset-bottom)); /* 60px nav + 20px breathing room + home bar */
  /* Hide scrollbar — content remains scrollable */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE / Edge */
}

.app-shell::-webkit-scrollbar {
  display: none;                /* Chrome / Safari / WebKit */
}

.landing-shell {
  max-width: 1120px;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 1.5rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 0 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.app-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-header-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.app-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.025em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-greeting {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.settings-gear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--muted);
  font-weight: normal;
  text-decoration: none;
  transition: color 120ms, background 120ms;
  flex-shrink: 0;
}

.settings-gear-btn:hover,
.settings-gear-btn:focus-visible {
  color: var(--primary);
  background: var(--primary-light);
  outline: none;
}

/* ─────────────────────────────────────────────────────────────────
   Auth bar (settings page only)
───────────────────────────────────────────────────────────────── */
.auth-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#auth-email {
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-bar button {
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
}

.app-status {
  font-size: 0.8125rem;
  color: var(--muted);
  min-height: 1.25rem;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────
   Views & animation
───────────────────────────────────────────────────────────────── */
.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* prevent grid item blowout on mobile */
  gap: 0.875rem;
  position: relative; /* for view transition overlays */
}
.app-main.is-transitioning {
  overflow: hidden; /* clip sliding views at container edges */
}

.app-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* prevent grid item blowout on mobile */
  gap: 0.875rem;
  min-width: 0; /* also a grid item inside .app-main */
  animation: view-enter 160ms ease;
}

.app-view[hidden] {
  display: none;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Native-style push/pop view transitions ──────────────────────
   Exiting view: absolute overlay on top while entering view uses
   normal flow. Higher specificity overrides base view-enter anim. */
.app-view.view-exit {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  pointer-events: none;
}
.app-view.view-enter-push { animation: v-slide-in-right  300ms cubic-bezier(0.32, 0.72, 0, 1); }
.app-view.view-exit-push  { animation: v-slide-out-left  300ms cubic-bezier(0.32, 0.72, 0, 1) forwards; }
.app-view.view-enter-pop  { animation: v-slide-in-left   300ms cubic-bezier(0.32, 0.72, 0, 1); }
.app-view.view-exit-pop   { animation: v-slide-out-right 300ms cubic-bezier(0.32, 0.72, 0, 1) forwards; }

@keyframes v-slide-in-right  { from { transform: translateX(100%); }         to { transform: translateX(0); } }
@keyframes v-slide-out-right { from { transform: translateX(0); }             to { transform: translateX(100%); } }
@keyframes v-slide-out-left  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-28%); opacity: 0; } }
@keyframes v-slide-in-left   { from { transform: translateX(-28%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─────────────────────────────────────────────────────────────────
   Cards / panels
───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  min-width: 0; /* prevent grid blowout on mobile */
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 360px);
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(236, 139, 94, 0.1));
}

.landing-copy {
  display: grid;
  gap: 0.9rem;
  max-width: 680px;
}

.landing-copy h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.8rem, 4.4vw, 5.1rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.landing-actions {
  display: grid;
  gap: 0.8rem;
  align-content: center;
  justify-self: end;
  min-height: 100%;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.landing-main {
  gap: 1rem;
}

.selling-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.8rem;
}

.selling-card {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.selling-card h3 {
  margin: 0 0 0.35rem;
}

.landing-feature-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
}

.hero-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 1.2rem 1.2rem 1.2rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.hero-panel h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.insight-panel {
  background: var(--bg);
  border-style: dashed;
}

/* ─────────────────────────────────────────────────────────────────
   Day 0 welcome screen
───────────────────────────────────────────────────────────────── */
#welcome-screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h, 80px) - var(--nav-h, 60px));
  padding-bottom: 2rem;
}

/* ── Onboarding overlay ───────────────────────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ob-fade-in 0.25s ease;
}

@keyframes ob-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ob-overlay.ob-fade-out {
  animation: ob-fade-out 0.3s ease forwards;
}

@keyframes ob-fade-out {
  to { opacity: 0; }
}

.ob-card {
  background: var(--card);
  border-radius: 1.5rem 1.5rem 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
  display: flex;
  flex-direction: column;
  animation: ob-slide-up 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes ob-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0;
}

.ob-back-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: color 0.15s;
}

.ob-back-btn:hover { color: var(--text); }

.ob-dots {
  display: flex;
  gap: 0.375rem;
}

.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, width 0.2s;
}

.ob-dot-active {
  background: var(--primary);
  width: 18px;
  border-radius: 3px;
}

.ob-header-spacer { width: 2.5rem; }

/* ── Autoimmune conditions picker ────────────────────────────────── */
.ob-ai-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ob-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: rgba(45,212,191,0.90);
  background: rgba(45,212,191,0.12);
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 20px;
  padding: 3px 6px 3px 10px;
}
.ob-ai-chip-rm {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  color: rgba(45,212,191,0.60);
  font-size: var(--font-xl);
  flex-shrink: 0;
}
.ob-ai-chip-rm:hover { color: rgba(45,212,191,1); }
.ob-ai-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 168px;
  overflow-y: auto;
}
.ob-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.60);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ob-ai-pill:active { opacity: 0.7; }
.ob-ai-pill--sel {
  color: rgba(45,212,191,0.90);
  background: rgba(45,212,191,0.13);
  border-color: rgba(45,212,191,0.30);
}
.ob-ai-pill--custom {
  border-style: dashed;
  color: rgba(255,255,255,0.45);
}
.ob-ai-pill-icon {
  font-size: var(--font-md);
  font-style: normal;
  flex-shrink: 0;
  color: inherit;
}

.ob-step-container {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.ob-step {
  padding: 1.5rem 1.5rem 2rem;
}

/* Slide animations */
@keyframes ob-in-right  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ob-in-left   { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ob-out-left  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
@keyframes ob-out-right { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.ob-slide-in-right  { animation: ob-in-right  0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.ob-slide-in-left   { animation: ob-in-left   0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.ob-slide-out-left  { animation: ob-out-left  0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards; position: absolute; inset: 0; }
.ob-slide-out-right { animation: ob-out-right 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards; position: absolute; inset: 0; }

.ob-step-content { display: flex; flex-direction: column; gap: 0.75rem; }

.ob-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}

.ob-headline {
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}

.ob-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.ob-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.ob-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--surface-2, #f1f5f9);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ob-pill:hover:not(.ob-pill-active) { background: rgba(0,0,0,0.04); border-color: var(--muted); }

.ob-pill-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ob-pill-icon { font-size: 1rem; }

.ob-sex-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ob-sex-pill { border-radius: 999px; }

.ob-bio-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ob-label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.ob-muted { font-weight: 400; color: var(--muted); }

.ob-input {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface, #fff);
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.ob-input:focus {
  outline: none;
  border-color: var(--primary);
}

.ob-next-btn {
  margin-top: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, opacity 0.15s;
}

.ob-next-btn:hover { background: var(--primary-dark); }

.ob-next-muted { opacity: 0.65; }

.ob-autoimmune-detail {
  overflow: hidden;
  max-height: 80px;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
  opacity: 1;
  margin-bottom: 0.5rem;
}
.ob-autoimmune-detail.ob-hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.ob-finish-btn { background: var(--primary); }

.ob-disclaimer {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  line-height: 1.4;
  margin: 0;
}

/* ── Welcome screen ───────────────────────────────────────────────────────── */
.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: var(--card);
  border-radius: var(--radius-lg, 1rem);
  margin: 1rem;
}

.welcome-day-label {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.welcome-headline {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
  color: var(--text);
}

.welcome-body {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 28ch;
  line-height: 1.55;
}

.welcome-disclaimer {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 1rem;
  max-width: 30ch;
  line-height: 1.4;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1rem 0;
}

.welcome-steps-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 0.25rem;
  margin-bottom: 0.25rem;
}

.welcome-step-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 0.75rem);
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.welcome-step-card:hover,
.welcome-step-card:focus-visible {
  background: var(--card-hover, rgba(255,255,255,0.05));
  transform: translateY(-1px);
}

.welcome-step-card:active {
  transform: translateY(0);
}

.welcome-step-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 2.5rem;
  text-align: center;
}

.welcome-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.welcome-step-text strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.welcome-step-text span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.welcome-step-arrow {
  font-size: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
   Day 1 header (shown when user has no entries yet)
───────────────────────────────────────────────────────────────── */
.day1-header {
  text-align: center;
  padding: 1.25rem 0.5rem 0.5rem;
}

.day1-label {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.day1-headline {
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.6rem;
}

.day1-sub {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.day1-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.day1-example {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 2rem;
  padding: 0.3rem 0.8rem;
  font-style: italic;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────
   Home — greeting header
───────────────────────────────────────────────────────────────── */
.today-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 0 0.5rem;
  gap: 0.75rem;
}

.today-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.today-greeting {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.streak-badge {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

.home-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

/* ─────────────────────────────────────────────────────────────────
   Home — daily score ring card
───────────────────────────────────────────────────────────────── */
.today-score-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin: 0.75rem 0 0;
  box-shadow: var(--shadow-xs);
}

.today-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  height: 100px;
}

.today-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.ring-arc {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ring-score-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.ring-score-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.ring-breakdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.ring-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.ring-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}

.ring-row-dot.logged {
  background: var(--primary);
}

.ring-row-name {
  color: var(--ink);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ring-row-value {
  color: var(--primary-dark);
  font-weight: 600;
  white-space: nowrap;
}

.ring-row-value.empty {
  color: var(--muted);
  font-weight: 400;
}

/* ─────────────────────────────────────────────────────────────────
   Home — quick-log strip
───────────────────────────────────────────────────────────────── */
.log-now-section {
  padding: 1.25rem 0 0;
  overflow: hidden; /* contain chip strip scroll; prevent mobile page-level overflow */
}

.log-now-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  padding: 0;
}

.log-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.5rem 0.6rem 0; /* top: room for count badge; right: trailing scroll hint */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}

.log-chips::-webkit-scrollbar {
  display: none;
}

.log-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem 0.55rem;
  border-radius: 1rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  width: auto; /* override global button width:100% */
  flex-shrink: 0;
  min-width: 60px;
}

.log-chip:hover:not(.logged) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.log-chip.logged {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.log-chip-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.log-chip-name {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.log-chip.logged .log-chip-name {
  color: var(--primary-text);
}

.log-chip-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 0.2rem;
  border: 2px solid var(--surface);
}

/* ─────────────────────────────────────────────────────────────────
   Insights usage dial
───────────────────────────────────────────────────────────────── */
.insights-dial-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.25rem 0;
}

.insights-dial-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 88px;
}

.insights-dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.insights-dial-arc {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.insights-dial-arc.full {
  stroke: var(--danger);
}

.insights-dial-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.insights-dial-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

.insights-dial-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────
   Category grid
───────────────────────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.category-card {
  text-align: left;
  padding: 1rem;
  min-height: 128px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.4rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.category-card:hover {
  /* Override the global button:hover teal fill — card stays white on hover */
  background: var(--card);
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.category-card:hover .category-card-title {
  color: var(--primary-dark);
}

.category-card:hover .category-card-count {
  background: var(--primary);
  color: #fff;
}

.category-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}

.category-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.category-card-count {
  min-width: 1.6rem;
  height: 1.6rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.category-card-copy {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.category-card-footer {
  font-size: 0.775rem;
  color: var(--muted);
  font-weight: 500;
}

.empty-panel {
  padding: 1rem;
  border-radius: var(--r);
  background: var(--bg);
  color: var(--muted);
  border: 1px dashed var(--border);
  font-size: 0.875rem;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────
   Entry lists
───────────────────────────────────────────────────────────────── */
.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.entry-list li {
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.compact-list li {
  cursor: pointer;
  transition: border-color 120ms ease;
}

.compact-list li:hover {
  border-color: var(--primary);
}

/* Tappable history entry card */
.timeline-entry--tappable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
  align-items: center;
}

.timeline-entry--tappable:hover {
  border-color: var(--primary);
  background: var(--card);
}

.timeline-entry--tappable:active {
  background: var(--primary-light);
}

/* X delete button — floats to the right of the card */
.timeline-entry-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.4rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
  align-self: center;
}

.timeline-entry-delete:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.compact-entry strong,
.timeline-entry strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.2rem;
}

.meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Prevent long unbroken strings (medication names, titles, notes) from
   blowing out the layout on narrow mobile screens. */
.timeline-entry strong,
.compact-entry strong,
.meta,
.insight-card-content,
.insight-card-source,
.exp-card-title,
.exp-card-hypothesis,
.exp-card-notes,
.exp-banner-title,
.exp-daily-text,
.hub-card-title,
.hub-card-desc,
.hero-text,
.muted-copy {
  word-break: break-word;
  overflow-wrap: break-word;
}

.entry-icon-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
}

.entry-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.entry-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #e63947;
  align-self: flex-start;
  margin-bottom: 0.05rem;
}

.entry-source-badge::before {
  content: "♥";
  font-size: 0.65rem;
}

.entry-category-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-text);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-bottom: 0.1rem;
  align-self: flex-start;
}

.entry-category {
  font-weight: 700;
  color: var(--primary-text);
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.entry-actions button {
  width: auto;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

/* ─────────────────────────────────────────────────────────────────
   Sleep stage bar — shown on sleep entries in My Story feed
───────────────────────────────────────────────────────────────── */
.sleep-stage-bar {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.sleep-stage-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
}
.sleep-stage-label {
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.75;
}
.sleep-stage-val {
  font-variant-numeric: tabular-nums;
}
.sleep-stage--deep {
  background: #dbeafe;
  color: #1d4ed8;
}
.sleep-stage--rem  {
  background: #ede9fe;
  color: #6d28d9;
}
.sleep-stage--core {
  background: #d1fae5;
  color: #065f46;
}

/* ─────────────────────────────────────────────────────────────────
   Exercise chip bar — shown on exercise entries in My Story feed
───────────────────────────────────────────────────────────────── */
.exercise-chip-bar {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.exercise-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
}
.exercise-chip-label {
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.7;
}
.exercise-chip-val { font-variant-numeric: tabular-nums; }
.exercise-chip--duration { background: #f1f5f9; color: #334155; }
.exercise-chip--light    { background: #dcfce7; color: #166534; }
.exercise-chip--moderate { background: #fef9c3; color: #854d0e; }
.exercise-chip--intense  { background: #fee2e2; color: #991b1b; }
.exercise-chip--distance { background: #dbeafe; color: #1d4ed8; }
.exercise-chip--kcal     { background: #ffedd5; color: #9a3412; }

/* Intensity dot on home vitals strip workout chip */
.vitals-chip-intensity-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 3px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────────
   Report panel — collapsible, sits above history feed
───────────────────────────────────────────────────────────────── */
.report-panel {
  padding: 0;
  overflow: hidden;
}

.report-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-radius: inherit;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.report-panel-toggle:hover {
  background: var(--primary-light);
  color: var(--ink);
}

.report-panel-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-panel-icon { font-size: 1rem; }

.report-panel-chevron {
  font-size: 1.1rem;
  color: var(--muted);
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  line-height: 1;
}

.report-panel-toggle--open .report-panel-chevron {
  transform: rotate(90deg);
}

.report-panel-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

.report-panel-desc {
  margin: 0.75rem 0 1rem;
}

.report-category-section {
  margin-bottom: 0.75rem;
}

.report-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.report-category-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-cat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  width: auto;
}

.report-cat-toggle--on {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-text);
}

/* ─────────────────────────────────────────────────────────────────
   Detail view
───────────────────────────────────────────────────────────────── */

/* Section kickers inside the detail view are labels, not navigation —
   use muted gray so they don't read as interactive tabs. */
#detail-view .section-kicker,
#detail-view .hero-kicker {
  color: var(--muted);
}

/* The detail hero is a page heading, not an interactive card.
   Remove the card border/shadow so it reads as a title, not a button. */
.detail-hero {
  background: transparent;
  border: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0.25rem;
  padding-bottom: 0.5rem;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-text);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────
   Forms
───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 0.75rem;
}

.detail-panel {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  background: var(--bg);
}

.detail-panel legend {
  padding: 0 0.4rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
}

.detail-grid {
  display: grid;
  gap: 0.65rem;
}

.empty-state-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.25rem 0;
}

.empty-state-inline .muted-copy {
  margin: 0;
}

.btn-primary-sm {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r);
  background: var(--primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms;
}

.btn-primary-sm:hover {
  background: var(--primary-dark);
}

.med-add-link-row {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 0.6rem;
}

.form-actions > button {
  flex: 1;
  padding: 0.75rem 1rem;
}

.summary {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
  min-height: 1.25rem;
}

/* ─────────────────────────────────────────────────────────────────
   Mood selector
───────────────────────────────────────────────────────────────── */
.mood-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.mood-option {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  align-content: center;
  min-height: 76px;
  padding: 0.6rem 0.35rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.mood-option:hover:not(.active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.mood-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-text);
}

.mood-option-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.mood-option-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: inherit;
}

/* ─────────────────────────────────────────────────────────────────
   Image preview
───────────────────────────────────────────────────────────────── */
.image-preview {
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg);
}

.image-preview-img,
.entry-image {
  width: 100%;
  max-width: 320px;
  border-radius: var(--r);
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────────────
   History view
───────────────────────────────────────────────────────────────── */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.segment-btn {
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: calc(var(--r) - 2px);
  transition: background 120ms ease, color 120ms ease;
}

.segment-btn:hover:not(.active) { background: rgba(0,0,0,0.04); }

.segment-btn.active {
  background: var(--primary);
  color: #fff;
}

.filter-chip-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.1rem 0 0.45rem;
  min-width: 0; /* allow flex container to shrink inside grid */
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none;
}

.filter-chip-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.filter-chip:hover:not(.active) { background: rgba(0,0,0,0.04); border-color: var(--muted); }

.filter-chip.active {
  background: var(--primary-light);
  color: var(--primary-text);
  border-color: var(--primary);
}

.inline-filter-btn {
  align-self: flex-start;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

.history-load-more {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--primary);
  border: 1.5px dashed var(--primary);
  border-radius: var(--r);
  padding: 0.65rem;
}

.history-feed {
  display: grid;
  gap: 1.25rem;
}

.day-group {
  display: grid;
  gap: 0.55rem;
}

.day-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.day-group-count {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.775rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   Settings / manage page
───────────────────────────────────────────────────────────────── */

/* Manage views — same show/hide pattern as tracker */
.manage-view[hidden] { display: none; }
.manage-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0.875rem;
  animation: view-enter 160ms ease;
}

/* Header row: back button + title + tracker link in one line */
.manage-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.manage-header-row .app-header-copy {
  flex: 1;
}

.manage-tracker-link {
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* Hub grid: three tall clickable cards */
.settings-hub-grid {
  display: grid;
  gap: 0.75rem;
}

.settings-hub-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.25rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.settings-hub-card:hover {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.hub-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.hub-card-body {
  flex: 1;
  display: grid;
  gap: 0.2rem;
}

.hub-card-title {
  font-size: 1rem;
  font-weight: 700;
}

.hub-card-desc {
  font-size: 0.8125rem;
  color: var(--muted);
}

.hub-card-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Profile summary definition list */
.profile-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 1rem;
}

.profile-dl-row {
  display: grid;
  gap: 0.1rem;
}

.profile-dl-row dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-dl-row dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* Inline two-column form layout for paired fields */
.form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* Category manage-badge */
.manage-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Medication cards */
.med-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
}

.med-card-read {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.med-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-right: 0.25rem;
}

.med-badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.med-badge-muted {
  background: var(--bg);
  color: var(--muted);
  border-color: var(--border);
}

.med-badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-border);
}

.med-card-edit {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.med-card-actions {
  display: flex;
  gap: 0.5rem;
}

.med-card-actions button {
  font-size: 0.8125rem;
  padding: 0.4rem 0.85rem;
}

.med-card-history {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.med-history-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.med-history-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.med-history-date {
  color: var(--muted);
  white-space: nowrap;
  min-width: 90px;
}

.med-history-label {
  color: var(--text);
  opacity: 0.80;
}

.manage-empty {
  padding: 0.85rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.manage-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.manage-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 0.5rem;
  align-items: center;
}

.medication-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) minmax(90px, 1fr) minmax(110px, 1fr) auto auto;
  gap: 0.5rem;
  align-items: center;
}

.manage-default {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────────
   Bottom navigation
───────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 1.25rem));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

/* Empty slot in the nav grid where the FAB sits visually */
.fab-nav-slot {
  pointer-events: none;
}

/* ── FAB anchor — handles fixed positioning, never moves ─────── */
.fab-anchor {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + 0.3rem);
  transform: translateX(-50%);
  width: 68px;
  height: 68px;
  z-index: 200;
  display: grid;
  place-items: center;
}

/* ── FAB button — only rotates, no position transition ──────── */
.fab-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.45);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, box-shadow 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

.fab-btn[aria-expanded="true"] {
  background: var(--ink);
  transform: rotate(45deg);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.3);
}

.fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

/* ── Fan backdrop ────────────────────────────────────────────── */
.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fab-backdrop-in 0.2s ease;
}

@keyframes fab-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Bottom sheet ────────────────────────────────────────────── */
.fab-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 0.5rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  box-shadow: 0 -4px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.fab-sheet.fab-sheet--open {
  transform: translateY(0);
}

.fab-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 1.25rem;
}

/* ── 3-column category grid ──────────────────────────────────── */
.fab-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}

.fab-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem 0.875rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  width: 100%;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  animation: sheet-item-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

@keyframes sheet-item-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-sheet-item:active {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.fab-sheet-icon {
  font-size: 1.75rem;
  line-height: 1;
  display: block;
}

.fab-sheet-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  text-align: center;
  display: block;
}

.bottom-nav-btn {
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: calc(var(--r-lg) - 3px);
  transition: color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}

/* Active tab: lift up + teal colour, no filled background */
.bottom-nav-btn.active {
  background: transparent;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 -2px 0 0 var(--primary) inset; /* subtle top-edge accent */
}

.bottom-nav-btn:hover:not(.active) {
  color: var(--ink);
}

.bottom-nav-btn.active:hover {
  background: transparent;
  color: var(--primary);
}

/* Suppress global button:active lift on nav buttons — they have their own active state */
.bottom-nav-btn:active {
  transform: translateY(-1px);
  box-shadow: none;
}

/* ─────────────────────────────────────────────────────────────────
   Landing page
   Intentionally does NOT inherit app-shell's sticky header or
   bottom nav padding. Uses its own layout container.
───────────────────────────────────────────────────────────────── */

/* Override app-shell padding for the landing page — no sticky header,
   no bottom nav, so the big bottom padding is not needed */
.landing-shell {
  max-width: 1040px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* The landing hero is a standalone full-width card, not using .panel */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.landing-copy {
  display: grid;
  gap: 1rem;
}

.landing-copy h1 {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.landing-copy .hero-text {
  max-width: 50ch;
  font-size: 1rem;
  line-height: 1.65;
}

/* The sign-in action card sits in the right column */
.landing-actions {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.landing-actions p.summary {
  text-align: center;
  margin-top: 0;
}

.landing-actions button {
  width: 100%;
  padding: 0.75rem 1.25rem;
}

.landing-main {
  display: grid;
  gap: 1rem;
}

.selling-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.selling-card {
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
}

.selling-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.9375rem;
}

.landing-feature-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .app-shell {
    padding: 0 0.875rem calc(5.75rem + env(safe-area-inset-bottom));
  }

  .app-header {
    /* On small screens keep sticky but reduce padding */
    padding: 0.65rem 0 0.6rem;
  }

  /* Landing layout stacks to single column */
  .landing-shell {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .landing-shell {
    padding-bottom: 1rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero,
  .selling-grid {
    grid-template-columns: 1fr;
  }

  .landing-copy h1 {
    max-width: none;
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .landing-actions {
    justify-self: stretch;
    min-height: auto;
    padding: 1rem;
  }

  .mood-selector {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-actions,
  .entry-actions,
  .auth-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-actions button {
    width: 100%;
  }

  /* Stack the detail topbar and day-group-header to column,
     but let section-heading WRAP (not stack) so the action button
     stays inline when it fits, or wraps neatly below when it doesn't. */
  .detail-topbar,
  .day-group-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .manage-row,
  .medication-row,
  .form-two-col,
  .profile-dl {
    grid-template-columns: 1fr;
  }

  /* Experiment comparison cells: 2 columns is readable; 3 is too cramped. */
  .exp-comparison-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Allow medication card and experiment review buttons to wrap on small screens. */
  .med-card-actions,
  .exp-review-actions,
  .exp-card-actions,
  .exp-verdict-selector {
    flex-wrap: wrap;
  }

  /* Bottom nav: shrink text and padding so "Experiments" fits at ≤375 px. */
  .bottom-nav-btn {
    padding: 0.6rem 0.2rem;
    font-size: 0.8125rem;
  }

  /* On the manage page, hide the redundant "Tracker" link in the header
     since the "← Tracker" / "← Back" back-button already handles navigation. */
  .manage-tracker-link {
    display: none;
  }
}

/* ─── Very narrow screens: iPhone SE / mini (≤ 390px) ──────────────────────
   Tighten fixed-size rings, dials, and the FAB so they don't crowd the
   content on 375px-wide devices.                                            */
@media (max-width: 390px) {
  .app-shell {
    padding: 0 0.75rem calc(80px + env(safe-area-inset-bottom));
  }

  /* Daily score ring: 100px → 82px */
  .today-ring-wrap {
    width: 82px;
    height: 82px;
  }
  .today-score-card {
    gap: 0.875rem;
  }

  /* Insights dial: 88px → 74px */
  .insights-dial-ring-wrap {
    width: 74px;
    height: 74px;
  }
  .insights-dial-wrap {
    gap: 0.875rem;
  }

  /* FAB: 68px → 58px */
  .fab-anchor,
  .fab-btn {
    width: 58px;
    height: 58px;
  }

  /* Greeting headline: cap at smaller size so it never forces a 3rd line */
  .today-greeting {
    font-size: 1.45rem;
  }

  /* Settings rows: tighten horizontal padding */
  .about-settings-row {
    padding: 0.75rem 0.85rem;
  }
}

/* ─────────────────────────────────────────────────────────────────
   Experiments
───────────────────────────────────────────────────────────────── */

/* Home + experiments view banner */
.experiment-banner {
  background: transparent;
  border: none;
  margin: 0;
}

.exp-compact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
}
.exp-compact-row:hover { border-color: var(--primary); }

.exp-compact-icon { font-size: 1rem; flex-shrink: 0; }

.exp-compact-label {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

.exp-compact-arrow {
  font-size: 1rem;
  color: var(--muted);
  flex-shrink: 0;
}

.exp-banner-card {
  border-left: 3px solid var(--primary);
  padding: 0.55rem 0 0.55rem 0.9rem;
}

/* Home daily analysis card */
/* ── Missing data banner ─────────────────────────────────────────────────── */

#home-missing-banner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.missing-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid #f59e0b;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem 0.75rem;
}

.missing-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.missing-banner-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.missing-banner-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
}

.missing-banner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.missing-chip {
  background: var(--surface-elevated, var(--surface));
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.missing-chip:active {
  background: var(--primary-light, rgba(99,102,241,0.12));
}

.missing-banner-footer {
  display: flex;
  justify-content: flex-end;
}

.missing-banner-analyze {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.missing-banner-dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
}

.no-wearable-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
}

.no-wearable-notice-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex: 1;
}

.no-wearable-dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Home daily analysis card ─────────────────────────────────────────────── */

.home-daily-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Status accent: top border only — no green background */
.home-daily-card--on-track   { border-top-color: #22c55e; }
.home-daily-card--attention  { border-top-color: #f59e0b; }
.home-daily-card--motivate   { border-top-color: #6366f1; }

/* Daily analysis result layout */
/* Collapsed/expanded insight card */
.exp-daily-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: 0.45rem;
  text-align: left;
  color: inherit;
}
.exp-daily-toggle-row:hover  { background: none; color: inherit; opacity: 0.8; }
.exp-daily-toggle-row:active { background: none; color: inherit; opacity: 0.65; }

.exp-daily-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  flex: 1;
  min-width: 0;
}

.exp-daily-date {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 400;
}

.exp-daily-chevron {
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.exp-daily-summary-preview {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exp-daily-expandable {
  margin-top: 0.5rem;
}

.exp-daily-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.exp-daily-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
}

.exp-daily-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 0.6rem;
}

/* Segment rows */
.daily-seg-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.daily-seg-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.82rem;
  line-height: 1.45;
}

.daily-seg-hidden {
  display: none;
}

.daily-seg-label {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  min-width: 5.5rem;
  flex-shrink: 0;
}

.daily-seg-note {
  color: var(--text-secondary, #4b5563);
}

.daily-seg-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0 0;
  cursor: pointer;
  align-self: flex-start;
}

.daily-seg-toggle:hover {
  text-decoration: underline;
}

/* Footer row in home daily card (refresh or "done" label) */
.exp-daily-footer {
  margin-top: 0.6rem;
}

.exp-daily-done {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

/* Header row: toggle button + circular refresh icon */
.exp-daily-header-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.exp-daily-header-row .exp-daily-toggle-row {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.exp-daily-refresh-circle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface, #f5f5f5);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.15s;
}
.exp-daily-refresh-circle:hover  { opacity: 0.7; }
.exp-daily-refresh-circle:active { opacity: 0.5; }

/* "Based on" label inside insight card */
.daily-insight-summary {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.daily-insight-for {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  margin: 0.5rem 0 0;
}

.exp-banner-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.exp-banner-meta {
  flex: 1;
  min-width: 0; /* prevent flex blowout on long experiment titles */
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-banner-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary-text);
  opacity: 0.85;
}

.exp-banner-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.exp-banner-status {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.exp-banner-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  border: none;
}

/* Progress bar — used in banner and cards */
.exp-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: visible;
}

.exp-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 400ms ease;
}

/* Week milestone ticks at 25/50/75% */
.exp-progress-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 10px;
  background: var(--border);
  border-radius: 2px;
  z-index: 1;
}

.exp-progress-tick.reached {
  background: var(--primary-dark);
  opacity: 0.5;
}

.exp-progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Daily experiment summary strip ── */
.exp-daily-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Icon + text on one row */
.exp-daily-main {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.exp-daily-summary.exp-daily--loading {
  background: var(--surface);
  color: var(--muted);
}

.exp-daily-summary.exp-daily--on-track {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.exp-daily-summary.exp-daily--attention {
  background: #f0f4ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.exp-daily-summary.exp-daily--motivate {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Refresh / not-yet-fetched state */
.exp-daily-summary.exp-daily--refresh {
  background: transparent;
  border: none;
}

.exp-daily-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.exp-daily-text { flex: 1; min-width: 0; word-break: break-word; overflow-wrap: break-word; }
.exp-daily-date { font-size: 0.72rem; opacity: 0.55; white-space: nowrap; align-self: flex-end; }

/* Date in the daily header row */
.exp-daily-date {
  font-size: 0.72rem;
  opacity: 0.55;
  margin-left: auto;
  white-space: nowrap;
}

/* Refresh / Analyse button — full-width CTA, clearly tappable on mobile */
.exp-daily-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: 0.15rem;
  transition: background 120ms ease, transform 80ms ease;
}

.exp-daily-refresh-btn:hover,
.exp-daily-refresh-btn:focus-visible {
  background: var(--primary-dark);
  outline: none;
}

.exp-daily-refresh-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Banner variant — tighter to match slim strip */
.exp-banner-daily {
  margin-top: 0.5rem;
}

.exp-banner-daily .exp-daily-summary {
  margin-top: 0;
  font-size: 0.78rem;
}

/* Positive verdict card — green left accent */
.experiment-card.exp-card-positive {
  border-left: 3px solid #22c55e;
  background: linear-gradient(to right, #f0fdf4 0%, var(--card) 60px);
}

/* Experiment list */
.experiment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.experiment-empty {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.5rem 0;
}

/* Experiment card */
.experiment-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: var(--shadow-xs);
}

.exp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exp-card-title {
  flex: 1;
  font-size: 0.95rem;
  color: var(--ink);
}

.exp-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.exp-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.exp-badge-ready {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.exp-badge-positive    { background: #dcfce7; color: #166534; border-color: #86efac; }
.exp-badge-negative    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.exp-badge-inconclusive { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.exp-badge-abandoned   { background: #f1f5f9; color: var(--muted); border-color: var(--border); }

.exp-card-hypothesis {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.exp-card-dates {
  display: flex;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.exp-card-notes {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.exp-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

/* Baseline vs. experiment comparison panel */
.exp-comparison {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem;
}

.exp-comparison-title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exp-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.exp-comparison-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.exp-cell-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exp-cell-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.exp-cell-sub {
  font-size: 0.7rem;
  color: var(--muted);
}

.exp-delta-positive .exp-cell-value { color: #166534; }
.exp-delta-negative .exp-cell-value { color: #991b1b; }

/* Review panel */
.exp-review-panel {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--r);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exp-review-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.exp-verdict-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.exp-verdict-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.exp-verdict-btn:hover {
  background: var(--card);
  border-color: var(--primary);
  color: var(--ink);
}

.exp-verdict-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.exp-review-notes-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}

.exp-review-notes-label textarea {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  resize: vertical;
  background: var(--card);
  color: var(--ink);
}

.exp-review-notes-label textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.exp-review-actions {
  display: flex;
  gap: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────
   AI Insights
───────────────────────────────────────────────────────────────── */
.insights-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.insight-card-new {
  border-color: var(--primary);
  background: var(--primary-light);
}

.insight-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.insight-type-pill {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--primary-light);
  color: var(--primary-text);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
}

.insight-card-new .insight-type-pill {
  background: rgba(13, 148, 136, 0.15);
}

.insight-card-source {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.insight-card-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: auto;
}

/* Highlight strip — positive/earned observation at the top of any insight card */
.insight-highlight {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-sm);
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #166534;
  line-height: 1.45;
}

.insight-highlight-icon {
  flex-shrink: 0;
  font-size: 0.7rem;
  margin-top: 0.15rem;
  color: #16a34a;
}

/* Variant for the home daily card — inherits card background colour */
.insight-highlight--card {
  background: rgba(255,255,255,0.55);
  border-color: rgba(134,239,172,0.6);
}

.insight-fb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.07);
}
.insight-fb-label {
  font-size: 0.75rem;
  color: var(--ink-muted, #888);
  flex: 1;
}
.insight-fb-done {
  font-size: 0.75rem;
  color: var(--ink-muted, #888);
}
.insight-fb-btn {
  background: none;
  border: 1.5px solid rgba(0,0,0,0.14);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.insight-fb-btn:hover  { background: rgba(0,0,0,0.05); }
.insight-fb-btn:active { background: rgba(0,0,0,0.10); }
.insight-fb-btn--active { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.28); }
.insight-fb-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.insight-fb-reason {
  background: none;
  border: 1.5px solid rgba(0,0,0,0.18);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.insight-fb-reason:hover  { background: rgba(0,0,0,0.05); }
.insight-fb-reason:active { background: rgba(0,0,0,0.10); }
.insight-fb-reason--selected { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.28); }

/* Override for dark glass cards (morning brief, water-shell insight cards) */
.w-glass .insight-fb-row { border-top-color: rgba(255,255,255,0.10); }
.w-glass .insight-fb-label { color: rgba(255,255,255,0.45); }
.w-glass .insight-fb-done  { color: rgba(255,255,255,0.55); }
.w-glass .insight-fb-btn   { border-color: rgba(255,255,255,0.22); }
.w-glass .insight-fb-btn:hover  { background: rgba(255,255,255,0.08); }
.w-glass .insight-fb-btn:active { background: rgba(255,255,255,0.14); }
.w-glass .insight-fb-btn--active { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.55); }
.w-glass .insight-fb-reason { border-color: rgba(255,255,255,0.22); color: rgba(255,255,255,0.80); }
.w-glass .insight-fb-reason:hover  { background: rgba(255,255,255,0.08); }
.w-glass .insight-fb-reason--selected { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.55); }

.insight-card-content {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}

.insight-card-content p {
  margin: 0 0 0.65rem;
}

.insight-card-content p:last-child {
  margin-bottom: 0;
}

.insight-card-content p.insight-heading {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0.9rem 0 0.3rem;
}

.insight-card-content p.insight-heading:first-child {
  margin-top: 0;
}

.insight-card-content ul.insight-list {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.insight-card-content ul.insight-list:last-child {
  margin-bottom: 0;
}

.insight-card-content ul.insight-list li {
  font-size: 0.9rem;
  line-height: 1.5;
}

.insight-card-content strong {
  font-weight: 600;
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────────
   DNA double-helix loader
   Two arcs per strand: "front" arcs start opaque, "back" arcs start
   faded. A single rotation keyframe cycles them, making the helix
   appear to rotate in 3D. Strand A = brand teal, Strand B = violet.
───────────────────────────────────────────────────────────────── */
@keyframes dna-kf-front {
  0%, 100% { stroke-opacity: 1;    stroke-width: 2.5; }
  50%       { stroke-opacity: 0.12; stroke-width: 1.5; }
}
@keyframes dna-kf-back {
  0%, 100% { stroke-opacity: 0.12; stroke-width: 1.5; }
  50%       { stroke-opacity: 1;    stroke-width: 2.5; }
}

/* Strand A — teal */
.dna-a-f {
  stroke: var(--primary);
  fill: none;
  stroke-linecap: round;
  animation: dna-kf-front 1.8s ease-in-out infinite;
}
.dna-a-b {
  stroke: var(--primary);
  fill: none;
  stroke-linecap: round;
  animation: dna-kf-back 1.8s ease-in-out infinite;
}

/* Strand B — violet */
.dna-b-f {
  stroke: #7c3aed;
  fill: none;
  stroke-linecap: round;
  animation: dna-kf-front 1.8s ease-in-out infinite;
}
.dna-b-b {
  stroke: #7c3aed;
  fill: none;
  stroke-linecap: round;
  animation: dna-kf-back 1.8s ease-in-out infinite;
}

/* Rungs — subtle cross-bars between strands */
.dna-rung {
  stroke: var(--border);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ── Heartbeat / ECG loader ───────────────────────────────────────────────── */
@keyframes hb-draw {
  0%   { stroke-dashoffset:  140; }
  50%  { stroke-dashoffset:  0;   }
  100% { stroke-dashoffset: -140; }
}
.hb-path {
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 140;
  animation: hb-draw 1.8s ease-in-out infinite;
}

/* Wrapper: flex row with label */
.dna-loading-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
}

.dna-loading-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.insight-loading {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  padding: 0.75rem 0;
}

.insight-disclaimer {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* Period analysis pill */
.insight-type-pill.interval {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Diet analysis pill */
.insight-type-pill.diet {
  background: #f0fdf4;
  color: #15803d;
}

/* Experiment insight pill */
.insight-type-pill.experiment {
  background: #f5f3ff;
  color: #6d28d9;
}

/* Symptom analysis pill */
.insight-type-pill.symptom {
  background: #fff7ed;
  color: #c2410c;
}

/* Daily summary pill */
.insight-type-pill.daily {
  background: #f0f9ff;
  color: #0369a1;
}

/* ── Diet meal type pills ─────────────────────────────────────────────────── */
.diet-meal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.diet-pill {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.diet-pill:hover:not(.diet-pill-active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.diet-pill-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.diet-pill-fasting {
  border-style: dashed;
}

.diet-pill-fasting.diet-pill-active {
  background: var(--surface-2);
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
}

/* ── Diet multi-meal split prompt ────────────────────────────────────────── */

.diet-split-container {
  margin-bottom: 0.75rem;
}

.diet-split-prompt {
  background: var(--surface-2);
  border: 1.5px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
}

.diet-split-msg {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.diet-split-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diet-split-btn-yes {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;
}

.diet-split-btn-no {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;
}

.diet-split-preview {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.diet-split-row {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  font-size: 0.85rem;
}

.diet-split-row-type {
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
  min-width: 90px;
}

.diet-split-row-notes {
  color: var(--muted);
}

.diet-split-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ── Symptom severity pills ───────────────────────────────────────────────── */

.symptom-severity-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.symptom-pill {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.symptom-pill-none.symptom-pill-active     { background: #16a34a; border-color: #16a34a; color: #fff; }
.symptom-pill-mild.symptom-pill-active     { background: #d4b400; border-color: #d4b400; color: #fff; }
.symptom-pill-moderate.symptom-pill-active { background: #e07b00; border-color: #e07b00; color: #fff; }
.symptom-pill-severe.symptom-pill-active   { background: #d03030; border-color: #d03030; color: #fff; }

.symptom-pill:not(.symptom-pill-active):hover { background: rgba(0,0,0,0.04); border-color: var(--muted); }

/* ── Meal photo buttons ───────────────────────────────────────────────────── */
.entry-image-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.meal-photo-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diet-analyse-hint {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
}

/* ── Diet voice input ─────────────────────────────────────────────────────── */
.diet-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.diet-textarea-label {
  flex: 1;
  min-width: 0;
}

.diet-mic-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Explicit size — override global button width: 100% */
  width: 2.5rem !important;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms, box-shadow 120ms;
}

.diet-mic-btn:hover {
  background: var(--card);
  border-color: var(--primary);
  color: var(--primary);
}

.diet-mic-btn--listening {
  border-color: #dc2626;
  color: #fff;
  background: #dc2626;
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.diet-mic-status-text {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  min-height: 1.25rem;
}

/* Period analysis form */
.period-analysis-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.period-analysis-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}

.period-analysis-form select {
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
}

.period-analysis-form select:focus {
  outline: none;
  border-color: var(--border-focus);
}

#period-analysis-result {
  margin-top: 1rem;
}

#entry-insight-area {
  margin-top: 1rem;
}

/* ── Danger zone ──────────────────────────────────────────────────────────── */

.danger-zone {
  border: 1px solid #fecaca;
  background: #fff5f5;
  margin-top: 1.5rem;
}

.btn-danger {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { background: #fca5a5; cursor: not-allowed; }

/* ── Landing footer ───────────────────────────────────────────────────────── */

.landing-footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.landing-footer a { color: var(--ink-muted); text-decoration: underline; }
.landing-footer a:hover { color: var(--ink); }

/* ── Settings privacy note ────────────────────────────────────────────────── */

.manage-privacy-note {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-top: 1.5rem;
  padding: 0 0.25rem;
}

/* ── Lab scan ─────────────────────────────────────────────────────────────── */

/* ── Lab mode tabs ───────────────────────────────────────────────────── */
.lab-mode-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}

.lab-mode-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lab-mode-tab:hover:not(.lab-mode-tab-active) { color: var(--ink); }

.lab-mode-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Upload drop zone ────────────────────────────────────────────────── */
.lab-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.lab-drop-zone[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.lab-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-width: 140px;
  justify-content: center;
  transition: background 0.15s;
}

.lab-upload-btn:hover {
  background: var(--border);
}

.lab-upload-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.lab-scan-status-text {
  font-size: 0.8125rem;
  margin: 0.375rem 0 0;
  min-height: 1.25rem;
  color: var(--muted);
}

/* ── Review card ─────────────────────────────────────────────────────── */
.lab-review-card {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lab-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.lab-review-panel {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.lab-review-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.lab-review-rows {
  display: flex;
  flex-direction: column;
}

.lab-review-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-bottom: 1px solid var(--border);
}

.lab-review-row:last-child {
  border-bottom: none;
}

.lab-review-label {
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-review-input {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.5);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  min-width: 0;
}

.lab-review-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.lab-review-remove:hover {
  color: var(--error, #e53e3e);
  background: var(--surface-2);
}

.lab-rescan-btn {
  display: block;
  margin: 0.625rem auto 0.75rem;
  font-size: 0.8125rem;
}

/* ── OCR Review screen ──────────────────────────────────────────────────── */
.lab-ocr-review {
  padding: 0.75rem 0 0.5rem;
}

.lab-ocr-review-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
  margin: 0 0 0.375rem;
}

.lab-ocr-review-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #718096);
  line-height: 1.5;
  margin: 0 0 0.75rem;
}

.lab-ocr-textarea {
  width: 100%;
  min-height: 180px;
  max-height: 360px;
  resize: vertical;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-family: ui-monospace, "SF Mono", monospace;
  line-height: 1.55;
  color: var(--text-primary, #1a202c);
  background: var(--surface-1, #f7fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.lab-ocr-textarea:focus {
  border-color: var(--accent, #667eea);
}

.lab-ocr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.lab-ocr-confirm-btn {
  flex-shrink: 0;
}

.lab-ocr-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.labs-extra-toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.labs-extra-toggle-btn:hover {
  background: none;
  color: var(--primary-dark);
}

/* ─────────────────────────────────────────────────────────────────
   Toast notifications
───────────────────────────────────────────────────────────────── */
/* Wrapper sits exactly on the viewport — left:0;right:0 never widens the ICB */
.app-toast-anchor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h, 60px) + 1rem);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
}

.app-toast {
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  max-width: min(88%, 28rem);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.app-toast.has-action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.toast-action-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: var(--r-sm, 6px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.toast-action-btn:active {
  background: rgba(255,255,255,0.15);
}

/* ─────────────────────────────────────────────────────────────────
   Save confirmation — button flash + post-save strip
───────────────────────────────────────────────────────────────── */

/* Button flashes green for 1.5 s after a successful save */
.entry-submit--saved {
  background: #059669 !important;
  color: #fff !important;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Strip that slides in below the form actions */
.save-confirm-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  margin-top: 0.5rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  animation: save-strip-in 0.2s ease both;
  transition: opacity 0.35s ease;
}

.save-confirm-strip--out {
  opacity: 0;
}

.save-confirm-msg {
  font-size: 0.85rem;
  font-weight: 500;
  color: #166534;
}

.save-confirm-msg::before {
  content: "✓  ";
}

.save-confirm-home-btn {
  font-size: 0.8rem;
  color: #166534;
  background: transparent;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.save-confirm-home-btn:hover,
.save-confirm-home-btn:focus-visible {
  background: #dcfce7;
  outline: none;
}

@keyframes save-strip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────
   Pattern card
───────────────────────────────────────────────────────────────── */
/* ── Re-engagement nudge card ─────────────────────────────────────────────── */
.nudge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  background: var(--card);
  border: 1.5px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-xs);
}

.nudge-card-body {
  flex: 1;
  min-width: 0;
}

.nudge-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.2rem;
}

.nudge-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.nudge-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nudge-log-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.nudge-dismiss-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 50%;
}

.nudge-dismiss-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.pattern-card {
  margin: 0.75rem 0 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
}

.pattern-card-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.pattern-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pattern-list li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 1rem;
  position: relative;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pattern-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 600;
}

/* ── Export panel ─────────────────────────────────────────────────────────── */

.export-panel { margin-top: 1.5rem; }

#export-status {
  min-height: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 1 REDESIGN — New design system & components
   Branch: Refresh-UI-simple-design
═══════════════════════════════════════════════════════════════════════════ */

/* ── Override: warm palette ────────────────────────────────────────────── */
:root {
  --bg:            #f0ece4;
  --border:        #e0dbd1;
  --muted:         #6b6660;
  --ink-muted:     #6b6660;
  --ink:           #1c1814;
  --font-serif:    Georgia, 'Times New Roman', serif;
}

/* ── Minimal sticky header ─────────────────────────────────────────────── */
.app-header {
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
}
.app-wordmark {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  cursor: pointer;
}
.app-wordmark span { color: #c4a0d8; }
.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── 5-tab bottom nav — fixed, full-width, rounded top edge ── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  /* Layout */
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 60px;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  gap: 0;
  /* Visual */
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 200;
}
.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  transition: color 0.15s;
}
.bottom-nav-btn svg { flex-shrink: 0; }
.bottom-nav-btn:hover { color: var(--primary-dark); background: none; }
/* Hide old FAB slot if it lingers */
.fab-nav-slot { display: none !important; }

/* ── Today view: greeting ──────────────────────────────────────────────── */
.today-header {
  padding: 1.1rem 0 0.4rem;
}
.today-header-text { flex: 1; }
.today-greeting {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.25rem;
}
.today-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.today-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Yesterday pill ────────────────────────────────────────────────────── */
.yesterday-pill {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  margin-bottom: 0.1rem;
  overflow: hidden;
  max-width: 100%;
}
.yesterday-pill-label {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.yesterday-pill-text {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Apple Health connect card ─────────────────────────────────────────── */
#hk-connect-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.1rem;
  animation: view-enter 200ms ease;
}
.hk-connect-inner { display: flex; flex-direction: column; gap: 0.75rem; }
.hk-connect-info   { display: flex; align-items: flex-start; gap: 0.65rem; }
.hk-connect-icon   { font-size: 1.4rem; line-height: 1; flex-shrink: 0; margin-top: 0.05rem; }
.hk-connect-text   { display: flex; flex-direction: column; gap: 0.15rem; }
.hk-connect-title  { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.hk-connect-desc   { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.hk-connect-actions { display: flex; align-items: center; gap: 0.75rem; }
.hk-connect-btn {
  background: var(--accent, #e63946);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  cursor: pointer;
}
.hk-connect-btn:disabled { opacity: 0.6; cursor: default; }
.hk-connect-dismiss {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0;
}

/* ── Vitals sync animations ────────────────────────────────────────────── */

/* Pulsing kicker text while HealthKit sync is in progress */
@keyframes vitals-sync-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
#hk-vitals-strip.vitals-syncing .vitals-strip-kicker::after {
  content: " · SYNCING…";
  animation: vitals-sync-pulse 1.2s ease-in-out infinite;
  display: inline;
}

/* Green-tinted chip flash when fresh HealthKit data just arrived */
@keyframes vitals-chip-pop {
  0%   { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); transform: scale(1.02); }
  60%  { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); transform: scale(1.01); }
  100% { background: var(--surface); transform: scale(1); }
}
#hk-vitals-strip.vitals-fresh .vitals-chip {
  animation: vitals-chip-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
#hk-vitals-strip.vitals-fresh .vitals-chip:nth-child(2) { animation-delay: 0.06s; }
#hk-vitals-strip.vitals-fresh .vitals-chip:nth-child(3) { animation-delay: 0.12s; }
#hk-vitals-strip.vitals-fresh .vitals-chip:nth-child(4) { animation-delay: 0.18s; }

/* ── Today's vitals card ──────────────────────────────────────────────── */
#hk-vitals-strip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.1rem;
  animation: view-enter 200ms ease;
}
.vitals-strip-kicker {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.vitals-strip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.vitals-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--surface, #f5f5f5);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}
.vitals-chip-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.3rem;
}
.vitals-chip-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  flex-shrink: 0;
}
.vitals-chip-label {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vitals-spark {
  flex-shrink: 0;
  color: var(--primary, #0a84ff);
  opacity: 0.55;
  display: block;
}

/* ── Medication suggestion cards ───────────────────────────────────────── */
@keyframes med-suggest-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes med-suggest-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

.med-suggest-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  animation: med-suggest-in 0.2s ease both;
}

.med-suggest-card.med-suggest-exit {
  animation: med-suggest-out 0.18s ease both;
}

.med-suggest-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.med-suggest-body {
  flex: 1;
  min-width: 0;
}

.med-suggest-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.med-suggest-sub {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.med-suggest-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.med-suggest-add-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.med-suggest-add-btn:hover {
  background: var(--primary);
  color: #fff;
}

.med-suggest-dismiss-btn {
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  line-height: 1;
}

/* ── Quick-log card ────────────────────────────────────────────────────── */
.quick-log-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem 0.75rem;
  box-shadow: 0 1px 4px rgba(28,24,20,.06);
}
.quick-log-prompt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  line-height: 1.4;
  text-align: center;
}

/* ── Voice-first state ────────────────────────────────────────────────── */
.quick-log-voice-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0 0.5rem;
}

/* Primary action row: Talk + Camera side by side */
.quick-log-primary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.quick-log-primary-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 1.1rem 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: 100%;
  transition: background 0.15s, transform 0.1s;
}
.quick-log-primary-btn:hover  { background: var(--primary-dark); }
.quick-log-primary-btn:active { transform: scale(0.97); }

.quick-log-primary-btn-label { pointer-events: none; }

/* Mic recording state */
.quick-log-primary-btn.is-recording {
  background: var(--danger, #dc2626);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
  50%       { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

/* Camera loading state */
.quick-log-primary-btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.quick-log-secondary-actions {
  display: flex;
  gap: 0.75rem;
}
.quick-log-secondary-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.quick-log-secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Camera loading state on secondary button */
.quick-log-secondary-btn.is-loading {
  opacity: 0.55;
  cursor: wait;
}

/* Mini heartbeat animation reused for camera loading states */
@keyframes hb-draw-sm {
  0%   { stroke-dashoffset:  42; }
  50%  { stroke-dashoffset:  0;  }
  100% { stroke-dashoffset: -42; }
}
.hb-path-sm {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 42;
  animation: hb-draw-sm 1.4s ease-in-out infinite;
}

/* ── Text-input state ─────────────────────────────────────────────────── */
.quick-log-text-state {
  display: flex;
  flex-direction: column;
}
.quick-log-textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  resize: none;
  line-height: 1.5;
  min-height: 64px;
}
.quick-log-textarea::placeholder { color: var(--muted); font-style: italic; }
.quick-log-text-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.quick-log-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.quick-log-back-btn:hover { border-color: var(--primary); color: var(--primary); }

.quick-log-send-btn {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.quick-log-send-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
.quick-log-send-btn:not(:disabled):hover { background: var(--primary-dark); }

/* ── Category pills (replaces log-chips) ───────────────────────────────── */
/* Allow horizontal scroll to escape the parent — old overflow:hidden clipped it */
.log-now-section { overflow: visible; }
.log-now-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }

/* Override old log-chip styles for the new pill look */
.log-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem 0.75rem;
  min-width: 60px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.log-chip:hover:not(.logged) { background: rgba(0,0,0,0.04); border-color: var(--muted); }
.log-chip.logged {
  border-color: var(--primary);
  background: var(--primary-light);
}
.log-chip-icon { font-size: 1.3rem; line-height: 1; }
.log-chip-name {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}
.log-chip.logged .log-chip-name { color: var(--primary-dark); }
.log-chip-count {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 1px 5px;
}

/* ── My Story header ───────────────────────────────────────────────────── */
.my-story-header {
  padding: 1.1rem 0 0.75rem;
}
.my-story-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.my-story-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin: 0;
}
.my-story-title em {
  font-style: italic;
  color: var(--muted);
  font-weight: 400;
}

/* ── Labs view ─────────────────────────────────────────────────────────── */
/* ── Labs water page ──────────────────────────────────────────────────── */
.w-labs-page-title {
  font-size: var(--font-5xl);
  font-weight: 700;
  color: #fff;
  margin: 4px 0 16px;
}
.w-labs-section-label {
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.42);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.w-labs-section-date {
  font-weight: 500;
  color: rgba(255,255,255,0.30);
}
/* Analysis card */
.w-lab-analysis-card {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.w-lab-analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.w-lab-analysis-kicker {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #14b8a6;
}
.w-lab-analysis-date {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.35);
}
.w-lab-analysis-highlight {
  font-size: var(--font-base);
  font-weight: 600;
  color: #6ee7b7;
  margin-bottom: 8px;
  line-height: 1.5;
}
.w-lab-analysis-text {
  font-size: var(--font-lg);
  line-height: 1.65;
  color: rgba(255,255,255,0.96);
}
.w-ai-disclaimer {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.30);
  letter-spacing: 0.02em;
  margin-top: 8px;
  margin-bottom: 0;
}
.w-lab-analysis-empty {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,0.14);
}
.w-lab-analysis-empty-text {
  font-size: var(--font-md);
  color: rgba(255,255,255,0.40);
  line-height: 1.55;
}
.w-lab-analysis-empty-text strong { color: rgba(255,255,255,0.60); font-weight: 600; }
/* Metric table */
.w-lab-metric-table {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  overflow: hidden;
}
.w-lab-metric-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(to right, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}
.w-lab-metric-row:nth-child(even) {
  background: linear-gradient(to right, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
}
.w-lab-metric-row.out-range-row {
  background: linear-gradient(to right, rgba(252,165,165,0.18), rgba(252,165,165,0.04));
}
.w-lab-metric-row.in-range-row {
  background: linear-gradient(to right, rgba(110,231,183,0.14), rgba(110,231,183,0.03));
}
.w-lab-metric-row:last-child { border-bottom: none; }
.w-lab-metric-name {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.80);
  font-weight: 500;
}
.w-lab-metric-val {
  font-size: var(--font-lg);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.w-lab-metric-delta {
  font-size: var(--font-md);
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  min-width: 36px;
  text-align: right;
  white-space: nowrap;
}
.w-lab-metric-val.in-range  { color: #6ee7b7; }
.w-lab-metric-val.out-range { color: #fca5a5; }
.w-lab-metric-spark { color: #14b8a6; display: flex; align-items: center; }
/* Tappable metric rows */
.w-lab-metric-row--tappable {
  grid-template-columns: 1fr auto auto auto auto;
  cursor: pointer;
  transition: background 0.15s;
}
.w-lab-metric-row--tappable:active { background: rgba(255,255,255,0.09); }
.w-lab-metric-chevron {
  font-size: var(--font-3xl);
  color: rgba(255,255,255,0.25);
  line-height: 1;
}
/* Lab metric detail chart */
.w-lab-chart-card { padding: 16px; margin-bottom: 12px; }
.w-lab-chart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.w-lab-chart-latest {
  font-size: var(--font-7xl);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.w-lab-chart-delta {
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-left: 8px;
}
.w-lab-chart-wrap { width: 100%; padding: 4px 0; }
.w-lab-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.w-lab-chart-legend-item { font-size: var(--font-xs); color: rgba(255,255,255,0.50); }
.w-lab-reading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-lab-reading-row:last-child { border-bottom: none; }
/* Lab panel groups */
.w-lab-panel-group {
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  transition: opacity 0.2s;
}
.w-lab-panel-stale {
  opacity: 0.55;
}
.w-lab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.52);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.w-lab-panel-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.w-lab-panel-age-badge {
  font-size: var(--font-sm);
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 20px;
  padding: 2px 8px;
}
.w-lab-panel-age-fresh {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.38);
}
/* Medication rows with edit/stop actions */
.w-med-row {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.w-med-row-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.w-med-row-actions {
  display: flex;
  gap: 8px;
}
.w-med-edit-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.70);
  font-size: var(--font-md);
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}
.w-med-stop-btn {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: var(--font-md);
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}
.w-med-restart-btn {
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 8px;
  color: #6ee7b7;
  font-size: var(--font-md);
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}
.w-med-edit-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
/* Upload view — center content vertically */
#w-lab-upload-content {
  display: flex;
  flex-direction: column;
}
/* Upload row */
.w-lab-upload-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: none;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 12px;
  color: rgba(255,255,255,0.45);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
}

.labs-trend-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.labs-trend-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.labs-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
}
.labs-trend-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.labs-trend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: 0.75;
  min-height: 4px;
  transition: opacity 0.2s;
}
.labs-trend-bar.latest { opacity: 1; }
.labs-trend-bar-label {
  font-size: 0.52rem;
  color: var(--muted);
  text-align: center;
}
.labs-trend-val {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.labs-trend-empty {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0;
  font-style: italic;
}
.labs-add-row {
  margin-bottom: 0.75rem;
}
.labs-add-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.labs-add-btn:hover { background: var(--primary-dark); }
.labs-entry-list { display: flex; flex-direction: column; gap: 0.5rem; }
.labs-entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}
.labs-entry-card:hover { border-color: var(--primary); }
.labs-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.labs-entry-date { font-size: 0.7rem; color: var(--muted); font-weight: 500; }
.labs-entry-title { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.labs-entry-detail { font-size: 0.72rem; color: var(--muted); }
.labs-entry-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(13,148,136,0.12);
  color: #0d9488;
}
.labs-entry-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.labs-entry-delta-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0,0,0,0.05);
  color: var(--ink);
}
.labs-entry-delta-chip.hi { color: #0d9488; background: rgba(13,148,136,0.10); }
.labs-entry-delta-chip.lo { color: #dc2626; background: rgba(220,38,38,0.08); }
.labs-entry-insight {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.labs-entry-view-analysis {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0d9488;
  text-align: right;
  margin-top: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.labs-metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 8px;
}
.labs-metric-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.labs-metric-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.labs-metric-value {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.labs-metric-unit {
  font-size: var(--font-2xs);
  font-weight: 400;
  color: var(--muted);
}
.labs-metric-label {
  font-size: var(--font-2xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.labs-metric-chip .vitals-spark {
  color: #0d9488;
}

/* ── About view ────────────────────────────────────────────────────────── */
.about-hero {
  padding: 1.1rem 0 0.5rem;
}
.about-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin: 0.15rem 0 0.5rem;
}
.about-title em { font-style: italic; color: var(--muted); font-weight: 400; }
.about-tagline {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.about-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}
.about-steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.about-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.about-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.about-step-body { flex: 1; }
.about-step-title { font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.about-step-desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

.about-settings { margin-top: 1.25rem; }
.about-settings-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: block;
  padding: 0 0.25rem;
}
/* Card wrapper around all rows */
.about-settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.about-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  gap: 0.5rem;
  font-size: inherit;
  font-weight: inherit;
  color: var(--ink);
  box-shadow: none;
  transform: none;
  transition: background 120ms ease;
}
.about-settings-row:last-child { border-bottom: none; }
.about-settings-row:hover  { background: var(--bg); color: var(--ink); }
.about-settings-row:active { background: var(--bg); color: var(--ink); transform: none; box-shadow: none; }
.about-settings-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.about-settings-row-title { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.about-settings-row-sub   { font-size: 0.75rem; color: var(--muted); }
.about-settings-row-arrow { font-size: 1.1rem; color: var(--muted); flex-shrink: 0; }
.about-settings-row--danger .about-settings-row-title { color: var(--danger); }

/* ── Quick-log confirm sheet ────────────────────────────────────────────── */
.confirm-sheet {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  overflow: hidden; /* clip the animating panel so it can't affect document layout */
  transform: translateZ(0); /* promote to GPU compositing layer so overflow:hidden clips translateY on WKWebView */
}
.confirm-sheet[hidden] { display: none; }

.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.confirm-sheet.is-open .confirm-overlay { opacity: 1; }

.confirm-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 1.25rem 1rem 2rem;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88vh;
  overflow-y: auto;
}
.confirm-sheet.is-open .confirm-panel { transform: translateY(0); }

.confirm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.confirm-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.15rem;
}
.confirm-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}
.confirm-close-btn {
  background: var(--card);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.confirm-close-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.confirm-date-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.confirm-date-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.confirm-date-input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  flex: 1;
}
.confirm-date-input:focus { outline: none; }

.confirm-date-hint {
  font-size: 0.72rem;
  color: var(--primary);
  margin: -0.6rem 0 0.75rem;
  padding-left: 0.1rem;
}

.confirm-entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.confirm-empty {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 0;
}

/* Confirm entry card — collapsible with inline edit */
.confirm-entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.confirm-entry-card--open { border-color: var(--primary); }

.confirm-entry-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  user-select: none;
}
.confirm-entry-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.confirm-entry-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.confirm-entry-cat {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.confirm-entry-cat--new     { color: #f59e0b; }
.confirm-entry-cat--unmatched { color: #f59e0b; }
.confirm-new-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 4px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.confirm-entry-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-entry-detail {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-entry-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.35rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}
.confirm-entry-remove:hover { color: var(--danger); background: var(--danger-light); }

/* Inline edit fields */
.confirm-entry-edit-fields {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cedit-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cedit-input,
.cedit-select {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  width: 100%;
  text-transform: none;
  letter-spacing: normal;
}
.cedit-input:focus,
.cedit-select:focus {
  outline: none;
  border-color: var(--primary);
}

.cedit-delete-btn {
  margin-top: 0.25rem;
  background: none;
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s;
}
.cedit-delete-btn:hover { background: var(--danger-light); }

/* Simplified title-only edit field */
.cedit-title-input {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  width: 100%;
}
.cedit-title-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(44,90,44,.12); }

.cedit-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: -0.15rem;
}

.cedit-cat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}
.cedit-category-select {
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  width: 100%;
  cursor: pointer;
}
.cedit-category-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(44,90,44,.12); }

/* Camera button on Diet confirm cards */
.confirm-entry-camera {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0; /* override global button padding so 30px is the true size */
  border-radius: 50%;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.confirm-entry-camera:hover  { background: var(--primary); color: #fff; }
.confirm-entry-camera:active { opacity: 0.7; transform: none; }
.confirm-entry-camera.is-loading { opacity: 0.4; pointer-events: none; }

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.confirm-save-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.confirm-save-btn:hover:not(:disabled) { background: var(--primary-dark); }
.confirm-save-btn:disabled { background: var(--border); color: var(--muted); cursor: default; }

/* Fading out entries during save */
.confirm-entries-fading {
  opacity: 0.25;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

/* Success state */
/* Loading state inside confirm panel */
.confirm-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 3rem;
  gap: 0.75rem;
}

.confirm-loading-icon {
  margin-bottom: 0.25rem;
}

.confirm-loading-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.confirm-loading-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.confirm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 3.5rem;
  gap: 0.9rem;
  animation: confirm-success-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes confirm-success-pop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.confirm-success-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.confirm-success-circle svg {
  width: 38px;
  height: 38px;
}

.confirm-success-circle svg path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: confirm-draw-check 0.4s 0.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes confirm-draw-check {
  to { stroke-dashoffset: 0; }
}

.confirm-success-count {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.confirm-success-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ── Patch: hide old nav elements that are now redundant ───────────────── */
.app-header .app-header-copy { display: none; }
#show-experiments-view { display: none !important; }  /* not in new nav */

/* ═══════════════════════════════════════════════════════════════════════════
   Simplified Entry Forms  (sf-*)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Container ─────────────────────────────────────────────────────────── */
.sf-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0;
  margin: 0;
  border: none;
}

/* ── Field group ────────────────────────────────────────────────────────── */
.sf-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sf-field-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Native inputs inside sf-panel (select, time) ──────────────────────── */
.sf-panel select,
.sf-panel input[type="time"],
.sf-panel input[type="text"]:not(.sf-number-input) {
  width: 100%;
  box-sizing: border-box;
  background: var(--card);
}

.sf-panel input[type="time"] {
  width: auto;
  min-width: 9rem;
}

.sf-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sf-optional {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  opacity: 0.7;
}

.sf-locked-note {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.65;
  font-style: italic;
}

/* ── Number input row ───────────────────────────────────────────────────── */
.sf-number-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sf-number-input {
  width: 5.5rem;
  padding: 0.5rem 0.6rem;
  font-size: 1.15rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  -moz-appearance: textfield;
}
.sf-number-input::-webkit-inner-spin-button,
.sf-number-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sf-number-input:focus { outline: none; border-color: var(--primary); }
.sf-number-input[readonly] {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.sf-unit {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Score dots (1–10) ──────────────────────────────────────────────────── */
.sf-score-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.sf-score-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.sf-score-dot:hover:not(.sf-score-dot-active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.sf-score-dot-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sf-score-dot[disabled],
.sf-score-dot.sf-locked {
  pointer-events: none;
  opacity: 0.5;
}

/* ── Collapsible stages section ─────────────────────────────────────────── */
.sf-details-section {
  margin-top: 0.2rem;
}

.sf-details-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-weight: 500;
}

.sf-details-toggle svg {
  transition: transform 0.2s ease;
}

.sf-details-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.sf-stages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-top: 0.6rem;
}

.sf-stage-input {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sf-stage-input label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Notes textarea ─────────────────────────────────────────────────────── */
.sf-notes-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  resize: vertical;
  min-height: 4rem;
  font-family: inherit;
  line-height: 1.45;
}
.sf-notes-input:focus { outline: none; border-color: var(--primary); }

/* ── Pill row (multi-select tags) ───────────────────────────────────────── */
.sf-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sf-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.sf-pill:hover:not(.sf-pill-active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
  box-shadow: none;
}

.sf-pill-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sf-pill-active:hover {
  background: var(--primary);
  opacity: 0.9;
}

.sf-pill-locked {
  pointer-events: none;
  opacity: 0.55;
}

/* ── Taken / Missed / Skipped toggle ────────────────────────────────────── */
.sf-toggle-row {
  display: flex;
  gap: 0.4rem;
}

.sf-toggle-opt {
  flex: 1;
  padding: 0.5rem 0.4rem;
  border-radius: 0.6rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
  user-select: none;
}

.sf-toggle-opt:hover:not(.sf-taken-active):not(.sf-missed-active):not(.sf-skipped-active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.sf-taken-active  { background: #d1fae5; border-color: #10b981; color: #065f46; }
.sf-missed-active { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.sf-skipped-active{ background: #fef3c7; border-color: #f59e0b; color: #92400e; }

/* ── Health import button ───────────────────────────────────────────────── */
.sf-health-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.65rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.sf-health-import-btn:hover { background: rgba(0,0,0,0.04); border-color: var(--muted); }
.sf-health-import-btn svg  { flex-shrink: 0; }

.sf-health-import-btn.sf-apple  { border-color: #d1d5db; }
.sf-health-import-btn.sf-google { border-color: #4285f4; }

/* ── Source badge ───────────────────────────────────────────────────────── */
.sf-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

.sf-source-text {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.sf-clear-import {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.sf-clear-import:hover { color: var(--ink); }

/* ── Stat chips (imported read-only metrics) ────────────────────────────── */
.sf-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.sf-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 4rem;
}

.sf-stat-chip-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.sf-stat-chip-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

/* ── Callout (informational note inside a form) ─────────────────────────── */
.sf-callout {
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* ── Hero mic + camera buttons (Diet / Symptoms entry) ─────────────────── */
.sf-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.sf-hero-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.25rem 0.5rem 1rem;
  border-radius: 0.9rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  width: 100%;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sf-hero-btn svg { flex-shrink: 0; }

.sf-hero-btn:hover:not(:disabled):not(.sf-hero-active) {
  background: rgba(0,0,0,0.04);
  border-color: var(--muted);
}

.sf-hero-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
  color: var(--primary);
}

.sf-hero-status {
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1rem;
  margin-top: 0.1rem;
  text-align: center;
}

/* ── Category analyse area (below entry form, above history) ────────────── */
.cat-analyse-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cat-analyse-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cat-analyse-status {
  margin: 0;
}

.cat-analyse-result {
  margin-top: 0.25rem;
}

/* ── Inline add medication ──────────────────────────────────────────────── */
.sf-inline-add-row {
  margin-top: 0.2rem;
}

.sf-inline-add-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  cursor: pointer;
}

.sf-inline-add-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem;
  border-radius: 0.65rem;
  border: 1.5px dashed var(--border);
  background: var(--card);
  margin-top: 0.2rem;
}

.sf-inline-add-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}

.sf-inline-add-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Native platform (iOS / Android): compact entry form layout ─────────── */
html.platform-native .detail-hero {
  display: none;
}

html.platform-native #detail-view .insight-panel {
  display: none;
}

/* Override the mobile media-query column-stack — keep topbar as a row on native */
html.platform-native .detail-topbar {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

html.platform-native #detail-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--primary);
  min-width: 44px;  /* iOS minimum touch target */
  min-height: 44px;
}

html.platform-native #detail-category-pill {
  font-size: 0.9375rem;
  font-weight: 600;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

/* ── Dark-mode overrides ────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .sf-taken-active  { background: #065f46; border-color: #10b981; color: #d1fae5; }
  .sf-missed-active { background: #7f1d1d; border-color: #ef4444; color: #fee2e2; }
  .sf-skipped-active{ background: #78350f; border-color: #f59e0b; color: #fef3c7; }
  .sf-source-badge  { background: #0c4a6e; color: #bae6fd; }
  .sf-callout       { background: #0c4a6e; border-color: #0369a1; color: #bae6fd; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CLEAR WATER DESIGN SYSTEM  (Phase 1 — redesigned native app shell)

   All rules are scoped to #water-shell or use w-* class names so they
   cannot collide with the existing .app-shell or any legacy class.

   Background photo: bg.png (alpine meadow with lupins — Gemini generated).
   Swap for a bundled asset in Phase 11 before App Store submission.
══════════════════════════════════════════════════════════════════════════ */

/* ── Shell container ──────────────────────────────────────────────────── */
/* Reset legacy global button styles inside the Water shell */
#water-shell button {
  background: none;
  color: rgba(255,255,255,0.90);
  transform: none;
  box-shadow: none;
  transition: none;
}
#water-shell button:hover  { background: none; }
#water-shell button:active { transform: none; box-shadow: none; }

#water-shell {
  position: fixed;
  inset: 0;
  z-index: 50;                    /* above legacy .app-shell (z-index 0) */
  background-image: url('bg.png');
  background-size: cover;
  background-position: center center;
  background-color: #2d1a3a;     /* shows while image loads on slow connections */
  overflow: hidden;
}

/* Desktop: constrain to phone width, centred. Must come AFTER the base rule
   so it wins the cascade (same specificity, later source order). */
@media (min-width: 560px) {
  body {
    background-image: url('bg.png');
    background-size: cover;
    background-position: center center;
    background-color: #1a0d2e;
  }
  #water-shell {
    inset: unset;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 600px;
    transform: translateX(-50%);
    background-image: none;   /* body provides the background on desktop */
    background-color: transparent;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
  }
}

/* Shared dark-gradient overlay — sits between photo and all view content */
#w-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(20,10,35,0.52)  0%,
    rgba(15,8,28,0.42)  45%,
    rgba(10,5,20,0.62) 100%
  );
}

/* ── Individual view containers ──────────────────────────────────────── */
/* Each view is absolutely positioned and shown/hidden via the `hidden`
   attribute.  render.js calls waterSetActiveView() to swap them. */
.water-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scrollable inner body — padding-bottom clears the pill tab bar + home indicator */
.w-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px calc(80px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  background: rgba(10, 5, 20, 0.10);
}
.w-scroll-body::-webkit-scrollbar { display: none; }

/* ── Persistent pill tab bar ─────────────────────────────────────────── */
/* Floats above all views at the bottom of the shell */
#w-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 6px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  pointer-events: none;         /* let taps pass through padding area */
}
#w-tabbar .w-tabbar-pill {
  pointer-events: auto;
  flex: 1;                      /* stretch pill to fill available width */
}

/* ── Status bar ──────────────────────────────────────────────────────── */
.w-sb {
  height: 0;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.w-time  { display: none; }
.w-icons { display: none; }

/* ── App header (wordmark + V avatar) ───────────────────────────────── */
.w-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 18px 10px;
  flex-shrink: 0;
}
.w-wordmark {
  font-size: var(--font-sm);
  font-weight: 800;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
}
.w-wordmark b { color: #fff; font-weight: 800; }

.w-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124,58,237,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.45);
  cursor: pointer;
}

/* ── Typography utilities ────────────────────────────────────────────── */
.w-h1    { font-size: var(--font-5xl); font-weight: 800; color: #fff; letter-spacing: -0.03em; line-height: 1.15; }
.w-h2    { font-size: var(--font-input); font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.w-h3    { font-size: var(--font-base); font-weight: 700; color: #fff; }
.w-body  { font-size: var(--font-sm); color: rgba(255,255,255,0.62); line-height: 1.5; }
.w-label { font-size: var(--font-3xs);  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.42); }
.w-num   { font-size: var(--font-6xl); font-weight: 800; color: #fff; letter-spacing: -0.04em; line-height: 1; }
.w-muted { font-size: var(--font-sm); color: rgba(255,255,255,0.45); }

/* ── Glass surface (primary card material) ──────────────────────────── */
/* Only primary CTAs and data cards get the glass surface.
   Everything else floats on the water (no-box principle). */
.w-glass {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 22px;
}

/* ── CTA button variants ─────────────────────────────────────────────── */
.w-cta {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 13px;
  text-align: center;
  font-size: var(--font-base);
  font-weight: 800;
  color: #0369a1;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: block;
  width: 100%;
  border: none;
  transition: background 0.12s, transform 0.10s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.w-cta:active {
  background: rgba(255,255,255,0.82);
  transform: scale(0.97);
}
/* Restore w-cta / w-cta-ghost overridden by #water-shell button (101 > 10) */
#water-shell .w-cta {
  background: rgba(255,255,255,0.95);
  color: #0369a1;
  transition: background 0.12s, transform 0.10s;
}
#water-shell .w-cta:active {
  background: rgba(255,255,255,0.82);
  transform: scale(0.97);
}
#water-shell .w-cta-ghost {
  transition: background 0.12s, border-color 0.12s, transform 0.10s;
}
#water-shell .w-cta-ghost:active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.55);
  transform: scale(0.97);
}
.w-cta-ghost {
  border: 1.5px solid rgba(255,255,255,0.32);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  font-size: var(--font-base);
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  margin-top: 8px;
  cursor: pointer;
  display: block;
  width: 100%;
  background: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.10s;
}
.w-cta-ghost:active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.55);
  transform: scale(0.97);
}

/* ── Progress track ──────────────────────────────────────────────────── */
.w-track { height: 2px; background: rgba(255,255,255,0.18); border-radius: 2px; }
.w-fill  { height: 2px; border-radius: 2px; background: rgba(255,255,255,0.8); }

/* ── Dividers ────────────────────────────────────────────────────────── */
.w-vdivider { width: 1px; background: rgba(255,255,255,0.15); margin: 0 16px; align-self: stretch; }
.w-hdivider { height: 1px; background: rgba(255,255,255,0.12); margin: 14px 0; }

/* ── Log save tree animation ─────────────────────────────────────────── */
@keyframes w-tree-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  65%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1.0);  opacity: 1; }
}
@keyframes w-tree-shrink {
  0%   { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes w-tree-grow {
  0%   { transform: scale(0.2); opacity: 0; }
  65%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1.0); opacity: 1; }
}
@keyframes w-tree-fadein {
  from { opacity: 0; transform: translateX(-3px); }
  to   { opacity: 1; transform: translateX(0); }
}
.w-save-tree-anim {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 5px;
}
.w-save-tree-emoji {
  display: inline-block; font-size: 22px; line-height: 1;
}
.w-save-tree-pop    { animation: w-tree-pop    0.45s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.w-save-tree-shrink { animation: w-tree-shrink 0.25s ease-in forwards; }
.w-save-tree-grow   { animation: w-tree-grow   0.45s cubic-bezier(0.34,1.56,0.64,1) 0.22s both; }
.w-save-tree-label  { animation: w-tree-fadein 0.3s ease 0.3s both; }
.w-save-tree-arrow  {
  animation: w-tree-fadein 0.25s ease 0.1s both;
  font-size: 13px; color: rgba(255,255,255,0.55);
}

/* ── Onboarding step dots ────────────────────────────────────────────── */
.w-dots { display: flex; gap: 5px; justify-content: center; margin-bottom: 20px; }
.w-dot  { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.28); }
.w-dot.active { background: #fff; width: 18px; border-radius: 3px; }

/* ── Pill tab bar design ─────────────────────────────────────────────── */
.w-tabbar-pill {
  background: rgba(10,10,20,0.84);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 32px;
  padding: 5px 6px;
  display: flex;
  gap: 2px;
  align-items: center;
  position: relative;   /* anchor for the sliding indicator */
}
/* Sliding glass indicator — positioned by JS */
.w-tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 24px;
  background: rgba(0,0,0,0.42);
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.34, 1.36, 0.64, 1),
              width    0.32s cubic-bezier(0.34, 1.36, 0.64, 1);
  will-change: transform, width;
}
.w-tab-indicator.no-transition {
  transition: none;
}
.w-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0.4;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 24px;
  position: relative;   /* sit above the indicator */
  z-index: 1;
  transition: opacity 0.15s;
}
.w-tab.on   { opacity: 1; }
.w-tab-lbl  { font-size: var(--font-3xs); font-weight: 600; color: #fff; letter-spacing: 0.04em; }

/* ── Onboarding bottom panel ─────────────────────────────────────────── */
.w-onb-panel {
  background: rgba(255,255,255,0.13);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 26px 26px 0 0;
  padding: 22px 18px 28px;
  flex-shrink: 0;
  width: min(440px, 100%);
  align-self: center;
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .w-onb-panel {
    border-radius: 26px;
    margin-bottom: 48px;
  }
  .water-auth-shell {
    justify-content: center;
  }
  #w-auth-brand {
    flex: unset;
    padding: 48px 18px 24px;
  }
}

/* ── Form input ──────────────────────────────────────────────────────── */
.w-input {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 12px;
  padding: 11px 14px;
  /* max() ensures computed size never drops below 16px regardless of root
     font-size — iOS WKWebView zooms the viewport on focus when < 16px */
  font-size: max(var(--font-input), 16px);
  color: rgba(255,255,255,0.90);
  /* -webkit-text-fill-color overrides iOS system text color on inputs */
  -webkit-text-fill-color: rgba(255,255,255,0.90);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  font-family: inherit;
}
.w-input::placeholder { color: rgba(255,255,255,0.35); }
.w-input:focus { border-color: rgba(255,255,255,0.45); outline: none; }
/* Override iOS autofill background (yellow/blue) which makes white text unreadable */
.w-input:-webkit-autofill,
.w-input:-webkit-autofill:hover,
.w-input:-webkit-autofill:focus {
  -webkit-text-fill-color: rgba(255,255,255,0.90);
  -webkit-box-shadow: 0 0 0 1000px rgba(20,20,32,0.95) inset;
  box-shadow: 0 0 0 1000px rgba(20,20,32,0.95) inset;
  caret-color: rgba(56,189,248,0.90);
  border-color: rgba(255,255,255,0.20);
}

/* ── Goal-setting option cards ───────────────────────────────────────── */
.w-goal {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.w-goal.sel {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.50);
}

/* ── Diary / log entry rows ──────────────────────────────────────────── */
.w-entry {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}

/* ── Sub-tabs (Insights feed filter) ────────────────────────────────── */
.w-subtabs {
  display: flex;
  background: rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.15);
}
.w-subtab {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  font-size: var(--font-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  border-radius: 9px;
  cursor: pointer;
}
.w-subtab.on { background: rgba(255,255,255,0.18); color: #fff; }

/* ── Profile rows ────────────────────────────────────────────────────── */
.w-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.w-profile-row:last-child { border-bottom: none; }

.w-profile-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-input);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  flex-shrink: 0;
}

/* ── Shimmer skeleton loading ────────────────────────────────────────── */
/* Usage: add class .skel to any element.  Three preset templates:
   .skel-hero  (tall hero block)
   .skel-row   (single entry row height)
   .skel-card  (medium card) */
@keyframes w-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skel {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.07) 25%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.07) 75%
  );
  background-size: 800px 100%;
  animation: w-shimmer 1.4s ease-in-out infinite;
  border-radius: 12px;
}
.skel-hero { height: 100px; margin-bottom: 10px; }
.skel-row  { height:  48px; margin-bottom:  8px; }
.skel-card { height:  72px; margin-bottom: 10px; }

/* ── View transition: slide-in from right ────────────────────────────── */
/* Used by sub-views (profile, log screens) that push over a tab view */
@keyframes w-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes w-slide-out {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}
.w-view-push { animation: w-slide-in  0.28s cubic-bezier(0.32,0,0.08,1) forwards; }
.w-view-pop  { animation: w-slide-out 0.22s cubic-bezier(0.32,0,0.08,1) forwards; }

/* ── Chip colour accents for log confirmation ────────────────────────── */
/* Category colours: amber=symptoms, teal=labs, slate=diet/activity,
   indigo=medications (detected by AI), purple=experiments */
.w-chip-amber  { background: rgba(245,158, 11,0.20); border-color: rgba(245,158, 11,0.40); }
.w-chip-teal   { background: rgba( 13,148,136,0.20); border-color: rgba( 13,148,136,0.40); }
.w-chip-indigo { background: rgba( 99,102,241,0.25); border-color: rgba( 99,102,241,0.45); }
.w-chip-purple { background: rgba(139, 92,246,0.20); border-color: rgba(139, 92,246,0.40); }

/* ── Confidence bar (Sflare hypothesis cards) ────────────────────────── */
.w-conf-track { height: 3px; background: rgba(255,255,255,0.15); border-radius: 2px; margin-top: 6px; }
.w-conf-fill  { height: 3px; border-radius: 2px; background: rgba(245,158,11,0.80); }

/* ── Experiment verdict badges ───────────────────────────────────────── */
.w-verdict-confirmed   { background: rgba( 34,197, 94,0.25); color: #86efac; border: 1px solid rgba(34,197,94,0.4); border-radius: 10px; padding: 3px 10px; font-size: var(--font-xs); font-weight: 700; }
.w-verdict-inconclusive{ background: rgba(245,158, 11,0.20); color: #fcd34d; border: 1px solid rgba(245,158,11,0.4); border-radius: 10px; padding: 3px 10px; font-size: var(--font-xs); font-weight: 700; }
.w-verdict-none        { background: rgba(239, 68, 68,0.20); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4);  border-radius: 10px; padding: 3px 10px; font-size: var(--font-xs); font-weight: 700; }

/* ── Water auth shell (index.html — Phase 2) ──────────────────────────── */
/* #landing-wrapper is repurposed as the full-screen water auth container.
   The opacity:0 inline style and _showLanding() reveal mechanism are kept
   unchanged so all existing auth-flow tests continue to pass. */
.water-auth-shell {
  position: fixed;
  inset: 0;
  z-index: 10;                    /* below app-splash (z-index:9999) until revealed */
  background-image: url('bg.png');
  background-size: cover;
  background-position: center center;
  background-color: #2d1a3a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.water-auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,25,45,0.44) 0%, rgba(0,18,38,0.34) 45%, rgba(0,12,30,0.54) 100%);
}

/* Brand section — flex:1 pushes the glass panel to the bottom */
#w-auth-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 18px 20px;
  position: relative;
  z-index: 1;
  text-align: center;
}

/* SSO buttons */
.auth-sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.auth-sso-apple  { background: rgba(0,0,0,0.85);             color: #fff; }
.auth-sso-google { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: #fff; }

/* Divider "or" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  position: relative;
  z-index: 1;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.15); }
.auth-divider span   { font-size: var(--font-xs); color: rgba(255,255,255,0.45); }

/* Terms, switch links, status */
.auth-terms {
  font-size: var(--font-2xs);
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.4;
  margin: 12px 0 8px;
  position: relative;
  z-index: 1;
}
.auth-switch {
  text-align: center;
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.50);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}
.auth-switch-btn {
  color: #fff;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-status {
  font-size: var(--font-sm);
  color: #fca5a5;
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   Phase 2 — Today, Diary, Insights water view styles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Today: vitals strip container ────────────────────────────────────── */
.w-vitals-wrap {
  min-height: 72px;
  margin-bottom: 8px;
}
/* Apple Health nudge tile (native, not-yet-connected) */
.w-hk-nudge-tile {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.w-hk-dismissed-hint {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.55;
  margin: 0 0 10px;
  padding: 4px 0;
}
.w-hk-dismissed-hint-link {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-sm);
  color: rgba(45,212,191,0.70);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.w-vitals-wrap .vitals-strip-kicker {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
  margin-bottom: 6px;
}
.w-vitals-wrap .vitals-strip-grid {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.w-vitals-wrap .vitals-chip {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  min-width: 68px;
}
.w-vitals-wrap .vitals-chip-top {
  display: flex;
  align-items: center;
  gap: 4px;
}
.w-vitals-wrap .vitals-chip-value {
  font-size: var(--font-base);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.w-vitals-wrap .vitals-chip-label {
  font-size: var(--font-2xs);
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.w-vitals-wrap .vitals-spark { color: rgba(255,255,255,0.55); }
.w-vitals-wrap .vitals-chip-intensity-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}

/* ── Today: CTA card (S1 state) ────────────────────────────────────────── */
.w-log-cta-card { margin-bottom: 10px; }

/* ── Today: brief card (S2 state) ─────────────────────────────────────── */
.w-brief-card { margin-bottom: 10px; }
.w-brief-preview-text {
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.96);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.w-brief-read-more {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: rgba(45,212,191,0.80);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.w-brief-highlight {
  font-size: var(--font-base);
  font-weight: 600;
  color: #2dd4bf;
  margin-bottom: 6px;
  line-height: 1.4;
}
.w-brief-collapsed {
  display: flex;
  align-items: center;
  width: 100%;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 6px 10px 6px 14px;
  margin-bottom: 10px;
}
.w-brief-collapsed-text {
  font-size: var(--font-md);
  color: rgba(255,255,255,0.72);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}
.w-brief-collapsed-chevron {
  font-size: var(--font-input);
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
}

/* ── Today: contract card (Day X of 7) ────────────────────────────────── */
.w-contract-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.w-contract-num {
  font-size: 44px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.w-contract-text { flex: 1; }
.w-contract-label {
  font-size: var(--font-base);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
}
.w-contract-sub {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.42);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* ── Today: logging progress bar ───────────────────────────────────────── */
.w-progress-card {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.w-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.w-progress-label {
  font-size: var(--font-sm);
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.w-progress-count {
  font-size: var(--font-md);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.w-progress-track {
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 7px;
}
.w-progress-fill {
  height: 100%;
  background: #2dd4bf;
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 6px;
}
.w-progress-sub {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.38);
}

/* ── Today: I'm flaring row ────────────────────────────────────────────── */
.w-flare-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245,158,11,0.32);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.14s;
}
.w-flare-row:active { background: linear-gradient(160deg, rgba(245,158,11,0.14) 0%, rgba(245,158,11,0.10) 100%); }
.w-flare-label {
  font-size: var(--font-xl);
  font-weight: 600;
  color: rgba(251,191,36,1.0);
  letter-spacing: 0.01em;
}
.w-flare-arrow {
  font-style: normal;
  font-size: var(--font-3xl);
  color: rgba(251,191,36,0.85);
}

/* ── Today / Diary: compact log row ───────────────────────────────────── */
.w-log-row {
  display: flex;
  gap: 10px;
  margin: 12px 0 4px;
}
.w-log-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px 0 14px;
  border-radius: 18px;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.38) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
  transition: background 0.12s, transform 0.10s;
}
.w-log-btn:active {
  background: linear-gradient(160deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.48) 100%);
  transform: scale(0.96);
}
/* Restore log-btn background: #water-shell button { background:none } (101) > .w-log-btn (10) */
#water-shell .w-log-btn {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.38) 100%);
}
#water-shell .w-log-btn:active {
  background: linear-gradient(160deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.48) 100%);
}
.w-log-btn-label {
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.85);
}
.w-log-btn--lab {
  border-color: rgba(45,212,191,0.45);
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(45,212,191,0.18) 100%);
  color: rgba(45,212,191,1.00);
}
.w-log-btn--lab:active {
  background: linear-gradient(160deg, rgba(0,0,0,0.62) 0%, rgba(45,212,191,0.28) 100%);
}
.w-log-btn--lab .w-log-btn-label { color: rgba(45,212,191,0.95); }
.w-log-btn--recording {
  border-color: rgba(239,68,68,0.45);
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(239,68,68,0.22) 100%);
  color: rgba(239,68,68,0.95);
}
.w-log-btn--recording .w-log-btn-label { color: rgba(239,68,68,0.90); }
#view-log-voice .w-scroll-body,
#view-sflare .w-scroll-body { padding: 0; }

/* ── Diary: date group header ──────────────────────────────────────────── */
/* ── Diary today header ─────────────────────────────────────────────────── */
.w-diary-today-header {
  margin-bottom: 14px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px 14px;
}
.w-diary-today-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin: 0 0 8px 2px;
}
.w-diary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.w-diary-log-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: var(--font-md);
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.60);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.w-diary-log-chip--done {
  background: rgba(45,212,191,0.12);
  border-color: rgba(45,212,191,0.35);
  color: rgba(45,212,191,0.90);
  cursor: default;
}
.w-diary-log-chip--hk {
  background: rgba(56,189,248,0.10);
  border-color: rgba(56,189,248,0.28);
  color: rgba(56,189,248,0.80);
  cursor: default;
}
.w-diary-log-chip--missing {
  border-style: dashed;
}
.w-diary-log-chip--missing:active {
  background: rgba(255,255,255,0.12);
}
.w-diary-chip-check { font-size: var(--font-sm); }

.w-diary-date-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin: 14px 0 6px 2px;
}
.w-diary-date-label:first-child { margin-top: 2px; }

/* ── Diary: entry row with swipe-to-delete ─────────────────────────────── */
.w-diary-row {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 6px;
  touch-action: pan-y;
  user-select: none;
}
.w-diary-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  /* No border-radius — parent overflow:hidden + border-radius clips it */
  position: relative;
  z-index: 1;
  transition: transform 0.18s ease;
  cursor: pointer;
  will-change: transform;
  min-height: 56px;
}
.w-diary-row--hk .w-diary-row-inner { cursor: default; opacity: 0.72; }
.w-diary-row-left { flex: 1; min-width: 0; }
.w-diary-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-2xs);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.72);
  margin-bottom: 3px;
}
.w-diary-title {
  font-size: var(--font-base);
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w-diary-detail {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.w-diary-chevron {
  color: rgba(255,255,255,0.32);
  font-size: var(--font-3xl);
  flex-shrink: 0;
  margin-left: 8px;
  font-style: normal;
}
.w-diary-notes-wrap {
  margin-top: 5px;
  cursor: text;
}
.w-diary-notes-text {
  font-size: var(--font-md);
  color: rgba(255,255,255,0.52);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.w-diary-notes-placeholder {
  font-size: var(--font-md);
  color: rgba(255,255,255,0.22);
  font-style: italic;
}
.w-diary-delete-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ── Diary / filter: bottom sheet overlay ─────────────────────────────── */
/* ── Pattern discovery card ─────────────────────────────────────────────────── */
/* Slides up from bottom when a new pattern is detected in-session.             */
#pattern-discovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,0);
  transition: background 0.35s ease;
  pointer-events: none;
}
#pattern-discovery-overlay.visible {
  background: rgba(0,0,0,0.55);
  pointer-events: auto;
}
#pattern-discovery-card {
  width: 100%;
  background: linear-gradient(160deg, rgba(20,14,40,0.98) 0%, rgba(10,26,45,0.98) 100%);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 12px 20px 44px;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#pattern-discovery-overlay.visible #pattern-discovery-card {
  transform: translateY(0);
}
.pdc-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.22);
  margin: 0 auto 20px;
}
.pdc-eyebrow {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.pdc-eyebrow--confirmed { color: rgba(168,85,247,0.90); }
.pdc-eyebrow--emerging  { color: rgba(251,191,36,0.90); }
.pdc-headline {
  font-size: 19px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  line-height: 1.3;
  margin: 0 0 8px;
}
.pdc-body {
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
  margin: 0 0 24px;
}
.pdc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pdc-cta {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: var(--font-xl);
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  text-align: center;
  border: none;
}
.pdc-cta--primary {
  background: rgba(168,85,247,0.90);
  color: #fff;
}
.pdc-cta--secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.50);
  font-size: var(--font-base);
  font-weight: 500;
  padding: 11px;
}

.w-bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: flex-end;
}
.w-bottom-sheet {
  width: 100%;
  background: rgba(14,40,60,0.97);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-radius: 22px 22px 0 0;
  padding: 12px 18px 36px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.w-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.28);
  margin: 0 auto 16px;
}
.w-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.w-filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: background 0.12s;
}
.w-filter-chip.active {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.40);
  color: #fff;
}

/* ── Diary filter button: active dot ──────────────────────────────────── */
#w-diary-filter-btn.active::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b8a6;
}
#w-diary-filter-btn { position: relative; }

/* ── Insights: locked state (S5a) ─────────────────────────────────────── */
.w-insights-locked {
  text-align: center;
  padding: 24px 0 16px;
}
.w-insights-locked-num {
  font-size: 80px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.04em;
}
.w-insights-locked-sub {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.50);
  margin-bottom: 6px;
}
.w-insights-locked-hint {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.30);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.w-insights-teasers {
  filter: blur(5px);
  pointer-events: none;
  opacity: 0.45;
}

/* ── Insights: query input ─────────────────────────────────────────────── */
.w-query-wrap { margin-bottom: 10px; }
.w-query-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.w-query-input {
  flex: 1;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.92);
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.12s;
}
.w-query-input::placeholder { color: rgba(255,255,255,0.40); }
.w-query-input:focus { border-color: rgba(255,255,255,0.50); }
.w-query-submit {
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 12px;
  padding: 11px 16px;
  color: rgba(255,255,255,0.92);
  font-size: var(--font-input);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.w-query-submit:active { background: rgba(255,255,255,0.15); }
.w-usage-hint {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.55);
  margin: 5px 2px 10px;
  line-height: 1.4;
}

/* ── Insights: card feed ───────────────────────────────────────────────── */
.w-insight-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.w-insight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.w-insight-dot--amber  { background: #f59e0b; }
.w-insight-dot--teal   { background: #14b8a6; }
.w-insight-dot--white  { background: rgba(255,255,255,0.55); }
.w-insight-dot--purple { background: #a855f7; }
.w-insight-card-body { flex: 1; min-width: 0; }
.w-insight-type {
  font-size: var(--font-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.w-insight-type--amber  { color: #f59e0b; }
.w-insight-type--teal   { color: #14b8a6; }
.w-insight-type--purple { color: #a855f7; }
.w-insight-card--filler { opacity: 0.42; pointer-events: none; }
.w-insight-highlight {
  font-size: var(--font-base);
  font-weight: 600;
  color: #2dd4bf;
  line-height: 1.4;
  margin-bottom: 4px;
}
.w-insight-text {
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.96);
  line-height: 1.6;
}
.w-insight-date {
  font-size: var(--font-2xs);
  color: rgba(255,255,255,0.36);
  margin-top: 6px;
}
.w-insight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.w-insight-read-more {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: #2dd4bf;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 2px;
  display: block;
}
.w-insight-share-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 4px 10px;
  color: rgba(255,255,255,0.80);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}
.w-insight-share-btn:active {
  background: rgba(255,255,255,0.18);
}
.w-insight-share-btn--lg {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.90);
  font-size: var(--font-base);
  padding: 6px 14px;
  gap: 6px;
}
.w-insight-delete-bg {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 80px;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.w-insight-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 14px;
  transition: transform 0.15s ease;
  will-change: transform;
  width: 100%;
  box-sizing: border-box;
}

/* ── Insights: experiments section ───────────────────────────────────── */
.w-exp-section-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.60);
  text-transform: uppercase;
  margin: 16px 2px 8px;
}
/* Symptom tracking rows with merge/delete actions */
.w-sym-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-sym-row-label {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.75);
  flex: 1;
  min-width: 0;
}
.w-sym-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.w-sym-action-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.w-sym-action-btn:hover { color: rgba(168,85,247,0.85); background: rgba(168,85,247,0.12); }
.w-sym-delete-btn:hover { color: rgba(239,68,68,0.80); background: rgba(239,68,68,0.10); }
/* Merge sheet chips */
.w-merge-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.w-merge-chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(168,85,247,0.45);
  background: rgba(168,85,247,0.12);
  color: rgba(200,160,255,0.92);
  font-size: var(--font-base);
  font-weight: 500;
  cursor: pointer;
}
.w-merge-chip:active { background: rgba(168,85,247,0.25); }
.w-merge-chip-canonical {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.60);
}
.w-merge-chip-canonical:active { background: rgba(255,255,255,0.12); }
.w-exp-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  margin-bottom: 8px;
}
.w-exp-entry-card:active { background: rgba(168,85,247,0.18); }
.w-exp-entry-card-body { flex: 1; min-width: 0; }
.w-exp-entry-label { font-size: var(--font-sm); font-weight: 700; color: rgba(168,85,247,0.90); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.w-exp-entry-text  { font-size: var(--font-base); color: rgba(255,255,255,0.88); }
.w-exp-entry-arrow { color: rgba(168,85,247,0.70); font-size: var(--font-input); flex-shrink: 0; padding-left: 8px; }
.w-exp-hint {
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.96);
  line-height: 1.55;
  padding: 12px 14px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  margin-bottom: 8px;
}
.w-exp-hint strong { color: #fff; }
/* ── Experiment compliance day grid ─────────────────────────────────────── */
.w-exp-day-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.w-exp-day-rect {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}
.w-exp-day-rect--done   { background: rgba(45,212,191,0.75); }
.w-exp-day-rect--break  { background: rgba(245,158,11,0.55); }
.w-exp-day-rect--missed { background: rgba(255,255,255,0.14); }
.w-exp-day-rect--future { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); }
.w-exp-day-rect--today  { box-shadow: 0 0 0 2px rgba(255,255,255,0.55); }
.w-exp-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 4px;
}

.w-exp-start-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(168,85,247,0.60);
  background: linear-gradient(160deg, rgba(30,12,50,0.85), rgba(20,8,40,0.90));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.92);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  text-align: left;
}
.w-exp-start-btn:active { background: linear-gradient(160deg, rgba(168,85,247,0.20), rgba(124,58,237,0.18)); }
/* Restore exp-start-btn styling overridden by #water-shell button (101 > 10) */
#water-shell .w-exp-start-btn {
  background: linear-gradient(160deg, rgba(30,12,50,0.85), rgba(20,8,40,0.90));
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(168,85,247,0.60);
}
#water-shell .w-exp-start-btn:active { background: linear-gradient(160deg, rgba(168,85,247,0.20), rgba(124,58,237,0.18)); }
.w-exp-setup-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 14px 0 6px;
}
.w-exp-setup-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--font-lg);
  color: #fff;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.w-exp-setup-input::placeholder { color: rgba(255,255,255,0.30); }
.w-exp-setup-select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--font-lg);
  color: #fff;
  margin-bottom: 10px;
  box-sizing: border-box;
  appearance: none;
}
.w-exp-duration-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.w-exp-duration-pill {
  flex: 1;
  padding: 8px 0;
  border-radius: 999px;
  border: 1px solid rgba(168,85,247,0.35);
  background: rgba(168,85,247,0.07);
  color: rgba(168,85,247,0.80);
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.w-exp-duration-pill.selected {
  background: rgba(168,85,247,0.25);
  border-color: rgba(168,85,247,0.70);
  color: #fff;
}
.w-insight-rate-limit {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.28);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: var(--font-sm);
  color: rgba(252,165,165,0.9);
  margin-bottom: 10px;
  text-align: center;
}

/* ── Phase 5: S2b alert hero ───────────────────────────────────── */
.w-alert-hero {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.30);
  border-radius: 22px;
  padding: 18px 16px 14px;
  margin-bottom: 10px;
}
.w-alert-hero .w-label { color: rgba(245,158,11,0.80); margin-bottom:6px; }
.w-alert-hero .w-h2 { color: #fff; margin-bottom:6px; }
.w-alert-hero .w-cta--alert {
  background: rgba(245,158,11,0.90);
  color: #1c1400;
  border-radius: 14px;
  padding: 11px;
  text-align: center;
  font-size: var(--font-md);
  font-weight: 800;
  cursor: pointer;
  display: block;
  width: 100%;
  border: none;
  margin-top: 12px;
}

/* ── Phase 5: S2c lab comparison hero ──────────────────────────── */
.w-lab-hero {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px 14px 10px;
  margin-bottom: 10px;
}
.w-lab-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.w-lab-hero .w-label { color: rgba(255,255,255,0.45); }
.w-lab-hero-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: var(--font-3xl);
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.w-lab-hero-summary {
  font-size: var(--font-lg);
  color: rgba(255,255,255,0.96);
  line-height: 1.55;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.w-lab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.w-lab-chip {
  font-size: var(--font-sm);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}
.w-lab-chip strong { font-weight: 700; color: #fff; }
.w-lab-chip.hi strong { color: #6ee7b7; }
.w-lab-chip.lo strong { color: #fca5a5; }
.w-lab-deep-btn {
  display: block;
  width: 100%;
  margin-top: 2px;
  background: none;
  border: none;
  color: rgba(20,184,166,0.80);
  font-size: var(--font-md);
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  padding: 0;
}
.w-lab-deep-btn:active { opacity: 0.6; }

/* ── Phase 5: hypothesis chips (Sflare) ────────────────────────── */
.w-hyp-chip {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.w-hyp-chip--selectable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.w-hyp-chip--selectable:active { background: rgba(255,255,255,0.13); }
.w-hyp-chip--selected {
  border-color: rgba(20,184,166,0.70);
  background: rgba(20,184,166,0.12);
}
.w-hyp-chip--watched { opacity: 0.55; cursor: default; }

/* ── Root cause step ────────────────────────────────────────── */
.w-rc-option--selected {
  background: rgba(45,212,191,0.25) !important;
  border-color: rgba(45,212,191,0.70) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(45,212,191,0.30);
}
.w-hyp-trigger { font-size: var(--font-lg); font-weight:700; color:#fff; margin-bottom:4px; }
.w-hyp-evidence { font-size: var(--font-sm); color:rgba(255,255,255,0.55); line-height:1.4; }

/* ── Watching strip ──────────────────────────────────────────── */
.w-watching-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(20,184,166,0.28);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  color: rgba(20,184,166,0.90);
  text-align: left;
  transition: background 0.14s;
}
.w-watching-row:active { background: linear-gradient(160deg, rgba(20,184,166,0.14) 0%, rgba(20,184,166,0.10) 100%); }
.w-watching-names { flex: 1; font-size: var(--font-base); font-weight: 500; color: rgba(255,255,255,0.92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-watching-count { font-size: var(--font-sm); color: rgba(20,184,166,0.90); flex-shrink: 0; }

/* ── Inline back button for push views ────────────────────────── */
.w-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: var(--font-base);
  font-weight: 600;
  padding: 8px 12px 8px 0;
  cursor: pointer;
  display: inline-block;
  letter-spacing: -0.01em;
  transition: color 0.12s;
}
.w-back-btn:active { color: rgba(255,255,255,0.90); }

/* .w-cta--alert outside .w-alert-hero (standalone use) */
.w-cta--alert {
  background: rgba(245,158,11,0.90);
  color: #1c1400;
  border-radius: 14px;
  padding: 11px;
  text-align: center;
  font-size: var(--font-md);
  font-weight: 800;
  cursor: pointer;
  display: block;
  width: 100%;
  border: none;
}

/* ── Day coverage rings ───────────────────────────────────────────────── */
.w-cov-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 14px 12px 16px;
  margin-bottom: 10px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
}
.w-cov-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.w-cov-ring-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.40);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Phase 6: Experiments ─────────────────────────────────────────────── */

/* Today experiment banner */
.w-exp-banner {
  width: 100%;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(139,92,246,0.32);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s;
}
#water-shell .w-exp-banner {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
}
.w-exp-banner:active,
#water-shell .w-exp-banner:active { background: linear-gradient(160deg, rgba(139,92,246,0.18) 0%, rgba(139,92,246,0.12) 100%); }
.w-exp-banner-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.w-exp-banner-progress { width: 100%; }
.w-exp-banner-track {
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.w-exp-banner-fill {
  height: 100%;
  background: rgba(139,92,246,0.70);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* End early button on active-experiment view */

/* Experiment log rows (Sexp + Sexp-result) */
.w-exp-log-list { display: flex; flex-direction: column; gap: 6px; }
.w-exp-log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-exp-log-row:last-child { border-bottom: none; }
.w-exp-log-row--break { opacity: 0.55; }
.w-exp-log-date { font-size: var(--font-sm); color: rgba(255,255,255,0.45); min-width: 36px; }
.w-exp-log-title { flex: 1; font-size: var(--font-base); color: rgba(255,255,255,0.85); }
.w-exp-log-badge {
  font-size: var(--font-xs);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(239,68,68,0.18);
  color: rgba(239,68,68,0.85);
}

/* Profile row */
.w-profile-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-size: var(--font-xl);
}
.w-profile-row:last-child { border-bottom: none; }
.w-profile-row:active { background: rgba(255,255,255,0.05); }

/* ── Phase 3: Log Form + Confirm + Lab Upload ─────────────────────────── */

/* Push views (no custom status bar row) — zero out outer padding so the
   inner .w-push-page can own padding including safe-area-inset-top */
#view-log-text .w-scroll-body,
#view-log-confirm .w-scroll-body,
#view-log-parsing .w-scroll-body { padding: 0; }

/* Full-height wrapper for push views — handles safe-area + vertical layout */
.w-push-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 80px;
}
/* Flex-expander that vertically centers its content in the remaining space */
.w-push-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.w-log-analyze-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 17px 20px;
  background: linear-gradient(135deg, #2dd4bf 0%, #0ea5e9 100%);
  border: none;
  border-radius: 18px;
  color: #0c1a2e;
  font-size: var(--font-2xl);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(45,212,191,0.35);
  transition: opacity 0.15s, transform 0.10s;
}
.w-log-analyze-primary:active {
  opacity: 0.85;
  transform: scale(0.98);
}
.w-log-analyze-primary:disabled {
  opacity: 0.30;
  cursor: default;
  box-shadow: none;
}
.w-log-analyze-primary.w-saving:disabled {
  opacity: 0.80;   /* saving state: button stays readable, just slightly dimmed */
  cursor: default;
}

.w-exp-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 17px 20px;
  background: linear-gradient(135deg, rgba(168,85,247,0.92) 0%, rgba(124,58,237,0.92) 100%);
  border: none;
  border-radius: 18px;
  color: #fff;
  font-size: var(--font-2xl);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(168,85,247,0.30);
  transition: opacity 0.15s, transform 0.10s;
}
.w-exp-confirm-btn:active { opacity: 0.85; transform: scale(0.98); }
.w-exp-confirm-btn:disabled { opacity: 0.30; cursor: default; box-shadow: none; }

.w-log-rerecord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 14px;
  color: rgba(255,255,255,0.75);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
}
.w-log-rerecord-btn:active { background: rgba(255,255,255,0.12); }

/* Text log textarea card */
.w-log-form-card {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.w-log-textarea {
  width: 100%;
  min-height: 120px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: rgba(255,255,255,0.90);
  font-size: var(--font-xl);
  line-height: 1.55;
  font-family: inherit;
  caret-color: rgba(56,189,248,0.90);
}
.w-log-textarea::placeholder { color: rgba(255,255,255,0.30); }
.w-log-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.w-log-date-input {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.70);
  font-size: var(--font-input);
  font-family: inherit;
  text-align: right;
}
.w-log-date-input::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* ── Entry hub (Phase 3 voice/photo/text unified screen) ──────────────── */

.w-entry-hub {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
}

/* Idle state — flex column that fills the scroll body height */
.w-entry-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 36px;
  min-height: 100%;
}
.w-entry-close {
  align-self: flex-end;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: none;
  color: rgba(255,255,255,0.65);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.w-entry-close:active { background: rgba(255,255,255,0.18); }
.w-entry-close--rec {
  width: auto; height: auto; border-radius: 8px;
  padding: 6px 14px; font-size: var(--font-lg);
  align-self: flex-start;
  background: transparent; color: rgba(255,255,255,0.45);
}
.w-entry-date {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.40);
  text-align: center;
  margin: 0 0 0;
}

/* Mic block — centred with flex spacers around it */
.w-entry-mic-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 160px; height: 160px;
  background: rgba(56,189,248,0.12);
  border: 1.5px solid rgba(56,189,248,0.30);
  border-radius: 50%;
  color: rgba(56,189,248,0.92);
  cursor: pointer;
  /* no margin — parent uses flex spacers */
  transition: background 0.15s, transform 0.12s;
}
.w-entry-mic-hero:active { background: rgba(56,189,248,0.22); transform: scale(0.95); }
.w-entry-mic-hero-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(56,189,248,0.15);
  pointer-events: none;
}
/* Label is now in normal flow below the mic, not absolute */
.w-entry-mic-hero-label {
  font-size: var(--font-lg);
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  margin-top: 20px; /* space between mic circle and label */
  text-align: center;
}

/* Type instead link */
.w-entry-type-link {
  display: block;
  margin: 0 auto;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  color: rgba(255,255,255,0.75);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 28px;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}
.w-entry-type-link:active {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.95);
}
/* Restore overrides from #water-shell button { background:none } (101 > 10) */
#water-shell .w-entry-type-link {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.15s, color 0.15s;
}
#water-shell .w-entry-type-link:active {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.95);
  transform: scale(0.97);
}

/* Inline text mode (revealed by Type instead) */
.w-entry-text-mode {
  margin-top: 20px;
  width: 100%;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  overflow: hidden;
}
.w-entry-textarea {
  width: 100%;
  min-height: 140px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: rgba(255,255,255,0.90);
  font-size: var(--font-xl);
  line-height: 1.55;
  font-family: inherit;
  padding: 14px 16px 10px;
  caret-color: rgba(56,189,248,0.90);
  display: block;
}
.w-entry-textarea::placeholder { color: rgba(255,255,255,0.28); }
.w-entry-text-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  gap: 8px;
}
.w-entry-analyze-btn {
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2dd4bf 0%, #0ea5e9 100%);
  color: #0c1a2e;
  font-size: var(--font-xl);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.10s;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgba(45,212,191,0.30);
}
.w-entry-analyze-btn:disabled { opacity: 0.30; cursor: default; box-shadow: none; }
.w-entry-analyze-btn:not(:disabled):active { opacity: 0.82; transform: scale(0.97); }

/* ── Recording state ───────────────────────────────────────────────────── */

.w-entry-recording {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 100svh bypasses the scroll-container percentage chain */
  min-height: 100svh;
  padding: 20px 24px 60px;
  gap: 28px;
}
.w-entry-recording--active { animation: w-rec-fadein 0.22s ease; }
@keyframes w-rec-fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

.w-waveform-wrap {
  width: 100%;
  max-width: 340px;
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.w-waveform-svg {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.w-wf-bar {
  fill: rgba(56,189,248,0.25);
  transform: scaleY(0.08);
  transition: fill 0.3s;
}

/* CSS animation when recording (fallback + default) */
.w-waveform-svg.is-recording .w-wf-bar {
  fill: rgba(56,189,248,0.70);
  animation: w-bar-dance ease-in-out infinite;
}
@keyframes w-bar-dance {
  0%   { transform: scaleY(var(--wf-min, 0.08)); }
  50%  { transform: scaleY(var(--wf-max, 0.90)); }
  100% { transform: scaleY(var(--wf-min, 0.08)); }
}

.w-rec-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.w-rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(239,68,68,0.90);
  animation: w-rec-blink 1.1s ease-in-out infinite;
}
@keyframes w-rec-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
.w-rec-label {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.w-rec-transcript {
  font-size: var(--font-input);
  color: rgba(255,255,255,0.80);
  text-align: center;
  min-height: 48px;
  padding: 0 24px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 28px;
}
.w-rec-stop-btn {
  width: 100%;
  max-width: 260px;
  font-size: var(--font-input);
}

/* Confirm view */
.w-confirm-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.w-confirm-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  margin-bottom: 10px;
}
.w-confirm-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}
.w-confirm-delete-bg {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 80px;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--font-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.1s;
}
.w-confirm-inner {
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 1;
  transition: transform 0.15s ease;
  will-change: transform;
}
.w-confirm-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
}
.w-confirm-card-header:active { background: rgba(255,255,255,0.04); }
.w-confirm-icon { font-size: var(--font-4xl); line-height: 1; flex-shrink: 0; }
.w-confirm-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.w-confirm-cat  { font-size: var(--font-sm); color: rgba(56,189,248,0.80); text-transform: uppercase; letter-spacing: 0.04em; }
.w-confirm-title { font-size: var(--font-lg); color: rgba(255,255,255,0.90); }
.w-confirm-detail { font-size: var(--font-md); color: rgba(255,255,255,0.50); }
.w-confirm-edit-row {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.w-confirm-title-input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 8px 10px;
  color: rgba(255,255,255,0.90);
  font-size: var(--font-lg);
  font-family: inherit;
  outline: none;
  margin-top: 10px;
}

/* Lab pick buttons */
.w-lab-pick-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  font-size: var(--font-xl);
  font-family: inherit;
  cursor: pointer;
  display: block;
}
.w-lab-pick-btn:active { background: rgba(255,255,255,0.16); }

/* ── Lab metrics review rows (water shell) ───────────────────────────── */
.w-lab-metric-review-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.w-lab-metric-review-row:last-child { border-bottom: none; }
.w-lab-metric-review-label {
  flex: 1;
  font-size: var(--font-base);
  font-weight: 500;
  color: rgba(255,255,255,0.90);
  min-width: 0;
}
.w-lab-metric-review-input {
  width: 72px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: var(--font-input);
  font-family: inherit;
  color: rgba(255,255,255,0.92);
  text-align: right;
  outline: none;
}
.w-lab-metric-review-input:focus { border-color: rgba(255,255,255,0.35); }
.w-lab-metric-review-unit {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.50);
  flex-shrink: 0;
  min-width: 28px;
}
.w-lab-metric-review-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: var(--font-xl);
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  font-family: inherit;
}
.w-lab-metric-review-remove:active { color: rgba(255,255,255,0.70); }

/* ══════════════════════════════════════════════════════════════════════
   Doctor Prep — Appointment row (Labs tab), Today tile, Prep screen
   ══════════════════════════════════════════════════════════════════════ */

/* ── Shared countdown badge ────────────────────────────────────────────── */
.w-appt-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.70);
  white-space: nowrap;
}
.w-appt-badge--soon    { background: rgba(192,38,211,0.25); color: #e879f9; }
.w-appt-badge--urgent  { background: rgba(239,68,68,0.25);  color: #fca5a5; }

/* ── Labs tab appointment row ──────────────────────────────────────────── */
.w-appt-labs-card {
  background: linear-gradient(160deg, rgba(192,38,211,0.12) 0%, rgba(0,0,0,0.40) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(192,38,211,0.22);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.w-appt-labs-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(160deg, rgba(192,38,211,0.12) 0%, rgba(0,0,0,0.40) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(192,38,211,0.22);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 4px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.w-appt-labs-row:active { background: rgba(192,38,211,0.22); }
.w-appt-labs-row--empty { border-style: dashed; background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.18); }
.w-appt-labs-row--empty:active { background: rgba(255,255,255,0.08); }
.w-appt-labs-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.w-appt-labs-kicker { font-size: var(--font-sm); font-weight: 700; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); text-transform: uppercase; }
.w-appt-labs-sub    { font-size: var(--font-base); font-weight: 500; color: rgba(255,255,255,0.85); }
.w-appt-labs-meta   { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.w-appt-item-count  { font-size: var(--font-sm); color: rgba(192,38,211,0.90); font-weight: 600; }
.w-appt-labs-set-label { font-size: var(--font-lg); color: rgba(255,255,255,0.60); }
.w-appt-labs-arrow     { font-size: var(--font-input); color: rgba(255,255,255,0.40); }
.w-appt-labs-link   { background: none; border: none; font-size: var(--font-base); font-weight: 600; color: rgba(192,38,211,0.90); cursor: pointer; padding: 0; font-family: inherit; }
.w-appt-labs-set-btn {
  background: rgba(192,38,211,0.20);
  border: 1px solid rgba(192,38,211,0.35);
  border-radius: 8px;
  color: #e879f9;
  font-size: var(--font-md);
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

/* ── Today appointment tile ────────────────────────────────────────────── */
.w-appt-tile {
  background: linear-gradient(160deg, rgba(192,38,211,0.22) 0%, rgba(139,0,185,0.14) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(192,38,211,0.30);
  border-radius: 18px;
  padding: 18px 16px 16px;
  margin-bottom: 10px;
}
.w-appt-tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.w-appt-tile-specialty { font-size: var(--font-base); font-weight: 700; color: rgba(255,255,255,0.90); margin: 0 0 3px; }
.w-appt-tile-date      { font-size: var(--font-md); color: rgba(255,255,255,0.50); margin: 0; }
.w-appt-tile-items     { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.w-appt-tile-item      { display: flex; align-items: center; gap: 8px; }
.w-appt-tile-dot       { width: 5px; height: 5px; border-radius: 50%; background: rgba(192,38,211,0.80); flex-shrink: 0; }
.w-appt-tile-item-text { font-size: var(--font-base); color: rgba(255,255,255,0.80); line-height: 1.4; }
.w-appt-tile-empty     { font-size: var(--font-md); color: rgba(255,255,255,0.35); margin: 0; line-height: 1.5; }
.w-appt-tile-cta {
  width: 100%;
  padding: 12px 16px;
  background: rgba(192,38,211,0.30);
  border: 1px solid rgba(192,38,211,0.45);
  border-radius: 12px;
  color: #f0abfc;
  font-size: var(--font-lg);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.w-appt-tile-cta:active { background: rgba(192,38,211,0.45); }

/* ── Prep screen ───────────────────────────────────────────────────────── */
.w-prep-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.w-prep-specialty { font-size: var(--font-xl); font-weight: 700; color: rgba(255,255,255,0.95); margin: 0 0 3px; }
.w-prep-date      { font-size: var(--font-md); color: rgba(255,255,255,0.65); margin: 0; }
.w-prep-edit-btn  {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  color: rgba(255,255,255,0.80);
  font-size: var(--font-md);
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.w-prep-coverage {
  margin-bottom: 16px;
}
.w-prep-coverage-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  margin-bottom: 5px;
}
.w-prep-coverage-fill {
  height: 100%;
  border-radius: 2px;
  background: rgba(255,255,255,0.30);
  transition: width 0.4s ease;
}
.w-prep-coverage.teal  .w-prep-coverage-fill { background: #2dd4bf; }
.w-prep-coverage.amber .w-prep-coverage-fill { background: #f59e0b; }
.w-prep-coverage-label { font-size: var(--font-sm); color: rgba(255,255,255,0.62); margin: 0; }
.w-prep-coverage.amber .w-prep-coverage-label { color: #fcd34d; }

.w-prep-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.w-prep-item:last-child { border-bottom: none; }
.w-prep-item-icon   { font-size: var(--font-input); flex-shrink: 0; margin-top: 1px; }
.w-prep-item-body   { flex: 1; min-width: 0; }
.w-prep-item-title  { font-size: var(--font-base); font-weight: 600; color: rgba(255,255,255,0.95); margin: 0 0 3px; }
.w-prep-item-detail { font-size: var(--font-md); color: rgba(255,255,255,0.68); margin: 0; line-height: 1.45; }
.w-prep-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: var(--font-3xl);
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  font-family: inherit;
}
.w-prep-dismiss-btn:active { color: rgba(255,255,255,0.75); }

.w-prep-generating {
  text-align: center;
  padding: 24px 0;
  color: rgba(255,255,255,0.70);
}
.w-prep-generating-spinner {
  font-size: var(--font-5xl);
  display: inline-block;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}

/* ── Generic swipe-to-delete row ─────────────────────────────────────────── */
.w-swipe-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.w-swipe-inner {
  position: relative;
  z-index: 1;
  transition: transform 0.18s ease;
  will-change: transform;
}
.w-swipe-delete-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.w-prep-question {
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 14px;
  margin-bottom: 8px;
}
.w-prep-question .w-swipe-inner {
  background: rgba(0,0,0,0.40);
  border-radius: 14px;
}
.w-prep-question-text     { font-size: var(--font-lg); color: rgba(255,255,255,0.95); margin: 0 0 6px; line-height: 1.55; }
.w-prep-question-citation { font-size: var(--font-sm); color: rgba(255,255,255,0.58); margin: 0; font-style: italic; }
.w-prep-add-q-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 16px;
}
.w-prep-add-q-input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--font-base);
  color: rgba(255,255,255,0.90);
  font-family: inherit;
  outline: none;
}
.w-prep-add-q-input::placeholder { color: rgba(255,255,255,0.35); }
.w-prep-add-q-input:focus { border-color: rgba(255,255,255,0.30); }

/* ── Generic spinner ───────────────────────────────────────────────────────── */
.w-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.70);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ── Period tiles (weekly / monthly reviews) ──────────────────────────────── */
.w-period-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(160deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.42) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.10);
}
.w-period-tiles-row { display: flex; gap: 8px; margin-bottom: 4px; }
.w-period-tiles-row .w-period-tile { flex: 1; min-width: 0; margin-bottom: 0; }

.w-period-tile--ready { border-color: rgba(45,212,191,0.35); cursor: pointer; }
.w-period-tile--ready:active { background: rgba(45,212,191,0.10); }
.w-period-tile--countdown { border-color: rgba(251,191,36,0.35); }

/* ── Analyzing state ──────────────────────────────────────────────── */
.w-period-tile--analyzing {
  border-color: rgba(45,212,191,0.20);
  flex-direction: column;
  align-items: flex-start;
}
.w-period-anlz-hdr {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 9px;
}
/* Three pulsing dots — live indicator */
.w-period-anlz-pulse {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-left: auto;
}
.w-period-anlz-pulse i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(45,212,191,0.75);
  animation: wPeriodPulse 1.2s ease-in-out infinite;
  font-style: normal;
}
.w-period-anlz-pulse i:nth-child(2) { animation-delay: 0.2s; }
.w-period-anlz-pulse i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wPeriodPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%       { opacity: 1;    transform: scale(1.15); }
}
/* Days grid */
.w-period-anlz-grid {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}
.w-period-anlz-grid--week  { grid-template-columns: repeat(7, 8px); }
.w-period-anlz-grid--month { grid-template-columns: repeat(7, 7px); }
.w-period-anlz-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255,255,255,0.10);
  position: relative;
  overflow: hidden;
}
.w-period-anlz-grid--month .w-period-anlz-dot { width: 7px; height: 7px; }
.w-period-anlz-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: rgba(45,212,191,0.72);
  transform: scale(0);
  animation: wPeriodDotFill 0.28s cubic-bezier(0.34,1.56,0.64,1) forwards;
  animation-delay: calc(var(--i) * 120ms);
}
.w-period-anlz-grid--month .w-period-anlz-dot::after {
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes wPeriodDotFill {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
/* Category chips */
.w-period-anlz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.w-period-anlz-chip {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 2px 8px;
  opacity: 0;
  animation-name: wPeriodChipIn, wPeriodChipDone;
  animation-duration: 0.35s, 0.35s;
  animation-fill-mode: forwards, forwards;
  animation-timing-function: ease, ease;
  animation-delay:
    calc(var(--i) * 0.52s + 1.0s),
    calc(var(--i) * 0.52s + 1.6s);
}
.w-period-anlz-grid--month ~ .w-period-anlz-chips .w-period-anlz-chip {
  animation-delay:
    calc(var(--i) * 0.52s + 1.7s),
    calc(var(--i) * 0.52s + 2.3s);
}
@keyframes wPeriodChipIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wPeriodChipDone {
  to {
    color: rgba(45,212,191,0.85);
    background: rgba(45,212,191,0.10);
    border-color: rgba(45,212,191,0.28);
  }
}
/* Subtitle */
.w-period-anlz-sub {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.32);
  animation: wPeriodSubBreathe 2s ease-in-out infinite alternate;
}
@keyframes wPeriodSubBreathe {
  from { opacity: 0.32; }
  to   { opacity: 0.60; }
}
.w-period-tile--locked { opacity: 0.45; }
.w-period-tile-body { flex: 1; min-width: 0; }
.w-period-tile-label {
  font-size: var(--font-sm);
  font-weight: 700;
  color: rgba(45,212,191,0.90);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.w-period-tile--countdown .w-period-tile-label { color: rgba(251,191,36,0.90); }
.w-period-tile--locked .w-period-tile-label { color: rgba(255,255,255,0.40); }
.w-period-tile-date { font-size: var(--font-base); font-weight: 600; color: rgba(255,255,255,0.80); margin-bottom: 2px; }
.w-period-tile-text { font-size: var(--font-md); color: rgba(255,255,255,0.50); line-height: 1.45; margin-top: 2px; }
.w-period-tile-coverage { font-size: var(--font-sm); color: rgba(251,146,60,0.80); display: block; margin-bottom: 2px; }
.w-period-tile-countdown { font-size: var(--font-base); color: rgba(251,191,36,0.80); font-weight: 600; }
.w-period-tile-locked-hint { font-size: var(--font-md); color: rgba(255,255,255,0.35); }

/* ── Period analysis full page ────────────────────────────────────────────── */
.w-period-narrative {
  font-size: var(--font-xl);
  line-height: 1.70;
  color: rgba(255,255,255,0.82);
  white-space: pre-line;
}
.w-period-highlights { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 12px; }
.w-period-chip {
  background: rgba(45,212,191,0.12);
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: var(--font-md);
  font-weight: 600;
  color: rgba(45,212,191,0.90);
}
.w-period-trends { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 12px; }
.w-period-trend-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-md);
  color: rgba(255,255,255,0.65);
}
.w-period-trend-chip.w-period-trend--good {
  border-color: rgba(45,212,191,0.35);
  color: rgba(45,212,191,0.85);
  background: rgba(45,212,191,0.08);
}
.w-period-trend-chip.w-period-trend--bad {
  border-color: rgba(248,113,113,0.35);
  color: rgba(248,113,113,0.80);
  background: rgba(248,113,113,0.06);
}
.w-period-trend-dir { font-size: var(--font-lg); }
.w-period-section-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.60);
  text-transform: uppercase;
  margin: 16px 2px 8px;
}
.w-period-labs {}
.w-period-lab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-period-lab-row:last-child { border-bottom: none; }
