/* ── Design tokens ─────────────────────────────── */
:root {
/*  --bg:             #E8CAAC; 
    --surface:        #F5E8D8;
*/
  --bg:             #d3996a;
  --surface:        #F5E8D8;
  --surface-alt:    #DBBFA0;
  --border:         #C4966A;
  --border-light:   #D8B48A;
  --primary:        #B85C38;
  --primary-dark:   #9A4A28;
  --primary-light:  rgba(184,92,56,0.10);
  --accent:         #C4923A;
  --sage:           #6B8E6E;
  --text:           #3D2510;
  --text-mid:       #6B4E35;
  --text-muted:     #9A7A5A;
  --danger:         #C23B2A;
  --shadow-sm:      0 1px 4px rgba(61,37,16,0.10);
  --shadow-md:      0 4px 14px rgba(61,37,16,0.13);
  --radius:         10px;
  --radius-sm:      6px;
  --nav-h:          62px;
  --header-h:       50px;
  --module-bar-h:   74px;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── App shell ─────────────────────────────────── */
#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

#app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 5;
}
.app-logo { width: 28px; height: 28px; flex-shrink: 0; }
.app-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.sync-status { width: 9px; height: 9px; border-radius: 50%; background: #5a9e6f; flex-shrink: 0; cursor: default; margin-left: auto; }

/* ── Pull-to-refresh ────────────────────────────────── */
.pull-to-refresh {
  text-align: center;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s, padding 0.2s;
  color: var(--text-muted);
  font-size: 13px;
}
.pull-to-refresh.ptr-pulling,
.pull-to-refresh.ptr-loading {
  max-height: 48px;
  padding: 12px 0;
}

#main-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.view-content {
  padding: 16px 16px calc(16px + var(--nav-h));
  max-width: 480px;
  margin: 0 auto;
}

/* ── Bottom nav ────────────────────────────────── */
#bottom-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
  padding: 0;
}
.nav-btn.active { color: var(--primary); }
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Toast ─────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Login screen ──────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
#login-screen.hidden { display: none; }
#app.hidden { display: none; }
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.login-desc {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 20px;
}
.login-card input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  margin-bottom: 12px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.login-msg {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 12px;
}
.login-msg.hidden { display: none; }

/* ── Shared: buttons ───────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.15s;
  margin-top: 20px;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-ghost {
  flex: 1;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-mid);
  font-size: 14px;
  transition: background 0.15s;
}
.btn-ghost:active { background: var(--surface-alt); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  padding: 4px 0;
  text-decoration: underline;
  text-decoration-color: rgba(184,92,56,0.4);
}
.btn-link.muted { color: var(--text-muted); text-decoration-color: rgba(154,122,90,0.4); }

.btn-danger {
  padding: 10px 18px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin: 8px 0 4px;
}

/* ── Shared: form elements ─────────────────────── */
.field-group { margin-bottom: 20px; }

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

textarea, .text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  resize: vertical;
  margin-top: 4px;
}
textarea:focus, .text-input:focus { outline: none; border-color: var(--primary); }

select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
select:focus { outline: none; border-color: var(--primary); }

input[type="time"] {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
}
input[type="time"]:focus { outline: none; border-color: var(--primary); }

/* ── Chips ─────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: 14px;
  min-height: 38px;
  user-select: none;
  transition: all 0.13s;
  white-space: nowrap;
}
.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.chip:active { transform: scale(0.96); }

.color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  flex-shrink: 0;
  display: inline-block;
}
.chip.selected .color-dot { border-color: rgba(255,255,255,0.5); }

/* ── Home / entry form ─────────────────────────── */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow-sm);
}

.group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 16px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.detail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 0 10px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
  user-select: none;
}
.toggle-arrow { transition: transform 0.2s; flex-shrink: 0; }
.toggle-arrow.up { transform: rotate(180deg); }

.detail-section { display: none; }
.detail-section.open { display: block; }

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.slider-min, .slider-max { font-size: 12px; color: var(--text-muted); min-width: 16px; text-align: center; }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(184,92,56,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}
.slider-val { font-size: 13px; font-weight: 600; color: var(--primary); min-width: 42px; text-align: right; }

