:root {
  color-scheme: dark;
  --bg: #050806;
  --surface: rgba(13, 20, 16, 0.94);
  --surface-2: rgba(13, 38, 26, 0.96);
  --ink: #effff6;
  --muted: #8faa9a;
  --line: rgba(92, 255, 166, 0.22);
  --primary: #29f27c;
  --primary-dark: #11c762;
  --accent: #b8ff3d;
  --danger: #ff4d4d;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.46);
  --glow: 0 0 24px rgba(41, 242, 124, 0.22);
}

/* RC-UI Premium Redesign: presentation-only visual system */
:root {
  --bg: #050505;
  --surface: rgba(18, 20, 19, 0.86);
  --surface-2: rgba(26, 31, 28, 0.9);
  --card: rgba(16, 18, 17, 0.82);
  --elevated: rgba(24, 27, 25, 0.94);
  --ink: #f4fff8;
  --text: #f4fff8;
  --muted: #a1b5aa;
  --line: rgba(255, 255, 255, 0.1);
  --primary: #34f577;
  --primary-dark: #15c861;
  --accent: #b8ff3d;
  --danger: #ff5a66;
  --warning: #ffd166;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.52);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  --glow: 0 0 26px rgba(52, 245, 119, 0.18);
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(52, 245, 119, 0.18), transparent 28%),
    radial-gradient(circle at 86% 6%, rgba(184, 255, 61, 0.1), transparent 26%),
    linear-gradient(180deg, #050505 0%, #07100b 48%, #050505 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  background:
    linear-gradient(120deg, rgba(255,255,255,.035), transparent 32%),
    radial-gradient(circle at 50% 0, rgba(52,245,119,.08), transparent 38%);
  mask-image: none;
}

h1 { font-size: clamp(32px, 8vw, 40px); letter-spacing: -0.04em; }
h2 { font-size: 24px; letter-spacing: -0.03em; }
.dashboard-hero h2,
.coach-chat-hero h2,
.analytics-hero h2,
.workout-hero h2 { font-size: clamp(30px, 7vw, 40px); }
.section-title h2 { font-size: 24px; }
.chart-card .section-title h2 { font-size: 18px; }
.label,
.trend-line,
.dashboard-grid span,
.notification-summary-grid span { font-size: 13px; }

button,
.tab,
.workout-subtab,
.persona-chip {
  min-height: 48px;
  border-radius: var(--radius-md);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

button:hover { transform: translateY(-1px); }
button:active { transform: scale(.975); }
button.secondary {
  background: rgba(255,255,255,.055);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
}
button.secondary:hover { border-color: rgba(52,245,119,.34); background: rgba(52,245,119,.1); }
button.danger {
  background: linear-gradient(180deg, rgba(255,90,102,1), rgba(178,35,51,1));
  box-shadow: 0 0 24px rgba(255,90,102,.18);
}
.link-button,
button.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--primary);
  box-shadow: none;
}

.app {
  width: min(520px, 100%);
  padding: max(20px, env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  margin: -20px -16px 16px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(180deg, rgba(5,5,5,.94), rgba(5,5,5,.72) 72%, transparent);
  backdrop-filter: blur(18px);
}

.motif-banner {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 8px;
  background: rgba(255,255,255,.035);
}
.motif-banner span {
  border: 0;
  border-radius: 14px;
  background: rgba(52,245,119,.08);
}

.summary article,
.session-card,
.entry-form,
.quick-list,
.chart-card,
.metrics-grid article,
.store-card,
.dashboard-section,
.mission-card,
.dashboard-actions,
.dashboard-water-card,
.score-card {
  border-color: rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
    var(--card);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.chart-card,
.entry-form,
.quick-list,
.store-card,
.dashboard-section,
.mission-card,
.dashboard-water-card {
  margin-top: var(--space-2);
  padding: var(--space-2);
}

.dashboard-hero {
  border-radius: 28px;
  padding: 24px;
  border-color: rgba(52,245,119,.2);
  background:
    radial-gradient(circle at 18% 10%, rgba(52,245,119,.24), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    #0a0d0b;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
}
.ai-coach-hero {
  min-height: 220px;
  display: grid;
  align-content: space-between;
}
.ai-coach-hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -44% 34%;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(52,245,119,.22), transparent 66%);
  pointer-events: none;
}
.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.coach-dashboard-card {
  border-color: rgba(184,255,61,.26);
  background:
    linear-gradient(145deg, rgba(184,255,61,.1), transparent 46%),
    var(--elevated);
}
.coach-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.recovery-readiness-card,
.habit-adherence-card,
.progress-prediction-card,
.smart-notifications-card {
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}
.recovery-readiness-layout,
.habit-adherence-layout,
.prediction-card-layout {
  grid-template-columns: 112px 1fr;
  gap: 16px;
}
.readiness-score-ring {
  width: 112px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.025), var(--glow);
}
.readiness-score-ring span { font-size: 32px; }
.recovery-factor-grid,
.habit-metric-grid,
.prediction-metric-grid,
.notification-summary-grid,
.dashboard-grid,
.trend-grid {
  gap: 8px;
}
.recovery-factor-grid article,
.habit-metric-grid article,
.prediction-metric-grid article,
.notification-summary-grid article,
.dashboard-grid article,
.trend-grid article,
.draft-dashboard-grid div {
  border-radius: var(--radius-md);
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.dashboard-grid strong,
.trend-grid strong,
.notification-summary-grid strong,
.habit-metric-grid strong,
.prediction-metric-grid strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.notification-list article {
  position: relative;
  padding-left: 14px;
  border-radius: 18px;
}
.notification-list article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}
.notification-list article[data-priority="Critical"]::before,
.notification-list article[data-priority="High"]::before { background: var(--warning); }
.weekly-notification-summary {
  border-radius: var(--radius-md);
  line-height: 1.5;
}

.analytics-volume-row {
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, rgba(52,245,119,.12), rgba(255,255,255,.035)),
    rgba(255,255,255,.035);
}
.analytics-volume-row small,
.progress-bar,
.water-bar,
.macro-bar {
  overflow: hidden;
  border-radius: 999px;
}
.analytics-volume-row small::after,
.progress-bar span,
.water-bar span,
.macro-bar span {
  box-shadow: 0 0 18px rgba(52,245,119,.28);
}

.session-card {
  border-radius: 26px;
  padding: 22px;
}
#timer {
  font-size: clamp(46px, 16vw, 72px);
  letter-spacing: -0.06em;
}
input,
select,
textarea {
  min-height: 48px;
  border-radius: var(--radius-md);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
}
.entry-form button,
.quick-action-grid button,
.ai-actions button,
.session-actions button {
  min-height: 52px;
}

.empty,
.food-empty,
.chart-empty,
.adaptive-empty,
.chat-empty-state,
.progress-empty-card {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(circle at 50% 0, rgba(52,245,119,.14), transparent 42%),
    rgba(255,255,255,.04);
  color: var(--muted);
}
.empty::before,
.empty-illustration {
  filter: drop-shadow(0 0 18px rgba(52,245,119,.18));
}
.chat-empty-state strong,
.food-empty strong,
.empty strong { color: var(--ink); }

.skeleton,
.skeleton-card,
.loading-placeholder,
.chart-skeleton {
  position: relative;
  overflow: hidden;
  min-height: 72px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.055);
}
.skeleton::after,
.skeleton-card::after,
.loading-placeholder::after,
.chart-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  transform: translateX(-100%);
  animation: skeletonSweep 1.4s ease-in-out infinite;
}

.modal-backdrop {
  backdrop-filter: blur(16px);
  background: rgba(0,0,0,.62);
}
.modal-card {
  border-radius: 28px;
  border-color: rgba(255,255,255,.12);
  background: rgba(18,20,19,.94);
  box-shadow: var(--shadow);
}
.toast {
  border-radius: 20px;
  background: rgba(18,20,19,.94);
  backdrop-filter: blur(18px);
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(520px, calc(100% - 24px));
  min-height: 78px;
  padding: 10px;
  border-radius: 28px;
  border-color: rgba(255,255,255,.11);
  background: rgba(14,16,15,.86);
}
.bottom-nav .tab {
  min-height: 56px;
  border-radius: 20px;
}
.bottom-nav .tab[data-tab="health"],
.bottom-nav .tab[data-tab="nutrition"],
.bottom-nav .tab[data-tab="trainerPortal"],
.bottom-nav .tab[data-tab="progress"],
.bottom-nav .tab[data-tab="profile"] {
  display: none;
}
.bottom-nav .tab[data-tab="track"] {
  order: 3;
}
.bottom-nav .tab[data-tab="track"] span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #031007;
  box-shadow: var(--glow);
}
.bottom-nav .tab[data-tab="dashboard"] { order: 1; }
.bottom-nav .tab[data-tab="trainingAnalytics"] { order: 4; }
.bottom-nav .tab[data-tab="coachChat"] { order: 5; }

