/* Kyzefit Nutrition — design tokens
   Style: OLED dark · vibrant & block-based (fitness). Type: Barlow Condensed / Barlow. */
:root {
  /* Surfaces */
  --bg: #07080A;
  --surface: #101216;
  --surface-2: #171A1F;
  --surface-3: #20242B;
  --border: #262A32;
  --border-strong: #343A44;
  /* Text */
  --text: #F5F7FA;
  --text-2: #A3ABB8;
  --text-3: #7D8594;
  /* Brand & semantic */
  --primary: #FF6B35;
  --primary-press: #E85A26;
  --primary-soft: rgba(255, 107, 53, .14);
  --on-primary: #160700;
  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, .14);
  --warning: #FBBF24;
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, .12);
  /* Macros */
  --protein: #60A5FA;
  --carbs: #FBBF24;
  --fat: #F472B6;
  --fiber: #34D399;
  /* Hydration */
  --water: #38BDF8;
  --water-soft: rgba(56, 189, 248, .15);
  --water-glow: rgba(56, 189, 248, .35);
  /* Shape & rhythm */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --gutter: 16px;
  --nav-h: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 150ms;
  --t-med: 240ms;
  /* Layers */
  --z-topbar: 20;
  --z-nav: 30;
  --z-sheet: 50;
  --z-toast: 100;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color-scheme: dark;
}
@media (min-width: 375px) { :root { --gutter: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex-shrink: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: var(--z-toast);
  background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: calc(12px + var(--safe-top)); }

.ico { width: 20px; height: 20px; }
.ico-lg { width: 24px; height: 24px; }

/* ── Boot / spinner ─────────────────────────── */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
.spinner.sm { width: 18px; height: 18px; border-width: 2px; border-color: rgba(0,0,0,.2); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--r-md);
  font-weight: 700; font-size: 16px; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), opacity var(--t-fast);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: var(--primary-press); } }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
@media (hover: hover) { .btn-secondary:hover:not(:disabled) { background: var(--surface-3); } }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: var(--r-sm); }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast);
}
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) { .icon-btn:hover:not(:disabled) { background: var(--surface-3); } }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label { font-size: 14px; color: var(--text-2); font-weight: 600; }
.req { color: var(--primary); }
.hint { font-size: 13px; color: var(--text-3); }
.input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border-strong); outline: none;
  font-size: 16px; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 88px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.field-error { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: center; }
.field-error:empty { display: none; }

/* ── Login ──────────────────────────────────── */
.login {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(24px + var(--safe-top)) var(--gutter) calc(24px + var(--safe-bottom));
  background:
    radial-gradient(520px 320px at 85% -5%, rgba(255, 107, 53, .22), transparent 70%),
    radial-gradient(420px 260px at -10% 105%, rgba(34, 197, 94, .1), transparent 70%),
    var(--bg);
}
.login-inner { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.brand b { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand span { display: block; font-size: 13px; color: var(--text-2); }
.login h1 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(40px, 11vw, 52px); line-height: .95; letter-spacing: .005em; margin-bottom: 14px;
}
.login h1 em { font-style: normal; color: var(--primary); }
.login .sub { color: var(--text-2); margin-bottom: 32px; font-size: 16px; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.otp-input { text-align: center; font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: .5em; padding-left: .5em; min-height: 68px; }
.text-btn {
  min-height: 44px; padding: 0 4px; font-weight: 600; font-size: 15px; color: var(--primary);
  display: inline-flex; align-items: center; gap: 6px;
}
.text-btn.subtle { color: var(--text-2); }
.text-btn:disabled { color: var(--text-3); cursor: default; }
.login-foot { display: flex; justify-content: space-between; align-items: center; }
.feature-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.feature-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); font-weight: 500;
}
.feature-pill svg { width: 16px; height: 16px; color: var(--primary); }