/* ── Fluid counters ────────────────────────────── */
.fluid-counters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.fluid-counter {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.fluid-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fluid-name { font-size: 14px; color: var(--text); flex: 1; }
.fluid-unit { font-size: 12px; color: var(--text-muted); }
.fluid-stepper { display: flex; align-items: center; gap: 8px; }
.fluid-dec, .fluid-inc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.13s;
  flex-shrink: 0;
}
.fluid-dec:active, .fluid-inc:active { background: var(--primary-light); }
.fluid-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  min-width: 24px;
  text-align: center;
}
.fluid-total-row { display: flex; justify-content: flex-end; margin-top: 2px; }
.fluid-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Time adjuster */
.time-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.time-display { font-size: 15px; font-weight: 500; color: var(--text); }
.time-adjust-panel { display: flex; align-items: center; gap: 8px; padding: 8px 0 4px; flex-wrap: wrap; }
.time-adjust-panel.hidden { display: none; }

/* ── Morning recap modal ───────────────────────── */
#recap-modal { display: none; position: fixed; inset: 0; z-index: 50; }
#recap-modal.open { display: block; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61,37,16,0.50);
  display: flex;
  align-items: flex-end;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}
.modal-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-header h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.modal-date { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.modal-body { padding: 16px 20px 4px; }
.modal-footer {
  padding: 14px 20px 16px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.modal-footer .btn-primary { flex: 1; margin-top: 0; }
.modal-footer .btn-ghost   { margin-top: 0; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.form-actions .btn-primary { flex: 1; width: auto; margin-top: 0; }
.form-actions .btn-ghost   { flex: 0 0 auto; padding: 14px 20px; margin-top: 0; }

.top-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.top-bar-time { flex: 1; }
.btn-save-top { width: auto; flex: 0 0 auto; margin-top: 22px; padding: 10px 20px; }

.void-cards-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.void-cards-scroll .recap-void-entry {
  flex: 0 0 88%;
  scroll-snap-align: start;
  margin-bottom: 0;
}
.recap-void-entry {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.recap-void-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ── History view ──────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2, .section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.day-card {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.day-header {
  padding: 11px 14px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}
.day-date { font-size: 14px; font-weight: 600; color: var(--text); display: block; }
.day-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.stat { font-size: 11px; color: var(--text-muted); }
.stat::before { content: '· '; }
.stat:first-child::before { content: ''; }

.entry-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.entry-row:last-child { border-bottom: none; }
.entry-row-top { display: flex; align-items: baseline; gap: 10px; }
.entry-time { font-size: 13px; font-weight: 600; color: var(--primary); min-width: 58px; flex-shrink: 0; }
.entry-summary { font-size: 13px; color: var(--text-mid); flex: 1; }

.entry-details { display: none; padding-top: 10px; }
.entry-row.expanded .entry-details { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.detail-item { font-size: 12px; color: var(--text); display: flex; gap: 4px; align-items: baseline; }
.detail-item .di-label { color: var(--text-muted); flex-shrink: 0; }
.detail-item.full-width { grid-column: 1 / -1; }

.recap-row {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(196,146,58,0.07);
  border-top: 1px solid var(--border-light);
  cursor: pointer;
}
.recap-row .entry-time { color: var(--accent); }
.entry-edit-hint { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }

.export-panel { margin-bottom: 16px; }
.export-panel.hidden { display: none; }
.export-box { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.export-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.export-actions .btn-ghost { flex: 1; margin-top: 0; padding: 10px 12px; font-size: 13px; }
.export-actions .btn-primary { flex: 1; margin-top: 0; padding: 10px 12px; font-size: 13px; }
.export-text {
  margin-top: 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-mid);
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg);
}

/* ── Trends view ───────────────────────────────── */
.section-title { margin-bottom: 16px; }

.range-selector { display: flex; gap: 5px; }
.range-btn {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.range-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.charts-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-sm);
}
.chart-card h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

/* ── Settings view ─────────────────────────────── */
.settings-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.settings-card.danger-zone { border: 1px solid rgba(194,59,42,0.25); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-label { font-size: 15px; font-weight: 500; color: var(--text); }
.setting-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Details collapsible section (hidden fields) ── */
.details-section {
  margin: 8px 0 4px;
}
.details-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.details-summary::-webkit-details-marker { display: none; }
.details-summary::before {
  content: '▸';
  font-size: 11px;
  transition: transform 0.18s;
}
details[open] .details-summary::before { transform: rotate(90deg); }
.details-body { padding: 0 0 4px; }

/* ── App Settings back nav ──────────────────────── */
.app-settings-back {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
}
.app-settings-back-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Utility ───────────────────────────────────── */
.loading { padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state p { font-size: 15px; color: var(--text-muted); line-height: 1.7; }
.empty-state .hint { font-size: 13px; color: var(--text-muted); margin-top: 12px; }
.hidden { display: none !important; }

/* ── Module tile bar ───────────────────────────────── */
#module-bar {
  height: var(--module-bar-h);
  display: flex;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  z-index: 4;
}
#module-bar::-webkit-scrollbar { display: none; }

.module-tile {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-sizing: border-box;
  width: 58px;
  height: 58px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.module-tile svg { width: 100%; height: 100%; display: block; }
.module-tile.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.module-tile:active { transform: scale(0.96); }
.module-tile.mod-hidden { display: none; }

/* ── BP vitals row ─────────────────────────────────── */
.bp-vitals-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 20px;
}
.bp-vital-group { flex: 1; }
.bp-vital-sep {
  font-size: 28px;
  color: var(--text-muted);
  padding-bottom: 10px;
  flex-shrink: 0;
  line-height: 1;
}
.bp-vital-input {
  width: 100%;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  margin-top: 6px;
}
.bp-vital-input::-webkit-outer-spin-button,
.bp-vital-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bp-vital-input:focus { outline: none; border-color: var(--primary); }

/* ── BP classification preview ─────────────────────── */
.bp-preview {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.bp-preview-normal     { background: #e8f5e9; color: #2e7d32; }
.bp-preview-borderline { background: #fff8e1; color: #e65100; }
.bp-preview-elevated   { background: #ffebee; color: #c62828; }

/* ── Session banner ────────────────────────────────── */
.session-banner {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-mid);
}
.session-banner-text { margin-bottom: 10px; }
.session-banner-actions { display: flex; gap: 8px; }
.session-banner-actions .btn-ghost { flex: 1; margin-top: 0; padding: 10px; font-size: 13px; }
.session-btn-active { border-color: var(--primary) !important; color: var(--primary) !important; }

/* ── BP history session rows ───────────────────────── */
.bp-session-row {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
  cursor: pointer;
}
.bp-normal     { border-left-color: #4CAF50; }
.bp-borderline { border-left-color: #FFC107; }
.bp-elevated   { border-left-color: #F44336; }

.bp-session-header { padding: 11px 14px 10px; }
.bp-session-main   { display: flex; align-items: baseline; gap: 10px; }
.bp-session-value  { font-size: 20px; font-weight: 700; color: var(--text); }
.bp-session-count  { font-size: 12px; color: var(--text-muted); }
.bp-session-meta   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.bp-session-details {
  display: none;
  padding: 8px 14px 14px;
  border-top: 1px solid var(--border-light);
}
.bp-session-row.expanded .bp-session-details { display: block; }

.bp-reading-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  flex-wrap: wrap;
}
.bp-reading-row:last-child { border-bottom: none; }
.bp-reading-time    { color: var(--primary); font-weight: 600; min-width: 70px; flex-shrink: 0; }
.bp-reading-val     { font-weight: 600; flex-shrink: 0; }
.bp-reading-context { color: var(--text-muted); font-size: 12px; flex: 1; }

/* ── BP trends controls ────────────────────────────── */
.bp-trend-controls {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

/* ── BP pulse collapsible section ──────────────────── */
.bp-pulse-section {
  margin-top: 12px;
}
.bp-pulse-section summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
  list-style: none;
}
.bp-pulse-section summary::before {
  content: '▸ ';
  font-size: 10px;
}
.bp-pulse-section[open] summary::before { content: '▾ '; }

/* ── Module color themes ───────────────────────── */

/* Mutra: water / ayurvedic blue */
#app[data-module="mutra"] {
  --bg:            #EBF3F8;
  --surface:       #F5F9FC;
  --surface-alt:   #D8EAF3;
  --border:        #9BBDD4;
  --border-light:  #C4DCE9;
  --primary:       #3B82B0;
  --primary-dark:  #2D6690;
  --primary-light: rgba(59,130,176,0.12);
  --accent:        #5BA0C8;
  --sage:          #5A8E8E;
  --text:          #1C3A4A;
  --text-mid:      #3D6478;
  --text-muted:    #6A90A8;
  --shadow-sm:     0 1px 4px rgba(28,58,74,0.10);
  --shadow-md:     0 4px 14px rgba(28,58,74,0.13);
}

/* BP: cardiovascular pink-red */
#app[data-module="bp"] {
  --bg:            #FBF0F2;
  --surface:       #FEF6F7;
  --surface-alt:   #F2E0E3;
  --border:        #D4A0A8;
  --border-light:  #E8C8CC;
  --primary:       #C0445A;
  --primary-dark:  #A0334A;
  --primary-light: rgba(192,68,90,0.10);
  --accent:        #D4705A;
  --sage:          #8E6E78;
  --text:          #3D1520;
  --text-mid:      #6B3545;
  --text-muted:    #9A6570;
  --shadow-sm:     0 1px 4px rgba(61,21,32,0.10);
  --shadow-md:     0 4px 14px rgba(61,21,32,0.13);
}

/* ── Good morning modal — darker background ────── */
.modal-card {
  background: var(--surface-alt);
}
.modal-header,
.modal-footer {
  background: var(--surface-alt);
}

/* ── Field label row with info button ──────────── */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.field-label-row .field-label {
  margin-bottom: 0;
}
.info-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 50%;
  transition: color 0.15s;
}
.info-btn:hover, .info-btn:focus { color: var(--primary); outline: none; }
.info-note {
  font-size: 12px;
  color: var(--text-mid);
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
  line-height: 1.5;
}
.info-note.hidden { display: none; }

/* ── Purisha color theme ────────────────────────── */
#app[data-module="purisha"] {
  --bg:            #F5F0E8;
  --surface:       #FAF7F2;
  --surface-alt:   #EDE4D4;
  --border:        #C8A882;
  --border-light:  #DCCFB8;
  --primary:       #8B5E3C;
  --primary-dark:  #6E4828;
  --primary-light: rgba(139,94,60,0.10);
  --accent:        #A67C52;
  --sage:          #6E7A5E;
  --text:          #3D2010;
  --text-mid:      #6B4530;
  --text-muted:    #9A7558;
  --shadow-sm:     0 1px 4px rgba(61,32,16,0.10);
  --shadow-md:     0 4px 14px rgba(61,32,16,0.13);
}

/* ── Sveda color theme ──────────────────────────── */
#app[data-module="sveda"] {
  --bg:            #EAF2ED;
  --surface:       #F2F8F4;
  --surface-alt:   #D0E8DA;
  --border:        #8CC4A8;
  --border-light:  #B8D8C8;
  --primary:       #3D7A5A;
  --primary-dark:  #2E5F44;
  --primary-light: rgba(61,122,90,0.10);
  --accent:        #5A9A6E;
  --sage:          #6E8A72;
  --text:          #1A3426;
  --text-mid:      #3D6050;
  --text-muted:    #6A8A78;
  --shadow-sm:     0 1px 4px rgba(26,52,38,0.10);
  --shadow-md:     0 4px 14px rgba(26,52,38,0.13);
}
