:root, [data-theme="emerald"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #27272a;
  --border: #3f3f46;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #10b981;
  --accent-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  --accent-dim: #064e3b;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="oled"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0a0a0c;
  --surface-2: #16161a;
  --border: #27272a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --accent-dim: #082f49;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.9);
}

[data-theme="amber"] {
  color-scheme: dark;
  --bg: #0c0d10;
  --surface: #18191e;
  --surface-2: #24262d;
  --border: #373a43;
  --text: #fafaf9;
  --muted: #a8a29e;
  --accent: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --accent-dim: #451a03;
  --warn: #fb923c;
  --danger: #ef4444;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #059669;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --accent-dim: #d1fae5;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="emerald"]):not([data-theme="oled"]):not([data-theme="amber"]) {
    color-scheme: light;
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --border: #e4e4e7;
    --text: #09090b;
    --muted: #71717a;
    --accent: #10b981;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --accent-dim: #d1fae5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}

/* Brighten the date/time picker indicator icons on dark theme */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}
@media (prefers-color-scheme: light) {
  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator {
    filter: none;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  transition: all 0.3s ease;
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; font-family: 'Outfit', sans-serif; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  min-height: 38px; min-width: 38px; padding: 0 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px; line-height: 1;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}
.icon-btn:hover { background: var(--border); }
.icon-btn:active { transform: scale(0.92); }

/* Today: daily welcome / motivation */
.welcome { border-left: 4px solid var(--accent); }
.welcome-greeting { font-weight: 700; font-size: 15px; }
.welcome-quote { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-style: italic; line-height: 1.45; }

/* Help sheet (daily rules) */
.modal-lead { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.help-rules { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.help-rules li { font-size: 14px; line-height: 1.4; }

.muted { color: var(--muted); font-size: 13px; }

#app { padding: 16px; max-width: 720px; margin: 0 auto; transition: opacity 0.2s ease, transform 0.2s ease; }
#app.fade-out { opacity: 0; transform: translateY(4px); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h2 { margin: 0 0 10px; font-size: 18px; font-family: 'Outfit', sans-serif; letter-spacing: -0.01em; }
.card h3 { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.row { display: flex; gap: 8px; align-items: center; }
.row + .row { margin-top: 6px; }
.spread { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

button, .btn {
  appearance: none;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit; font-weight: 500;
  cursor: pointer;
  min-height: 46px;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { 
  background: var(--accent-gradient); 
  color: white; 
  border: none; 
  font-weight: 600; 
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
button.primary:hover, .btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 50%, transparent);
}
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover { background: var(--surface-2); border-color: var(--surface-2); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
button.danger:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); }
button:active, .btn:active { transform: scale(0.96) !important; box-shadow: none !important; }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font-size: 16px;
}

input[type="number"], input[type="text"], input[type="password"], input[type="date"], input[type="time"] {
  appearance: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  width: 100%;
  min-height: 46px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="number"]:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="time"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
input[type="number"] { text-align: center; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.bar {
  height: 10px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.bar > span {
  display: block; height: 100%;
  background: var(--accent);
  transition: width 200ms ease;
}
.bar.warn > span { background: var(--warn); }
.bar.over > span { background: var(--danger); }

.ai-progress {
  margin-top: 10px; padding: 9px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px;
}
.ai-progress[hidden] { display: none; }
.ai-progress-head {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.ai-progress-mark {
  color: var(--accent); font-size: 15px; line-height: 1;
  animation: ai-progress-pulse 900ms ease-in-out infinite alternate;
}
.ai-progress-track {
  height: 6px; margin-top: 7px; overflow: hidden;
  background: var(--border); border-radius: 999px;
}
.ai-progress-fill {
  display: block; width: 38%; height: 100%;
  background: var(--accent); border-radius: inherit;
  animation: ai-progress-move 1.1s ease-in-out infinite;
}
.ai-progress.done .ai-progress-head { color: var(--text); }
.ai-progress.done .ai-progress-mark { animation: none; }
.ai-progress.done .ai-progress-fill {
  width: 100%; animation: none;
}
.ai-progress.error .ai-progress-mark { color: var(--danger); animation: none; }
.ai-progress.error .ai-progress-fill {
  width: 100%; background: var(--danger); animation: none;
}

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; gap: 4px;
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 600; font-family: 'Inter', sans-serif;
  border-top: 2px solid transparent;
  transition: all 0.2s ease;
}
.tab::before {
  /* Icon placeholder - in a real app, you'd use SVG icons here */
  content: "•";
  font-size: 20px; line-height: 0.5; color: transparent;
  width: 24px; height: 24px;
  background-color: var(--muted);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E");
  mask-size: cover; -webkit-mask-size: cover;
  transition: all 0.2s ease;
}
.tab[data-tab="workout"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 6.5h11M6.5 17.5h11m-11-11v11m11-11v11'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 6.5h11M6.5 17.5h11m-11-11v11m11-11v11'/%3E%3C/svg%3E"); }
.tab[data-tab="meals"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); }
.tab[data-tab="progress"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18M18 9l-5 5-4-4-5 5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18M18 9l-5 5-4-4-5 5'/%3E%3C/svg%3E"); }
.tab[data-tab="settings"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); }
.tab.active { color: var(--accent); border-top-color: var(--accent); }
.tab.active::before { background-color: var(--accent); transform: scale(1.1); }
.tab:active::before { transform: scale(0.9); }

/* During onboarding the tabs are inert (every route → Welcome), so hide them. */
body.onboarding .tabs { display: none; }
body.onboarding { padding-bottom: env(safe-area-inset-bottom); }

.opt-stack { display: grid; gap: 8px; margin-top: 6px; }
.opt-stack .opt {
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; min-height: auto;
}
.opt-stack .opt b { font-size: 14px; }
.opt-stack .opt .opt-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.opt-stack .opt.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--text); }

.suggestion { border-left: 4px solid var(--accent); }
.suggestion.suggestion-celebrate { border-left-color: #fbbf24; background: color-mix(in srgb, #fbbf24 8%, var(--surface)); }
.suggestion .sugg-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.suggestion .sugg-body { font-size: 13px; color: var(--muted); line-height: 1.45; }

.overload-hint {
  margin-top: 8px; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.overload-hint.hint-deload { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.overload-hint.hint-hold { background: var(--surface-2); color: var(--muted); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); }
.checklist .meal-name { font-weight: 600; }
.checklist .meal-macros { font-size: 12px; color: var(--muted); }
.checklist li.done .meal-name { text-decoration: line-through; color: var(--muted); }
.checklist li.next {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  margin: 0 -10px; padding: 10px; border-radius: 8px;
}
.meal-time {
  display: inline-block; margin-left: 8px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--surface-2); padding: 2px 8px; border-radius: 999px;
  text-transform: lowercase;
}
.next-meal {
  margin-top: 12px; padding: 10px 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 8px; border-left: 3px solid var(--accent);
}

/* "Save to My Foods" toggle in the off-plan form */
.cf-save-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text); }
.cf-save-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }

/* Modal + toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  /* Clear the notch and home indicator so a full-height sheet stays reachable. */
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: fade-in 140ms ease-out;
}
/* Column layout so a long body (a coach review) scrolls on its own while the
   title and buttons stay pinned and reachable on a phone. */
