/* Meridian · Clinical Apothecary design system  (v2 — hero-gauge visual language)
   ------------------------------------------------------------ */
:root {
  --bone: #F3EFE6;
  --card: #FBF9F3;
  --ink: #20261F;
  --ink-soft: #4A5348;
  --spruce: #2C4034;
  --spruce-deep: #1E2E25;
  --spruce-glow: #3A5445;
  --brass: #A9834C;
  --brass-soft: #C9AC7C;
  --brass-tint: #E7D8BF;
  --sage: #E5E8DC;
  --hairline: rgba(44, 64, 52, 0.16);
  --hairline-soft: rgba(44, 64, 52, 0.08);
  --danger: #8B3A2F;

  --radius-xl: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --pill: 100px;

  --shadow-card: 0 1px 0 rgba(44,64,52,0.03), 0 10px 26px -18px rgba(30, 46, 37, 0.20);
  --shadow-lift: 0 2px 0 rgba(44,64,52,0.04), 0 18px 40px -20px rgba(30, 46, 37, 0.32);
  --shadow-hero: 0 20px 48px -22px rgba(30, 46, 37, 0.55), 0 2px 0 rgba(255,255,255,0.05) inset;

  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; }
h4 { font-size: 15px; line-height: 1.3; font-weight: 600; }
em { font-style: italic; color: var(--spruce-deep); }
p { margin: 0 0 8px; }
.lede { color: var(--ink-soft); font-size: 15.5px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 18px;
  color: var(--spruce-deep);
}
.wordmark .dot { color: var(--brass); }

/* ---- Layout shell ---- */
.app-shell {
  min-height: 100dvh;
  padding-top: calc(var(--safe-t) + 8px);
  padding-bottom: calc(var(--safe-b) + 96px);
  max-width: 640px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  gap: 12px;
}
.topbar-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--spruce) 0%, var(--spruce-deep) 100%);
  color: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 600; font-size: 17px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 2px 6px -2px rgba(30,46,37,.35);
  flex: 0 0 auto;
}
.avatar-btn { padding: 0; border: none; background: transparent; }
.topbar-hello { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar-hello .greeting { font-size: 12px; color: var(--ink-soft); }
.topbar-hello .name { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--hairline);
  color: var(--spruce-deep);
}
.icon-btn:hover { border-color: var(--spruce); }

.section { padding: 0 20px; margin-bottom: 20px; }
.section > h2 { margin-bottom: 10px; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 12px; }
.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-title h3 { font-size: 16px; }

/* ---- Hero card (dashboard) ---- */
.hero {
  background:
    radial-gradient(circle at 20% 0%, rgba(201,172,124,0.22) 0%, transparent 55%),
    linear-gradient(155deg, var(--spruce) 0%, var(--spruce-deep) 65%, #17241D 100%);
  color: var(--card);
  border-radius: var(--radius-xl);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-hero);
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* subtle grain */
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 90%, rgba(201,172,124,0.10) 0%, transparent 40%);
  pointer-events: none;
}
.hero-date {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(251,249,243,0.65);
  text-align: center;
  margin-top: 4px;
}

/* Day-of-week pill selector */
.day-picker { display: flex; justify-content: space-between; gap: 6px; margin: 4px 0 6px; }
.day-pill {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  border-radius: var(--pill);
  border: none;
  background: transparent;
  color: rgba(251,249,243,0.72);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px;
  transition: background .12s ease, color .12s ease;
}
.day-pill.today {
  background: var(--card);
  color: var(--spruce-deep);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,.35);
}
.day-pill.faded { color: rgba(251,249,243,0.42); }

/* Circular / arc gauge */
.gauge-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0 4px;
  position: relative;
}
.gauge-svg { display: block; }
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.gauge-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(251,249,243,0.7);
}
.gauge-value {
  font-family: var(--font-serif);
  font-size: 44px; line-height: 1;
  color: var(--card);
  font-weight: 500;
}
.gauge-unit { font-family: var(--font-body); font-size: 14px; color: rgba(251,249,243,0.75); margin-top: -2px; }
.gauge-caption { font-size: 13px; color: rgba(251,249,243,0.82); max-width: 240px; text-align: center; margin-top: 2px; }

/* Pill stat rail (inside hero) */
.pill-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pill-stat {
  background: rgba(251,249,243,0.10);
  border: 1px solid rgba(251,249,243,0.14);
  border-radius: var(--pill);
  padding: 8px 12px 8px 8px;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  backdrop-filter: blur(6px);
}
.pill-stat .ico {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  background: var(--brass);
  color: var(--card);
}
.pill-stat .ico svg { width: 18px; height: 18px; }
.pill-stat.alt .ico { background: var(--brass-soft); color: var(--spruce-deep); }
.pill-stat .txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pill-stat .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(251,249,243,0.6); }
.pill-stat .val { font-family: var(--font-serif); font-size: 16px; color: var(--card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Focus card (Start-your-next-habit analog) ---- */
.focus-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
}
.focus-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--sage);
  color: var(--spruce-deep);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.focus-icon svg { width: 22px; height: 22px; }
