:root {
  --bg: #0b1f3a;
  --bg-elevated: #0f2744;
  --bg-card: #122a4a;
  --bg-card-hover: #163456;
  --border: rgba(147, 197, 253, 0.22);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.16);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px); /* v38: header clears the status bar in native/standalone; 0 in normal browsers */
  --nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* v31 theme tokens — dark values are the exact v30 colors */
  --header-bg: linear-gradient(180deg, #0b1f3a 70%, rgba(11, 31, 58, 0.92));
  --brand-fg: #fff;
  --brand-glow: 0 0 24px rgba(59, 130, 246, 0.45);
  --brand-sub: var(--text-muted);
  --focus: #93c5fd;
  --sky: #93c5fd;
  --sky-2: #bfdbfe;
  --pill-fg: #bfdbfe;
  --pill-ok-fg: #a7f3d0;
  --warn-fg: #fde68a;
  --danger-fg: #fca5a5;
  --ok-text: #86efac;
  --nav-bg: #0a1930;
  --nav-border: var(--border);
  --nav-fg: var(--text-muted);
  --nav-on-bg: rgba(59, 130, 246, 0.25);
  --backdrop: rgba(3, 8, 18, 0.72);
  --toast-bg: #e8f0ff;
  --toast-fg: #0a1628;
  --stack-bg: linear-gradient(145deg, #1e40af 0%, #1d4ed8 55%, #2563eb 100%);
  --stack-border: rgba(147, 197, 253, 0.45);
  --stack-shadow: 0 8px 24px rgba(29, 78, 216, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --due-bg: linear-gradient(160deg, #123058 0%, #0f2240 100%);
  --sunken: rgba(10, 22, 40, 0.45);
  --acc-count: #cfe0f5;
  --drag-fg: #93c5fd;
  --drag-card-bg: #183463;
  --drag-shadow: rgba(0, 0, 0, 0.55);
  --logged-bg: #14532d;
  --logged-border: rgba(134, 239, 172, 0.35);
  --logged-fg: #86efac;
  --chip-bg: #163456;
  --chip-fg: #cbd5e1;
  --chip-on-border: #93c5fd;
  --field-bg: #163456;
  --icon-btn-bg: #163456;
  --switch-off: #22385c;
  --switch-knob: #cbd5e1;
  --border-strong: rgba(147, 197, 253, 0.45);
  --tag-fg: #bfdbfe;
  --tag-bg: rgba(59, 130, 246, 0.18);
  --tag-ok-fg: #86efac;
  --tag-ok-bg: rgba(22, 163, 74, 0.2);
  --calc-answer-bg: linear-gradient(135deg, #1e3a5f, #1d4ed8);
  --mic-bg: rgba(59, 130, 246, 0.18);
  --mic-bg-active: rgba(59, 130, 246, 0.32);
  --mic-fg: #93c5fd;
  --soft-mark: linear-gradient(180deg, rgba(147, 197, 253, 0.28) 0%, rgba(147, 197, 253, 0.06) 100%);
  --soft-line: rgba(147, 197, 253, 0.22);
  --soft-hint: rgba(148, 163, 184, 0.7);
  --ns-border: rgba(147, 197, 253, 0.25);
  --ns-bg: rgba(59, 130, 246, 0.12);
  --ns-fg: #bfdbfe;
  --pre-border: rgba(147, 197, 253, 0.28);
  --pre-on-bg: rgba(59, 130, 246, 0.2);
  --rot-next-bg: #1e3a8a;
  --rot-arr: #475569;
  --theme-btn-bg: rgba(59, 130, 246, 0.18);
  --theme-btn-fg: #93c5fd;
  --theme-btn-border: var(--border);
  --btn-shadow: none;
}

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

html {
  height: 100%;
  height: 100dvh;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* nav is in-flow at bottom — do not pad for a fixed bar */
  padding-bottom: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a { color: var(--accent); }

.app-header {
  position: relative;
  flex: 0 0 auto;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  padding: 14px 16px 10px;
  padding-top: calc(14px + var(--safe-top));
  border-bottom: 1px solid var(--border);
}

.brand-title {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: var(--brand-fg);
  text-shadow: var(--brand-glow);
  line-height: 1.15;
}

.brand-title .subtitle {
  display: block;
  font-weight: 500;
  color: var(--brand-sub);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
  text-shadow: none;
}

/* legacy brand row (unused after v22, keep for safety) */
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { margin: 0; font-size: 1.85rem; letter-spacing: 0.04em; font-weight: 800; }

.header-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px 24px;
}

.screen { display: none; }
.screen.active { display: block; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-success {
  background: #059669;
}
.btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}
.btn-sm {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.95rem;
  width: auto;
}
.btn-icon {
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--pill-fg);
  font-size: 0.85rem;
  font-weight: 600;
}
.pill.ok {
  background: var(--success-soft);
  color: var(--pill-ok-fg);
}
.pill.warn {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warn-fg);
}

.empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--text-muted);
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label {
  font-weight: 650;
  font-size: 0.95rem;
}
.field .hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -2px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}
.field-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  min-height: var(--tap);
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
}

.calc-box {
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 4px 0 14px;
}
.calc-box .label {
  color: var(--sky-2);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.calc-box .value {
  font-size: 1.2rem;
  font-weight: 800;
}

.peptide-log-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.peptide-log-card .title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}
.meta-line {
  color: var(--text-muted);
  font-size: 0.92rem;
}
.dose-line {
  font-weight: 700;
  font-size: 1.05rem;
}
.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.actions.single { grid-template-columns: 1fr; }