.screen.active,
.chart-card,
.dashboard-section,
.entry-form,
.quick-list,
.store-card {
  animation: rcFadeSlide .22s ease both;
}

@keyframes rcFadeSlide {
  from { opacity: .001; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes skeletonSweep {
  to { transform: translateX(100%); }
}

@media (min-width: 760px) {
  .app { width: min(1120px, calc(100% - 48px)); }
  .screen#dashboard.active {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  .screen#dashboard.active > .ai-coach-hero,
  .screen#dashboard.active > .coach-dashboard-card,
  .screen#dashboard.active > .dashboard-actions,
  .screen#dashboard.active > .mission-card {
    grid-column: 1 / -1;
  }
  .bottom-nav { width: min(560px, calc(100% - 40px)); }
}

@media (max-width: 420px) {
  .app { padding-inline: 12px; }
  .hero-actions,
  .coach-card-head,
  .recovery-readiness-layout,
  .habit-adherence-layout,
  .prediction-card-layout {
    grid-template-columns: 1fr;
  }
  .readiness-score-ring {
    width: 104px;
  }
  .bottom-nav {
    width: calc(100% - 16px);
    padding: 8px;
  }
  .bottom-nav .tab small { font-size: 9px; }
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(41, 242, 124, 0.18), transparent 26%),
    radial-gradient(circle at 92% 8%, rgba(184, 255, 61, 0.11), transparent 22%),
    linear-gradient(135deg, rgba(41, 242, 124, 0.07) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 42px),
    var(--bg);
  color: var(--ink);
  font-family: Arial, "Noto Sans Thai", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 40%, rgba(41, 242, 124, 0.08) 40% 42%, transparent 42% 100%),
    repeating-linear-gradient(145deg, transparent 0 22px, rgba(41, 242, 124, 0.055) 22px 24px, transparent 24px 46px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.2));
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #031007;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
button:active { transform: scale(.98); }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(184, 255, 61, .32);
  outline-offset: 2px;
}
button.secondary { background: rgba(41, 242, 124, 0.11); color: var(--primary); border: 1px solid var(--line); box-shadow: none; }
button.danger { background: linear-gradient(180deg, #ff6666, #b91c1c); color: #fff; box-shadow: 0 0 22px rgba(255, 77, 77, 0.2); }
.link-button { min-height: auto; padding: 0; background: transparent; color: var(--primary); box-shadow: none; }
.icon-button { padding: 0 14px; }
.splash-shell,
.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}
.splash-card,
.auth-card {
  width: min(640px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(41, 242, 124, 0.12), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow);
}
.splash-card {
  text-align: center;
}
.splash-card h1 {
  margin: 4px 0 8px;
  font-size: 42px;
  color: var(--primary);
}
.landing-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.landing-actions button {
  width: 100%;
}
.auth-card::before {
  content: "MOVE / LIFT / REPEAT";
  display: block;
  margin-bottom: 16px;
  padding: 8px 10px;
  border: 1px solid rgba(41, 242, 124, 0.22);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}
.auth-card h1 { margin-bottom: 10px; }
.auth-card > form,
.onboarding-card form {
  display: grid;
  gap: 0;
}
.auth-copy, .auth-note, .user-line {
  color: var(--muted);
  line-height: 1.45;
}
.auth-copy { margin-bottom: 18px; }
.auth-card button[type="submit"] { width: 100%; }
.demo-button {
  width: 100%;
  margin-top: 10px;
}
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.ai-button { width: 100%; }
.ai-result {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(184, 255, 61, 0.24);
  border-radius: 8px;
  background: rgba(184, 255, 61, 0.06);
  color: var(--muted);
  line-height: 1.45;
}
.ai-result strong {
  color: var(--accent);
}
.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.photo-preview figure {
  margin: 0;
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 28px;
  width: 28px;
  padding: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  box-shadow: none;
}
.auth-toggle {
  width: 100%;
  margin-top: 14px;
}
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.oauth-grid {
  display: grid;
  gap: 8px;
}
.oauth-button {
  background: rgba(255,255,255,0.045);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.auth-note {
  min-height: 22px;
  margin: 12px 0 0;
  text-align: center;
}
.legal-links {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.legal-links a,
.store-card a {
  color: var(--primary);
}
.auth-note.error { color: #b42318; }
.auth-note.success { color: var(--primary); }
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.user-line {
  margin: 5px 0 0;
  font-size: 13px;
}
.app {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.motif-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.motif-banner span {
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid rgba(41, 242, 124, 0.18);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(41, 242, 124, 0.12) 0 2px, transparent 2px 9px),
    rgba(0, 0, 0, 0.28);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: 0; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nutrition-summary { margin-top: 10px; }
.summary article, .session-card, .entry-form, .quick-list, .chart-card, .metrics-grid article, .store-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(41, 242, 124, 0.07), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
}
.summary article { padding: 14px 12px; }
.summary span { display: block; font-size: 26px; font-weight: 800; color: var(--primary); text-shadow: 0 0 18px rgba(41, 242, 124, 0.25); }
.summary p, .label, .store-card p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.dashboard-hero {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(41, 242, 124, 0.12), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}
.dashboard-hero h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--ink);
}
.dashboard-hero p:last-child {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}
.score-card,
.mission-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0, rgba(184,255,61,0.16), transparent 34%),
    linear-gradient(145deg, rgba(41, 242, 124, 0.1), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}
.score-card,
.nutrition-coach,
.coach-card,
.premium-preview {
  position: relative;
  overflow: hidden;
  animation: premiumRise .42s ease both;
}
.score-card::after,
.nutrition-coach::after,
.coach-card::after,
.premium-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(184,255,61,.08) 46%, transparent 64%);
  transform: translateX(-120%);
  animation: premiumSheen 5.5s ease-in-out infinite;
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  margin-right: 6px;
  border: 1px solid rgba(184,255,61,.42);
  border-radius: 999px;
  background: rgba(184,255,61,.11);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(184,255,61,.16);
}
.trend-line {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}
.score-ring {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0;
  color: var(--primary);
  text-shadow: 0 0 28px rgba(41,242,124,.42);
}
.score-ring span { font-size: 64px; font-weight: 900; line-height: .95; }
.score-ring small { color: var(--muted); font-weight: 800; }
.score-status {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid rgba(184,255,61,.38);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(184,255,61,.1);
  font-size: 13px;
}
.health-score-preview {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.health-score-preview article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(41, 242, 124, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}
.health-score-preview strong {
  color: var(--primary);
  font-size: 20px;
}
.health-score-preview span {
  color: var(--ink);
  font-weight: 800;
}
.health-score-preview small,
.health-score-preview em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}
.health-score-recommendation {
  margin: 10px 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}
