:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --card: #1a1a1a;
  --border: #262626;
  --accent: #c8f542;
  --accent2: #3dffa0;
  --orange: #ff8c42;
  --red: #ff4d4d;
  --text: #f0f0f0;
  --muted: #777;
  --top-bar-h: 60px;
}
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html, body { height:100%; background:var(--bg); color:var(--text); font-family:'DM Sans',sans-serif; overflow:hidden; }

/* Mobile: Prevent iOS auto-zoom on inputs */
@media (max-width: 480px) {
  input, textarea, select { font-size:16px; }
}

#app { display:flex; flex-direction:column; height:100%; }
#main { flex:1; overflow-y:auto; overflow-x:hidden; padding-bottom:32px; }
#main::-webkit-scrollbar { display:none; }

/* ── TOP BAR ── */
#top-bar {
  height: var(--top-bar-h);
  background: rgba(15,15,15,0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
  z-index: 110;
}
#menu-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#top-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
  margin-left: 8px;
}
#top-logo span { color: var(--accent); }
#top-spacer { flex: 1; }

/* ── SIDEBAR NAV ── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#nav.open {
  transform: translateX(0);
}
.sidebar-header {
  height: var(--top-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
}
.sidebar-logo span { color: var(--accent); }
.close-menu {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}
.nav-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}
#nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#nav-overlay.open {
  display: block;
  opacity: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  padding: 14px 24px;
  text-align: left;
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-btn.active { color: var(--accent); background: rgba(200,245,66,0.08); }
.nav-btn.active:hover { background: rgba(200,245,66,0.12); }
.nav-btn .nav-icon { font-size: 20px; width: 24px; text-align: center; line-height: 1; }
.nav-btn .nav-lbl { font-size: 14px; font-weight: 500; letter-spacing: 0.5px; }
.nav-btn-logout { margin-top: auto; border-top: 1px solid var(--border); padding-top: 20px; }
.nav-btn-logout:hover { color: var(--red); background: rgba(255,77,77,0.05); }
.nav-spacer { flex: 1; }

/* Mobile: Sidebar Adjustments */
@media (max-width: 480px) {
  #nav { width: 85%; max-width: 300px; }
}

/* Tablet: Better spacing */
@media (min-width: 768px) {
  .page { padding:24px 32px; }
  .home-section { padding:24px 32px 0; }
  .start-btn-wrap { padding:24px 32px; }
  .prog-preview { padding:0 32px 32px; }
  .start-btn { max-width:600px; margin:0 auto; }
  .btn-primary, .btn-secondary { max-width:600px; margin-left:auto; margin-right:auto; }
}

/* ── SHARED ── */
.page { padding:20px 16px; animation:fadeIn 0.2s ease; }
.page-header { margin-bottom:24px; }
.page-title { font-family:'Bebas Neue',sans-serif; font-size:36px; letter-spacing:1px; line-height:1; }
.page-sub { font-size:13px; color:var(--muted); margin-top:4px; font-weight:300; }

/* Mobile: Page */
@media (max-width: 480px) {
  .page { padding:16px 12px; }
  .page-header { margin-bottom:16px; }
  .page-title { font-size:28px; }
  .page-sub { font-size:12px; }
}

.card { background:var(--card); border:1px solid var(--border); border-radius:16px; }
.section-label { font-family:'Bebas Neue',sans-serif; font-size:13px; letter-spacing:2px; color:var(--muted); margin-bottom:10px; }

/* Mobile: Cards */
@media (max-width: 480px) {
  .card { border-radius:12px; }
  .section-label { font-size:11px; letter-spacing:1px; margin-bottom:8px; }
}

.btn-primary {
  width:100%; padding:16px; background:var(--accent); color:#111;
  border:none; border-radius:14px; font-size:16px; font-weight:600;
  cursor:pointer; font-family:'DM Sans',sans-serif; letter-spacing:0.3px;
  transition:opacity 0.15s, transform 0.1s;
}
.btn-primary:active { opacity:0.85; transform:scale(0.98); }
.btn-secondary {
  width:100%; padding:14px; background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:14px; font-size:15px; font-weight:500;
  cursor:pointer; font-family:'DM Sans',sans-serif;
  transition:opacity 0.15s;
}
.btn-secondary:active { opacity:0.7; }

/* Mobile: Buttons */
@media (max-width: 480px) {
  .btn-primary { padding:14px; font-size:15px; }
  .btn-secondary { padding:12px; font-size:14px; }
}

.tag { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:500; }
.tag-green { background:rgba(200,245,66,0.15); color:var(--accent); }
.tag-orange { background:rgba(255,140,66,0.15); color:var(--orange); }
.tag-blue { background:rgba(61,255,160,0.15); color:var(--accent2); }

@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ── HOME ── */
.home-hero {
  background: linear-gradient(135deg, #111 0%, #0a0a0a 60%, #0f1a04 100%);
  padding:32px 16px 24px;
  border-bottom:1px solid var(--border);
  position:relative; overflow:hidden;
}
.home-hero::before {
  content:''; position:absolute; top:-40px; right:-40px;
  width:200px; height:200px;
  background:radial-gradient(circle, rgba(200,245,66,0.1) 0%, transparent 70%);
  border-radius:50%;
}
.hero-greeting { font-family:'Bebas Neue',sans-serif; font-size:48px; line-height:0.9; letter-spacing:1px; }
.hero-greeting span { color:var(--accent); }
.hero-date { font-size:13px; color:var(--muted); margin-top:8px; font-weight:300; }

.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:16px 16px 0; }
.stat-card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:14px 10px; text-align:center; }
.stat-val { font-family:'Bebas Neue',sans-serif; font-size:28px; color:var(--accent); line-height:1; }
.stat-lbl { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; margin-top:4px; font-weight:500; }

/* Mobile: Home hero */
@media (max-width: 480px) {
  .hero-greeting { font-size:40px; }
  .home-hero { padding:24px 16px 20px; }
  .stat-val { font-size:26px; }
  .stat-lbl { font-size:11px; }
  .stats-row { gap:6px; }
  .stat-card { padding:12px 8px; }
}

.home-section { padding:16px 16px 0; }
.last-card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:16px; }
.last-card-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; }
.last-card-title { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:1px; font-weight:500; }
.last-card-date { font-size:18px; font-weight:600; color:var(--text); margin-top:2px; }
.last-card-stats { font-size:13px; color:var(--muted); }
.last-card-row { display:flex; gap:12px; margin-top:8px; }

/* Mobile: Home cards */
@media (max-width: 480px) {
  .home-section { padding:12px 12px 0; }
  .last-card { padding:12px; border-radius:12px; }
  .last-card-date { font-size:16px; }
  .last-card-stats { font-size:12px; }
}

.start-btn-wrap { padding:16px; }
.start-btn {
  width:100%; padding:20px; background:var(--accent); color:#111;
  border:none; border-radius:16px; font-size:18px; font-weight:700;
  cursor:pointer; font-family:'Bebas Neue',sans-serif; letter-spacing:1px;
  transition:transform 0.1s, opacity 0.15s;
  display:flex; align-items:center; justify-content:center; gap:10px;
}
.start-btn:active { transform:scale(0.97); opacity:0.9; }