.nav {
  /* In-flow flex footer — stays pinned to viewport bottom while main scrolls */
  position: relative;
  flex: 0 0 auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  padding: 6px 4px calc(10px + var(--safe-bottom));
  z-index: 30;
}
/* v38: Vial Math is shown in native too (the v34 native Calc hide was removed). */
.nav button {
  background: transparent;
  border: 0;
  color: var(--nav-fg);
  min-height: 52px;
  border-radius: 10px;
  font-weight: 650;
  font-size: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 2px;
}
.nav button .ico { font-size: 1.15rem; line-height: 1; }
.nav button.active {
  color: #fff;
  background: var(--nav-on-bg);
}
.nav button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  pointer-events: auto;
  touch-action: manipulation;
  overscroll-behavior: contain;
  justify-content: center;
  padding: 12px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px 20px 16px 16px;
  padding: 16px;
}
.modal { position: relative; z-index: 1; pointer-events: auto; -webkit-overflow-scrolling: touch; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}
.modal h2 {
  margin: 0;
  font-size: 1.3rem;
}
.modal-x {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  touch-action: manipulation;
}
.modal button, .modal .btn { touch-action: manipulation; }
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg-elevated) 30%);
  padding-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--nav-h) + 12px);
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1100;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast { font-size: 0.85rem; font-weight: 600; padding: 8px 14px; opacity: 0; }
.toast.has-undo { pointer-events: auto; white-space: nowrap; opacity: 0; }
.toast.show.has-undo { opacity: 0.92; }
.toast-undo { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; margin-left: 12px; padding: 2px 4px; cursor: pointer; }
.vial-ring { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 0.8rem; color: var(--text-muted); opacity: 0.85; }
.vial-ring svg { flex: none; }
.vr-track, .vr-arc { fill: none; stroke-width: 1.5; }
.vr-track { stroke: var(--border); }
.vr-arc { stroke: var(--accent); opacity: 0.6; stroke-linecap: round; }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.summary-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.summary-grid .kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.summary-grid .kv:last-child { border-bottom: 0; }
.summary-grid .k { color: var(--text-muted); }
.summary-grid .v { font-weight: 700; text-align: right; }

.list-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.list-actions .btn { width: auto; flex: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* v33: hidden inputs (the Log date picker) must stay 1px; the input sizing rule above made it 100% wide + padding → sideways wobble */
input.sr-only { width: 1px; min-height: 0; padding: 0; }

.date-bar {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}
.date-bar .field { flex: 1; margin-bottom: 0; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

@media (min-width: 420px) {
  body { font-size: 17px; }
}

/* --- v2: units + backfill --- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.chip {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.chip:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.chip.active, .chip:active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.units-big {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.units-big input {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}
.hint-link {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
  min-height: auto;
  cursor: pointer;
  text-decoration: underline;
}
.backfill-preview {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 8px 0 14px;
  font-weight: 650;
}
.btn-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.meta-units {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
}

/* --- v3: stack + fill scheduler --- */
.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 18px 0 8px;
}
.section-label:first-child { margin-top: 4px; }
.home-log-label { margin: 4px 0 10px; }
.stack-card {
  position: relative;
  overflow: hidden;
  background: var(--stack-bg);
  border: 1px solid var(--stack-border);
  border-left: 0;
  box-shadow: var(--stack-shadow);
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 18px;
  color: #fff;
}
.stack-card .acc-chev { border-color: #93c5fd; }
.stack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.stack-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bfdbfe;
}
.stack-title::before { display: none; }
.stack-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #dbeafe;
  background: transparent;
  border-radius: 0;
  padding: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stack-card:not(.stack-acc) .stack-head { display: none; } /* label lives outside card in v22 */
.stack-acc > summary.stack-head { display: flex; }
.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.stack-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  min-width: 0;
  font-size: 1rem;
  font-weight: 650;
}
.stack-list li:first-child { padding-top: 2px; }
.stack-list li:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.stack-name {
  font-weight: 650;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.stack-meta {
  color: #dbeafe;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
}
.stack-dose {
  color: #fff;
  font-weight: 650;
  font-size: 0.92rem;
}
.stack-dur {
  color: rgba(219, 234, 254, 0.72);
  font-weight: 500;
  font-size: 0.82rem;
}
/* Import review: missing setup fields */
.missing-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}
.missing-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--warning);
  margin-bottom: 6px;
}
.mf-row {
  display: grid;
  grid-template-columns: 7.5em 1fr 4.5em;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.mf-row label { font-weight: 700; font-size: 0.92rem; }
.mf-row input, .mf-row select { min-height: 44px; font-size: 1rem; }
.mf-unit { color: var(--text-muted); font-weight: 700; padding-left: 4px; }
.missing-hint {
  margin: 0;
  color: var(--warning);
  font-weight: 700;
  font-size: 0.92rem;
}
#btnApplyNotepad:disabled { opacity: 0.45; }
.dow-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.dow-chip {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}
.dow-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.dow-chip:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.fill-scheduler .chip-row { margin-top: 0; }

/* --- v4: import --- */
.list-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
}
.review-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
}
.review-list .r-title { font-weight: 800; }
.review-list .r-meta { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.ocr-status {
  padding: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--sky-2);
}
.raw-text-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  min-height: 120px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 8px 0;
}
.toggle-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
}
.import-warn {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--warn-fg);
  font-size: 0.88rem;
  margin: 8px 0;
  max-height: 120px;
  overflow: auto;
}

