:root {
  --bg: #0f0f13;
  --surface: #1c1c24;
  --surface2: #26262f;
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --accent: #8B5CF6;
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overscroll-behavior: none; overflow-x: hidden;
}

/* ── Screens ─────────────────────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  z-index: 1;
}
.screen.active    { transform: translateX(0); z-index: 3; }
.screen.slide-out { transform: translateX(-30%); z-index: 2; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 8px; flex-shrink: 0;
}
.header-title { font-size: 22px; font-weight: 700; }
.header-date  { font-size: 13px; color: var(--text-muted); min-width: 60px; }
.header-actions { display: flex; gap: 8px; }

.header-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); border: none; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.header-icon-btn:active { background: var(--border); color: var(--text); }

.header-save-btn {
  background: none; border: none; color: var(--accent);
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 4px 0;
}

.back-btn {
  background: none; border: none; color: var(--text);
  font-size: 24px; cursor: pointer; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Progress ring strip ─────────────────────────────────────────────────── */
.progress-strip {
  margin: 0 16px 10px; padding: 12px 16px;
  background: var(--surface); border-radius: 16px; border: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.strip-ring { width: 44px; height: 44px; flex-shrink: 0; }
.strip-track { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 6; }
.strip-fill {
  fill: none; stroke-width: 6; stroke-linecap: round; stroke: var(--accent);
  transform: rotate(-90deg); transform-origin: 22px 22px;
  transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1),stroke .4s;
}
.strip-text { flex: 1; }
.strip-fraction { font-size: 16px; font-weight: 700; line-height: 1.2; }
.strip-label    { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.strip-pct      { font-size: 22px; font-weight: 800; color: var(--accent); min-width: 48px; text-align: right; transition: color .4s; }

/* ── Banner ──────────────────────────────────────────────────────────────── */
.motivation-banner {
  margin: 0 16px 10px;
  background: linear-gradient(135deg,rgba(139,92,246,.18),rgba(59,130,246,.14));
  border: 1px solid rgba(139,92,246,.28); border-radius: 16px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  animation: banner-in .4s cubic-bezier(.34,1.56,.64,1);
}
.motivation-banner.success {
  background: linear-gradient(135deg,rgba(16,185,129,.2),rgba(52,211,153,.14));
  border-color: rgba(16,185,129,.35);
}
@keyframes banner-in  { from{opacity:0;transform:translateY(-8px) scale(.97)} to{opacity:1;transform:none} }
@keyframes banner-out { from{opacity:1;transform:none} to{opacity:0;transform:translateY(-8px) scale(.97)} }
.banner-icon  { font-size: 26px; line-height: 1; flex-shrink: 0; }
.banner-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.banner-sub   { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Habits grid ─────────────────────────────────────────────────────────── */
#screen-main { overflow: hidden; }
#screen-main > .habits-grid,
#screen-main > .tomorrow-section,
#screen-main > .empty-state {
  /* scrolled together via wrapper below */
}
.main-scroll {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.main-scroll::-webkit-scrollbar { display: none; }
.habits-grid {
  padding: 4px 16px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start;
}
.habits-grid::-webkit-scrollbar { display: none; }

/* ── Habit card ──────────────────────────────────────────────────────────── */
.habit-card {
  background: var(--surface); border-radius: var(--radius); padding: 18px 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; border: 1.5px solid var(--border); position: relative;
  transition: transform .15s ease, border-color .3s ease, opacity .2s; user-select: none;
}
.habit-card:active   { transform: scale(0.96); }
.habit-card.completed{ border-color: rgba(255,255,255,.18); }
.habit-card.dragging { opacity: 0.25; transform: scale(0.95); pointer-events: none; }
.habit-card.drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
  transform: scale(1.05) rotate(1.5deg);
  transition: none !important;
  border-color: var(--accent);
}

.card-check-btn {
  position: absolute; bottom: 12px; right: 10px;
  width: 24px; height: 24px; border-radius: 50%;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-muted);
  transition: color .2s, transform .15s;
}
.card-check-btn svg { width: 100%; height: 100%; display: block; }
.card-check-btn.checked { color: #10B981; }
.card-check-btn:active  { transform: scale(0.85); }

.card-info-btn {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── SVG Ring ────────────────────────────────────────────────────────────── */
.ring-svg { width: 100px; height: 100px; overflow: visible; }

.ring-track    { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 9; }

/* FIX: No transform-box — transform-origin uses SVG viewport coords (60,60 = center) */
.ring-progress {
  fill: none; stroke-width: 9; stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1);
}

.ring-emoji { font-size: 26px; }

@keyframes ring-pulse {
  0%  { transform: rotate(-90deg) scale(1); }
  40% { transform: rotate(-90deg) scale(1.08); }
  100%{ transform: rotate(-90deg) scale(1); }
}
.ring-progress.pulse { animation: ring-pulse .5s ease; }

.card-name {
  font-size: 13px; font-weight: 600; text-align: center; color: var(--text); line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-schedule { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: -6px; }
.card-streak   { font-size: 12px; color: var(--text-muted); }
.card-streak.on-fire { color: #FF9500; }

/* ── Tomorrow section ────────────────────────────────────────────────────── */
.tomorrow-section {
  padding: 20px 16px calc(110px + var(--safe-bottom));
}
.tomorrow-header {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}
.tomorrow-list { display: flex; flex-direction: column; gap: 6px; }
.tomorrow-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: 12px;
  padding: 10px 14px; border: 1.5px solid var(--border);
  opacity: 0.6;
}
.tomorrow-emoji { font-size: 18px; flex-shrink: 0; }
.tomorrow-name  { font-size: 14px; font-weight: 500; flex: 1; color: var(--text); }
.tomorrow-sched { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ── Empty state — centered above FAB ───────────────────────────────────── */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  /* push center point up so FAB doesn't overlap */
  padding: 0 20px calc(130px + var(--safe-bottom));
  text-align: center; color: var(--text-muted);
}
.empty-icon { font-size: 64px; margin-bottom: 8px; }
.empty-state p    { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state span { font-size: 14px; }
.hidden { display: none !important; }

/* ── FAB ─────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(24px + var(--safe-bottom)); right: 20px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff;
  font-size: 30px; font-weight: 300; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(139,92,246,.45); z-index: 10;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab:active { transform: scale(0.92); box-shadow: 0 4px 12px rgba(139,92,246,.3); }

/* ── Form shared ─────────────────────────────────────────────────────────── */
#screen-add, #screen-profile, #screen-calendar { background: var(--bg); }
.form-body {
  flex: 1; overflow-y: auto; padding: 12px 20px calc(24px + var(--safe-bottom));
}
.form-body::-webkit-scrollbar { display: none; }

.preview-circle-wrap { display: flex; justify-content: center; padding: 16px 0 20px; }
.preview-svg { width: 120px; height: 120px; }

.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 8px; margin-top: 20px;
}
.field-input {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); font-size: 16px; outline: none; transition: border-color .2s;
}
.field-input:focus { border-color: var(--accent); }
.field-input::placeholder { color: var(--text-muted); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.5); }