/* ── App shell ──────────────────────────────── */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  padding: calc(12px + var(--safe-top)) var(--gutter) 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(7, 8, 10, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent; transition: border-color var(--t-med);
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .eyebrow { font-size: 13px; color: var(--text-2); font-weight: 500; }
.topbar h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.main {
  padding: 4px var(--gutter) calc(var(--nav-h) + 36px + max(var(--safe-bottom), 8px));
  max-width: 820px; margin: 0 auto;
  animation: viewIn var(--t-med) var(--ease-out);
}
.main:focus { outline: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* Bottom tab bar (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  height: calc(var(--nav-h) + max(var(--safe-bottom), 8px));
  padding: 0 16px max(var(--safe-bottom), 8px);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
}
.tab {
  flex: 1; max-width: 96px; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  text-decoration: none; transition: color var(--t-fast), transform var(--t-fast);
  position: relative;
}
.tab svg {
  width: 22px; height: 22px;
  transition: transform var(--t-fast), stroke var(--t-fast);
}
.tab:active { transform: scale(.92); }
.tab[aria-current="page"] {
  color: var(--primary); font-weight: 700;
}
.tab[aria-current="page"] svg {
  stroke: var(--primary);
  transform: translateY(-1px);
}
/* Refined active indicator: discreet glowing dot below the label */
.tab::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 6px var(--primary);
  opacity: 0; transform: scale(0); transition: opacity var(--t-fast), transform var(--t-fast);
  margin-top: 1px;
}
.tab[aria-current="page"]::after {
  opacity: 1; transform: scale(1);
}
.tab-fab {
  flex: 0 0 auto; height: 100%; display: grid; place-items: center;
  background: none; border: none; padding: 0 12px; cursor: pointer;
}
.tab-fab span {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #FF6B35 0%, #FF4D00 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(255, 107, 53, .45), 0 2px 4px rgba(0, 0, 0, .25);
  border: 1.5px solid rgba(255, 255, 255, .22);
  transition: transform var(--t-fast) cubic-bezier(.34, 1.56, .64, 1), box-shadow var(--t-fast);
}
.tab-fab:active span {
  transform: scale(.92);
  box-shadow: 0 2px 8px rgba(255, 107, 53, .35);
}
.tab-fab svg { width: 24px; height: 24px; stroke: #FFFFFF; stroke-width: 2.5; }
.desktop-only { display: none !important; }
.side-brand { display: none; }
.side-nav-group { display: contents; }
.side-bottom { display: none; }
.side-user { display: none; }
.dash-layout { display: flex; flex-direction: column; }
.dash-main { display: flex; flex-direction: column; }
.dash-side { display: flex; flex-direction: column; }

/* Desktop / tablet landscape: side rail */
@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100dvh;
    background: var(--bg);
  }
  .tabbar {
    position: sticky; top: 0; height: 100dvh; padding: 24px 16px;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; border-top: 0; border-right: 1px solid var(--border); background: var(--surface);
    box-shadow: none; z-index: var(--z-nav);
  }
  .side-brand {
    display: flex; align-items: center; gap: 12px; padding: 4px 12px 18px;
    text-decoration: none; color: var(--text); order: -3;
  }
  .side-brand img { width: 34px; height: 34px; border-radius: 10px; }
  .side-brand b { font-family: var(--font-display); font-size: 24px; letter-spacing: .03em; text-transform: uppercase; }
  .side-nav-group {
    display: flex; flex-direction: column; gap: 4px; width: 100%; order: -1;
  }
  .tab {
    flex: 0 0 auto;
    height: 46px;
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 16px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: none;
    letter-spacing: 0;
    border: 1px solid transparent;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .tab svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; transform: none; }
  .tab[aria-current="page"] svg { stroke: var(--primary); transform: none; }
  .tab::after { display: none; }
  @media (hover: hover) {
    .tab:hover:not([aria-current="page"]) { background: var(--surface-2); color: var(--text); }
  }
  .tab[aria-current="page"] {
    background: rgba(255, 107, 53, 0.12);
    color: var(--primary);
    font-weight: 700;
    border-color: rgba(255, 107, 53, 0.24);
  }
  .tab-fab {
    order: -2; margin: 4px 0 14px; height: auto; padding: 0; width: 100%;
  }
  .tab-fab span {
    width: 100%; height: 48px; border-radius: var(--r-md); border: none;
    box-shadow: 0 4px 16px rgba(255, 107, 53, .35);
    display: flex; align-items: center; justify-content: center;
    gap: 8px; font-weight: 700; font-size: 15px; background: var(--primary);
    cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast);
  }
  .tab-fab span:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 53, .5);
    transform: translateY(-1px);
  }
  .tab-fab span::after { content: "Log a meal"; }
  .tab-fab svg { width: 20px; height: 20px; }
  .side-bottom {
    margin-top: auto; display: flex; flex-direction: column; gap: 8px;
    width: 100%; padding-top: 16px; border-top: 1px solid var(--border);
  }
  .side-user {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px;
    border-radius: var(--r-md); text-decoration: none; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    transition: background var(--t-fast);
  }
  .side-user:hover { background: var(--surface-3); }
  .side-user .avatar { width: 36px; height: 36px; font-size: 14px; flex-shrink: 0; }
  .side-user-meta { min-width: 0; flex: 1; }
  .side-user-meta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user-meta span { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.logout {
    margin: 0; padding: 0 14px; height: 42px; border-radius: var(--r-md);
    color: var(--text-3); font-size: 14px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; gap: 12px;
  }
  .tab.logout:hover { color: var(--danger); background: var(--danger-soft); }
  .desktop-only { display: flex !important; }
  .mobile-only { display: none !important; }
  .content-pane {
    max-width: 1260px; width: 100%; padding: 0 36px 60px; margin: 0;
  }
  .topbar {
    padding: 32px 0 24px; max-width: none; margin: 0; width: 100%;
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static;
  }
  .topbar h1 { font-size: 34px; letter-spacing: .02em; }
  .main {
    padding: 0; max-width: none; margin: 0; width: 100%;
  }
  .dash-layout {
    display: grid;
    grid-template-columns: minmax(340px, 440px) minmax(360px, 1fr);
    gap: 28px;
    align-items: start;
  }
  .dash-main {
    display: flex; flex-direction: column; gap: 14px;
  }
  .dash-side {
    display: flex; flex-direction: column;
  }
  .dash-side .section-title {
    margin-top: 0; margin-bottom: 14px;
  }
  .user-list {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  }
  .toolbar {
    max-width: 680px;
  }
}