/* --- v9: upcoming schedule / today's doses --- */
.due-card {
  background: var(--due-bg);
  border-color: rgba(59, 130, 246, 0.4);
}
.due-list, .preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.due-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.due-item:last-child { border-bottom: 0; padding-bottom: 0; }
.due-item.due-done > :not(.site-pick) { opacity: 0.55; }
.due-item { flex-wrap: wrap; }
.due-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.due-name { font-weight: 800; font-size: 1.05rem; }
.due-meta { color: var(--text-muted); font-size: 0.92rem; font-weight: 600; }
.due-item .btn { width: auto; min-width: 88px; flex-shrink: 0; }
.preview-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.preview-list li:last-child { border-bottom: 0; }
.preview-day { font-weight: 800; color: var(--sky); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.preview-items { font-weight: 650; font-size: 0.95rem; }

/* --- v10: voice input --- */
.btn-mic {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  font-size: 1.15rem;
  min-height: 64px;
  letter-spacing: 0.01em;
}
.btn-mic.listening {
  background: #dc2626;
  animation: pulse-mic 1.1s ease-in-out infinite;
}
.btn-mic-sm {
  min-width: 52px;
  width: 52px;
  padding: 0;
  font-size: 1.25rem;
}
.btn-mic-sm.listening {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  animation: pulse-mic 1.1s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.voice-status {
  text-align: center;
  font-weight: 700;
  color: var(--sky-2);
  min-height: 1.4em;
}
.voice-transcript {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 72px;
  font-size: 1.05rem;
  font-weight: 650;
}

/* Dose history accordion */
.dose-history {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--sunken);
}
.dose-history > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  font-weight: 800;
  touch-action: manipulation;
}
.dose-history > summary::-webkit-details-marker { display: none; }
.dose-history > summary > span:first-child { white-space: nowrap; }
.dose-history > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--sky);
  border-bottom: 2.5px solid var(--sky);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s ease;
}
.dose-history[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.hist-sum {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.88rem;
  text-align: right;
}
.hist-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 8px;
  max-height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.hist-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.hist-date { color: var(--text-muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.hist-dose { font-weight: 800; }
.hist-list li.is-change { box-shadow: inset 3px 0 0 var(--warning); padding-left: 8px; }
.hist-change {
  flex-basis: 100%;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--warning);
}

/* Home accordions (shown only when > 3 active peptides) */
.acc-chev {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin: 0 4px 4px 6px;
  border-right: 2.5px solid var(--sky);
  border-bottom: 2.5px solid var(--sky);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
details[open] > summary .acc-chev { transform: rotate(-135deg); margin-bottom: -4px; }
.stack-acc > summary,
.quick-acc > summary {
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.stack-acc > summary::-webkit-details-marker,
.quick-acc > summary::-webkit-details-marker { display: none; }
.stack-acc > summary { min-height: 44px; margin-bottom: 0; }
.stack-acc[open] > summary { margin-bottom: 8px; }
.stack-acc .stack-count { margin-left: auto; }
.quick-acc { margin: 4px 0 0; }
.quick-acc-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.quick-acc[open] > .quick-acc-sum { margin-bottom: 12px; }
.quick-acc-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.quick-acc-count {
  margin-left: auto;
  font-weight: 750;
  font-size: 0.9rem;
  color: var(--acc-count);
  text-align: right;
  white-space: nowrap;
}
.quick-acc-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Drag to reorder */
.title-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.title-wrap .title { margin: 0; }
.reorder-tools {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  margin: -6px 0 -6px -8px;
}
.reorder-arrows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.reorder-btn {
  width: 28px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--drag-fg);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.reorder-btn:disabled { opacity: 0.28; cursor: default; }
.reorder-btn:not(:disabled):active,
.reorder-btn:not(:disabled):hover { background: var(--accent-soft); }
.reorder-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.drag-handle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--drag-fg);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.2em;
  line-height: 1;
  cursor: grab;
  touch-action: none;           /* finger drags the card instead of scrolling */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.drag-handle:active { cursor: grabbing; background: var(--accent-soft); }
.drag-handle:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.peptide-log-card.dragging {
  opacity: 1;
  background: var(--drag-card-bg);
  box-shadow: 0 18px 40px var(--drag-shadow), 0 0 0 2px #60a5fa;
  transform: scale(1.02);
  pointer-events: none;
}
.peptide-log-card.dragging .drag-handle { pointer-events: auto; }
.drag-placeholder {
  border: 2px dashed rgba(147, 197, 253, 0.55);
  border-radius: var(--radius);
  background: rgba(59, 130, 246, 0.08);
  margin-bottom: 12px;
}
html.is-dragging, body.is-dragging {
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

/* Planned dose changes editor */
.dc-section { border-top: 1px solid var(--border); padding-top: 12px; }
.dc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.dc-title { font-weight: 800; }
.dc-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 64px;
  grid-template-areas: "date date del" "dose unit units";
  gap: 6px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--sunken);
}
.dc-row.is-past { opacity: 0.7; }
.dc-row .dc-date { grid-area: date; min-width: 0; }
.dc-row .dc-dose { grid-area: dose; min-width: 0; }
.dc-row .dc-unit { grid-area: unit; min-width: 0; }
.dc-row input, .dc-row select { min-height: 44px; font-size: 1rem; padding-left: 8px; padding-right: 6px; }
.dc-units { grid-area: units; color: var(--sky-2); font-weight: 750; font-size: 0.95rem; text-align: right; white-space: nowrap; }
.dc-row .dc-del { justify-self: end; }
.dc-past { grid-column: 1 / -1; font-size: 0.78rem; color: var(--text-muted); font-weight: 700; margin-top: -4px; }
.dc-del {
  grid-area: del;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.05rem;
  touch-action: manipulation;
}
.dc-pills .pill { display: inline-block; margin: 0 4px 4px 0; }
.dc-review { color: var(--warning); }

/* Logged state: static indicator, not a button */
.logged-indicator {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--logged-bg);
  border: 1px solid var(--logged-border);
  color: var(--logged-fg);
  font-weight: 650;
  font-size: 1.05rem;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

/* Injection site picker (appears only right after logging) */
.site-pick {
  flex-basis: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
.site-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 750;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.site-skip {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 36px;
  padding: 0 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.site-chip {
  position: relative;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0 2px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-chip.suggest {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--chip-bg);
}
.site-chip.active {
  background: #2563eb;
  border-color: var(--chip-on-border);
  color: #fff;
}
.site-next {
  position: absolute;
  top: -8px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
}
.logged-site { font-weight: 700; opacity: 0.9; }

/* Reminder (bell) in peptide edit */
.rem-note {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: var(--warn-fg);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
}
.rem-section { border-top: 1px solid var(--border); padding-top: 12px; }
.rem-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rem-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rem-bell { font-size: 1.3rem; }
.rem-label { font-weight: 800; font-size: 1.05rem; flex: 1; }
.rem-switch {
  position: relative;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: var(--switch-off);
  border: 1px solid var(--border);
  transition: background 0.15s ease;
  flex: 0 0 auto;
}
.rem-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-knob);
  transition: transform 0.15s ease, background 0.15s ease;
}
.rem-toggle input:checked ~ .rem-switch { background: #2563eb; border-color: #60a5fa; }
.rem-toggle input:checked ~ .rem-switch::after { transform: translateX(22px); background: #fff; }
.rem-toggle input:focus-visible ~ .rem-switch { outline: 3px solid var(--focus); outline-offset: 2px; }
.rem-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rem-body[hidden] { display: none; }
.rem-time-row { display: flex; align-items: center; gap: 12px; }
.rem-time-row label { font-weight: 700; margin: 0; }
.rem-time-row input { flex: 1; min-height: 48px; font-size: 1.05rem; }

/* ---------- v21: first run ---------- */
#screen-home.first-run .date-bar { display: none; }
.welcome {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 4px 8px;
  text-align: center;
}
.welcome-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.01em; }
.welcome-q { margin: 0 0 8px; font-size: 1.75rem; font-weight: 900; line-height: 1.2; }
.btn-xl { width: 100%; min-height: 68px; font-size: 1.2rem; border-radius: 16px; }
.btn-type { background: var(--bg-card); border-color: var(--border-strong); color: var(--text); }
.welcome-eg { margin: 2px 0 6px; color: var(--text-muted); font-size: 0.95rem; }
.welcome-links { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--text-muted); }
.link-btn {
  background: none;
  border: 0;
  color: var(--sky);
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 10px 4px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}
.tip-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  padding: 2px 4px 2px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(96, 165, 250, 0.35);
  font-size: 0.95rem;
  font-weight: 600;
}
.tip-line .link-btn { padding: 8px 2px; min-height: 40px; font-size: 0.95rem; }
.tip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tip-x { background: none; border: 0; color: var(--text-muted); font-size: 1.05rem; min-width: 44px; min-height: 44px; cursor: pointer; }

/* ---------- v21: backup ---------- */
.bk-status { margin: 4px 0 0; color: var(--text-muted); font-size: 0.95rem; }
.bk-conflict { display: flex; gap: 8px; margin-top: 8px; }
.bk-conflict[hidden] { display: none; }
.bk-conflict .btn { flex: 1; }
#bkShowCode { display: block; padding-left: 0; }
#bkShowCode[hidden] { display: none; }
.bk-restore { width: 100%; margin-top: 10px; }
.code-big {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: min(1.5rem, 6.3vw);
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-align: center;
  padding: 18px 8px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  user-select: all;
  -webkit-user-select: all;
  overflow-x: auto;
}
.code-warn { margin: 0; font-weight: 800; color: var(--warn-fg); line-height: 1.35; }
.code-input {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace !important;
  font-size: 1.3rem !important;
  letter-spacing: 0.06em;
  text-align: center;
  min-height: 56px;
}
.restore-err { margin: 0; color: var(--danger-fg); font-weight: 700; }
.restore-preview { text-align: center; padding: 18px 8px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--border); }
.rp-big { font-size: 1.35rem; font-weight: 900; }
.rp-meta { color: var(--text-muted); margin-top: 4px; }
.rp-prev { align-self: center; font-size: 0.92rem; }