.health-score-history {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.health-score-history span {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, .2);
  font-size: 12px;
  font-weight: 800;
}
.dashboard-grid,
.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.dashboard-grid article,
.trend-grid article,
.mission-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(41,242,124,.065);
}
.dashboard-grid article,
.trend-grid article { padding: 13px; }
.dashboard-grid strong,
.trend-grid strong {
  display: block;
  color: var(--primary);
  font-size: 22px;
}
.dashboard-grid span,
.trend-grid span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.dashboard-section,
.mission-card,
.dashboard-actions,
.dashboard-water-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(92,255,166,.2);
  border-radius: 16px;
  background:
    linear-gradient(155deg, rgba(41,242,124,.08), transparent 42%),
    rgba(9, 17, 13, .88);
  box-shadow: 0 14px 34px rgba(0,0,0,.3);
}
.dashboard-section .dashboard-grid {
  margin-top: 12px;
}
.compact-dashboard-grid article {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  border-radius: 14px;
}
.dashboard-section .section-title span {
  color: var(--accent);
  font-weight: 800;
}
.mission-list { display: grid; gap: 8px; }
.mission-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 10px;
}
.mission-row small { grid-column: 2; color: var(--muted); }
.mission-row.done { background: rgba(184,255,61,.11); }
.dashboard-actions {
  margin-top: 14px;
  padding: 16px;
}
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.quick-action-grid button {
  width: 100%;
  min-height: 52px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .72);
}
.modal-card {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.12), transparent 44%),
    var(--surface);
  box-shadow: var(--shadow);
}
.modal-card p {
  color: var(--muted);
  line-height: 1.5;
}
.modal-card button {
  width: 100%;
}
.premium-preview,
.coach-card,
.program-day {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(184,255,61,.09), transparent 40%),
    var(--surface);
  box-shadow: var(--shadow);
}
.premium-preview button { width: 100%; margin-top: 10px; }
.program-list { display: grid; gap: 12px; }
.workout-hero,
.workout-setup-card,
.workout-summary-card,
.workout-calendar-card,
.workout-plan-card {
  border-radius: 12px;
}
.workout-program-content {
  display: block;
}
.workout-subnav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 16px;
  background: rgba(4, 10, 7, .9);
  backdrop-filter: blur(14px);
}
.workout-subtab {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  box-shadow: none;
  white-space: nowrap;
}
.workout-subtab.active {
  border-color: var(--line);
  background: rgba(41,242,124,.14);
  color: var(--primary);
}
.workout-panel {
  display: none;
  animation: premiumRise .22s ease both;
}
.workout-panel.active { display: block; }
.workout-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}
.weekly-calendar article {
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.weekly-calendar article.training {
  border-color: rgba(184,255,61,.42);
  background:
    radial-gradient(circle at 20% 0, rgba(184,255,61,.16), transparent 42%),
    rgba(41,242,124,.07);
}
.weekly-calendar article.rest {
  opacity: .62;
}
.weekly-calendar strong,
.weekly-calendar span {
  display: block;
}
.weekly-calendar strong {
  color: var(--primary);
  font-size: 13px;
}
.weekly-calendar span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.safety-warning {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(255, 196, 87, .35);
  border-radius: 8px;
  color: #ffe4a3;
  background: rgba(255, 196, 87, .08);
  font-size: 13px;
  line-height: 1.45;
}
.exercise-library-card {
  border-radius: 12px;
}
.exercise-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.exercise-library-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.exercise-card {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(41,242,124,.055);
  color: var(--ink);
  text-align: left;
}
.exercise-card strong {
  color: var(--primary);
  font-size: 16px;
}
.exercise-card span,
.exercise-card small,
.exercise-detail-card p {
  color: var(--muted);
  line-height: 1.45;
}
.exercise-detail-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(184,255,61,.28);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(184,255,61,.08), rgba(0,0,0,.2));
}
.exercise-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.exercise-detail-grid article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.exercise-detail-grid strong,
.exercise-detail-grid span {
  display: block;
}
.exercise-detail-grid strong {
  color: var(--primary);
}
.program-day header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.program-day header span,
.program-day p,
.program-exercise span,
.program-exercise small,
.coach-line span {
  color: var(--muted);
}
.coach-dashboard-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 92% 0, rgba(184,255,61,.18), transparent 32%),
    linear-gradient(145deg, rgba(41,242,124,.13), rgba(6,13,8,.86) 52%),
    var(--card);
}
.coach-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}
.coach-card-head strong {
  display: block;
  color: var(--primary);
  font-size: 24px;
  line-height: 1.1;
}
.coach-card-head p {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.55;
}
.ai-badge {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(184,255,61,.45);
  border-radius: 999px;
  background: rgba(184,255,61,.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(41,242,124,.16);
}
.coach-summary-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.coach-summary-grid article,
.coach-mini-review {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.23);
}
.coach-summary-grid strong,
.coach-mini-review strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}
.coach-summary-grid span,
.coach-mini-review span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.coach-line-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.coach-weekly-review {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.coach-motivation {
  margin: 14px 0 0;
  padding: 12px;
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: rgba(184,255,61,.08);
  color: var(--ink);
  line-height: 1.45;
}
.coach-open-chat {
  width: 100%;
  margin-top: 14px;
}
.coach-chat-hero,
.coach-chat-card {
  border-radius: 14px;
}
.coach-chat-card {
  background:
    radial-gradient(circle at 8% 0, rgba(184,255,61,.14), transparent 30%),
    linear-gradient(145deg, rgba(41,242,124,.09), rgba(6,13,8,.9) 48%),
    var(--card);
}
.persona-control,
.suggested-question-grid,
.quick-reply-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.persona-control {
  margin: 10px 0 12px;
}
.persona-chip,
.suggestion-chip,
.quick-reply {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 999px;
  background: rgba(0,0,0,.24);
  color: var(--muted);
  font-size: 12px;
}
.persona-chip.active,
.suggestion-chip:hover,
.quick-reply:hover {
  border-color: rgba(184,255,61,.42);
  color: var(--primary);
  background: rgba(184,255,61,.1);
}
.chat-history {
  display: grid;
  gap: 10px;
  min-height: 300px;
  max-height: 54vh;
  margin-top: 14px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(92,255,166,.16);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  scroll-behavior: smooth;
}
.chat-empty-state {
  display: grid;
  gap: 8px;
  align-self: center;
  justify-self: center;
  max-width: 340px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}
.chat-empty-state strong {
  color: var(--primary);
  font-size: 18px;
}
.chat-message {
  display: grid;
  gap: 5px;
  width: min(88%, 520px);
  padding: 11px 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}
.chat-message.user {
  justify-self: end;
  border-color: rgba(184,255,61,.34);
  background: rgba(184,255,61,.11);
}
.chat-message.coach {
  justify-self: start;
  background: rgba(0,0,0,.28);
}
.chat-message.thinking div {
  color: var(--primary);
}
.chat-message.thinking div::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  animation: thinkingDots 1.1s steps(4, end) infinite;
}
.chat-message div {
  color: var(--ink);
  line-height: 1.5;
}
.chat-message time {
  color: var(--muted);
  font-size: 11px;
}
.quick-reply-grid {
  margin-top: 12px;
}
.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}
.chat-input-row input {
  min-width: 0;
}
.chat-input-row button {
  min-width: 76px;
}
.clear-chat-button {
  width: 100%;
  margin-top: 10px;
}
.recovery-readiness-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(184, 255, 61, .08), transparent 50%),
    rgba(6, 13, 9, .92);
}
.habit-adherence-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(41, 242, 124, .1), transparent 52%),
    rgba(6, 13, 9, .92);
}
.progress-prediction-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(82, 155, 255, .12), transparent 54%),
    rgba(6, 13, 9, .92);
}
.smart-notifications-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 210, 92, .12), transparent 54%),
    rgba(6, 13, 9, .92);
}
.recovery-readiness-layout,
.habit-adherence-layout,
.prediction-card-layout {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}
.readiness-score-ring {
  --ring-value: 0%;
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(5,8,6,1) 0 55%, transparent 56%),
    conic-gradient(var(--primary) var(--ring-value), rgba(255,255,255,.08) 0);
  box-shadow: var(--glow);
}
.readiness-score-ring span {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.readiness-score-ring small {
  color: var(--muted);
  font-weight: 800;
}
.recovery-readiness-layout strong,
.recovery-readiness-layout p,
.habit-adherence-layout strong,
.habit-adherence-layout p,
.prediction-card-layout strong,
.prediction-card-layout p {
  display: block;
  margin: 0;
  line-height: 1.45;
}
.recovery-readiness-layout p,
.habit-adherence-layout p,
.prediction-card-layout p {
  color: var(--muted);
}
.recovery-factor-grid,
.habit-metric-grid,
.prediction-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 10px;
}
.recovery-factor-grid article,
.habit-metric-grid article,
.prediction-metric-grid article {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(92,255,166,.16);
  border-radius: 8px;
  background: rgba(0,0,0,.22);
}
.recovery-factor-grid strong,
.recovery-factor-grid span,
.habit-metric-grid strong,
.habit-metric-grid span,
.prediction-metric-grid strong,
.prediction-metric-grid span {
  display: block;
  overflow-wrap: anywhere;
}
.recovery-factor-grid span,
.habit-metric-grid span,
.prediction-metric-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.notification-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0;
}
.notification-summary-grid article,
.weekly-notification-summary {
  padding: 11px;
  border: 1px solid rgba(92,255,166,.16);
  border-radius: 8px;
  background: rgba(0,0,0,.22);
}
.notification-summary-grid strong,
.notification-summary-grid span {
  display: block;
}
.notification-summary-grid span,
.weekly-notification-summary {
  color: var(--muted);
  font-size: 12px;
}
.notification-list article[data-priority="Critical"],
.notification-list article[data-priority="High"] {
  border-color: rgba(255, 210, 92, .36);
}
.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.notification-action {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}
.trainer-hero,
.trainer-profile-card,
.trainer-client-card,
.trainer-overview-card,
.trainer-note-card,
.trainer-recommendation-card,
.trainer-ai-card {
  border-radius: 14px;
}
.trainer-dashboard-grid,
.trainer-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.trainer-dashboard-grid article,
.trainer-overview-grid article {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(92,255,166,.17);
  border-radius: 12px;
  background: rgba(0,0,0,.24);
}
.trainer-dashboard-grid strong,
.trainer-overview-grid strong {
  display: block;
  color: var(--primary);
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.trainer-dashboard-grid span,
.trainer-overview-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.trainer-filter-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 180px);
  gap: 8px;
  margin: 10px 0 12px;
}
.trainer-client-list,
.trainer-timeline {
  display: grid;
  gap: 9px;
}
.trainer-client-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 12px;
  border: 1px solid rgba(92,255,166,.16);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
  color: var(--ink);
  text-align: left;
}
.trainer-client-row.active {
  border-color: rgba(184,255,61,.5);
  background: rgba(184,255,61,.1);
}
.trainer-client-row strong,
.trainer-client-row small,
.trainer-client-row b {
  display: block;
}
.trainer-client-row small,
.trainer-timeline-item span,
.trainer-timeline-item small {
  color: var(--muted);
}
.trainer-client-row b {
  color: var(--primary);
  text-align: right;
}
.trainer-overview-grid {
  margin-top: 12px;
}
.trainer-timeline {
  margin-top: 14px;
}
.trainer-timeline-item {
  padding: 11px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: rgba(0,0,0,.24);
}
.trainer-timeline-item strong,
.trainer-timeline-item span,
.trainer-timeline-item small {
  display: block;
  line-height: 1.35;
}
.program-exercise {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(92,255,166,.16);
  border-radius: 8px;
  background: rgba(3,10,6,.55);
}
.program-exercise label { margin-bottom: 8px; }
.compact-grid { grid-template-columns: repeat(4, 1fr); }
.compact-grid input { padding: 9px; }
.overload-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(184,255,61,.08), transparent 52%),
    rgba(6, 13, 9, .9);
}
.program-manager-card,
.program-detail-card {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.09), transparent 48%),
    rgba(6, 13, 9, .92);
}
.program-manager-layout,
.program-schedule-grid,
.program-manager-list {
  display: grid;
  gap: 10px;
}
.program-manager-layout {
  margin-top: 14px;
}
.program-manager-item {
  padding: 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}