/* ── Segmented control ───────────────────────────────────────────────────── */
.seg-control {
  display: flex; background: var(--surface2); border-radius: 12px; padding: 3px; gap: 3px;
}
.seg-btn {
  flex: 1; padding: 9px; border-radius: 10px; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.seg-btn:active { opacity: .8; }

/* ── Day picker ──────────────────────────────────────────────────────────── */
.day-picker { display: flex; gap: 5px; margin-top: 12px; }
.day-picker-hint {
  font-size: 12px; color: #EF4444; margin-top: 8px; text-align: center;
  animation: hint-shake .35s ease;
}
@keyframes hint-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.day-btn {
  flex: 1; padding: 8px 0; border-radius: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .18s; text-align: center;
}
.day-btn.selected { background: rgba(139,92,246,.2); border-color: var(--accent); color: var(--text); }
.day-btn:active   { transform: scale(0.92); }

/* ── Emoji / color pickers ───────────────────────────────────────────────── */
.emoji-grid {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
}
.emoji-grid::-webkit-scrollbar { display: none; }

.emoji-picker-popup {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 12px; margin-top: 8px;
}
.emoji-picker-item {
  font-size: 22px; background: none; border: none; cursor: pointer;
  border-radius: 8px; padding: 4px; line-height: 1;
  transition: background .15s, transform .1s;
}
.emoji-picker-item:hover  { background: var(--surface2); }
.emoji-picker-item:active { transform: scale(.85); }
.emoji-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: var(--surface);
  border: 2px solid transparent; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: border-color .2s, transform .1s;
}
.emoji-btn:active   { transform: scale(.9); }
.emoji-btn.selected { border-color: var(--accent); background: var(--surface2); }
.emoji-btn-plus {
  font-size: 22px; color: var(--text-muted);
  border: 2px dashed var(--border);
}