.focus-body { flex: 1; min-width: 0; }
.focus-title { font-family: var(--font-serif); font-size: 15.5px; color: var(--ink); font-weight: 500; }
.focus-sub { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.focus-cta { flex: 0 0 auto; }

/* ---- Two-column stat grid ---- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 8px;
}
.stat-card .head { display: flex; align-items: center; gap: 8px; }
.stat-card .head .ico {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sage); color: var(--spruce-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-card .head .ico svg { width: 16px; height: 16px; }
.stat-card .head .lbl { font-family: var(--font-serif); font-size: 15px; color: var(--ink); font-weight: 500; }
.stat-card .goal-line { font-size: 12.5px; color: var(--ink-soft); }
.stat-card .big { font-family: var(--font-serif); font-size: 22px; color: var(--spruce-deep); line-height: 1; }
.stat-card .sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .10em; text-transform: uppercase; color: var(--ink-soft); }

/* Segmented progress bar */
.seg-bar { display: flex; gap: 4px; }
.seg-bar .seg {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--sage);
}
.seg-bar .seg.on { background: var(--brass); }

/* Sparkline row */
.sparkline { width: 100%; height: 36px; }

/* ---- Stat row (weight card etc.) ---- */
.stat-row { display: flex; align-items: baseline; gap: 10px; }
.stat-value { font-family: var(--font-serif); font-size: 32px; font-weight: 500; color: var(--spruce-deep); }
.stat-unit { color: var(--ink-soft); font-size: 14px; }
.stat-delta { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.stat-delta.up { color: var(--brass); }
.stat-delta.down { color: var(--spruce); }
.stat-delta.flat { color: var(--ink-soft); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 20px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  background: transparent;
  color: var(--ink);
  transition: transform .06s ease, background .12s ease, color .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--spruce-deep); color: #FBF9F3; }
.btn-primary:hover { background: var(--spruce); }
.btn-secondary { background: var(--sage); color: var(--spruce-deep); }
.btn-secondary:hover { background: #DBE0D2; }
.btn-ghost { background: transparent; color: var(--spruce-deep); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--spruce); }
.btn-brass { background: var(--brass); color: #FBF9F3; }
.btn-brass:hover { background: #97733E; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(139,58,47,0.35); }

.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.btn-tiny { min-height: 30px; padding: 4px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.link-arrow {
  background: transparent; border: none;
  color: var(--spruce-deep);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 4px 6px;
  min-height: 30px;
  display: inline-flex; align-items: center; gap: 4px;
}
.link-arrow:hover { color: var(--brass); }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  min-height: var(--tap);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--spruce);
  box-shadow: 0 0 0 3px rgba(44,64,52,0.10);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: var(--pill);
  background: var(--sage);
  color: var(--spruce-deep);
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
  display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"] { background: var(--spruce-deep); color: #FBF9F3; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); padding: 6px 0; }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--spruce); }

/* ---- Bottom tabbar with elevated center action ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 10px 12px calc(var(--safe-b) + 10px);
  background: rgba(251, 249, 243, 0.94);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-top: 1px solid var(--hairline);
  z-index: 20;
}
.tabbar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 76px 1fr 1fr;
  align-items: end;
  gap: 4px;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .02em;
  min-height: 52px;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--spruce-deep); }
.tab[aria-current="page"] .tab-label { color: var(--spruce-deep); font-weight: 600; }
.tab .tab-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.tab[aria-current="page"] .tab-dot {
  display: block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--brass); margin-top: 2px;
}
.tab-dot { display: none; }

.tab-plus {
  align-self: end;
  transform: translateY(-14px);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--spruce) 0%, var(--spruce-deep) 100%);
  color: var(--card);
  border: 3px solid var(--bone);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px -8px rgba(30,46,37,0.55);
  justify-self: center;
}
.tab-plus svg { width: 26px; height: 26px; }
.tab-plus:active { transform: translateY(-13px) scale(0.98); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0;
  background: rgba(30,46,37,0.55);
  z-index: 100;
  padding: 20px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow-y: auto;
}
.modal[hidden] { display: none !important; }
@media (min-width: 560px) { .modal { align-items: center; } }
.modal-panel {
  background: var(--card);
  border-radius: 22px;
  padding: 22px 20px 20px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lift);
  max-height: calc(100dvh - var(--safe-t) - 40px);
  overflow-y: auto;
}
.modal-panel h1 { margin: 6px 0 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.terms-block { background: var(--bone); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0 4px; }
.terms-block h3 { margin: 10px 0 6px; font-size: 13.5px; font-weight: 600; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.terms-block h3:first-child { margin-top: 0; }
.terms-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); }
.terms-list li { margin-bottom: 6px; }
.terms-list strong { color: var(--ink); }
.fineprint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }

/* ---- Quick-add sheet (bottom sheet) ---- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(var(--safe-b) + 20px);
  box-shadow: 0 -20px 40px -10px rgba(30,46,37,0.35);
  z-index: 110;
  max-width: 640px; margin: 0 auto;
  animation: sheet-up .2s ease-out;
}
.sheet[hidden] { display: none !important; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--hairline);
  margin: 0 auto 10px;
}
.sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(30,46,37,0.35);
  z-index: 105;
}
.sheet-scrim[hidden] { display: none !important; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-action {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bone);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  min-height: 62px;
}
.sheet-action .ico {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--spruce-deep); color: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.sheet-action .ico svg { width: 20px; height: 20px; }
.sheet-action .lbl { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.sheet-action .lbl .sub { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.sheet-title { display: flex; justify-content: space-between; align-items: center; margin: 4px 4px 12px; }
.sheet-title h3 { font-family: var(--font-serif); font-size: 18px; }

/* ---- Landing / login ---- */
.landing {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--safe-t) + 40px) 24px calc(var(--safe-b) + 32px);
  background:
    radial-gradient(circle at 90% 10%, rgba(201,172,124,0.18) 0%, transparent 50%),
    linear-gradient(180deg, var(--bone) 0%, var(--sage) 100%);
}
.landing-hero { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.landing-hero h1 { font-size: 40px; line-height: 1.05; }
.landing-hero p { color: var(--ink-soft); font-size: 16px; max-width: 360px; }
.landing-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.landing-foot { text-align: center; color: var(--ink-soft); font-size: 12px; }
.landing-foot a { color: var(--spruce); }

/* ---- Weight chart ---- */
.chart-wrap { position: relative; margin: 8px 0 4px; }
.chart-wrap canvas { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.chart-legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
}
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.legend-dot.weight { background: var(--spruce-deep); }
.legend-dot.goal { background: var(--brass); }

.range-tabs { display: inline-flex; background: var(--sage); border-radius: var(--pill); padding: 3px; gap: 2px; margin-bottom: 4px; }
.range-tabs button {
  padding: 5px 12px; border-radius: var(--pill); border: none; background: transparent;
  color: var(--spruce-deep); font-size: 12px; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  min-height: 32px;
}
.range-tabs button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 0 rgba(0,0,0,.04); }

/* ---- Lists ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
}
.list-item-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-item .meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--brass); text-transform: uppercase; }
.list-item .body { color: var(--ink); }
.list-item .note { color: var(--ink-soft); font-size: 13.5px; }
.list-item .actions { margin-top: 4px; display: flex; gap: 8px; justify-content: flex-end; }
.list-item.leaf { padding-left: 12px; }
.list-item .lead {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sage); color: var(--spruce-deep);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.list-item .lead svg { width: 18px; height: 18px; }

.empty {
  text-align: center; padding: 32px 20px; color: var(--ink-soft);
  border: 1px dashed var(--hairline); border-radius: var(--radius); background: transparent;
}
.empty h3 { font-family: var(--font-serif); margin-bottom: 6px; color: var(--ink); }
.empty p { font-size: 14px; }

/* ---- Workouts ---- */
.workout-tile {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-card);
}
.workout-tile .eyebrow { color: var(--brass); }
.workout-tile h3 { font-size: 17px; }
.workout-tile .summary { color: var(--ink-soft); font-size: 14px; }
.workout-tile .meta-row { display: flex; gap: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-soft); text-transform: uppercase; }
.workout-tile .actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 4px; }
.done-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--spruce); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* ---- Filters ---- */
.filter-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }

/* ---- Question notepad ---- */
.q-list .list-item.resolved { opacity: 0.55; }
.q-list .list-item.resolved .body { text-decoration: line-through; }

/* ---- Toast ---- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 110px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 40; pointer-events: none; }
.toast {
  background: var(--spruce-deep);
  color: #FBF9F3;
  padding: 10px 16px;
  border-radius: var(--pill);
  font-size: 13.5px;
  box-shadow: var(--shadow-lift);
  animation: toast-in .2s ease-out;
  max-width: 88%;
  text-align: center;
}
.toast.err { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- iOS A2HS toast ---- */
.a2hs-toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 110px);
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-lift);
  display: flex; gap: 10px; align-items: center;
  font-size: 13.5px; color: var(--ink);
  z-index: 30;
  max-width: 640px; margin: 0 auto;
}
.a2hs-toast[hidden] { display: none !important; }
.a2hs-body { flex: 1; }
.a2hs-body strong { font-family: var(--font-serif); font-weight: 500; margin-right: 6px; }
.a2hs-body em { font-style: italic; }
.ios-share { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--sage); }
.a2hs-dismiss { border: none; background: transparent; font-size: 22px; color: var(--ink-soft); width: 36px; height: 36px; }

/* ---- Utility ---- */
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.hairline { border: 0; border-top: 1px solid var(--hairline); margin: 16px 0; }

@supports (padding: max(0px)) {
  .tabbar { padding-bottom: max(var(--safe-b), 10px); }
}