.program-manager-item.active {
  border-color: rgba(184,255,61,.42);
  box-shadow: 0 0 22px rgba(184,255,61,.08);
}
.program-manager-item header,
.program-order-actions,
.program-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.program-manager-item header {
  justify-content: space-between;
}
.program-manager-item p,
.program-manager-item small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.program-manager-item p { margin: 7px 0 2px; }
.program-actions { margin-top: 10px; }
.program-actions button,
.program-order-actions button {
  min-height: 38px;
  padding: 8px 11px;
}
.program-order-actions {
  margin: 10px 0 8px;
}
.program-schedule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.program-schedule-grid article {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
}
.program-schedule-grid article.training {
  border-color: rgba(184,255,61,.34);
  background: rgba(184,255,61,.08);
}
.program-schedule-grid strong,
.program-schedule-grid span {
  display: block;
}
.program-schedule-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.analytics-hero,
.analytics-overview-card,
.analytics-volume-card,
.analytics-balance-card,
.analytics-recovery-card,
.analytics-heatmap-card,
.analytics-landmarks-card,
.analytics-weak-card,
.analytics-frequency-card {
  border-radius: 14px;
}
.analytics-overview-card,
.analytics-volume-card,
.analytics-balance-card,
.analytics-recovery-card,
.analytics-heatmap-card,
.analytics-landmarks-card,
.analytics-weak-card,
.analytics-frequency-card {
  background:
    linear-gradient(145deg, rgba(41,242,124,.08), transparent 50%),
    rgba(6, 13, 9, .9);
}
.analytics-recommendation {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid rgba(184,255,61,.28);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(184,255,61,.07);
  font-weight: 800;
  line-height: 1.45;
}
.analytics-volume-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.analytics-volume-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
}
.analytics-volume-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.analytics-volume-row strong,
.analytics-volume-row span,
.analytics-volume-row small {
  display: block;
}
.analytics-volume-row span,
.analytics-volume-row small {
  color: var(--muted);
  line-height: 1.4;
}
.landmark-below-range { border-color: rgba(255,196,87,.34); }
.landmark-optimal { border-color: rgba(184,255,61,.34); }
.landmark-above-range { border-color: rgba(255,77,77,.34); }
.muscle-heatmap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.muscle-heatmap article {
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.muscle-heatmap strong,
.muscle-heatmap span,
.muscle-heatmap small {
  display: block;
}
.muscle-heatmap span {
  margin-top: 8px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}
.muscle-heatmap small { color: var(--muted); }
.heat-very-high { border-color: rgba(255,77,77,.42) !important; background: rgba(255,77,77,.1) !important; }
.heat-high { border-color: rgba(184,255,61,.42) !important; background: rgba(184,255,61,.09) !important; }
.heat-medium { border-color: rgba(41,242,124,.36) !important; background: rgba(41,242,124,.08) !important; }
.heat-low { border-color: rgba(92,255,166,.2) !important; }
.heat-none { opacity: .62; }
.overload-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.overload-item {
  padding: 12px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
}
.overload-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.overload-item strong,
.overload-item p,
.overload-item small {
  display: block;
}
.overload-item p {
  margin: 7px 0 0;
  color: var(--ink);
  line-height: 1.45;
}
.overload-item small,
.overload-suggestion {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}
.pr-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid rgba(184,255,61,.4);
  border-radius: 999px;
  background: rgba(184,255,61,.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}
.pr-item {
  border-color: rgba(184,255,61,.34);
  box-shadow: 0 0 22px rgba(184,255,61,.08);
}
.coach-line {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(92,255,166,.14);
}
.coach-line:last-child { border-bottom: 0; }
.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  margin: 16px -2px;
  padding: 8px 2px;
  overflow-x: auto;
  background: rgba(5, 8, 6, 0.9);
  backdrop-filter: blur(12px);
}
.tab { min-width: 82px; min-height: 40px; background: transparent; color: var(--muted); border: 1px solid transparent; box-shadow: none; }
.tab.active { background: rgba(41, 242, 124, 0.1); color: var(--primary); border-color: var(--line); box-shadow: none; }
.top-nav { display: none; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: min(480px, calc(100% - 20px));
  padding: 8px;
  border: 1px solid rgba(92, 255, 166, .24);
  border-radius: 18px;
  background: rgba(4, 10, 7, .92);
  box-shadow: 0 18px 48px rgba(0,0,0,.55), 0 0 28px rgba(41,242,124,.12);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}
.bottom-nav .tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 52px;
  padding: 7px 2px;
  border-radius: 14px;
}
.bottom-nav .tab span {
  font-size: 18px;
  line-height: 1;
}
.bottom-nav .tab small {
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.bottom-nav .tab.active {
  background: linear-gradient(180deg, rgba(41,242,124,.2), rgba(41,242,124,.08));
  box-shadow: inset 0 0 0 1px rgba(184,255,61,.2);
}
.screen { display: none; }
.screen.active {
  display: block;
  animation: premiumRise .22s ease both;
}
.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(41, 242, 124, 0.16), transparent),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 12px),
    var(--surface-2);
}
#timer { margin-top: 4px; font-size: 46px; line-height: 1; color: var(--primary); text-shadow: 0 0 24px rgba(41, 242, 124, 0.38); }
.session-actions { display: grid; gap: 8px; }
.session-actions button { min-width: 88px; }
.entry-form, .quick-list, .chart-card, .store-card { margin-top: 14px; padding: 16px; }
label { display: block; margin-bottom: 12px; color: var(--ink); font-weight: 700; }
input, select, textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 10, 6, 0.78);
  color: var(--ink);
}
input[readonly] {
  color: var(--accent);
  font-weight: 800;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(41, 242, 124, 0.36);
  border-color: var(--primary);
}
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.entry-form > button { width: 100%; }
.calorie-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(41, 242, 124, 0.08) 0 2px, transparent 2px 10px),
    rgba(41, 242, 124, 0.06);
}
.calorie-estimate span,
#healthSyncStatus,
#healthImportCalories {
  display: block;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}
