/* LymeLight — Design System */

:root {
  /* Mid-century modern palette — warm off-white base, neon volt accent, Nike-esque */
  --bg: #F7F6F1;              /* paper off-white, neutral not peachy */
  --bg-deep: #EDECE4;         /* cool sand */
  --surface: #FFFFFF;
  --surface-hover: #F2F0E9;
  --surface-soft: #FFFFFF;
  --surface-softer: #F2F0E9;
  --border: rgba(26,29,33,0.09);
  --border-strong: rgba(26,29,33,0.20);

  /* Type — cool charcoal, not warm brown */
  --text: #1A1D21;
  --text-secondary: rgba(26,29,33,0.70);
  --text-muted: rgba(26,29,33,0.48);

  /* Accents — Nike/Off-White-inflected */
  --warm: #1A1D21;            /* "primary" is now ink-black, like Nike */
  --warm-soft: #3A3E45;
  --warm-deep: #0A0C0F;

  --volt: #CCFF00;            /* Nike Volt — neon highlighter */
  --volt-deep: #9FCC00;
  --volt-soft: #E8FFA6;

  --pink: #FF3D7F;            /* bright mid-century pink — notifications/alerts */
  --pink-soft: #FFB8D0;
  --pink-deep: #C71F59;

  --navy: #1E3A5F;            /* dusty mid-century navy */
  --navy-soft: #C5D3E2;
  --navy-deep: #0E2138;

  --mustard: #D4A935;         /* grounded mid-century mustard */
  --mustard-soft: #F0DFA8;
  --mustard-deep: #8A6B1C;

  --sage: #7FA087;            /* quiet sage for success states */
  --sage-soft: #C9D8CD;

  /* Legacy aliases — mapped to the new palette so existing styles still work */
  --purple: var(--navy);
  --purple-soft: var(--navy-soft);
  --green: var(--sage);
  --green-soft: var(--sage-soft);
  --rose: var(--pink);
  --rose-soft: var(--pink-soft);
  --blue: var(--navy);
  --blue-soft: var(--navy-soft);

  /* Shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Layout */
  --max: 640px;
  --pad: 20px;

  /* Shadows — light, Apple-soft */
  --shadow-soft: 0 1px 2px rgba(28,24,20,0.04), 0 6px 20px rgba(28,24,20,0.05);
  --shadow-lift: 0 2px 4px rgba(28,24,20,0.05), 0 12px 32px rgba(28,24,20,0.07);
  --shadow-hero: 0 2px 6px rgba(28,24,20,0.05), 0 18px 44px rgba(26,29,33,0.10);
  --glow-warm: 0 0 0 rgba(0,0,0,0);
  --glow-purple: 0 0 0 rgba(0,0,0,0);

  /* Motion */
  --ease-gentle: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 600ms;

  --font: "PP Mori", "PPMori", "PP Mori Regular", -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* PP Mori (self-hosted, optional). If .woff2 files exist in /fonts/, they load;
   otherwise the font-family gracefully falls back to system fonts above. */
@font-face {
  font-family: "PP Mori";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PPMori-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "PP Mori";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/PPMori-Book.woff2") format("woff2");
}
@font-face {
  font-family: "PP Mori";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/PPMori-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "PP Mori";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/PPMori-Extrabold.woff2") format("woff2");
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  min-height: 100vh;
}
body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad) 112px;
  background: var(--bg);
}

/* Typography */
h1 {
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 12px;
}
h2 {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.18;
  margin-bottom: 10px;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 8px;
}
p { margin-bottom: 10px; color: var(--text); }
a { color: var(--navy); text-decoration: none; transition: color var(--dur-fast) var(--ease-soft); text-underline-offset: 3px; }
a:hover { color: var(--navy-deep); text-decoration: underline; }
small, .small { font-size: 13px; color: var(--text-secondary); }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 4px;
  line-height: 1.5;
}
.muted { color: var(--text-muted); }
.dim { color: var(--text-secondary); }

/* Header */
.page-header {
  padding: 6px 0 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
  padding: 6px 10px 6px 0;
  transition: color var(--dur-fast) var(--ease-soft);
}
.back-link:hover { color: var(--text); text-decoration: none; }

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.022em;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.wordmark .dot {
  width: 11px; height: 11px;
  background: var(--warm);
  border-radius: 50%;
}