.modal-panel {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; max-width: 380px; width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: pop-in 160ms ease-out;
  display: flex; flex-direction: column;
  max-height: 100%; min-height: 0;
}
.modal-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; flex: 0 0 auto; }
.modal-message {
  font-size: 14px; line-height: 1.5; color: var(--text); white-space: pre-wrap;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
/* pre-wrap is for plain-text bodies; markup bodies would render their own
   source indentation as blank lines. */
.modal-message-html { white-space: normal; }
.modal-buttons {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex: 0 0 auto;
}
/* Stop the page behind the sheet from scrolling with it. */
body.modal-open { overflow: hidden; }

/* Coach review sheet — applyable changes vs advice that changes nothing. */
.coach-summary { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.coach-h {
  margin: 16px 0 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.coach-flags {
  background: var(--surface-2); border-left: 3px solid var(--warn);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.coach-flags ul { margin: 6px 0 0; padding-left: 18px; }
.coach-flags li { margin-bottom: 4px; }
.coach-opt {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.coach-opt input[type="checkbox"] {
  width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent);
}
.coach-opt > span { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.coach-delta { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.coach-why { font-size: 12px; color: var(--muted); line-height: 1.45; }
.coach-advice { margin: 0; padding-left: 18px; font-size: 13px; }
.coach-advice li { margin-bottom: 8px; }
.coach-advice .coach-why { display: block; margin-top: 2px; }
.coach-msg { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Photo-log draft: one editable row per recognized food. */
.photo-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.photo-item-head { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.photo-item-head input[type="checkbox"] {
  width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent);
}
.photo-item-head > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.photo-macros { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; margin-top: 10px; }
.photo-macros label { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.photo-macros span { font-size: 11px; color: var(--muted); }
.photo-macros input { min-height: 40px; padding: 6px 8px; text-align: center; }
.conf { font-weight: 600; }
.conf-high { color: var(--accent); }
.conf-medium { color: var(--warn); }
.conf-low { color: var(--danger); }
.modal-buttons button { min-width: 80px; }
.modal-buttons button.danger { background: var(--danger); border-color: var(--danger); color: white; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0; transition: opacity 200ms ease, transform 200ms ease;
  z-index: 50; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ai-progress-move {
  from { transform: translateX(-110%); }
  to { transform: translateX(270%); }
}
@keyframes ai-progress-pulse {
  from { opacity: 0.45; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.08); }
}

/* Date navigator */
.date-nav {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.date-nav .arrow { padding: 6px 10px; min-width: 40px; }
.date-nav .date-label {
  flex: 1; text-align: center; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.date-nav .date-label .weekday { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.date-nav .date-label .when { font-size: 14px; }
.date-nav input[type="date"] {
  position: absolute; opacity: 0; pointer-events: none; width: 0;
}
.date-nav .past-banner {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn); font-size: 12px; padding: 6px 10px; border-radius: 6px;
  margin-bottom: 10px;
}

.macros-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px;
}
.macros-grid .m {
  background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center;
}
.macros-grid .m b { display: block; font-size: 16px; }
.macros-grid .m span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.macros-grid .m .m-label {
  display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px;
}
.macros-grid .m .m-target {
  display: block; font-size: 10px; color: var(--muted); text-transform: none; margin-top: 1px;
}

.set-row {
  display: grid; grid-template-columns: 32px 1fr 1fr auto; gap: 8px; align-items: center;
  margin-top: 6px;
}
.set-row .idx { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.set-row input { padding: 8px; min-height: 38px; }
.set-row .last { font-size: 11px; color: var(--muted); white-space: nowrap; }

.exercise { margin-top: 14px; }
.exercise .ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exercise .ex-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.exercise .ex-title > div { min-width: 0; }
.exercise .ex-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.exercise .ex-target { font-size: 12px; color: var(--muted); white-space: nowrap; }
.exercise .ex-demo { font-size: 11px; color: var(--accent); text-decoration: none; display: inline-block; margin-top: 2px; }
.exercise .ex-demo:hover { text-decoration: underline; }
.guided-set { border-left: 4px solid var(--accent); }
.guided-set h2 { margin: 2px 0 0; }
.guided-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.guided-progress {
  flex-shrink: 0; min-width: 48px; text-align: center;
  padding: 5px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.guided-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-top: 10px;
}
.guided-meta div {
  background: var(--surface-2); border-radius: 8px; padding: 8px;
  min-width: 0;
}
.guided-meta span {
  display: block; color: var(--muted); font-size: 11px; text-transform: uppercase;
}
.guided-meta b {
  display: block; margin-top: 2px; font-size: 13px; overflow-wrap: anywhere;
}
.guided-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px;
}
.guided-inputs label { margin: 0; }
.guided-inputs label span { display: block; margin-bottom: 4px; }
.guided-next { width: 100%; margin-top: 12px; }
.workout-details { margin-bottom: 12px; transition: all 0.3s ease; }
.workout-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  font-weight: 700; font-family: 'Outfit', sans-serif; font-size: 16px;
  transition: all 0.2s ease;
}
.workout-details summary:hover { background: var(--surface-2); }
.workout-details summary::-webkit-details-marker { display: none; }
.workout-details summary::after {
  content: "▼"; color: var(--muted); font-size: 11px; transition: transform 160ms ease;
}
.workout-details[open] summary { margin-bottom: 12px; }
.workout-details[open] summary::after { transform: rotate(180deg); }
.workout-details-body .exercise:first-child { margin-top: 0; }
.ex-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--surface-2); border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}
.ex-icon { display: block; }
.today-ex-list { list-style: none; padding: 0; margin: 6px 0 0; }
.today-ex-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.today-ex-list li:last-child { border-bottom: none; }
.today-ex-list .ex-icon-wrap { width: 32px; height: 32px; border-radius: 8px; }
.today-ex-list .ex-icon { width: 28px; height: 28px; }
.today-ex-list .meta { font-size: 12px; color: var(--muted); }

.timer-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 30;
}
.timer-modal .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; min-width: 280px; text-align: center;
}
.timer-modal .countdown { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 12px 0; }
.timer-modal .presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }

.chart { width: 100%; height: 200px; background: var(--surface-2); border-radius: 8px; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.5; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart .lbl { fill: var(--muted); font-size: 10px; }

.entry-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.entry-table th, .entry-table td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--border); }
.entry-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
.entry-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { padding: 20px; text-align: center; color: var(--muted); }
.small { font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button, .btn, .tab, select { touch-action: manipulation; }

/* ── Dynamic plan + customization UI ────────────────────────────────────── */

select {
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238a96a3' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 30px 10px 12px;
  font: inherit;
  min-height: 44px;
  max-width: 100%;
}

/* Today: treadmill / conditioning day */
.cardio-block { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cardio-block .ex-icon-wrap { width: 40px; height: 40px; }

/* Workout: exercise header right side + inline swap picker */
.ex-head-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Compact icon-only swap: the ⇄ shows; a transparent native <select> overlays
   it so tapping opens the picker without the long name eating header width. */
.exercise .swap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 36px; margin: 0; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted);
}
.exercise .swap select {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  margin: 0; padding: 0; border: none; background: transparent;
  color: transparent; font-size: 16px; /* 16px avoids iOS zoom-on-focus */
}

.set-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.set-actions .small { min-height: 36px; padding: 6px 12px; }
.set-actions [data-rmex] { margin-right: auto; color: var(--muted); }
.add-ex .row { margin-top: 6px; }
.add-ex select { flex: 1; min-width: 0; }

/* Progression chips (hint-hold / hint-deload defined above) */
.overload-hint.hint-up  { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.overload-hint.hint-new { background: var(--surface-2); color: var(--muted); }

/* Settings: training-plan editor */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.seg button { min-height: 44px; padding: 8px; }
.seg button.active { background: var(--accent); color: #06231b; border-color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips .chip { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.chips .chip.on { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); border-color: var(--accent); color: var(--text); }
.week-edit { display: grid; gap: 6px; margin-top: 6px; }
.week-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; }
.week-row .wd { font-weight: 600; color: var(--muted); font-size: 13px; }
.week-row select { width: 100%; min-height: 40px; }

/* Settings wizard — stepped form that slides left/right instead of scrolling */
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.wiz-step-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wiz-dots { display: flex; gap: 2px; }
.setup-fast-start { width: 100%; margin: 10px 0 4px; }
.wiz-dot { position: relative; width: 34px; height: 36px; min-height: 0; padding: 0; background: transparent; border: none; }
.wiz-dot::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: width 200ms ease, background 200ms ease;
}
.wiz-dot.active::before { width: 22px; background: var(--accent); border-color: var(--accent); }
.wizard { overflow: hidden; }
.wizard-track { display: flex; align-items: flex-start; will-change: transform; }
.wizard-step { flex: 0 0 100%; }
.wizard-step .card { margin-bottom: 0; }
.wiz-nav { display: flex; gap: 10px; margin-top: 12px; }
.wiz-nav button { flex: 1; }
.wiz-nav #wiz-back[disabled] { opacity: 0.4; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .wizard, .wizard-track { transition: none !important; }
  .ai-progress-mark, .ai-progress-fill { animation: none; }
  .ai-progress:not(.done):not(.error) .ai-progress-fill { width: 65%; }
}

/* Narrow phones: a 4-up macro grid gets cramped */
@media (max-width: 380px) {
  .macros-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Persistent Floating Rest Timer ── */
.floating-timer-bar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 68px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 95;
  overflow: hidden;
  animation: slideUp 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-timer-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0.16;
  pointer-events: none;
  transition: width 0.3s linear;
}

.floating-timer-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  gap: 8px;
}