/* ========== v22 mockup polish ========== */
.card {
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}

.peptide-log-card {
  gap: 0;
}
.peptide-log-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.peptide-log-card .name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.peptide-log-card .dose-accent {
  color: var(--sky);
  font-size: 0.95rem;
  margin-top: 2px;
  font-weight: 600;
}
.peptide-log-card .pull-line {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 6px;
  font-weight: 500;
}
.peptide-log-card .tag {
  font-size: 0.7rem;
  color: var(--tag-fg);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  font-weight: 600;
}
.peptide-log-card .tag.ok {
  color: var(--tag-ok-fg);
  background: var(--tag-ok-bg);
}
.peptide-log-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.peptide-log-card .actions .btn {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 650;
  width: auto;
}
.peptide-log-card .actions .btn-icon,
.peptide-log-card .actions .btn.btn-icon {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  padding: 0;
  background: var(--icon-btn-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
}
.peptide-log-card .card-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  min-height: 36px;
  padding: 6px;
  cursor: pointer;
}
.peptide-log-card .card-more:focus-visible {
  outline: 2px solid var(--focus);
  border-radius: 8px;
}

.home-log-label { margin: 18px 0 8px; }

.date-bar {
  margin-bottom: 6px;
  opacity: 0.92;
}
.date-bar label { font-size: 0.72rem; }