.calorie-estimate p,
.health-copy {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.health-connect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.health-provider {
  min-height: 52px;
  padding: 8px;
}
.health-provider.active-provider {
  background: linear-gradient(180deg, var(--accent), var(--primary));
  color: #041006;
  border-color: transparent;
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.mood-grid button {
  min-height: 52px;
  background: rgba(41,242,124,.08);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
  font-size: 24px;
}
.mood-grid button.active-mood {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}
.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}
.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.danger-zone {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chips button { min-height: 54px; padding: 8px 10px; background: rgba(41, 242, 124, 0.1); color: var(--primary); border: 1px solid var(--line); box-shadow: none; }
.history-list { display: grid; gap: 10px; }
.history-item { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.history-item header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.history-item strong { display: block; }
.history-item span, .history-item p { color: var(--muted); }
.history-item p { margin: 8px 0 0; }
.meal-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.meal-group-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(184,255,61,.24);
  border-radius: 8px;
  background: rgba(184,255,61,.06);
}
.meal-group-header strong { color: var(--accent); }
.meal-group-header span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.danger-link {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}
.food-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 8px;
  margin: 10px 0;
}
.food-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(41,242,124,.035);
  color: var(--muted);
  text-align: center;
}
.empty::before {
  content: "";
  width: 44px;
  height: 44px;
  border: 1px solid rgba(184,255,61,.38);
  border-radius: 50%;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 22px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 3px 22px no-repeat,
    rgba(184,255,61,.08);
  box-shadow: 0 0 22px rgba(184,255,61,.12);
}
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; height: 180px; padding-top: 12px; }
.bar { display: grid; align-items: end; gap: 6px; height: 100%; text-align: center; color: var(--muted); font-size: 12px; }
.bar-fill { min-height: 8px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--primary)); box-shadow: 0 0 16px rgba(41, 242, 124, 0.28); }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.metrics-grid article { padding: 14px 12px; }
.metrics-grid strong { display: block; font-size: 24px; }
.metrics-grid span { color: var(--muted); font-size: 13px; }
.progress-hero,
.progress-overall-card,
.progress-score-card,
.progress-weight-card,
.progress-nutrition-card,
.progress-water-card,
.progress-sleep-card,
.progress-summary-card,
.progress-achievements-card {
  border-radius: 12px;
}
.progress-empty-card {
  border-style: dashed;
  text-align: center;
  color: var(--muted);
}
.progress-chart,
.progress-line-chart {
  width: 100%;
  min-height: 150px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(41, 242, 124, .18);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(41, 242, 124, .06), rgba(0, 0, 0, .22));
  overflow: hidden;
}
.progress-chart svg,
.progress-line-chart svg {
  display: block;
  width: 100%;
  height: 130px;
}
.progress-grid-line {
  fill: none;
  stroke: rgba(255, 255, 255, .12);
  stroke-width: 1;
}
.progress-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(41, 242, 124, .45));
}
.progress-dot {
  fill: var(--accent);
  stroke: rgba(0, 0, 0, .5);
  stroke-width: 1;
}
.progress-chart > span,
.progress-line-chart > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.progress-mini-bars {
  display: grid;
  grid-template-columns: repeat(30, minmax(3px, 1fr));
  align-items: end;
  gap: 3px;
  height: 130px;
}
.progress-mini-bars i {
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  box-shadow: 0 0 10px rgba(41, 242, 124, .22);
}
.progress-bars {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.progress-bars label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.summary-grid,
.achievement-grid {
  display: grid;
  gap: 10px;
}
.summary-grid article,
.achievement-grid article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(41, 242, 124, .055);
}
.summary-grid strong,
.achievement-grid strong {
  display: block;
  color: var(--primary);
}
.summary-grid span,
.achievement-grid span,
.achievement-grid small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.achievement-grid article {
  min-height: 112px;
  transition: transform .18s ease, border-color .18s ease;
}
.achievement-grid article.earned {
  border-color: rgba(184, 255, 61, .45);
  background: linear-gradient(145deg, rgba(184, 255, 61, .12), rgba(41, 242, 124, .045));
}
.achievement-grid article.locked {
  opacity: .55;
  filter: grayscale(.45);
}
.achievement-grid article strong {
  font-size: 22px;
  margin-bottom: 6px;
}
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.macro-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(41, 242, 124, 0.06);
}
.macro-grid strong {
  display: block;
  color: var(--primary);
  font-size: 22px;
}
.macro-grid span,
.macro-bars span,
.ai-coach-text {
  color: var(--muted);
}
.macro-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.macro-track {
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.macro-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width .35s ease;
}
.macro-fill.protein { background: linear-gradient(90deg, #29f27c, #9dffbd); }
.macro-fill.carbs { background: linear-gradient(90deg, #b8ff3d, #ffe66d); }
.macro-fill.fat { background: linear-gradient(90deg, #6ee7b7, #22c55e); }
.ai-coach-text {
  margin: 14px 0 0;
  line-height: 1.5;
}
#nutrition .chart-card,
#nutrition .entry-form,
#nutrition .quick-list {
  margin-top: 16px;
  padding: 18px;
  border-radius: 12px;
}
#nutrition .section-title {
  align-items: flex-start;
  gap: 12px;
}
#nutrition .section-title h2 {
  font-size: 20px;
  line-height: 1.2;
}
#nutrition .section-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.food-summary-card {
  background:
    radial-gradient(circle at 12% 0, rgba(184,255,61,.18), transparent 34%),
    linear-gradient(145deg, rgba(41,242,124,.11), transparent 46%),
    var(--surface);
}
#nutrition .macro-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
#nutrition .macro-grid article {
  min-height: 86px;
  padding: 14px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.1), transparent 62%),
    rgba(3,10,6,.58);
}
#nutrition .macro-grid strong {
  margin-bottom: 4px;
  font-size: 25px;
  line-height: 1;
}
#nutrition .macro-bars {
  gap: 12px;
  margin-top: 16px;
}
#nutrition .macro-track {
  height: 12px;
  margin-top: 7px;
}
.food-form-card label { margin-bottom: 14px; }
.food-form-card input,
.food-form-card select,
.food-form-card textarea {
  min-height: 48px;
}
.save-feedback {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.saved-pop { animation: savedPulse .42s ease both; }
#nutrition .meal-group {
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(92,255,166,.18);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.08), transparent 52%),
    rgba(3,10,6,.5);
}
#nutrition .meal-group-header {
  padding: 4px 2px 10px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