.floating-timer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.floating-pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
.floating-pulse.paused {
  background: var(--warn);
  box-shadow: none;
  animation: none;
}

.floating-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  color: var(--text);
}

.floating-digits {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.floating-timer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.floating-action-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  min-height: 28px;
  padding: 2px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.floating-action-btn:hover {
  background: var(--border);
}
.floating-action-btn.expand-btn {
  font-size: 14px;
  padding: 2px 7px;
}
.floating-action-btn.close-btn {
  font-size: 12px;
  padding: 2px 7px;
  color: var(--muted);
}

.timer-completed-bar {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-color: var(--accent);
}
.timer-bell-icon {
  font-size: 16px;
  animation: ring 0.5s ease;
}

/* Timer Modal Enhancements */
.timer-clock-wrap {
  margin: 12px 0;
}
.timer-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.timer-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.25s linear;
}
.countdown.paused {
  opacity: 0.65;
}

/* ── Barbell Plate Calculator Modal & Sleeve ── */
.plate-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 180ms ease;
}

.plate-modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  margin-bottom: 0;
}

.sleeve-container {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.sleeve-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 12px;
}
.sleeve-warn {
  color: var(--warn);
  font-weight: 600;
  font-size: 12px;
}

.barbell-graphic {
  display: flex;
  align-items: center;
  height: 90px;
  position: relative;
  padding-left: 20px;
  overflow-x: auto;
}