/* Calc tab */
.calc-prefill,
.calc-inputs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.calc-prefill label,
.calc-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  font-weight: 600;
}
.calc-field { margin-bottom: 14px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-input-row {
  display: flex;
  gap: 8px;
}
.calc-input-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.1rem;
  padding: 0 12px;
  font-weight: 600;
}
.calc-input-row select {
  flex: 0 0 88px;
  min-height: 48px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  padding: 0 8px;
}
.calc-prefill select {
  width: 100%;
  min-height: 48px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 12px;
}
.calc-answer {
  background: var(--calc-answer-bg);
  color: #fff;
  border-radius: 18px;
  padding: 22px 16px;
  text-align: center;
  margin: 8px 0 12px;
}
.calc-answer .lbl {
  font-size: 0.8rem;
  color: #bfdbfe;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.calc-answer .big {
  font-size: 2.6rem;
  font-weight: 800;
  margin: 6px 0 2px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.calc-answer .sub {
  color: #bfdbfe;
  font-size: 0.9rem;
}
.calc-secs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.calc-sec {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.calc-sec .k {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-sec .v {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 4px;
}
.calc-save {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--sky);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.calc-save:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.calc-save[hidden] { display: none; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-actions .btn { width: 100%; }

#screen-home .due-card { display: none; } /* absorbed into Today cards in v22 */
.summary-preview.due-card,
#pepSchedulePane .due-card { display: block; }

@media (max-width: 390px) {
  .nav button { font-size: 0.62rem; padding: 6px 1px; }
  .nav button .ico { font-size: 1.1rem; }
}


/* ========== v24 date bar A ========== */
.date-bar.db-a {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 14px;
  opacity: 1;
}
.date-bar.db-a .field { display: none; }
.db-a .db-chev {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sky);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.db-a .db-chev:active { background: rgba(59, 130, 246, 0.18); }
.db-a .db-chev:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.db-a .db-mid {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 4px 6px;
  cursor: pointer;
  touch-action: manipulation;
  line-height: 1.2;
}
.db-a .db-mid:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.db-a .db-mid small {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1px;
  min-height: 0.85em;
}
.db-a .db-mid small:empty { display: none; }
.db-a .db-mic {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--mic-bg);
  color: var(--mic-fg);
  font-size: 1.05rem;
  flex: 0 0 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.db-a .db-mic:active { background: var(--mic-bg-active); }
.db-a .db-mic:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.db-a .db-mic.listening {
  background: #dc2626;
  color: #fff;
  animation: pulse-mic 1.1s ease-in-out infinite;
}


/* ========== v25 Summary view picker ========== */
.summary-picker {
  margin-bottom: 14px;
}
.summary-picker label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.summary-picker select {
  width: 100%;
  min-height: 48px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
  padding: 0 12px;
}
.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}
.sum-row:active { background: var(--bg-card-hover); }
.sum-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sum-row .sr-name {
  font-weight: 700;
  font-size: 1.05rem;
}
.sum-row .sr-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 2px;
}
.sum-row .sr-right {
  flex: 0 0 auto;
  text-align: right;
  color: var(--sky);
  font-weight: 650;
  font-size: 0.9rem;
}
.sum-row .sr-chev {
  color: var(--sky);
  font-size: 1.1rem;
  margin-left: 6px;
  opacity: 0.8;
}
.sum-overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#pepSchedulePane .summary-preview {
  margin-bottom: 14px;
}
#pepSchedulePane .summary-preview .stack-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sky-2);
  margin-bottom: 8px;
}
#pepSchedulePane .summary-preview .stack-title::before { display: none; }


/* ---------- v26: medical disclaimer + privacy link ---------- */
.disclaimer {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 500;
}
.welcome-disclaimer {
  margin: 14px 8px 0;
  text-align: center;
}
.calc-disclaimer {
  margin: 14px 4px 0;
  text-align: center;
}
.about-link {
  color: var(--sky);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#aboutCard .disclaimer { margin-top: 12px; }


/* ---------- v27: condensed Log soft brand void (option B) ---------- */
.log-soft-fill {
  position: relative;
  min-height: 240px;
  margin: 12px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  max-height: 320px;
  transition: opacity 0.22s ease, max-height 0.22s ease, margin 0.22s ease, min-height 0.22s ease;
}
.log-soft-fill.is-faded {
  opacity: 0;
  max-height: 0;
  min-height: 0;
  margin: 0;
  visibility: hidden;
}
.log-soft-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 70%);
  filter: blur(2px);
  pointer-events: none;
}
.log-soft-mark {
  position: relative;
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  color: transparent;
  background: var(--soft-mark);
  -webkit-background-clip: text;
  background-clip: text;
}
.log-soft-vial {
  position: relative;
  width: 44px;
  height: 72px;
  margin-top: 10px;
  border: 2px solid var(--soft-line);
  border-radius: 10px 10px 14px 14px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 40%, rgba(59, 130, 246, 0.28) 40%);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35), inset 0 0 18px rgba(59, 130, 246, 0.18);
}
.log-soft-vial::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 8px;
  right: 8px;
  height: 10px;
  border: 2px solid var(--soft-line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.log-soft-hint {
  position: relative;
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--soft-hint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .log-soft-fill { transition: none; }
}


/* ---------- v28: fixed bottom nav shell (flex, not position:fixed) ---------- */
/* Ensures Log/Peptides/Calc/Summary/More stay at viewport bottom while content scrolls in main. */

/* Next injection site chip on Log cards (v30) */
.peptide-log-card .pull-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}
.next-site {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ns-border);
  background: var(--ns-bg);
  color: var(--ns-fg);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.next-site::before { content: ""; position: absolute; inset: -10px -6px; } /* bigger tap target */
.next-site:active, .next-site.open { background: rgba(59, 130, 246, 0.24); border-color: var(--sky); }
.next-site .ns-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.9);
}
.next-site .ns-k { color: var(--text-muted); font-weight: 550; }
.site-chip.off-rot { opacity: 0.5; }