/* Cards */
.card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}
.card.solid {
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.card.hero {
  position: relative;
  padding: 28px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(26,29,33,0.10);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.card.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--volt);
}
.card.hero .eyebrow {
  color: var(--navy);
  letter-spacing: 0.14em;
  font-weight: 700;
}
.card.hero h2 {
  letter-spacing: -0.022em;
  line-height: 1.14;
  color: var(--text);
  font-weight: 700;
}
.card.hero .task {
  background: var(--bg);
  border-color: rgba(26,29,33,0.10);
}
.card.hero .task:hover { background: var(--bg-deep); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft),
              opacity var(--dur-fast) var(--ease-soft);
  letter-spacing: -0.005em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--text);
  color: var(--volt);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.btn-primary:hover {
  background: var(--warm-deep);
  text-decoration: none;
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-deep); text-decoration: none; }
.btn-block { width: 100%; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge-warm  { background: var(--volt); color: var(--text); border-color: var(--volt-deep); }
.badge-green { background: #DCE8DF; color: #445E4C;          border-color: rgba(127,160,135,0.20); }
.badge-blue  { background: #D4DEE8; color: #0E2138;          border-color: rgba(30,58,95,0.20); }
.badge-purple{ background: #D4DEE8; color: #0E2138;          border-color: rgba(30,58,95,0.22); }
.badge-rose  { background: #FFE0EC; color: #C71F59;          border-color: rgba(255,61,127,0.22); }
.badge-muted { background: var(--bg-deep); color: var(--text-secondary); border-color: var(--border); }
.badge-large {
  font-size: 13px;
  padding: 7px 14px;
  letter-spacing: 0.04em;
}

/* Phase pill */
.phase-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 14px;
  border-radius: 999px;
  background: var(--volt);
  border: 1px solid var(--volt-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}
.phase-pill .phase-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text);
}
.phase-pill .phase-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 2px;
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Quick-link tiles — distinct per-tile personality */
.quick-link {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  min-height: 124px;
  justify-content: space-between;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft);
  box-shadow: var(--shadow-soft);
}
.quick-link::before { display: none; }
.quick-link:hover {
  background: var(--surface);
  text-decoration: none;
  border-color: rgba(28,24,20,0.14);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.quick-link:active { transform: translateY(0); }
.quick-link .icon {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--ql-icon-bg, var(--bg-deep));
  color: var(--ql-icon, var(--text));
  border: 1px solid var(--ql-icon-border, transparent);
  position: relative; z-index: 1;
}
.quick-link .icon svg { width: 20px; height: 20px; }
.quick-link .label {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.008em;
  line-height: 1.25;
  position: relative; z-index: 1;
}
.quick-link .hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  position: relative; z-index: 1;
}

/* Per-tile variants — Headspace-ish, tinted solids */
.quick-link.ql-warm   { --ql-icon: var(--text); --ql-icon-bg: var(--volt); --ql-icon-border: var(--volt-deep); }
.quick-link.ql-blue   { --ql-icon: var(--navy-deep); --ql-icon-bg: var(--navy-soft); --ql-icon-border: rgba(30,58,95,0.22); }
.quick-link.ql-purple { --ql-icon: var(--pink-deep); --ql-icon-bg: var(--pink-soft); --ql-icon-border: rgba(255,61,127,0.25); }
.quick-link.ql-green  { --ql-icon: #2D4936; --ql-icon-bg: var(--sage-soft); --ql-icon-border: rgba(127,160,135,0.25); }

/* Checkbox */
.check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 2px solid rgba(28,24,20,0.24);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              transform var(--dur-med) var(--ease-gentle);
  cursor: pointer;
  background: transparent;
}
.check.checked {
  background: var(--green);
  border-color: var(--green);
  animation: check-pop var(--dur-med) var(--ease-gentle);
}
.check svg {
  width: 14px; height: 14px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--dur-fast) var(--ease-soft),
              transform var(--dur-med) var(--ease-gentle);
  stroke: #ffffff;
}
.check.checked svg { opacity: 1; transform: scale(1); }
@keyframes check-pop {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.task {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              opacity var(--dur-med) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.task:hover { background: var(--surface-hover); }
.task.done {
  opacity: 0.58;
  border-color: rgba(127,160,135,0.22);
  background: #DCE8DF;
}
.task.done .task-text {
  text-decoration: line-through;
  text-decoration-color: rgba(127,160,135,0.55);
  text-decoration-thickness: 1px;
}
.task-content { flex: 1; min-width: 0; }
.task-text { font-size: 16px; font-weight: 500; line-height: 1.35; letter-spacing: -0.003em; }
.task-detail { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.task-detail a { color: var(--navy); }
.task-meta {
  font-size: 11px;
  color: var(--green);
  margin-top: 6px;
  letter-spacing: 0.04em;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Progress ring — gradient + glow */
.progress-ring {
  display: flex; align-items: center; gap: 18px;
}
.progress-ring svg {
  width: 96px; height: 96px;
  flex-shrink: 0;
}
.progress-ring .track {
  stroke: rgba(28,24,20,0.10);
}
.progress-ring .fill {
  stroke: var(--volt-deep);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-slow) var(--ease-gentle);
  animation: ring-draw var(--dur-slow) var(--ease-gentle) both;
}
@keyframes ring-draw {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.progress-ring .pct {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.progress-ring .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}
.progress-ring .phase-tag {
  margin-top: 8px;
}

/* Progress bar */
.progress {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--volt-deep);
  border-radius: 999px;
  transition: width var(--dur-slow) var(--ease-gentle);
  width: 0;
}

/* Sections */
section { margin-bottom: 32px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 14px;
}
.section-title.purple { color: #0E2138; }
.section-title.green  { color: #445E4C; }
.section-title.rose   { color: #C71F59; }
.section-title.blue   { color: #0E2138; }

/* Accordion */
.accordion { margin-bottom: 10px; }
.accordion summary {
  list-style: none;
  padding: 16px 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: background var(--dur-fast) var(--ease-soft);
}
.accordion summary:hover { background: var(--surface-hover); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: '';
  width: 10px; height: 10px;
  border-right: 1.8px solid var(--text-muted);
  border-bottom: 1.8px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-med) var(--ease-gentle);
  margin-right: 4px;
}
.accordion[open] summary { border-radius: 12px 12px 0 0; }
.accordion[open] summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.accordion .body {
  padding: 16px 18px 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.accordion .body p { margin-bottom: 10px; color: var(--text-secondary); }
.accordion .body strong { color: var(--text); }
.accordion .body ul { padding-left: 20px; margin: 8px 0; }
.accordion .body li { margin-bottom: 6px; }
.accordion .body .tldr {
  padding: 11px 14px;
  background: var(--volt-soft);
  border-left: 3px solid var(--warm);
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 14px;
}

/* Accordion section progress ring (checklist) */
.accordion .sec-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-right: 10px;
}
.accordion[data-complete="true"] summary {
  border-color: rgba(127,160,135,0.30);
  background: #DCE8DF;
}
.accordion[data-complete="true"] .sec-count {
  color: var(--green);
}

/* Doctor card */
.doc {
  position: relative;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.doc[data-tier="1"] {
  background: var(--volt-soft);
  border-color: rgba(26,29,33,0.22);
}
.doc[data-tier="2"] {
  background: var(--surface);
  border-color: var(--border);
}
.doc[data-tier="3"] {
  background: #D4DEE8;
  border-color: rgba(30,58,95,0.22);
}
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.doc-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
  margin-bottom: 2px;
}
.doc-specialty {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}
.doc-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}
.doc-meta a { color: var(--navy); }
.doc-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.doc-actions a { flex: 1; min-width: 110px; }

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  padding: 9px 16px;
  min-height: 44px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.chip:hover { background: var(--bg-deep); color: var(--text); }
.chip.active {
  background: var(--volt-soft);
  border-color: rgba(26,29,33,0.4);
  color: var(--warm-deep);
}

/* Test status chips — progress journey */
.status-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 14px 0 0;
  padding: 10px 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.status-step {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 4px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease-soft);
  min-width: 0;
}
.status-step .dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(28,24,20,0.16);
  transition: all var(--dur-med) var(--ease-gentle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; z-index: 2;
}
.status-step .dot svg { width: 9px; height: 9px; opacity: 0; transition: opacity var(--dur-fast) var(--ease-soft); stroke: #ffffff; }
.status-step.on { color: var(--text); }
.status-step.on .dot svg { opacity: 1; }
.status-step[data-field="ordered"].on .dot { background: var(--warm);   border-color: var(--warm); }
.status-step[data-field="ordered"].on       { color: var(--warm-deep); }
.status-step[data-field="resultBack"].on .dot { background: var(--purple); border-color: var(--purple); }
.status-step[data-field="resultBack"].on      { color: #0E2138; }
.status-step[data-field="normal"].on .dot { background: var(--green); border-color: var(--green); }
.status-step[data-field="normal"].on      { color: #445E4C; }
.status-step[data-field="abnormal"].on .dot { background: var(--rose); border-color: var(--rose); }
.status-step[data-field="abnormal"].on      { color: #C71F59; }
/* Connector line between steps */
.status-step::before {
  content: '';
  position: absolute;
  top: 13px;
  left: -50%;
  right: 50%;
  height: 1.5px;
  background: rgba(28,24,20,0.10);
  z-index: 1;
}
.status-step:first-child::before { display: none; }
.status-step.on + .status-step::before,
.status-step.on::before {
  background: rgba(26,29,33,0.45);
}

/* Script block — pull-quote feel */
.script {
  position: relative;
  padding: 20px 20px 18px 42px;
  background: #D4DEE8;
  border: 1px solid rgba(30,58,95,0.22);
  border-radius: 14px;
  font-size: 15.5px;
  line-height: 1.65;
  margin-bottom: 14px;
  font-style: italic;
  color: #2A234A;
  letter-spacing: -0.005em;
}
.script::before {
  content: '\201C';
  position: absolute;
  top: 6px; left: 14px;
  font-size: 46px;
  font-style: normal;
  font-weight: 600;
  color: rgba(30,58,95,0.55);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}
.note {
  padding: 12px 14px;
  background: var(--bg-deep);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-strong);
  margin: 12px 0;
  line-height: 1.55;
}
.note.warm { border-left-color: var(--volt-deep); background: var(--volt-soft); color: var(--text); }
.note.rose { border-left-color: var(--pink); background: #FFE0EC; color: var(--pink-deep); }

/* Lists inside cards */
.card ul, .card ol { padding-left: 20px; margin: 8px 0; color: var(--text-secondary); }
.card li { margin-bottom: 6px; line-height: 1.5; }

/* Pills (inline tags) */
.pill {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Gentle completion banner */
.done-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: #DCE8DF;
  border: 1px solid rgba(127,160,135,0.25);
  border-radius: 12px;
  font-size: 14px;
  color: #445E4C;
  margin-bottom: 14px;
}
.done-banner svg {
  width: 16px; height: 16px;
  stroke: var(--green);
  flex-shrink: 0;
}

/* Undo toast */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(26,22,32,0.96);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.55);
  z-index: 120;
  opacity: 0;
  animation: toast-in 180ms var(--ease-gentle, ease) forwards;
  transition: opacity 240ms ease, transform 240ms ease;
  max-width: calc(100vw - 40px);
}
.undo-toast.leaving { opacity: 0; transform: translate(-50%, 8px); }
.undo-toast .undo-btn {
  background: var(--warm);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
}
.undo-toast .undo-btn:active { background: var(--warm-deep); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Storage error banner */
.storage-banner {
  background: #FFE0EC;
  border: 1px solid rgba(255,61,127,0.3);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: #C71F59;
  margin-bottom: 14px;
}

/* Undo toast (light) */
.undo-toast {
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(251,245,234,0.9);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.bottom-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 0 8px;
}
.nav-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 7px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 14px;
  transition: color var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft);
  min-height: 52px;
}
.nav-item svg {
  width: 22px; height: 22px;
  stroke-width: 1.8;
  transition: transform var(--dur-med) var(--ease-gentle);
}
.nav-item:hover { color: var(--text-secondary); text-decoration: none; }
.nav-item.active {
  color: var(--text);
  background: var(--volt);
  font-weight: 700;
}
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text);
}

/* Utility */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-sm { gap: 8px; }
.gap { gap: 12px; }
.mb-sm { margin-bottom: 8px; }
.mb { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.text-center { text-align: center; }
.stretch { width: 100%; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ──────────────────────────────────────────────────────────────
   Responsive — Tablet / small desktop (≥760px)
   ────────────────────────────────────────────────────────────── */
@media (min-width: 760px) {
  body { max-width: 720px; padding: 88px 36px 96px; }
  h1 { font-size: clamp(34px, 4.5vw, 48px); line-height: 1.05; }
  h2 { font-size: clamp(24px, 3vw, 32px); }
  .page-header { padding: 8px 0 30px; margin-bottom: 32px; }
  .wordmark { font-size: 24px; }

  /* Bottom nav becomes a top nav with pill items */
  .bottom-nav {
    top: 0; bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    background: rgba(251,245,234,0.88);
  }
  .bottom-nav-inner {
    grid-template-columns: none;
    display: flex;
    justify-content: center;
    gap: 4px;
    max-width: 1180px;
    padding: 0 28px;
  }
  .nav-item {
    flex-direction: row;
    gap: 9px;
    padding: 10px 18px;
    font-size: 14px;
    min-height: 44px;
    border-radius: 999px;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item.active::after { display: none; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .quick-link { min-height: 130px; }
}

/* ──────────────────────────────────────────────────────────────
   Responsive — Desktop (≥1040px)
   Left sidebar nav + widened content. Hero + progress sit side-by-side
   on the dashboard. 4-up quick links.
   ────────────────────────────────────────────────────────────── */
@media (min-width: 1040px) {
  html, body { background: var(--bg); }
  body {
    max-width: 1160px;
    padding: 48px 48px 72px 260px;   /* 220 sidebar + 40 gap */
  }
  h1 { font-size: clamp(40px, 3.6vw, 54px); }
  h2 { font-size: clamp(26px, 2.2vw, 34px); }

  /* Sidebar nav (reuses .bottom-nav element, restyles) */
  .bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 220px;
    padding: 36px 20px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    flex-direction: column;
  }
  .bottom-nav::before {
    content: 'Fix my Lyme';
    display: block;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.022em;
    color: var(--text);
    padding: 0 14px 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .bottom-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    max-width: none;
    margin: 18px 0 0;
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    font-size: 14.5px;
    min-height: 44px;
    border-radius: 14px;
    color: var(--text-secondary);
  }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item:hover { background: var(--bg-deep); color: var(--text); }
  .nav-item.active {
    background: var(--volt);
    color: var(--text);
    font-weight: 700;
  }

  /* Dashboard quick-links fan out to 4 columns */
  .grid-2 { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .quick-link { min-height: 170px; padding: 22px; border-radius: var(--radius-lg); }
  .quick-link .icon { width: 46px; height: 46px; border-radius: 14px; }
  .quick-link .icon svg { width: 22px; height: 22px; }
  .quick-link .label { font-size: 17px; }
  .quick-link .hint { font-size: 13.5px; }

  /* Hero + progress become a 2-column dashboard pairing */
  .dashboard-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
  }
  .dashboard-top #daily-focus,
  .dashboard-top #progress-section { margin: 0; }
  .dashboard-top .card { margin-bottom: 0; height: 100%; }

  .card.hero { padding: 36px 36px 32px; border-radius: var(--radius-xl); }
  .card.hero h2 { font-size: 30px; }

  /* Progress ring scales up on desktop */
  .progress-ring svg { width: 128px; height: 128px; }
  .progress-ring .pct { font-size: 34px; }

  /* Doctor cards become a 2-col grid on desktop */
  #tier-1-list, #tier-2-list, #tier-3-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .doc { margin-bottom: 0; }

  /* Back link + header wordmark are redundant with the sidebar */
  .back-link { display: none; }
  .page-header .wordmark { display: none; }
  .page-header { border-bottom: none; padding-bottom: 8px; margin-bottom: 16px; }
}

/* Ultra-wide safety cap */
@media (min-width: 1400px) {
  body { max-width: 1240px; }
}