.bar-shaft {
  width: 50px;
  height: 12px;
  background: linear-gradient(180deg, #94a3b8 0%, #475569 50%, #1e293b 100%);
  border-radius: 4px 0 0 4px;
}

.bar-collar {
  width: 16px;
  height: 48px;
  background: linear-gradient(180deg, #cbd5e1 0%, #64748b 50%, #334155 100%);
  border-radius: 4px;
  box-shadow: 2px 0 6px rgba(0,0,0,0.4);
  z-index: 2;
}

.bar-sleeve {
  display: flex;
  align-items: center;
  height: 80px;
  position: relative;
  padding-left: 4px;
  gap: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 6px 6px 0;
  min-width: 160px;
}

.plate-disk {
  width: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset -1px 0 3px rgba(0,0,0,0.3), 1px 0 4px rgba(0,0,0,0.3);
  font-size: 10px;
  font-weight: 800;
  transition: transform 0.2s ease;
}
.plate-disk span {
  transform: rotate(-90deg);
  white-space: nowrap;
}

.empty-bar-label {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  padding: 0 12px;
}

.plate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.plate-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.warmup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.warmup-table th, .warmup-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.warmup-table th.num, .warmup-table td.num {
  text-align: right;
}
.warmup-table tr.target-row {
  background: rgba(16, 185, 129, 0.12);
  font-weight: 700;
}
.warmup-table tr.target-row td {
  color: var(--accent);
}

/* ── PR Badges & Trophy Board ── */
.pr-badge {
  display: inline-block;
  font-size: 11px;
  margin-left: 4px;
  animation: pr-pulse 1.8s infinite;
}

@keyframes pr-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8)); }
}

