/* ═══════════════════════════════════════════════════════════
   V-FIT · Premium Coaching App
   System-aware theme · Glassmorphism · RTL-first
═══════════════════════════════════════════════════════════ */

:root {
  /* Brand accents (shared across themes) */
  --accent-1: #b5ff4d;
  --accent-2: #6a5af9;
  --accent-3: #ff6b9b;

  /* Macro colors */
  --c-protein: #b5ff4d;
  --c-carbs: #ffb547;
  --c-fat: #ff6b9b;
  --c-water: #4dc8ff;

  /* Type */
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-he: "Heebo", "Inter", system-ui, sans-serif;

  /* Radii & shadows */
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;
}

/* ── DARK THEME (default + system dark) ── */
:root,
:root[data-theme="dark"] {
  --bg-0: #07070b;
  --bg-1: #0d0e14;
  --bg-2: #15161f;

  --surface: rgba(22, 24, 34, 0.55);
  --surface-2: rgba(28, 30, 42, 0.7);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-1: #f5f6fb;
  --text-2: rgba(245, 246, 251, 0.72);
  --text-3: rgba(245, 246, 251, 0.5);

  --shadow-card: 0 20px 60px -20px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-glow: 0 0 60px rgba(181, 255, 77, 0.15);

  --ring-track: rgba(255, 255, 255, 0.08);
  --orb-opacity: 0.55;
  --vlogo-opacity: 0.07;
  --grid-opacity: 0.04;

  color-scheme: dark;
}

/* ── LIGHT THEME ── */
:root[data-theme="light"] {
  --bg-0: #f5f6fa;
  --bg-1: #eceef5;
  --bg-2: #ffffff;

  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 18, 30, 0.08);
  --border-strong: rgba(15, 18, 30, 0.14);

  --text-1: #0f1220;
  --text-2: rgba(15, 18, 32, 0.7);
  --text-3: rgba(15, 18, 32, 0.5);

  --shadow-card: 0 20px 50px -25px rgba(20, 30, 60, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --shadow-glow: 0 0 60px rgba(106, 90, 249, 0.18);

  --ring-track: rgba(15, 18, 30, 0.08);
  --orb-opacity: 0.4;
  --vlogo-opacity: 0.06;
  --grid-opacity: 0.06;

  color-scheme: light;
}

/* ── SYSTEM (auto) when no explicit theme set ── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-0: #f5f6fa;
    --bg-1: #eceef5;
    --bg-2: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-2: rgba(255, 255, 255, 0.9);
    --border: rgba(15, 18, 30, 0.08);
    --border-strong: rgba(15, 18, 30, 0.14);
    --text-1: #0f1220;
    --text-2: rgba(15, 18, 32, 0.7);
    --text-3: rgba(15, 18, 32, 0.5);
    --shadow-card: 0 20px 50px -25px rgba(20, 30, 60, 0.25),
      0 1px 0 rgba(255, 255, 255, 0.6) inset;
    --shadow-glow: 0 0 60px rgba(106, 90, 249, 0.18);
    --ring-track: rgba(15, 18, 30, 0.08);
    --orb-opacity: 0.4;
    --vlogo-opacity: 0.06;
    --grid-opacity: 0.06;
    color-scheme: light;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: linear-gradient(to bottom, #000000 55px, #f5f6fa 55px) !important;
  overflow-x: hidden;
  position: relative;
  transition: color 0.3s ease;
}

html[lang="en"] body,
html[lang="he"] body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

html[lang="he"] body { text-align: start; }
html[lang="en"] body { text-align: start; }

/* Bidi-safe semantic islands: interface direction may change without
   mirroring numbers, clocks, URLs, charts, media or user-authored fields. */
input, textarea, [contenteditable], [data-user-content], [data-server-content] {
  unicode-bidi: plaintext;
}
input[type="number"], input[type="range"], input[type="tel"], input[type="url"],
.ring-num, .cm-val, .mini-num, .ws-timer, .ws-rest-time,
canvas, video, audio, iframe, code, pre, [data-ltr] {
  direction: ltr;
  unicode-bidi: isolate;
}
html[lang="en"] .daily-note-toggle,
html[lang="en"] .daily-note-textarea {
  direction: ltr;
}

* {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

svg {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATED BACKGROUND — hidden for plain-white mode
═══════════════════════════════════════════════════════════ */
.bg-stage {
  display: none !important;
}

.bg-orb {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--orb-opacity);
  will-change: transform;
}
.bg-orb--lime {
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  top: -120px;
  right: -120px;
  animation: orbDriftA 22s ease-in-out infinite alternate;
}
.bg-orb--violet {
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  bottom: -160px;
  left: -120px;
  animation: orbDriftB 26s ease-in-out infinite alternate;
}
@keyframes orbDriftA {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-40px, 60px, 0) scale(1.08); }
}
@keyframes orbDriftB {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(50px, -50px, 0) scale(1.12); }
}

.bg-vlogo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 720px);
  aspect-ratio: 1 / 1;
  transform: translate3d(-50%, -50%, 0);
  opacity: var(--vlogo-opacity);
  filter: blur(0.5px);
  animation: vBreathe 9s ease-in-out infinite;
  will-change: transform, opacity, filter;
}
.bg-vlogo svg {
  width: 100%;
  height: 100%;
}
@keyframes vBreathe {
  0%, 100% {
    transform: translate3d(-50%, -50%, 0) scale(1) rotate(0deg);
    filter: blur(0.5px) drop-shadow(0 0 30px rgba(181, 255, 77, 0.4));
  }
  50% {
    transform: translate3d(-50%, -52%, 0) scale(1.05) rotate(-1.5deg);
    filter: blur(0px) drop-shadow(0 0 60px rgba(106, 90, 249, 0.45));
  }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, currentColor 1px, transparent 1px),
    linear-gradient(to bottom, currentColor 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--text-1);
  opacity: var(--grid-opacity);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════════ */
.app {
  position: relative;
  z-index: 1;
  max-width: 412px;
  margin: 0 auto;
  padding: 18px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav-spacer {
  height: 110px;
}

/* ═══════════════════════════════════════════════════════════
   GLASS PRIMITIVE
═══════════════════════════════════════════════════════════ */
.glass {
  background: #ffffff;
  border: 1px solid #f0f0f0;
  box-shadow: none;
  border-radius: var(--r-md);
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR (avatar · brand · day picker)
═══════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  flex-direction: column;
  direction: ltr;
  gap: 8px;
  padding: 10px 14px 10px;
  border-radius: var(--r-lg);
  height: auto;
  flex-shrink: 0;
}

.topbar-row {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Inter", system-ui, sans-serif;
  font-style: normal;
  font-weight: 900;
  font-size: 25px;
  letter-spacing: -0.03em;
  color: #000000;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  text-shadow: none;
  pointer-events: none;
  white-space: nowrap;
}
.topbar-row { position: relative; }

/* Avatar */
.avatar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.avatar-btn:hover { transform: scale(1.05); }
.avatar-ring {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 0;
  background: none;
  box-shadow: none;
}
.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #f2f2f2;
  border: 1.5px solid #cccccc;
  display: grid;
  place-items: center;
  color: #555555;
  overflow: hidden;
}
.avatar-inner svg { width: 22px; height: 22px; }
.avatar-inner img { width:100%; height:100%; object-fit:cover; display:block; }
.avatar-inner img[hidden] { display:none; }
.avatar-inner.has-photo svg { display:none; }
.avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: none;
}

.topbar-actions {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 6px;
}

.icon-btn,
.lang-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: var(--text-1);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: transform 0.18s ease, background 0.2s ease;
}
.icon-btn--sm,
.lang-btn--sm { width: 34px; height: 34px; }
.lang-btn--sm { width: auto; padding: 0 10px; font-size: 11px; }
.icon-btn:hover,
.lang-btn:hover {
  transform: translateY(-1px);
  background: var(--surface);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.lang-btn {
  width: auto;
  padding: 0 14px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-3);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-en);
  border: 2px solid var(--bg-0);
}

/* ── Day Strip ── */
.day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  height: 60px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease,
    opacity 0.25s ease;
  opacity: 0.65;
}
.day-pill:hover { opacity: 1; transform: translateY(-1px); }
.day-name {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.day-num {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
.day-pill.is-today .day-num::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-1);
  margin: 3px auto 0;
  box-shadow: 0 0 6px var(--accent-1);
}
.day-pill.is-active {
  opacity: 1;
  position: relative;
  overflow: hidden;
  background-color: #f0e8d8;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(255, 80, 80, 0.85) 0%, transparent 52%),
    radial-gradient(ellipse at 85% 15%, rgba(255, 210, 40, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 80%, rgba(6, 214, 160, 0.85) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 82%, rgba(72, 202, 228, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 160, 120, 0.55) 0%, transparent 60%);
  border-color: transparent;
  box-shadow: 0 4px 12px -5px rgba(0, 0, 0, 0.22);
  transform: scale(1.1);
}
/* Grain / noise texture overlay */
.day-pill.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.11;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.day-pill.is-active .day-name,
.day-pill.is-active .day-num { color: #000000; }
/* Hide the today-dot on the active pill — checkmark takes its place */
.day-pill.is-active.is-today .day-num::after { display: none; }

/* Always show checkmark on the active day */
.day-pill.is-active .day-check { display: block; }

/* ── Completed day indicator ── */
.day-check {
  display: none;
  font-size: 10px;
  font-weight: 900;
  color: #000000;
  line-height: 1;
  margin-top: -1px;
}
.day-pill.is-done .day-check { display: block; }
.day-pill.is-done:not(.is-active) .day-num { font-size: 13px; }

/* ── Bi-weekly reminder pill ── */
.biweekly-pill {
  position: relative;
  display: inline-flex;
  direction: ltr;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 7px 16px 7px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-1);
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  justify-content: center;
  flex-wrap: wrap;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}
.biweekly-pill:hover { transform: translateY(-1px); }
.biweekly-pill:active { transform: translateY(0) scale(0.98); }
.biweekly-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.biweekly-icon svg { width: 13px; height: 13px; }
.biweekly-text { white-space: nowrap; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; unicode-bidi: isolate; }
.biweekly-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  background: #ff4d6d;
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg-0), 0 4px 12px -2px rgba(255, 77, 109, 0.6);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Active state — solid black */
.biweekly-pill.is-active {
  background: #000000;
  color: #ffffff;
  border-color: transparent;
  box-shadow: none;
}
.biweekly-pill.is-active .biweekly-icon { background: rgba(255, 255, 255, 0.15); }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 18, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: 88vh;
  border-radius: 28px 28px 0 0;
  padding: 18px 18px 22px;
  overflow-y: auto;
  transform: translateY(40px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -20px 60px -12px rgba(0, 0, 0, 0.5);
}
.modal.is-open .modal-sheet { transform: translateY(0); }
.modal-sheet::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-1);
  margin: 0 auto 14px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-eyebrow {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #00d2ff;
  margin: 0 0 4px;
}
.modal-title {
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin: 0;
  letter-spacing: -0.01em;
}
.modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-1);
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--text-1); transform: rotate(90deg); transition: transform 0.25s ease, color 0.2s ease; }

.modal-body { display: flex; flex-direction: column; gap: 22px; }
.modal-section { display: flex; flex-direction: column; gap: 12px; }
.modal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.modal-section-title {
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  margin: 0;
}
.modal-section-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.photo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-1);
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.photo-slot:hover {
  border-color: #00d2ff;
  color: #00d2ff;
  background: color-mix(in srgb, #00d2ff 6%, var(--surface-2));
  transform: translateY(-2px);
}
.photo-slot-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-1);
}
.photo-slot-icon svg { width: 16px; height: 16px; }
.photo-slot-label {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.photo-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 0;
  border-radius: 12px;
  border: 1.5px dashed var(--border-1);
  background: transparent;
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.photo-add-btn:hover {
  border-color: #00d2ff;
  color: #00d2ff;
  background: color-mix(in srgb, #00d2ff 6%, transparent);
}
.photo-add-btn[hidden] { display: none; }

/* Measurements table */
.measure-table {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-1);
}
.measure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
}
.measure-row:last-child { border-bottom: none; }
.measure-label {
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.measure-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-0);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  padding: 6px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.measure-input:focus-within {
  border-color: #00d2ff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #00d2ff 18%, transparent);
}
.measure-input input {
  width: 56px;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  text-align: center;
  -moz-appearance: textfield;
}
/* ── split-input rows (thighs / arms) ── */
.measure-row--split { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.measure-split {
  display: flex;
  flex-direction: row;
  gap: 8px;
}
.measure-split-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.measure-split-label {
  font-family: var(--font-he);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.measure-split-pair .measure-input input { width: 40px; }

.measure-input input::-webkit-outer-spin-button,
.measure-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.measure-unit {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Daily note ── */
.daily-note-wrap {
  margin: 10px 14px 4px;
  border-radius: 12px;
  border: 1px solid var(--border-1);
  overflow: hidden;
}
.daily-note-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: none;
  cursor: pointer;
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  transition: background 0.18s, color 0.18s;
}
.daily-note-toggle:hover { color: var(--text-1); }
.daily-note-toggle.open {
  color: #00d2ff;
  background: color-mix(in srgb, #00d2ff 8%, var(--surface-2));
}
.note-chevron {
  margin-right: auto;
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform 0.24s cubic-bezier(.4,0,.2,1);
}
.daily-note-toggle.open .note-chevron { transform: rotate(180deg); }
.daily-note-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.26s cubic-bezier(.4,0,.2,1);
  background: var(--bg-0);
}
.daily-note-body.open { grid-template-rows: 1fr; }
.daily-note-inner { overflow: hidden; }
.daily-note-textarea {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-he);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
  padding: 12px 14px 4px;
}
.daily-note-textarea::placeholder { color: var(--text-3); }
.daily-note-counter {
  display: block;
  text-align: left;
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-3);
  padding: 2px 12px 8px;
  direction: ltr;
}

/* Modal footer */
.modal-foot {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.modal-btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}
.modal-btn:active { transform: scale(0.98); }
.modal-btn--ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border-1);
}
.modal-btn--ghost:hover { color: var(--text-1); }
.modal-btn--primary {
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(0, 210, 255, 0.55);
}
.modal-btn--primary:hover { box-shadow: 0 14px 30px -8px rgba(0, 210, 255, 0.65); }

@media (min-width: 520px) {
  .modal { align-items: center; }
  .modal-sheet { border-radius: 28px; }
  .modal-sheet::before { display: none; }
}

/* Modal subtitle (used by Daily Log) */
.modal-subtitle {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}

/* Inline icon next to label rows (Daily Log) */
.measure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.row-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, #00d2ff 14%, var(--surface-1));
  color: #00d2ff;
}
.row-icon svg { width: 14px; height: 14px; }

/* Progress chart card */
.progress-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 16px;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-he); }
.legend-dot { width: 9px; height: 9px; border-radius: 999px; box-shadow: 0 0 6px currentColor; }
.progress-chart-wrap {
  position: relative;
  width: 100%;
  height: 250px;
  min-height: 250px;
}
.progress-chart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Photo slot — show uploaded thumbnail */
.photo-slot { position: relative; overflow: hidden; }
.photo-slot.has-image {
  border-style: solid;
  border-color: #00d2ff;
}
.photo-slot.has-image .photo-slot-icon,
.photo-slot.has-image .photo-slot-label { display: none; }
.photo-slot-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

/* Theme icon switching */
.icon-btn .ic-sun,
.icon-btn .ic-moon {
  width: 18px;
  height: 18px;
}
.icon-btn .ic-sun { display: none; }
.icon-btn .ic-moon { display: block; }
:root[data-theme="dark"] .icon-btn .ic-sun,
:root:not([data-theme]) .icon-btn .ic-sun { display: block; }
:root[data-theme="dark"] .icon-btn .ic-moon,
:root:not([data-theme]) .icon-btn .ic-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .icon-btn .ic-sun { display: none; }
  :root:not([data-theme]) .icon-btn .ic-moon { display: block; }
}
:root[data-theme="light"] .icon-btn .ic-sun { display: none; }
:root[data-theme="light"] .icon-btn .ic-moon { display: block; }