#nutrition .meal-group-header strong {
  color: var(--accent);
  font-size: 16px;
}
#nutrition .history-item {
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.07), transparent 60%),
    rgba(8,18,12,.76);
}
#nutrition .history-item header { align-items: flex-start; }
#nutrition .history-item strong { font-size: 16px; }
.food-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
}
.food-empty strong {
  color: var(--ink);
  font-size: 17px;
}
.food-empty p { margin: 0; }
.empty-illustration {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(184,255,61,.3);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(184,255,61,.16), transparent 44%),
    rgba(41,242,124,.08);
  box-shadow: 0 0 24px rgba(41,242,124,.14);
}
.empty-illustration::before,
.empty-illustration::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--accent);
}
.empty-illustration::before {
  width: 34px;
  height: 3px;
  left: 19px;
  top: 35px;
}
.empty-illustration::after {
  width: 3px;
  height: 34px;
  left: 35px;
  top: 19px;
}
.checkin-hero,
.checkin-card,
.checkin-history-card {
  border-radius: 12px;
}
.checkin-card {
  background:
    radial-gradient(circle at 10% 0, rgba(184,255,61,.16), transparent 30%),
    linear-gradient(145deg, rgba(41,242,124,.1), transparent 48%),
    var(--surface);
}
.checkin-field {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.checkin-field > strong {
  font-size: 14px;
}
.checkin-mood-grid button {
  min-height: 58px;
  border-radius: 12px;
}
#energyValue {
  float: right;
  color: var(--accent);
  font-size: 13px;
}
input[type="range"] {
  accent-color: var(--primary);
  min-height: 34px;
  padding: 0;
}
.checkin-history-item {
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.07), transparent 56%),
    rgba(8,18,12,.78);
}
.checkin-history-item.done {
  border-color: rgba(184,255,61,.36);
  background:
    linear-gradient(145deg, rgba(184,255,61,.12), transparent 56%),
    rgba(8,18,12,.82);
}
.weight-hero,
.weight-latest-card,
.weight-form-card,
.weight-stats-card,
.weight-chart-card,
.weight-history-card {
  border-radius: 12px;
}
.weight-latest-card,
.weight-form-card,
.weight-stats-card,
.weight-chart-card,
.weight-history-card {
  background:
    linear-gradient(145deg, rgba(184,255,61,.09), rgba(11,15,12,.72) 44%),
    var(--card);
}
.weight-latest-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.weight-latest-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}
.weight-latest-grid span,
.weight-chart-point span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.weight-latest-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--primary);
  font-size: 22px;
  line-height: 1.1;
}
.photo-placeholder {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin-top: 8px;
  border: 1px dashed rgba(184,255,61,.35);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(41,242,124,.08), rgba(255,255,255,.03)),
    rgba(0,0,0,.22);
  color: var(--muted);
  font-size: 13px;
}
.weight-line-chart {
  display: grid;
  min-height: 178px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 12px;
}
.weight-chart-point {
  display: grid;
  min-width: 0;
  min-height: 150px;
  align-items: end;
  justify-items: center;
  gap: 6px;
}
.weight-chart-line {
  width: 100%;
  max-width: 24px;
  min-height: 6px;
  border-radius: 999px 999px 4px 4px;
  background: rgba(255,255,255,.12);
}
.weight-chart-point.has-value .weight-chart-line {
  background: linear-gradient(180deg, var(--primary), rgba(41,242,124,.28));
  box-shadow: 0 0 18px rgba(41,242,124,.22);
}
.weight-chart-point strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}
.chart-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--muted);
}
.weight-history-item .history-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.weight-history-item .history-actions button {
  min-height: 38px;
  padding: 8px 12px;
}
.danger-link {
  color: #ff7979;
}
.dashboard-water-card,
.water-hero,
.water-today-card,
.water-actions-card,
.water-goal-card,
.water-streak-card,
.water-stats-card,
.water-history-card,
.checkin-hydration-card {
  border-radius: 12px;
}
.dashboard-water-card,
.water-today-card,
.water-actions-card,
.water-goal-card,
.water-streak-card,
.water-stats-card,
.water-history-card,
.checkin-hydration-card {
  background:
    radial-gradient(circle at 88% 0, rgba(184,255,61,.14), transparent 30%),
    linear-gradient(145deg, rgba(41,242,124,.09), rgba(6,13,8,.82) 48%),
    var(--card);
}
.dashboard-water-layout,
.water-today-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.water-ring {
  --ring-value: 0%;
  display: grid;
  width: 142px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(5,8,6,1) 0 56%, transparent 57%),
    conic-gradient(var(--primary) var(--ring-value), rgba(255,255,255,.09) 0);
  box-shadow: inset 0 0 18px rgba(41,242,124,.08), 0 0 28px rgba(41,242,124,.12);
  transition: background .28s ease;
}
.water-ring.small {
  width: 92px;
}
.water-ring span {
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
}
.water-ring.small span {
  font-size: 18px;
}
.water-today-copy strong,
.dashboard-water-layout strong {
  display: block;
  color: var(--primary);
  font-size: 28px;
  line-height: 1.1;
}
.water-today-copy span,
.water-today-copy p,
.dashboard-water-layout p {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.water-summary-grid,
.water-quick-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.water-summary-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}
.water-summary-grid strong {
  display: block;
  color: var(--primary);
  font-size: 20px;
}
.water-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}
.water-quick-grid button {
  min-height: 52px;
  border-radius: 12px;
}
.inline-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.water-history-item.done {
  border-color: rgba(184,255,61,.36);
  background:
    linear-gradient(145deg, rgba(184,255,61,.12), transparent 54%),
    rgba(8,18,12,.82);
}
.water-history-item .history-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.water-history-item .history-actions button {
  min-height: 38px;
  padding: 8px 12px;
}
.water-fill {
  background: linear-gradient(90deg, #29f27c, #b8ff3d);
}
.sleep-hero,
.sleep-today-card,
.sleep-form-card,
.sleep-goal-card,
.sleep-summary-card,
.sleep-streak-card,
.sleep-history-card {
  border-radius: 12px;
}
.sleep-today-card,
.sleep-form-card,
.sleep-goal-card,
.sleep-summary-card,
.sleep-streak-card,
.sleep-history-card {
  background:
    radial-gradient(circle at 12% 0, rgba(184,255,61,.12), transparent 30%),
    linear-gradient(145deg, rgba(41,242,124,.08), rgba(6,13,8,.82) 52%),
    var(--card);
}
.sleep-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sleep-summary-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}
.sleep-summary-grid strong {
  display: block;
  color: var(--primary);
  font-size: 22px;
  line-height: 1.1;
}
.sleep-summary-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.sleep-stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.sleep-stars button {
  min-height: 52px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.32);
  box-shadow: none;
  font-size: 22px;
}
.sleep-stars button.active {
  color: var(--primary);
  border-color: rgba(184,255,61,.54);
  background: rgba(184,255,61,.12);
  box-shadow: 0 0 20px rgba(41,242,124,.14);
}
.sleep-history-item.done {
  border-color: rgba(184,255,61,.36);
  background:
    linear-gradient(145deg, rgba(184,255,61,.12), transparent 54%),
    rgba(8,18,12,.82);
}
.sleep-history-item .history-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.sleep-history-item .history-actions button {
  min-height: 38px;
  padding: 8px 12px;
}
.ai-estimate-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(184,255,61,.32);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(41,242,124,.12), transparent 46%),
    rgba(3,10,6,.72);
  box-shadow: 0 0 22px rgba(41,242,124,.12);
}
.ai-estimate-card img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(184,255,61,.35);
}
.ai-estimate-card strong,
.ai-estimate-card p,
.ai-estimate-card small {
  display: block;
}
.ai-estimate-card strong { margin-top: 6px; color: var(--text); }
.ai-estimate-card p { margin: 4px 0; color: var(--primary); font-weight: 800; line-height: 1.4; }
.ai-estimate-card small { color: var(--muted); line-height: 1.45; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 40;
  width: min(430px, calc(100% - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(184,255,61,.34);
  border-radius: 14px;
  background: rgba(5, 13, 9, .96);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 24px rgba(41,242,124,.18);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.adaptive-card {
  border-color: rgba(184,255,61,.32);
  background:
    linear-gradient(145deg, rgba(184,255,61,.08), rgba(8,18,14,.96) 42%),
    var(--card);
}
.adaptive-recommendation {
  display: grid;
  gap: 12px;
}
.adaptive-recommendation header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.adaptive-recommendation header strong {
  color: var(--text);
  font-size: 18px;
}
.adaptive-recommendation header span,
.adaptive-recommendation small,
.adaptive-empty {
  color: var(--muted);
}
.adaptive-recommendation p {
  color: var(--text);
  margin: 0;
}
.program-diff {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}
.program-diff strong {
  color: var(--accent);
}
.program-diff b {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}
.program-diff span {
  color: var(--text);
}
.adaptive-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1fr;
}
.adaptive-actions button {
  min-height: 42px;
  padding: 10px 8px;
}
@keyframes premiumRise {
  from { opacity: .84; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes premiumSheen {
  0%, 58% { transform: translateX(-120%); }
  76%, 100% { transform: translateX(120%); }
}
@keyframes savedPulse {
  0% { transform: scale(.98); box-shadow: 0 0 0 rgba(184,255,61,0); }
  50% { transform: scale(1.02); box-shadow: 0 0 26px rgba(184,255,61,.35); }
  100% { transform: scale(1); }
}
@keyframes thinkingDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}
@media (min-width: 760px) {
  .app { width: min(980px, calc(100% - 48px)); }
  .screen.active { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .screen#dashboard.active, .screen#history.active, .screen#progress.active, .screen#trainingAnalytics.active, .screen#coachChat.active, .screen#trainerPortal.active, .screen#profile.active, .screen#track.active, .screen#weightPage.active, .screen#waterPage.active, .screen#sleepPage.active { display: block; }
  .bottom-nav { width: min(620px, calc(100% - 40px)); }
}

@media (max-width: 420px) {
  .health-connect-grid { grid-template-columns: 1fr; }
  .calorie-estimate { align-items: stretch; flex-direction: column; }
  .compact-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-estimate-card { grid-template-columns: 1fr; }
  .ai-estimate-card img { width: 100%; height: 160px; }
  #nutrition .macro-grid,
  .weight-latest-grid,
  .dashboard-water-layout,
  .water-today-layout,
  .water-summary-grid,
  .water-quick-grid,
  .sleep-summary-grid,
  .achievement-grid,
  .muscle-heatmap,
  .workout-summary-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .weekly-calendar {
    grid-template-columns: 1fr 1fr;
  }
  .exercise-filter-grid,
  .adaptive-actions,
  .exercise-detail-grid {
    grid-template-columns: 1fr;
  }
  #nutrition .meal-group-header {
    display: grid;
  }
  #nutrition .meal-group-header span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .score-card,
  .nutrition-coach,
  .coach-card,
  .premium-preview,
  .score-card::after,
  .nutrition-coach::after,
  .coach-card::after,
  .premium-preview::after {
    animation: none;
  }
  .macro-fill { transition: none; }
  .saved-pop { animation: none; }
}

.ai-program-generator-card,.ai-program-draft,.ai-draft-dashboard-card{border-color:rgba(111,255,117,.3)}
.draft-dashboard-grid,.draft-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}
.draft-dashboard-grid div,.draft-summary-grid article{display:grid;gap:4px;padding:12px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08);border-radius:8px}
.draft-dashboard-grid span,.draft-summary-grid span{color:var(--muted);font-size:.78rem}.draft-program-days{display:grid;gap:12px;margin:16px 0}
.draft-day{padding:14px;border:1px solid rgba(111,255,117,.2);border-radius:8px;background:rgba(0,0,0,.2)}.draft-day header{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px}
.draft-exercise-row{display:grid;grid-template-columns:minmax(0,1.5fr) repeat(4,minmax(70px,.6fr));gap:8px;align-items:end;padding:9px 0;border-top:1px solid rgba(255,255,255,.07)}
.draft-exercise-row label{font-size:.72rem;color:var(--muted)}.draft-exercise-row input{min-width:0}.draft-validation{display:grid;gap:7px;margin:12px 0}
.draft-check{padding:9px 11px;border-radius:6px;background:rgba(255,255,255,.04)}.draft-check.pass{color:var(--green)}.draft-check.warn{color:#ffd56a}
.draft-explanation{padding:14px;border-left:3px solid var(--green);background:rgba(111,255,117,.06)}
@media(max-width:680px){.draft-dashboard-grid,.draft-summary-grid{grid-template-columns:1fr 1fr}.draft-exercise-row{grid-template-columns:1fr 1fr}.draft-exercise-row strong{grid-column:1/-1}}

.ai-nutrition-planner-card,.nutrition-plan-draft,.nutrition-draft-dashboard-card{border-color:rgba(111,255,117,.3)}
.nutrition-meal-plan{display:grid;gap:12px;margin:16px 0}.nutrition-meal-card{padding:14px;border:1px solid rgba(111,255,117,.2);border-radius:8px;background:rgba(0,0,0,.2)}
.nutrition-meal-card header{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}.nutrition-meal-items{display:grid;gap:7px}
.nutrition-food-row{display:grid;grid-template-columns:minmax(0,1.4fr) repeat(4,minmax(70px,.6fr));gap:8px;align-items:end;padding:8px 0;border-top:1px solid rgba(255,255,255,.07)}
.nutrition-food-row label{font-size:.72rem;color:var(--muted)}.nutrition-food-row input{min-width:0}.food-substitutions{color:var(--muted);font-size:.82rem;margin-top:8px}
.shopping-list-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}.shopping-group{padding:13px;border-radius:8px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08)}
.shopping-group strong{display:block;color:var(--green);margin-bottom:7px}.shopping-group span{display:block;color:var(--muted);font-size:.84rem;line-height:1.5}
@media(max-width:680px){.nutrition-food-row{grid-template-columns:1fr 1fr}.nutrition-food-row strong{grid-column:1/-1}.shopping-list-grid{grid-template-columns:1fr 1fr}}