@media (min-width: 1280px) {
  .shell { grid-template-columns: 260px 1fr; }
  .content-pane { padding: 0 48px 60px; }
  .dash-layout {
    grid-template-columns: 440px 1fr;
    gap: 36px;
  }
}

/* Custom scrollbars for desktop */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Cards & sections ───────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.stack > * + * { margin-top: 12px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 32px 0 12px; font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.section-title small { font-family: var(--font); font-size: 14px; color: var(--text-2); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Hero summary */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: auto -60px -80px auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,.18), transparent 70%); pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hero-top .label { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.streak {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px;
}
.streak svg { width: 16px; height: 16px; }
.streak.zero { background: var(--surface-2); color: var(--text-2); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 359px) { .summary { grid-template-columns: 1fr; justify-items: center; } .summary .macros { width: 100%; } }

.ring { position: relative; width: 140px; height: 140px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease-out); }
.ring.over .bar { stroke: var(--danger); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-family: var(--font-display); font-size: 38px; font-weight: 700; line-height: 1; }
.ring-label span { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.macros { display: flex; flex-direction: column; gap: 14px; }
.macro-row .top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 6px; }
.macro-row .top b { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.macro-row .top span { color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.track-bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.track-bar i { display: block; height: 100%; border-radius: 8px; transition: width .7s var(--ease-out); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-grid.two { grid-template-columns: repeat(2, 1fr); }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid.three .stat { padding: 12px; }
.stat-grid.three .stat b { font-size: 24px; }
.stat-grid.four { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-grid.four .stat { padding: 12px; }
.stat-grid.four .stat b { font-size: 24px; }
@media (min-width: 640px) {
  .stat-grid.two { grid-template-columns: repeat(2, 1fr); }
  .stat-grid.three { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat-grid.three .stat { padding: 14px 16px; }
  .stat-grid.four { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .stat-grid.four .stat { padding: 14px 16px; }
}
@media (min-width: 1024px) {
  .dash-main .stat-grid.four { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.stat span { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.stat b small { font-family: var(--font); font-size: 14px; color: var(--text-3); font-weight: 500; }

/* Water / Hydration card */
.water-card {
  position: relative; overflow: hidden; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  transition: border-color var(--t-fast);
}
.water-card::before {
  content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, var(--water-soft), transparent 70%); pointer-events: none;
}
.water-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.water-title {
  display: flex; align-items: center; gap: 12px;
}
.water-icon-bubble {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--water-soft); color: var(--water); flex-shrink: 0;
}
.water-icon-bubble svg { width: 22px; height: 22px; }
.water-title-text h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; margin: 0; line-height: 1.1;
}
.water-title-text span {
  font-size: 12px; color: var(--text-2); font-weight: 500; display: block; margin-top: 2px;
}
.water-stats {
  text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.water-amount-row {
  display: inline-flex; align-items: center; gap: 8px;
}
.water-mini-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; transition: background var(--t-fast), transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0; padding: 0;
}
.water-mini-btn:hover:not(:disabled) {
  background: var(--surface-3); color: var(--text); border-color: var(--border-strong);
}
.water-mini-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.water-mini-btn:disabled {
  opacity: 0.3; cursor: not-allowed; pointer-events: none;
}
.water-mini-btn.plus {
  background: var(--water-soft); border-color: rgba(56, 189, 248, 0.28); color: var(--water);
}
.water-mini-btn.plus:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.26);
}
.water-mini-btn svg {
  width: 15px; height: 15px;
}
.water-amount {
  font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; color: var(--text);
}
.water-amount small {
  font-family: var(--font); font-size: 13px; color: var(--text-3); font-weight: 500;
}
.water-pct {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--water-soft); color: var(--water); transition: background var(--t-fast), color var(--t-fast);
}
.water-pct.goal-met {
  background: var(--success-soft); color: var(--success);
}
.water-progress-track {
  height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden;
  margin: 14px 0 14px; position: relative;
}
.water-progress-bar {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #38BDF8 0%, #0284C7 100%);
  box-shadow: 0 0 12px var(--water-glow);
  transition: width 0.4s var(--ease-out);
}
.water-progress-bar.goal-met {
  background: linear-gradient(90deg, #38BDF8 0%, #22C55E 100%);
}
.water-quick-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
@media (max-width: 440px) {
  .water-quick-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
@media (max-width: 320px) {
  .water-quick-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
.water-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 6px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; user-select: none;
}
.water-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.water-btn:active { transform: scale(0.94); }
.water-btn.accent {
  background: var(--water-soft); border-color: rgba(56, 189, 248, 0.28); color: var(--water);
}
.water-btn.accent:hover {
  background: rgba(56, 189, 248, 0.24);
}
.water-btn.minus {
  background: var(--surface-2); border-color: var(--border); color: var(--text-2);
}
.water-btn.minus:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: var(--danger);
}
.water-btn.minus:disabled {
  opacity: 0.35; cursor: not-allowed; pointer-events: none;
}
.water-btn svg { width: 14px; height: 14px; }
.btn-icon { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; flex-shrink: 0; }
.btn-icon svg { width: 20px; height: 20px; }

/* Meal list */
.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px 12px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), border-color var(--t-fast), box-shadow var(--t-fast);
}
.meal:active { transform: scale(.985); }
@media (hover: hover) {
  .meal:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}
.thumb {
  width: 64px; height: 64px; border-radius: var(--r-md); flex: 0 0 auto; object-fit: cover;
  background: var(--surface-3); display: grid; place-items: center; color: var(--text-3);
}
.thumb svg { width: 26px; height: 26px; }
.meal .info { flex: 1; min-width: 0; }
.meal .name { font-weight: 600; font-size: 16px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.meal .meta { font-size: 13px; color: var(--text-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.meal .kcal { text-align: right; white-space: nowrap; }
.meal .kcal b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; }
.meal .kcal small { font-size: 12px; color: var(--text-3); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2);
}
.tag.fat { background: rgba(244,114,182,.12); color: var(--fat); }

.empty {
  text-align: center; padding: 36px 20px; color: var(--text-2);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty .empty-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); margin-bottom: 6px; }
.empty .empty-ico svg { width: 26px; height: 26px; }
.empty b { color: var(--text); font-size: 17px; }
.empty .btn { margin-top: 12px; }

/* Date navigation */
.date-nav { display: flex; align-items: center; gap: 8px; padding: 8px; }
.date-nav .date-label { flex: 1; text-align: center; position: relative; min-height: 48px; display: flex; flex-direction: column; justify-content: center; border-radius: var(--r-md); }
.date-nav .date-label b { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
.date-nav .date-label span { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.date-nav .date-label span svg { width: 14px; height: 14px; }
.date-nav input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.date-nav input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date-nav .date-label:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Week chart */
.week-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 12px; }
.week-head .label { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.week-head b { font-family: var(--font-display); font-size: 22px; }
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 156px; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border-strong); pointer-events: none; }
.goal-line span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--text-3); }
.week button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; border-radius: var(--r-sm); padding-top: 4px; min-width: 0; }
.week .col { width: 100%; max-width: 32px; border-radius: 8px 8px 4px 4px; background: var(--surface-3); min-height: 6px; transition: height .6s var(--ease-out); }
.week .col.has { background: linear-gradient(180deg, #FF8A5C, var(--primary)); }
.week .col.over { background: linear-gradient(180deg, #FCA5A5, var(--danger)); }
.week .d { font-size: 12px; color: var(--text-2); font-weight: 600; }
.week .v { font-size: 11px; color: var(--text-3); height: 14px; }
.week button[aria-pressed="true"] .d { color: var(--primary); }
.week button[aria-pressed="true"] .col { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Segmented control */
.segmented { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.segmented button { flex: 1; min-height: 44px; border-radius: var(--r-sm); font-weight: 600; font-size: 15px; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: var(--r-md); font-weight: 600; font-size: 15px;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chips-grid .chip { padding: 0 6px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ── Sheets: header / scrollable body / pinned footer ── */
.sheet-backdrop {
  position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100dvh);
  z-index: var(--z-sheet); background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade var(--t-med) ease-out;
}
.sheet-backdrop.closing { animation: fadeOut 160ms ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 640px;
  max-height: calc(var(--vv-h, 100dvh) - 24px - var(--safe-top));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  animation: slideUp 320ms var(--ease-out);
}
.sheet-backdrop.closing .sheet { animation: slideDown 160ms ease-in forwards; }
.sheet.full { height: var(--vv-h, 100dvh); max-height: var(--vv-h, 100dvh); border-radius: 0; border: 0; max-width: none; }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes slideDown { to { transform: translateY(100%); } }
.sheet-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 24px var(--gutter) 12px; position: relative;
}
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--surface-3); }
.sheet.full .sheet-head { padding-top: calc(12px + var(--safe-top)); border-bottom: 1px solid var(--border); }
.sheet.full .sheet-head::before { display: none; }
.sheet-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 4px var(--gutter) 20px; display: flex; flex-direction: column; gap: 20px;
}
.sheet.full .sheet-body { padding-top: 16px; }
.sheet-foot {
  flex: 0 0 auto; padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border); background: var(--surface);
  display: flex; gap: 10px;
}
.sheet-foot:empty { display: none; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.shrink { flex: 0 0 auto; }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet, .sheet.full { height: auto; max-height: min(88dvh, 860px); border-radius: var(--r-xl); border: 1px solid var(--border); max-width: 600px; }
  .sheet-head::before { display: none; }
  .sheet-head, .sheet.full .sheet-head { padding: 20px 24px 12px; border-bottom: 0; }
  .sheet-body, .sheet.full .sheet-body { padding: 4px 24px 24px; }
  .sheet-foot { padding: 16px 24px; border-radius: 0 0 var(--r-xl) var(--r-xl); }
  @keyframes slideUp { from { transform: translateY(16px) scale(.98); opacity: 0; } }
  @keyframes slideDown { to { transform: translateY(16px) scale(.98); opacity: 0; } }
}

/* Photo picker */
.photo-drop {
  aspect-ratio: 4 / 3; border-radius: var(--r-lg); border: 2px dashed var(--border-strong); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px;
  overflow: hidden; position: relative; width: 100%; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.photo-drop:hover { border-color: var(--primary); background: var(--surface-3); }
.photo-drop.dragover { border-color: var(--primary); background: rgba(255, 107, 53, 0.1); transform: scale(1.01); }
.photo-drop .ph-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.photo-drop .ph-ico svg { width: 30px; height: 30px; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop.has { border-style: solid; border-color: var(--border); }
.photo-drop.has:hover { border-color: var(--primary); }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-actions .btn { min-height: 48px; font-size: 15px; cursor: pointer; }

.analyzing { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.analyzing b { font-size: 17px; }
.scan { position: relative; }
.scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; top: 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent); box-shadow: 0 0 18px var(--primary);
  animation: scan 1.6s ease-in-out infinite;
}
@keyframes scan { 50% { top: calc(100% - 3px); } }
.steps { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 6px; text-align: left; }
.steps div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.steps div svg { width: 18px; height: 18px; color: var(--primary); }

/* Result */
.result-hero { display: flex; gap: 14px; align-items: center; }
.result-hero img { width: 76px; height: 76px; border-radius: var(--r-md); object-fit: cover; flex: 0 0 auto; }
.result-hero .t { flex: 1; min-width: 0; }
.name-input { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed var(--border-strong); font-size: 18px; font-weight: 700; padding: 6px 0; outline: none; border-radius: 0; }
.name-input:focus { border-bottom-color: var(--primary); }
.conf { font-size: 13px; margin-top: 8px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag.high { background: var(--success-soft); color: var(--success); }
.tag.medium { background: rgba(251,191,36,.12); color: var(--warning); }
.tag.low { background: var(--danger-soft); color: var(--danger); }

.big-kcal { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-kcal b { font-family: var(--font-display); font-size: 52px; font-weight: 700; line-height: 1; }
.big-kcal span { color: var(--text-2); font-size: 15px; }
.macro-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.macro-pill { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 6px; text-align: center; border-top: 3px solid var(--c); }
.macro-pill b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.macro-pill span { font-size: 12px; color: var(--text-2); font-weight: 600; }

.items { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; background: var(--surface-2); min-height: 60px; }
.item.static { padding-right: 14px; }
.item + .item { border-top: 1px solid var(--border); }
.item .n { flex: 1; min-width: 0; }
.item .n b { display: block; font-weight: 600; font-size: 15px; }
.item .n span { font-size: 13px; color: var(--text-2); }
.item .k { font-weight: 700; font-size: 15px; white-space: nowrap; }
.item .x { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-3); }
@media (hover: hover) { .item .x:hover { color: var(--danger); background: var(--danger-soft); } }
.item .x svg { width: 18px; height: 18px; }
.item.added { background: rgba(244,114,182,.06); }

.fat-box { border: 1px solid rgba(251,191,36,.35); background: linear-gradient(160deg, rgba(251,191,36,.08), rgba(244,114,182,.05)); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fat-box .fb-head { display: flex; gap: 12px; }
.fat-box .fb-ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(251,191,36,.14); color: var(--warning); display: grid; place-items: center; flex: 0 0 auto; }
.fat-box .fb-ico svg { width: 22px; height: 22px; }
.fat-box h3 { font-size: 16px; font-weight: 700; }
.fat-box p { font-size: 14px; color: var(--text-2); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border-strong); display: grid; place-items: center; }
.stepper button svg { width: 20px; height: 20px; }
.stepper .val { flex: 1; text-align: center; }
.stepper .val b { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.stepper .val span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.tip { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.tip svg { width: 18px; height: 18px; color: var(--warning); margin-top: 2px; }

.detail-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); background: var(--surface-2); }
.detail-meta { font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }

/* Admin */
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; width: 100%; text-align: left; min-height: 68px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); transition: background var(--t-fast);
}
@media (hover: hover) { .user-row:hover { background: var(--surface-2); } }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--primary); flex: 0 0 auto; text-transform: uppercase; text-decoration: none;
}
a.avatar[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.user-row .info { flex: 1; min-width: 0; }
.user-row .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .info span { font-size: 13px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .right { text-align: right; font-size: 12px; color: var(--text-3); }
.user-row .right b { display: block; color: var(--text); font-family: var(--font-display); font-size: 22px; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--success); } .status.over { color: var(--danger); } .status.idle { color: var(--text-3); }
.group { margin-top: 24px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.group-head .who { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; min-height: 44px; border-radius: var(--r-md); }
.group-head .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-head .who span { font-size: 13px; color: var(--text-2); }
.group-head .day b { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.group-head .day span { display: block; font-size: 13px; color: var(--text-2); }
.group-head .tot { text-align: right; white-space: nowrap; }
.group-head .tot b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.group-head .tot small { font-size: 12px; color: var(--text-3); }
.toolbar { display: flex; gap: 10px; align-items: stretch; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 42px; }
.badge-admin { font-size: 12px; font-weight: 700; letter-spacing: .08em; background: var(--primary-soft); color: var(--primary); padding: 6px 10px; border-radius: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 4px; }
.back-link svg { width: 18px; height: 18px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head > div { min-width: 0; }
.profile-head b { font-size: 18px; display: block; }
.profile-head span { font-size: 14px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 379px) { .add-label { display: none; } }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + max(var(--safe-bottom), 8px)); z-index: var(--z-toast);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 18px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5); transition: opacity var(--t-med), transform var(--t-med) var(--ease-out);
}
#toast svg { width: 18px; height: 18px; color: var(--success); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error svg { color: var(--danger); }
#toast.error { border-color: rgba(248, 113, 113, .45); }
body.sheet-open #toast { bottom: calc(96px + max(var(--safe-bottom), 8px)); }
@media (min-width: 1024px) { #toast { bottom: 32px; } }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── Trainer card (client Today screen) ───────── */
.trainer {
  position: relative; overflow: hidden; display: flex; align-items: stretch; min-height: 188px;
  padding: 20px 0 0 20px; margin-bottom: 12px;
  background:
    radial-gradient(260px 220px at 85% 70%, rgba(255, 107, 53, .32), transparent 70%),
    linear-gradient(135deg, var(--surface) 40%, #1A1410);
}
.trainer-info { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 16px; }
.trainer-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.trainer-name { font-family: var(--font-display); font-size: 32px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; margin: 2px 0 10px; }
.trainer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.trainer-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px 0 0;
  color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 8px; max-width: 100%;
}
.trainer-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trainer-link svg { width: 18px; height: 18px; color: var(--primary); flex: 0 0 auto; }
@media (hover: hover) { .trainer-link:hover span { text-decoration: underline; text-underline-offset: 3px; } }
.trainer-photo {
  position: relative; align-self: flex-end; flex: 0 0 auto;
  width: auto; height: 176px; margin-left: -12px; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45));
}
@media (max-width: 359px) { .trainer-photo { height: 150px; } .trainer-name { font-size: 28px; } }
@media (min-width: 640px) { .trainer { min-height: 200px; padding: 24px 0 0 28px; } .trainer-photo { height: 196px; margin-right: 24px; } }