.pr-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pr-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.pr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}
.pr-crown {
  font-size: 16px;
}

.pr-card-body {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.pr-card-body div {
  display: flex;
  flex-direction: column;
}
.pr-card-body span {
  font-size: 11px;
  color: var(--muted);
}
.pr-card-body b {
  color: var(--accent);
  font-size: 14px;
}

/* ── Strength Chart & Tooltip ── */
.strength-chart-wrap {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.chart-tooltip {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
  margin-bottom: 6px;
}

.strength-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
}
.strength-dot:hover, .strength-dot:focus {
  r: 7;
  fill: #fff;
  outline: none;
}

/* ── Theme Picker ── */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.theme-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: border-color 0.15s ease;
}
.theme-card.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
}
.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* ── Premium Quick Water Tracker ── */
.water-tracker {
  margin-top: 14px;
}

.water-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.water-amount-current {
  font-size: 17px;
  font-weight: 800;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

.water-bar-track {
  width: 100%;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.water-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #06b6d4 60%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.water-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.water-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 66px;
}

.water-tile:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.water-tile:active {
  transform: scale(0.92);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.water-tile-icon {
  font-size: 22px;
  margin-bottom: 2px;
  line-height: 1;
}

.water-tile-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.water-tile-sub {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 1px;
}

.water-tile.undo-tile {
  opacity: 0.8;
}
.water-tile.undo-tile:hover {
  opacity: 1;
  border-color: var(--warn);
  background: rgba(245, 158, 11, 0.08);
}