.color-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.color-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: transform .15s; outline: 2px solid transparent; outline-offset: 2px;
}
.color-btn:active  { transform: scale(.88); }
.color-btn.selected{ outline-color: rgba(255,255,255,.6); }

.btn-primary {
  width: 100%; padding: 16px; border-radius: 16px;
  background: var(--accent); border: none; color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 28px;
  transition: opacity .2s, transform .15s;
}
.btn-primary:active  { opacity: .85; transform: scale(.98); }
.btn-primary:disabled{ opacity: .4; pointer-events: none; }

.btn-edit {
  width: 100%; padding: 14px; border-radius: 16px;
  background: rgba(139,92,246,.12); border: 1.5px solid rgba(139,92,246,.3);
  color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px;
  transition: background .2s;
}
.btn-edit:active { background: rgba(139,92,246,.22); }

.btn-danger {
  width: 100%; padding: 14px; border-radius: 16px;
  background: rgba(255,59,48,.15); border: 1.5px solid rgba(255,59,48,.3);
  color: #FF3B30; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px;
  transition: background .2s;
}
.btn-danger:active { background: rgba(255,59,48,.25); }

/* ── Confetti ─────────────────────────────────────────────────────────────── */
.confetti-particle {
  position: fixed; top: -12px; z-index: 9999; pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(800deg) scale(.6); opacity: 0; }
}

/* ── Profile screen ──────────────────────────────────────────────────────── */
.profile-avatar {
  font-size: 72px; text-align: center; margin: 8px 0 4px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
}

.profile-row { display: flex; gap: 12px; }
.profile-col { flex: 1; }
.profile-col .field-label { margin-top: 20px; }