/* RC-UI final presentation layer */
body{background:radial-gradient(circle at 18% 0,rgba(52,245,119,.18),transparent 28%),radial-gradient(circle at 86% 6%,rgba(184,255,61,.1),transparent 26%),linear-gradient(180deg,#050505,#07100b 52%,#050505);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans Thai",Arial,sans-serif;font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased}
h1{font-size:clamp(32px,8vw,40px);letter-spacing:-.04em}h2{font-size:24px;letter-spacing:-.03em}.section-title h2,.chart-card .section-title h2{font-size:18px}.dashboard-hero h2,.coach-chat-hero h2,.analytics-hero h2,.workout-hero h2{font-size:clamp(30px,7vw,40px)}
button,.tab,.workout-subtab,.persona-chip{min-height:48px;border-radius:16px;transition:transform .18s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease,opacity .18s ease}button:hover{transform:translateY(-1px)}button:active{transform:scale(.975)}button.secondary{background:rgba(255,255,255,.055);color:var(--ink);border:1px solid rgba(255,255,255,.12);box-shadow:none}button.secondary:hover{border-color:rgba(52,245,119,.34);background:rgba(52,245,119,.1)}
.app{width:min(520px,100%);padding:max(20px,env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom))}.topbar{position:sticky;top:0;z-index:18;margin:-20px -16px 16px;padding:max(14px,env(safe-area-inset-top)) 16px 12px;background:linear-gradient(180deg,rgba(5,5,5,.94),rgba(5,5,5,.72) 72%,transparent);backdrop-filter:blur(18px)}
.summary article,.session-card,.entry-form,.quick-list,.chart-card,.metrics-grid article,.store-card,.dashboard-section,.mission-card,.dashboard-actions,.dashboard-water-card,.score-card{border-color:rgba(255,255,255,.1);border-radius:20px;background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025)),rgba(16,18,17,.82);box-shadow:0 10px 28px rgba(0,0,0,.34);backdrop-filter:blur(18px)}.chart-card,.entry-form,.quick-list,.store-card,.dashboard-section,.mission-card,.dashboard-water-card{margin-top:16px;padding:16px}
.dashboard-hero{position:relative;border-radius:28px;padding:24px;border-color:rgba(52,245,119,.2);background:radial-gradient(circle at 18% 10%,rgba(52,245,119,.24),transparent 34%),linear-gradient(145deg,rgba(255,255,255,.08),rgba(255,255,255,.02)),#0a0d0b;box-shadow:0 20px 56px rgba(0,0,0,.52),inset 0 1px 0 rgba(255,255,255,.08);overflow:hidden}.ai-coach-hero{min-height:220px;display:grid;align-content:space-between}.hero-actions{position:relative;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}
.coach-dashboard-card{border-color:rgba(184,255,61,.26);background:linear-gradient(145deg,rgba(184,255,61,.1),transparent 46%),rgba(24,27,25,.94)}.coach-card-head{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:start}
.recovery-readiness-card,.habit-adherence-card,.progress-prediction-card,.smart-notifications-card{border-radius:24px;box-shadow:0 10px 28px rgba(0,0,0,.34)}.recovery-readiness-layout,.habit-adherence-layout,.prediction-card-layout{grid-template-columns:112px 1fr;gap:16px}.readiness-score-ring{width:112px;border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 0 0 8px rgba(255,255,255,.025),0 0 26px rgba(52,245,119,.18)}.readiness-score-ring span{font-size:32px}
.recovery-factor-grid article,.habit-metric-grid article,.prediction-metric-grid article,.notification-summary-grid article,.dashboard-grid article,.trend-grid article,.draft-dashboard-grid div,.draft-summary-grid article{border-radius:16px;border-color:rgba(255,255,255,.09);background:rgba(255,255,255,.045);box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}.dashboard-grid strong,.trend-grid strong,.notification-summary-grid strong,.habit-metric-grid strong,.prediction-metric-grid strong{font-size:22px;letter-spacing:-.02em}
.notification-list article{position:relative;padding-left:14px;border-radius:18px}.notification-list article:before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:999px;background:var(--primary)}.notification-list article[data-priority="Critical"]:before,.notification-list article[data-priority="High"]:before{background:#ffd166}.weekly-notification-summary{border-radius:16px;line-height:1.5}
.session-card{border-radius:26px;padding:22px}#timer{font-size:clamp(46px,16vw,72px);letter-spacing:-.06em}.entry-form button,.quick-action-grid button,.ai-actions button,.session-actions button{min-height:52px}input,select,textarea{min-height:48px;border-radius:16px;border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.055)}
.analytics-volume-row{border-radius:16px;background:linear-gradient(90deg,rgba(52,245,119,.12),rgba(255,255,255,.035)),rgba(255,255,255,.035)}.empty,.food-empty,.chart-empty,.adaptive-empty,.chat-empty-state,.progress-empty-card{border-radius:24px;border:1px solid rgba(255,255,255,.1);background:radial-gradient(circle at 50% 0,rgba(52,245,119,.14),transparent 42%),rgba(255,255,255,.04);color:var(--muted)}.chat-empty-state strong,.food-empty strong,.empty strong{color:var(--ink)}
.skeleton,.skeleton-card,.loading-placeholder,.chart-skeleton{position:relative;overflow:hidden;min-height:72px;border-radius:20px;background:rgba(255,255,255,.055)}.skeleton:after,.skeleton-card:after,.loading-placeholder:after,.chart-skeleton:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);transform:translateX(-100%);animation:skeletonSweep 1.4s ease-in-out infinite}
.modal-backdrop{backdrop-filter:blur(16px);background:rgba(0,0,0,.62)}.modal-card{border-radius:28px;border-color:rgba(255,255,255,.12);background:rgba(18,20,19,.94);box-shadow:0 20px 56px rgba(0,0,0,.52)}.toast{border-radius:20px;background:rgba(18,20,19,.94);backdrop-filter:blur(18px)}
.bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr));width:min(520px,calc(100% - 24px));min-height:78px;padding:10px 74px 10px 10px;border-radius:28px;border-color:rgba(255,255,255,.11);background:rgba(14,16,15,.86)}.bottom-nav .tab{min-height:56px;border-radius:20px}.bottom-nav .tab[data-tab="health"],.bottom-nav .tab[data-tab="nutrition"],.bottom-nav .tab[data-tab="trainerPortal"],.bottom-nav .tab[data-tab="progress"],.bottom-nav .tab[data-tab="profile"]{display:none}.bottom-nav .tab[data-tab="track"]{position:absolute;left:50%;top:-22px;width:72px;height:72px;min-height:72px;border-radius:50%;background:linear-gradient(180deg,var(--primary),var(--primary-dark));color:#031007;box-shadow:0 0 26px rgba(52,245,119,.28);transform:translateX(-50%)}.bottom-nav .tab[data-tab="track"] small{font-size:9px}.bottom-nav .tab[data-tab="track"] span{font-size:24px;color:#031007}
.screen.active,.chart-card,.dashboard-section,.entry-form,.quick-list,.store-card{animation:rcFadeSlide .22s ease both}@keyframes rcFadeSlide{from{opacity:.001;transform:translateY(8px) scale(.995)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes skeletonSweep{to{transform:translateX(100%)}}
@media(min-width:760px){.app{width:min(1120px,calc(100% - 48px))}.screen#dashboard.active{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.screen#dashboard.active>.ai-coach-hero,.screen#dashboard.active>.coach-dashboard-card,.screen#dashboard.active>.dashboard-actions,.screen#dashboard.active>.mission-card{grid-column:1/-1}.bottom-nav{width:min(560px,calc(100% - 40px))}}
@media(max-width:420px){.app{padding-inline:12px}.hero-actions,.coach-card-head,.recovery-readiness-layout,.habit-adherence-layout,.prediction-card-layout{grid-template-columns:1fr}.readiness-score-ring{width:104px}.bottom-nav{width:calc(100% - 16px);padding:8px 64px 8px 8px}.bottom-nav .tab small{font-size:9px}}

/* RC-UI bottom navigation refinement: Home / Workout / Quick / Analytics / AI Coach */
.bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr));padding:10px}
.bottom-nav .tab[data-tab="track"]{position:static;width:auto;height:auto;min-height:56px;border-radius:20px;background:transparent;color:var(--muted);box-shadow:none;transform:none}
.bottom-nav .tab[data-tab="track"] span{display:block;width:auto;height:auto;margin:0;border-radius:0;background:transparent;color:inherit;box-shadow:none;font-size:18px}
.bottom-nav .tab:nth-of-type(5){position:absolute;left:50%;top:-22px;width:72px;height:72px;min-height:72px;border-radius:50%;background:linear-gradient(180deg,var(--primary),var(--primary-dark));color:#031007;box-shadow:0 0 26px rgba(52,245,119,.28);transform:translateX(-50%)}
.bottom-nav .tab:nth-of-type(5) span{font-size:24px;color:#031007}.bottom-nav .tab:nth-of-type(5) small{font-size:9px;color:#031007}
.bottom-nav .tab:nth-of-type(1){order:2}.bottom-nav .tab:nth-of-type(2){order:1}.bottom-nav .tab:nth-of-type(6){order:5}.bottom-nav .tab:nth-of-type(8){order:4}
.bottom-nav .tab[data-tab="dashboard"] span,.bottom-nav .tab[data-tab="dashboard"] small{font-size:0}.bottom-nav .tab[data-tab="dashboard"] span:after{content:"⌂";font-size:18px}.bottom-nav .tab[data-tab="dashboard"] small:after{content:"Home";font-size:9px}

/* RC Mobile Experience (PWA): presentation-only native app polish */
html {
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  scroll-padding-top: calc(72px + env(safe-area-inset-top));
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
a,
input,
select,
textarea,
.tab,
.quick-action,
.water-button,
.water-add-button {
  touch-action: manipulation;
}

button,
.tab,
.quick-action,
.notification-action,
.persona-chip,
.workout-subtab {
  user-select: none;
  -webkit-user-select: none;
}

input,
select,
textarea {
  font-size: 16px;
  scroll-margin-top: calc(88px + env(safe-area-inset-top));
  scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom));
}

input[type="number"],
input[inputmode="decimal"] {
  font-variant-numeric: tabular-nums;
}

.app {
  width: min(100%, 520px);
  padding:
    calc(18px + env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    calc(124px + env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.splash-shell,
.auth-shell {
  padding:
    calc(18px + env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.topbar {
  top: 0;
  margin:
    calc((18px + env(safe-area-inset-top)) * -1)
    calc(max(14px, env(safe-area-inset-right)) * -1)
    16px
    calc(max(14px, env(safe-area-inset-left)) * -1);
  padding:
    calc(14px + env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    12px
    max(16px, env(safe-area-inset-left));
}

.bottom-nav {
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(520px, calc(100% - max(24px, env(safe-area-inset-left) + env(safe-area-inset-right) + 16px)));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  min-height: calc(78px + env(safe-area-inset-bottom));
}

.bottom-nav .tab,
.bottom-nav .tab[data-tab="track"],
.bottom-nav .tab:nth-of-type(5) {
  min-width: 56px;
  min-height: 56px;
}

.bottom-nav .tab:nth-of-type(5) {
  width: 74px;
  height: 74px;
}

.screen,
.chart-card,
.dashboard-section,
.entry-form,
.quick-list,
.store-card,
.session-card {
  max-width: 100%;
}

.dashboard-grid,
.trend-grid,
.form-grid,
.quick-action-grid,
.notification-summary-grid,
.habit-metric-grid,
.prediction-metric-grid,
.recovery-factor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid article,
.trend-grid article,
.history-list article,
.coach-line-list article,
.analytics-volume-row,
.draft-exercise-row,
.nutrition-food-row {
  min-width: 0;
  overflow-wrap: anywhere;
}

.session-card {
  position: sticky;
  top: calc(74px + env(safe-area-inset-top));
  z-index: 12;
  grid-template-columns: 1fr auto;
  backdrop-filter: blur(20px);
}

.session-actions {
  min-width: 112px;
}

.session-actions button,
#finishSession,
#toggleSession {
  min-height: 56px;
}

#entryForm {
  border-color: rgba(52,245,119,.18);
}

#entryForm .form-grid {
  gap: 12px;
}

#timer {
  min-width: 0;
  text-wrap: balance;
}

.chat-input-row {
  position: sticky;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 10;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: rgba(14,16,15,.88);
  backdrop-filter: blur(18px);
}

.toast {
  bottom: calc(104px + env(safe-area-inset-bottom));
}

.modal-card {
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
}

.offline-ready-note,
.pwa-install-hint {
  border-radius: 18px;
  border: 1px solid rgba(184,255,61,.18);
  background: rgba(184,255,61,.07);
  color: var(--muted);
}

@supports (height: 100dvh) {
  .splash-shell,
  .auth-shell,
  .app {
    min-height: 100dvh;
  }
}

/* RC Launch & Beta Operations */
.beta-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  margin: 8px 0 14px;
  padding: 7px 12px;
  border: 1px solid rgba(184,255,61,.28);
  border-radius: 999px;
  background: rgba(184,255,61,.09);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.beta-settings-card,
.beta-info-card,
.beta-feedback-form,
.diagnostics-card,
.beta-welcome-card,
.app-error-card {
  border-color: rgba(184,255,61,.22);
  background:
    radial-gradient(circle at 12% 0, rgba(184,255,61,.12), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
    rgba(16,18,17,.9);
}

.diagnostics-card #exportDiagnostics,
.diagnostics-card #refreshDiagnostics {
  width: 100%;
  margin-top: 10px;
}

.beta-feedback-form textarea {
  min-height: 144px;
  resize: vertical;
}

.beta-welcome-card,
.app-error-card {
  text-align: left;
}

.app-error-card .hero-actions,
.beta-welcome-card button {
  margin-top: 16px;
}

@media (display-mode: standalone) {
  body {
    background-attachment: fixed;
  }
  .topbar {
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
  }
}

@media (max-width: 360px) {
  .app {
    padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
  }
  .dashboard-grid,
  .trend-grid,
  .notification-summary-grid,
  .habit-metric-grid,
  .prediction-metric-grid,
  .recovery-factor-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions,
  .ai-actions {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    gap: 2px;
    padding-inline: 6px;
  }
  .bottom-nav .tab small {
    font-size: 8px;
  }
}

@media (min-width: 430px) and (max-width: 759px) {
  .app {
    width: min(100%, 560px);
  }
}

@media (min-width: 760px) {
  .app {
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
  }
  .session-card {
    top: calc(78px + env(safe-area-inset-top));
  }
}

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