/* ==== SleepSage — app styles ==== */
/* Accent override, sliders, chat bubbles, 7-day bar chart, disclaimer strip. */

:root {
  --accent: #6d28d9;
  --accent-contrast: #ffffff;
  --disclaimer-h: 34px;
}

/* Reserve room for the disclaimer strip above the tab bar */
body { padding-bottom: calc(var(--tabbar-h) + var(--disclaimer-h) + env(safe-area-inset-bottom, 0px)); }
.toast { bottom: calc(var(--tabbar-h) + var(--disclaimer-h) + var(--space-6) + env(safe-area-inset-bottom, 0px)); }

/* ---- Disclaimer (always visible) ---- */
.disclaimer {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 9; height: var(--disclaimer-h);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); padding: 0 var(--space-4); text-align: center;
}

/* ---- Sliders ---- */
input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.slider-out { font-size: 13px; font-weight: 700; color: var(--text-2); margin-top: -4px; }

/* ---- Switch row ---- */
.switch-row {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 44px; cursor: pointer;
}
.switch-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---- Plan list ---- */
.plan-list { margin: 0; padding-inline-start: 22px; }
.plan-list li { margin-bottom: var(--space-2); color: var(--text-2); }
.plan-list li:last-child { margin-bottom: 0; }

/* ---- Bedtime calculator ---- */
.bedtime-out { font-size: 26px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- Reflective chat ---- */
.chat-log { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.bubble {
  max-width: 85%; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-m); font-size: 14px; line-height: 1.45;
}
.bubble-sage { align-self: flex-start; background: var(--surface-2); }
.bubble-user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ---- 7-day bar chart ---- */
.chart {
  display: flex; align-items: flex-end; gap: var(--space-2);
  height: 110px; padding-top: var(--space-2);
}
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart .bar {
  width: 100%; border-radius: 6px 6px 2px 2px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  min-height: 4px; margin-top: auto;
}
.chart .bar.empty { background: var(--surface-2); }
.chart .bar-label { font-size: 10px; color: var(--muted); }

/* ---- Streaks ---- */
.streak-row { align-items: stretch; }
.streak-card { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.streak-num { font-size: 28px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- RTL ---- */
[dir="rtl"] .bubble-sage { align-self: flex-start; }
[dir="rtl"] .bubble-user { align-self: flex-end; }