/* BMI card */
.bmi-card {
  margin-top: 24px; background: var(--surface); border-radius: 20px; padding: 20px;
  border: 1.5px solid var(--border);
}
.bmi-label    { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.bmi-value    { font-size: 52px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.bmi-category { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.bmi-scale-wrap { position: relative; }
.bmi-scale {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 4px;
}
.bmi-scale-seg { height: 100%; }
.bmi-marker {
  position: absolute; top: -4px;
  width: 4px; height: 16px; background: #fff; border-radius: 2px;
  transform: translateX(-50%); box-shadow: 0 0 6px rgba(0,0,0,.5);
  transition: left .5s cubic-bezier(.4,0,.2,1);
}
.bmi-scale-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
}
.bmi-metrics {
  display: flex; gap: 8px; margin-top: 16px;
}
.bmi-metric {
  flex: 1; background: var(--bg); border-radius: 14px; padding: 10px 8px;
  text-align: center; border: 1px solid var(--border);
}
.bmi-metric-icon  { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.bmi-metric-label { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.bmi-metric-value { font-size: 13px; font-weight: 700; color: var(--text); }
.bmi-tip {
  margin-top: 12px; font-size: 12px; color: var(--text-muted);
  line-height: 1.5; text-align: center; font-style: italic;
}

.profile-stats {
  margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap;
}
.stat-chip {
  background: var(--surface); border-radius: 12px; padding: 10px 14px;
  font-size: 13px; flex: 1; min-width: 100px;
  border: 1px solid var(--border);
}
.stat-chip-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stat-chip-value { font-weight: 700; }

/* ── Top habits ──────────────────────────────────────────────────────────── */
/* ── All habits screen ───────────────────────────────────────────────────── */
.btn-all-habits {
  width: 100%; margin-top: 24px; padding: 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.all-habit-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 10px; border: 1.5px solid var(--border);
}
.all-habit-emoji { font-size: 22px; flex-shrink: 0; }
.all-habit-info  { flex: 1; min-width: 0; }
.all-habit-name  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.all-habit-sched { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.all-habit-actions { display: flex; gap: 6px; flex-shrink: 0; }
.all-habit-btn {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: var(--surface2); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.all-habit-btn:active { opacity: 0.6; }
.all-habit-btn.danger { background: rgba(239,68,68,.15); }

.top-habit-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 14px; padding: 12px 14px;
  margin-top: 10px; border: 1.5px solid var(--border);
}
.top-habit-medal { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.top-habit-emoji { font-size: 22px; flex-shrink: 0; }
.top-habit-info  { flex: 1; min-width: 0; }
.top-habit-name  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-habit-bar-wrap { margin-top: 5px; display: flex; align-items: center; gap: 8px; }
.top-habit-bar-track {
  flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden;
}
.top-habit-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.top-habit-pct { font-size: 13px; font-weight: 700; min-width: 36px; text-align: right; flex-shrink: 0; }
.top-habits-empty { font-size: 13px; color: var(--text-muted); margin-top: 12px; text-align: center; padding: 16px; }

/* ── Habit detail bottom sheet ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6); display: flex; align-items: flex-end;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  width: 100%; background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(24px + var(--safe-bottom));
}
.modal-handle { width: 36px; height: 4px; background: rgba(255,255,255,.2); border-radius: 2px; margin: 0 auto 16px; }
.modal-heading { font-size: 18px; font-weight: 700; margin-bottom: 16px; text-align: center; }

.modal-actions {
  background: var(--surface2); border-radius: 16px; overflow: hidden;
}
.modal-action-btn {
  width: 100%; padding: 16px 20px; background: none; border: none;
  color: var(--text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: background .15s;
}
.modal-action-btn:active { background: rgba(255,255,255,.06); }
.modal-action-btn.danger { color: #FF3B30; }
.modal-action-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.modal-action-divider { height: 1px; background: var(--border); margin: 0 16px; }

.modal-overlay:not(.hidden) .modal-sheet { animation: sheet-up .3s cubic-bezier(.4,0,.2,1); }
@keyframes sheet-up { from{transform:translateY(100%)} to{transform:translateY(0)} }

/* ── General Calendar screen ─────────────────────────────────────────────── */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 12px; flex-shrink: 0;
}
.month-label { font-size: 17px; font-weight: 700; text-align: center; flex: 1; }
.month-nav-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); border: none;
  color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.month-nav-btn:active   { background: var(--border); }
.month-nav-btn:disabled { opacity: .3; pointer-events: none; }

.weekday-row { display: grid; grid-template-columns: repeat(7,1fr); padding: 0 16px; flex-shrink: 0; margin-bottom: 8px; }
.weekday-row span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

.main-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; padding: 0 16px; flex-shrink: 0; }

.mcal-day {
  aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; cursor: pointer; position: relative; transition: transform .15s;
}
.mcal-day.empty  { pointer-events: none; }
.mcal-day.future { opacity: .25; pointer-events: none; }
.mcal-day.none   { color: var(--text-muted); }
.mcal-day.missed { background: rgba(239,68,68,.15); color: #FF6B6B; }
.mcal-day.partial{ background: rgba(245,158,11,.25); color: #F59E0B; font-weight: 700; }
.mcal-day.all    { background: #10B981; color: #fff; font-weight: 700; }
.mcal-day.today::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}
.mcal-day:not(.empty):not(.future):not(.none):active { transform: scale(.88); }
.mcal-day.selected-day { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }

.cal-legend { display: flex; justify-content: center; gap: 16px; padding: 14px 16px 0; flex-shrink: 0; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; }
.ld-all      { background: #10B981; }
.ld-partial  { background: #F59E0B; }
.ld-missed   { background: rgba(239,68,68,.5); }

.day-detail {
  margin: 12px 16px 0; background: var(--surface); border-radius: 16px; padding: 14px 16px;
  animation: banner-in .3s ease; overflow-y: auto; flex-shrink: 0;
}
.day-detail-date  { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.day-detail-habits{ display: flex; flex-direction: column; gap: 8px; }
.dh-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dh-row .dh-check { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.dh-row.done   .dh-check { background: rgba(16,185,129,.25); color: #10B981; }
.dh-row.undone .dh-check { background: var(--surface2); color: var(--text-muted); }
.dh-row.undone .dh-name  { color: var(--text-muted); }