/* Rotation picker in peptide edit (v30) */
.rot-section { border-top: 1px solid var(--border); padding-top: 12px; }
.rot-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.rot-title { font-weight: 800; }
.rot-grid { margin: 10px 0 8px; }
.site-chip.rot-chip { color: var(--text-muted); gap: 4px; }
.site-chip.rot-chip.on {
  background: #2563eb;
  border-color: var(--chip-on-border);
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}
.site-chip.rot-chip.on::before { content: "✓"; font-size: 0.72rem; font-weight: 800; }
.rot-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.rot-pre {
  min-height: 30px;
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--sky);
  background: transparent;
  border: 1px solid var(--pre-border);
  border-radius: 999px;
  padding: 0 11px;
  touch-action: manipulation;
}
.rot-pre.on { background: var(--pre-on-bg); color: #fff; border-color: var(--chip-on-border); }
.rot-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.rot-lab {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.rot-cyc { display: flex; align-items: flex-start; gap: 5px; overflow: hidden; }
.rot-step { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.rot-p {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--chip-fg);
  white-space: nowrap;
}
.rot-w { font-size: 0.6rem; color: var(--text-muted); }
.rot-step.done .rot-p { color: var(--ok-text); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.1); }
.rot-step.next .rot-p {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(59, 130, 246, 0.45);
  color: #fff;
  background: var(--rot-next-bg);
}
.rot-step.next .rot-w { color: var(--sky); font-weight: 700; }
.rot-arr { color: var(--rot-arr); font-size: 0.8rem; padding-top: 4px; }
.rot-arr.rot-loop { color: var(--sky); font-size: 0.95rem; padding-top: 2px; }

/* ========== v31: Light theme + theme toggle ========== */
/* Dark is the default (:root). Light overrides tokens only; see inline <head> script in index.html. */
.peptide-log-card .actions .btn:not(.btn-icon) { box-shadow: var(--btn-shadow); }

.app-header { padding-right: 68px; }
.theme-btn {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease;
}
.theme-btn:active { transform: scale(0.94); }
.theme-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-btn svg { width: 22px; height: 22px; display: block; }
.theme-btn .ic-moon { display: none; }
[data-theme="light"] .theme-btn .ic-sun { display: none; }
[data-theme="light"] .theme-btn .ic-moon { display: block; }

/* Appearance card (More) */
.appearance-seg {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  margin: 12px 0 8px;
}
.appearance-seg button {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  touch-action: manipulation;
  line-height: 1.15;
}
.appearance-seg button svg { width: 16px; height: 16px; flex: 0 0 auto; }
.appearance-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: var(--btn-shadow); }
.appearance-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #e8eef8;
  --border: #d5deeb;
  --text: #0a0f1a;
  --text-muted: #55657d;
  --accent: #1d5bf0;
  --accent-soft: rgba(29, 91, 240, 0.10);
  --success: #0f7a43;
  --success-soft: rgba(16, 185, 129, 0.14);
  --danger: #c81e1e;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --warning: #a14a07;

  --header-bg: #ffffff;
  --brand-fg: #0a0f1a;
  --brand-glow: none;
  --brand-sub: #1d5bf0;
  --focus: #1d5bf0;
  --sky: #1d4ed8;
  --sky-2: #1e40af;
  --pill-fg: #1e3a8a;
  --pill-ok-fg: #046c3e;
  --warn-fg: #8a3c06;
  --danger-fg: #b91c1c;
  --ok-text: #0f7a43;
  --nav-bg: #0a0f1a;
  --nav-border: #0a0f1a;
  --nav-fg: #a3b1c6;
  --nav-on-bg: #1d5bf0;
  --backdrop: rgba(10, 15, 26, 0.45);
  --toast-bg: #0a0f1a;
  --toast-fg: #ffffff;
  --stack-bg: linear-gradient(145deg, #1d4ed8 0%, #2156e6 55%, #2a63ee 100%);
  --stack-border: #1d4ed8;
  --stack-shadow: 0 10px 24px rgba(37, 99, 235, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --due-bg: linear-gradient(160deg, #ffffff 0%, #f3f7ff 100%);
  --sunken: #f5f8fd;
  --acc-count: #0a0f1a;
  --drag-fg: #7d8ca5;
  --drag-card-bg: #f0f5ff;
  --drag-shadow: rgba(15, 23, 42, 0.18);
  --logged-bg: #e3f7ec;
  --logged-border: #8fd9b3;
  --logged-fg: #0b6b3a;
  --chip-bg: #f5f8fd;
  --chip-fg: #334155;
  --chip-on-border: #1d4ed8;
  --field-bg: #f5f8fd;
  --icon-btn-bg: #ffffff;
  --switch-off: #cbd5e1;
  --switch-knob: #ffffff;
  --border-strong: #9db6e0;
  --tag-fg: #ffffff;
  --tag-bg: #0a0f1a;
  --tag-ok-fg: #0b6b3a;
  --tag-ok-bg: #d7f3e4;
  --calc-answer-bg: linear-gradient(135deg, #1d4ed8, #2156e6);
  --mic-bg: #1d5bf0;
  --mic-bg-active: #1747c4;
  --mic-fg: #ffffff;
  --soft-mark: linear-gradient(180deg, rgba(29, 91, 240, 0.20) 0%, rgba(29, 91, 240, 0.04) 100%);
  --soft-line: rgba(29, 91, 240, 0.30);
  --soft-hint: rgba(71, 85, 105, 0.85);
  --ns-border: #bcd0f5;
  --ns-bg: #e8f0ff;
  --ns-fg: #163c9e;
  --pre-border: #bcd0f5;
  --pre-on-bg: #1d5bf0;
  --rot-next-bg: #1d5bf0;
  --rot-arr: #94a3b8;
  --theme-btn-bg: #0a0f1a;
  --theme-btn-fg: #ffffff;
  --theme-btn-border: #0a0f1a;
  --btn-shadow: 0 4px 12px rgba(29, 91, 240, 0.28);
}
[data-theme="light"] .app-header { backdrop-filter: none; }
[data-theme="light"] .card,
[data-theme="light"] .quick-acc-sum,
[data-theme="light"] .date-bar.db-a,
[data-theme="light"] .sum-row,
[data-theme="light"] .calc-sec { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
[data-theme="light"] .modal { box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18); }
[data-theme="light"] .stack-title,
[data-theme="light"] .stack-count,
[data-theme="light"] .stack-meta { color: #e6efff; }
[data-theme="light"] .stack-dur { color: #eef3ff; }
[data-theme="light"] .stack-card .acc-chev { border-color: #e6efff; }
[data-theme="light"] #pepSchedulePane .summary-preview .stack-title { color: var(--sky-2); }
[data-theme="light"] .calc-answer .lbl,
[data-theme="light"] .calc-answer .sub { color: #e6efff; }
[data-theme="light"] .rem-switch::after { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); }
[data-theme="light"] .site-chip.active,
[data-theme="light"] .site-chip.rot-chip.on { background: #1d5bf0; }
[data-theme="light"] .btn-success { background: #047857; }
[data-theme="light"] .log-soft-vial { box-shadow: 0 0 24px rgba(29, 91, 240, 0.22), inset 0 0 18px rgba(29, 91, 240, 0.12); }
[data-theme="light"] .tip-line { border-color: #bcd0f5; }
[data-theme="light"] .next-site .ns-k { color: #44546b; }
[data-theme="light"] .rot-arr:not(.rot-loop) { color: #7d8ca5; }

/* ========== v32: stack card — dose | unit ‖ weeks | days columns ========== */
.stack-list li { align-items: baseline; }
.stack-cols {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: minmax(2.3em, auto) 2.1em 1px 2.2em 1.7em;
  column-gap: 4px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: inherit;
}
.stack-cols .sc-num { text-align: right; color: #fff; font-weight: 650; font-size: 0.92rem; }
.stack-cols .sc-unit { text-align: left; color: #dbeafe; font-weight: 500; font-size: 0.74rem; opacity: 0.85; }
.stack-cols .sc-sep { align-self: stretch; width: 1px; margin: 3px 4px 1px; background: rgba(255, 255, 255, 0.22); }
.stack-cols .sc-w,
.stack-cols .sc-d { text-align: right; color: #dbeafe; font-weight: 600; font-size: 0.88rem; }
.stack-cols small { font-size: 0.78em; font-weight: 500; opacity: 0.78; margin-left: 1px; }
.stack-cols .sc-sep { margin-left: 2px; margin-right: 6px; }
[data-theme="light"] .stack-cols .sc-unit,
[data-theme="light"] .stack-cols .sc-w,
[data-theme="light"] .stack-cols .sc-d { color: #eef3ff; }
[data-theme="light"] .stack-cols .sc-sep { background: rgba(255, 255, 255, 0.3); }

/* v38: Vial Math helper line */
.calc-note { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-muted); }

/* ========== v40: Peptides | Schedule toggle, amber pull line ========== */
.pep-seg { display: flex; gap: 4px; padding: 3px; margin: 0 0 12px; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 12px; }
.pep-seg button { flex: 1; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 700; font-size: 0.9rem; padding: 7px 0; border-radius: 9px; cursor: pointer; }
.pep-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
#pepListPane[hidden], #pepSchedulePane[hidden] { display: none; }
html { --pull: #fbbf24; }
[data-theme="light"] { --pull: #d97706; }
.pull-line > span:first-child, .meta-units {
  font-size: 1.25rem; font-weight: 800; color: var(--pull);
  display: inline-flex; align-items: center; gap: 7px;
}
.pull-line > span:first-child::before, .meta-units::before {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor; opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21l5-5M14 4l6 6M12 6l6 6-8 8-6-6zM9 11l4 4' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21l5-5M14 4l6 6M12 6l6 6-8 8-6-6zM9 11l4 4' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.dose-accent, .peptide-log-card .dose-accent { color: var(--text) !important; font-weight: 700; }

/* ========== v41: due-only Log, future days ========== */
.next-due-line { margin: 12px 6px 4px; color: var(--text-muted); font-size: 0.85rem; }
.next-due-line b { color: var(--text); font-weight: 700; }
.nothing-due { margin: 18px 6px 6px; color: var(--text-muted); text-align: center; font-weight: 600; }
.future-note { margin: 4px 6px 10px; color: var(--text-muted); font-size: 0.8rem; text-align: center; }
.not-due-acc { margin-top: 8px; }
.not-due-acc .quick-acc-body { display: grid; gap: 12px; padding-top: 8px; }
.future-card { opacity: 0.85; background: transparent !important; box-shadow: none !important; border-style: dashed; }
.future-card .pull-line > span:first-child { opacity: 0.75; }
.sched-bar { flex: 1; text-align: center; font-weight: 700; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 0; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ========== v42: cycles ========== */
.cyc-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cyc-row .btn { flex: 1; margin: 0 !important; width: auto !important; }
.cyc-end { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 8px 6px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cyc-note { width: 100%; min-height: 76px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; padding: 10px; box-sizing: border-box; resize: none; }
.cyc-hint { color: var(--text-muted); font-size: 0.85rem; margin: 6px 0 8px; line-height: 1.35; }
.cyc-warn { color: var(--text-muted); font-size: 0.85rem; margin: 0; padding-left: 8px; border-left: 2px solid var(--pull); }
.cyc-warn[hidden] { display: none; }
.cyc-lbl { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 6px; }
.cyc-opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.cyc-check { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-weight: 600; }
.cyc-check.off { opacity: 0.5; }
.cyc-past { margin-top: 14px; }
.cyc-past .quick-acc-body { display: grid; gap: 10px; padding-top: 8px; }
.cyc-meta { color: var(--text-muted); font-size: 0.9rem; margin: 4px 0; }
.cyc-prev { font-size: 0.9rem; margin: 8px 0 2px; opacity: 0.85; font-style: italic; }
.cyc-back { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; padding: 4px 0 12px; cursor: pointer; }
.cyc-dc { list-style: none; padding: 0; margin: 0; }
.cyc-dc li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.cyc-dc li:last-child { border: 0; }
#screen-peptides.cyc-detail-mode #pepSeg, #screen-peptides.cyc-detail-mode .list-actions { display: none; }

/* ========== v43: half-life ========== */
.hl-line { display: block; margin-top: 2px; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 0.82rem; color: var(--text-muted); text-align: left; cursor: pointer; }
.hl-line::after { content: " ›"; opacity: 0.6; }
.hl-link { display: block; background: none; border: 0; padding: 6px 0 0; font: inherit; font-size: 0.82rem; color: var(--text-muted); text-align: left; cursor: pointer; }
.hl-sheet .hl-svg { width: 100%; height: auto; display: block; }
.hl-sheet .hl-big { font-size: 1.6rem; font-weight: 800; }
.hl-sheet .hl-meta { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 2px; font-size: 0.95rem; }
.hl-sheet .hl-edit { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; cursor: pointer; }
.hl-sub { color: var(--text-muted); font-size: 0.9rem; margin: 2px 0 8px; }
.hl-note { color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; margin: 8px 0 4px; }
.hl-opt { font-weight: 500; color: var(--text-muted); }
.hl-inrow { display: flex; gap: 10px; align-items: center; }
.hl-inrow input { flex: 1; min-width: 0; }
.hl-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.hl-seg button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.hl-seg button.on { background: var(--accent); color: #fff; }
.hl-rep { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.9rem; font-weight: 500; }
.hl-hintrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: var(--text-muted); font-size: 0.85rem; }
.hl-use { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; }
.hl-use[hidden] { display: none; }
.hl-sheet .hl-edit:focus { outline: none; }

/* ========== v44: half-life pill ========== */
.hl-line, .hl-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 6px; padding: 5px 12px 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.8rem; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hl-line::after { content: none; }
.hl-line:active, .hl-link:active { background: var(--border); }
.hl-ico { flex: 0 0 auto; color: var(--accent); }
.hl-link { margin-top: 8px; }
.hl-line { white-space: nowrap; max-width: 100%; }
.peptide-log-card > .hl-line { margin: 2px 0 2px 0; }
.peptide-log-card > .hl-line { align-self: flex-start; width: fit-content; }

/* ========== v45: schedule after add ========== */
.sched-after .sf-dose { display: flex; gap: 8px; }
.sched-after .sf-dose input { flex: 1; min-width: 0; }
.sched-after .sf-dose select { width: auto; }
.sched-after .sf-rem { display: flex; align-items: center; gap: 10px; }
.sched-after .sf-rem input[type="time"] { margin-left: auto; width: auto; min-width: 0; padding: 8px 10px; }
.sched-after .sf-rem input[type="time"]:disabled { opacity: 0.45; }
.sched-after .sf-next { margin: 2px 0 4px; color: var(--text-muted); font-size: 0.92rem; }
.sched-after .sf-next strong { color: var(--text); }
.sched-after .sf-link { display: block; width: 100%; background: none; border: 0; padding: 10px 0 2px; color: var(--text-muted); font: inherit; font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sched-after .sf-link-sm { font-size: 0.85rem; padding-top: 4px; }
.sched-after #sfDowWrap .dow-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* v46: scan fields that couldn't be read */
.needs-check { border-color: var(--warn, #f59e0b) !important; box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn, #f59e0b) 35%, transparent); }

/* v46: [hidden] always wins over component display rules (e.g. .field) */
[hidden] { display: none !important; }
/* v46: date + number inputs never squeeze siblings on narrow iPhones */
.field input, .field select { min-width: 0; max-width: 100%; }
.field-row > .field { min-width: 0; }
.field input[type="date"], .field input[type="time"] { width: 100%; -webkit-appearance: none; appearance: none; }
.sched-after .sf-dose select { flex: 0 0 auto; width: auto; min-width: 76px; }

/* v47 split dose per weekday (opt-in) */
.split-toggle{margin:4px 0}
.split-list{display:flex;flex-direction:column;gap:8px;margin:6px 0}
.split-row{display:grid;grid-template-columns:1fr 110px 40px;align-items:center;gap:8px}
.split-row input{width:100%;min-width:0}
.split-day{font-weight:600}
.split-unit{color:var(--muted,#888)}
.split-total{margin:2px 0 6px}

/* v47j: cycle time left on Log cards */
.cycle-left { font-size: 12px; font-weight: 600; color: var(--sky, #93c5fd); margin-top: 2px; letter-spacing: .01em; white-space: nowrap; }
.cycle-left.last { color: var(--warning); }

/* v47k: low-confidence scan notice */
.scan-low { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--warn-fg, #fde68a); font-weight: 600; font-size: 14px; }

/* v47p */
.beta-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.16); vertical-align: middle; }
.scan-check { margin: 0 0 8px; font-size: 14px; font-weight: 600; }


/* v48: oral capsule form */
.form-seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin: 0;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.form-seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 0;
  border-radius: 9px;
  cursor: pointer;
}
.form-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.form-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
#oralFields[hidden], #injectFields[hidden], #fSitesField[hidden], .units-big[hidden] { display: none !important; }