/* ═══════════════════════════════════════════════════════════
   GREETING
═══════════════════════════════════════════════════════════ */
.greeting {
  padding: 10px 6px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
:root[dir="rtl"] .greeting { direction: rtl; }
:root[dir="ltr"] .greeting { direction: ltr; }
.greeting-text {
  flex: 1;
  min-width: 0;
  text-align: start;
  unicode-bidi: plaintext;
}
.greeting-sub {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.greeting-name {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, var(--text-1), var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.greeting-hint {
  color: var(--text-2);
  font-size: 14px;
}

/* Food scanner (locked) — unified dark/neon premium design (matches .ns-scanner-*) */
.food-scanner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.food-scanner-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #e3e6ec;
  cursor: pointer;
  background: linear-gradient(145deg, #fdfdfe, #eef0f4);
  color: #111318;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(15, 18, 30, 0.12);
  transition: transform 0.18s ease;
}
.food-scanner-btn:hover { transform: scale(1.05); }
.food-scanner-btn:active { transform: scale(0.95); }
.fs-apple { width: 30px; height: 30px; }
.food-scanner-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  background: #111318;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 2.5px 6px;
  border-radius: 999px;
  border: 2px solid #f5f6fa;
}
.food-scanner-lock {
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #111318;
  border: 2px solid #f5f6fa;
  display: grid;
  place-items: center;
  color: #d7dbe2; /* monochrome — matches white/black button */
  pointer-events: none;
}
.food-scanner-lock svg { width: 11px; height: 11px; }
.food-scanner-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #6a6f80;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 12px);
  background: rgba(20, 22, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-1);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(0, 210, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 18px rgba(0, 210, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ═══════════════════════════════════════════════════════════
   GENERIC CARD
═══════════════════════════════════════════════════════════ */
.card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-eyebrow {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-meta {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  align-self: center;
}
.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-1);
  transition: transform 0.15s ease, background 0.2s ease;
}
.chip:hover { transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════
   UNIFIED CALORIE + MACRO COMBO CARD
═══════════════════════════════════════════════════════════ */
.combo-card {
  padding: 14px 16px;
  background: #ffffff !important;
  box-shadow: none !important;
  border: 1px solid #f0f0f0 !important;
}
.combo-layout {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 16px;
}

/* Ring column */
.combo-ring {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

/* ── Conic gradient disc — colour source for the progress arc ── */
.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* scaleY(-1) mirrors the SVG vertically so strokes draw COUNTER-CLOCKWISE;
     rotate(135deg) then lands the start point at bottom-left (~7:30).
     Both fills start there, run counter-clockwise, and close the 360° loop there. */
  transform: rotate(135deg) scaleY(-1);
}
/* Subtle light track — full closed circle */
.ring-track {
  fill: none;
  stroke: #edeff4;
  stroke-width: 14;
}
/* Green progress stroke — fills counter-clockwise from bottom-left */
.ring-progress {
  fill: none;
  stroke: url(#ringProgressGrad); /* protein light-blue → carbs green */
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 0.001 578.1;
  transition: stroke-dasharray 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Surplus overlay — red second lap from the same start point */
.ring-surplus {
  fill: none;
  stroke: url(#ringSurplusGrad); /* fat orange, soft fade-in at the start edge */
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 0.001 578.1;
  opacity: 0;
  transition: stroke-dasharray 1.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.ring-surplus.is-visible { opacity: 1; }
/* Leading dot ("thumb") at the tip of the active fill — sits centered on the
   stroke line (cx = 110 + r 92) and orbits the ring center via rotate(). */
.ring-lead-dot {
  /* Flat — matches the carbs macro bar green */
  fill: #22c55e;
  stroke: #ffffff;
  stroke-width: 3;
  opacity: 0;
  /* transform-box: view-box is required for Safari/iOS — without it,
     transform-origin is ignored on SVG elements and the dot stays stuck
     at the origin. 50% 50% of the 220 viewBox = ring center (110,110). */
  transform-box: view-box;
  transform-origin: 50% 50%;
  transform: rotate(0deg);
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1),
              fill 0.3s ease, opacity 0.3s ease;
}
.ring-lead-dot.is-visible { opacity: 1; }
.ring-lead-dot.is-surplus {
  /* Flat — matches the fat macro bar orange */
  fill: #f97316;
  transition-duration: 1.2s, 0.3s, 0.3s; /* match the surplus arc timing */
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.ring-center {
  background: #ffffff;
  border-radius: 50%;
  margin: 14px;
}
.ring-num {
  /* Same clean face as the macro numbers (.cm-val), tightened to sit
     compactly inside the ring center */
  font-family: "Inter", system-ui, sans-serif;
  font-size: 23px;
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #000000;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}
.ring-unit {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 9px;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Bold red excess label shown when intake exceeds the daily goal */
.ring-surplus-text { /* matches the fat-orange surplus ring */
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #f97316;
  margin-top: 1px;
  letter-spacing: 0.01em;
}
.ring-surplus-text[hidden] { display: none; }

/* Data column */
.combo-data {
  flex: 1;
  min-width: 0;
  display: flex;
  direction: ltr;
  flex-direction: column;
  gap: 8px;
}
.combo-head {
  display: flex;
  direction: ltr;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.combo-eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000000;
  margin-bottom: 2px;
}
.combo-target {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-en);
}
.combo-chip {
  padding: 4px 10px;
  font-size: 11px;
  flex-shrink: 0;
  cursor: pointer;
}
.combo-chip:focus-visible { outline:3px solid rgba(220,38,38,.2); outline-offset:2px; }

.burn-breakdown-modal { z-index:140; align-items:center; padding:20px; }
.burn-breakdown-modal .modal-backdrop { background:rgba(8,10,18,.42); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
.burn-breakdown-sheet {
  width:min(400px,100%);
  max-height:min(560px,calc(100dvh - 40px));
  padding:20px;
  border:1px solid rgba(255,255,255,.65);
  border-radius:24px;
  background:#fff;
  color:#15171c;
  box-shadow:0 24px 70px rgba(17,24,39,.24),0 4px 18px rgba(17,24,39,.12);
  transform:translateY(14px) scale(.97);
}
.burn-breakdown-modal.is-open .burn-breakdown-sheet { transform:translateY(0) scale(1); }
.burn-breakdown-sheet::before { display:none; }
.burn-breakdown-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; text-align:start; margin-bottom:16px; }
.burn-breakdown-eyebrow { margin:0 0 4px; color:#dc2626; font-size:10px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.burn-breakdown-head h2 { margin:0; font-size:20px; line-height:1.2; }
.burn-breakdown-head p:last-child { margin:5px 0 0; color:#6b7280; font-size:11px; line-height:1.45; }
.burn-breakdown-close { flex:0 0 auto; width:34px; height:34px; border:1px solid #e5e7eb; border-radius:50%; background:#fff; color:#111827; display:grid; place-items:center; font:700 15px/1 inherit; cursor:pointer; }
.burn-breakdown-list { display:grid; gap:8px; }
.burn-breakdown-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px; border:1px solid #eceef2; border-radius:14px; background:#fafafa; text-align:start; }
.burn-breakdown-icon { width:38px; height:38px; border-radius:12px; background:#fff1f2; display:grid; place-items:center; font-size:18px; }
.burn-breakdown-copy { min-width:0; }
.burn-breakdown-copy b,.burn-breakdown-copy small { display:block; }
.burn-breakdown-copy b { font-size:12px; line-height:1.3; }
.burn-breakdown-copy small { margin-top:3px; color:#6b7280; font-size:9.5px; line-height:1.35; }
.burn-breakdown-row > strong { color:#b91c1c; font-size:14px; white-space:nowrap; direction:ltr; }
.burn-breakdown-row > strong small { font-size:9px; color:#6b7280; }
.burn-breakdown-empty { margin:2px 0 0; padding:10px; border-radius:12px; background:#f4f5f7; color:#6b7280; font-size:11px; text-align:center; }
.burn-breakdown-total { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:13px 14px; border-radius:15px; background:#17191d; color:#fff; font-size:12px; font-weight:800; }
.burn-breakdown-total strong { color:#fff; direction:ltr; font-size:17px; }

/* Eaten / burned / remain row */
.combo-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  direction: ltr;
  gap: 4px;
  width: 100%;
}
.cs {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}
.cs-val {
  font-size: clamp(11px, 3.1vw, 13px);
  font-weight: 700;
  font-family: var(--font-en);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.cs-lbl {
  font-size: clamp(8px, 2.35vw, 10px);
  color: var(--text-3);
  line-height: 1;
}

/* Shared dot styles (reused from rs-dot) */
.rs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rs-dot--eaten  { background: #1d4ed8; }
.rs-dot--burned { background: #dc2626; }
.rs-dot--remain { background: #16a34a; }

/* Divider */
.combo-divider {
  height: 1px;
  background: var(--border);
}

/* Macro mini rows */
.combo-macros {
  display: flex;
  direction: ltr;
  flex-direction: column;
  gap: 6px;
}
.cm-row {
  display: flex;
  direction: ltr;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.cm-name {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  font-family: "Inter", system-ui, sans-serif;
}
.cm-val {
  font-size: 11px;
  color: #888;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
}
.cm-val b {
  color: #333;
  font-weight: 700;
  font-size: 12px;
}
.cm-val small {
  font-size: 9px;
  color: #999;
}
.cm-track {
  height: 3px;
  background: #f0f0f0;
  border-radius: 99px;
  overflow: hidden;
}
.cm-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Protein — teal → steel-blue → sky mesh */
.cm-fill--protein {
  background: linear-gradient(90deg, #0dd3c5 0%, #3a8fb7 50%, #7dd3fc 100%);
}
/* Carbs — forest-green → emerald → mint mesh */
.cm-fill--carbs {
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 55%, #86efac 100%);
}
/* Fat — amber → warm-orange → golden mesh */
.cm-fill--fat {
  background: linear-gradient(90deg, #d97706 0%, #f97316 50%, #fbbf24 100%);
}

/* ═══════════════════════════════════════════════════════════
   MINI CARDS (steps + water)
═══════════════════════════════════════════════════════════ */
.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mini-card {
  padding: 18px;
}
.mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text-2);
}
.mini-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mini-icon svg { width: 14px; height: 14px; }
.mini-icon--steps { color: var(--accent-1); }
.mini-icon--water { color: var(--c-water); }
.mini-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000000;
}
.mini-num {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mini-num small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  margin-inline-start: 2px;
}
.mini-bar {
  margin: 12px 0 10px;
  height: 6px;
  background: var(--ring-track);
  border-radius: 999px;
  overflow: hidden;
}
.mini-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), #7be03d);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mini-fill--water {
  background: linear-gradient(90deg, var(--c-water), #2e9bff);
}

/* ── Water range slider ── */
.water-slider {
  --water-fill-end: 9px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 12px 0 10px;
  direction: ltr;
  padding: 0;
  border: 0;
  background: transparent;
}
.water-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #4dc8ff 0%, #2e9bff var(--water-fill-end), #e5e5e5 var(--water-fill-end));
}
.water-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  margin-top: -6px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  box-shadow: 0 1px 4px rgba(37,99,235,0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.water-slider::-webkit-slider-thumb:active {
  transform: scale(1.18);
  box-shadow: 0 2px 10px rgba(37,99,235,0.35);
}
.water-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  box-shadow: 0 1px 4px rgba(37,99,235,0.25);
  cursor: pointer;
}
.water-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #4dc8ff 0%, #2e9bff var(--water-fill-end), #e5e5e5 var(--water-fill-end));
}

.mini-foot {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   FEATURE GRID (2×2)
═══════════════════════════════════════════════════════════ */
.feature-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
  padding: 0 !important;
  width: 100%;
}

.fg-card {
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: none;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.14),
    0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.fg-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.1);
}
.fg-card:active {
  transform: scale(0.97);
}

/* Dark gradient overlay so white text always pops */
.fg-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Image area — full bleed, covers entire card */
.fg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Real photos fill the card area */
.fg-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Label — absolute, bottom-left, inside card over gradient, forced LTR */
.fg-label {
  position: absolute;
  bottom: 15px;
  left: 15px !important;
  right: auto !important;
  z-index: 2;
  direction: ltr !important;
  text-align: left !important;
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  padding: 0;
  background: none;
  max-width: calc(100% - 30px);
}

/* ── Heat Map ── */
.fg-img--heatmap {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}
.fg-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 20px;
  width: 100%;
}
.fg-heatmap-grid span {
  aspect-ratio: 1;
  border-radius: 5px;
  background: #302b63;
}
.fg-heatmap-grid span:nth-child(3)  { background: rgba(106, 90, 249, 0.4); }
.fg-heatmap-grid span:nth-child(7)  { background: rgba(106, 90, 249, 0.6); }
.fg-heatmap-grid span:nth-child(8)  { background: rgba(106, 90, 249, 0.9); }
.fg-heatmap-grid span:nth-child(9)  { background: rgba(181, 255, 77, 0.8); }
.fg-heatmap-grid span:nth-child(12) { background: rgba(106, 90, 249, 0.5); }
.fg-heatmap-grid span:nth-child(13) { background: rgba(181, 255, 77, 1);   }
.fg-heatmap-grid span:nth-child(14) { background: rgba(181, 255, 77, 0.7); }
.fg-heatmap-grid span:nth-child(18) { background: rgba(106, 90, 249, 0.7); }
.fg-heatmap-grid span:nth-child(19) { background: rgba(106, 90, 249, 0.4); }
.fg-heatmap-grid span:nth-child(23) { background: rgba(181, 255, 77, 0.5); }
.fg-heatmap-grid span:nth-child(24) { background: rgba(181, 255, 77, 0.9); }

/* ── Avatar Progression ── */
.fg-img--avatar {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.fg-avatar-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fg-av-head {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #6a5af9);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.6);
}
.fg-av-body {
  width: 20px;
  height: 36px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #6a5af9, #b5ff4d);
  box-shadow: 0 0 24px rgba(106, 90, 249, 0.5);
}
.fg-av-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,210,255,0.18), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ── Destination Map ── */
.fg-img--map {
  background: linear-gradient(160deg, #e8f4f8 0%, #d4eaf5 50%, #c8dfe8 100%);
}
.fg-map-pin {
  position: relative;
  z-index: 2;
  color: #e53e3e;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 8px rgba(229, 62, 62, 0.4));
}
.fg-map-pin svg {
  width: 100%;
  height: 100%;
  fill: #e53e3e;
  stroke: #fff;
  stroke-width: 1.2;
}
.fg-map-path {
  position: absolute;
  bottom: 22%;
  left: 15%;
  right: 15%;
  height: 2px;
  border-bottom: 2.5px dashed rgba(100, 120, 160, 0.45);
  border-radius: 999px;
}

/* ── Invincible Mindset ── */
.fg-img--mindset {
  background: linear-gradient(135deg, #1a0533, #2d1b69, #0d0d1a);
}
.fg-mindset-bolt {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  color: #ffcc00;
  filter: drop-shadow(0 0 14px rgba(255, 204, 0, 0.7));
}
.fg-mindset-bolt svg {
  width: 100%;
  height: 100%;
  fill: #ffcc00;
  stroke: #ffcc00;
}
.fg-mindset-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fg-mindset-rings span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 204, 0, 0.2);
}
.fg-mindset-rings span:nth-child(1) { width: 60px;  height: 60px; }
.fg-mindset-rings span:nth-child(2) { width: 90px;  height: 90px; border-color: rgba(255,204,0,0.12); }
.fg-mindset-rings span:nth-child(3) { width: 120px; height: 120px; border-color: rgba(255,204,0,0.07); }

/* ═══════════════════════════════════════════════════════════
   FLOATING BOTTOM NAV (Home · Workout · Nutrition · AI Coach · More)
═══════════════════════════════════════════════════════════ */
.nav-dock {
  position: fixed;
  direction: ltr;
  z-index: 50;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  left: 50%;
  transform: translateX(-50%);
  width: min(412px, calc(100% - 24px));
  pointer-events: none;
}
.nav-dock > * { pointer-events: auto; }

/* ── Quick-action row (sits above nav, only shows when relevant tab is active) ── */
.quick-row {
  display: grid;
  direction: ltr;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  margin-bottom: 10px;
  padding: 0 12px;
  pointer-events: none;
}
.quick-slot {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 44px;
}
.quick-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  color: #07070b;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.01em;
  border: 2px solid var(--bg-0);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px) scale(0.6);
  pointer-events: none;
  white-space: nowrap;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quick-fab svg { width: 16px; height: 16px; flex-shrink: 0; }
.quick-label { font-family: var(--font-he); }
.quick-fab--workout { background: #00ff87; box-shadow: 0 12px 28px -8px rgba(0, 255, 135, 0.6); }
.quick-fab.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: fabBounce 1.6s ease-in-out infinite;
}
@keyframes fabBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.04); }
}

/* ── Main nav bar ── */
.bottom-nav {
  display: grid;
  direction: ltr;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px;
  border-radius: 30px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.2);
  gap: 4px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 18px;
  padding: 7px 6px 6px;
  color: #cccccc;
  font-size: 10px;
  font-weight: 700;
  background: transparent;
  transition:
    color       0.28s ease,
    background  0.28s ease;
}
.nav-icon {
  display: grid;
  place-items: center;
  position: relative;
}
.nav-item svg    { width: 22px; height: 22px; }
.nav-item .icon-ol,
.nav-item .icon-fl { display: block; }

/* Outline visible when inactive; filled hidden */
.nav-item .icon-fl { display: none; }
.nav-item .icon-ol { display: block; }

/* Swap to filled when active */
.nav-item.active .icon-ol { display: none; }
.nav-item.active .icon-fl { display: block; }

.nav-label {
  letter-spacing: 0.02em;
  unicode-bidi: isolate;
  transition: color 0.28s ease, font-weight 0.28s ease;
}

/* Inactive AI Coach — same neutral gray */
.nav-item--coach { color: #cccccc; }
.nav-item--coach .nav-label { color: #cccccc; opacity: 1; }

/* ── Active state: Gymshark pill — #E5E5E5 bg, solid black fill icon + bold label ── */
.nav-item.active {
  background: #E5E5E5;
  color: #000000;
}
.nav-item.active .nav-icon { color: #000000; }
.nav-item.active .nav-label {
  color: #000000;
  font-weight: 800;
}

.nav-item:hover:not(.active) { color: #888888; }
.nav-item:hover:not(.active) .nav-label { color: #888888; }

/* ═══════════════════════════════════════════════════════════
   REVEAL ANIMATIONS
═══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger the cards */
.app .reveal:nth-child(1) { transition-delay: 0.05s; }
.app .reveal:nth-child(2) { transition-delay: 0.12s; }
.app .reveal:nth-child(3) { transition-delay: 0.20s; }
.app .reveal:nth-child(4) { transition-delay: 0.28s; }
.app .reveal:nth-child(5) { transition-delay: 0.36s; }
.app .reveal:nth-child(6) { transition-delay: 0.44s; }
.app .reveal:nth-child(7) { transition-delay: 0.52s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-orb, .bg-vlogo, .macro-fill::after { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
═══════════════════════════════════════════════════════════ */
@media (min-width: 520px) {
  .app { padding: 26px 26px 0; }
  .greeting-name { font-size: 38px; }
}

/* ═══════════════════════════════════════════════════════════
   ACTIVE MODE  —  Running Interface
═══════════════════════════════════════════════════════════ */
.active-mode {
  position: fixed;
  inset: 0;
  z-index: 9000;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
  will-change: transform;
  background: #ffffff; /* seamless white below the map / stats bar */
  overflow: hidden;
}
.active-mode.is-open {
  transform: translateX(0);
}

/* Map fills full panel behind everything */
.run-map {
  position: absolute;
  inset: 0 0 72px; /* stop above the bottom nav — no map bleed under it */
  z-index: 0;
}

/* Leaflet tile filters for a crisp look */
.run-map .leaflet-tile-pane {
  filter: saturate(0.85) brightness(1.02);
}
.active-mode.map-dark .run-map .leaflet-tile-pane {
  filter: none;
}

/* User location dot */
.am-user-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,0.45);
}

/* ── Header ── */
.am-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 16px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.am-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.6px;
  color: #000;
  text-transform: uppercase;
}
.am-run-icon { color: #000; flex-shrink: 0; }
/* Invisible spacer — same width as the back button so title stays centred */
.am-header-spacer {
  width: 38px;
  flex-shrink: 0;
}

/* ── Control-centre icon buttons (Settings & Music flanking START) ── */
.am-ctrl-btn {
  width: 52px;
  height: 52px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.13);
  box-shadow: 0 4px 18px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.08);
  color: #000;
}

/* ── Pre-run row: [Settings] [START] [Music] ── */
.am-prerun-row {
  display: flex;
  align-items: center;
  gap: 22px;
}
.am-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  transition: background 0.18s, transform 0.12s;
}
.am-icon-btn:active { transform: scale(0.9); }

/* ── Pre-run overlay ── */
.am-prerun {
  position: absolute;
  bottom: 170px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: opacity 0.25s ease;
}

.am-planned-context {
  width: min(340px, calc(100vw - 32px));
  margin: 0 auto 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 12, 16, .88);
  color: #fff;
  text-align: right;
  box-shadow: 0 14px 32px rgba(0,0,0,.24);
  backdrop-filter: blur(12px);
}
.am-planned-context > * { display: block; }
.am-planned-kicker { color: #b5ff4d; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.am-planned-context strong { margin-top: 4px; font-size: 18px; }
.am-planned-context small { margin-top: 4px; color: rgba(255,255,255,.72); }
.am-planned-context p { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.am-start-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.16);
  transition: transform 0.14s, box-shadow 0.14s;
  flex-shrink: 0;
}
.am-start-btn:active {
  transform: scale(0.91);
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.am-goal-btn {
  background: #fff;
  border: 2px solid rgba(0,0,0,0.75);
  border-radius: 24px;
  padding: 8px 28px;
  cursor: pointer;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  color: #000;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.18s, transform 0.12s;
  white-space: nowrap;
}
.am-goal-btn:active { transform: scale(0.95); }
.am-demo-btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.22);
  border-radius: 20px;
  padding: 5px 16px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(0,0,0,0.38);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.am-demo-btn:hover { color: rgba(0,0,0,0.65); border-color: rgba(0,0,0,0.45); }

/* ── Countdown overlay ── */
.am-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  font-family: var(--font-en);
  font-size: 100px;
  font-weight: 900;
  color: #000;
  letter-spacing: -4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  text-shadow: 0 0 40px rgba(255,255,255,0.95), 0 2px 24px rgba(255,255,255,0.7);
}
.am-countdown.visible { opacity: 1; }
.am-countdown.go {
  font-size: 52px;
  letter-spacing: 4px;
  color: #000;
}

/* ── Run-state controls (PAUSE / RESUME+FINISH) ── */
.am-run-controls {
  /* sits DIRECTLY ABOVE the metrics strip (bottom: 72px + ~95px height) — never overlaps it */
  position: absolute;
  bottom: 182px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.am-run-controls.visible { opacity: 1; pointer-events: auto; }
.am-run-ctrl-btn {
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14);
  transition: transform 0.14s, box-shadow 0.14s;
}
.am-run-ctrl-btn:active { transform: scale(0.9); box-shadow: 0 3px 12px rgba(0,0,0,0.18); }
.am-pause-btn  { width: 76px; height: 76px; background: #fff; color: #000; }
.am-resume-btn { width: 66px; height: 66px; background: #fff; color: #000; }
.am-finish-btn { width: 66px; height: 66px; background: #ef4444; color: #fff; }
.am-paused-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.am-paused-label {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #000;
  text-shadow: 0 1px 10px rgba(255,255,255,0.9);
}
.am-paused-btns { display: flex; align-items: center; gap: 26px; }

/* ── Post-run summary — minimal floating strip, map fills screen ── */
.am-summary {
  position: absolute;
  top: 78px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.am-summary.visible { opacity: 1; pointer-events: auto; }

/* header row: title (RTL right) + Done pill (left) */
.am-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-radius: 16px;
  padding: 10px 10px 10px 14px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid rgba(255,255,255,0.55);
}
.am-summary-title {
  font-family: var(--font-he);
  font-size: 17px;
  font-weight: 300;
  color: #111;
  letter-spacing: 0.2px;
}
.am-summary-done {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 7px 18px;
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.14s, opacity 0.14s;
}
.am-summary-done:active { transform: scale(0.93); }

/* legend pill */
.am-summary-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 600;
  color: rgba(0,0,0,0.45);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  pointer-events: none;
}
.am-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ── Live metrics strip — glassmorphism white, black text ── */
.am-metrics {
  position: absolute;
  bottom: 72px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 12px 4px;
}
.am-metric-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.am-metric-icon {
  color: rgba(0,0,0,0.4);
  margin-bottom: 2px;
}
.am-metric-val {
  font-family: var(--font-en), "Inter", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #000;
  line-height: 1;
}
.am-metric-lbl {
  font-family: var(--font-en);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: rgba(0,0,0,0.45);
  text-transform: uppercase;
}
.am-metric-divider {
  width: 1px;
  background: rgba(0,0,0,0.1);
  align-self: stretch;
  margin: 2px 0;
}

/* ── Active Mode bottom nav ── */
.am-nav {
  position: absolute;
  direction: ltr;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 72px;
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0,0,0,0.07);
}
.am-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 4px;
  border-radius: 10px;
  transition: color 0.18s;
}
/* Active tab: bold black, no background pill — clean NRC style */
.am-nav-btn.active {
  color: #000;
  background: transparent;
  font-weight: 900;
}
/* Run tab bold black ONLY when it carries the active class */
.am-nav-btn--run.active {
  color: #000 !important;
  background: transparent !important;
  font-weight: 900;
}

/* ── Dark map mode overrides ── */
.active-mode.map-dark .am-header {
  background: #0a0a0a;
  border-bottom-color: rgba(255,255,255,0.06);
}
.active-mode.map-dark .am-title { color: #fff; }
.active-mode.map-dark .am-run-icon { color: #9aff0a; }
.active-mode.map-dark .am-icon-btn {
  background: rgba(30,30,30,0.95);
  border-color: rgba(255,255,255,0.1);
  color: #fff;
}
.active-mode.map-dark .am-side-btn {
  background: rgba(30,30,30,0.95);
  border-color: rgba(255,255,255,0.1);
  color: #eee;
}
.active-mode.map-dark .am-start-btn {
  background: #fff;
  color: #000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.active-mode.map-dark .am-goal-btn {
  border-color: rgba(255,255,255,0.55);
  color: #fff;
}
/* Metrics are always dark — no override needed */
.active-mode.map-dark .am-nav {
  background: #0a0a0a;
  border-top-color: rgba(255,255,255,0.06);
}
.active-mode.map-dark .am-nav-btn { color: rgba(255,255,255,0.38); }
.active-mode.map-dark .am-nav-btn.active { color: #fff; background: #1f1f1f; }
.active-mode.map-dark .am-nav-btn--run,
.active-mode.map-dark .am-nav-btn--run.active {
  color: #9aff0a !important;
  background: transparent !important;
}

/* ═══════════════════════════════════════════════════════════
   WORKOUT SCREEN
═══════════════════════════════════════════════════════════ */
.workout-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  max-width: 412px;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.workout-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}

.ws-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 200px;
}
.ws-scroll::-webkit-scrollbar { width: 0; }

/* ── Header + program selector ── */
.ws-header {
  position: relative;
  margin-bottom: 16px;
}
.ws-header-top {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ws-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ws-timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background 0.2s ease;
}
.ws-timer-val {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ws-timer.is-running {
  background: #000;
  border-color: #000;
}
.ws-timer.is-running .ws-timer-val { color: #fff; }
.ws-timer.is-running .ws-timer-dot {
  background: #ff4d4d;
  animation: wsTimerPulse 1.4s ease-in-out infinite;
}
@keyframes wsTimerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Rest timer banner ── */
.ws-rest {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 14px 0 2px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: #000;
  color: #fff;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.6);
}
.ws-rest.is-open { display: flex; animation: wsRestIn 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes wsRestIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ws-rest-pulse {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 8px var(--accent-1);
  animation: wsTimerPulse 1.2s ease-in-out infinite;
}
.ws-rest-body {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.ws-rest-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}
.ws-rest-time {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ws-rest-skip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.ws-rest-skip:active { background: rgba(255, 255, 255, 0.16); }
/* "Rest is over" alert state */
.ws-rest.is-over {
  background: var(--accent-1);
  color: #06120a;
  animation: wsRestOver 0.6s ease;
}
.ws-rest.is-over .ws-rest-pulse {
  background: #06120a;
  box-shadow: none;
  animation: none;
}
.ws-rest.is-over .ws-rest-label {
  color: #06120a;
  font-weight: 800;
  font-size: 14px;
}
@keyframes wsRestOver {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.03); }
}
.ws-eyebrow {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 2px 8px;
}
.ws-bank-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  background: transparent;
  border: 1.5px solid var(--border-strong, var(--border));
  border-radius: var(--r-pill);
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.ws-bank-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.ws-bank-btn:hover { background: rgba(0,0,0,0.04); border-color: #000; }
.ws-bank-btn:active { transform: scale(0.95); }

/* Minimal single-row program selector (no card chrome) */
.ws-program-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: right;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.ws-program-select:active { transform: scale(0.99); opacity: 0.7; }
.ws-program-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ws-program-name {
  font-family: var(--font-he);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.ws-program-sub {
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.2;
}
.ws-program-chev {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-2);
  transition: transform 0.28s cubic-bezier(0.32,0,0.18,1);
}
.ws-program-select[aria-expanded="true"] .ws-program-chev { transform: rotate(180deg); }

/* ── Program dropdown ── */
.ws-program-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 22px 48px -18px rgba(0,0,0,0.32);
  padding: 6px;
  overflow: hidden;
  transform-origin: top center;
  animation: wsMenuIn 0.22s cubic-bezier(0.32,0,0.18,1);
}
@keyframes wsMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ws-menu-group + .ws-menu-group { margin-top: 4px; }
.ws-menu-group-label {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 12px 4px;
}
.ws-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: right;
  transition: background 0.15s ease;
}
.ws-menu-item:hover { background: rgba(0,0,0,0.04); }
.ws-menu-item.is-active { background: rgba(0,0,0,0.05); }
.ws-menu-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-menu-item-name {
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.ws-menu-item-sub {
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}
.ws-menu-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #000;
  opacity: 0;
}
.ws-menu-item.is-active .ws-menu-check { opacity: 1; }

/* ── Weekly split tabs ── */
.ws-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px 20px;
  padding: 2px 18px 6px;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font-he);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease, transform 0.12s ease;
}
.ws-tab:active { transform: scale(0.95); }
.ws-tab.is-active {
  background: #000;
  border-color: #000;
  color: #fff;
  box-shadow: 0 6px 16px -7px rgba(0,0,0,0.45);
}

/* ── Exercise list ── */
.ws-list { display: flex; flex-direction: column; gap: 12px; }

.ws-exercise {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ws-exercise.is-rest-menu-open { overflow: visible; }

.ws-cardio-card {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-align: right;
  border: 1px solid rgba(37,99,235,.18);
  background: linear-gradient(135deg, #eef6ff, #fff);
  cursor: pointer;
}
.ws-cardio-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #2563eb; font-size: 25px; }
.ws-cardio-info { display: flex; min-width: 0; flex-direction: column; gap: 3px; color: #111827; }
.ws-cardio-info strong { font-size: 16px; }
.ws-cardio-info > span:not(.ws-cardio-kicker), .ws-cardio-info small { color: #64748b; font-size: 12px; }
.ws-cardio-kicker { color: #2563eb; font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.ws-cardio-cta { color: #2563eb; font-size: 12px; font-weight: 800; white-space: nowrap; }
.ws-exercise.is-expanded {
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px -16px rgba(0,0,0,0.22);
}
.ws-ex-main {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  direction: ltr;
}
.ws-ex-info { text-align: start; }
.ws-ex-thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #1a1a1f 0%, #2c2c34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ws-ex-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.14), transparent 60%);
}
.ws-ex-play {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
.ws-ex-play svg { width: 12px; height: 12px; margin-right: -2px; }
.ws-ex-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #15151a;
}
.ws-ex-media-tag {
  position: absolute;
  z-index: 3;
  bottom: 3px;
  inset-inline-start: 3px;
  padding: 1px 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  backdrop-filter: blur(2px);
}
.ws-ex-media-tag--trainer {
  background: #fff;
  color: #000;
}
.ws-media-open { overflow: hidden !important; }
.ws-media-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}
.ws-media-modal[hidden] { display: none; }
.ws-media-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 24, 32, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  backdrop-filter: blur(16px) saturate(115%);
}
.ws-media-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-1);
}
.ws-media-close {
  position: absolute;
  z-index: 3;
  top: 0;
  inset-inline-end: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
}
.ws-media-close svg { width: 22px; height: 22px; }
.ws-media-heading { width: 100%; padding: 4px 54px 14px; text-align: center; }
.ws-media-heading span { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--text-2); }
.ws-media-heading h2 { margin: 4px 0 0; font-size: clamp(18px, 3vw, 26px); }
.ws-media-stage {
  width: 100%;
  min-height: 260px;
  max-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: #111;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
.ws-media-stage img,
.ws-media-stage video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}
.ws-media-hint { margin: 12px 0 0; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.72); color: #394150; font-size: 12px; text-align: center; }
.ws-ex-thumb[role="button"] { cursor: zoom-in; }
.ws-ex-thumb[role="button"]:focus-visible { outline: 3px solid #6a5af9; outline-offset: 3px; }

.cd-cardio-targets {
  margin: 14px 0;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.cd-cardio-targets legend { padding: 0 8px; font-weight: 800; color: var(--text-1); }
.cd-cardio-targets legend small { display: block; margin-top: 3px; font-weight: 500; color: var(--text-2); }
.am-goaltype-btn--wide { grid-column: 1 / -1; }
.am-interval-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.am-interval-fields[hidden] { display: none; }
.am-interval-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.am-interval-fields label > div { display: flex; align-items: center; gap: 6px; }
.am-interval-fields input,
.am-interval-fields select {
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-0);
  color: var(--text-1);
  font: inherit;
}
.am-interval-fields small { white-space: nowrap; font-size: 11px; color: var(--text-3); }
@media (max-width: 560px) {
  .cd-cardio-targets { grid-template-columns: 1fr; }
  .ws-media-modal { padding-inline: 10px; }
  .ws-media-stage { border-radius: 16px; }
}
.ws-ex-info { flex: 1; min-width: 0; }
.ws-ex-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ws-ex-title {
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  margin: 0;
  line-height: 1.2;
}
.ws-ex-source {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.ws-ex-source--trainer { background: rgba(0,0,0,0.07); color: var(--text-1); }
.ws-ex-source--ai { background: rgba(106,90,249,0.12); color: #6a5af9; }
.ws-ex-source--custom { background: rgba(0,0,0,0.04); color: var(--text-2); border: 1px solid var(--border); }
.ws-ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(0,0,0,0.035);
  padding: 4px 9px;
  border-radius: var(--r-pill);
}
.ws-chip b {
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--text-1);
  font-size: 11.5px;
}
.ws-rest-control {
  position: relative;
  display: inline-flex;
}
.ws-rest-trigger {
  border: 0;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}
.ws-rest-trigger:hover,
.ws-rest-trigger[aria-expanded="true"] {
  background: rgba(106,90,249,.11);
  color: #5948df;
}
.ws-rest-trigger:focus-visible {
  outline: 2px solid #6a5af9;
  outline-offset: 2px;
}
.ws-rest-trigger svg {
  width: 11px;
  height: 11px;
  transition: transform .16s ease;
}
.ws-rest-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.ws-rest-menu {
  position: fixed;
  z-index: 80;
  inset: auto;
  margin: 0;
  width: min(180px, calc(100vw - 58px));
  height: auto;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 28px -14px rgba(0,0,0,.34);
}
.ws-rest-menu::backdrop { background: transparent; pointer-events: none; }
.ws-rest-menu[hidden] { display: none; }
.ws-rest-options {
  display: block;
  height: 102px;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.ws-rest-options::-webkit-scrollbar { display: none; }
.ws-rest-options::before,
.ws-rest-options::after {
  content: "";
  display: block;
  height: 34px;
  pointer-events: none;
}
.ws-rest-wheel-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: end;
  gap: 2px;
  margin: 5px 0;
  border-block: 1px solid var(--border);
  overflow: hidden;
}
.ws-rest-wheel-wrap::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 50px 0 auto;
  height: 34px;
  border-block: 1px solid rgba(106,90,249,.2);
  background: rgba(106,90,249,.07);
  pointer-events: none;
}
.ws-rest-wheel-wrap::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 16px 0 0;
  background: linear-gradient(to bottom, #fff 0, transparent 34%, transparent 66%, #fff 100%);
  pointer-events: none;
}
.ws-rest-column {
  display: block;
  min-width: 0;
}
.ws-rest-unit {
  display: block;
  height: 16px;
  color: var(--text-3);
  font: 800 8px/16px var(--font-en);
  letter-spacing: .08em;
  text-align: center;
}
.ws-rest-separator {
  align-self: center;
  margin-top: 16px;
  color: var(--text-2);
  font: 850 15px/34px var(--font-en);
  text-align: center;
}
.ws-rest-option {
  display: block;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-1);
  font: 700 13px var(--font-en);
  cursor: pointer;
  scroll-snap-align: center;
  opacity: .46;
  transition: opacity .12s ease, font-size .12s ease;
}
.ws-rest-option:hover,
.ws-rest-option:focus-visible {
  outline: 0;
  opacity: .8;
}
.ws-rest-option[aria-selected="true"] {
  opacity: 1;
  font-size: 15px;
  font-weight: 850;
}
.ws-rest-option:disabled {
  opacity: .16;
  cursor: default;
}
.ws-rest-coach,
.ws-rest-apply {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text-1);
  font: 750 10.5px var(--font-he);
  cursor: pointer;
}
.ws-rest-coach[aria-pressed="true"] {
  border-color: #6a5af9;
  background: rgba(106,90,249,.1);
  color: #5948df;
}
.ws-rest-apply {
  min-height: 30px;
  border-color: #000;
  background: #000;
  color: #fff;
  font-size: 11px;
}
.ws-rest-coach:focus-visible,
.ws-rest-apply:focus-visible {
  outline: 2px solid #6a5af9;
  outline-offset: 1px;
}
.ws-ex-last {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 7px;
}
.ws-ex-last-tag {
  font-family: var(--font-he);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
}
.ws-ex-last-val {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.ws-ex-pr {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-he);
  font-size: 10.5px;
  font-weight: 800;
  color: #b58a16;
  background: rgba(231, 178, 28, 0.16);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.ws-ex-pr svg { width: 12px; height: 12px; }
.ws-ex-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.28s cubic-bezier(0.32,0,0.18,1);
}
.ws-ex-toggle svg { width: 16px; height: 16px; }
.ws-exercise.is-expanded .ws-ex-toggle {
  transform: rotate(180deg);
  background: #000;
  color: #fff;
}
.ws-ex-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.32,0,0.18,1);
}
.ws-exercise.is-expanded .ws-ex-detail { grid-template-rows: 1fr; }
.ws-ex-detail-inner { overflow: hidden; }
.ws-ex-detail-body {
  padding: 0 14px 16px 14px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 13px;
}
.ws-ex-detail-label {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 6px;
}
.ws-ex-detail-text {
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

/* ── Superset grouping ── */
.ws-superset {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px;
  background: rgba(0,0,0,0.018);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-superset-label {
  position: absolute;
  top: -9px;
  right: 14px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.ws-superset .ws-exercise { background: var(--bg-2); }
.ws-ss-tag {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
  color: #000;
  background: rgba(0,0,0,0.07);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

/* ── Empty state ── */
.ws-empty {
  text-align: center;
  padding: 50px 20px;
  font-family: var(--font-he);
  font-size: 14px;
  color: var(--text-3);
}

/* ── Action button ── */
.ws-action {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 24px 18px calc(env(safe-area-inset-bottom, 0px) + 102px);
  background: linear-gradient(to top, #ffffff 78%, transparent);
  pointer-events: none;
}
.ws-log-btn {
  pointer-events: auto;
  position: relative;
  z-index: 31;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 17px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 14px 32px -12px rgba(0,0,0,0.5);
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}
.ws-log-btn svg { width: 18px; height: 18px; }
.ws-log-btn:active { transform: scale(0.97); }

/* ── Active workout set logger ── */
.ws-exercise.is-logging .ws-ex-toggle { display: none; }
.ws-ex-logger {
  border-top: 1.5px solid var(--border);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: wsLoggerIn 0.26s cubic-bezier(0.32,0,0.18,1);
}
@keyframes wsLoggerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ws-set-row {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  touch-action: pan-y;
}
.ws-set-row-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 32px 1fr 1fr 38px;
  gap: 8px;
  align-items: center;
  background: var(--bg-2);
  transition: transform 0.3s cubic-bezier(0.32, 0, 0.18, 1);
  will-change: transform;
}
.ws-set-row-inner.is-dragging { transition: none; }
.ws-set-row.is-open .ws-set-row-inner { transform: translateX(-56px); }
@media (hover: hover) and (pointer: fine) {
  .ws-set-row:hover .ws-set-row-inner { transform: translateX(-56px); }
}
.ws-set-del {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 0;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  color: #ef4444;
  border: none;
  cursor: pointer;
  transition: background 0.16s ease;
}
.ws-set-del svg { width: 18px; height: 18px; }
.ws-set-del:active { background: var(--border); }
.ws-set-row--head {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 38px;
  gap: 8px;
  align-items: center;
  overflow: visible;
  padding: 0 2px 2px;
}
.ws-set-row--head span {
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
}
.ws-set-row--head .ws-set-num { text-align: center; }
.ws-set-num {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ws-set-input {
  width: 100%;
  padding: 9px 6px;
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.ws-set-input::-webkit-outer-spin-button,
.ws-set-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ws-set-input:focus {
  outline: none;
  border-color: #000;
  background: #fff;
}
.ws-set-check {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden; /* clip inner background layers to the rounded corners */
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.16s ease, transform 0.12s ease;
}
.ws-set-check svg {
  width: 16px;
  height: 16px;
  display: block;
  border-radius: inherit;
}
.ws-set-check:active { transform: scale(0.9); }
.ws-set-check.is-done {
  border: none; /* no inner ring — the gradient fills edge-to-edge */
  color: #fff;
  background-color: #f0e8d8;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(255, 80, 80, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(255, 210, 40, 1) 0%, transparent 52%),
    radial-gradient(ellipse at 10% 80%, rgba(6, 214, 160, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse at 88% 82%, rgba(72, 202, 228, 0.9) 0%, transparent 52%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 160, 120, 0.6) 0%, transparent 62%);
  background-clip: border-box;
  border-radius: var(--r-sm);
  outline: none;
  box-shadow: 0 4px 12px -5px rgba(0, 0, 0, 0.3); /* outer only, no inset */
}
.ws-set-check.is-done svg { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45)); }
.ws-set-row.is-done .ws-set-input {
  background: #000;
  border-color: #000;
  color: #fff;
  opacity: 1;
}
.ws-set-row.is-done .ws-set-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.ws-set-row.is-done .ws-set-num { color: #000; }
.ws-set-foot {
  display: flex;
  justify-content: center;
  margin-top: 7px;
}
.ws-set-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.ws-set-btn:active { transform: scale(0.97); }
.ws-set-add:hover { background: #000; border-color: #000; color: #fff; }

/* ═══════════════════════════════
   ACTIVE WORKOUT SESSION MODAL
═══════════════════════════════ */
.ws-session-modal { align-items: center; }
.ws-session-sheet {
  width: min(340px, calc(100% - 44px));
  margin: auto;
  padding: 26px 24px 22px;
  text-align: center;
  border-radius: 26px;
}
.ws-session-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--bg-1);
  color: var(--text-1);
}
.ws-session-icon svg { width: 28px; height: 28px; }
.ws-session-title {
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin: 0 0 8px;
}
.ws-session-msg {
  font-family: var(--font-he);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-3);
  margin: 0 0 20px;
}
.ws-session-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ws-session-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  font-family: var(--font-he);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.16s ease, background 0.16s ease;
}
.ws-session-btn svg { width: 18px; height: 18px; }
.ws-session-btn:active { transform: scale(0.97); }
.ws-session-btn--save {
  background: var(--text-1);
  color: var(--bg-2);
}
.ws-session-btn--delete {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.24);
}
.ws-session-btn--resume {
  background: transparent;
  color: var(--text-3);
  border-color: var(--border);
}

/* ═══════════════════════════════
   EXERCISE BANK
═══════════════════════════════ */
.exercise-bank {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  max-width: 412px;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.exercise-bank.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}

.eb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 12px;
  flex-shrink: 0;
}
.eb-back {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.eb-back svg { width: 20px; height: 20px; transform: scaleX(-1); }
.eb-back:active { transform: scale(0.92); }
.eb-eyebrow {
  margin: 0 0 1px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eb-title {
  margin: 0;
  font-family: var(--font-he);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-1);
}

/* ── Search ── */
.eb-searchbar {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 18px 12px;
  padding: 0 14px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.eb-searchbar:focus-within {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.eb-search-ic { width: 19px; height: 19px; color: var(--text-3); flex-shrink: 0; }
.eb-search-input {
  flex: 1;
  min-width: 0;
  margin: 0 10px;
  border: 0;
  background: transparent;
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  outline: none;
}
.eb-search-input::placeholder { color: var(--text-3); font-weight: 500; }
.eb-search-input::-webkit-search-cancel-button { display: none; }
.eb-clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--text-3);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.eb-clear svg { width: 13px; height: 13px; }

/* ── Filters ── */
.eb-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px;
  flex-shrink: 0;
}
.eb-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 18px;
  scrollbar-width: none;
}
.eb-filter-row::-webkit-scrollbar { display: none; }
.eb-chip-btn {
  flex-shrink: 0;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  font-family: var(--font-he);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}
.eb-chip-btn:active { transform: scale(0.94); }
.eb-chip-btn.is-active {
  background: #000;
  border-color: #000;
  color: #fff;
}
.eb-chip-btn[data-kind="equip"] { font-weight: 600; }

.eb-count {
  margin: 0;
  padding: 0 18px 10px;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  flex-shrink: 0;
}

/* ── List ── */
.eb-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.eb-list::-webkit-scrollbar { width: 0; }

.eb-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 11px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  text-align: right;
  cursor: pointer;
  direction: ltr;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.eb-card:active { transform: scale(0.985); }
.eb-card:hover { border-color: var(--border-strong); }
.eb-thumb {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #1a1a1f 0%, #2c2c34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
}
.eb-thumb-ic { position: relative; z-index: 1; width: 24px; height: 24px; }
.eb-thumb-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #15151a;
}
.eb-thumb-tag {
  position: absolute;
  z-index: 3;
  bottom: 3px;
  inset-inline-start: 3px;
  padding: 1px 5px;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.5;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  backdrop-filter: blur(2px);
}
.eb-card-body { flex: 1; min-width: 0; text-align: start; }
.eb-card-title {
  display: block;
  font-family: var(--font-he);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eb-card-sub {
  display: block;
  margin-top: 1px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eb-card-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.eb-mini {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-he);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg-0);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.eb-mini--eq { background: #000; color: #fff; border-color: #000; }
.eb-card-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transform: scaleX(-1);
}

.eb-state {
  padding: 48px 24px;
  text-align: center;
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}
.eb-spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: #000;
  animation: ebSpin 0.7s linear infinite;
}
@keyframes ebSpin { to { transform: rotate(360deg); } }
.eb-sentinel { height: 1px; }

/* ── Detail overlay ── */
.eb-detail {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateX(16px);
  transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.3s;
}
.eb-detail.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.32, 0, 0.18, 1);
}
.eb-detail-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 120px;
  scrollbar-width: none;
}
.eb-detail-scroll::-webkit-scrollbar { width: 0; }
.eb-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-0);
  border: 1.5px solid var(--border);
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
}
.eb-detail-back svg { width: 17px; height: 17px; transform: scaleX(-1); }
.eb-detail-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #1a1a1f 0%, #2c2c34 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 18px;
}
.eb-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #15151a;
}
.eb-detail-media .eb-thumb-ic { width: 64px; height: 64px; }
.eb-detail-noimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}
.eb-detail-title {
  margin: 0 0 3px;
  font-family: var(--font-he);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-1);
  text-align: right;
}
.eb-detail-sub {
  margin: 0 0 14px;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: capitalize;
  text-align: right;
}
.eb-detail-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.eb-detail-chips .eb-mini { font-size: 12px; padding: 5px 12px; }
.eb-mini--cat { background: #000; color: #fff; border-color: #000; }
.eb-mini--focus {
  background: var(--bg-0);
  color: var(--text-1);
  border-color: var(--text-1);
}
.eb-anat {
  flex-basis: 100%;
  width: 100%;
  margin-top: -2px;
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-align: start;
}
.eb-detail-block { text-align: right; }
.eb-detail-label {
  margin: 0 0 12px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eb-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.eb-steps li {
  position: relative;
  padding-inline-start: 36px;
  font-family: var(--font-he);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  counter-increment: ebstep;
}
.eb-steps li::before {
  content: counter(ebstep);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
}
.eb-steps { counter-reset: ebstep; }
.eb-steps-empty {
  font-family: var(--font-he);
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.eb-back svg,
.eb-detail-back svg,
.eb-detail-back span,
.eb-card > *,
.eb-card-body * { pointer-events: none; }

/* ═══════════════════════════════
   WEEKLY SUMMARY & BODY HEAT MAP
═══════════════════════════════ */
.weekly-screen {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  flex-direction: column;
  background: #fbfbfc;
  max-width: 412px;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.weekly-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.wk-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px;
}

/* Header */
.wk-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 16px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fbfbfc 70%, rgba(251,251,252,0));
  z-index: 4;
}
.wk-back {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid #ececf0;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(17,17,17,0.04);
  transition: transform 0.16s ease, background 0.16s ease;
}
.wk-back:active { transform: scale(0.92); }
.wk-back svg { width: 20px; height: 20px; }
.wk-head-text { display: flex; flex-direction: column; gap: 2px; }
.wk-eyebrow {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9aa0a8;
  margin: 0;
}
.wk-title {
  font-family: var(--font-he);
  font-size: 24px;
  font-weight: 800;
  color: #0e0f12;
  margin: 0;
  letter-spacing: -0.01em;
}
.wk-range {
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 500;
  color: #9aa0a8;
  margin: 1px 0 0;
}

/* Panels */
.wk-panel {
  background: #fff;
  border: 1px solid #f0f0f3;
  border-radius: var(--r-lg);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(17,17,17,0.04);
}
.wk-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.wk-panel-title {
  font-family: var(--font-he);
  font-size: 17px;
  font-weight: 800;
  color: #0e0f12;
  margin: 0;
}
.wk-panel-sub {
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 500;
  color: #9aa0a8;
  margin: 3px 0 0;
}

/* Heat map bodies — high-end 2D vector figures with typographic callouts */
.wk-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.wk-bodies {
  position: relative;
  /* LTR so the Front figure sits physically LEFT and SVG text-anchor
     start/end keep their geometric meaning (RTL flips both). */
  direction: ltr;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 2px 4px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 18%, #ffffff 0%, #f4f6fa 58%, #edf0f6 100%);
  border: 1px solid #f0f2f6;
}
.wk-body { margin: 0; display: flex; flex-direction: column; align-items: center; }
.wk-body-fig { position: relative; width: 100%; }
.wk-body-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.wk-heat-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.wk-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
/* Engines without CSS masking would let the glows spill outside the body —
   degrade gracefully to the plain illustration + callouts. */
@supports not ((mask-image: none) or (-webkit-mask-image: none)) {
  .wk-heat-layer { display: none; }
}
.wk-body-cap {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8b919a;
  margin: 4px 0 8px;
}
.wk-muscles .hm { fill: none; }
.wk-muscles .hm.is-high { fill: url(#wkHeatHigh); }
.wk-muscles .hm.is-mid  { fill: url(#wkHeatMid); }
.wk-muscles .hm.is-opt  { fill: url(#wkHeatOpt); }
.wk-muscles .hm.is-injury { fill: url(#wkHeatInjury); }
.wk-muscles .hm.is-neg  { fill: none; }

/* Callouts: thin leader lines + minimalist uppercase labels */
.wk-co-line {
  fill: none;
  stroke: #c6cdd9;
  stroke-width: 1;
  stroke-linejoin: round;
}
.wk-co-dot { stroke: #ffffff; stroke-width: 1.1; }
.wk-co-dot--high { fill: #ef5f0a; }
.wk-co-dot--mid  { fill: #f0a41c; }
.wk-co-dot--opt  { fill: #2fae62; }
.wk-co-name {
  font-family: var(--font-en, Inter, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  fill: #9aa2ad;
}
.wk-co-pct {
  font-family: var(--font-en, Inter, sans-serif);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  fill: #14181f;
}
.wk-co-pct--high { fill: #e2540a; }
.wk-co-pct--mid  { fill: #d98f0d; }
.wk-co-pct--opt  { fill: #23945a; }

/* Legend */
.wk-legend {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f2f2f5;
}
.wk-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 600;
  color: #6c727b;
}
.wk-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.wk-dot--high { background: #ef5f0a; box-shadow: 0 0 8px rgba(239, 95, 10, 0.45); }
.wk-dot--mid  { background: #f0a41c; box-shadow: 0 0 8px rgba(240, 164, 28, 0.45); }
.wk-dot--opt  { background: #2fae62; box-shadow: 0 0 8px rgba(47, 174, 98, 0.4); }
.wk-dot--injury { background: #5E35B1; box-shadow: 0 0 8px rgba(94, 53, 177, 0.45); }
.wk-dot--neg  { background: #e3e6ea; }
.wk-leg--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
}
.wk-leg-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wk-leg-note {
  font-family: var(--font-he);
  font-size: 10.5px;
  font-weight: 500;
  color: #9aa0a9;
  padding-inline-start: 17px;
  line-height: 1.4;
}

/* Insight cards */
.wk-insights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.wk-card {
  background: #fff;
  border: 1px solid #f0f0f3;
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: 0 6px 20px rgba(17,17,17,0.04);
  position: relative;
  overflow: hidden;
}
.wk-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.wk-card--top::before { background: linear-gradient(180deg, #ff8a4d, #ff6a4d); }
.wk-card--miss::before { background: linear-gradient(180deg, #ffd36a, #ffb04a); }
.wk-card-ic {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.wk-card-ic svg { width: 22px; height: 22px; }
.wk-card-ic--flame { background: #fff0eb; color: #ff5a3c; }
.wk-card-ic--alert { background: #fff7e6; color: #f5a623; }
.wk-card-title {
  font-family: var(--font-he);
  font-size: 16px;
  font-weight: 800;
  color: #0e0f12;
  margin: 0 0 6px;
}
.wk-card-text {
  font-family: var(--font-he);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  color: #6c727b;
  margin: 0 0 12px;
}
.wk-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wk-chip {
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--r-pill);
}
.wk-chip--high { background: #fff0eb; color: #e3492a; }
.wk-chip--neg  { background: #f2f3f5; color: #7b818a; }

/* Progress chart */
.wk-trend {
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.wk-trend.is-down { background: #eafaf0; color: #1f9d57; }
.wk-trend.is-up { background: #fff0eb; color: #e3492a; }
.wk-chart { width: 100%; }
.wk-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.wk-chart-x {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.wk-chart-xlab {
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 600;
  color: #aab0b8;
}

/* PR section */
.wk-pr-block { margin-bottom: 8px; }
.wk-pr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.wk-pr-title {
  font-family: var(--font-he);
  font-size: 18px;
  font-weight: 800;
  color: #0e0f12;
  margin: 0;
}
.wk-crown { font-size: 20px; }
.wk-pr-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wk-pr-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fffdf5, #fff);
  border: 1px solid #f3e9c8;
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(201,162,39,0.08);
  overflow: hidden;
}
.wk-pr-card::after {
  content: "";
  position: absolute;
  inset-inline-end: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(247,201,72,0.18), transparent 70%);
}
.wk-pr-medal {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f7d774, #e0a72e);
  color: #fff;
  box-shadow: 0 6px 14px rgba(224,167,46,0.35);
}
.wk-pr-medal svg { width: 26px; height: 26px; }
.wk-pr-body { flex: 1; min-width: 0; }
.wk-pr-ex {
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 800;
  color: #0e0f12;
  margin: 0;
}
.wk-pr-meta {
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 500;
  color: #8b919a;
  margin: 2px 0 0;
}
.wk-pr-val {
  flex: 0 0 auto;
  text-align: center;
}
.wk-pr-num {
  font-family: var(--font-he);
  font-size: 19px;
  font-weight: 900;
  color: #c8901f;
  line-height: 1;
}
.wk-pr-unit {
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 600;
  color: #b89248;
}
.wk-pr-delta {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 800;
  color: #1f9d57;
}
.wk-foot-space { height: 120px; }

/* ═══════════════════════════════════════════════════════════
   AVATAR — TRANSFORMATION TIMELINE MODULE (light glassmorphism)
═══════════════════════════════════════════════════════════ */
.avatar-screen {
  position: fixed;
  inset: 0;
  z-index: 64;
  background: #0a0a0a;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.34s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.4s;
  overflow: hidden;
}
.avatar-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.34s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.av-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 412px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.av-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}
.av-back {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: #f2f2f7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.av-back:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
.av-back svg { width: 22px; height: 22px; }
.av-head-text { display: flex; flex-direction: column; gap: 2px; }
.av-eyebrow {
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.av-title {
  font-family: var(--font-he);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Discreet demo trigger (testing tool) */
.av-demo-btn {
  margin-inline-start: auto;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #6e7480;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}
.av-demo-btn:hover,
.av-demo-btn[aria-expanded="true"] { opacity: 0.9; }
.av-demo-btn:focus-visible {
  outline: 2px solid rgba(255, 179, 71, 0.8);
  outline-offset: 3px;
  opacity: 1;
}

/* Interactive Demo Panel */
.av-demo-panel {
  padding: 14px;
  border: 1px solid rgba(255, 179, 71, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 0%, rgba(255, 107, 0, 0.12), transparent 40%),
    #111113;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: avDemoReveal 0.22s ease-out;
}
@keyframes avDemoReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.av-demo-panel[hidden] { display: none; }
.av-demo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.av-demo-title {
  margin: 0;
  font-family: var(--font-he);
  font-size: 14px;
  font-weight: 800;
  color: #f7f7f9;
}
.av-demo-badge {
  padding: 4px 8px;
  border: 1px solid rgba(255, 179, 71, 0.18);
  border-radius: 999px;
  background: rgba(255, 107, 0, 0.08);
  font-family: var(--font-he);
  font-size: 9.5px;
  font-weight: 700;
  color: #d79b5e;
}
.av-demo-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.av-demo-buttons button {
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #b9bdc7;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.av-demo-buttons button:hover,
.av-demo-buttons button.is-active {
  border-color: rgba(255, 179, 71, 0.52);
  background: rgba(255, 107, 0, 0.12);
  color: #ffbe73;
}
.av-demo-buttons button:active { transform: scale(0.97); }
.av-demo-buttons button:focus-visible,
.av-demo-close:focus-visible {
  outline: 2px solid rgba(255, 179, 71, 0.8);
  outline-offset: 2px;
}
.av-demo-status {
  min-height: 20px;
  margin: 0;
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 600;
  color: #858b98;
}
.av-demo-close {
  align-self: flex-start;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 700;
  color: #9da2ad;
}
.av-demo-close:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f2f2f7;
}

/* Consistency Streak */
.av-streak { display: flex; flex-direction: column; gap: 14px; }
.av-streak-head { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.av-streak-eyebrow {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a91a1;
}
.av-streak-title {
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.av-streak-card {
  --flame-size: 90px;
  --flame-y: 0px;
  --flame-glow-color: rgba(255, 157, 0, 0.4);
  --flame-glow-size: 30px;
  --card-glow-color: transparent;
  --spark-opacity: 0;
  --ambient-opacity: 0;
  --bg-scale: 1;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 22px 22px;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 107, 0, 0.12), transparent 55%),
    linear-gradient(145deg, #121212 0%, #1c1c1e 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 14px 34px rgba(10, 12, 20, 0.35), inset 0 0 80px var(--card-glow-color);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 1s ease, filter 0.4s ease, border-color 1s ease;
}

/* Stage Modifiers */
.av-streak-card[data-stage="spark"] {
  --flame-size: 90px;
  --flame-y: 10px;
  --flame-glow-color: rgba(255, 170, 0, 0.5);
  --flame-glow-size: 30px;
  --card-glow-color: transparent;
  --spark-opacity: 0;
  --ambient-opacity: 0;
}
.av-streak-card[data-stage="blaze"] {
  --flame-size: 140px;
  --flame-y: 0px;
  --flame-glow-color: rgba(255, 106, 0, 0.6);
  --flame-glow-size: 60px;
  --card-glow-color: rgba(255, 106, 0, 0.05);
  --spark-opacity: 0.3;
  --ambient-opacity: 0.24;
}
.av-streak-card[data-stage="surge"] {
  --flame-size: 200px;
  --flame-y: -15px;
  --flame-glow-color: rgba(255, 42, 0, 0.7);
  --flame-glow-size: 100px;
  --card-glow-color: rgba(255, 42, 0, 0.15);
  --spark-opacity: 0.7;
  --ambient-opacity: 0.5;
  border-color: rgba(255, 42, 0, 0.3);
}
.av-streak-card[data-stage="inferno"] {
  --flame-size: clamp(330px, 92vw, 430px);
  --flame-y: 0px;
  --flame-glow-color: rgba(255, 55, 20, 0.72);
  --flame-glow-size: 92px;
  --card-glow-color: rgba(255, 50, 16, 0.14);
  --spark-opacity: 0.88;
  --ambient-opacity: 0;
  --bg-scale: 1;
  min-height: 500px;
  padding: 0 22px;
  justify-content: center;
  border-color: rgba(255, 112, 25, 0.38);
}
.av-streak-card[data-stage="flowing"] {
  --flame-size: clamp(280px, 78vw, 360px);
  --flame-y: 0px;
  --flame-glow-color: rgba(255, 55, 20, 0.62);
  --flame-glow-size: 78px;
  --card-glow-color: rgba(255, 50, 16, 0.12);
  --spark-opacity: 0;
  --ambient-opacity: 0.48;
  --bg-scale: 1;
  min-height: 450px;
  padding: 0 22px;
  justify-content: center;
  border-color: rgba(255, 112, 25, 0.3);
}
.av-streak-card[data-stage="failed"] {
  --flame-size: 150px;
  --flame-y: 0px;
  --flame-glow-color: rgba(150, 150, 150, 0.4);
  --flame-glow-size: 20px;
  --card-glow-color: transparent;
  --spark-opacity: 0;
  --ambient-opacity: 0;
  filter: grayscale(1);
}

/* Base Ambient Layers */
.av-energy-layer,
.av-lottie-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--ambient-opacity);
  transition: opacity 1s ease, transform 1s ease;
  transform: scale(var(--bg-scale));
}
.av-lottie-layer lottie-player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.av-lottie-bg { z-index: 0; }
.av-lottie-fg { z-index: 2; }
.av-lottie-bg lottie-player {
  opacity: 0.58;
  transform: scale(1.28) rotate(180deg);
}
.av-lottie-fg lottie-player {
  opacity: 0.68;
  transform: scale(1.12) translateX(-7%);
}
.av-ambient-bg {
  background: radial-gradient(circle at 50% 50%, var(--card-glow-color) 0%, transparent 70%);
  z-index: 0;
  mix-blend-mode: color-dodge;
}

/* Sparks CSS */
.av-spark-layer {
  z-index: 2;
  opacity: var(--spark-opacity);
  overflow: hidden;
}
.av-spark {
  position: absolute;
  bottom: -10px;
  left: var(--spark-x);
  width: var(--spark-size, 4px);
  height: var(--spark-size, 4px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px 2px #ffaa00, 0 0 12px 4px #ff0000;
  animation: floatUp var(--spark-dur) linear infinite;
  animation-delay: var(--spark-delay);
  opacity: 0;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 0.8; }
  100% { transform: translateY(-220px) scale(0.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .av-streak-card { transition: none !important; }
  .av-spark { animation: none !important; display: none; }
  .av-confetti { animation: none !important; display: none; }
  .av-inferno-star { animation: none !important; display: none; }
  .av-energy-layer, .av-lottie-layer { transition: none !important; }
}
.av-streak-card:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(10, 12, 20, 0.45); }
.av-streak-card.is-inactive { filter: grayscale(0.78) saturate(0.35); }
.av-streak-card > :not(.av-demo-effect):not(.av-energy-layer):not(.av-lottie-layer) {
  position: relative;
  z-index: 1;
}
.av-demo-effect {
  position: absolute;
  inset: -4%;
  z-index: 0;
  display: block;
  width: 108%;
  height: 108%;
  opacity: 0.42;
  pointer-events: none;
}
.av-demo-effect[data-effect="flow"] {
  inset: 5% -32%;
  width: 164%;
  height: 90%;
  opacity: 0.26;
}
.av-streak-card[data-stage="flowing"] [data-effect="flow"] {
  opacity: 0.34;
  filter: saturate(1.15) hue-rotate(-8deg);
}
.av-demo-effect[hidden] { display: none; }
[data-av-energy-player][hidden] { display: none !important; }
.av-start-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 107, 0, 0.15), transparent 34%),
    rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  text-align: center;
}
.av-start-overlay[hidden] { display: none; }
.av-start-overlay span {
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}
.av-start-overlay button {
  min-width: 176px;
  padding: 13px 22px;
  border: 1px solid rgba(255, 200, 90, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, #f5c15c, #ff7b20);
  box-shadow: 0 10px 28px rgba(255, 107, 0, 0.28);
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 900;
  color: #15100a;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.av-start-overlay button:active { transform: scale(0.97); }
.av-start-overlay button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
.av-streak-flame {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  pointer-events: none;
  margin: -10px 0 10px;
}
.av-inferno-center {
  display: contents;
}
.av-inferno-fireworks {
  display: none;
}
.av-inferno-stars {
  display: none;
}
.av-inferno-label {
  display: none;
}
.av-confetti-layer {
  display: none;
}
#avFlameLottie {
  display: block;
  margin: 0 auto;
  width: var(--flame-size);
  height: var(--flame-size);
  transform: translateY(var(--flame-y));
  filter: drop-shadow(0 0 var(--flame-glow-size) var(--flame-glow-color));
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.3s ease;
  will-change: transform, width, height, filter;
}

@media (prefers-reduced-motion: reduce) {
  #avFlameLottie { transition: none !important; animation: none !important; }
  .av-streak-num { transition: none !important; }
}

.av-streak-count {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.av-streak-num {
  font-family: var(--font-en);
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 107, 0, 0.35);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: filter 1s ease, text-shadow 1s ease;
}
.av-streak-card[data-stage="surge"] .av-streak-num {
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.8));
  text-shadow: 0 0 34px rgba(255, 0, 34, 0.8);
}

/* Inferno layout — fireworks at the top, centered flame/counter, milestone line at the bottom. */
.av-streak-card[data-stage="inferno"] .av-energy-layer,
.av-streak-card[data-stage="inferno"] .av-lottie-layer,
.av-streak-card[data-stage="inferno"] .av-demo-effect,
.av-streak-card[data-stage="inferno"] .av-milestone,
.av-streak-card[data-stage="inferno"] .av-streak-reward {
  display: none !important;
}
.av-streak-card[data-stage="inferno"] .av-spark-layer {
  display: block !important;
  z-index: 2 !important;
  opacity: var(--spark-opacity);
}
.av-streak-card[data-stage="inferno"] .av-spark {
  background: #ff3b30;
  box-shadow: 0 0 7px 2px rgba(255, 59, 48, 0.9), 0 0 17px 4px rgba(213, 24, 18, 0.42);
  animation-name: avInfernoEmberRise;
  animation-timing-function: linear;
  will-change: transform, opacity;
}
@keyframes avInfernoEmberRise {
  0% {
    transform: translateY(0) scale(0.68);
    opacity: 0;
  }
  12% { opacity: 0.92; }
  80% { opacity: 0.72; }
  100% {
    transform: translateY(-480px) scale(0.18);
    opacity: 0;
  }
}
.av-streak-card[data-stage="inferno"] .av-inferno-fireworks {
  position: absolute !important;
  top: 0;
  left: 50%;
  z-index: 1 !important;
  display: block;
  width: 260px;
  height: 260px;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.av-streak-card[data-stage="inferno"] #avInfernoFireworks {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.av-streak-card[data-stage="inferno"] .av-inferno-stars {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  display: block;
  overflow: hidden;
  pointer-events: none;
}
.av-streak-card[data-stage="inferno"] .av-inferno-star {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 999px;
  background: #fff5bc;
  box-shadow: 0 0 5px 1px rgba(255, 228, 113, 0.65), 0 0 13px 3px rgba(255, 121, 24, 0.22);
  opacity: 0.38;
  animation: avInfernoStarPulse 4.8s ease-in-out infinite;
  animation-delay: var(--star-delay);
  will-change: transform, opacity;
}
@keyframes avInfernoStarPulse {
  0%, 100% { transform: scale(0.72); opacity: 0.2; }
  50% { transform: scale(1.16); opacity: 0.62; }
}
.av-streak-card[data-stage="inferno"] .av-inferno-center {
  position: absolute !important;
  inset: 0;
  z-index: 4 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.av-streak-card[data-stage="inferno"] .av-streak-flame {
  position: static !important;
  width: var(--flame-size);
  height: var(--flame-size);
  margin: 0;
  transform: none;
  filter: drop-shadow(0 0 var(--flame-glow-size) var(--flame-glow-color)) drop-shadow(0 28px 46px rgba(255, 66, 0, 0.42));
}
.av-streak-card[data-stage="inferno"] .av-streak-count {
  position: static !important;
  width: auto;
  transform: none;
}
.av-streak-card[data-stage="inferno"] .av-road {
  position: absolute !important;
  inset-inline: 22px;
  bottom: 12px;
  z-index: 4 !important;
  width: auto;
  padding-bottom: 22px;
}
.av-streak-card[data-stage="inferno"] .av-confetti-layer {
  position: absolute !important;
  inset: 0;
  z-index: 2 !important;
  display: block;
  overflow: hidden;
  pointer-events: none;
}
.av-streak-card[data-stage="inferno"] .av-confetti {
  position: absolute;
  top: -12px;
  left: var(--confetti-x);
  width: 5px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, #fff2a5, #f5c15c 48%, #ffae1f);
  box-shadow: 0 0 6px rgba(245, 193, 92, 0.46);
  opacity: 0;
  animation: avInfernoConfettiFall var(--confetti-duration) linear infinite;
  animation-delay: var(--confetti-delay);
  will-change: transform, opacity;
}
@keyframes avInfernoConfettiFall {
  0% {
    transform: translate3d(0, -14px, 0) rotate(var(--confetti-rotate));
    opacity: 0;
  }
  11% { opacity: 0.54; }
  88% { opacity: 0.46; }
  100% {
    transform: translate3d(18px, 510px, 0) rotate(calc(var(--confetti-rotate) + 320deg));
    opacity: 0;
  }
}
.av-streak-card[data-stage="inferno"] .av-inferno-label {
  position: absolute !important;
  left: 22px;
  bottom: 74px;
  z-index: 5 !important;
  display: block;
  color: rgba(255, 243, 188, 0.88);
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255, 177, 48, 0.38);
  pointer-events: none;
}

/* Between exact 100-day milestones: red flame + slow flow only. */
.av-streak-card[data-stage="flowing"] .av-spark-layer,
.av-streak-card[data-stage="flowing"] .av-inferno-fireworks,
.av-streak-card[data-stage="flowing"] .av-inferno-stars,
.av-streak-card[data-stage="flowing"] .av-confetti-layer {
  display: none !important;
}
.av-streak-card[data-stage="flowing"] .av-inferno-center {
  position: relative !important;
  z-index: 4 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.av-streak-card[data-stage="flowing"] .av-streak-flame {
  width: var(--flame-size);
  height: var(--flame-size);
  margin: -45px 0 -42px;
  filter: drop-shadow(0 0 var(--flame-glow-size) var(--flame-glow-color));
}
.av-streak-card[data-stage="flowing"] .av-streak-count {
  position: relative;
  z-index: 5;
}
.av-streak-card[data-stage="flowing"] .av-road {
  position: relative;
  z-index: 5;
  width: 100%;
}

.av-streak-lbl {
  font-family: var(--font-he);
  font-size: 13.5px;
  font-weight: 700;
  color: #c9cdd6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.av-road { width: 100%; padding: 24px 6px 26px; position: relative; }
.av-road-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.av-road-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(270deg, #ffb347, #ff6b00 55%, #c81d25);
  box-shadow: 0 0 8px rgba(255, 107, 0, 0.5);
}
.av-road-node {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3a3a3e;
  border: 2.5px solid #1c1c1e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.av-road-node.is-hit {
  background: linear-gradient(150deg, #ffb347, #ff6b00);
  box-shadow: 0 0 6px rgba(255, 107, 0, 0.8), 0 0 16px rgba(255, 107, 0, 0.55);
  animation: avNodePulse 1.8s ease-in-out infinite;
}
.av-road-node.is-celebrating { animation: avNodeUnlock 0.8s ease-out 2; }
@keyframes avNodePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 107, 0, 0.7), 0 0 12px rgba(255, 107, 0, 0.35); }
  50% { box-shadow: 0 0 9px rgba(255, 179, 71, 1), 0 0 22px rgba(255, 107, 0, 0.72); }
}
@keyframes avNodeUnlock {
  0% { transform: translate(50%, -50%) scale(1); }
  45% { transform: translate(50%, -50%) scale(1.75); }
  100% { transform: translate(50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .av-demo-panel,
  .av-road-node.is-hit,
  .av-road-node.is-celebrating { animation: none; }
  .av-demo-buttons button { transition: none; }
}
.av-road-node--final { width: 14px; height: 14px; }
.av-road-labels { position: absolute; inset-inline: 6px; top: 0; bottom: 0; pointer-events: none; }
.av-road-lbl {
  position: absolute;
  top: 36px; /* below the line */
  transform: translateX(50%);
  white-space: nowrap;
  font-family: var(--font-he);
  font-size: 10.5px;
  font-weight: 700;
  color: #f2f2f7;
}
/* Alternate labels above the line so neighbors never crowd each other */
.av-road-lbl:nth-child(even) { top: 4px; }
.av-road-lbl.is-hit { color: #ffb347; }
.av-road-lbl:last-child { transform: translateX(100%); }

.av-streak-reward {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 200, 90, 0.09), rgba(255, 255, 255, 0.04) 55%);
  border: 1px solid rgba(255, 200, 90, 0.22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.av-streak-reward:active { transform: scale(0.98); }
.av-streak-reward:focus-visible { outline: 2px solid rgba(255, 200, 90, 0.6); outline-offset: 2px; }
.av-gift {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #f5c15c;
  background: rgba(255, 200, 90, 0.1);
  border: 1px solid rgba(255, 200, 90, 0.25);
  animation: avGiftGlow 2.6s ease-in-out infinite;
}
.av-gift svg { width: 19px; height: 19px; }
@keyframes avGiftGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 193, 92, 0); transform: scale(1); }
  50% { box-shadow: 0 0 14px rgba(245, 193, 92, 0.35); transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .av-gift { animation: none; }
}
.av-streak-hook {
  flex: 1;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #cfd3dc;
}
.av-gold {
  font-weight: 800;
  color: #f5c15c;
  text-shadow: 0 0 14px rgba(245, 193, 92, 0.35);
}
.av-reward-chev {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #8a8f9b;
}
.av-reward-chev svg { width: 15px; height: 15px; }
[dir="rtl"] .av-reward-chev svg { transform: scaleX(-1); }

/* 100-Day Challenge rules modal */
.av-rules {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.av-rules.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.av-rules-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.av-rules-panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 400px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(165deg, #16161a, #0e0e10);
  border: 1px solid rgba(255, 200, 90, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(245, 193, 92, 0.06);
  transform: translateY(14px);
  transition: transform 0.25s ease;
  scrollbar-width: none;
}
.av-rules-panel::-webkit-scrollbar { display: none; }
.av-rules.is-open .av-rules-panel { transform: translateY(0); }
.av-rules-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfd3dc;
  cursor: pointer;
}
.av-rules-close:active { transform: scale(0.92); }
.av-rules-close svg { width: 15px; height: 15px; }
.av-rules-gift {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 16px;
  color: #f5c15c;
  background: rgba(255, 200, 90, 0.09);
  border: 1px solid rgba(255, 200, 90, 0.25);
  box-shadow: 0 0 26px rgba(245, 193, 92, 0.18);
  animation: avGiftGlow 2.6s ease-in-out infinite;
}
.av-rules-gift svg { width: 30px; height: 30px; }
@media (prefers-reduced-motion: reduce) {
  .av-rules-gift { animation: none; }
}
.av-rules-title {
  margin: 0 0 10px;
  font-family: var(--font-he);
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  color: #ffffff;
}
.av-rules-intro {
  margin: 0 0 14px;
  font-family: var(--font-he);
  font-size: 13.5px;
  line-height: 1.65;
  color: #c9cdd6;
}
.av-rules-list {
  margin: 0 0 14px;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.av-rules-list li {
  position: relative;
  padding-inline-start: 16px;
  font-family: var(--font-he);
  font-size: 13px;
  line-height: 1.6;
  color: #c9cdd6;
}
.av-rules-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5c15c;
  box-shadow: 0 0 8px rgba(245, 193, 92, 0.5);
}
.av-rules-list strong { color: #eceef2; font-weight: 700; }
.av-rules-note {
  margin: 0 0 14px;
  font-family: var(--font-he);
  font-size: 11.5px;
  line-height: 1.6;
  color: #8a8f9b;
}
.av-rules-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 200, 90, 0.05);
  border: 1px solid rgba(255, 200, 90, 0.18);
  cursor: pointer;
}
.av-rules-consent[hidden] { display: none; }
.av-rules-consent input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #f5c15c;
}
.av-rules-consent span {
  font-family: var(--font-he);
  font-size: 12px;
  line-height: 1.6;
  color: #c9cdd6;
}
.av-rules-start {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 800;
  color: #14100a;
  background: linear-gradient(135deg, #f5c15c, #ff8a2a);
  box-shadow: 0 8px 24px rgba(245, 193, 92, 0.28);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.av-rules-start:active { transform: scale(0.98); }
.av-rules-start:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* Streak fail state + milestone */
.av-streak-flame.is-out {
  filter: grayscale(1) brightness(0.55) !important;
  opacity: 0.55;
  transform: none !important;
}
.av-streak-card[data-stage="failed"] .av-streak-flame.is-out {
  filter: grayscale(1) brightness(0.82) contrast(1.15) !important;
  opacity: 0.82;
}
.av-fail-tip {
  position: relative;
  margin: 0 auto 10px;
  max-width: 300px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.av-fail-tip[hidden] { display: none !important; }
.av-fail-tip::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(38, 38, 41, 1);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.av-fail-msg {
  margin: 0 0 8px;
  font-family: var(--font-he);
  font-size: 12.5px;
  line-height: 1.55;
  color: #e6e8ee;
}
.av-restart-hint {
  margin: 0 0 10px;
  font-family: var(--font-he);
  font-size: 11.5px;
  line-height: 1.55;
  color: #aeb3bf;
}
.av-fail-restart {
  padding: 7px 14px;
  border: 1px solid rgba(255, 200, 90, 0.35);
  border-radius: 999px;
  background: rgba(255, 200, 90, 0.1);
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 700;
  color: #f5c15c;
  cursor: pointer;
}
.av-fail-restart:disabled { opacity: 0.4; cursor: not-allowed; }
.av-milestone {
  margin: 2px auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  width: fit-content;
  background: rgba(255, 200, 90, 0.1);
  border: 1px solid rgba(255, 200, 90, 0.3);
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 700;
  color: #f5c15c;
  text-shadow: 0 0 12px rgba(245, 193, 92, 0.35);
}

/* Friends Leaderboard */
.av-lb { display: flex; flex-direction: column; gap: 14px; }
.av-lb-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.av-lb-search-ico { width: 18px; height: 18px; color: #8a91a1; flex-shrink: 0; }
.av-lb-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-he);
  font-size: 14.5px;
  font-weight: 600;
  color: #f2f2f7;
}
.av-lb-search-input::placeholder { color: #7a8090; font-weight: 600; }
.av-lb-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.av-lb-search:focus-within { box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25); }

.av-lb-head { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.av-lb-eyebrow {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a91a1;
}
.av-lb-title {
  font-family: var(--font-he);
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.av-lb-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.av-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid transparent;
}
.av-lb-row + .av-lb-row { margin-top: 2px; }
.av-lb-rank {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 900;
  color: #6e7480;
}
.av-lb-ava {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 800;
  color: #c9cdd6;
  background: linear-gradient(150deg, #2c2c30, #1f1f23);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.av-lb-ava--me {
  color: #ffffff;
  background: linear-gradient(150deg, #ffb347, #ff6b00);
  border-color: transparent;
}
.av-lb-name {
  flex: 1;
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 700;
  color: #f2f2f7;
}
.av-lb-streak {
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 800;
  color: #8a91a1;
  white-space: nowrap;
}
.av-lb-row:first-child .av-lb-rank { color: #ff6b00; }
.av-lb-row.is-me {
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(255, 107, 0, 0.14), transparent 60%),
    rgba(255, 107, 0, 0.07);
  border-color: rgba(255, 107, 0, 0.3);
}
.av-lb-row.is-me .av-lb-rank { color: #ff6b00; }
.av-lb-row.is-me .av-lb-streak { color: #ff6b00; }

.av-spacer { height: 32px; flex-shrink: 0; }


/* ═══════════════════════════════
   INVINCIBLE MINDSET — premium white shell, high-contrast dark media blocks
   (forced light palette matching the main app, independent of theme toggles)
═══════════════════════════════ */
.mindset-screen {
  position: fixed;
  inset: 0;
  z-index: 63;
  display: flex;
  flex-direction: column;
  max-width: 412px;
  margin: 0 auto;
  background:
    radial-gradient(120% 55% at 85% -5%, rgba(106, 90, 249, 0.09), transparent 60%),
    radial-gradient(110% 45% at 10% 6%, rgba(181, 255, 77, 0.1), transparent 55%),
    #f5f6fa;
  color: #0f1220;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.mindset-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.ms-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px;
}

/* Header — sharp dark typography on white */
.ms-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #f5f6fa 66%, rgba(245, 246, 250, 0));
}
.ms-back {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(15, 18, 30, 0.12);
  background: #ffffff;
  color: #0f1220;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(20, 30, 60, 0.25);
  transition: transform 0.16s ease, background 0.16s ease;
}
.ms-back:active { transform: scale(0.92); }
.ms-back svg { width: 20px; height: 20px; }
.ms-head-text { display: flex; flex-direction: column; gap: 2px; }
.ms-eyebrow {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(15, 18, 32, 0.55);
  margin: 0;
}
.ms-title {
  font-family: "Barlow Condensed", var(--font-en);
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #0f1220;
  margin: 0;
  direction: ltr;
  text-align: right;
}
.ms-title span {
  background: linear-gradient(92deg, #57a802, #0f9d3e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── White card shell shared by content sections ── */
.ms-quote-card,
.ms-block {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.07);
  border-radius: 24px;
  box-shadow: 0 18px 44px -26px rgba(20, 30, 60, 0.28);
  padding: 18px;
  margin-bottom: 22px;
}

/* ── Quote of the day — seamless dark-on-white inside the white card ── */
.ms-quote {
  position: relative;
  overflow: hidden;
  padding: 6px 6px 2px;
}
.ms-quote-eyebrow {
  font-family: var(--font-he);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(15, 18, 32, 0.45);
  margin: 0 0 12px;
}
.ms-quote-mark {
  position: absolute;
  top: -6px;
  left: 8px;
  font-family: Georgia, serif;
  font-size: 120px;
  line-height: 1;
  color: rgba(15, 18, 32, 0.06);
  pointer-events: none;
  user-select: none;
}
.ms-quote-text {
  font-family: var(--font-he);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.45;
  color: #0f1220;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.ms-quote-author {
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 600;
  color: rgba(15, 18, 32, 0.6);
  margin: 0;
}
.ms-quote-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 18, 30, 0.08);
}
.ms-quote-arrow {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(15, 18, 30, 0.14);
  background: #ffffff;
  color: #0f1220;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.ms-quote-arrow:hover { border-color: rgba(15, 18, 30, 0.45); background: #f5f6fa; }
.ms-quote-arrow:active { transform: scale(0.9); }
.ms-quote-arrow svg { width: 17px; height: 17px; }
.ms-quote-count {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(15, 18, 32, 0.45);
  min-width: 52px;
  text-align: center;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
@keyframes msQuoteSwap {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.ms-quote.is-swap .ms-quote-text,
.ms-quote.is-swap .ms-quote-author {
  animation: msQuoteSwap 0.32s cubic-bezier(0.22, 0, 0.18, 1) both;
}
.ms-quote.is-swap .ms-quote-author { animation-delay: 0.05s; }

/* ── Section headers inside white cards — dark typography ── */
.ms-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ms-block-title {
  font-family: var(--font-he);
  font-size: 17px;
  font-weight: 800;
  color: #0f1220;
  margin: 0;
}
.ms-block-tag {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(15, 18, 32, 0.55);
  border: 1px solid rgba(15, 18, 30, 0.16);
  border-radius: var(--r-pill);
  padding: 4px 10px 3px;
  background: #ffffff;
}
.ms-block-tag--sp {
  color: #128a43;
  border-color: rgba(18, 138, 67, 0.4);
}

/* ── Video podcasts — dark frames pop on the white card ── */
.ms-video { margin-bottom: 18px; }
.ms-video:last-child { margin-bottom: 0; }
.ms-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #0d0e14;
  border: 1px solid rgba(15, 18, 30, 0.85);
  box-shadow: 0 16px 36px -18px rgba(15, 18, 32, 0.55);
  transform: translateZ(0);
}
.ms-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.ms-video-meta { padding: 10px 4px 0; }
.ms-video-name {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: #0f1220;
  margin: 0 0 2px;
  direction: ltr;
  text-align: right;
}
.ms-video-sub {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  color: rgba(15, 18, 32, 0.5);
  margin: 0;
  direction: ltr;
  text-align: right;
}

/* ── Spotify quick-links — dark buttons with green Spotify accent ── */
.ms-playlists { display: flex; flex-direction: column; gap: 12px; }
.ms-pl {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  text-decoration: none;
  background: linear-gradient(160deg, #16171f, #0c0d12 70%);
  border: 1px solid rgba(15, 18, 30, 0.9);
  box-shadow: 0 14px 30px -18px rgba(15, 18, 32, 0.6);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.2s ease;
}
.ms-pl:active { transform: scale(0.98); }
.ms-pl:hover {
  border-color: rgba(29, 185, 84, 0.55);
  box-shadow: 0 16px 34px -18px rgba(29, 185, 84, 0.45);
}
.ms-pl-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(29, 185, 84, 0.14);
  color: #1db954;
}
.ms-pl-icon svg { width: 26px; height: 26px; }
.ms-pl-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-pl-name {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f5f6fb;
}
.ms-pl-sub {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 500;
  color: rgba(245, 246, 251, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-pl-open {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(245, 246, 251, 0.6);
}
.ms-pl-open svg { width: 15px; height: 15px; transform: scaleX(-1); }

/* ── Champions' stories — cinematic dark cards inside the white card ── */
.ms-stories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -18px;
  padding: 2px 18px 4px;
  scrollbar-width: none;
}
.ms-stories::-webkit-scrollbar { display: none; }
.ms-story {
  position: relative;
  flex: 0 0 70%;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: center;
  background: #0d0e14;
  border: 1px solid rgba(15, 18, 30, 0.85);
  box-shadow: 0 16px 36px -20px rgba(15, 18, 32, 0.55);
  cursor: pointer;
  transform: translateZ(0);
}
.ms-story-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0, 0.18, 1);
}
.ms-story:hover .ms-story-img { transform: scale(1.05); }
.ms-story-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 3, 6, 0.92) 0%, rgba(3, 3, 6, 0.35) 38%, transparent 62%);
}
.ms-story-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
}
.ms-story-tag {
  font-family: var(--font-en);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: var(--accent-1);
  margin: 0 0 6px;
  direction: ltr;
  text-align: right;
}
.ms-story-title {
  font-family: "Barlow Condensed", var(--font-en);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin: 0 0 4px;
  direction: ltr;
  text-align: right;
}
.ms-story-sub {
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(245, 246, 251, 0.66);
  margin: 0;
}

.ms-foot-space { height: 36px; }

/* ── Champions' story modal — clean black-and-white premium sheet ── */
.ms-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
.ms-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease;
}
.ms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ms-modal-panel {
  position: relative;
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.08);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -24px 60px -18px rgba(15, 18, 32, 0.45);
  transform: translateY(26px);
  transition: transform 0.34s cubic-bezier(0.26, 0, 0.14, 1);
  scrollbar-width: none;
}
.ms-modal-panel::-webkit-scrollbar { display: none; }
.ms-modal.is-open .ms-modal-panel { transform: translateY(0); }
.ms-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 9, 14, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.ms-modal-close:active { transform: scale(0.9); }
.ms-modal-close svg { width: 18px; height: 18px; }
.ms-modal-hero {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  background: #0d0e14;
}
.ms-modal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.ms-modal-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 4, 8, 0.88) 2%, rgba(4, 4, 8, 0.38) 42%, rgba(4, 4, 8, 0.04) 70%);
}
.ms-modal-hero-text {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 20px 12px;
}
.ms-modal-tag {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: var(--accent-1);
  margin: 0 0 6px;
  direction: ltr;
  text-align: right;
}
.ms-modal-title {
  font-family: "Barlow Condensed", var(--font-en);
  font-size: 34px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin: 0 0 4px;
  direction: ltr;
  text-align: right;
}
.ms-modal-sub {
  font-family: var(--font-he);
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}
.ms-modal-body {
  padding: 18px 20px 30px;
}
.ms-modal-body p {
  font-family: var(--font-he);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(15, 18, 32, 0.82);
  margin: 0 0 14px;
}
.ms-modal-body p:first-child {
  font-weight: 600;
  color: #0f1220;
}
.ms-modal-body p:last-child {
  margin-bottom: 0;
  color: #0f1220;
  font-weight: 700;
  border-right: 3px solid var(--accent-1);
  padding-right: 12px;
}

/* ═══════════════════════════════════════════════
   DESTINATION MAP — gamified goal journey (light)
═══════════════════════════════════════════════ */
.dest-screen {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  max-width: 412px;
  margin: 0 auto;
  background:
    radial-gradient(120% 55% at 85% -5%, rgba(106, 90, 249, 0.09), transparent 60%),
    radial-gradient(110% 45% at 10% 6%, rgba(181, 255, 77, 0.1), transparent 55%),
    #f5f6fa;
  color: #0f1220;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0s 0.24s;
}
.dest-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.dm-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px;
}

/* Header — same sharp dark-on-white language as the rest of the app */
.dm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #f5f6fa 66%, rgba(245, 246, 250, 0));
}
.dm-back {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(15, 18, 30, 0.12);
  background: #ffffff;
  color: #0f1220;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(20, 30, 60, 0.25);
  transition: transform 0.16s ease, background 0.16s ease;
}
.dm-back:active { transform: scale(0.92); }
.dm-back svg { width: 20px; height: 20px; }
.dm-head-text { display: flex; flex-direction: column; gap: 2px; }
.dm-eyebrow {
  font-family: var(--font-he);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(15, 18, 32, 0.55);
  margin: 0;
}
.dm-title {
  font-family: "Barlow Condensed", var(--font-en);
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #0f1220;
  margin: 0;
  direction: ltr;
  text-align: right;
}
.dm-title span {
  background: linear-gradient(92deg, #57a802, #0f9d3e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Summary strip */
.dm-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.07);
  border-radius: 20px;
  box-shadow: 0 14px 34px -24px rgba(20, 30, 60, 0.3);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.dm-sum-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dm-sum-num {
  font-family: var(--font-he);
  font-size: 16px;
  font-weight: 800;
  color: #0f1220;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}
#dmDoneCount { direction: ltr; }
.dm-sum-lab {
  font-family: var(--font-he);
  font-size: 11px;
  font-weight: 600;
  color: rgba(15, 18, 32, 0.5);
}
.dm-sum-div { width: 1px; align-self: stretch; background: rgba(15, 18, 30, 0.08); }

/* Journey card — white shell, the trail lives inside */
.dm-card {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.07);
  border-radius: 24px;
  box-shadow: 0 18px 44px -26px rgba(20, 30, 60, 0.28);
  padding: 10px;
  margin-bottom: 22px;
}
.dm-journey {
  position: relative;
  width: 100%;
  aspect-ratio: 340 / 1060;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(80% 26% at 70% 4%, rgba(181, 255, 77, 0.14), transparent 70%),
    radial-gradient(90% 30% at 20% 96%, rgba(106, 90, 249, 0.08), transparent 70%),
    linear-gradient(180deg, #fbfcff, #f4f5fa);
}
.dm-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.dm-track {
  fill: none;
  stroke: rgba(15, 18, 30, 0.14);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1 9;
}
.dm-conquered {
  fill: none;
  stroke: #0f9d3e;
  stroke-width: 3.4;
  stroke-linecap: round;
}

/* Nodes — the DOT is anchored exactly on the trail point; the text hangs
   off to the inner side so nothing clips at the card edges. */
.dm-node {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.dm-node-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 178px;
  height: auto;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}
/* Dot on the right of the trail → text to its left (toward center) */
.dm-node--r .dm-node-text { right: 58px; text-align: right; }
/* Dot on the left of the trail → text to its right (toward center) */
.dm-node--l .dm-node-text { left: 58px; text-align: right; }

.dm-dot {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}
.dm-dot svg { width: 20px; height: 20px; }

/* Completed — solid premium dark dot + checkmark */
.dm-node--done .dm-dot {
  background: linear-gradient(160deg, #191b26, #0d0e14);
  border: 2px solid #0f1220;
  color: #b5ff4d;
  box-shadow: 0 10px 22px -10px rgba(15, 18, 32, 0.55);
}

/* Current — "you are here", pulsing glow */
.dm-node--current .dm-dot {
  background: linear-gradient(160deg, #17b558, #0f9d3e);
  border: 2px solid #ffffff;
  color: #ffffff;
  box-shadow: 0 0 0 0 rgba(15, 157, 62, 0.45);
  animation: dmPulse 1.8s ease-out infinite;
}
.dm-node--current .dm-dot::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
}
@keyframes dmPulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 157, 62, 0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(15, 157, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 62, 0); }
}

/* Locked / future — dimmed gray + lock */
.dm-node--locked .dm-dot {
  background: #eef0f5;
  border: 2px dashed rgba(15, 18, 30, 0.18);
  color: rgba(15, 18, 32, 0.35);
}
.dm-node--locked .dm-node-title,
.dm-node--locked .dm-node-sub { color: rgba(15, 18, 32, 0.38); }

/* Missed — the user skipped ahead on another metric; amber alert dot */
.dm-node--missed .dm-dot {
  background: rgba(255, 173, 51, 0.12);
  border: 2px dashed rgba(214, 130, 10, 0.55);
  color: #c47a06;
}
.dm-node--missed .dm-node-title { color: rgba(150, 96, 8, 0.9); }
.dm-node--missed .dm-node-sub { color: rgba(150, 96, 8, 0.6); }

/* Summit keeps the lock dimming but gets a flag icon */
.dm-node--summit .dm-dot { border-radius: 16px; }

.dm-node-text { min-width: 0; }
.dm-here {
  display: inline-block;
  font-family: var(--font-he);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0b7a30;
  background: rgba(15, 157, 62, 0.12);
  border: 1px solid rgba(15, 157, 62, 0.3);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  margin-bottom: 4px;
}
.dm-node-title {
  font-family: var(--font-he);
  font-size: 14.5px;
  font-weight: 800;
  color: #0f1220;
  margin: 0 0 2px;
  line-height: 1.3;
}
.dm-node-sub {
  font-family: var(--font-he);
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(15, 18, 32, 0.55);
  margin: 0;
  line-height: 1.35;
}

/* ═════════ NUTRITION SCREEN (תזונה) ═════════ */
.nutri-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  max-width: 412px;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.nutri-screen.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.ns-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 18px 200px;
}
.ns-scroll::-webkit-scrollbar { width: 0; }

/* Header */
.ns-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.ns-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f9d3e;
  margin-bottom: 4px;
}
.ns-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #0f1220;
  line-height: 1.05;
}
.ns-title span { color: #0f9d3e; }

/* Recipe library icon button — clean, minimal, sits beside the scanner */
.ns-lib-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(15, 18, 30, 0.1);
  background: #ffffff;
  color: #0f1220;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 18, 30, 0.06);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ns-lib-btn svg { width: 21px; height: 21px; }
.ns-lib-btn:hover { transform: translateY(-1px); border-color: #0f9d3e; box-shadow: 0 6px 16px rgba(15, 18, 30, 0.1); }
.ns-lib-btn:active { transform: scale(0.95); }

/* Weekly Sun–Sat navigation — pill look borrowed from the Home day strip */
.ns-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.nsw-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 54px;
  padding: 0;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.08);
  cursor: pointer;
  opacity: 0.7;
  font-family: inherit;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease, opacity 0.25s ease;
}
.nsw-pill:hover { opacity: 1; transform: translateY(-1px); }
.nsw-name {
  font-family: var(--font-en);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8f9e;
}
.nsw-num {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f1220;
}
.nsw-pill.is-active {
  opacity: 1;
  background: linear-gradient(135deg, #0f9d3e, #14b74a);
  border-color: transparent;
  box-shadow: 0 6px 14px -4px rgba(15, 157, 62, 0.45);
  transform: scale(1.08);
}
.nsw-pill.is-active .nsw-name,
.nsw-pill.is-active .nsw-num { color: #ffffff; }

/* Scanner teaser */
.ns-scanner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ns-scanner-btn {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #000000 !important; /* pure black — matches the MEAL title text */
  color: #b5ff4d;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  transition: transform 0.18s ease;
}
.ns-scanner-btn:hover { transform: scale(1.05); }
.ns-scanner-btn:active { transform: scale(0.95); }
.ns-scanner-icon { width: 30px; height: 30px; }
.ns-scanner-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  background: linear-gradient(135deg, #b5ff4d, #6fe06a);
  color: #0f1220;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 2.5px 6px;
  border-radius: 999px;
  border: 2px solid #f5f6fa;
}
.ns-scanner-lock {
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #000000;
  border: 2px solid #f5f6fa;
  display: grid;
  place-items: center;
  color: #b5ff4d; /* green — matches nutrition scheme */
  pointer-events: none;
}
.ns-scanner-lock svg { width: 11px; height: 11px; }
.ns-scanner-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #6a6f80;
}

/* Summary strip */
.ns-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-radius: 22px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.07);
}
.ns-sum-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.ns-sum-num {
  direction: ltr;
  font-size: 19px;
  font-weight: 900;
  color: #0f1220;
  font-variant-numeric: tabular-nums;
}
.ns-sum-lab { font-size: 11px; color: #6a6f80; font-weight: 600; }
.ns-sum-div { width: 1px; height: 30px; background: rgba(15, 18, 30, 0.08); }

/* Meal cards */
.ns-meals { display: flex; flex-direction: column; gap: 16px; }
.ns-meal {
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 30, 0.07);
  box-shadow: 0 8px 22px rgba(15, 18, 30, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.ns-meal.is-done {
  border-color: rgba(15, 157, 62, 0.45);
  box-shadow: 0 8px 22px rgba(15, 157, 62, 0.12);
}

/* Image placeholder — swap for a real <img> with object-fit:cover later */
.ns-meal { cursor: pointer; }
.ns-meal:active { transform: scale(0.99); }
.ns-meal-media {
  position: relative;
  height: 150px;
  display: grid;
  place-items: center;
  object-fit: cover;
}
/* Neutral fallback for meal types without a dedicated palette */
.ns-meal-media { background: linear-gradient(135deg, #e6ebf2, #cdd6e2); color: #4b5568; }
.ns-meal-media--breakfast { background: linear-gradient(135deg, #ffe9c7, #ffd08a); color: #b06a00; }
.ns-meal-media--lunch     { background: linear-gradient(135deg, #d9f4de, #a9e8b6); color: #0f7d34; }
.ns-meal-media--snack     { background: linear-gradient(135deg, #e9e4ff, #cfc4ff); color: #5b43c9; }
.ns-meal-media--dinner    { background: linear-gradient(135deg, #ffe1d6, #ffbfa8); color: #c0502a; }
.ns-meal--surplus { order: 999; border-color: rgba(249, 115, 22, .28); }
.ns-surplus-swipe {
  position: relative;
  order: 999;
  overflow: hidden;
  border-radius: 24px;
  touch-action: pan-y;
}
.ns-surplus-swipe .ns-meal--surplus {
  position: relative;
  z-index: 1;
  margin: 0;
  transition: transform .22s ease, border-color .25s ease, box-shadow .25s ease;
}
.ns-surplus-swipe.is-revealed .ns-meal--surplus { transform: translate3d(-92px, 0, 0); }
.ns-surplus-swipe .ns-meal--surplus.is-swiping { transition: none; }
.ns-surplus-delete {
  position: absolute;
  z-index: 0;
  inset-block: 0;
  right: 0;
  width: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 0;
  border-radius: 0 24px 24px 0;
  background: #dc2626;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.ns-surplus-delete span:first-child { font-size: 20px; }
.ns-meal--surplus .ns-meal-media { height: 112px; }
.ns-meal-media--surplus { background: linear-gradient(135deg, #fff3e8, #ffd2aa); color: #ea580c; }
.ns-surplus-badge {
  position: absolute;
  inset-inline-end: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: #ea580c;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(234, 88, 12, .16);
}
.ns-meal--surplus.is-cancelled { opacity: .72; border-style: dashed; }
.ns-meal--surplus.is-cancelled .ns-meal-media { filter: grayscale(.55); }
.ns-meal--surplus.is-cancelled .ns-complete {
  background: #f2f4f7;
  color: #5f6674;
  box-shadow: none;
}
.ns-meal-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ns-meal-media-icon { width: 46px; height: 46px; opacity: 0.85; }
.ns-meal-media-icon svg { width: 100%; height: 100%; }
.ns-meal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.ns-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  background: #f2f4f9;
  border: 1px solid rgba(15, 18, 30, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  color: #0f1220;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.ns-time-pill:hover { background: #e9edf5; border-color: rgba(15, 18, 30, 0.16); }
.ns-time-pill:active { transform: scale(0.97); }
.ns-time-clock { width: 13px; height: 13px; color: #0f9d3e; flex-shrink: 0; }
.ns-time-pill { position: relative; }
.ns-time-text {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f1220;
  font-variant-numeric: tabular-nums;
}
/* Invisible native time input overlays the pill — tap opens the OS picker,
   while the 24h text stays locale-independent */
.ns-time-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.ns-time-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ns-time-pill:focus-within {
  border-color: #0f9d3e;
  box-shadow: 0 0 0 3px rgba(15, 157, 62, 0.15);
}
/* Dual action row inside meal cards */
.ns-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 10px;
}
.ns-act {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease,
              background 0.2s ease, border-color 0.2s ease;
}
.ns-act:active { transform: scale(0.97); }
/* Swap meal — full-width ghost/outline */
.ns-act--swap {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid rgba(15, 18, 30, 0.14);
  color: #0f1220;
}
.ns-act--swap:hover {
  transform: translateY(-1px);
  border-color: #0f9d3e;
  background: #f4fbf6;
}
.ns-meal.is-done .ns-meal-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.35);
}

.ns-meal-body { padding: 14px 16px 16px; }
.ns-meal-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f9d3e;
  margin-bottom: 3px;
}
.ns-meal-name {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f1220;
  line-height: 1.3;
  margin-bottom: 11px;
}

/* Nutritional tags */
.ns-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.ns-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #3c4152;
  padding: 4.5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 18, 30, 0.08);
  background: #f7f8fb;
}
.ns-tag b { font-weight: 800; color: #0f1220; }
.ns-tag--kcal    { background: #fff4e2; border-color: #ffe1b0; }
.ns-tag--protein { background: #e9f8ee; border-color: #bfe9cd; }
.ns-tag--carbs   { background: #eef2ff; border-color: #ccd6ff; }
.ns-tag--fat     { background: #fdeeee; border-color: #f6cfcf; }

/* Empty plan */
.ns-empty {
  padding: 34px 20px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px dashed rgba(15, 18, 30, 0.16);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #6a6f80;
}

/* Complete button */
.ns-complete {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12.5px 16px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0f9d3e, #14b74a);
  box-shadow: 0 8px 18px rgba(15, 157, 62, 0.28);
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.25s ease;
}
.ns-complete:hover { transform: translateY(-1px); }
.ns-complete:active { transform: scale(0.97); }
.ns-complete-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.ns-complete-icon svg { width: 100%; height: 100%; }
.ns-meal.is-done .ns-complete {
  background: #eaf7ee;
  color: #0f9d3e;
  box-shadow: none;
}

/* Hidden overlays MUST not paint — display:grid/flex below would otherwise
   override the [hidden] UA rule, leaving an invisible full-screen layer that
   blocks all scrolling/taps on the Nutrition screen. */
.ns-modal[hidden],
.ns-video-modal[hidden],
.ns-sheet[hidden] { display: none; }

/* Recipe video modal — elegant overlay, 9:16 Shorts placeholder */
.ns-video-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
}
.ns-video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.ns-video-modal.is-open .ns-video-backdrop { opacity: 1; }
.ns-video-card {
  position: relative;
  width: min(340px, 100%);
  background: #ffffff;
  border-radius: 26px;
  padding: 22px 20px 20px;
  box-shadow: 0 30px 60px -18px rgba(10, 12, 20, 0.45);
  text-align: center;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease;
}
.ns-video-modal.is-open .ns-video-card { transform: none; opacity: 1; }
.ns-video-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #f1f2f6;
  color: #0f1220;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease;
}
.ns-video-close:hover { background: #e6e8ee; }
.ns-video-close:active { transform: scale(0.92); }
.ns-video-close svg { width: 15px; height: 15px; }
.ns-video-eyebrow {
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #0f9d3e;
  margin-bottom: 4px;
}
.ns-video-title {
  font-size: 17px;
  font-weight: 900;
  color: #0f1220;
  margin-bottom: 14px;
}

/* Custom exercise builder — header "+" button, modal form, "my exercises" */
.ws-add-custom {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--ink, #111);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.ws-add-custom:active { transform: scale(0.92); }
.ws-add-custom svg { width: 18px; height: 18px; }
/* Sit right next to the bank button (header row is LTR + space-between) */
.ws-header-top .ws-add-custom { margin-right: auto; margin-left: -2px; }
.eb-add-custom { margin-inline-start: auto; }

/* "+ הוסף תרגיל לאימון" — above the log button */
.ws-add-ex {
  position: relative;
  z-index: 31;
  pointer-events: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border: 1.5px dashed var(--border, #ddd);
  border-radius: var(--r-lg, 16px);
  background: var(--bg-0, #fff);
  color: var(--ink, #111);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ws-add-ex:active { transform: scale(0.98); }
.ws-add-ex svg { width: 16px; height: 16px; }

/* Per-card swap button (⇄) */
.ws-ex-swap {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border, #ddd);
  border-radius: 50%;
  background: var(--bg-0, #fff);
  color: var(--ink-2, #555);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ws-ex-swap:active { transform: scale(0.9); }
.ws-ex-swap svg { width: 14px; height: 14px; }

/* Exercise swap / add modal */
.exsw-tabs[hidden],
.exsw-search[hidden],
.exsw-list[hidden],
.exsw-sets[hidden] { display: none; }
.exsw-card {
  width: min(420px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.exsw-sub {
  margin: 4px 0 12px;
  font-size: 13.5px;
  color: var(--ink-2, #666);
}
.exsw-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: var(--r-pill, 999px);
  background: var(--bg-1, #f4f4f4);
}
.exsw-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-pill, 999px);
  background: transparent;
  color: var(--ink-2, #666);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.exsw-tab.is-active {
  background: var(--ink, #111);
  color: #fff;
}
.exsw-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border: 1.5px solid var(--border, #ddd);
  border-radius: var(--r-md, 12px);
  background: var(--bg-0, #fff);
}
.exsw-search svg { width: 16px; height: 16px; color: var(--ink-2, #888); flex: 0 0 auto; }
.exsw-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink, #111);
}
.exsw-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}
.exsw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1.5px solid var(--border, #e5e5e5);
  border-radius: var(--r-md, 12px);
  background: var(--bg-0, #fff);
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.exsw-row:active { transform: scale(0.985); }
.exsw-row-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm, 10px);
  background: var(--bg-1, #f4f4f4);
  overflow: hidden;
}
.exsw-row-img { width: 100%; height: 100%; object-fit: cover; }
.exsw-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.exsw-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #111);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exsw-row-chips { display: flex; gap: 5px; }
.exsw-loading,
.exsw-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 10px;
  font-size: 13.5px;
  color: var(--ink-2, #777);
  text-align: center;
}
/* Sets-count step (add mode) */
.exsw-sets { padding: 6px 0 2px; text-align: center; }
.exsw-sets-label { margin: 0 0 4px; font-size: 13px; color: var(--ink-2, #777); }
.exsw-chosen { margin: 0 0 14px; font-size: 15.5px; font-weight: 800; color: var(--ink, #111); }
.exsw-sets-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.exsw-step-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border, #ddd);
  border-radius: 50%;
  background: var(--bg-0, #fff);
  color: var(--ink, #111);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.exsw-sets-input {
  width: 64px;
  padding: 9px 0;
  border: 1.5px solid var(--border, #ddd);
  border-radius: var(--r-md, 12px);
  background: var(--bg-0, #fff);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  color: var(--ink, #111);
  -moz-appearance: textfield;
}
.exsw-sets-input::-webkit-outer-spin-button,
.exsw-sets-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.exsw-sets-actions { display: flex; flex-direction: column; gap: 8px; }
.exsw-confirm {
  padding: 13px 16px;
  border: none;
  border-radius: var(--r-md, 12px);
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.exsw-back {
  padding: 11px 16px;
  border: 1.5px solid var(--border, #ddd);
  border-radius: var(--r-md, 12px);
  background: var(--bg-0, #fff);
  color: var(--ink-2, #555);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ce-card {
  width: min(400px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  text-align: right;
}
.ce-label {
  display: block;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin: 12px 0 6px;
}
.ce-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(15, 18, 30, 0.12);
  border-radius: 14px;
  background: #fff;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 14px;
  color: #0f1220;
}
.ce-input:focus { outline: none; border-color: #22c55e; }
.ce-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ce-chip {
  padding: 8px 14px;
  border: 1.5px solid rgba(15, 18, 30, 0.1);
  border-radius: 999px;
  background: #fff;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ce-chip.is-active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: transparent;
  color: #fff;
}
.ce-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ce-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1.5px dashed rgba(15, 18, 30, 0.25);
  border-radius: 14px;
  background: rgba(15, 18, 30, 0.03);
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
}
.ce-photo-btn svg { width: 20px; height: 20px; }
.ce-photo-preview {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid rgba(15, 18, 30, 0.1);
}
.ce-save-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: #0f1220;
  color: #fff;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.ce-save-btn:active { transform: scale(0.98); }

.eb-custom { padding: 0 16px 4px; }
.eb-custom-title {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #0f1220;
  margin: 4px 0 8px;
}
.eb-custom-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ce-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(15, 18, 30, 0.08);
  border-radius: 14px;
  background: #fff;
}
.ce-item-photo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  object-fit: cover;
}
.ce-item-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 30, 0.05);
  color: #999;
}
.ce-item-photo--empty svg { width: 20px; height: 20px; }
.ce-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ce-item-name {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f1220;
}
.ce-item-meta {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 11.5px;
  color: #888;
}
.ce-item-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
}

/* Smart idle alert modal */
.idle-card {
  width: min(380px, 100%);
  text-align: right;
}
.idle-sub {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 13.5px;
  color: #555;
  line-height: 1.55;
  margin: -4px 0 14px;
}
.idle-alt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.09), rgba(72, 202, 228, 0.09));
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.idle-alt-name {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0f1220;
}
.idle-alt-note {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  color: #666;
  line-height: 1.5;
}
.idle-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.idle-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 14px;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.idle-btn:active { transform: scale(0.96); }
.idle-btn--swap {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(22, 163, 74, 0.5);
}
.idle-btn--dismiss {
  background: rgba(15, 18, 30, 0.06);
  color: #0f1220;
}
.idle-disable {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: #666;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  cursor: pointer;
}
.idle-disable input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #111;
}

/* Smart meal swap modal — list of valid replacements */
.ns-swap-card {
  width: min(400px, 100%);
  max-height: 86vh;
  overflow-y: auto;
}
.ns-swap-sub {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  color: #666;
  margin: -6px 0 12px;
}
.ns-swap-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ns-swap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(15, 18, 30, 0.08);
  border-radius: 16px;
  background: #fff;
  text-align: right;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ns-swap-item:hover,
.ns-swap-item:focus-visible {
  border-color: #22c55e;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.16);
  transform: translateY(-1px);
}
.ns-swap-img {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  object-fit: cover;
}
.ns-swap-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ns-swap-name {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #0f1220;
}
.ns-swap-macros {
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 11.5px;
  color: #777;
}
.ns-swap-cancel {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: rgba(15, 18, 30, 0.06);
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0f1220;
  cursor: pointer;
}
.ns-swap-cancel:hover { background: rgba(15, 18, 30, 0.1); }

/* Recipe Library modal — filter chips + dummy recipe grid */
.ns-lib-card {
  width: min(400px, 100%);
  max-height: 86vh;
  overflow-y: auto;
}
.ns-lib-seg {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 10px;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(15, 18, 30, 0.06);
}
.ns-seg-btn {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #565b6b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.ns-seg-btn:active { transform: scale(0.95); }
.ns-seg-btn.is-active {
  background: linear-gradient(135deg, #0f9d3e, #14b74a);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 157, 62, 0.28);
}
.ns-lib-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.ns-lib-chips::-webkit-scrollbar { display: none; }
.ns-chip {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 18, 30, 0.12);
  background: #ffffff;
  color: #0f1220;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.2s ease,
              border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.ns-chip:hover { border-color: #0f9d3e; }
.ns-chip:active { transform: scale(0.95); }
.ns-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #0f9d3e, #14b74a);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 157, 62, 0.28);
}
.ns-lib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ns-lib-recipe {
  border-radius: 18px;
  overflow: hidden;
  background: #f7f8fb;
  border: 1px solid rgba(15, 18, 30, 0.06);
  text-align: start;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.ns-lib-recipe:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,18,30,.12); }
.ns-lib-recipe:active { transform: scale(.98); }
.ns-lib-recipe:focus-visible { outline: 3px solid #16a34a; outline-offset: 3px; }
.ns-lib-recipe-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(140deg, #e8f7ee, #d7efe0);
}
.ns-lib-recipe-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ns-lib-recipe-body { padding: 10px 12px 12px; }
.ns-lib-recipe-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 157, 62, 0.1);
  color: #0f9d3e;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 6px;
}
.ns-lib-recipe-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f1220;
  line-height: 1.35;
  margin-bottom: 4px;
}
.ns-lib-recipe-kcal {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}
.ns-lib-recipe-kcal b { color: #0f1220; }
.ns-lib-empty {
  grid-column: 1 / -1;
  padding: 26px 10px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #6b7280;
}

/* Premium modal */
.ns-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.ns-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 22, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.ns-modal-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: linear-gradient(160deg, #12162a, #1c2240);
  border: 1px solid rgba(181, 255, 77, 0.22);
  border-radius: 26px;
  padding: 30px 24px 24px;
  text-align: center;
  color: #fff;
  overflow: hidden;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.32, 0, 0.18, 1), opacity 0.24s ease;
}
.ns-modal.is-open .ns-modal-backdrop { opacity: 1; }
.ns-modal.is-open .ns-modal-card { transform: translateY(0) scale(1); opacity: 1; }
.ns-modal-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 140px;
  background: radial-gradient(closest-side, rgba(181, 255, 77, 0.35), transparent);
  pointer-events: none;
}
.ns-modal-lock {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(181, 255, 77, 0.12);
  border: 1px solid rgba(181, 255, 77, 0.3);
  color: #b5ff4d;
}
.ns-modal-lock svg { width: 24px; height: 24px; }
.ns-modal-eyebrow {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #b5ff4d;
  margin-bottom: 7px;
}
.ns-modal-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.ns-modal-sub {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 18px;
}
.ns-modal-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  color: #0f1220;
  background: linear-gradient(135deg, #b5ff4d, #6fe06a);
  transition: transform 0.16s ease;
}
.ns-modal-btn:hover { transform: translateY(-1px); }
.ns-modal-btn:active { transform: scale(0.97); }


/* Ingredient detail bottom sheet */
.ns-sheet {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ns-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 22, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.ns-sheet-card {
  position: relative;
  width: 100%;
  max-width: 412px;
  max-height: 82vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0, 0.18, 1);
  box-shadow: 0 -18px 44px rgba(15, 18, 30, 0.22);
}
.ns-sheet.is-open .ns-sheet-backdrop { opacity: 1; }
.ns-sheet.is-open .ns-sheet-card { transform: translateY(0); }
.ns-sheet-grip {
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 18, 30, 0.14);
  margin: 0 auto 14px;
}
.ns-sheet-media {
  height: 148px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #e6ebf2, #cdd6e2);
}
.ns-sheet-media:empty { display: none; }
.ns-sheet-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ns-sheet-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f9d3e;
  margin-bottom: 3px;
}
.ns-sheet-name {
  font-size: 19px;
  font-weight: 900;
  color: #0f1220;
  line-height: 1.25;
  margin-bottom: 11px;
}
.ns-sheet-tags { margin-bottom: 16px; }
.ns-sheet-sub {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #6a6f80;
  margin-bottom: 9px;
}
.ns-sheet-ings {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ns-ing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}
.ns-ing-name { font-weight: 700; color: #0f1220; }
.ns-ing-dots {
  flex: 1;
  border-bottom: 2px dotted rgba(15, 18, 30, 0.14);
  transform: translateY(-3px);
}
.ns-ing-amount {
  font-weight: 800;
  color: #0f9d3e;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ns-ing--empty { color: #6a6f80; font-weight: 600; }
.ns-sheet-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  background: #0f1220;
  transition: transform 0.16s ease;
}
.ns-sheet-btn:active { transform: scale(0.97); }


/* Preparation (recipe) section inside the meal sheet */
.ns-sheet-prep { margin-bottom: 18px; }
.ns-prep-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 11px;
}
.ns-prep-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #0f1220;
  background: #f2f4f9;
  border: 1px solid rgba(15, 18, 30, 0.07);
  padding: 5px 10px;
  border-radius: 999px;
}
.ns-prep-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: prep;
}
.ns-prep-steps li {
  counter-increment: prep;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.55;
  color: #2a2f3f;
}
.ns-prep-steps li::before {
  content: counter(prep);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f1220;
  color: #b5ff4d;
  font-size: 11.5px;
  font-weight: 900;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

/* ═══ Exercise camera fallback (custom exercise builder) ═══ */
.ce-photo-btn--alt {
  background: #fff;
  color: #111;
  border: 1.5px dashed rgba(0, 0, 0, 0.28);
}
.ce-photo-btn--alt:hover { border-color: #000; }

/* ═══ Per-exercise "add note" button + saved note line ═══ */
.ws-set-note {
  border: 1.5px dashed rgba(0, 0, 0, 0.22);
  background: transparent;
  color: rgba(0, 0, 0, 0.62);
}
.ws-set-note:hover { border-color: #000; color: #000; background: rgba(0, 0, 0, 0.04); }
.ws-ex-usernote {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.62);
  background: rgba(255, 200, 40, 0.14);
  border-inline-start: 3px solid rgba(255, 180, 20, 0.75);
  border-radius: 8px;
  padding: 6px 9px;
  word-break: break-word;
}

/* ═══ Personal note modal ═══ */
.exnote-card { max-width: 380px; }
.exnote-sub {
  margin: 2px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.55);
}
.exnote-input {
  width: 100%;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 74px;
  background: rgba(0, 0, 0, 0.03);
}
.exnote-input:focus { outline: none; border-color: #000; background: #fff; }
.exnote-actions { display: flex; gap: 10px; margin-top: 14px; }
.exnote-save {
  flex: 1;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.exnote-save:active { transform: scale(0.98); }
.exnote-delete {
  background: transparent;
  border: 1.5px solid rgba(200, 40, 40, 0.4);
  color: #c22;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ═══ Weekly panel — exercise history & trends ═══ */
.wk-exh-block { margin-bottom: 8px; }
.wk-exh-select-wrap {
  position: relative;
  margin: 10px 0 12px;
}
.wk-exh-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  background: #fff;
  padding: 11px 14px;
  padding-inline-end: 38px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.wk-exh-select:focus { outline: none; border-color: #000; }
.wk-exh-caret {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  color: rgba(0, 0, 0, 0.5);
}
.wk-exh-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wk-exh-stat {
  background: rgba(0, 0, 0, 0.035);
  border-radius: 14px;
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.wk-exh-stat--pr { background: rgba(255, 200, 40, 0.16); }
.wk-exh-stat-label { font-size: 10.5px; font-weight: 700; color: rgba(0, 0, 0, 0.5); }
.wk-exh-stat-val { font-size: 14.5px; font-weight: 900; color: #000; }
.wk-exh-stat-sub { font-size: 10px; color: rgba(0, 0, 0, 0.42); }
.wk-exh-spark {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 12px;
}
.wk-exh-spark-line { fill: none; stroke: #000; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wk-exh-spark-fill { fill: rgba(0, 0, 0, 0.06); stroke: none; }
.wk-exh-spark-dot { fill: #000; }
.wk-exh-note, .wk-exh-empty {
  margin: 10px 0 2px;
  font-size: 12.5px;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ═══ Premium exercise-history trend chart + session log ═══ */
.wk-exh-spark { height: 96px; margin-top: 14px; }
.wk-exh-axis {
  font-size: 9.5px;
  font-weight: 700;
  fill: rgba(0, 0, 0, 0.38);
  text-anchor: middle;
  font-family: inherit;
}
.wk-exh-pt--up { fill: #0e9f6e; }
.wk-exh-pt--down { fill: #c81e2b; }
.wk-exh-dot--up { fill: #16c784; stroke: #fff; stroke-width: 1.6; }
.wk-exh-dot--down { fill: #ea3943; stroke: #fff; stroke-width: 1.6; }
.wk-exh-dot-glow--up { fill: rgba(22, 199, 132, 0.22); }
.wk-exh-dot-glow--down { fill: rgba(234, 57, 67, 0.22); }
.wk-exh-log {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.wk-exh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12.5px;
}
.wk-exh-row:last-child { border-bottom: none; }
.wk-exh-row--pr { background: rgba(255, 200, 40, 0.12); border-radius: 10px; padding-inline: 8px; }
.wk-exh-row-date { color: rgba(0, 0, 0, 0.45); font-weight: 700; min-width: 58px; font-variant-numeric: tabular-nums; }
.wk-exh-row-val { font-weight: 900; color: #000; flex: 1; }
.wk-exh-delta {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.wk-exh-delta--up { background: rgba(22, 199, 132, 0.14); color: #0b7d57; }
.wk-exh-delta--down { background: rgba(234, 57, 67, 0.12); color: #c81e2b; }
.wk-exh-delta--flat { background: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.5); }

/* ═══ AI Food Scanner & Barcode Tracker ═══ */
.fs-card { max-width: 420px; width: calc(100% - 28px); max-height: 88vh; overflow-y: auto; padding-bottom: 22px; }
.fs-tabs {
  display: flex; gap: 6px; margin: 14px 0 16px;
  background: rgba(0, 0, 0, 0.06); border-radius: 999px; padding: 4px;
}
.fs-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800; color: rgba(0, 0, 0, 0.5);
  padding: 9px 6px; border-radius: 999px; transition: all 0.2s;
}
.fs-tab.is-active { background: #101418; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }

/* camera viewport */
.fs-viewport {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(135deg, #0d1117, #1c2530);
  min-height: 260px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 18px;
}
.fs-corner { position: absolute; width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, 0.75); }
.fs-corner--tl { top: 14px; right: auto; left: 14px; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.fs-corner--tr { top: 14px; right: 14px; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.fs-corner--bl { bottom: 14px; left: 14px; border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.fs-corner--br { bottom: 14px; right: 14px; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }
.fs-laser {
  position: absolute; left: 8%; right: 8%; height: 2.5px; top: 20%;
  background: linear-gradient(90deg, transparent, #16c784 30%, #7dffd0 50%, #16c784 70%, transparent);
  box-shadow: 0 0 14px rgba(22, 199, 132, 0.85);
  animation: fsLaser 2.4s ease-in-out infinite; border-radius: 999px;
}
.fs-laser--fast { animation-duration: 1s; }
@keyframes fsLaser { 0%, 100% { top: 14%; } 50% { top: 82%; } }
.fs-viewport-hint { color: rgba(255, 255, 255, 0.65); font-size: 12.5px; font-weight: 700; margin: 0 0 12px; }
.fs-capture-row { display: flex; gap: 8px; width: 100%; }
.fs-capture-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: #16c784; color: #04150d; border-radius: 14px; padding: 12px 10px;
  font-size: 14px; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 18px rgba(22, 199, 132, 0.35);
}
.fs-capture-btn svg { width: 18px; height: 18px; }
.fs-capture-btn--alt { flex: 0 0 auto; background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; padding-inline: 14px; }

/* scanning state */
.fs-scanning { text-align: center; }
.fs-scan-photo-wrap { position: relative; border-radius: 20px; overflow: hidden; }
.fs-scan-photo-wrap img { display: block; width: 100%; aspect-ratio: 1 / 0.82; object-fit: cover; filter: saturate(1.05); }
.fs-scan-status { font-size: 14.5px; font-weight: 800; margin: 14px 0 4px; animation: fsPulse 1.1s ease-in-out infinite; }
@keyframes fsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* result */
.fs-photo-wrap { position: relative; border-radius: 20px; overflow: hidden; }
.fs-photo-wrap img { display: block; width: 100%; aspect-ratio: 1 / 0.82; object-fit: cover; }
.fs-badge {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10, 14, 18, 0.82); color: #fff; backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.fs-badge b { color: #7dffd0; }
.fs-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #16c784; box-shadow: 0 0 8px #16c784; }
.fs-conf-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.fs-conf-badge {
  display: inline-block; background: rgba(22, 199, 132, 0.13); color: #0b7d57;
  font-size: 12px; font-weight: 900; padding: 6px 12px; border-radius: 999px;
}
.fs-conf-badge--sm { font-size: 11px; padding: 4px 10px; }
.fs-rescan { border: none; background: transparent; font: inherit; font-size: 12.5px; font-weight: 800; color: rgba(0, 0, 0, 0.45); cursor: pointer; text-decoration: underline; }

/* itemized breakdown + sliders */
.fs-items { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.fs-item { background: rgba(0, 0, 0, 0.045); border-radius: 16px; padding: 11px 14px 8px; }
.fs-item-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.fs-item-name { font-weight: 900; }
.fs-item-meta { font-size: 12px; color: rgba(0, 0, 0, 0.5); font-variant-numeric: tabular-nums; }
.fs-item-meta b { color: #0b7d57; }
.fs-slider { width: 100%; accent-color: #16c784; height: 26px; cursor: pointer; }

/* totals */
.fs-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.fs-total { border-radius: 14px; padding: 9px 4px; text-align: center; background: rgba(0, 0, 0, 0.045); }
.fs-total-val { display: block; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.fs-total-val small { font-size: 10px; font-weight: 800; margin-inline-start: 1px; }
.fs-total-label { font-size: 10px; font-weight: 700; color: rgba(0, 0, 0, 0.45); }
.fs-total--kcal { background: rgba(22, 199, 132, 0.13); }
.fs-total--kcal .fs-total-val { color: #0b7d57; }

/* meal slot selector */
.fs-slots { display: flex; gap: 6px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; scrollbar-width: none; }
.fs-slot {
  flex: 0 0 auto; border: 1.5px solid rgba(0, 0, 0, 0.12); background: #fff;
  font: inherit; font-size: 12px; font-weight: 800; color: rgba(0, 0, 0, 0.55);
  padding: 8px 13px; border-radius: 999px; cursor: pointer; transition: all 0.15s;
}
.fs-slot.is-active { background: #101418; border-color: #101418; color: #fff; }

.fs-log-btn {
  width: 100%; margin-top: 14px; border: none; cursor: pointer;
  background: #101418; color: #fff; font: inherit; font-size: 15px; font-weight: 900;
  padding: 15px; border-radius: 16px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.fs-log-btn:active { transform: scale(0.98); }

/* barcode tab */
.fs-bc-frame {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, #0d1117, #1c2530);
  min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.fs-bc-icon { width: 84px; height: 84px; color: rgba(255, 255, 255, 0.35); }
.fs-bc-line {
  position: absolute; left: 12%; right: 12%; height: 2.5px; top: 50%;
  background: linear-gradient(90deg, transparent, #ea3943 25%, #ff8a90 50%, #ea3943 75%, transparent);
  box-shadow: 0 0 14px rgba(234, 57, 67, 0.9); border-radius: 999px;
  animation: fsLaser 2s ease-in-out infinite;
}
.fs-bc-frame.is-scanning .fs-bc-line { animation-duration: 0.7s; }
.fs-bc-hint { color: rgba(255, 255, 255, 0.7); font-size: 13px; font-weight: 800; margin: 0; }
.fs-bc-result { margin-top: 4px; }
.fs-bc-product {
  display: flex; align-items: center; gap: 12px;
  background: rgba(0, 0, 0, 0.045); border-radius: 18px; padding: 14px;
}
.fs-bc-emoji { font-size: 30px; }
.fs-bc-info { flex: 1; min-width: 0; }
.fs-bc-name { font-size: 14px; font-weight: 900; margin: 0 0 3px; }
.fs-bc-macros { font-size: 12px; color: rgba(0, 0, 0, 0.55); margin: 0; font-variant-numeric: tabular-nums; }
/* attribute `hidden` must beat the display rules above */
.fs-modal [hidden] { display: none !important; }

/* RTL-safe item meta: grams and kcal are atomic spans in a flex row,
   separated by a bullet — no word-breaking between number and unit */
.fs-item-meta { display: flex; align-items: center; gap: 6px; direction: ltr; }
.fs-item-meta .fs-item-grams,
.fs-item-meta .fs-item-kcal { white-space: nowrap; }
.fs-item-grams { color: #0b7d57; }
.fs-item-sep { color: rgba(0, 0, 0, 0.3); }

/* ═══ AI Coach onboarding flow ═══ */
.ob-card { max-width: 420px; width: calc(100% - 28px); max-height: 90vh; overflow-y: auto; padding-bottom: 20px; display: flex; flex-direction: column; }
.ob-progress { height: 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); margin: 6px 0 14px; overflow: hidden; }
.ob-progress-fill { display: block; height: 100%; width: 11%; border-radius: 999px; background: linear-gradient(90deg, #16c784, #7dffd0); transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.ob-title { font-size: 21px; font-weight: 900; margin: 4px 0 4px; }
.ob-sub { font-size: 13px; color: rgba(0, 0, 0, 0.5); font-weight: 600; margin: 0 0 16px; }

/* selectable cards */
.ob-cards { display: flex; flex-direction: column; gap: 10px; }
.ob-choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 2px solid rgba(0, 0, 0, 0.09); border-radius: 18px; background: #fff;
  font: inherit; font-size: 15px; font-weight: 800; padding: 15px 16px; cursor: pointer;
  transition: all 0.15s; text-align: start;
}
.ob-choice.is-active { border-color: #101418; background: #101418; color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.ob-choice-ic { font-size: 20px; width: 30px; text-align: center; flex: 0 0 auto; }
.ob-choice-ic--down { color: #16c784; font-weight: 900; }
.ob-choice-ic--up { color: #ea3943; font-weight: 900; }
.ob-choice-ic--flat { color: rgba(0, 0, 0, 0.4); font-weight: 900; }
.ob-choice.is-active .ob-choice-ic--down, .ob-choice.is-active .ob-choice-ic--up, .ob-choice.is-active .ob-choice-ic--flat { color: #7dffd0; }

/* scroll wheels */
.ob-wheels { position: relative; display: flex; gap: 8px; justify-content: center; }
.ob-wheels--single .ob-wheel-col { flex: 0 0 60%; }
.ob-wheel-col { flex: 1; min-width: 0; text-align: center; }
.ob-wheel-label { font-size: 11px; font-weight: 800; color: rgba(0, 0, 0, 0.4); margin: 0 0 6px; }
.ob-wheel {
  height: 180px; overflow-y: auto; scroll-snap-type: y mandatory;
  padding: 72px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
.ob-wheel::-webkit-scrollbar { display: none; }
.ob-wheel-item {
  height: 36px; line-height: 36px; scroll-snap-align: center;
  font-size: 16px; font-weight: 700; color: rgba(0, 0, 0, 0.35);
  transition: color 0.15s, transform 0.15s; font-variant-numeric: tabular-nums;
}
.ob-wheel-item.is-sel { color: #000; font-weight: 900; transform: scale(1.12); }
.ob-wheel-highlight {
  position: absolute; left: 0; right: 0; top: 50%; height: 40px; margin-top: -6px;
  transform: translateY(-50%); pointer-events: none;
  border-top: 1.5px solid rgba(22, 199, 132, 0.55); border-bottom: 1.5px solid rgba(22, 199, 132, 0.55);
  background: rgba(22, 199, 132, 0.06); border-radius: 10px;
}
.ob-wheels .ob-wheel-highlight { margin-top: 6px; }
.ob-wheels--single .ob-wheel-highlight { margin-top: -8px; }

/* weight ruler */
.ob-weight-readout { text-align: center; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.ob-weight-readout b { font-size: 44px; font-weight: 900; letter-spacing: -1px; }
.ob-weight-readout small { font-size: 15px; font-weight: 800; color: rgba(0, 0, 0, 0.45); margin-inline-start: 5px; }
.ob-ruler-wrap { position: relative; }
.ob-ruler-needle {
  position: absolute; top: -6px; bottom: 10px; left: 50%; width: 3px; margin-left: -1.5px;
  background: #16c784; border-radius: 999px; z-index: 2; pointer-events: none;
  box-shadow: 0 0 10px rgba(22, 199, 132, 0.6);
}
.ob-ruler-needle::after { content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #16c784; }
.ob-ruler {
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 14px 50%; cursor: grab;
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
}
.ob-ruler::-webkit-scrollbar { display: none; }
.ob-ruler-track { display: flex; height: 62px; align-items: flex-start; }
.ob-tick { position: relative; flex: 0 0 12px; height: 26px; }
.ob-tick::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 18px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.ob-tick--big::before { height: 30px; width: 2.5px; background: rgba(0, 0, 0, 0.45); }
.ob-tick i { position: absolute; top: 38px; left: 1px; transform: translateX(-50%); font-style: normal; font-size: 12px; font-weight: 800; color: rgba(0, 0, 0, 0.5); font-variant-numeric: tabular-nums; }

/* ecosystem sync */
.ob-sync-anim { position: relative; width: 120px; height: 120px; margin: 10px auto 18px; display: grid; place-items: center; }
.ob-sync-core { font-size: 44px; z-index: 1; }
.ob-sync-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(22, 199, 132, 0.5); animation: obRing 2.4s ease-out infinite; }
.ob-sync-ring--2 { animation-delay: 1.2s; }
.ob-sync-anim.is-syncing .ob-sync-ring { animation-duration: 0.9s; border-color: rgba(22, 199, 132, 0.8); }
.ob-sync-anim.is-syncing .ob-sync-ring--2 { animation-delay: 0.45s; }
@keyframes obRing { 0% { transform: scale(0.55); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.ob-sync-btns { display: flex; gap: 8px; }
.ob-sync-btn {
  flex: 1; border: 2px solid rgba(0, 0, 0, 0.1); background: #fff; border-radius: 16px;
  font: inherit; font-size: 13.5px; font-weight: 800; padding: 13px 8px; cursor: pointer; transition: all 0.15s;
}
.ob-sync-btn.is-connected { border-color: #16c784; background: rgba(22, 199, 132, 0.1); color: #0b7d57; }
.ob-sync-btn:disabled { opacity: 0.55; cursor: default; }
.ob-sync-status { text-align: center; font-size: 13px; font-weight: 800; color: #0b7d57; min-height: 18px; margin: 12px 0 0; }

/* medical firewall */
.ob-med-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ob-med-chip {
  border: 2px solid rgba(0, 0, 0, 0.09); background: #fff; border-radius: 14px;
  font: inherit; font-size: 13px; font-weight: 800; padding: 12px 8px; cursor: pointer; transition: all 0.15s;
}
.ob-med-chip.is-active { border-color: #101418; background: #101418; color: #fff; }
.ob-med-chip--none { grid-column: 1 / -1; }
.ob-med-chip--none.is-active { border-color: #16c784; background: rgba(22, 199, 132, 0.12); color: #0b7d57; }
.ob-med-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13.5px; font-weight: 800; }
.ob-switch { position: relative; display: inline-block; flex: 0 0 auto; }
.ob-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ob-switch-track { display: block; width: 46px; height: 27px; border-radius: 999px; background: rgba(0, 0, 0, 0.15); transition: background 0.2s; position: relative; pointer-events: none; }
.ob-switch-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.ob-switch input:checked + .ob-switch-track { background: #16c784; }
.ob-switch input:checked + .ob-switch-track::after { transform: translateX(-19px); }
.ob-firewall { margin-top: 14px; border: 1.5px solid rgba(234, 57, 67, 0.4); background: rgba(234, 57, 67, 0.07); border-radius: 16px; padding: 14px; }
.ob-firewall-title { font-size: 13.5px; font-weight: 900; color: #c81e2b; margin: 0 0 6px; }
.ob-firewall-text { font-size: 12.5px; font-weight: 600; color: rgba(0, 0, 0, 0.65); line-height: 1.5; margin: 0 0 10px; }
.ob-firewall-agree { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; font-weight: 900; cursor: pointer; }
.ob-firewall-agree input { width: 19px; height: 19px; accent-color: #c81e2b; flex: 0 0 auto; margin-top: 1px; cursor: pointer; }

/* summary + loading */
.ob-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-sum-chip { background: rgba(0, 0, 0, 0.05); border-radius: 999px; padding: 8px 13px; font-size: 12.5px; font-weight: 800; }
.ob-loading { text-align: center; padding: 30px 0 20px; }
.ob-loading-chart { width: 200px; height: 100px; }
.ob-loading-line { stroke: #16c784; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: obDraw 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.ob-loading-area { opacity: 0; animation: obFade 0.8s 1s forwards; }
.ob-loading-dot { fill: #16c784; opacity: 0; animation: obFade 0.4s 1.7s forwards; filter: drop-shadow(0 0 6px rgba(22, 199, 132, 0.9)); }
@keyframes obDraw { to { stroke-dashoffset: 0; } }
@keyframes obFade { to { opacity: 1; } }
.ob-loading-text { font-size: 14px; font-weight: 800; margin-top: 14px; animation: fsPulse 1.1s ease-in-out infinite; }

/* footer */
.ob-footer { display: flex; gap: 10px; margin-top: 18px; }
.ob-back { border: none; background: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.6); font: inherit; font-size: 14px; font-weight: 800; padding: 14px 20px; border-radius: 16px; cursor: pointer; flex: 0 0 auto; }
.ob-preview-skip { border: 1px solid rgba(16, 20, 24, 0.14); background: #fff; color: rgba(16, 20, 24, 0.7); font: inherit; font-size: 13px; font-weight: 800; padding: 14px 13px; border-radius: 16px; cursor: pointer; flex: 0 0 auto; }
.ob-preview-skip:active { transform: scale(0.98); }
.ob-next { flex: 1; border: none; background: #101418; color: #fff; font: inherit; font-size: 15px; font-weight: 900; padding: 15px; border-radius: 16px; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); transition: opacity 0.15s; }
.ob-next:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.ob-next:not(:disabled):active { transform: scale(0.98); }
.ob-modal [hidden] { display: none !important; }

/* ═══ External Coach — manual plan ═══ */
.tc-open-btn {
  width: 100%; margin-top: 14px; border: 1.5px dashed rgba(0, 0, 0, 0.18); background: transparent;
  border-radius: 14px; font: inherit; font-size: 13px; font-weight: 800; color: rgba(0, 0, 0, 0.55);
  padding: 11px; cursor: pointer; transition: all 0.15s;
}
.tc-open-btn:hover { border-color: #16c784; color: #0b7d57; background: rgba(22, 199, 132, 0.05); }
.tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tc-field { display: flex; flex-direction: column; gap: 6px; }
.tc-field--wide { grid-column: 1 / -1; }
.tc-label { font-size: 12px; font-weight: 800; color: rgba(0, 0, 0, 0.5); }
.tc-field input {
  width: 100%; border: 2px solid rgba(0, 0, 0, 0.09); border-radius: 14px; background: #fff;
  font: inherit; font-size: 17px; font-weight: 900; padding: 12px 14px; text-align: center;
  font-variant-numeric: tabular-nums; transition: border-color 0.15s; -moz-appearance: textfield;
}
.tc-field input::-webkit-outer-spin-button, .tc-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tc-field input:focus { outline: none; border-color: #16c784; }
.tc-err { font-size: 12.5px; font-weight: 800; color: #c81e2b; margin: 10px 2px 0; }
.tc-save { width: 100%; margin-top: 16px; }

/* ═══ AI Coach chat — Jake ═══ */
.coach-screen {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: #f5f6fa; max-width: 412px; margin: 0 auto;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.coach-screen.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.cc-header {
  display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px;
  background: rgba(245, 246, 250, 0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06); position: sticky; top: 0; z-index: 2;
}
.cc-avatar {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #101418 0%, #1c2733 55%, #16c784 220%); display: grid; place-items: center;
  color: #7dffd0; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), inset 0 0 0 1.5px rgba(125, 255, 208, 0.18);
}
.cc-avatar svg { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(125, 255, 208, 0.45)); }
.cc-avatar-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid rgba(22, 199, 132, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
/* attachment ready — paperclip turns brand green */
.cc-ib-btn.cc-attach-ready { color: #16c784; }
.cc-ib-btn.cc-attach-ready svg { filter: drop-shadow(0 0 5px rgba(22, 199, 132, 0.4)); }
/* recording — mic turns red and pulses */
.cc-ib-btn.cc-rec { color: #e53935; }
.cc-ib-btn.cc-rec svg { animation: ccRecPulse 1.1s ease-in-out infinite; }
@keyframes ccRecPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(229, 57, 53, 0)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 8px rgba(229, 57, 53, 0.55)); }
}
.cc-send:disabled { opacity: 0.45; pointer-events: none; }
.cc-online-dot { position: absolute; bottom: 1px; inset-inline-start: 1px; width: 11px; height: 11px; border-radius: 50%; background: #16c784; border: 2px solid #f5f6fa; }
.cc-name { font-size: 15.5px; font-weight: 900; margin: 0; }
.cc-status { font-size: 11.5px; font-weight: 700; color: rgba(0, 0, 0, 0.45); margin: 2px 0 0; }
.cc-msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.cc-msgs::-webkit-scrollbar { width: 0; }
.cc-msg {
  max-width: 82%; padding: 12px 15px; border-radius: 20px; font-size: 14px; font-weight: 600;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word; animation: ccPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
/* ChatGPT-style: Jake pinned to the visual LEFT, user to the visual RIGHT
   (dir=rtl flips flex, so flex-end = left, flex-start = right) */
.cc-msg--jake { align-self: flex-end; background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-start-end-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05); }
.cc-msg--user { align-self: flex-start; background: #101418; color: #fff; border-start-start-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
@keyframes ccPop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.cc-typing { display: flex; gap: 5px; align-items: center; padding: 15px 17px; }
.cc-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); animation: ccDot 1.1s ease-in-out infinite; }
.cc-typing span:nth-child(2) { animation-delay: 0.15s; }
.cc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ccDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.cc-bottom { padding: 8px 12px 112px; background: linear-gradient(to top, #f5f6fa 75%, rgba(245, 246, 250, 0)); }
.cc-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cc-chips::-webkit-scrollbar { display: none; }
.cc-chip {
  flex: 0 0 auto; border: 1.5px solid rgba(0, 0, 0, 0.1); background: #fff; border-radius: 999px;
  font: inherit; font-size: 12.5px; font-weight: 800; padding: 9px 14px; cursor: pointer; transition: all 0.15s;
}
.cc-chip:active { transform: scale(0.95); background: rgba(22, 199, 132, 0.08); border-color: #16c784; }
.cc-chip--menu { background:#101418; color:#fff; border-color:#101418; }

/* Food Scanner routines, shopping and restaurant coach */
.fs-quick-tools { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:12px 0; }
.fs-quick-tool { min-width:0; min-height:66px; border:1px solid rgba(22,199,132,.22); border-radius:15px; padding:10px; background:linear-gradient(145deg,#fff,#f3fbf7); display:flex; align-items:center; gap:8px; text-align:right; color:#101418; cursor:pointer; }
.fs-quick-tool > span:first-child { font-size:22px; flex:0 0 auto; }
.fs-quick-tool b,.fs-quick-tool small { display:block; }
.fs-quick-tool b { font-size:12px; line-height:1.25; }
.fs-quick-tool small { margin-top:3px; color:#69716d; font-size:9.5px; font-weight:650; }
.fs-quick-tool:focus-visible { outline:3px solid rgba(22,199,132,.35); outline-offset:2px; }
.quick-ack-setting { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 12px; padding:9px 10px; border-radius:12px; background:#f4f7f5; color:#5f6763; font-size:10.5px; font-weight:650; }
.quick-ack-setting button { flex:0 0 auto; border:0; background:transparent; color:#087c50; font:inherit; font-weight:850; text-decoration:underline; cursor:pointer; }
.nutrition-tools { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:2px 0 14px; }
.nutrition-tool-btn { min-height:82px; padding:12px; border:1px solid rgba(0,0,0,.07); border-radius:18px; background:#fff; box-shadow:0 5px 16px rgba(0,0,0,.05); text-align:right; display:grid; grid-template-columns:auto 1fr; column-gap:8px; }
.nutrition-tool-btn span { grid-row:1/3; font-size:24px; align-self:center; }.nutrition-tool-btn b{font-size:13px}.nutrition-tool-btn small{font-size:10.5px;color:#777;font-weight:600}
.nutrition-tool-btn--extra { grid-column:1/-1; min-height:68px; padding:9px 11px; border-color:rgba(249,115,22,.28); background:linear-gradient(135deg,#fff,#fff7ed); display:flex; align-items:center; gap:8px; }
.extra-meal-main { min-width:0; flex:1; border:0; padding:3px 1px; background:transparent; color:inherit; display:flex; align-items:center; gap:9px; text-align:right; cursor:pointer; }
.nutrition-tool-btn--extra .extra-meal-main-icon { flex:0 0 auto; width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#f97316; color:#fff; font-size:24px; line-height:1; }
.extra-meal-main-copy { min-width:0; display:flex; flex-direction:column; gap:2px; }
.extra-meal-main-copy b { font-size:13px; }
.extra-meal-main-copy small { color:#777; font-size:10.5px; font-weight:600; line-height:1.35; }
.extra-meal-card-info { flex:0 0 auto; width:30px; height:30px; border:1px solid rgba(249,115,22,.35); border-radius:50%; background:#fff; color:#c6540c; display:grid; place-items:center; font:900 15px/1 Inter,Arial,sans-serif; cursor:pointer; box-shadow:0 3px 10px rgba(249,115,22,.08); }
.extra-meal-card-info span { width:auto; height:auto; display:block; background:none; color:inherit; font:inherit; }
.extra-meal-main:focus-visible,.extra-meal-card-info:focus-visible { outline:3px solid rgba(249,115,22,.28); outline-offset:2px; }
.food-tools-card { width:min(400px,100%); max-height:88vh; overflow:auto; text-align:right; }
.food-tools-sub { color:#666; font-size:13px; line-height:1.55; margin:6px 0 14px; }
.extra-meal-card { width:min(370px,100%); }
.extra-meal-form { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.extra-meal-field { display:flex; flex-direction:column; gap:5px; font-size:11px; font-weight:800; color:#30353a; }
.extra-meal-field--wide,.extra-meal-error,.extra-meal-submit { grid-column:1/-1; }
.extra-meal-field input { width:100%; padding:12px; border:1px solid #dfe3e6; border-radius:12px; background:#fff; color:#111; font:inherit; font-size:14px; font-weight:650; direction:ltr; text-align:start; }
.extra-meal-field input:focus { outline:3px solid rgba(249,115,22,.16); border-color:#f97316; }
.extra-meal-error { margin:0; padding:9px 11px; border-radius:10px; background:#fff1f2; color:#b42336; font-size:12px; font-weight:750; }
.extra-meal-error[hidden] { display:none; }

/* ── Custom Surplus Meal flow ── */
.em-view { animation: fadeInUp 0.3s cubic-bezier(0.2,1,0.3,1); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.em-title-row { display: flex; align-items: center; justify-content: space-between; position: relative; margin: 0; padding-right: 4px; }
.em-help-btn { display: grid; place-items: center; width: 28px; height: 28px; color: #a1a1aa; border-radius: 50%; transition: 0.2s; cursor: pointer; flex-shrink: 0; }
.em-help-btn:hover, .em-help-btn:focus { color: #f97316; background: #fff7ed; }
.em-help-btn svg { width: 16px; height: 16px; }

.em-help-tooltip { margin-top: 10px; padding: 12px; font-size: 13px; line-height: 1.5; color: #666; background: #fffaf5; border: 1px solid #fed7aa; border-radius: 12px; animation: fadeInUp 0.2s ease; }
.em-help-tooltip[hidden] { display: none; }

.em-routes { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.em-route-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid #eaeaea; border-radius: 16px; background: #fff; text-align: start; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; cursor: pointer; }
.em-route-btn:active { transform: scale(0.98); }
.em-route-btn:hover { border-color: #f97316; box-shadow: 0 4px 12px -4px rgba(249, 115, 22, 0.15); }
.em-route-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff7ed; color: #f97316; display: grid; place-items: center; flex-shrink: 0; }
.em-route-ic svg { width: 20px; height: 20px; }
.em-route-intro { margin:18px 0 0; color:#6b7280; font-size:12px; font-weight:750; }
.em-route-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.em-route-copy b { font-size:14px; font-weight:850; color:#111; }
.em-route-copy small { color:#70757d; font-size:10.5px; font-weight:650; line-height:1.35; }
.em-route-arr { color: #ccc; }
.em-route-arr svg { width: 18px; height: 18px; }

.em-back-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.em-back-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #eee; color: #555; transition: 0.2s; cursor: pointer; flex-shrink: 0; }
.em-back-btn:hover { background: #f9fafb; color: #111; }
.em-back-btn svg { width: 18px; height: 18px; }
.em-view-title { font-size: 18px; font-weight: 800; margin: 0; color: #111; }

.em-templates-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin-bottom: 16px; padding: 2px 2px 6px; }
.em-template-section { margin: 12px 2px 3px; color: #111; font-size: 11px; font-weight: 900; letter-spacing: .02em; }
.em-template-section:first-child { margin-top: 2px; }
.em-template-empty { margin: 2px 3px 8px; }
.em-template-btn { padding: 12px 14px; border-radius: 12px; border: 1.5px solid #eee; background: #fdfdfd; text-align: start; transition: 0.2s; cursor: pointer; }
.em-template-btn--coach { border-color: rgba(249,115,22,.24); background: linear-gradient(135deg,#fff 35%,#fff7ed); }
.em-template-btn--coach .em-template-name::before { content: "AI"; display: inline-grid; place-items: center; min-width: 24px; height: 18px; margin-inline-end: 7px; border-radius: 6px; background: #fff0e4; color: #ea580c; font-size: 8px; font-weight: 950; vertical-align: middle; }
.em-template-btn.is-selected { border-color: #f97316; background: #fff7ed; box-shadow: 0 2px 8px rgba(249,115,22,0.1); }
.em-template-name { font-size: 14px; font-weight: 800; color: #222; margin-bottom: 4px; }
.em-template-macros { font-size: 12px; color: #666; font-family: var(--font-en); direction: ltr; text-align: left; }

.em-adjust { animation: fadeInUp 0.3s ease; }
.em-adjust[hidden] { display: none; }
.em-adjust-title { font-size: 13px; font-weight: 800; color: #444; margin-bottom: 14px; }
.em-adjust-source { margin:3px 0 0; color:#f97316; font-size:10px; font-weight:800; }
.em-adjust-copy { margin:10px 0 16px; }
.em-name-field { margin-bottom:6px; }

.em-slider-group { margin-bottom: 14px; }
.em-slider-head { display: flex; justify-content: space-between; align-items: flex-end; font-family: var(--font-en); margin-bottom: 6px; }
.em-slider-label { font-size: 11px; font-weight: 800; color: #777; text-transform: uppercase; letter-spacing: 0.04em; }
.em-slider-val { font-size: 16px; font-weight: 900; color: #111; display: flex; align-items: center; gap: 4px; direction:ltr; }
.em-slider-val small { font-size: 11px; color: #888; font-weight: 700; }
.em-slider-val input { width:76px; padding:6px 8px; border:1px solid #e1e4e8; border-radius:9px; background:#fff; color:#111; font:inherit; font-size:14px; font-weight:850; text-align:end; }
.em-slider-val input:focus { outline:2px solid rgba(249,115,22,.18); border-color:#f97316; }
.em-slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 999px; background: #eee; outline: none; margin: 6px 0; }
.em-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.15); cursor: pointer; margin-top: -8px; }
.em-slider::-moz-range-thumb { width:20px; height:20px; border-radius:50%; background:#fff; border:2px solid #ccc; box-shadow:0 2px 5px rgba(0,0,0,.15); cursor:pointer; }
.em-slider:active::-webkit-slider-thumb { transform: scale(1.1); }

.em-slider--kcal::-webkit-slider-thumb { border-color: #f97316; }
.em-slider--kcal { background: linear-gradient(90deg, #fed7aa, #f97316); }

.em-slider--p::-webkit-slider-thumb { border-color: var(--c-protein); }
.em-slider--p { background: linear-gradient(90deg, color-mix(in srgb, var(--c-protein) 30%, transparent), var(--c-protein)); }

.em-slider--c::-webkit-slider-thumb { border-color: var(--c-carbs); }
.em-slider--c { background: linear-gradient(90deg, color-mix(in srgb, var(--c-carbs) 30%, transparent), var(--c-carbs)); }

.em-slider--f::-webkit-slider-thumb { border-color: var(--c-fat); }
.em-slider--f { background: linear-gradient(90deg, color-mix(in srgb, var(--c-fat) 30%, transparent), var(--c-fat)); }
.cc-msg-action { margin-top:9px; padding:9px 12px; border:1px solid rgba(249,115,22,.28); border-radius:12px; background:#fff7ed; color:#c45108; font:inherit; font-size:11px; font-weight:850; cursor:pointer; }

.extra-meal-submit { margin-top:3px; }
.saved-meals-list,.shopping-items { display:flex; flex-direction:column; gap:9px; }
.saved-meal-row,.shopping-row { display:flex; align-items:center; gap:10px; border:1px solid #e8e8e8; border-radius:14px; padding:11px; background:#fff; }
.saved-meal-body { flex:1; min-width:0; }.saved-meal-body b{display:block;font-size:13px}.saved-meal-body small{color:#777;font-size:11px}
.saved-meal-log,.saved-meal-delete,.shopping-add-form button { border-radius:999px; padding:8px 11px; font-size:11px; font-weight:800; background:#101418; color:#fff; }
.saved-meal-delete { background:#f4f4f4;color:#a21b2d;padding:8px}
.food-confirm-card { width:min(360px,100%); text-align:center; }.food-confirm-icon{font-size:34px}.food-confirm-card p{font-size:14px;line-height:1.65;color:#555;margin:12px 0}
.food-confirm-actions { display:grid; gap:8px; }.food-confirm-actions button{padding:12px;border-radius:13px;background:#101418;color:#fff;font-weight:800}.food-confirm-actions button:nth-child(2){background:#16a34a}.food-confirm-actions button:last-child{background:#eee;color:#555}
.shopping-controls { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.shopping-controls label{font-size:11px;font-weight:800}.shopping-controls input,.shopping-controls select,.shopping-add-form input,#menuText{width:100%;margin-top:5px;padding:10px;border:1px solid #ddd;border-radius:11px;background:#fff;color:#111;font:inherit}
.shopping-row label{display:flex;gap:9px;align-items:center;flex:1;font-size:13px;font-weight:700}.shopping-row.is-done label{text-decoration:line-through;opacity:.5}.shopping-add-form{display:flex;gap:8px;margin-top:12px}.shopping-add-form input{margin:0;flex:1}
.menu-file-label{display:block;border:1px dashed #aaa;border-radius:12px;padding:10px;text-align:center;font-size:12px;font-weight:800;margin:8px 0;cursor:pointer}.menu-photo-state{display:grid;grid-template-columns:54px 1fr auto;align-items:center;gap:10px;padding:8px;border:1px solid #e4e4e4;border-radius:12px;margin:8px 0;background:#fff}.menu-photo-state[hidden]{display:none}.menu-photo-state img{width:54px;height:54px;object-fit:cover;border-radius:9px}.menu-photo-state span{font-size:11px;font-weight:750;line-height:1.4}.menu-photo-state button{width:30px;height:30px;border-radius:50%;background:#f1f1f1;color:#8f1424;font-weight:900}.menu-result{margin-top:12px;padding:13px;border-radius:14px;background:#f4f7f5;font-size:13px;line-height:1.65;white-space:pre-wrap}.menu-result:empty{display:none}
@media(max-width:350px){.nutrition-tools,.fs-quick-tools{grid-template-columns:1fr}}
.cc-inputbar {
  display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px; padding: 6px 8px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
.cc-input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 6px; }
.cc-input:focus { outline: none; }
.cc-ib-btn { border: none; background: transparent; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: rgba(0, 0, 0, 0.45); cursor: pointer; flex: 0 0 auto; }
.cc-ib-btn svg { width: 20px; height: 20px; }
.cc-ib-btn:active { background: rgba(0, 0, 0, 0.06); }
.cc-send { border: none; background: #16c784; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(22, 199, 132, 0.4); transition: transform 0.15s; }
.cc-send svg { width: 19px; height: 19px; margin-inline-start: -2px; }
.cc-send:active { transform: scale(0.92); }

/* track cards (onboarding) */
.ob-choice--track { position: relative; align-items: flex-start; }
.ob-choice-txt { display: flex; flex-direction: column; gap: 3px; }
.ob-choice-txt small { font-size: 12px; font-weight: 600; opacity: 0.6; }
.ob-choice--premium { border-color: rgba(212, 175, 55, 0.55); background: linear-gradient(135deg, #fffdf5, #fff8e1); }
.ob-choice--premium.is-active { border-color: #d4af37; background: #101418; }
.ob-premium-tag {
  position: absolute; top: -9px; inset-inline-end: 14px; background: linear-gradient(90deg, #d4af37, #f3d878);
  color: #4a3a00; font-size: 9.5px; font-weight: 900; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 999px;
}

/* ═══ MORE — Settings & Profile screen ═══ */
.more-screen {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: #f5f6fa; max-width: 412px; margin: 0 auto;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1), visibility 0s linear 0.36s;
}
.more-screen.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.32, 0, 0.18, 1);
}
.ms-header {
  padding: 26px 20px 16px;
  background: rgba(245, 246, 250, 0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.ms-title { font-size: 22px; font-weight: 900; margin: 0; }
.ms-sub { font-size: 13px; font-weight: 700; color: rgba(0, 0, 0, 0.45); margin: 4px 0 0; }
.ms-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 130px; }
.ms-section-title {
  font-size: 12.5px; font-weight: 900; letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.45); margin: 0 4px 10px;
}
.ms-card {
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 20px;
  padding: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}
.ms-card-text { font-size: 13.5px; font-weight: 600; line-height: 1.6; color: rgba(0, 0, 0, 0.6); margin: 0 0 12px; }
.ms-card .tc-open-btn { margin-top: 0; }

/* TEMP dev gender toggle button — discrete, remove before production */
.dev-gender-btn { opacity: 0.35; }
.dev-gender-btn:active { opacity: 1; }

/* ── PR celebration burst ─────────────────────────────────── */
.pr-burst {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}
.pr-trophy {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 26px;
  transform: translate(-50%, -50%) scale(0.2);
  filter: drop-shadow(0 0 10px rgba(255, 200, 40, 0.9)) drop-shadow(0 0 22px rgba(255, 180, 0, 0.5));
  animation: prTrophy 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes prTrophy {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  14%  { transform: translate(-50%, -62%) scale(1.35); opacity: 1; }
  26%  { transform: translate(-50%, -58%) scale(1); }
  72%  { transform: translate(-50%, -58%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -78%) scale(0.85); opacity: 0; }
}
.pr-star {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 13px;
  opacity: 0;
  animation: prStar 1.1s ease-out forwards;
  animation-delay: var(--dl, 0ms);
}
@keyframes prStar {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  18%  { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1.1); opacity: 0; }
}
.pr-label {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 10px);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: var(--green, #22c55e);
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
  opacity: 0;
  animation: prLabel 2s ease forwards;
}
@keyframes prLabel {
  0%   { transform: translate(-50%, 18px); opacity: 0; }
  16%  { transform: translate(-50%, 10px); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(-50%, 2px); opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ═══ MORE TAB HUB ═══ */
.mr-group { margin: 18px 16px 0; }
.mr-group-title {
  font-size: 13px; font-weight: 800; color: var(--text-2, #9ca3af);
  letter-spacing: 0.02em; margin: 0 4px 8px;
}
.mr-list { display: flex; flex-direction: column; gap: 8px; }
.mr-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: start; padding: 13px 14px;
  background: var(--bg-2, #fff); border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 14px; cursor: pointer; font: inherit; color: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mr-item:active { transform: scale(0.98); }
.mr-item--static { cursor: default; }
.mr-language-item { cursor: default; }
.mr-language-item:active { transform: none; }
.language-switch {
  direction: ltr; display: flex; flex: 0 0 auto; padding: 3px; gap: 2px;
  border-radius: 11px; background: var(--bg, #eef0f4);
  border: 1px solid var(--line, rgba(0,0,0,0.07));
}
.language-option {
  border: 0; border-radius: 8px; padding: 7px 9px; background: transparent;
  color: var(--text-2, #6b7280); font: inherit; font-size: 11.5px;
  font-weight: 800; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.language-option.is-active {
  color: var(--text, #111827); background: var(--bg-2, #fff);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.language-option:focus-visible { outline: 2px solid #22c55e; outline-offset: 2px; }
[dir="ltr"] .mr-chev { transform: scaleX(-1); }
[dir="ltr"] .mr-sub { transform: translateX(14px); }
[dir="ltr"] .mr-sub.is-open { transform: translateX(0); }

@media (max-width: 370px) {
  .mr-language-item { align-items: flex-start; flex-wrap: wrap; }
  .mr-language-item .language-switch { margin-inline-start: 32px; }
}
.mr-item-ic { font-size: 20px; flex: 0 0 auto; }
.mr-item-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mr-item-title { font-size: 14.5px; font-weight: 800; }
.mr-item-sub { font-size: 12px; color: var(--text-2, #6b7280); }
.mr-chev { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-2, #9ca3af); }
.mr-c-red    { color: #ef4444; }
.mr-c-yellow { color: #d97706; }
.mr-c-blue   { color: #3b82f6; }
.mr-c-purple { color: #8b5cf6; }
.mr-c-green  { color: #22c55e; }

/* sub-view */
.mr-sub {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--bg, #f6f7f9);
  transform: translateX(-14px); opacity: 0;
  /* keep the closed sub-view out of the way so the menu underneath can scroll */
  visibility: hidden; pointer-events: none;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0s linear 0.26s;
}
.mr-sub.is-open {
  transform: translateX(0); opacity: 1;
  visibility: visible; pointer-events: auto;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
.mr-sub-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 12px;
}
.mr-back {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line, rgba(0,0,0,0.08)); background: var(--bg-2, #fff);
  display: grid; place-items: center; cursor: pointer; color: inherit;
}
.mr-back svg { width: 18px; height: 18px; }
.mr-sub-title { font-size: 18px; font-weight: 900; margin: 0; }
.mr-sub-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(env(safe-area-inset-bottom, 0px) + 110px); }

.mr-card {
  background: var(--bg-2, #fff); border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 14px; padding: 6px 14px; margin: 8px 0 14px;
}
.mr-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
}
.mr-row:last-child { border-bottom: none; }
.mr-readonly-tag { font-size: 12px; color: var(--text-2, #6b7280); margin: 6px 2px 2px; }
.mr-block-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.mr-block-title { font-size: 14px; font-weight: 800; margin: 12px 2px 8px; }
.mr-mini-btn {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line, rgba(0,0,0,0.1)); background: var(--bg-2, #fff); color: inherit;
}
.mr-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.mr-photo { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; }
.mr-timeline-entry { margin-bottom: 14px; }
.mr-timeline-date { font-size: 12.5px; font-weight: 700; color: var(--text-2, #6b7280); margin: 0 2px 4px; }
.mr-wgraph { width: 100%; height: auto; display: block; margin: 6px 0; }

.mr-empty { text-align: center; padding: 46px 20px; }
.mr-empty-ic { font-size: 40px; display: block; margin-bottom: 10px; }
.mr-empty-sub { font-size: 12.5px; color: var(--text-2, #6b7280); margin: 8px 2px; line-height: 1.55; }

.mr-sync-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: rgba(59, 130, 246, 0.1); color: #2563eb;
  padding: 6px 12px; border-radius: 999px; margin: 8px 0 12px;
}
.mr-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.mr-stat {
  background: var(--bg-2, #fff); border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px;
}
.mr-stat-num { font-size: 20px; font-weight: 900; }
.mr-stat-lbl { font-size: 11.5px; color: var(--text-2, #6b7280); }

.mr-disclaimer {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.25);
  color: #92400e; font-size: 12.5px; font-weight: 600; line-height: 1.5;
}

.mr-folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 8px; }
.mr-folder {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 14px; border-radius: 16px; cursor: pointer; font: inherit; color: inherit;
  background: var(--bg-2, #fff); border: 1px solid var(--line, rgba(0,0,0,0.08));
  text-align: start; transition: transform 0.15s ease;
}
.mr-folder:active { transform: scale(0.97); }
.mr-folder-ic { font-size: 26px; }
.mr-folder-name { font-size: 13.5px; font-weight: 800; }
.mr-folder-count { font-size: 11.5px; color: var(--text-2, #6b7280); }
.mr-folder.has-cover { background-size: cover; background-position: center; color: #fff; border-color: transparent; min-height: 112px; }
.mr-folder.has-cover .mr-folder-count { color: rgba(255,255,255,.85); }
.mr-folder.has-cover .mr-folder-name { text-shadow: 0 1px 4px rgba(0,0,0,.35); }

.mr-terms h4 { margin: 12px 0 4px; font-size: 14px; }
.mr-terms p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; color: var(--text-2, #4b5563); }

/* upsell modal */
.mr-upsell-card { text-align: center; }
.mr-upsell-crown { font-size: 44px; margin-top: 6px; }
.mr-upsell-title { font-size: 22px; font-weight: 900; letter-spacing: 0.04em; margin: 6px 0 2px; }
.mr-upsell-sub { font-size: 13px; color: var(--text-2, #6b7280); margin: 0 0 14px; }
.mr-upsell-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: start; }
.mr-upsell-list li { padding: 7px 2px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--line, rgba(0,0,0,0.06)); }
.mr-upsell-list li:last-child { border-bottom: none; }
.mr-upsell-cta {
  width: 100%; padding: 15px; border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 900; color: #111;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.35);
}
.mr-upsell-note { font-size: 11.5px; color: var(--text-2, #9ca3af); margin: 10px 0 4px; }

/* ═══ TECH-DEBT (remove before launch): dev demo controls ═══ */
.dev-demo-controls {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 90; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  direction: ltr; gap: 6px; width: min(412px, 100%); padding: 4px 8px;
  opacity: 0.45; transition: opacity 0.2s ease;
}
.dev-demo-controls[hidden] { display: none !important; }
.dev-demo-controls:hover { opacity: 1; }
.dev-demo-controls button {
  font: inherit; font-size: 10.5px; font-weight: 800;
  min-width: 0; width: 100%; line-height: 1.2; overflow-wrap: anywhere;
  padding: 4px 9px; border-radius: 0 0 10px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12); border-top: none;
  background: #fffbe6; color: #6b5900; cursor: pointer; white-space: normal;
}

.dev-demo-controls button { unicode-bidi: plaintext; }

@media (max-width: 340px) {
  .dev-demo-controls { grid-template-columns: 1fr; }
}

/* ═══ COACH DEMO — B2B management interface (mock) ═══ */
.coachdash-screen {
  position: fixed; inset: 0; z-index: 60; display: none; flex-direction: column;
  background: #f5f6fa; max-width: 412px; margin: 0 auto;
}
.coachdash-screen.is-open { display: flex; }
.cd-header {
  padding: 30px 20px 14px;
  background: rgba(245, 246, 250, 0.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 10px 12px;
}
.cd-title {
  min-width: 0; margin: 0;
  font-size: clamp(15.5px, 4.5vw, 19px); font-weight: 900; line-height: 1.18;
  text-align: start; overflow-wrap: anywhere;
}
.cd-exit, .cd-library-link {
  max-width: 116px; font: inherit; font-size: 11.5px; font-weight: 800;
  line-height: 1.2; padding: 7px 10px; text-align: center;
  border-radius: 12px; border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff; cursor: pointer; white-space: normal;
}
.cd-library-link { max-width: 150px; background: #e7fbbd; }
.cd-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.cd-notification-badge {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  box-shadow: 0 7px 18px rgba(220, 38, 38, .26);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.cd-surplus-alert.is-multiple {
  background: #fff1f2;
  border-color: rgba(220, 38, 38, .34);
}
.cd-surplus-ledger { margin-bottom: 12px; }
.cd-surplus-day {
  border: 1px solid rgba(234, 88, 12, .2);
  border-radius: 14px;
  background: #fff7ed;
  padding: 10px 12px;
  margin-top: 8px;
}
.cd-surplus-day.is-multiple {
  border-color: rgba(220, 38, 38, .35);
  background: #fff1f2;
}
.cd-surplus-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 7px;
}
.cd-surplus-meal {
  display: grid;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px dashed rgba(15, 23, 42, .1);
  font-size: 12px;
}
.cd-surplus-meal:first-of-type { border-top: 0; }
.cd-surplus-meal small { color: rgba(15, 23, 42, .58); font-weight: 700; }
.cd-surplus-meal.is-cancelled { opacity: .56; text-decoration: line-through; }
@media (max-width: 360px) {
  .cd-header { grid-template-columns: 1fr; padding-inline: 16px; }
  .cd-exit, .cd-library-link { max-width: none; justify-self: start; }
}
.cd-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 40px; }
.cd-search {
  width: 100%; font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 12px 16px; border-radius: 16px; margin-bottom: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1); background: #fff; outline: none;
}
.cd-search:focus { border-color: rgba(59, 130, 246, 0.55); }
.cd-client {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 18px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; font: inherit;
}
.cd-client-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff;
}
.cd-client-name { font-size: 15px; font-weight: 900; margin: 0; }
.cd-client-meta { font-size: 12px; font-weight: 700; color: rgba(0, 0, 0, 0.45); margin: 2px 0 0; }
.cd-client-chev { margin-inline-start: auto; color: rgba(0, 0, 0, 0.3); font-size: 16px; }
.cd-back {
  font: inherit; font-size: 13px; font-weight: 800; border: none; background: none;
  color: #2563eb; cursor: pointer; padding: 4px 0; margin-bottom: 10px;
}
.cd-card {
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 18px;
  padding: 14px 16px; margin-bottom: 12px;
}
.cd-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 900; color: rgba(0, 0, 0, 0.55); }
.cd-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; font-weight: 700; border-bottom: 1px dashed rgba(0, 0, 0, 0.07); }
.cd-row:last-child { border-bottom: none; }
.cd-row b { font-weight: 900; }
.cd-edit-btn {
  width: 100%; font: inherit; font-size: 14.5px; font-weight: 900; color: #fff;
  padding: 13px; border: none; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #7c3aed); margin-top: 4px;
}

/* ═══ Trainer's Plan — read-only trainee view ═══ */
.tp-hero { background: linear-gradient(135deg, #eef4ff, #f6f0ff); }
.tp-eyebrow { font-size: 11px; font-weight: 900; letter-spacing: 0.06em; color: rgba(0, 0, 0, 0.45); margin: 0 0 4px; }
.tp-coach { font-size: 20px; font-weight: 900; margin: 0; }
.tp-hero-sub { margin-top: 6px; }
.tp-demo-tag {
  display: inline-block; font-size: 9.5px; font-weight: 900; vertical-align: middle;
  padding: 2px 7px; border-radius: 8px; background: rgba(0, 0, 0, 0.07); color: rgba(0, 0, 0, 0.5);
}
.tp-card-title { margin: 0 0 10px; font-size: 14.5px; font-weight: 900; }
.tp-label { font-size: 11.5px; font-weight: 900; color: rgba(0, 0, 0, 0.45); margin: 10px 0 2px; }
.tp-text { font-size: 13.5px; font-weight: 700; line-height: 1.55; margin: 0; }
.tp-targets { margin-top: 12px; }
.tp-bar { margin-bottom: 10px; }
.tp-bar-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; margin-bottom: 4px; }
.tp-bar-track { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.07); overflow: hidden; margin-bottom: 8px; }
.tp-bar-fill { display: block; height: 100%; border-radius: 6px; }
.tp-f-cal { background: linear-gradient(90deg, #22c55e, #4ade80); }
.tp-f-protein { background: linear-gradient(90deg, #ef4444, #f87171); }
.tp-f-carbs { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tp-f-fat { background: linear-gradient(90deg, #10b981, #34d399); }
.tp-f-water { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* ═══ Coach hub additions ═══ */
.cd-alerts { margin-bottom: 14px; }
.cd-alerts-title { font-size: 12.5px; font-weight: 900; color: rgba(0, 0, 0, 0.5); margin: 0 4px 8px; }
.cd-alert {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff7ed; border: 1px solid rgba(217, 119, 6, 0.22); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px;
}
.cd-alert b { display: block; font-size: 13px; font-weight: 900; }
.cd-alert small { display: block; font-size: 11.5px; font-weight: 700; color: rgba(0, 0, 0, 0.5); margin-top: 2px; }
.cd-alert-ic { font-size: 16px; flex: none; }
.cd-ai-card .cd-alert { background: #f4f1ff; border-color: rgba(124, 58, 237, 0.2); }
.cd-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cd-readonly-tag {
  font-size: 11.5px; font-weight: 900; color: #6b5900; background: #fffbe6;
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px;
  display: inline-block;
}
.cd-tabs {
  display: flex; justify-content: flex-start; flex-wrap: nowrap; gap: 4px;
  max-width: 100%; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-inline: contain; scrollbar-width: none;
  background: rgba(0, 0, 0, 0.05); border-radius: 14px; padding: 3px; margin-bottom: 16px;
}
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab {
  font: inherit; font-size: 10px; font-weight: 800; white-space: nowrap;
  padding: 7px 10px; border: none; border-radius: 11px; background: none;
  color: rgba(0, 0, 0, 0.55); cursor: pointer; flex: 0 0 auto; min-width: max-content;
  scroll-snap-align: nearest; unicode-bidi: plaintext;
}
.cd-tab.is-active { background: #fff; color: #111; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }

html[lang="en"] .cd-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  margin-bottom: 12px;
  overflow: visible;
}

html[lang="en"] .cd-tab {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 3px;
  font-size: 9px;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[lang="en"] .cd-tab:nth-child(5) { grid-column: 1 / 3; }
html[lang="en"] .cd-tab:nth-child(6) { grid-column: 3 / 5; }

#cdTabBody { position: relative; display: flow-root; min-width: 0; clear: both; }
.cd-snap-ring-wrap {
  display: grid; grid-template-columns: 118px minmax(0, 1fr);
  align-items: center; gap: 16px; min-width: 0; margin-bottom: 12px;
}
.cd-snap-ring { width: 118px; max-width: 100%; }
.cd-snap-ring-num { font-size: 21px; font-weight: 900; fill: #111; }
.cd-snap-ring-lbl { font-size: 10.5px; font-weight: 800; fill: rgba(0, 0, 0, 0.45); }
.cd-snap-stats { min-width: 0; }

@media (max-width: 340px) {
  .cd-snap-ring-wrap { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .cd-snap-ring { width: 104px; }
}
.cd-hist-item { border-bottom: 1px dashed rgba(0, 0, 0, 0.08); padding: 8px 0; }
.cd-hist-item:last-child { border-bottom: none; }
.cd-hist-date { font-size: 12px; font-weight: 900; color: rgba(0, 0, 0, 0.5); margin-bottom: 3px; }
.cd-hist-line { font-size: 12.5px; font-weight: 700; padding: 1px 0; }
.cd-graph { width: 100%; height: 110px; margin-bottom: 6px; }
.cd-gal-group { margin-bottom: 12px; }
.cd-gal-date { font-size: 12px; font-weight: 900; color: rgba(0, 0, 0, 0.5); margin: 0 0 6px; }
.cd-gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cd-gal-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; }
.cd-heat { margin-top: 4px; }
.cd-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cd-field span { font-size: 12.5px; font-weight: 800; flex: none; }
.cd-field input {
  font: inherit; font-size: 14px; font-weight: 800; text-align: center;
  width: 130px; padding: 9px 10px; border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12); background: #fafafa; outline: none;
}
.cd-field input[type="text"], .cd-field input[type="url"] { width: 60%; text-align: start; }
.cd-field-file input { width: 60%; font-size: 11px; font-weight: 600; padding: 7px; background: none; border: 1px dashed rgba(0, 0, 0, 0.2); }
.cd-textarea {
  width: 100%; font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fafafa; outline: none; resize: vertical;
}
.cd-ex-hit {
  display: block; width: 100%; text-align: start; font: inherit; cursor: pointer;
  background: #fafafa; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 12px;
  padding: 9px 12px; margin-top: 6px;
}
.cd-ex-hit b { font-size: 13px; font-weight: 900; display: block; }
.cd-ex-hit small { font-size: 11px; font-weight: 700; color: rgba(0, 0, 0, 0.45); }
.cd-plan-row { border-bottom: 1px dashed rgba(0, 0, 0, 0.08); padding: 9px 0; }
.cd-plan-row:last-child { border-bottom: none; }
.cd-cardio-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.cd-cardio-builder select { width: 100%; min-height: 40px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; background: #fff; padding: 8px; }
.cd-plan-row--cardio { position: relative; margin: 8px 0; padding: 12px 42px 12px 12px; border: 1px solid rgba(37,99,235,.16); border-radius: 12px; background: #f5f9ff; }
.cd-plan-row--cardio .cd-plan-del { position: absolute; top: 12px; right: 12px; }
.cd-cardio-summary { margin-top: 5px; color: #64748b; font-size: 12px; }
@media (max-width: 520px) {
  .ws-cardio-card { grid-template-columns: 46px 1fr; }
  .ws-cardio-cta { grid-column: 2; }
  .cd-cardio-grid { grid-template-columns: 1fr; }
}
.cd-plan-name { font-size: 13.5px; font-weight: 900; margin-bottom: 6px; }
.cd-plan-fields { display: flex; gap: 8px; align-items: center; }
.cd-plan-fields label { font-size: 10.5px; font-weight: 800; color: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cd-plan-fields input {
  font: inherit; font-size: 12.5px; font-weight: 800; text-align: center;
  padding: 6px 4px; border-radius: 9px; border: 1px solid rgba(0, 0, 0, 0.12); background: #fafafa; outline: none; width: 100%;
}
.cd-plan-field-hint { font-size: 9px; font-weight: 700; color: rgba(0, 0, 0, 0.42); }
.cd-plan-fields input:invalid { border-color: #dc2626; background: #fff7f7; }
.cd-plan-del {
  font: inherit; font-size: 13px; font-weight: 900; color: #b91c1c; cursor: pointer;
  border: none; background: rgba(185, 28, 28, 0.08); border-radius: 9px; padding: 6px 9px; flex: none; align-self: flex-end;
}

/* ── Run-mode swipe hint (absolute, top-right whitespace above the greeting; no layout shift) ── */
.greeting { position: relative; }
.run-swipe-hint {
  position: absolute;
  top: -4px;
  inset-inline-start: 0; /* RTL → visual right, above the greeting text */
  display: flex;
  align-items: center;
  gap: 4px;
  color: #a8aebc;
  opacity: 0.7;
  pointer-events: auto;
  z-index: 1;
  animation: rshNudge 2.6s ease-in-out infinite;
}
.run-swipe-hint .rsh-runner { width: 13px; height: 13px; flex: none; }
.run-swipe-hint .rsh-arrow { width: 20px; height: 8px; flex: none; }
.run-swipe-hint .rsh-text { font-size: 9.5px; font-weight: 700; letter-spacing: 0.2px; }
@keyframes rshNudge {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(-6px); opacity: 0.95; }
}

/* ── Coach triage tabs ── */
.cd-triage {
  display: flex;
  gap: 6px;
  margin: 12px 0 10px;
}
.cd-triage-tab {
  flex: 1;
  border: 1px solid #e3e6ec;
  background: #fff;
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 800;
  color: #4b5163;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cd-triage-tab small { font-size: 11px; font-weight: 700; color: #9aa0b0; }
.cd-triage-tab.is-active { border-color: #2563eb; background: #eef4ff; color: #1d4ed8; }
.cd-triage-tab.is-active small { color: #1d4ed8; }

/* ── Client card AI flags ── */
.cd-client-main { min-width: 0; }
.cd-client-flag {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-block;
}
.cd-client-flag.is-neg { background: #fef2f2; color: #b91c1c; }
.cd-client-flag.is-pos { background: #f0fdf4; color: #15803d; }

/* ── Editor: blueprint textareas, meal builder, scrollable exercise library ── */
.cd-field-col { flex-direction: column; align-items: stretch; gap: 4px; }
.cd-field-col .cd-textarea { width: 100%; }
.cd-food-db {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px;
}
.cd-food-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  text-align: right;
  border: 1px solid #e9ebf1;
  background: #fafbfd;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  gap: 0 8px;
}
.cd-food-item b { font-size: 12.5px; color: #23283a; }
.cd-food-item small { font-size: 11px; color: #8a90a3; grid-column: 1; }
.cd-food-plus {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.cd-manual-meal { margin-top: 10px; border-top: 1px dashed #e3e6ec; padding-top: 10px; }
.cd-manual-title { font-size: 12px; font-weight: 800; color: #4b5163; margin-bottom: 6px; }
.cd-manual-fields { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 6px; }
.cd-manual-fields input {
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  min-width: 0;
  font-family: inherit;
}
.cd-manual-add {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}
.cd-ex-count { font-size: 11px; color: #8a90a3; font-weight: 700; margin: 8px 0 6px; }
.cd-ex-scroll {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px;
}

/* ── Notification Center dropdown ── */
.notif-panel {
  position: fixed;
  top: 62px;
  left: 12px;
  right: 12px;
  max-width: 360px;
  margin-inline-start: auto;
  z-index: 90;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.96);
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}
.notif-close {
  border: none;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #4b5163;
  cursor: pointer;
}
.notif-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.notif-item b { display: block; font-size: 13px; color: #1f2430; }
.notif-item small { display: block; font-size: 11.5px; color: #6b7280; line-height: 1.45; margin-top: 1px; }
.notif-ic {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.notif-ic.is-coach { background: rgba(37, 99, 235, 0.1); }
.notif-ic.is-sys { background: rgba(217, 119, 6, 0.12); }
.notif-ic.is-ai { background: rgba(5, 150, 105, 0.12); }

/* ── Profile quick-view modal ── */
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, 0.4);
  display: grid;
  place-items: center;
  padding: 24px;
}
.profile-modal {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  padding: 24px 20px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
}
.profile-close { position: absolute; top: 12px; inset-inline-start: 12px; }
.profile-pic {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8ecf3, #f6f8fb);
  border: 2px dashed #c7cdd9;
  display: grid;
  place-items: center;
  color: #9aa0b0;
  cursor: pointer;
  overflow: visible;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.profile-pic:hover { transform:scale(1.03); border-color:#f97316; box-shadow:0 8px 22px rgba(249,115,22,.16); }
.profile-pic:focus-visible { outline:3px solid rgba(249,115,22,.3); outline-offset:3px; }
.profile-pic:disabled { opacity:.65; cursor:wait; }
.profile-pic > img { width:100%; height:100%; border-radius:50%; object-fit:cover; display:block; }
.profile-pic > img[hidden] { display:none; }
.profile-pic-placeholder { width:38px; height:38px; }
.profile-pic.has-photo { border-style:solid; border-color:#fff; box-shadow:0 7px 20px rgba(15,23,42,.18); }
.profile-pic.has-photo .profile-pic-placeholder { display:none; }
.profile-pic-camera { position:absolute; inset-inline-end:-3px; bottom:-2px; width:25px; height:25px; border:2px solid #fff; border-radius:50%; background:#f97316; color:#fff; display:grid; place-items:center; box-shadow:0 3px 8px rgba(15,23,42,.22); }
.profile-pic-camera svg { width:13px; height:13px; }
.profile-name { font-size: 18px; font-weight: 900; color: #1f2430; margin: 0 0 12px; }
.profile-stats { display: flex; gap: 10px; margin-bottom: 14px; }
.profile-stat {
  flex: 1;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  padding: 10px 6px;
}
.profile-stat small { display: block; font-size: 11px; color: #6b7280; margin-bottom: 2px; }
.profile-stat b { font-size: 15px; color: #1f2430; }
/* ── Coach: gold/positive AI alerts ── */
.cd-alert.is-gold {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(202, 138, 4, 0.25);
  border-radius: 12px;
  padding: 8px 10px;
}
.cd-alert.is-gold b { color: #a16207; }

/* ── Coach: financial-style weight chart ── */
.cd-chart-chips { display: flex; gap: 6px; margin: 4px 0 10px; }
.cd-chart-chip {
  flex: 1;
  border: 1px solid #e3e6ec;
  background: #fff;
  border-radius: 10px;
  padding: 5px 0;
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: #6b7280;
  cursor: pointer;
}
.cd-chart-chip.is-active { background: #1f2430; border-color: #1f2430; color: #fff; }
.cd-graph-fin { width: 100%; height: auto; display: block; }

/* ── Coach: trend-based workout hub ── */
.cd-trend-group { border: 1px solid #eceff4; border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.cd-trend-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  background: rgba(15, 23, 42, 0.03);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  color: #1f2430;
  cursor: pointer;
}
.cd-trend-head small { font-weight: 700; color: #6b7280; }
.cd-trend-body { padding: 2px 10px 8px; }
.cd-trend-row {
  width: 100%;
  border: none;
  background: none;
  padding: 9px 2px;
  font: inherit;
  text-align: start;
  cursor: pointer;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: block;
}
.cd-trend-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cd-trend-row b { font-size: 13px; color: #1f2430; }
.cd-trend-row small { font-size: 11.5px; color: #6b7280; }
.cd-alt-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 8px;
  padding: 2px 7px;
  flex: none;
}
.cd-trend-hist { margin-top: 6px; padding: 8px 10px; background: rgba(15, 23, 42, 0.03); border-radius: 10px; }
.cd-trend-hist p { margin: 0; padding: 2px 0; font-size: 11.5px; color: #4b5163; }

/* ── Coach: workout split builder (blocks) ── */
.cd-blocks-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.cd-block-chip {
  border: 1px solid #e3e6ec;
  background: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #4b5163;
  cursor: pointer;
}
.cd-block-chip.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }
.cd-block-add {
  border: 1px dashed #c7cdd9;
  background: none;
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  cursor: pointer;
}
.cd-block-title { font-size: 13px; font-weight: 900; color: #2563eb; margin: 12px 0 4px; }
.cd-block-hint { font-size: 11.5px; color: #6b7280; margin: 2px 0 6px; }
.profile-modal-backdrop[hidden], .notif-panel[hidden] { display: none !important; }

/* ── Coach: workout history mini-table ── */
.cd-hist-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
  gap: 2px 6px;
  margin-top: 4px;
}
.cd-hist-cell { font-size: 11.5px; color: #4b5163; padding: 3px 0; }
.cd-hist-cell b { color: #1f2430; }
.cd-hist-cell.is-head {
  font-weight: 900;
  font-size: 10.5px;
  color: #9aa0b0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 4px;
}

/* ── Coach: check-in & nutrition day rows ── */
.cd-day-row {
  width: 100%;
  border: none;
  background: none;
  padding: 9px 2px;
  font: inherit;
  text-align: start;
  cursor: pointer;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: block;
}
.cd-day-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-day-head b { font-size: 13px; color: #1f2430; }
.cd-day-head small { font-size: 11.5px; color: #6b7280; margin-inline-start: auto; }
.cd-meal-pill {
  font-size: 10.5px;
  font-weight: 800;
  color: #92400e;
  background: rgba(217, 119, 6, 0.12);
  border-radius: 8px;
  padding: 2px 7px;
  flex: none;
}
.cd-meal-pill.is-good { color: #166534; background: rgba(34, 197, 94, 0.12); }
.cd-meal-pill.is-bad { color: #b91c1c; background: rgba(185, 28, 28, 0.1); }
.cd-day-meals {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 10px;
}
.cd-meal-line { display: block; font-size: 12px; color: #1f2430; padding: 2px 0; }
.cd-meal-line.is-missed { color: #b91c1c; }
.cd-meal-note { display: block; font-size: 10.5px; color: #9aa0b0; margin-top: 4px; }

/* ── Coach: chart axis labels ── */
.cd-axis-lbl { font-size: 8.5px; fill: #9aa0b0; font-weight: 700; }
.cd-day-meals[hidden], .cd-trend-hist[hidden] { display: none !important; }

/* ── Coach: interactive chart + target labels ── */
.cd-chart-box { position: relative; height: 210px; width: 100%; touch-action: pan-y; }
.cd-chart-hint { font-size: 10.5px; color: #9aa0b0; text-align: center; margin: 4px 0 2px; }
.cd-target-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 12px;
  background: rgba(15, 23, 42, 0.035);
  border-radius: 12px;
  font-size: 13px;
  color: #4b5163;
}
.cd-target-row b { color: #1f2430; font-weight: 900; }
.cd-target-row b.is-goal { color: #059669; }
.cd-target-sep { color: #c3c8d4; }

/* ── Notification Center as centered modal ── */
.notif-modal {
  width: min(360px, calc(100vw - 40px));
  border-radius: 20px;
  padding: 16px 16px 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

/* ── Profile modal extra stats grid ── */
.profile-stats { flex-wrap: wrap; gap: 10px; }
.profile-stat { flex: 1 1 calc(50% - 8px); }
.profile-stat.is-wide { flex-basis: 100%; }

/* ── Active Mode: tab views (Home / Plans / Activity) ── */
.am-view {
  position: absolute;
  inset: 100px 0 0; /* reach the very bottom — fully opaque, no map bleed behind the nav */
  z-index: 5;
  background: #f4f4f5;
  overflow-y: auto;
  padding: 14px 16px 96px; /* bottom padding clears the nav bar */
}
.am-view-title { font-size: 19px; font-weight: 900; color: #111; margin: 2px 0 12px; }

/* Home */
.am-home-hero {
  background: #111;
  color: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 12px;
}
.am-home-hi { font-size: 13px; opacity: 0.75; margin-bottom: 6px; }
.am-home-big { font-size: 40px; font-weight: 900; line-height: 1; }
.am-home-big small { font-size: 14px; font-weight: 700; opacity: 0.7; }
.am-home-sub { font-size: 12px; opacity: 0.65; margin-top: 8px; }
.am-home-grid { display: flex; gap: 8px; margin-bottom: 14px; }
.am-home-stat {
  flex: 1; background: #fff; border-radius: 14px; padding: 12px 8px; text-align: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.am-home-stat b { display: block; font-size: 17px; color: #111; }
.am-home-stat small { font-size: 10.5px; color: #6b7280; }
.am-home-cta {
  width: 100%; border: none; border-radius: 16px; background: #059669; color: #fff;
  font: inherit; font-size: 15px; font-weight: 900; padding: 14px; cursor: pointer;
}

/* Plans */
.am-plan-card {
  background: #fff; border-radius: 16px; padding: 14px 15px; margin-bottom: 10px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.07);
}
.am-plan-card.is-featured { background: #111; }
.am-plan-card.is-featured b, .am-plan-card.is-featured .am-plan-cta { color: #fff; }
.am-plan-card.is-featured small { color: rgba(255, 255, 255, 0.65); }
.am-plan-tag {
  display: inline-block; font-size: 10px; font-weight: 900; color: #059669;
  background: rgba(5, 150, 105, 0.1); border-radius: 8px; padding: 2px 8px; margin-bottom: 7px;
}
.am-plan-card b { display: block; font-size: 15.5px; color: #111; }
.am-plan-card small { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.am-plan-cta { display: block; font-size: 12px; font-weight: 900; color: #059669; margin-top: 9px; }

/* Activity history */
.am-act-item {
  display: flex; align-items: center; gap: 11px;
  background: #fff; border-radius: 16px; padding: 11px 12px; margin-bottom: 9px;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.07);
}
.am-act-map { width: 52px; height: 52px; flex: none; border-radius: 10px; }
.am-act-info { flex: 1; min-width: 0; }
.am-act-info b { display: block; font-size: 13px; color: #111; }
.am-act-info small { font-size: 11px; color: #9aa0b0; }
.am-act-stats { text-align: left; flex: none; }
.am-act-stats b { display: block; font-size: 14px; color: #059669; }
.am-act-stats small { font-size: 10.5px; color: #6b7280; }
.am-activity-sub { margin: -6px 0 12px; color: #6b7280; font-size: 12px; }

/* Shared trainee + trainer activity history */
.activity-feed { display: flex; flex-direction: column; gap: 9px; }
.activity-day {
  margin: 6px 0 -2px; color: #475467; font-size: 10px; font-weight: 900;
}
.activity-day:first-child { margin-top: 0; }
.activity-feed-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.activity-feed-row:last-child { border-bottom: none; padding-bottom: 0; }
.activity-feed-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; background: rgba(5, 150, 105, 0.11); font-size: 17px;
}
.activity-feed-main { min-width: 0; flex: 1; }
.activity-feed-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; min-width: 0; }
.activity-feed-title b {
  min-width: 0; color: #111827; font-size: 13px; line-height: 1.25;
  white-space: normal; overflow-wrap: anywhere;
}
.activity-category {
  flex: none; padding: 2px 6px; border-radius: 999px; background: #eef2f0;
  color: #047857; font-size: 9px; font-weight: 900;
}
.activity-feed-main small { display: block; margin-top: 3px; color: #7b8190; font-size: 10.5px; }
.activity-feed-metrics { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: #047857; }
.activity-feed-metrics b { font-size: 11px; white-space: nowrap; }
.activity-feed-metrics .is-secondary { color: #6b7280; font-size: 10px; font-weight: 700; }
.activity-state {
  margin: 0; padding: 18px 12px; border-radius: 12px; background: #f7f8fa;
  color: #6b7280; font-size: 12px; line-height: 1.55; text-align: center;
}
.activity-state.is-loading { color: #2563eb; }
.activity-state.is-error { color: #b42318; background: #fef3f2; }
.activity-card .activity-feed { margin-top: 8px; }
.cd-activity-summary h4 { margin-bottom: 4px; }
.cd-activity-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; }
.cd-activity-kpis span {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 5px; border-radius: 10px;
  background: #f7f8fa; color: #6b7280; font-size: 10px; text-align: center;
}
.cd-activity-kpis b { color: #111827; font-size: 17px; line-height: 1; }

/* Run settings modal + Indoor/Outdoor switch */
.am-settings-backdrop {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.am-settings-backdrop[hidden] { display: none !important; }
.am-settings-card {
  position: relative;
  width: min(330px, calc(100vw - 44px));
  background: #fff; border-radius: 20px; padding: 20px 18px 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  text-align: center;
}
#amGoalModal .am-settings-card {
  width: min(390px, calc(100vw - 24px));
  min-height: 390px;
  padding: 26px 22px 20px;
}
.am-settings-title { font-size: 16px; font-weight: 900; color: #111; margin-bottom: 14px; }
.am-settings-close { position: absolute; top: 10px; left: 10px; }
.am-runmode-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.am-runmode-opt { font-size: 12px; font-weight: 700; color: #9aa0b0; white-space: nowrap; }
.am-runmode-opt.is-active { color: #111; font-weight: 900; }
.am-switch {
  width: 48px; height: 28px; border: none; border-radius: 999px;
  background: #d4d8e0; position: relative; cursor: pointer; flex: none;
  transition: background 0.2s;
}
.am-switch.is-on { background: #059669; }
.am-switch-knob {
  position: absolute; top: 3px; inset-inline-start: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.am-switch.is-on .am-switch-knob { transform: translateX(-20px); }
.am-settings-sub { font-size: 11.5px; color: #6b7280; margin-top: 10px; }

/* ═══ NRC round 2: run-type modal, hold-to-finish, music sheet, goal, plans imgs ═══ */

/* Run-type chooser */
.am-runtype-row { display: flex; gap: 10px; }
.am-runtype-btn {
  flex: 1; border: 1.5px solid rgba(0,0,0,0.1); border-radius: 16px;
  background: #f7f8fa; padding: 16px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.am-runtype-btn:active { transform: scale(0.95); border-color: #111; background: #fff; }
.am-runtype-emoji { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.am-runtype-btn b { font-size: 14px; color: #111; font-family: var(--font-en); }
.am-runtype-btn small { font-size: 11px; color: #6b7280; }

/* Hold-to-finish */
.am-ctrl-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.am-ctrl-hint {
  font-size: 10px; font-weight: 700; color: #000;
  text-shadow: 0 1px 8px rgba(255,255,255,0.9); white-space: nowrap;
}
.am-finish-btn { position: relative; overflow: hidden; }
.am-finish-btn svg { position: relative; z-index: 1; }
.am-finish-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: rgba(0,0,0,0.38); z-index: 0; pointer-events: none;
  transition: height 1.5s linear;
}

/* Saved toast */
.am-saved-toast {
  position: absolute; top: 116px; left: 50%; transform: translateX(-50%);
  z-index: 40; background: #059669; color: #fff;
  font-size: 14px; font-weight: 900; padding: 10px 22px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(5,150,105,0.4);
}
.am-saved-toast[hidden] { display: none !important; }

/* Active goal badge */
.am-goal-badge {
  position: absolute; top: 100px; left: 50%; transform: translateX(-50%);
  z-index: 19; width: min(350px, calc(100% - 28px)); background: rgba(255,255,255,0.94); color: #111;
  font-size: 12px; font-weight: 800; padding: 10px 14px; border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  backdrop-filter: blur(10px);
}
.am-goal-badge[hidden] { display: none !important; }
.am-goal-live-head { display: flex; align-items: center; gap: 7px; }
.am-goal-live-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-goal-live-head b { color: #059669; font-family: var(--font-en); font-size: 14px; }
.am-goal-progress { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.am-goal-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #10b981, #22c55e); transition: width .35s ease; }
.am-goal-badge small { display: block; margin-top: 5px; color: #4b5563; font-size: 10.5px; text-align: center; }

/* Set-a-goal modal */
.am-goal-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; justify-content: center; margin-bottom: 22px; }
.am-goaltype-btn {
  border: 1.5px solid rgba(0,0,0,0.12); border-radius: 999px; background: #fff;
  min-width: 0; min-height: 42px; font: inherit; font-size: 11.5px; line-height: 1.2; font-weight: 800; color: #6b7280;
  padding: 8px 9px; cursor: pointer; transition: all 0.15s; white-space: normal;
}
.am-goaltype-btn.is-active { background: #111; border-color: #111; color: #fff; }
.am-goal-input-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 16px; }
.am-goal-input {
  width: 110px; border: none; border-bottom: 2.5px solid #111; background: transparent;
  font-family: var(--font-en); font-size: 40px; font-weight: 900; color: #111;
  text-align: center; outline: none;
}
.am-goal-input::-webkit-outer-spin-button, .am-goal-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.am-goal-unit { font-size: 14px; font-weight: 800; color: #6b7280; }
.am-goal-save {
  width: 100%; border: none; border-radius: 14px; background: #111; color: #fff;
  font: inherit; font-size: 14px; font-weight: 900; padding: 12px; cursor: pointer;
}
.am-goal-clear {
  width: 100%; border: none; background: transparent; color: #ef4444;
  font: inherit; font-size: 12px; font-weight: 800; padding: 9px 0 0; cursor: pointer;
}

/* Music bottom sheet */
.am-sheet-backdrop {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: flex-end;
}
.am-sheet-backdrop[hidden] { display: none !important; }
.am-sheet {
  width: 100%; background: #fff; border-radius: 22px 22px 0 0;
  padding: 10px 20px 26px; text-align: center;
  animation: amSheetUp 0.25s ease;
}
@keyframes amSheetUp { from { transform: translateY(40%); opacity: 0.5; } to { transform: none; opacity: 1; } }
.am-sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: #d4d8e0; margin: 0 auto 14px; }
.am-sheet-title { font-size: 16px; font-weight: 900; color: #111; }
.am-sheet-sub { font-size: 11.5px; color: #6b7280; margin: 4px 0 16px; }
.am-music-opt {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px solid rgba(0,0,0,0.1); border-radius: 16px; background: #fff;
  font: inherit; font-size: 14.5px; font-weight: 800; color: #111;
  padding: 13px; margin-bottom: 10px; cursor: pointer; transition: transform 0.12s;
}
.am-music-opt:active { transform: scale(0.97); }
.am-music-spotify svg { color: #1DB954; }
.am-music-apple svg { color: #FA243C; }

/* Premium image plan cards — white theme, dark gradient overlay for readability */
.am-plan-card.is-img {
  background-size: cover; background-position: center;
  min-height: 128px; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px 15px 14px;
}
.am-plan-card.is-img b, .am-plan-card.is-img .am-plan-cta { color: #fff; }
.am-plan-card.is-img small { color: rgba(255,255,255,0.82); }
.am-plan-card.is-img .am-plan-tag { background: rgba(255,255,255,0.92); color: #059669; align-self: flex-start; }

/* ═══ NRC round 3: full-screen settings, new-run button, custom plan ═══ */
.am-settings-screen {
  position: absolute; inset: 0; z-index: 40;
  background: #f7f8fa; display: flex; flex-direction: column;
}
.am-settings-screen[hidden] { display: none !important; }
.am-set-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 48px 16px 14px; background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.am-set-header h3 { font-size: 16px; font-weight: 900; color: #111; }
.am-set-header-spacer { width: 38px; }
.am-set-body { flex: 1; overflow-y: auto; padding: 6px 0 30px; }
.am-set-section {
  font-size: 11px; font-weight: 900; letter-spacing: 0.6px; color: #9aa0b0;
  text-transform: uppercase; padding: 20px 18px 8px;
}
.am-set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; padding: 13px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.am-set-label { font-size: 14px; font-weight: 700; color: #111; }
.am-set-label small { display: block; font-size: 11px; font-weight: 500; color: #9aa0b0; margin-top: 2px; }
.am-set-value { font-size: 12.5px; font-weight: 700; color: #6b7280; white-space: nowrap; }
.am-set-seg { display: flex; background: #eef0f4; border-radius: 999px; padding: 3px; }
.am-set-seg button {
  border: none; background: transparent; border-radius: 999px;
  font: inherit; font-size: 11.5px; font-weight: 800; color: #6b7280;
  padding: 5px 13px; cursor: pointer; transition: all 0.15s;
}
.am-set-seg button.is-active { background: #111; color: #fff; }

/* Summary: start-new-run */
.am-newrun-btn {
  margin-top: 10px; width: 100%; border: none; border-radius: 14px;
  background: #111; color: #fff; font: inherit; font-size: 14px; font-weight: 900;
  padding: 13px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.am-newrun-btn:active { transform: scale(0.97); }

/* Plans: build-custom-plan */
.am-buildplan-btn {
  width: 100%; border: 2px dashed rgba(0,0,0,0.25); border-radius: 16px;
  background: #fff; color: #111; font: inherit; font-size: 13.5px; font-weight: 900;
  padding: 14px; cursor: pointer; margin-top: 2px;
}
.am-buildplan-btn:active { transform: scale(0.98); }

/* ── Plans: edit button + plan builder modal (NRC round 4) ── */
.am-plan-card { position: relative; }
.am-plan-edit {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(10, 14, 20, 0.55); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px;
  font-size: 11px; font-family: inherit; padding: 4px 10px; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.am-plan-edit:active { transform: scale(0.95); }
.am-plan-image-card { max-width: 360px; padding: 20px 16px 18px; overflow: hidden; }
.am-plan-image-card .am-settings-title { margin-bottom: 15px; }
.am-plan-image-gallery {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 3px 12px;
  scroll-snap-type: x mandatory; overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.am-plan-image-gallery::-webkit-scrollbar { display: none; }
.am-plan-image-opt {
  position: relative; flex: 0 0 78%; aspect-ratio: 16/9; border-radius: 14px;
  border: 3px solid transparent; background-size: cover; background-position: center;
  cursor: pointer; padding: 0; overflow: hidden; scroll-snap-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.am-plan-image-opt.is-picked {
  border-color: #059669; box-shadow: 0 0 0 2px rgba(5,150,105,.2);
  transform: scale(.98);
}
.am-plan-image-opt.is-picked::after {
  content: "✓"; position: absolute; top: 6px; right: 6px;
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center;
  background: #059669; color: #fff; font-size: 13px; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.am-plan-image-opt:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
.am-plan-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 10px; text-align: right; }
.am-plan-field input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; background: #fafafa; }
.am-plan-field input:focus { outline: none; border-color: #059669; background: #fff; }
.am-plan-field-row { display: flex; gap: 10px; }
.am-plan-field-row .am-plan-field { flex: 1; min-width: 0; }
.am-plan-gal-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin: 2px 0 6px; text-align: right; }
.am-img-gallery { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; }
.am-img-opt {
  flex: 0 0 76px; height: 56px; border-radius: 10px; padding: 0;
  background-size: cover; background-position: center;
  border: 2px solid transparent; cursor: pointer; position: relative;
}
.am-img-opt.is-picked { border-color: #059669; box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25); }
.am-img-opt.is-picked::after {
  content: "✓"; position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #059669; color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

/* ── Plan builder: segments + custom image URL (NRC round 5) ── */
.am-seg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.am-seg-row { display: flex; gap: 6px; align-items: center; }
.am-seg-type {
  flex: 0 0 108px; min-width: 0; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 9px 6px; font-size: 13px; font-family: inherit; background: #fafafa; color: #111;
}
.am-seg-target {
  flex: 1; min-width: 0; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 9px 10px; font-size: 13px; font-family: inherit; background: #fafafa;
}
.am-seg-type:focus, .am-seg-target:focus, .am-plan-imgurl:focus { outline: none; border-color: #059669; background: #fff; }
.am-seg-del {
  flex: 0 0 28px; height: 28px; border-radius: 50%; border: none; padding: 0;
  background: #f3f4f6; color: #6b7280; font-size: 12px; cursor: pointer;
}
.am-seg-add {
  width: 100%; border: 1.5px dashed #d1d5db; border-radius: 10px; background: none;
  padding: 9px; font-size: 13px; font-weight: 700; color: #374151; font-family: inherit;
  cursor: pointer; margin-bottom: 12px;
}
.am-seg-add:active { background: #f3f4f6; }
.am-plan-imgurl {
  width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-family: inherit; background: #fafafa; margin-bottom: 12px;
}

/* ── Notifications: scrollable list, fixed header (premium scrollbar) ── */
.notif-modal { display: flex; flex-direction: column; max-height: 60vh; }
.notif-modal .notif-head { flex: 0 0 auto; }
.notif-list {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-left: 2px; /* room for the scrollbar (RTL) */
  scrollbar-width: thin; scrollbar-color: #d1d5db transparent;
}
.notif-list::-webkit-scrollbar { width: 5px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }
.notif-list::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Coach: day-by-day nutrition builder ── */
.cd-menu-day {
  border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; background: #fafafa;
}
.cd-menu-day.is-active { border-color: #059669; background: #f0fdf7; }
.cd-menu-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cd-menu-day-head b { font-size: 13px; color: #111; }
.cd-menu-day-head small { font-size: 11px; color: #6b7280; }

/* ── Coach: weekly summary matrix + slot chips ── */
.cd-slots-bar { margin-top: 6px; }
.cd-slot-chip.is-active { background: #059669; border-color: #059669; color: #fff; }
.cd-matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.cd-matrix { width: 100%; border-collapse: collapse; font-size: 11px; }
.cd-matrix th, .cd-matrix td {
  border: 1px solid #e5e7eb; padding: 5px 6px; text-align: right; vertical-align: top; min-width: 60px;
}
.cd-matrix thead th { background: #f3f4f6; font-size: 11px; color: #374151; white-space: nowrap; }
.cd-matrix tbody th { background: #fafafa; font-weight: 700; color: #111; white-space: nowrap; }
.cd-matrix tbody th small { display: block; font-weight: 500; color: #6b7280; font-size: 10px; }
.cd-matrix tbody tr.is-active th { background: #f0fdf7; color: #047857; }
.cd-matrix tbody tr.is-active td { background: #f7fefb; }
.cd-mx-empty { color: #d1d5db; text-align: center; }
.cd-mx-meal {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef2f0; border-radius: 999px; padding: 2px 7px; margin: 1px 0 1px 4px;
  font-size: 10.5px; color: #111; white-space: nowrap;
}
.cd-mx-del { border: none; background: none; color: #9ca3af; font-size: 10px; padding: 0; cursor: pointer; }
.cd-mx-del:hover { color: #dc2626; }

/* ── AI Smart Import ── */
.si-open-btn {
  display: block; width: calc(100% - 32px); margin: 10px 16px 4px; padding: 13px 16px;
  border: none; border-radius: 14px; cursor: pointer;
  font: 700 14.5px/1 inherit; font-family: inherit; color: #fff; letter-spacing: .2px;
  background: linear-gradient(120deg, #7c3aed, #db2777 55%, #f59e0b);
  background-size: 200% 200%; animation: si-shimmer 5s ease infinite;
  box-shadow: 0 6px 18px rgba(124, 58, 237, .32);
}
.si-open-btn:active { transform: scale(.98); }
.cd-card .si-open-btn { width: 100%; margin: 0 0 10px; }
@keyframes si-shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.si-modal { z-index: 1400; }
.si-card { max-width: 380px; }
.si-eyebrow { background: linear-gradient(90deg, #7c3aed, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.si-sub { margin: 4px 0 14px; font-size: 13.5px; color: #6b7280; line-height: 1.5; }
.si-input {
  width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1.5px solid #e5e7eb;
  border-radius: 12px; font-size: 14px; font-family: inherit; direction: ltr; text-align: left;
}
.si-input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.si-analyze {
  width: 100%; margin-top: 12px; padding: 14px; border: none; border-radius: 13px; cursor: pointer;
  font: 700 15px/1 inherit; font-family: inherit; color: #fff;
  background: linear-gradient(120deg, #7c3aed, #db2777);
  box-shadow: 0 6px 16px rgba(219, 39, 119, .3);
}
.si-analyze:active { transform: scale(.98); }

/* processing */
.si-orb { display: flex; justify-content: center; margin: 8px 0 16px; }
.si-orb span {
  width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed, #db2777, #f59e0b, #7c3aed);
  animation: si-spin 1.4s linear infinite; position: relative;
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 55%);
  mask: radial-gradient(circle, transparent 52%, #000 55%);
}
@keyframes si-spin { to { transform: rotate(360deg); } }
.si-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.si-steps li {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 12px;
  background: #f8f8fa; color: #9ca3af; font-size: 14px; font-weight: 600;
  transition: background .3s, color .3s, transform .3s; opacity: .65;
}
.si-steps li.is-active {
  background: linear-gradient(120deg, rgba(124,58,237,.1), rgba(219,39,119,.08));
  color: #111; opacity: 1; transform: translateX(-3px);
}
.si-steps li.is-done { color: #059669; opacity: 1; }
.si-steps li.is-done .si-step-ic::before { content: "✅"; }
.si-steps li.is-done .si-step-ic { font-size: 0; }
.si-steps li.is-done .si-step-ic::before { font-size: 15px; }
.si-step-ic { font-size: 15px; }

/* result */
.si-result-badge {
  display: inline-block; margin-bottom: 10px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #7c3aed; background: rgba(124, 58, 237, .1);
}
.si-result-card {
  display: flex; gap: 12px; align-items: stretch; padding: 14px;
  border: 1.5px solid #ede9fe; border-radius: 16px;
  background: linear-gradient(135deg, #faf9ff, #fdf7fb);
  box-shadow: 0 8px 22px rgba(124, 58, 237, .1);
  animation: si-pop .35s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes si-pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.si-result-info { flex: 1; min-width: 0; }
.si-result-name { margin: 0 0 8px; font-size: 16px; font-weight: 800; color: #111; line-height: 1.3; }
.si-result-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.si-meta-pill {
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: #fff; border: 1px solid #e9e5f5; color: #4b5563;
}
.si-meta-muscle { color: #7c3aed; border-color: #ddd3f7; }
.si-result-note { margin: 0; font-size: 11.5px; color: #6b7280; line-height: 1.45; }
.si-result-thumb {
  flex: 0 0 84px; align-self: center; width: 84px; height: 84px; border-radius: 14px;
  overflow: hidden; background: #fff; border: 1px solid #ede9fe;
  display: flex; align-items: center; justify-content: center;
}
.si-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.si-thumb-fallback { font-size: 34px; }
.si-save {
  width: 100%; margin-top: 16px; padding: 14px; border: none; border-radius: 13px; cursor: pointer;
  font: 700 15px/1 inherit; font-family: inherit; color: #fff;
  background: linear-gradient(120deg, #059669, #10b981);
  box-shadow: 0 6px 16px rgba(5, 150, 105, .3);
}
.si-save:active { transform: scale(.98); }
.si-discard {
  width: 100%; margin-top: 8px; padding: 11px; border: none; border-radius: 13px; cursor: pointer;
  background: none; font: 600 13.5px/1 inherit; font-family: inherit; color: #9ca3af;
}
.si-discard:active { color: #6b7280; }

/* ── Mindset: podcast emoji icon in playlist rows ── */
.ms-pl-emoji { font-size: 20px; line-height: 1; }

/* ── Mindset: video thumbnail cards (embed-safe) ── */
.ms-video-link { display: block; text-decoration: none; color: inherit; }
.ms-video-thumb { position: relative; overflow: hidden; }
.ms-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.ms-video-play svg {
  width: 26px; height: 26px; color: #fff;
  background: rgba(0, 0, 0, .55); border-radius: 50%; padding: 15px;
  backdrop-filter: blur(2px); transition: transform .2s;
}
.ms-video-link:active .ms-video-play svg { transform: scale(.92); }


/* ═══════════════════════════════════════════════════════════
   WEARABLE UI — Smart Cardio server-backed panel
═══════════════════════════════════════════════════════════ */

/* ── Connected provider badge ── */
.wr-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.wr-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.wr-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 12px;
  font-weight: 700;
}
.wr-badge--error {
  background: #fef2f2;
  border-color: #fecaca;
}
.wr-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wr-badge-dot--green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.wr-badge-dot--red   { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
.wr-badge-provider {
  color: #111827;
}
.wr-badge-state {
  color: #6b7280;
  font-weight: 600;
}
.wr-sync-line {
  font-size: 11.5px;
  color: #6b7280;
  margin: 0;
}

.wr-week-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
}
.wr-week-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dbe2ea;
  border-radius: 13px;
  background: #f8fafc;
  color: #111827;
  font-size: 25px;
  cursor: pointer;
}
.wr-week-btn:active { transform: scale(.95); }
.wr-week-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.wr-week-title { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.wr-week-title strong { color: #111827; font-size: 15px; }
.wr-week-title small { color: #7b8190; font-size: 10px; }
.wr-breakdown {
  display: flex;
  gap: 7px;
  margin: -3px 0 14px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.wr-breakdown::-webkit-scrollbar { display: none; }
.wr-breakdown span {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  background: #fff;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
}
.wr-breakdown span b { font-size: 14px; }
.wr-breakdown span strong { color: #111827; font-size: 12px; }

.wr-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.wr-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
}
.wr-stat strong { color: #111827; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wr-stat span { color: #667085; font-size: 10.5px; font-weight: 800; line-height: 1.3; }
.wr-stat small { color: #7b8190; font-size: 9.5px; line-height: 1.35; }
.wr-sport-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
.wr-sport {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 5px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 13px;
  background: #f7f9fc;
  border: 1px solid #e7ebf0;
}
.wr-sport > b { grid-row: span 2; font-size: 20px; }
.wr-sport > span { overflow-wrap: anywhere; color: #475467; font-size: 10px; font-weight: 800; }
.wr-sport > strong { color: #111827; font-size: 16px; }
.wr-sport > small { grid-column: 1 / -1; color: #667085; font-size: 9.5px; }
.wr-health-card { padding: 14px; }
.wr-energy-note { margin: -5px 0 9px; color: #667085; font-size: 10.5px; line-height: 1.4; }
.wr-health-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #eef0f3;
}
.wr-health-row time { color: #344054; font-size: 10.5px; font-weight: 800; }
.wr-health-row span { display: flex; min-width: 0; flex-direction: column; gap: 2px; color: #7b8190; font-size: 9px; }
.wr-health-row b { overflow-wrap: anywhere; color: #111827; font-size: 11px; font-variant-numeric: tabular-nums; }
.wr-demo-toggle {
  padding: 5px 10px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  background: #f5f3ff;
  color: #6d28d9;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.wr-demo-banner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #f5c66b;
  border-radius: 13px;
  background: #fffbeb;
  color: #854d0e;
}
.wr-demo-banner b { font-size: 12px; }
.wr-demo-banner span { font-size: 10.5px; line-height: 1.4; }
.wr-error-actions { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

/* ── Pairing code box ── */
.wr-pair-box {
  background: var(--surface-2, #fff);
  border: 1.5px dashed #a5b4fc;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.wr-pair-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 4px;
}
.wr-pair-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 12px;
}
.wr-pair-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wr-pair-input {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid #c7d2fe;
  background: #fff;
  font: 700 18px/1 "Inter", monospace;
  text-align: center;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1e1b4b;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  padding: 0 10px;
}
.wr-pair-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.wr-pair-input:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.wr-pair-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font: 700 13px/1 "Inter", sans-serif;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .18s, transform .18s;
  flex-shrink: 0;
}
.wr-pair-btn:hover   { opacity: .9; }
.wr-pair-btn:active  { transform: scale(.97); }
.wr-pair-error {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: #b42318;
  font-weight: 600;
}

/* ── Refresh / disconnect action buttons ── */
.wr-refresh-btn {
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s;
}
.wr-refresh-btn:hover { background: #e0e7ff; }
.wr-disconnect-btn {
  font-size: 12px;
  font-weight: 700;
  color: #b42318;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s;
}
.wr-disconnect-btn:hover { background: #fee2e2; }

/* Responsive — wider than 480px, show badge and actions in one row */
@media (min-width: 480px) {
  .wr-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .wr-header-actions { margin-top: 0; margin-inline-start: auto; }
}
@media (max-width: 360px) {
  .wr-stats { grid-template-columns: 1fr; }
  .wr-health-row { grid-template-columns: 1fr 1fr; }
  .wr-health-row time { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════
   CLERK AUTH SHELL — compact account status bar + auth pages
═══════════════════════════════════════════════════════════ */

/* Auth root — no default styles needed; Clerk manages its own overlay */
#vfit-auth-root {
  position: relative;
  z-index: 200;
}

/* Compact status bar shown at base route (signed-in OR signed-out) */
.vfit-auth-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(7, 7, 11, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  /* slide in */
  animation: vfitBarIn 0.3s ease both;
}

@keyframes vfitBarIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vfit-auth-bar--signed-in { justify-content: flex-end; }
.vfit-auth-bar--signed-out { justify-content: flex-end; }

.vfit-auth-greeting {
  color: rgba(245, 246, 251, 0.72);
  margin-inline-end: auto;
}
.vfit-auth-greeting strong { color: #f5f6fb; font-weight: 700; }

.vfit-auth-status {
  color: rgba(245, 246, 251, 0.50);
  margin-inline-end: auto;
  font-size: 12px;
}

.vfit-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.vfit-auth-btn:active { transform: scale(0.97); }

.vfit-auth-btn--primary {
  background: #b5ff4d;
  color: #07070b;
  border-color: #b5ff4d;
}
.vfit-auth-btn--primary:hover {
  background: #c8ff77;
  border-color: #c8ff77;
}

.vfit-auth-btn--outline {
  background: transparent;
  color: rgba(245, 246, 251, 0.72);
  border-color: rgba(255, 255, 255, 0.15);
}
.vfit-auth-btn--outline:hover {
  color: #f5f6fb;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

/* Auth pages — full-screen overlay for /sign-in and /sign-up */
.vfit-auth-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 7, 11, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  animation: vfitPageIn 0.25s ease both;
}

@keyframes vfitPageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Clerk form field placeholder contrast override */
.cl-formFieldInput::placeholder {
  color: rgba(245, 246, 251, 0.35);
  opacity: 1;
}
.mr-upsell-cta--beta { margin-top: 10px; color: #0f5f5a; background: #ffffff; border: 1.5px solid #14b8a6; box-shadow: none; }
.mr-upsell-cta:disabled + .mr-upsell-cta--beta { margin-top: 10px; }
.fs-sample-notice { margin: 8px 0; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: #0f5f5a; background: #e9f8f6; border: 1px solid #b2e6de; }
.fs-sample-notice:empty { display: none; }
#fsTrySample { display: block; margin: 10px auto 0; }