.home-dashboard {
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.home-coach-header {
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:12px;
  padding:18px;
  background:linear-gradient(135deg, #171717 0%, #101010 60%, #14180f 100%);
  border:1px solid var(--border);
  border-radius:18px;
}
.home-kicker {
  font-size:12px;
  color:var(--muted);
  margin-bottom:5px;
  font-weight:500;
}
.home-coach-header h1 {
  font-family:'Bebas Neue',sans-serif;
  font-size:40px;
  line-height:0.95;
  letter-spacing:1px;
  font-weight:400;
}
.home-coach-note {
  padding:12px;
  background:rgba(255,255,255,0.035);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:12px;
  color:#d8d8d8;
  font-size:13px;
  line-height:1.35;
}
.home-panel {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
}
.home-panel-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}
.home-panel-title {
  font-size:20px;
  font-weight:700;
  line-height:1.15;
}
.home-session-callout {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border:1px solid rgba(129,140,248,0.35);
  background:rgba(129,140,248,0.08);
  border-radius:12px;
  margin-bottom:12px;
}
.home-session-title {
  font-size:15px;
  font-weight:700;
}
.home-session-sub {
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}
.home-action-btn {
  border:none;
  border-radius:10px;
  padding:10px 12px;
  background:var(--accent);
  color:#111;
  font-weight:800;
  font-family:'DM Sans',sans-serif;
  cursor:pointer;
}
.home-session-done {
  text-align:center;
  padding:12px;
  border:1px solid rgba(200,245,66,0.35);
  border-radius:12px;
  color:var(--accent);
  background:rgba(200,245,66,0.08);
  font-weight:700;
  margin-bottom:12px;
}
.home-start-btn {
  padding:16px;
  border-radius:12px;
  margin-bottom:12px;
  font-size:16px;
}
.home-today-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}
.home-today-item {
  min-width:0;
  padding:12px;
  border:1px solid rgba(255,255,255,0.06);
  border-radius:12px;
  background:rgba(255,255,255,0.025);
}
.home-today-item span {
  display:block;
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:4px;
}
.home-today-item strong {
  display:block;
  font-size:14px;
  color:var(--text);
  overflow-wrap:anywhere;
}
.home-quick-add {
  margin-top:10px;
  border-top:1px solid var(--border);
  padding-top:10px;
}
.home-quick-add summary {
  color:var(--accent);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  list-style:none;
}
.home-quick-add summary::-webkit-details-marker { display:none; }
.home-quick-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.home-quick-grid button {
  grid-column:1 / -1;
}
.home-kpi-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.home-kpi-card {
  min-width:0;
  min-height:122px;
  padding:14px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.home-kpi-card.home-kpi-good { border-color:rgba(61,255,160,0.25); }
.home-kpi-card.home-kpi-watch { border-color:rgba(255,140,66,0.28); }
.home-kpi-card.home-kpi-neutral { border-color:var(--border); }
.home-kpi-label {
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.6px;
  font-weight:700;
}
.home-kpi-value {
  font-family:'Bebas Neue',sans-serif;
  color:var(--text);
  font-size:34px;
  line-height:1;
  letter-spacing:0;
}
.home-kpi-value span {
  font-family:'DM Sans',sans-serif;
  font-size:12px;
  color:var(--muted);
  margin-left:5px;
  font-weight:700;
}
.home-kpi-sub {
  color:var(--muted);
  font-size:12px;
  line-height:1.25;
}
.home-dashboard .home-section {
  padding:0;
}

/* ── Chat (Coach) ─────────────────────────────────────────────────────── */
.chat-page {
  display:flex; flex-direction:column;
  height:calc(100vh - 80px);
  max-height:calc(100vh - 80px);
  padding:12px 12px 0;
  gap:12px;
}
.chat-header {
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:12px;
}
.chat-clear {
  background:transparent; border:1px solid var(--border);
  color:var(--muted); width:36px; height:36px; border-radius:50%;
  cursor:pointer; font-size:16px;
}
.chat-msgs {
  flex:1; overflow-y:auto; padding:8px 4px; display:flex; flex-direction:column; gap:10px;
}
.chat-empty {
  text-align:center; color:var(--muted); padding:40px 20px;
}
.chat-empty-icon { font-size:48px; margin-bottom:8px; }
.chat-msg {
  max-width:85%; padding:10px 14px; border-radius:14px;
  font-size:14px; line-height:1.5; word-wrap:break-word;
}
.chat-msg-user {
  background:var(--accent, #4f46e5); color:#fff; align-self:flex-end;
  border-bottom-right-radius:4px;
}
.chat-msg-assistant {
  background:var(--card); border:1px solid var(--border);
  align-self:flex-start; border-bottom-left-radius:4px;
  color:var(--text);
}
.chat-tool-call {
  font-size:12px; color:var(--muted);
  display:flex; gap:8px; align-items:center;
  padding:4px 0;
}
.chat-tool-name { font-weight:600; }
.chat-tool-ok { color:#10b981; }
.chat-tool-err { color:#ef4444; }
.chat-msg-body { margin-top:4px; }
.chat-typing { color:var(--muted); font-style:italic; }
.chat-input-row {
  display:flex; gap:8px; padding:8px 0 12px;
  background:var(--bg, #0a0a0a);
}
.chat-input-row textarea {
  flex:1; background:var(--card); border:1px solid var(--border);
  border-radius:12px; padding:10px 12px; color:var(--text);
  font-family:inherit; font-size:14px; resize:none;
  outline:none;
}
.chat-input-row textarea:focus { border-color:var(--accent, #4f46e5); }
.chat-send {
  background:var(--accent, #4f46e5); color:#fff; border:none;
  border-radius:12px; width:56px; font-size:20px; cursor:pointer;
  font-weight:700;
}
.chat-send:disabled { opacity:0.5; cursor:not-allowed; }

/* ── Admin prompts ────────────────────────────────────────────────────── */
.admin-prompt-card {
  background:var(--card); border:1px solid var(--border);
  border-radius:14px; padding:14px; margin-bottom:12px;
}
.admin-prompt-card h4 {
  margin:0 0 4px; font-size:14px; text-transform:uppercase;
  letter-spacing:0.5px; color:var(--text);
}
.admin-prompt-meta { color:var(--muted); font-size:11px; margin-bottom:8px; }
.admin-prompt-card textarea {
  width:100%; background:#0c0c0c; border:1px solid var(--border);
  border-radius:8px; padding:10px; color:var(--text);
  font-family:monospace; font-size:12px; line-height:1.5;
  min-height:140px; resize:vertical; outline:none;
}
.admin-prompt-actions { display:flex; gap:8px; margin-top:8px; }

.home-trend-list,
.home-record-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
}
.home-trend-row,
.home-record-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-bottom:1px solid rgba(255,255,255,0.05);
}
.home-trend-row:last-child,
.home-record-row:last-child {
  border-bottom:none;
}
.home-trend-row div,
.home-record-row div {
  min-width:0;
}
.home-trend-row strong,
.home-record-name {
  display:block;
  font-size:14px;
  color:var(--text);
  font-weight:700;
}
.home-trend-row span,
.home-record-sub {
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.home-trend-row b {
  flex-shrink:0;
  color:var(--accent);
  font-size:13px;
  text-align:right;
}
.home-positive { color:var(--accent2) !important; }
.home-negative { color:var(--orange) !important; }
.home-trend-empty {
  padding:14px;
  color:var(--muted);
  font-size:13px;
}
.home-record-val {
  text-align:right;
  flex-shrink:0;
}
.home-record-val strong {
  display:block;
  color:var(--accent);
  font-size:16px;
}
.home-record-val span {
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-top:2px;
}

@media (min-width: 768px) {
  .home-dashboard {
    padding:24px 32px 32px;
    max-width:980px;
    margin:0 auto;
  }
  .home-coach-header {
    grid-template-columns:minmax(0, 1fr) 340px;
    align-items:end;
  }
  .home-kpi-grid {
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

/* Mobile: Start button */
@media (max-width: 480px) {
  .start-btn-wrap { padding:12px; }
  .start-btn { padding:16px; font-size:16px; border-radius:12px; gap:8px; }
  .home-dashboard { padding:12px; gap:12px; }
  .home-coach-header { padding:14px; border-radius:14px; }
  .home-coach-header h1 { font-size:34px; }
  .home-panel { padding:12px; border-radius:12px; }
  .home-panel-title { font-size:18px; }
  .home-today-grid { grid-template-columns:1fr; }
  .home-kpi-grid { gap:8px; }
  .home-kpi-card { min-height:116px; padding:12px; border-radius:12px; }
  .home-kpi-value { font-size:30px; }
  .home-trend-list,
  .home-record-card { border-radius:12px; }
  .home-trend-row,
  .home-record-row { padding:12px; }
}

.prog-preview { padding:0 16px 16px; }
.prog-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.prog-row:last-child { border-bottom:none; }
.prog-name { font-size:14px; font-weight:500; }
.prog-target { font-size:12px; color:var(--muted); }

/* Mobile: Program preview */
@media (max-width: 480px) {
  .prog-preview { padding:0 12px 12px; }
  .prog-row { padding:8px 0; }
  .prog-name { font-size:13px; }
  .prog-target { font-size:11px; }
}

/* ── ACTIVITY FEED ── */
.feed-item { display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.feed-item:last-child { border-bottom:none; }
.feed-avatar { width:36px; height:36px; min-width:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:'Bebas Neue',sans-serif; font-size:18px; margin-top:2px; }
.feed-body { flex:1; min-width:0; }
.feed-row { display:flex; align-items:center; }
.feed-info { flex:1; min-width:0; }
.feed-name { font-size:14px; font-weight:600; }
.feed-meta { font-size:11px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.feed-when { font-size:11px; color:var(--muted); white-space:nowrap; flex-shrink:0; padding-left:8px; }
.feed-reactions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.react-btn {
  display:flex; align-items:center; gap:3px;
  padding:3px 9px; border-radius:20px;
  border:1.5px solid var(--border); background:none;
  cursor:pointer; font-size:13px; color:var(--muted);
  transition:all 0.15s; font-family:'DM Sans',sans-serif; line-height:1.4;
}
.react-btn.active { background:rgba(200,245,66,0.12); border-color:var(--accent); color:var(--accent); }
.react-btn:active { transform:scale(0.9); }
.react-btn .react-count { font-size:12px; font-weight:500; }
@media (max-width: 480px) {
  .feed-item { gap:10px; padding:10px 0; }
  .feed-avatar { width:34px; height:34px; min-width:34px; font-size:16px; }
  .feed-name { font-size:13px; }
  .react-btn { padding:3px 8px; font-size:12px; }
}

/* ── SESSION ── */
.session-header { background:var(--surface); border-bottom:1px solid var(--border); padding:16px; }
.session-meta { display:flex; justify-content:space-between; align-items:center; }
.session-title { font-family:'Bebas Neue',sans-serif; font-size:28px; letter-spacing:1px; }
.session-timer { font-family:'Bebas Neue',sans-serif; font-size:24px; color:var(--accent); }
.session-progress-bar { margin-top:10px; height:4px; background:var(--border); border-radius:2px; }
.session-progress-fill { height:100%; background:var(--accent); border-radius:2px; transition:width 0.3s; }

/* Mobile: Session header */
@media (max-width: 480px) {
  .session-header { padding:14px 12px; }
  .session-title { font-size:22px; }
  .session-timer { font-size:22px; }
}

.ex-cards { padding:12px 16px; display:flex; flex-direction:column; gap:10px; }

/* Mobile: Exercise cards container */
@media (max-width: 480px) {
  .ex-cards { padding:8px 12px; gap:8px; }
}

.ex-card {
  background:var(--card); border:1px solid var(--border); border-radius:16px;
  overflow:hidden; transition:border-color 0.2s;
}
.ex-card.completed { border-color:rgba(200,245,66,0.3); background:rgba(200,245,66,0.04); }
.ex-card.active-card { border-color:var(--accent); }

.ex-card-header { padding:14px 16px; display:flex; align-items:center; gap:12px; }
.ex-num-badge {
  width:40px; height:40px; min-width:40px;
  background:#222; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Bebas Neue',sans-serif; font-size:20px; color:var(--accent);
}
.ex-card.completed .ex-num-badge { background:rgba(200,245,66,0.15); color:var(--accent); }
.ex-card-info { flex:1; }
.ex-card-name { font-size:15px; font-weight:600; }
.ex-card-muscle { font-size:11px; color:var(--muted); margin-top:1px; }
.ex-card-check { font-size:22px; }

/* Mobile: Exercise cards */
@media (max-width: 480px) {
  .ex-card-header { gap:10px; padding:14px 12px; }
  .ex-num-badge { width:40px; height:40px; font-size:18px; min-width:40px; }
  .ex-card-name { font-size:15px; }
  .ex-card-muscle { font-size:12px; }
}

/* Weight control */
.weight-ctrl {
  display:flex; align-items:center; gap:0;
  background:#222; border-radius:10px; overflow:hidden;
  border:1px solid var(--border);
}
.weight-btn {
  width:40px; height:40px; border:none; background:none;
  color:var(--accent); font-size:20px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background 0.1s;
}
.weight-btn:active { background:rgba(200,245,66,0.1); }
.weight-val { font-family:'Bebas Neue',sans-serif; font-size:20px; color:var(--text); min-width:52px; text-align:center; }
.weight-unit { font-size:11px; color:var(--muted); padding-right:10px; }

/* Mobile: Weight control */
@media (max-width: 480px) {
  .weight-btn { width:48px; height:48px; font-size:22px; }
  .weight-val { font-size:20px; min-width:52px; }
  .weight-unit { font-size:12px; }
}

/* Sets */
.sets-row { display:flex; gap:8px; padding:0 16px 14px; }
.set-btn {
  flex:1; padding:12px 8px; border:1.5px solid var(--border);
  background:none; border-radius:12px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  transition:all 0.15s; min-height:62px;
}
.set-btn:active { transform:scale(0.95); }
.set-btn.in-progress { border-color:var(--orange); background:rgba(255,140,66,0.12); }
.set-btn.done { background:rgba(200,245,66,0.12); border-color:var(--accent); }
.set-lbl { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; font-weight:500; }
.set-val { font-family:'Bebas Neue',sans-serif; font-size:20px; color:var(--text); line-height:1; }
.set-btn.in-progress .set-val { color:var(--orange); }
.set-btn.done .set-val { color:var(--accent); }
.set-btn.done .set-lbl { color:rgba(200,245,66,0.6); }

/* Mobile: Sets */
@media (max-width: 480px) {
  .sets-row { gap:6px; padding:0 12px 14px; }
  .set-btn { padding:12px 6px; min-height:64px; }
  .set-lbl { font-size:11px; }
  .set-val { font-size:20px; }
}

/* Reps input below set button */
.set-reps-input {
  width:100%; margin-top:4px; background:#222; border:1px solid var(--border);
  border-radius:8px; color:var(--text); font-size:14px; text-align:center;
  padding:4px 2px; outline:none; -moz-appearance:textfield;
}
.set-reps-input::-webkit-outer-spin-button,
.set-reps-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.set-reps-input:focus { border-color:var(--accent); }

/* Cardio & isometric inputs */
.cardio-row { display:flex; gap:8px; padding:0 16px 14px; }
.cardio-field { flex:1; background:#222; border:1px solid var(--border); border-radius:12px; padding:10px 12px; }
.cardio-field label { display:block; font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; font-weight:500; }
.cardio-field input {
  width:100%; background:none; border:none; color:var(--text);
  font-family:'Bebas Neue',sans-serif; font-size:22px; outline:none;
}

/* Mobile: Cardio */
@media (max-width: 480px) {
  .cardio-row { gap:6px; padding:0 12px 14px; }
  .cardio-field { padding:10px; }
  .cardio-field label { font-size:11px; margin-bottom:4px; }
  .cardio-field input { font-size:20px; }
}

.done-toggle {
  margin:0 16px 14px;
  padding:14px; border:1.5px solid var(--border);
  background:none; border-radius:12px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px;
  font-size:15px; font-weight:500; color:var(--muted);
  transition:all 0.15s; width:calc(100% - 32px);
}
.done-toggle.done { border-color:var(--accent); color:var(--accent); background:rgba(200,245,66,0.1); }

.rest-coach {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:520px;
  padding:12px 16px 20px;
  border-top:1px solid rgba(255,140,66,0.4);
  background:rgba(20,20,20,0.97);
  backdrop-filter:blur(12px);
  z-index:200;
  display:flex; align-items:center; gap:16px;
}
.rest-coach-title { font-size:11px; color:var(--orange); text-transform:uppercase; letter-spacing:1px; }
.rest-coach-timer { font-family:'Bebas Neue',sans-serif; font-size:36px; color:var(--orange); line-height:1; }
.rest-coach-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.rest-coach-info { flex:1; }
.rest-coach-dismiss { background:rgba(255,140,66,0.15); border:1px solid rgba(255,140,66,0.4); color:var(--orange); border-radius:8px; padding:8px 14px; font-size:13px; cursor:pointer; white-space:nowrap; }

/* Mobile: Done toggle */
@media (max-width: 480px) {
  .done-toggle { margin:0 12px 12px; width:calc(100% - 24px); padding:12px; font-size:14px; }
}

.session-footer { padding:16px; }
.session-notes { width:100%; background:var(--card); border:1px solid var(--border); border-radius:12px; padding:12px 14px; color:var(--text); font-family:'DM Sans',sans-serif; font-size:14px; resize:none; outline:none; margin-bottom:12px; }

/* Mobile: Form fields */
@media (max-width: 480px) {
  .session-notes { font-size:13px; padding:10px 12px; }
}

/* ── HISTORY ── */
.history-session { background:var(--card); border:1px solid var(--border); border-radius:16px; overflow:hidden; margin-bottom:10px; }
.hs-header { padding:14px 16px; display:flex; justify-content:space-between; align-items:center; cursor:pointer; }
.hs-date { font-size:16px; font-weight:600; }
.hs-meta { font-size:12px; color:var(--muted); margin-top:2px; }
.hs-badge { display:flex; align-items:center; gap:8px; }
.hs-detail { border-top:1px solid var(--border); padding:14px 16px; display:none; }
.hs-detail.open { display:block; }
.hs-ex-row { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px solid var(--border); }
.hs-ex-row:last-child { border-bottom:none; }
.hs-ex-name { font-size:13px; font-weight:500; }
.hs-ex-val { font-size:12px; color:var(--muted); }
.hs-delete { margin-top:12px; padding:10px; background:rgba(255,77,77,0.1); border:1px solid rgba(255,77,77,0.2); border-radius:10px; color:var(--red); font-size:13px; cursor:pointer; width:100%; font-family:'DM Sans',sans-serif; }
.hs-ex-block { margin-bottom:6px; border-bottom:1px solid var(--border); padding-bottom:6px; }
.hs-ex-block:last-of-type { border-bottom:none; }
.hs-set-row { display:flex; align-items:center; gap:6px; padding:3px 0 3px 12px; }
.hs-set-lbl { font-size:12px; color:var(--muted); min-width:52px; }
.hs-reps-input { width:54px; background:#222; border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:13px; text-align:center; padding:3px 4px; outline:none; -moz-appearance:textfield; }
.hs-reps-input::-webkit-outer-spin-button, .hs-reps-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.hs-reps-input:focus { border-color:var(--accent); }
.hs-set-sep { font-size:12px; color:var(--muted); }
.hs-set-kg { font-size:13px; color:var(--text); }

/* Mobile: History */
@media (max-width: 480px) {
  .hs-header { gap:8px; padding:14px 12px; min-height:56px; }
  .hs-date { font-size:15px; }
  .hs-meta { font-size:12px; }
  .hs-detail { padding:12px; }
  .hs-ex-name { font-size:13px; }
  .hs-ex-val { font-size:12px; }
  .hs-delete { padding:12px; font-size:13px; }
}

.chart-wrap { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:16px; margin-bottom:10px; }
.chart-title { font-family:'Bebas Neue',sans-serif; font-size:18px; letter-spacing:0.5px; margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; }
.chart-container { position:relative; height:140px; }

/* Mobile: Charts */
@media (max-width: 480px) {
  .chart-wrap { padding:12px; }
  .chart-title { font-size:14px; }
  .chart-container { height:120px; }
}

/* ── PROGRAMME ── */
.prog-card { background:var(--card); border:1px solid var(--border); border-radius:16px; overflow:hidden; margin-bottom:10px; }
.prog-card-header { padding:14px 16px; display:flex; align-items:center; gap:12px; cursor:pointer; }
.prog-card-num { width:40px; height:40px; min-width:40px; background:#222; border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:'Bebas Neue',sans-serif; font-size:20px; color:var(--accent); }
.prog-card-info { flex:1; }
.prog-card-name { font-size:15px; font-weight:600; }
.prog-card-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.prog-card-arrow { color:var(--muted); font-size:18px; transition:transform 0.2s; }
.prog-card.open .prog-card-arrow { transform:rotate(180deg); }


.program-category {
  background:rgba(255,255,255,0.015); border:1px solid var(--border);
  border-radius:18px; padding:12px; margin-bottom:14px;
}
.program-category-header {
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px;
}
.program-category-title {
  font-family:'Bebas Neue',sans-serif; font-size:20px; letter-spacing:0.8px; color:var(--text);
}
.program-category-count { font-size:12px; color:var(--muted); margin-top:2px; }
.program-category-body { display:flex; flex-direction:column; gap:10px; }
.program-category-body .prog-card { margin-bottom:0; }
.program-category-empty {
  border:1px dashed var(--border); border-radius:14px; padding:16px; text-align:center;
  color:var(--muted); font-size:13px; background:rgba(0,0,0,0.12);
}
.program-category-add {
  border:1.5px solid rgba(200,245,66,0.35); background:rgba(200,245,66,0.08); color:var(--accent);
  border-radius:999px; padding:8px 12px; font-size:13px; font-weight:700; cursor:pointer;
  font-family:'DM Sans',sans-serif; white-space:nowrap;
}
.program-category-add:active { transform:scale(0.96); background:rgba(200,245,66,0.14); }

/* Mobile: Programme cards */
@media (max-width: 480px) {
  .program-category { padding:10px; margin-bottom:12px; }
  .program-category-title { font-size:18px; }
  .program-category-add { padding:8px 10px; font-size:12px; }
  .prog-card-header { gap:10px; padding:14px 12px; min-height:56px; }
  .prog-card-num { width:40px; height:40px; min-width:40px; font-size:18px; }
  .prog-card-name { font-size:15px; }
  .prog-card-sub { font-size:12px; }
}

.prog-edit-form { border-top:1px solid var(--border); padding:16px; display:none; }
.prog-card.open .prog-edit-form { display:block; }
.catalog-meta-box {
  border:1px solid var(--border); border-radius:12px; padding:12px;
  background:rgba(255,255,255,0.025); margin-bottom:14px;
}
.catalog-meta-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.catalog-meta-name { font-size:15px; font-weight:700; }
.catalog-meta-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.catalog-meta-pill {
  flex-shrink:0; border:1px solid rgba(200,245,66,0.24); border-radius:999px;
  color:var(--accent); padding:5px 8px; font-size:11px; font-weight:800;
}
.catalog-meta-note {
  margin-top:10px; padding-top:10px; border-top:1px solid var(--border);
  font-size:12px; line-height:1.35; color:var(--muted);
}
.form-row { display:flex; gap:8px; margin-bottom:12px; }
.form-field { flex:1; }
.form-field label { display:block; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:6px; font-weight:500; }
.form-field input,
.form-field select {
  width:100%; background:#222; border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; color:var(--text); font-size:15px; font-family:'DM Sans',sans-serif;
  outline:none; transition:border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus { border-color:var(--accent); }
.form-save { width:100%; padding:12px; background:var(--accent); color:#111; border:none; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; }

/* Mobile: Form fields */
@media (max-width: 480px) {
  .prog-edit-form { padding:12px; }
  .form-row { gap:6px; }
  .form-field label { font-size:10px; margin-bottom:4px; }
  .form-field input,
  .form-field select { font-size:14px; padding:8px 10px; }
  .form-save { padding:10px; font-size:13px; }
}

/* ── PROFILE ── */
.profile-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
}
.profile-llm-status {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#222;
  margin-bottom:12px;
  font-size:13px;
}
.profile-llm-status span { color:var(--muted); }
.profile-llm-status strong { color:var(--accent); font-size:13px; }
.profile-llm-actions { display:flex; gap:8px; }
.profile-llm-actions .form-save,
.profile-llm-actions .btn-secondary { flex:1; }

.prog-pr { display:flex; gap:8px; margin-bottom:14px; }
.pr-item { flex:1; background:#222; border-radius:10px; padding:10px; text-align:center; }
.pr-val { font-family:'Bebas Neue',sans-serif; font-size:22px; color:var(--accent2); }
.pr-lbl { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; }

/* Mobile: PR items */
@media (max-width: 480px) {
  .pr-item { padding:10px; }
  .pr-val { font-size:20px; }
  .pr-lbl { font-size:11px; }
}

/* ── CONFIRM MODAL ── */
#modal-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7);
  z-index:200; align-items:flex-end; justify-content:center;
}
#modal-overlay.open { display:flex; }
#modal {
  background:var(--card); border:1px solid var(--border); border-radius:20px 20px 0 0;
  padding:24px 20px; width:100%; max-width:480px;
  animation:slideUp 0.25s ease;
}
#modal h3 { font-family:'Bebas Neue',sans-serif; font-size:24px; letter-spacing:1px; margin-bottom:8px; }
#modal p { font-size:14px; color:var(--muted); margin-bottom:20px; }
.modal-btns { display:flex; gap:8px; }
.modal-btns button { flex:1; padding:14px; border-radius:12px; font-size:15px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; border:none; }
.modal-cancel { background:var(--surface); color:var(--text); border:1px solid var(--border) !important; }
.modal-confirm { background:var(--red); color:#fff; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

/* Mobile: Modal */
@media (max-width: 480px) {
  #modal { padding:24px 16px; }
  #modal h3 { font-size:22px; }
  #modal p { font-size:14px; }
  .modal-btns button { padding:16px; font-size:15px; min-height:52px; }
}

/* ── EMPTY / LOADING ── */
.empty-state { text-align:center; padding:60px 20px; color:var(--muted); }
.empty-icon { font-size:48px; margin-bottom:12px; }
.empty-title { font-size:16px; font-weight:500; color:var(--text); margin-bottom:6px; }
.empty-sub { font-size:13px; }
.loading { text-align:center; padding:40px; color:var(--muted); font-size:14px; }

/* Mobile: Empty state */
@media (max-width: 480px) {
  .empty-state { padding:40px 16px; }
  .empty-icon { font-size:40px; }
  .empty-title { font-size:14px; }
  .empty-sub { font-size:12px; }
}

/* ── TOAST ── */
#toast {
  position:fixed; bottom:calc(var(--nav-h) + 16px); left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--accent); color:#111; padding:10px 20px; border-radius:20px;
  font-size:14px; font-weight:600; opacity:0; transition:all 0.3s; z-index:999; white-space:nowrap;
}
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Mobile: Toast - avoid hiding behind nav */
@media (max-width: 480px) {
  #toast { font-size:13px; padding:8px 16px; }
}

/* ── ADD EXERCISE SHEET ── */
#add-sheet-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7);
  z-index:200; align-items:flex-end; justify-content:center;
}
#add-sheet-overlay.open { display:flex; }
#add-sheet {
  background:var(--card); border:1px solid var(--border); border-radius:20px 20px 0 0;
  padding:24px 20px calc(24px + env(safe-area-inset-bottom)); width:100%; max-width:480px;
  animation:slideUp 0.25s ease; max-height:90vh; overflow-y:auto;
}
#add-sheet h3 { font-family:'Bebas Neue',sans-serif; font-size:24px; letter-spacing:1px; margin-bottom:16px; }
.add-tabs {
  display:flex; gap:4px; margin-bottom:14px; padding:4px;
  background:var(--surface); border-radius:10px;
}
.add-tab {
  flex:1; border:none; border-radius:8px; background:none; color:var(--muted);
  padding:9px 10px; font-size:14px; font-weight:700; cursor:pointer;
  font-family:'DM Sans',sans-serif;
}
.add-tab.active { background:var(--card); color:var(--text); }
.catalog-filter-row {
  display:flex; gap:6px; overflow-x:auto; padding-bottom:6px; margin-bottom:10px;
}
.catalog-filter {
  border:1.5px solid var(--border); background:none; color:var(--muted);
  border-radius:999px; padding:8px 10px; white-space:nowrap; cursor:pointer;
  font-size:12px; font-weight:700; font-family:'DM Sans',sans-serif;
}
.catalog-filter.selected {
  border-color:var(--accent); color:var(--accent); background:rgba(200,245,66,0.08);
}
.catalog-results {
  display:flex; flex-direction:column; gap:8px; min-height:180px; max-height:42vh; overflow-y:auto;
  padding-right:2px;
}
.catalog-row {
  width:100%; display:flex; align-items:center; gap:10px; text-align:left;
  border:1px solid var(--border); background:rgba(255,255,255,0.025);
  color:var(--text); border-radius:12px; padding:12px; cursor:pointer;
  font-family:'DM Sans',sans-serif;
}
.catalog-row:active { border-color:var(--accent); }
.catalog-row:disabled {
  cursor:default; opacity:0.58; background:rgba(255,255,255,0.015);
}
.catalog-row-main { flex:1; min-width:0; }
.catalog-row-name { font-size:14px; font-weight:700; }
.catalog-row-sub {
  min-height:16px; font-size:12px; color:var(--muted); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.catalog-row-target { font-size:12px; color:var(--accent2); margin-top:4px; }
.catalog-row-status {
  flex-shrink:0; font-size:11px; font-weight:800; color:var(--accent);
  border:1px solid rgba(200,245,66,0.24); border-radius:999px; padding:6px 8px;
}
.catalog-row:disabled .catalog-row-status { color:var(--muted); border-color:var(--border); }
.catalog-empty {
  border:1px dashed var(--border); border-radius:12px; color:var(--muted);
  padding:18px 14px; text-align:center; font-size:13px;
}
.catalog-inline-action {
  display:block; margin:10px auto 0; border:none; background:none; color:var(--accent);
  font:inherit; font-weight:700; cursor:pointer;
}
.type-picker { display:flex; gap:8px; margin-bottom:16px; }
.type-btn {
  flex:1; padding:10px 4px; border:1.5px solid var(--border); background:none;
  border-radius:12px; font-size:12px; font-weight:600; color:var(--muted);
  cursor:pointer; font-family:'DM Sans',sans-serif; transition:all 0.15s;
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.type-btn.selected { border-color:var(--accent); color:var(--accent); background:rgba(200,245,66,0.08); }
.type-btn .type-icon { font-size:20px; }
.drag-handle {
  width:32px; height:44px; border:none; background:none;
  color:var(--muted); font-size:20px; cursor:grab; touch-action:none;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.drag-handle:active { cursor:grabbing; color:var(--accent); }
.prog-card.dragging { opacity:0.25; }
.prog-list-card.plc-dragging { opacity:0.25; }
.btn-danger {
  width:100%; padding:12px; background:rgba(255,77,77,0.08); color:var(--red);
  border:1px solid rgba(255,77,77,0.2); border-radius:10px; font-size:14px;
  cursor:pointer; font-family:'DM Sans',sans-serif; margin-top:12px;
  transition:background 0.15s;
}
.btn-danger:active { background:rgba(255,77,77,0.18); }

/* ── LOGIN ── */
#login-overlay {
  position:fixed; inset:0; z-index:500; background:var(--bg);
  display:flex; align-items:center; justify-content:center; padding:24px;
}
#login-overlay.hidden { display:none; }
#login-box { width:100%; max-width:360px; }
.login-logo { font-family:'Bebas Neue',sans-serif; font-size:52px; line-height:0.9; letter-spacing:1px; margin-bottom:8px; }
.login-logo span { color:var(--accent); }
.login-sub { font-size:13px; color:var(--muted); margin-bottom:32px; }
.login-field { margin-bottom:12px; }
.login-field input {
  width:100%; padding:14px 16px; background:var(--surface);
  border:1px solid var(--border); border-radius:12px; color:var(--text);
  font-size:16px; font-family:'DM Sans',sans-serif; outline:none; transition:border-color 0.2s;
}
.login-field input:focus { border-color:var(--accent); }
#login-error { color:var(--red); font-size:13px; min-height:20px; margin-bottom:8px; text-align:center; }

/* ── ADMIN ── */
.admin-user-card { background:var(--card); border:1px solid var(--border); border-radius:16px; margin-bottom:10px; overflow:hidden; }
.admin-user-header { display:flex; align-items:center; gap:12px; padding:14px 16px; cursor:pointer; }
.admin-user-name { font-size:16px; font-weight:600; }
.admin-user-meta { font-size:12px; color:var(--muted); margin-top:2px; }
.admin-user-edit { display:none; padding:16px; border-top:1px solid var(--border); }
.admin-user-edit.open { display:block; }
.admin-action-row { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.tag-red { background:rgba(255,77,77,0.12); color:var(--red); }
.tag-muted { background:rgba(100,100,100,0.12); color:var(--muted); }

/* ── PROGRAM LIST ── */
.prog-list-card {
  background:var(--card); border:1px solid var(--border); border-radius:16px;
  padding:16px; margin-bottom:10px; display:flex; align-items:center; gap:8px;
  cursor:pointer; transition:border-color 0.2s;
}
.prog-list-card:active { border-color:var(--accent); }
.plc-info { flex:1; min-width:0; }
.plc-name { font-size:16px; font-weight:600; }
.plc-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.plc-btn {
  width:34px; height:34px; border:none; background:rgba(255,255,255,0.05);
  border-radius:8px; cursor:pointer; font-size:15px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  transition:background 0.1s;
}
.plc-btn:active { background:rgba(255,255,255,0.12); }
.plc-btn-del:active { background:rgba(255,77,77,0.18); }

/* ── SESSION SETUP ── */
.prog-sel-btn {
  padding:8px 16px; border:1.5px solid var(--border); background:none;
  border-radius:20px; font-size:13px; font-weight:500; color:var(--muted);
  cursor:pointer; font-family:'DM Sans',sans-serif; transition:all 0.15s;
}
.prog-sel-btn.selected { border-color:var(--accent); color:var(--accent); background:rgba(200,245,66,0.08); }
.setup-ex-row {
  display:flex; align-items:center; gap:12px;
  padding:13px 0; border-bottom:1px solid var(--border); cursor:pointer;
}
.setup-ex-row:last-child { border-bottom:none; }
.setup-ex-check {
  width:28px; height:28px; min-width:28px; border-radius:8px;
  border:1.5px solid var(--border); display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--accent); transition:all 0.15s;
}
.setup-ex-check.checked { background:rgba(200,245,66,0.15); border-color:var(--accent); }
.setup-ex-info { flex:1; min-width:0; }
.setup-ex-name { font-size:14px; font-weight:500; }
.setup-ex-target { font-size:12px; color:var(--muted); margin-top:1px; }

/* ── PROGRAM NAME SHEET ── */
#prog-name-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7);
  z-index:200; align-items:flex-end; justify-content:center;
}
#prog-name-overlay.open { display:flex; }
#prog-name-sheet {
  background:var(--card); border:1px solid var(--border); border-radius:20px 20px 0 0;
  padding:24px 20px calc(24px + env(safe-area-inset-bottom)); width:100%; max-width:480px;
  animation:slideUp 0.25s ease;
}
#prog-name-sheet h3 { font-family:'Bebas Neue',sans-serif; font-size:24px; letter-spacing:1px; margin-bottom:16px; }

/* ── PLAN NAME SHEET ── */
#plan-name-overlay, #session-summary-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7);
  z-index:200; align-items:flex-end; justify-content:center;
}
#plan-name-overlay.open, #session-summary-overlay.open { display:flex; }
#session-summary-sheet {
  background:var(--card); border:1px solid var(--border); border-radius:20px 20px 0 0;
  padding:24px 20px calc(24px + env(safe-area-inset-bottom)); width:100%; max-width:480px;
  animation:slideUp 0.25s ease;
}
#session-summary-sheet h3 { font-family:'Bebas Neue',sans-serif; font-size:24px; letter-spacing:1px; margin-bottom:4px; }
.summary-score { font-size:13px; color:var(--muted); margin-bottom:16px; }
.summary-ex-row {
  display:flex; align-items:center; gap:10px;
  padding:9px 0; border-bottom:1px solid var(--border);
}
.summary-ex-row:last-of-type { border-bottom:none; }
.summary-ex-icon { font-size:18px; flex-shrink:0; width:24px; text-align:center; }
.summary-ex-info { flex:1; min-width:0; }
.summary-ex-name { font-size:14px; font-weight:600; }
.summary-ex-vals { font-size:12px; color:var(--muted); margin-top:1px; }
#plan-name-sheet {
  background:var(--card); border:1px solid var(--border); border-radius:20px 20px 0 0;
  padding:24px 20px calc(24px + env(safe-area-inset-bottom)); width:100%; max-width:480px;
  animation:slideUp 0.25s ease;
}
#plan-name-sheet h3 { font-family:'Bebas Neue',sans-serif; font-size:24px; letter-spacing:1px; margin-bottom:16px; }

/* ── PLAN CARDS ── */
.plan-card {
  background:var(--card); border:1px solid var(--border); border-radius:14px;
  padding:14px 16px; margin-bottom:10px;
}
.plan-card-header { display:flex; align-items:flex-start; gap:10px; margin-bottom:10px; }
.plan-card-info { flex:1; min-width:0; cursor:pointer; }
.plan-card-name { font-size:16px; font-weight:600; }
.plan-card-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.plan-progress-bar { height:6px; background:var(--border); border-radius:3px; overflow:hidden; margin-bottom:6px; }
.plan-progress-fill { height:100%; background:var(--accent); border-radius:3px; }
.plan-progress-label { font-size:12px; color:var(--muted); }

/* ── PLAN TABS ── */
.plan-tabs { display:flex; gap:4px; margin-bottom:16px; background:var(--surface); border-radius:10px; padding:4px; }
.plan-tab { flex:1; padding:8px; border:none; border-radius:8px; background:none; color:var(--muted); cursor:pointer; font-size:14px; font-weight:500; font-family:inherit; transition:all 0.2s; }
.plan-tab.active { background:var(--card); color:var(--text); }

/* ── PLAN TRACKING TAB ── */
.plan-track-card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:14px 14px 10px; margin-bottom:12px; }
.plan-track-header { font-size:14px; font-weight:600; margin-bottom:2px; }
.plan-track-sub { font-size:12px; color:var(--muted); margin-bottom:10px; }
.plan-track-chart { position:relative; height:140px; }
.plan-track-legend { display:flex; gap:14px; margin-top:8px; }
.plan-track-legend-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--muted); }
.plan-track-legend-dot { width:20px; height:2px; border-radius:1px; }

/* ── PLAN SESSIONS TAB ── */
.plan-sess-week { margin-bottom:14px; }
.plan-sess-week-label { font-size:11px; color:var(--muted); font-weight:600; letter-spacing:0.5px; text-transform:uppercase; margin-bottom:6px; }
.plan-sess-row { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:10px 12px; margin-bottom:6px; }
.plan-sess-main { display:flex; align-items:center; gap:10px; }
.plan-sess-icon { font-size:18px; flex-shrink:0; }
.plan-sess-info { flex:1; min-width:0; }
.plan-sess-date { font-size:14px; font-weight:600; }
.plan-sess-prog { font-size:12px; color:var(--muted); margin-top:1px; }
.plan-sess-actions { display:flex; gap:4px; flex-shrink:0; }
.plan-sess-edit { margin-top:10px; display:flex; flex-direction:column; gap:6px; }

/* ── CALENDAR ── */
.cal-header { display:flex; align-items:center; justify-content:space-between; padding:0 0 16px; }
.cal-month-label { font-family:'Bebas Neue',sans-serif; font-size:28px; letter-spacing:1px; }
.cal-nav-btn { background:var(--surface); border:1px solid var(--border); color:var(--text); width:38px; height:38px; border-radius:10px; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.cal-nav-btn:active { opacity:0.7; }
.cal-nav-btn:disabled { opacity:0.3; cursor:default; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; margin-bottom:16px; }
.cal-day-name { text-align:center; font-size:10px; color:var(--muted); font-weight:600; padding:6px 0 8px; letter-spacing:0.5px; }
.cal-day { aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:10px; font-size:13px; font-weight:500; position:relative; color:var(--muted); }
.cal-day.in-month { color:var(--text); }
.cal-day.has-session { background:rgba(200,245,66,0.1); color:var(--accent); cursor:pointer; }
.cal-day.has-planned { background:rgba(96,165,250,0.12); color:#60a5fa; cursor:pointer; }
.cal-day.has-missed  { background:rgba(255,77,77,0.12);   color:var(--red); cursor:pointer; }
.cal-day.has-session:active,.cal-day.has-planned:active,.cal-day.has-missed:active { opacity:0.7; }
.cal-day.today { box-shadow:0 0 0 1.5px var(--accent); }
.cal-day.selected { background:var(--accent) !important; color:#111 !important; }
.cal-dot { width:4px; height:4px; border-radius:50%; background:var(--accent); position:absolute; bottom:5px; left:50%; transform:translateX(-50%); }
.cal-dot.planned { background:#60a5fa; }
.cal-dot.missed  { background:var(--red); }
.cal-day.selected .cal-dot { background:#111; }
.cal-detail-card { background:var(--card); border:1px solid var(--border); border-radius:16px; padding:16px; animation:fadeIn 0.2s ease; }
.cal-detail-date { font-size:16px; font-weight:600; margin-bottom:4px; }
.cal-detail-meta { font-size:13px; color:var(--muted); margin-bottom:12px; }
.cal-detail-ex { padding:8px 0; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; gap:8px; }
.cal-detail-ex:last-of-type { border-bottom:none; }
.cal-detail-ex-name { font-size:14px; font-weight:500; }
.cal-detail-ex-val { font-size:12px; color:var(--muted); text-align:right; }
.cal-reactions { display:flex; gap:8px; margin-top:14px; padding-top:12px; border-top:1px solid var(--border); }
.cal-session-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; margin-top:12px; }
.cal-session-actions .cal-edit-btn { flex:1 1 150px; margin:0; }
.cal-delete { flex:0 0 auto; padding:7px 10px; background:none; border:1px solid rgba(248,113,113,0.45); color:var(--red); border-radius:999px; font-size:12px; cursor:pointer; font-family:'DM Sans',sans-serif; line-height:1.1; }
.cal-delete:active { opacity:0.7; }
.cal-day.in-month { color:var(--text); cursor:pointer; }
.cal-photo-dot { width:4px; height:4px; border-radius:50%; background:#818cf8; position:absolute; bottom:5px; left:50%; transform:translateX(-50%); }
.cal-day.has-session.has-photo .cal-dot { transform:translateX(calc(-50% - 4px)); }
.cal-day.has-session.has-photo .cal-photo-dot { transform:translateX(calc(-50% + 4px)); }
.cal-day.selected .cal-photo-dot { background:#111; }
.cal-photo-section { margin-bottom:14px; }
.cal-photo-img { width:100%; border-radius:12px; display:block; object-fit:cover; max-height:340px; }
.cal-photo-actions { display:flex; gap:8px; margin-top:8px; }
.cal-photo-change-btn { flex:1; padding:8px; background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:10px; font-size:13px; cursor:pointer; font-family:'DM Sans',sans-serif; text-align:center; display:flex; align-items:center; justify-content:center; gap:4px; }
.cal-photo-del-btn { padding:8px 14px; background:none; border:1px solid var(--red); color:var(--red); border-radius:10px; font-size:13px; cursor:pointer; font-family:'DM Sans',sans-serif; }
.cal-photo-del-btn:active,.cal-photo-change-btn:active { opacity:0.7; }
.cal-photo-upload-row { display:flex; gap:8px; }
.cal-photo-upload { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; border:2px dashed var(--border); border-radius:12px; padding:20px 8px; cursor:pointer; color:var(--muted); font-size:13px; gap:6px; }
.cal-photo-upload:active { opacity:0.7; }
.cal-photo-upload-icon { font-size:28px; }
.cal-slideshow { position:relative; display:flex; align-items:center; gap:6px; }
.cal-slideshow .cal-photo-img { flex:1; min-width:0; }
.cal-slide-btn { flex:0 0 auto; background:rgba(0,0,0,0.5); border:none; color:#fff; font-size:22px; line-height:1; border-radius:50%; width:34px; height:34px; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.cal-slide-btn:disabled { opacity:0.25; cursor:default; }
.cal-slide-btn:not(:disabled):active { opacity:0.7; }
.cal-photo-counter { display:block; text-align:center; font-size:12px; color:var(--muted); margin:4px 0 0; }
.cal-session-divider { border:none; border-top:1px solid var(--border); margin:14px 0; }
.cal-nutrition-readonly { display:flex; flex-direction:column; gap:10px; }
.cal-nutrition-status {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
}
.cal-nutrition-status strong { display:block; font-size:13px; color:var(--text); }
.cal-nutrition-status span { display:block; margin-top:2px; font-size:11px; color:var(--muted); line-height:1.3; }
.cal-nutrition-status .btn-secondary { width:auto; padding:7px 10px; font-size:12px; flex-shrink:0; }
.cal-nutrition-status--excluded,
.cal-nutrition-status--missing {
  border-color:rgba(224,101,59,0.35);
  background:rgba(224,101,59,0.08);
}
.cal-nutrition-status--excluded strong,
.cal-nutrition-status--missing strong { color:#ff9a70; }
.cal-nutrition-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.cal-nutrition-stat { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px; min-width:0; }
.cal-nutrition-stat-top { display:flex; justify-content:space-between; gap:8px; align-items:center; font-size:11px; color:var(--muted); }
.cal-nutrition-stat-top strong { color:var(--text); font-size:13px; white-space:nowrap; }
.cal-nutrition-stat .nutrition-bar { margin-top:7px; }
.cal-nutrition-target { margin-top:6px; font-size:10px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-nutrition-macros { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
.cal-nutrition-macros span { background:rgba(255,255,255,.03); border:1px solid var(--border); border-radius:8px; padding:8px 6px; color:var(--muted); font-size:10px; text-align:center; }
.cal-nutrition-macros strong { display:block; margin-top:2px; color:var(--text); font-size:12px; }
.cal-nutrition-empty { color:var(--muted); font-size:12px; text-align:center; padding:4px 0; }

/* ── PLAN CONFIG ── */
.pc-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -4px; padding:0 4px; }
.pc-table { border-collapse:collapse; min-width:100%; font-size:13px; }
.pc-table th { background:var(--surface); color:var(--muted); font-weight:600; font-size:10px; text-transform:uppercase; letter-spacing:0.5px; padding:8px 10px; white-space:nowrap; position:sticky; top:0; z-index:1; }
.pc-table th.ex-col { text-align:left; position:sticky; left:0; z-index:2; background:var(--surface); min-width:110px; max-width:140px; }
.pc-table td { padding:6px 4px; border-bottom:1px solid var(--border); vertical-align:middle; }
.pc-table td.ex-name { position:sticky; left:0; background:var(--card); z-index:1; padding:6px 10px; font-weight:500; white-space:nowrap; max-width:140px; overflow:hidden; text-overflow:ellipsis; }
.pc-table td.ex-name small { display:block; color:var(--muted); font-size:11px; font-weight:400; }
.pc-week-input { width:60px; background:#222; border:1px solid var(--border); border-radius:6px; padding:5px 4px; color:var(--text); font-size:13px; font-family:'DM Sans',sans-serif; text-align:center; outline:none; transition:border-color 0.15s; }
.pc-week-input:focus { border-color:var(--accent); }
.pc-fill-row { display:flex; align-items:center; gap:6px; padding:8px 0 4px; flex-wrap:wrap; }
.pc-fill-label { font-size:11px; color:var(--muted); white-space:nowrap; }
.pc-fill-input { width:58px; background:#222; border:1px solid var(--border); border-radius:6px; padding:5px 6px; color:var(--text); font-size:13px; font-family:'DM Sans',sans-serif; text-align:center; outline:none; }
.pc-fill-btn { background:var(--accent); color:#111; border:none; border-radius:6px; padding:5px 10px; font-size:12px; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; white-space:nowrap; }
.pc-fill-btn:active { opacity:0.8; }
.pc-ex-card { background:var(--card); border:1px solid var(--border); border-radius:12px; margin-bottom:10px; overflow:hidden; }
.pc-ex-header { padding:10px 14px 4px; font-weight:600; font-size:14px; display:flex; align-items:baseline; gap:6px; }
.pc-ex-sub { font-size:11px; color:var(--muted); font-weight:400; }

/* ── MANUAL SESSION ── */
.ms-ex-block { border:1px solid var(--border); border-radius:12px; margin-bottom:8px; overflow:hidden; }
.ms-ex-header { display:flex; align-items:center; gap:12px; padding:13px 14px; cursor:pointer; }
.ms-ex-sets { padding:0 14px 14px; }
.ms-sets-table { width:100%; border-collapse:collapse; margin-bottom:8px; }
.ms-sets-table th { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; padding:6px 4px 6px 0; text-align:left; font-weight:500; }
.ms-sets-table td { padding:3px 4px 3px 0; vertical-align:middle; }
.ms-set-num { text-align:center; color:var(--muted); font-size:13px; width:28px; }
.ms-set-input { width:100%; background:#222; border:1px solid var(--border); border-radius:8px; padding:7px 8px; color:var(--text); font-size:14px; font-family:'DM Sans',sans-serif; outline:none; text-align:center; transition:border-color 0.15s; }
.ms-set-input:focus { border-color:var(--accent); }
.ms-add-set { background:none; border:none; color:var(--accent); font-size:13px; font-weight:500; cursor:pointer; padding:4px 0; font-family:'DM Sans',sans-serif; }
.ms-del-set { background:none; border:none; color:var(--muted); font-size:18px; cursor:pointer; padding:4px 6px; line-height:1; }
.ms-del-set:active { color:var(--red); }
.ms-add-btn { background:none; border:1px solid var(--border); color:var(--accent); border-radius:8px; padding:7px 12px; font-size:12px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; white-space:nowrap; }

/* ── DIFFICULTY PICKER ── */
.difficulty-picker { padding:0 16px 14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.difficulty-label { font-size:12px; color:var(--muted); font-weight:500; white-space:nowrap; }
.difficulty-btns { display:flex; gap:6px; flex-wrap:wrap; }
.diff-btn { background:var(--card); border:1px solid var(--border); border-radius:20px; padding:5px 12px; font-size:12px; font-weight:600; color:var(--muted); cursor:pointer; font-family:'DM Sans',sans-serif; transition:all 0.15s; white-space:nowrap; }
.diff-btn:active { transform:scale(0.95); }
.diff-btn.selected { color:#111; }
.diff-btn.selected.easy { background:#c8f542; border-color:#c8f542; }
.diff-btn.selected.medium { background:#ffa500; border-color:#ffa500; }
.diff-btn.selected.hard { background:#ff4d4d; border-color:#ff4d4d; }
/* Per-set difficulty row */
.set-col { display:flex; flex-direction:column; align-items:center; }
.set-difficulty-row { display:flex; justify-content:center; gap:4px; margin-top:4px; }
.diff-btn-sm { padding:3px 7px; font-size:14px; border-radius:16px; }

/* ── NUTRITION ── */
.nutrition-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.nutrition-date-row { display:flex; align-items:center; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.nutrition-date-row input[type="date"] { flex:1 1 150px; min-width:0; }
.nutrition-date-row .btn-secondary { width:auto; flex:0 0 auto; padding:8px 12px; font-size:13px; }
.nutrition-day-status-btn.active { border-color:rgba(224,101,59,0.55); color:#ff9a70; background:rgba(224,101,59,0.12); }

/* Premium Cards Glassmorphism */
.nutrition-score-card,
.nutrition-setup-card,
.nutrition-water-card,
.nutrition-meal-card {
  background: linear-gradient(145deg, rgba(24, 24, 24, 0.9), rgba(18, 18, 18, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}
.nutrition-score-card--hero {
  border: 1px solid rgba(201, 255, 47, 0.12);
  background: linear-gradient(145deg, rgba(28, 30, 24, 0.95), rgba(18, 18, 18, 0.95));
}
.nutrition-day-status {
  display:flex;
  flex-direction:column;
  gap:3px;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:10px;
}
.nutrition-day-status strong { font-size:13px; color:var(--text); }
.nutrition-day-status span { font-size:12px; color:var(--muted); line-height:1.35; }
.nutrition-day-status--excluded,
.nutrition-day-status--missing {
  border-color:rgba(224,101,59,0.35);
  background:rgba(224,101,59,0.08);
}
.nutrition-day-status--excluded strong,
.nutrition-day-status--missing strong { color:#ff9a70; }
.nutrition-score-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.nutrition-score-value { font-family:'Bebas Neue',sans-serif; font-size:34px; line-height:1; color:var(--accent); }
.nutrition-score-label { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; margin-top:3px; }
.nutrition-score-badge { background:rgba(200,245,66,0.13); color:var(--accent); border:1px solid rgba(200,245,66,0.22); border-radius:999px; padding:5px 10px; font-size:12px; font-weight:700; }
.nutrition-bar,
.nutrition-macro-bar { height:5px; background:#222; border-radius:999px; overflow:hidden; }
.nutrition-bar { margin-top:12px; }
.nutrition-bar div,
.nutrition-macro-bar div { height:100%; background:var(--accent); border-radius:999px; }
.nutrition-bar.over div,
.nutrition-macro-bar.over div { background:#e53935; }

/* Circular Calorie Ring */
.nutrition-circle-wrap { display:flex; align-items:center; gap:16px; }
.nutrition-circle-container {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.nutrition-circle-svg {
  transform: rotate(-90deg);
  width: 120px;
  height: 120px;
}
.nutrition-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}
.nutrition-circle-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7; /* 2 * PI * r (r=52) */
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.nutrition-circle-progress.over {
  stroke: #e53935;
}
.nutrition-circle-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
}
.nutrition-circle-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}
.nutrition-circle-target {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.nutrition-circle-pct {
  background: rgba(200, 245, 66, 0.13);
  color: var(--accent);
  border: 1px solid rgba(200, 245, 66, 0.22);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  display: inline-block;
  margin-top: 3px;
}
.nutrition-circle-pct.over {
  background: rgba(229, 57, 53, 0.13);
  color: #ff5252;
  border-color: rgba(229, 57, 53, 0.22);
}

/* Colored Macros Progress Bars */
.nutrition-macro-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; flex:1; min-width:0; }
.nutrition-macro { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px; min-width:0; }
.nutrition-macro-main { font-size:16px; font-weight:700; color:var(--text); }
.nutrition-macro-sub { font-size:10px; color:var(--muted); margin:2px 0 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.nutrition-macro.protein .nutrition-macro-bar div { background: #3b82f6; }
.nutrition-macro.carbs .nutrition-macro-bar div { background: #f59e0b; }
.nutrition-macro.fat .nutrition-macro-bar div { background: #ef4444; }
.nutrition-macro.fiber .nutrition-macro-bar div { background: #10b981; }
.nutrition-macro.sodium .nutrition-macro-bar div { background: #8b5cf6; }

.nutrition-macro.protein .nutrition-macro-main { color: #60a5fa; }
.nutrition-macro.carbs .nutrition-macro-main { color: #fbbf24; }
.nutrition-macro.fat .nutrition-macro-main { color: #f87171; }
.nutrition-macro.fiber .nutrition-macro-main { color: #34d399; }
.nutrition-macro.sodium .nutrition-macro-main { color: #a78bfa; }

.nutrition-mini-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:10px; }
.nutrition-mini-stats div { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px; text-align:center; }
.nutrition-mini-stats strong { display:block; font-family:'Bebas Neue',sans-serif; font-size:24px; color:var(--accent); line-height:1; }
.nutrition-mini-stats span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:0.4px; margin-top:4px; }

/* Interactive Hydration Card */
.nutrition-water-card { margin-top:10px; }
.nutrition-water-title { font-size:16px; font-weight:700; color:var(--text); }
.nutrition-water-bar { margin-top:8px; }
.nutrition-water-glasses {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}
.nutrition-water-glass-item {
  width: 32px;
  height: 38px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.nutrition-water-glass-item:hover {
  transform: scale(1.15);
}
.nutrition-water-glass-item:active {
  transform: scale(0.95);
}
.nutrition-water-glass-svg {
  width: 24px;
  height: 28px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.3s, stroke 0.3s;
}
.nutrition-water-glass-item.filled .nutrition-water-glass-svg {
  fill: #0ea5e9;
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.4));
}
.nutrition-water-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.nutrition-water-controls { display:grid; grid-template-columns:42px 1fr 42px; align-items:center; gap:10px; margin-top:12px; }
.nutrition-water-btn { width:42px; height:36px; border-radius:10px; border:1px solid rgba(200,245,66,0.24); background:rgba(200,245,66,0.08); color:var(--accent); font-size:22px; font-weight:800; line-height:1; cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.nutrition-water-btn:hover:not(:disabled) { background:rgba(200,245,66,0.16); border-color:rgba(200,245,66,0.45); }
.nutrition-water-btn:disabled { opacity:.35; cursor:not-allowed; }
.nutrition-water-amount { text-align:center; font-size:17px; font-weight:800; color:var(--text); white-space:nowrap; }
.nutrition-water-note { color:var(--muted); font-size:12px; margin-top:4px; }
.nutrition-water-card-empty { color:var(--muted); font-size:13px; }

/* Accordion Preview Tags */
.nutrition-meal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.nutrition-meal-tag {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nutrition-meal-card.open .nutrition-meal-tags { display: none; }

.nutrition-meal-card { margin-bottom:10px; }
.nutrition-meal-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.nutrition-meal-summary { appearance:none; border:0; background:transparent; color:inherit; padding:0; flex:1; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:left; cursor:pointer; }
.nutrition-meal-chevron { width:28px; height:28px; border:1px solid var(--border); border-radius:8px; display:grid; place-items:center; color:var(--muted); flex-shrink:0; transition:transform .15s, color .15s, border-color .15s; }
.nutrition-meal-chevron .ui-icon { width:16px; height:16px; }
.nutrition-meal-card.open .nutrition-meal-chevron { transform:rotate(180deg); color:var(--accent); border-color:rgba(200,245,66,0.35); }
.nutrition-meal-body { display:none; margin-top:8px; }
.nutrition-meal-card.open .nutrition-meal-body { display:block; }
.nutrition-meal-title { font-size:16px; font-weight:700; }
.nutrition-meal-time { display:flex; align-items:center; gap:6px; margin:5px 0 3px; color:var(--muted); font-size:11px; }
.nutrition-meal-time-input { width:104px !important; padding:5px 7px !important; font-size:13px !important; color:var(--text); }
.nutrition-meal-target { margin-bottom:8px; }
.nutrition-meal-target .nutrition-bar { margin-top:5px; }
.nutrition-meal-target-row { display:flex; justify-content:space-between; gap:10px; font-size:11px; color:var(--muted); }
.nutrition-meal-target-row span:last-child { color:var(--accent); font-weight:700; flex-shrink:0; }

/* Meal split editor */
.nutrition-split-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:12px 14px; }
.nutrition-split-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:6px 0; }
.nutrition-split-row label { font-size:14px; font-weight:600; color:var(--text); }
.nutrition-split-input { display:flex; align-items:center; gap:4px; }
.nutrition-split-input input { width:64px; text-align:right; }
.nutrition-split-input span { font-size:13px; color:var(--muted); }
.nutrition-split-sum { margin-top:8px; padding-top:8px; border-top:1px solid var(--border); font-size:13px; font-weight:700; text-align:right; }
.nutrition-split-sum-ok { color:var(--accent); }
.nutrition-split-sum-bad { color:#e0653b; }
.nutrition-meal-sub,
.nutrition-food-sub,
.nutrition-empty,
.nutrition-note { font-size:12px; color:var(--muted); }
.nutrition-empty { padding:8px 0; }
.nutrition-food-row { display:flex; justify-content:space-between; gap:10px; padding:9px 0; border-top:1px solid var(--border); }
.nutrition-food-name { font-size:14px; font-weight:600; }
.nutrition-food-side { display:flex; align-items:center; gap:6px; color:var(--accent); font-size:13px; font-weight:700; flex-shrink:0; }
.nutrition-inline-qty-wrap { display:flex; align-items:center; gap:4px; }
.nutrition-inline-qty {
  width: 62px !important;
  padding: 4px 6px !important;
  text-align: right;
  font-size: 13px !important;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px;
  transition: border-color 0.15s, background-color 0.15s;
}
.nutrition-inline-qty:focus {
  border-color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  outline: none;
}
.nutrition-inline-unit { font-size:11px; color:var(--muted); min-width:22px; font-weight:400; }
.nutrition-create-meal { margin-top:6px; }
.nutrition-custom-add-row { display:flex; gap:8px; align-items:center; }
.nutrition-custom-add-row .ms-set-input { flex:1; min-width:0; }
.nutrition-custom-add-row .btn-secondary { width:auto; flex-shrink:0; padding:10px 14px; }
.nutrition-custom-add-card { border-style:dashed; }
.modal-field { margin:10px 0 14px; }
.modal-field .ms-set-input,
#modal-input { width:100%; }

/* Dish picker inside meal form */

/* Library view */
.nutrition-tabs { display:flex; gap:6px; margin-bottom:14px; }
.nutrition-tab { flex:1; padding:9px 12px; border-radius:10px; border:1px solid var(--border); background:var(--surface); color:var(--muted); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
.nutrition-tab.active { background:var(--accent); color:#000; border-color:var(--accent); }
.nutrition-lib-tabs { display:flex; gap:8px; margin-bottom:16px; }
.nutrition-lib-tab { flex:1; padding:10px; border-radius:10px; border:1px solid var(--border); background:var(--surface); color:var(--muted); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
.nutrition-lib-tab.active { background:var(--accent); color:#000; border-color:var(--accent); }
.unified-picker-tabs { display:flex; gap:8px; padding:0 16px 10px; flex-shrink:0; }
.unified-picker-tabs .nutrition-lib-tab { flex:1; }
.nutrition-unit-tabs { display:flex; gap:6px; }
.nutrition-unit-tab { flex:1; padding:7px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
.nutrition-unit-tab.active { background:var(--accent); color:#000; border-color:var(--accent); }
.dish-picker-item--food { cursor:default; }
.dish-picker-item--food:active { background:var(--card); }
.nutrition-off-search { display:flex; flex-direction:column; gap:8px; }
.nutrition-off-search-row { display:flex; gap:6px; align-items:stretch; flex-wrap:wrap; }
.nutrition-off-search-row .ms-set-input { flex:1 1 100%; min-width:0; }
.nutrition-off-search-btn { flex:1 1 calc(50% - 3px); padding:10px 14px; font-size:14px; white-space:nowrap; }
.nutrition-off-scan-btn { flex:1 1 calc(50% - 3px); padding:10px 14px; font-size:14px; white-space:nowrap; }
@media (min-width: 520px) {
  .nutrition-off-search-row { flex-wrap:nowrap; }
  .nutrition-off-search-row .ms-set-input { flex:1 1 auto; }
  .nutrition-off-search-btn, .nutrition-off-scan-btn { flex:0 0 auto; }
}
#barcode-scanner-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.85); z-index:5000; display:none; align-items:center; justify-content:center; }
#barcode-scanner-overlay.open { display:flex; }
#barcode-scanner-sheet { width:min(560px, 100%); height:100%; background:var(--bg); display:flex; flex-direction:column; }
@media (min-width:520px) { #barcode-scanner-sheet { height:auto; max-height:90vh; border-radius:14px; } }
.barcode-scanner-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--border); }
.barcode-scanner-title { font-weight:600; font-size:15px; }
#barcode-scanner-reader { flex:1; min-height:280px; background:#000; position:relative; overflow:hidden; }
#barcode-scanner-reader video { width:100%; height:100%; object-fit:cover; }
.barcode-scanner-status { padding:10px 16px; font-size:13px; color:var(--muted); text-align:center; }
.barcode-scanner-footer { display:flex; gap:8px; padding:12px 16px 16px; border-top:1px solid var(--border); }
.barcode-scanner-footer button { flex:1; }
.nutrition-field { display:flex; flex-direction:column; gap:3px; }
.nutrition-field-label { font-size:11px; color:var(--muted); font-weight:500; display:block; margin-bottom:3px; text-transform:uppercase; letter-spacing:0.3px; }
.nutrition-food-inputs--labeled { align-items:start; }
.nutrition-off-results { display:flex; flex-direction:column; gap:6px; max-height:340px; overflow-y:auto; }
.nutrition-off-results:empty { display:none; }
.nutrition-off-loading { padding:14px; text-align:center; color:var(--muted); font-size:13px; background:var(--card); border-radius:10px; }
.nutrition-off-item { display:flex; align-items:center; gap:10px; padding:8px 10px; background:var(--card); border:1px solid var(--border); border-radius:10px; cursor:pointer; transition:background .15s; }
.nutrition-off-item:active { background:rgba(200,245,66,0.08); }
.nutrition-off-thumb { width:44px; height:44px; border-radius:8px; object-fit:cover; background:var(--surface); flex-shrink:0; }
.nutrition-off-thumb--empty { display:flex; align-items:center; justify-content:center; font-size:20px; }
.nutrition-off-item-name { font-weight:500; font-size:14px; margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nutrition-off-item-sub { font-size:11px; color:var(--muted); }
.nutrition-off-brand { font-weight:600; color:var(--accent); }
.nutrition-food-thumb { width:36px; height:36px; border-radius:6px; object-fit:cover; background:var(--surface); flex-shrink:0; }
.nutrition-food-brand { font-size:11px; color:var(--accent); font-weight:500; margin-left:4px; }
.nutrition-lib-create-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px; margin-bottom:4px; }
.nutrition-lib-search-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin-top:12px; }
.nutrition-lib-search-card .ms-set-input { margin-top:4px; }
.nutrition-lib-create-details summary { display:flex; justify-content:space-between; align-items:center; gap:10px; list-style:none; cursor:pointer; }
.nutrition-lib-create-details summary::-webkit-details-marker { display:none; }
.nutrition-lib-create-details summary::after { content:'+'; width:24px; height:24px; border-radius:999px; display:grid; place-items:center; background:rgba(255,255,255,.06); color:var(--text); font-size:18px; line-height:1; }
.nutrition-lib-create-details[open] summary { margin-bottom:10px; }
.nutrition-lib-create-details[open] summary::after { content:'−'; }
.nutrition-lib-create-hint { margin-left:auto; font-size:12px; color:var(--muted); }
.nutrition-lib-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--border); }
.nutrition-lib-row:first-child { border-top:none; }

/* Dish cards in library */
.nutrition-dish-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px; margin-bottom:10px; }
.nutrition-dish-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; list-style:none; cursor:pointer; }
.nutrition-dish-card-head::-webkit-details-marker { display:none; }
.nutrition-dish-card[open] .nutrition-dish-card-head { margin-bottom:10px; }
.nutrition-dish-item-row { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:7px 0; border-top:1px solid var(--border); }

/* Dish picker bottom sheet */
#dish-picker-overlay, #food-picker-overlay, #food-create-overlay, #unified-picker-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:500; display:flex; align-items:flex-end; opacity:0; pointer-events:none; transition:opacity 0.25s; }
#dish-picker-overlay.open, #food-picker-overlay.open, #food-create-overlay.open, #unified-picker-overlay.open { opacity:1; pointer-events:all; }
#dish-picker-sheet, #food-picker-sheet, #food-edit-sheet, #food-create-sheet, #unified-picker-sheet { width:100%; height:85vh; max-height:85vh; min-height:0; background:var(--surface); border-radius:20px 20px 0 0; display:flex; flex-direction:column; transform:translateY(100%); transition:transform 0.3s cubic-bezier(0.4,0,0.2,1); overflow:hidden; touch-action:pan-y; }
#dish-picker-overlay.open #dish-picker-sheet, #food-picker-overlay.open #food-picker-sheet, #food-create-overlay.open #food-create-sheet, #unified-picker-overlay.open #unified-picker-sheet { transform:translateY(0); }
/* Food edit sheet — display:none so hidden content is invisible to a11y/tests */
#food-edit-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:500; align-items:flex-end; }
#food-edit-overlay.open { display:flex; }
#food-edit-overlay.open #food-edit-sheet { transform:translateY(0); }
.food-edit-body { overflow-y:auto; padding:0 16px 24px; flex:1; }
.dish-picker-handle { width:40px; height:4px; background:var(--border); border-radius:2px; margin:12px auto 0; flex-shrink:0; }
.dish-picker-header { display:flex; justify-content:space-between; align-items:center; padding:14px 16px 10px; flex-shrink:0; }
.dish-picker-title { font-family:'Bebas Neue',sans-serif; font-size:20px; letter-spacing:1px; }
.dish-picker-close { background:none; border:none; color:var(--muted); font-size:22px; cursor:pointer; padding:4px 8px; line-height:1; }
.dish-picker-search-row { padding:0 16px 10px; flex-shrink:0; }
.dish-picker-servings-row { display:flex; align-items:center; gap:10px; padding:0 16px 12px; flex-shrink:0; border-bottom:1px solid var(--border); }
.dish-picker-servings-label { font-size:13px; color:var(--muted); }
.dish-picker-amount-row { display:flex; flex-direction:column; gap:8px; padding:0 16px 12px; flex-shrink:0; border-bottom:1px solid var(--border); }
.dish-picker-mode-tabs { display:flex; gap:6px; }
.dish-picker-mode-tab { flex:1; padding:7px 4px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
.dish-picker-mode-tab.active { background:var(--accent); color:#000; border-color:var(--accent); }
.dish-picker-amount-input-row { display:flex; align-items:center; gap:8px; }
.dish-picker-amount-input-row .ms-set-input { flex:0 0 90px; text-align:right; }
.dish-picker-amount-unit { font-size:13px; color:var(--muted); font-weight:500; }
.dish-picker-amount-hint { font-size:11px; color:var(--muted); line-height:1.3; }
.dish-picker-amount-hint:empty { display:none; }
#dish-picker-list, #food-picker-list { overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y; padding:8px 16px 24px; flex:1; min-height:0; }
.dish-picker-item { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-radius:12px; background:var(--card); border:1px solid var(--border); margin-bottom:8px; cursor:pointer; transition:background 0.15s; }
.dish-picker-item:active { background:rgba(200,245,66,0.08); }
.dish-picker-item-name { font-weight:500; font-size:15px; margin-bottom:2px; }
.dish-picker-item-sub { font-size:12px; color:var(--muted); }
.dish-picker-item-kcal { font-family:'Bebas Neue',sans-serif; font-size:18px; color:var(--accent); white-space:nowrap; }
.dish-picker-empty { text-align:center; color:var(--muted); font-size:14px; padding:32px 0; }
.dish-picker-empty--compact { padding:12px 0; }
.dish-custom-head { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.dish-custom-head .btn-secondary { width:auto; flex:0 0 auto; padding:8px 12px; font-size:13px; }
.dish-custom-section-title { color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; margin:14px 0 8px; }
.dish-custom-item,
.dish-custom-food-result { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--border); }
.dish-custom-main { min-width:0; }
.dish-custom-controls { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.dish-custom-controls .ms-set-input { width:70px; padding:6px 7px; text-align:right; }
.dish-custom-controls span { color:var(--muted); font-size:12px; min-width:24px; }
.dish-custom-controls .btn-secondary { width:auto; padding:6px 10px; line-height:1; }
.dish-custom-summary { position:sticky; bottom:-24px; display:flex; align-items:center; justify-content:space-between; gap:10px; margin:16px -16px -24px; padding:12px 16px 16px; background:var(--surface); border-top:1px solid var(--border); }
.dish-custom-summary strong { display:block; color:var(--accent); font-family:'Bebas Neue',sans-serif; font-size:24px; line-height:1; }
.dish-custom-summary span { display:block; color:var(--muted); font-size:12px; margin-top:2px; }
.dish-custom-summary .btn-primary { width:auto; flex:0 0 auto; padding:10px 14px; }
.nutrition-meal-actions { margin-top:10px; }
.nutrition-meal-actions .nutrition-add-dish-btn { margin-top:0; }
.nutrition-add-dish-btn { display:flex; align-items:center; justify-content:center; gap:6px; border:1px dashed var(--border); background:none; color:var(--muted); border-radius:10px; padding:9px 14px; font-size:13px; cursor:pointer; transition:color 0.15s, border-color 0.15s; width:100%; margin-top:10px; }
.nutrition-add-dish-btn:hover { color:var(--text); border-color:var(--accent); }
.nutrition-meal-card--empty .nutrition-meal-sub--empty { color:var(--muted); font-style:italic; }
.nutrition-new-food-btn { width:100%; padding:11px 16px; font-size:14px; }
.nutrition-lib-actions-row { margin-bottom:12px; }

@media (max-width: 480px) {
  .nutrition-circle-wrap { flex-direction:column; align-items:center; }
  .nutrition-macro-grid { grid-template-columns:repeat(3,1fr); }
  .nutrition-mini-stats { grid-template-columns:1fr 1fr; }
  .nutrition-score-value { font-size:30px; }
  .cal-nutrition-grid { grid-template-columns:1fr; }
  .cal-nutrition-macros { grid-template-columns:1fr 1fr; }
  .nutrition-custom-add-row .ms-set-input { font-size:16px; }
  .nutrition-meal-time { flex-wrap:wrap; }
  .nutrition-meal-time-input { min-height:34px; font-size:16px !important; }
  .dish-custom-item,
  .dish-custom-food-result,
  .dish-custom-summary { align-items:flex-start; flex-direction:column; }
  .dish-custom-controls { width:100%; }
  .dish-custom-controls .ms-set-input { flex:0 0 84px; }
  .dish-custom-summary .btn-primary { width:100%; }
  .nutrition-meal-actions { grid-template-columns:1fr; }
}

/* ── Coach (strategy document) ─────────────────────────────────────────── */
.coach-progress { font-size:12px; letter-spacing:1.2px; color:var(--muted); margin-bottom:8px; text-transform:uppercase; }
.coach-step-title { font-size:18px; font-weight:700; margin-bottom:6px; font-family:'DM Sans',sans-serif; }
.coach-subtitle { font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.5px; }
.coach-chips { display:flex; flex-wrap:wrap; gap:6px; }
.coach-chip {
  display:inline-flex; align-items:center;
  padding:6px 12px; border-radius:20px;
  background:#1f2429; color:#e6e6e6; border:1px solid #2c3137;
  font-size:13px; cursor:default;
}
.coach-chip.clickable { cursor:pointer; transition:background .15s,border-color .15s; }
.coach-chip.clickable:hover { background:#262b30; }
.coach-chip.selected { background:var(--accent); color:#111; border-color:var(--accent); font-weight:600; }
.coach-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px; margin-top:6px; }
.coach-card {
  text-align:left; padding:12px; border-radius:10px;
  background:#1f2429; color:#e6e6e6; border:1px solid #2c3137;
  cursor:pointer; transition:background .15s,border-color .15s;
  font-family:'DM Sans',sans-serif;
}
.coach-card:hover { background:#262b30; }
.coach-card.selected { background:rgba(255,255,255,0.04); border-color:var(--accent); }
.coach-card-title { font-weight:700; font-size:14px; margin-bottom:4px; }
.coach-card-hint { font-size:12px; color:var(--muted); }
.coach-frame {
  background:rgba(200,245,66,0.08); border:1px solid rgba(200,245,66,0.22);
  color:var(--text); border-radius:14px; padding:14px;
  font-size:14px; line-height:1.5; white-space:pre-wrap;
}
.coach-question { margin-top:14px; }
.coach-question label {
  display:block; font-size:13px; font-weight:700; color:var(--text);
  margin-bottom:6px;
}
.coach-question textarea {
  width:100%; resize:vertical; min-height:88px;
  background:#15191d; border:1px solid #2c3137; border-radius:12px;
  color:var(--text); padding:12px; font:inherit; line-height:1.45;
}
.coach-question textarea:focus { outline:none; border-color:var(--accent); }
.coach-review { display:grid; gap:10px; margin-top:8px; }
.coach-review div {
  background:#15191d; border:1px solid #2c3137; border-radius:12px;
  padding:10px 12px;
}
.coach-review span {
  display:block; color:var(--muted); font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px;
}
.coach-review strong { display:block; font-size:14px; line-height:1.35; font-weight:600; }
.coach-dashboard-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:14px; }
.coach-kpi-pill {
  flex-shrink:0; background:rgba(200,245,66,0.12); border:1px solid rgba(200,245,66,0.28);
  color:var(--accent); border-radius:999px; padding:7px 10px; font-size:12px; font-weight:800;
}
.coach-target-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; }
.coach-target-card {
  position:relative; overflow:hidden; background:linear-gradient(145deg,#15191d,#1f2429);
  border:1px solid #2c3137; border-radius:16px; padding:13px;
}
.coach-target-card:before {
  content:""; position:absolute; inset:-40% -40% auto auto; width:110px; height:110px;
  border-radius:50%; background:rgba(200,245,66,0.08); pointer-events:none;
}
.coach-target-card.orange:before { background:rgba(255,140,66,0.1); }
.coach-target-card.blue:before { background:rgba(129,140,248,0.1); }
.coach-target-head { position:relative; display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:12px; }
.coach-target-head span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; }
.coach-target-head strong { color:var(--accent); font-size:13px; white-space:nowrap; }
.coach-target-card.orange .coach-target-head strong { color:var(--orange); }
.coach-target-card.blue .coach-target-head strong { color:#818cf8; }
.coach-target-values { position:relative; display:grid; grid-template-columns:1fr auto 1fr; gap:8px; align-items:end; }
.coach-target-values small { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:3px; }
.coach-target-values b { display:block; font-family:'Bebas Neue',sans-serif; font-size:30px; line-height:1; color:var(--text); }
.coach-target-values div:last-child { text-align:right; }
.coach-target-arrow { color:var(--muted); font-size:18px; padding-bottom:4px; }
.coach-target-track { position:relative; height:5px; background:#101316; border-radius:999px; overflow:hidden; margin-top:12px; }
.coach-target-track div { height:100%; background:var(--accent); border-radius:999px; }
.coach-target-card.orange .coach-target-track div { background:var(--orange); }
.coach-target-card.blue .coach-target-track div { background:#818cf8; }
.coach-nutrition-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; }
.coach-nutrition-card { background:#15191d; border:1px solid #2c3137; border-radius:14px; padding:12px; }
.coach-nutrition-card span { display:block; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; }
.coach-nutrition-card strong { display:block; font-family:'Bebas Neue',sans-serif; font-size:28px; color:var(--text); line-height:1; margin-top:7px; }
.coach-nutrition-card small { display:block; color:var(--muted); font-size:12px; margin-top:6px; }
.coach-kpi-list { margin-top:12px; padding:12px; border-radius:14px; background:rgba(255,255,255,0.03); border:1px solid #2c3137; }
.coach-kpi-list span { display:block; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:5px; }
.coach-kpi-list strong { display:block; font-size:13px; line-height:1.45; }
.coach-markdown-editor {
  width:100%; min-height:320px; resize:vertical;
  background:#15191d; border:1px solid #2c3137; border-radius:12px;
  color:var(--text); padding:12px; font:13px/1.5 ui-monospace,Menlo,monospace;
}
.coach-markdown-editor:focus { outline:none; border-color:var(--accent); }
.coach-list { padding-left:18px; margin:6px 0; font-size:14px; line-height:1.5; }
.coach-nav { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; flex-wrap:wrap; }
.coach-nav .form-save { flex:1; max-width:200px; }
.btn-link { background:transparent; border:none; color:var(--accent); cursor:pointer; font-size:13px; padding:6px 10px; text-decoration:underline; }
@media (max-width:600px) {
  .coach-cards { grid-template-columns:1fr 1fr; }
  .coach-dashboard-head { flex-direction:column; }
  .coach-target-grid,
  .coach-nutrition-grid { grid-template-columns:1fr; }
  .coach-nav { justify-content:stretch; }
  .coach-nav button { flex:1; }
}

/* ── UX/UI redesign layer ─────────────────────────────────────────────── */
:root {
  --bg: #090909;
  --surface: #111;
  --card: #181818;
  --card-2: #202020;
  --border: #303030;
  --muted: #a0a0a0;
  --muted-2: #727272;
  --text: #f4f4f4;
  --accent: #c9ff2f;
  --accent-soft: rgba(201,255,47,0.13);
  --nav-w: 236px;
  --bottom-nav-h: 74px;
}

body { letter-spacing:0; }
button, input, select, textarea, summary { font-family:'DM Sans',sans-serif; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.ui-icon {
  width:20px;
  height:20px;
  flex:0 0 auto;
  display:inline-block;
  vertical-align:-0.2em;
}

#app {
  min-height:100%;
  background:var(--bg);
}

#top-bar {
  position:sticky;
  top:0;
  z-index:120;
  height:60px;
  background:rgba(9,9,9,0.94);
}
#top-title {
  display:none;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  margin-left:14px;
}
.top-icon-btn {
  min-width:44px;
  height:44px;
  border:1px solid transparent;
  border-radius:10px;
  background:none;
  color:var(--muted);
  font-weight:800;
  cursor:pointer;
}
#menu-toggle,
.close-menu {
  min-width:44px;
  min-height:44px;
}

#main {
  padding-bottom:calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom));
}

#bottom-nav {
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:180;
  height:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding:7px 8px calc(7px + env(safe-area-inset-bottom));
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:4px;
  background:rgba(13,13,13,0.96);
  border-top:1px solid var(--border);
  backdrop-filter:blur(18px);
}
.bottom-tab {
  min-width:0;
  min-height:56px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.bottom-tab .ui-icon { width:21px; height:21px; }
.bottom-tab.active {
  color:var(--accent);
  background:var(--accent-soft);
}

#nav {
  background:#101010;
}
.nav-group-label {
  padding:18px 24px 6px;
  color:var(--muted-2);
  font-size:10px;
  font-weight:900;
  letter-spacing:1.2px;
  text-transform:uppercase;
}
.nav-btn {
  min-height:48px;
  padding:12px 20px;
}
.nav-btn.active {
  color:var(--accent);
  background:var(--accent-soft);
}

.page {
  width:100%;
  max-width:1040px;
  margin:0 auto;
  padding:22px 16px;
}
.page-header {
  margin-bottom:18px;
}
.page-heading-row {
  display:flex;
  align-items:center;
  gap:12px;
}
.page-heading-copy {
  min-width:0;
  flex:1;
}
.page-actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.page-title {
  font-size:34px;
  color:var(--text);
}
.page-sub {
  color:var(--muted);
  font-size:13px;
  font-weight:500;
}
.section-label {
  color:var(--muted-2);
  letter-spacing:1.6px;
}
.icon-btn {
  width:44px;
  height:44px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.icon-btn:hover { border-color:#454545; }
.icon-btn-danger { color:var(--red); }
.icon-btn-sm {
  width:44px;
  height:44px;
}
.page-back {
  flex:0 0 auto;
  background:transparent;
}
.btn-primary,
.btn-secondary,
.form-save {
  min-height:44px;
  border-radius:10px;
}
.btn-primary {
  background:var(--accent);
  color:#111;
}
.btn-secondary {
  background:var(--surface);
  border-color:var(--border);
  color:var(--text);
}
.btn-compact,
.btn-header {
  width:auto;
  min-height:44px;
  padding:9px 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:13px;
}
.btn-header {
  min-width:136px;
}
.empty-inline {
  padding:18px;
  color:var(--muted);
  font-size:14px;
  text-align:center;
  border:1px dashed var(--border);
  border-radius:12px;
  background:rgba(255,255,255,0.02);
}
.chip-row {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.home-dashboard {
  max-width:1040px;
  padding:16px;
  gap:14px;
}
.home-coach-header,
.home-panel,
.home-kpi-card,
.home-trend-list,
.home-record-card,
.nutrition-score-card,
.nutrition-water-card,
.nutrition-meal-card,
.nutrition-setup-card,
.profile-card,
.program-category,
.prog-card,
.prog-list-card,
.cal-detail-card,
.progress-calendar-card,
.more-card {
  border-radius:12px;
  border-color:var(--border);
  background:var(--card);
}
.home-coach-header h1 {
  font-size:36px;
}
.home-coach-note {
  color:var(--text);
  background:rgba(255,255,255,0.045);
}
.home-quick-add summary {
  min-height:44px;
  display:flex;
  align-items:center;
}

.train-count-pill {
  flex:0 0 auto;
  border:1px solid rgba(201,255,47,0.25);
  color:var(--accent);
  background:var(--accent-soft);
  border-radius:999px;
  padding:7px 10px;
  font-size:13px;
  font-weight:900;
}
.train-program-picker,
.train-program-name {
  margin-bottom:14px;
}
.setup-list {
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
  overflow:hidden;
}
.setup-ex-row {
  min-height:72px;
  padding:14px;
}
.setup-ex-check {
  width:44px;
  height:44px;
  min-width:44px;
  border-radius:11px;
  font-size:17px;
}
.setup-ex-name {
  font-size:16px;
  font-weight:800;
}
.setup-actions {
  position:sticky;
  bottom:calc(var(--bottom-nav-h) + 8px + env(safe-area-inset-bottom));
  z-index:20;
  padding:12px 0 0;
  background:linear-gradient(to top, var(--bg) 82%, rgba(9,9,9,0));
}
.session-header {
  position:sticky;
  top:60px;
  z-index:60;
  background:rgba(13,13,13,0.96);
  backdrop-filter:blur(16px);
}
.session-subline {
  color:var(--muted);
  font-size:12px;
  margin-top:7px;
}
.ex-card {
  border-radius:14px;
}
.ex-card-name {
  font-size:17px;
  font-weight:800;
}
.ex-card-muscle {
  color:var(--muted);
  font-size:12px;
}
.set-btn,
.done-toggle,
.weight-btn,
.nutrition-add-dish-btn,
.cal-nav-btn,
.program-category-add,
.prog-sel-btn {
  min-height:44px;
}
.rest-coach {
  bottom:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  max-width:none;
  border:1px solid rgba(255,140,66,0.4);
  border-left:0;
  border-right:0;
}

.nutrition-page {
  max-width:1120px;
}
.nutrition-top-actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.nutrition-score-card--hero {
  background:linear-gradient(180deg, #1b1b1b 0%, #151515 100%);
}
.nutrition-macro-grid {
  grid-template-columns:repeat(5, minmax(0, 1fr));
}
.nutrition-mini-stats {
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
.journal-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:18px 0 8px;
}
.nutrition-meal-card {
  margin-bottom:12px;
}
.nutrition-food-row {
  align-items:center;
}
.nutrition-meal-actions .ui-icon {
  width:16px;
  height:16px;
}

.progress-page {
  max-width:1180px;
}
.progress-layout {
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:14px;
}
.progress-calendar-card {
  padding:14px;
}
.cal-header {
  padding-bottom:14px;
}
.cal-next .ui-icon {
  transform:rotate(180deg);
}
.cal-nav-btn {
  width:44px;
  height:44px;
}
.cal-grid {
  gap:6px;
}
.cal-day {
  min-height:44px;
  border:1px solid transparent;
}
.cal-day.in-month {
  color:#e8e8e8;
}
.cal-day:not(.selected):hover {
  border-color:var(--border);
  background:rgba(255,255,255,0.04);
}
.progress-detail-empty {
  min-height:180px;
}

.program-page {
  max-width:1180px;
}
.program-mobile-create {
  display:none;
}
.program-category {
  padding:14px;
}
.program-category-header {
  align-items:center;
}
.program-category-add {
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
}
.prog-card-header {
  min-height:68px;
}
.drag-handle {
  width:44px;
}
.btn-danger {
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.more-page {
  max-width:720px;
}
.more-card {
  overflow:hidden;
}
.more-row {
  width:100%;
  min-height:72px;
  padding:14px;
  border:0;
  border-bottom:1px solid var(--border);
  background:transparent;
  color:var(--text);
  text-align:left;
  display:flex;
  align-items:center;
  gap:12px;
  cursor:pointer;
}
.more-row:last-child {
  border-bottom:0;
}
.more-row-icon {
  width:44px;
  height:44px;
  border-radius:10px;
  background:rgba(255,255,255,0.05);
  color:var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}
.more-row-copy {
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.more-row-copy strong {
  font-size:15px;
}
.more-row-copy span {
  color:var(--muted);
  font-size:12px;
}
.more-row-arrow {
  color:var(--muted);
  font-size:24px;
}
.more-logout {
  width:100%;
  min-height:48px;
  margin-top:12px;
  border:1px solid rgba(255,77,77,0.25);
  border-radius:12px;
  background:rgba(255,77,77,0.08);
  color:var(--red);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  font-weight:800;
}
.subtabs {
  display:flex;
  gap:8px;
  margin-bottom:14px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
}
.subtab {
  flex:1;
  min-height:42px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-weight:800;
  cursor:pointer;
}
.subtab.active {
  color:#111;
  background:var(--accent);
}
.chat-clear {
  width:44px;
  height:44px;
}
.ms-set-input,
.form-field input,
.form-field select,
.login-field input,
.set-reps-input,
.nutrition-meal-time-input {
  min-height:44px;
}
.nutrition-water-btn {
  width:44px;
  height:44px;
}
.nutrition-inline-qty {
  min-height:44px;
}

@media (max-width: 700px) {
  #top-logo {
    font-size:28px;
  }
  .page {
    padding:18px 12px;
  }
  .page-title {
    font-size:32px;
  }
  .btn-header {
    display:none;
  }
  .program-mobile-create {
    display:block;
  }
  .nutrition-header {
    align-items:flex-start;
  }
  .nutrition-macro-grid {
    grid-template-columns:repeat(2,1fr);
  }
  .nutrition-mini-stats {
    grid-template-columns:1fr 1fr;
  }
  .nutrition-food-row {
    align-items:flex-start;
    flex-direction:column;
  }
  .nutrition-food-side {
    width:100%;
    justify-content:space-between;
  }
  .cal-grid {
    gap:4px;
  }
  .cal-day {
    border-radius:12px;
    font-size:15px;
  }
  .rest-coach {
    padding:12px 16px calc(14px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 900px) {
  #app {
    display:block;
  }
  #menu-toggle,
  #nav-overlay,
  #bottom-nav,
  #top-profile {
    display:none !important;
  }
  #top-bar {
    left:0;
    right:0;
  }
  #top-logo {
    margin-left:0;
  }
  #top-title {
    display:block;
  }
  #nav {
    top:60px;
    width:var(--nav-w);
    transform:none;
    z-index:80;
    border-top:1px solid var(--border);
  }
  .sidebar-header {
    display:none;
  }
  .nav-content {
    padding:14px 10px;
  }
  .nav-btn {
    border-radius:10px;
    padding:12px 14px;
    margin:1px 0;
  }
  .nav-btn-logout {
    border-top:0;
  }
  #main {
    margin-left:var(--nav-w);
    height:calc(100vh - 60px);
    padding-bottom:32px;
  }
  .page {
    padding:28px 32px 40px;
  }
  .home-dashboard {
    padding:24px 32px 40px;
  }
  .progress-layout {
    grid-template-columns:minmax(360px, 0.9fr) minmax(420px, 1.1fr);
    align-items:start;
  }
  .progress-calendar-card,
  #cal-detail {
    position:sticky;
    top:24px;
  }
  .cal-detail-card {
    max-height:calc(100vh - 124px);
    overflow:auto;
  }
  .nutrition-date-row {
    max-width:620px;
  }
  .session-header {
    top:0;
  }
  .rest-coach {
    left:calc(var(--nav-w) + ((100vw - var(--nav-w)) / 2));
    width:calc(100vw - var(--nav-w));
    bottom:0;
  }
}
