:root {
  --ink: #e8e8e8;
  --ink-2: #d0d0d0;
  --moss: #1a1a1a;
  --moss-2: #222;
  --fern: #4a9a6a;
  --sage: #8a9a90;
  --sage-soft: #b3c2b6;
  --bone: #0e0e0e;
  --paper: #1a1a1a;
  --paper-2: #222;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --clay: #d4643e;
  --clay-dark: #b85030;
  --ochre: #d6a23c;
  --berry: #a04040;
  --ice: #1a2a1e;
  --white: #161616;
  --text-light: #f0f0f0;
  --danger: #c44;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.3), 0 22px 50px rgba(0,0,0,.5);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  color: var(--ink);
  background: var(--bone);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(ellipse at top left, rgba(212,100,62,0.06), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(214,162,60,0.04), transparent 55%);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: #0a0a0a;
  color: var(--sage-soft);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(193,90,54,0.5) 30%, rgba(193,90,54,0.5) 70%, transparent);
}

.brand {
  padding: 34px 26px 28px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 300;
  line-height: 0.85;
  color: var(--clay);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-style: italic;
  letter-spacing: -0.04em;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--text-light);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-top: 8px;
}

.nav { padding: 26px 20px; flex: 1; }
.nav-section { margin-bottom: 26px; }
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fern);
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: var(--sage-soft);
  font-size: 13px;
  transition: color .18s ease;
  position: relative;
}
.nav-item:hover { color: var(--text-light); }
.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fern);
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: color .18s ease;
  min-width: 18px;
}
.nav-item:hover .nav-num { color: var(--ochre); }
.nav-label { flex: 1; font-weight: 400; }
.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--clay);
  background: rgba(193,90,54,0.12);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}
.nav-item.active { color: var(--text-light); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--clay);
}
.nav-item.active .nav-num { color: var(--clay); }

.sidebar-foot {
  padding: 20px 24px 26px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.coach { display: flex; align-items: center; gap: 12px; }
.coach-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--moss-2);
  color: var(--text-light);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  border: 1px solid rgba(193,90,54,0.4);
  font-variation-settings: "opsz" 144;
}
.coach-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(193,90,54,0.4);
}
.coach-name { font-size: 13px; color: var(--text-light); font-weight: 500; }
.coach-role {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fern);
  margin-top: 2px;
}
.logout-link {
  color: var(--fern);
  font-size: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all .15s;
  text-decoration: none;
  line-height: 1;
}
.logout-link:hover {
  color: var(--clay);
  border-color: var(--clay);
}

/* ============ MAIN ============ */
.main { overflow-y: auto; position: relative; }

.topbar {
  padding: 44px 48px 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 48px;
  bottom: -1px;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.topbar-left { min-width: 0; flex: 1; }
.topbar-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--clay);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--clay);
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
}
.topbar-sub {
  font-size: 13px;
  color: var(--fern);
  margin-top: 10px;
}
.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }

.content { padding: 32px 48px 60px; }

/* ============ BUTTONS ============ */
.btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 11px 20px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: all .18s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: #333; color: var(--text-light); border-color: #333; }
.btn-primary { background: #333; color: var(--text-light); border-color: #333; }
.btn-primary:hover { background: var(--moss); border-color: var(--moss); }
.btn-accent { background: var(--clay); color: var(--text-light); border-color: var(--clay); }
.btn-accent:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
.btn-ghost { border-color: transparent; color: var(--fern); padding: 11px 14px; }
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: transparent; }
.btn-danger { border-color: var(--berry); color: var(--berry); }
.btn-danger:hover { background: var(--berry); color: var(--text-light); border-color: var(--berry); }
.btn-lg { padding: 15px 30px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============ CARDS ============ */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.card-flat {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px;
}

/* ============ FORMS ============ */
.field { display: block; margin-bottom: 20px; }
.field > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fern);
  margin-bottom: 9px;
  font-weight: 500;
}
.input, .select, .textarea {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  font-family: var(--font-sans);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(212,100,62,0.15);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2334614a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ============ STEPPER ============ */
.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.step {
  flex: 1;
  padding: 14px 20px 20px 0;
  position: relative;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sage);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  display: block;
}
.step-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--sage);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.step::after {
  content: '';
  position: absolute;
  left: 0;
  right: 20px;
  bottom: -1px;
  height: 2px;
  background: transparent;
}
.step.active .step-num, .step.done .step-num { color: var(--clay); }
.step.active .step-label, .step.done .step-label { color: var(--ink); }
.step.active::after { background: var(--clay); }
.step.done::after { background: var(--fern); }

/* ============ TAGS ============ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 5px 11px;
  border-radius: 2px;
  background: var(--paper);
  color: var(--fern);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-clay { background: rgba(193,90,54,0.1); color: var(--clay-dark); border-color: rgba(193,90,54,0.3); }
.tag-sage { background: var(--ice); color: var(--moss); border-color: rgba(52,97,74,0.2); }
.tag-ochre { background: rgba(214,162,60,0.15); color: #8a6a17; border-color: rgba(214,162,60,0.35); }
.tag-berry { background: rgba(122,46,46,0.1); color: var(--berry); border-color: rgba(122,46,46,0.3); }
.tag-ink { background: #333; color: var(--text-light); border-color: #333; }

/* ============ CLIENT CARDS ============ */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}
.client-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 28px;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.client-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--clay);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s ease;
}
.client-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.client-card:hover::before { transform: scaleY(1); }
.client-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.client-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--sage);
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}
.client-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 6px;
}
.client-meta { font-size: 12px; color: var(--fern); }
.client-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.client-stat-label {
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-bottom: 5px;
}
.client-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  line-height: 1;
  letter-spacing: -0.02em;
}
.client-stat-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fern);
  margin-left: 3px;
  font-weight: 400;
}
.client-progress {
  display: flex;
  align-items: center;
  gap: 14px;
}
.progress-track {
  flex: 1;
  height: 2px;
  background: var(--paper-2);
  position: relative;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--clay);
  transition: width .4s ease;
}
.progress-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fern);
  letter-spacing: 0.1em;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .25);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, .25); }
  50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, .1); }
}

.client-portal-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--paper);
  border-radius: 6px;
  border: 1px dashed var(--line);
}
.client-portal-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sage);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

/* ============ DETAIL HEADER ============ */
.detail-header {
  padding: 44px 48px 28px;
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.detail-header::after {
  content: '';
  position: absolute;
  left: 48px;
  bottom: -1px;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.back-link {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fern);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color .15s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.back-link:hover { color: var(--clay); }
.detail-name {
  font-family: var(--font-display);
  font-size: 62px;
  font-weight: 300;
  color: var(--ink);
  line-height: 0.95;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.035em;
}
.detail-sub {
  font-size: 13px;
  color: var(--fern);
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.detail-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sage); }

/* ============ TABS ============ */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 14px 0;
  margin-right: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--sage);
  position: relative;
  transition: color .15s;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tab .tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--sage);
  transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab:hover .tab-icon { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active .tab-icon { color: var(--clay); }
.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--clay);
}

/* ============ HERO STAT CARD (atleta perfil) ============ */
.hero-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(74,154,106,.10) 0%, rgba(212,100,62,.07) 60%, rgba(214,162,60,.05) 100%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(212,100,62,.10), transparent 70%);
  pointer-events: none;
}
.hero-stat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  position: relative;
}
.hero-stat + .hero-stat {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.hero-stat-icon {
  flex-shrink: 0;
  margin-top: 4px;
}
.hero-stat-body {
  flex: 1;
  min-width: 0;
}
.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}
.hero-stat-val {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  line-height: 1.05;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-stat-u {
  font-size: 13px;
  color: var(--sage);
  font-family: var(--font-sans);
  font-variation-settings: normal;
  margin-left: 1px;
}
.hero-stat-of {
  font-size: 11px;
  color: var(--sage);
  font-family: var(--font-mono);
  font-variation-settings: normal;
  letter-spacing: 0.05em;
}
.hero-stat-sub {
  font-size: 10px;
  color: var(--sage);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-stat-bar {
  height: 3px;
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.hero-stat-bar > div {
  height: 100%;
  transition: width .4s ease;
}
.atleta-body.light .hero-card {
  background:
    linear-gradient(135deg, rgba(74,154,106,.08) 0%, rgba(212,100,62,.06) 60%, rgba(214,162,60,.04) 100%),
    #fefcf5;
  border-color: #d8ccaa;
}
.atleta-body.light .hero-stat + .hero-stat {
  border-left-color: #d8ccaa;
}
@media (max-width: 720px) {
  .hero-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 16px;
  }
  .hero-stat + .hero-stat {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
  .atleta-body.light .hero-stat + .hero-stat {
    border-top-color: #d8ccaa;
  }
  .hero-stat-val { font-size: 22px; }

  /* Metric grids fixos a 4-5 colunas (declarados em style inline) colapsam para 2 em mobile/landscape estreito. */
  .metric-grid[style*="repeat(5,1fr)"],
  .metric-grid[style*="repeat(5, 1fr)"],
  .metric-grid[style*="repeat(4,1fr)"],
  .metric-grid[style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Grid-4 (subscricao activa, layouts auxiliares) idem. */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  /* Subscricao activa — valores colapsam tamanho para caber. */
  .sub-stats .sub-stat-val,
  .sub-stats .metric-val {
    font-size: 18px !important;
  }
  /* Botoes de accao em paineis devem fluir, nao esticar para fora do card. */
  .sub-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    padding: 9px 12px;
  }
}

@media (max-width: 480px) {
  /* Mobile portrait estreito — metric-grids viram 1 coluna. */
  .metric-grid[style*="repeat(5,1fr)"],
  .metric-grid[style*="repeat(5, 1fr)"],
  .metric-grid[style*="repeat(4,1fr)"],
  .metric-grid[style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Grid-4 da subscricao — 2 colunas em portrait estreito (mantem visivel). */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .sub-stats .sub-stat-val,
  .sub-stats .metric-val {
    font-size: 16px !important;
  }
}

/* ============ METRIC GRID ============ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: var(--white);
  margin-bottom: 28px;
}
.metric {
  padding: 24px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric:nth-child(3n) { border-right: none; }
.metric:nth-last-child(-n+3) { border-bottom: none; }
.metric-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-bottom: 12px;
}
.metric-val {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
}
.metric-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fern);
  margin-left: 5px;
  font-weight: 400;
}

/* ============ HEALTH STRIP ============ */
.health-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 28px;
}
.health-item {
  padding: 18px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.health-item:nth-child(2n) { border-right: none; }
.health-item:nth-last-child(-n+2) { border-bottom: none; }
.health-item b {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ============ DAY TABS ============ */
.day-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.day-tab:hover { color: var(--ink); }
.day-tab.active {
  color: var(--ink);
  border-bottom-color: var(--clay);
}

/* ============ MEAL ROW ============ */
.meal {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: opacity .2s;
}
.meal-done { opacity: .5; }
.meal-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding-top: 4px;
}
.meal-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  transition: all .15s;
}
.meal-checkbox.checked {
  background: var(--fern);
  border-color: var(--fern);
}
.meal-photo-btn {
  cursor: pointer;
  font-size: 18px;
  opacity: .4;
  transition: opacity .15s;
  display: flex;
  align-items: center;
  padding: 4px;
}
.meal-photo-btn:hover { opacity: 1; }
.meal-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clay);
  letter-spacing: 0.1em;
  font-weight: 500;
}
.meal-label-sm {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
  margin-top: 6px;
}
.meal-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  line-height: 1.15;
}
.meal-foods {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 16px;
}
.macro-row { display: flex; gap: 24px; }
.macro { display: flex; align-items: baseline; gap: 6px; }
.macro-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--sage);
}
.macro-val {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
}
.meal-kcal { text-align: right; min-width: 100px; }
.meal-kcal-val {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
}
.meal-kcal-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-top: 6px;
}

/* ============ TRAINING ============ */
.phase-header {
  background: #0a0a0a;
  color: var(--text-light);
  padding: 32px 36px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
}
.phase-header::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.phase-num {
  font-family: var(--font-display);
  font-size: 84px;
  font-weight: 300;
  line-height: 0.8;
  color: var(--clay);
  font-variation-settings: "opsz" 144, "SOFT" 60;
  letter-spacing: -0.04em;
}
.phase-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.05;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.02em;
}
.phase-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage-soft);
  margin-top: 10px;
}

.day-section { margin-bottom: 28px; }
.day-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 14px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  display: flex;
  align-items: center;
  gap: 14px;
}
.day-title::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--clay);
}

.exercise {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.ex-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--clay);
  letter-spacing: 0.1em;
}
.ex-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.ex-det {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fern);
  letter-spacing: 0.03em;
  margin-top: 3px;
}
.ex-tempo {
  color: var(--clay);
  font-weight: 500;
  cursor: help;
}

/* ============ LOADING / EMPTY ============ */
.loading {
  padding: 100px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: 400;
}
.load-sub {
  font-size: 12px;
  color: var(--fern);
  max-width: 360px;
  text-align: center;
  line-height: 1.65;
}

.empty { padding: 90px 40px; text-align: center; }
.empty-num {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 300;
  color: var(--line-strong);
  line-height: 0.9;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}
.empty-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  margin-bottom: 12px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.empty-sub {
  font-size: 13px;
  color: var(--fern);
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* ============ ALERTS ============ */
.alert {
  padding: 16px 0;
  font-size: 13px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.55;
  background: none;
  border: none;
}
.alert-ok { color: #6baa84; }
.alert-warn { color: #d6a23c; }
.alert-err { color: #d06060; }
.alert-prefix {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  flex-shrink: 0;
}

/* ============ STARS ============ */
.stars { display: flex; gap: 8px; }
.star {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--white);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--line-strong);
  transition: all .15s;
  user-select: none;
  cursor: pointer;
}
.star:hover { border-color: var(--clay); }
.star.on {
  background: var(--clay);
  color: var(--text-light);
  border-color: var(--clay);
}

/* ============ CHECKIN ============ */
.checkin-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ci-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clay);
  letter-spacing: 0.1em;
  font-weight: 500;
}
.ci-body { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.ci-weight {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.015em;
}

.hero-params {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px 36px;
  margin-bottom: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.hero-param {
  padding-right: 22px;
  border-right: 1px solid var(--line);
}
.hero-param:last-child { border-right: none; padding-right: 0; }
.hero-param-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-bottom: 10px;
}
.hero-param-val {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.02em;
}
.hero-param-val .sm { font-size: 14px; color: var(--fern); font-weight: 400; }

.generate-cta {
  text-align: center;
  padding: 70px 40px;
  border: 1px dashed var(--line-strong);
  background: var(--paper);
}
.generate-cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--clay);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.generate-cta-eyebrow::before, .generate-cta-eyebrow::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--clay);
}
.generate-cta-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 300;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  line-height: 1.05;
}
.generate-cta-sub {
  font-size: 13px;
  color: var(--fern);
  max-width: 520px;
  margin: 0 auto 30px;
  line-height: 1.65;
}

.phase-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 30px;
}
.phase-prev {
  padding: 28px 26px 26px;
  background: var(--white);
  border: 1px solid var(--line);
  position: relative;
}
.phase-prev-num {
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--clay);
  font-variation-settings: "opsz" 144, "SOFT" 60;
  line-height: 0.85;
  font-weight: 300;
  letter-spacing: -0.03em;
}
.phase-prev-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
  margin-top: 8px;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.phase-prev-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 12px;
  line-height: 1.6;
}

/* ============ CHECKIN RESULT ============ */
.ci-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--white);
  margin-bottom: 28px;
}
.ci-metric {
  padding: 26px 28px;
  border-right: 1px solid var(--line);
}
.ci-metric:last-child { border-right: none; }
.ci-metric-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage);
  margin-bottom: 12px;
}
.ci-metric-val {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
}
.ci-metric-delta {
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 10px;
  letter-spacing: 0.1em;
}
.ci-metric-delta.up { color: var(--fern); }
.ci-metric-delta.dn { color: var(--clay); }

.feedback-card {
  background: #0a0a0a;
  color: var(--text-light);
  padding: 40px 44px;
  position: relative;
}
.feedback-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 56px;
  background: var(--clay);
}
.feedback-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--clay);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.feedback-title::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--clay);
}
.feedback-body {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-light);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.01em;
}
.feedback-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 32px 0 22px;
}
.feedback-adjustments {
  font-size: 13px;
  color: var(--sage-soft);
  line-height: 1.8;
  white-space: pre-line;
}

.select-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px 26px;
  margin-bottom: 26px;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#content > * { animation: fadeUp .15s ease both; }
#content > *:nth-child(2) { animation-delay: .03s; }
#content > *:nth-child(3) { animation-delay: .06s; }

/* ============ MODAL SYSTEM ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 15, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .22s ease;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; }
.modal {
  background: var(--white);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 40px 42px 34px;
  position: relative;
  transform: translateY(12px);
  transition: transform .25s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--clay);
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 300;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.modal-description {
  font-size: 13px;
  color: var(--fern);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-body {
  margin-bottom: 24px;
}
.modal-body .field:last-child { margin-bottom: 0; }
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.modal-actions .btn { min-width: 110px; justify-content: center; }

.modal-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fern);
  letter-spacing: 0.08em;
  margin-top: 6px;
  line-height: 1.55;
}
.modal-calc {
  background: var(--paper);
  border-left: 2px solid var(--clay);
  padding: 14px 18px;
  margin: 6px 0 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.modal-calc b {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 16px;
  font-variation-settings: "opsz" 144;
}

.overdue-banner {
  background: var(--berry);
  color: var(--text-light);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background .15s;
}
.overdue-banner:hover { background: #5f2323; }
.overdue-banner-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ochre);
  font-weight: 500;
  white-space: nowrap;
}
.overdue-banner-list { flex: 1; }
.overdue-banner-list strong { color: var(--text-light); }
.overdue-banner-cta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.8;
  white-space: nowrap;
}

/* ============ PACKAGES CATALOG ============ */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.package-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px 26px;
  position: relative;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.package-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--clay);
}
.package-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.package-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.package-code {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--clay);
  font-weight: 500;
}
.package-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.package-desc {
  font-size: 12px;
  color: var(--fern);
  line-height: 1.55;
  margin-bottom: 18px;
  min-height: 54px;
}
.package-price {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 14px;
}
.package-price-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.025em;
  line-height: 1;
}
.package-price-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fern);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.package-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* ============ AUTH PAGES ============ */
.auth-body {
  background: var(--bone);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at top left, rgba(193,90,54,0.06), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(214,162,60,0.08), transparent 55%);
  pointer-events: none;
}
.auth-shell {
  width: 100%;
  max-width: 460px;
  position: relative;
}
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}
.auth-brand-mark {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 300;
  line-height: 0.85;
  color: var(--clay);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-style: italic;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
.auth-brand-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}
.auth-brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1.1;
}
.auth-brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--clay);
  margin-top: 10px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 44px 44px 40px;
  position: relative;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.auth-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 300;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.auth-sub {
  font-size: 13px;
  color: var(--fern);
  line-height: 1.6;
}
.auth-foot {
  text-align: center;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
}

/* ============ WATER TRACKER ============ */
.water-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px 36px;
  margin-bottom: 24px;
  position: relative;
}
.water-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 2px;
  background: var(--clay);
}
.water-ring-wrap {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}
.water-ring {
  width: 100%;
  height: 100%;
}
.water-actions {
  flex: 1;
  min-width: 0;
}
.water-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
.water-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.water-btn:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--text-light);
}
.water-btn:hover .water-btn-lbl { color: rgba(255,255,255,0.8); }
.water-btn-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
}
.water-btn:hover .water-btn-val { color: var(--text-light); }
.water-btn-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fern);
}

.water-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 20px 18px;
  align-items: end;
}
.water-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.water-bar-val {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fern);
  letter-spacing: 0.05em;
  min-height: 14px;
}
.water-bar-track {
  width: 100%;
  min-height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.water-bar-fill {
  width: 24px;
  background: var(--line-strong);
  transition: height .4s ease;
}
.water-bar-fill.hit {
  background: var(--clay);
}
.water-bar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sage);
}

/* ============ PROTOCOLS ============ */
.protocol-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  padding: 22px 26px;
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.protocol-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px 26px;
  cursor: pointer;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.protocol-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--clay);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s ease;
}
.protocol-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.protocol-card:hover::before { transform: scaleY(1); }
.protocol-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.protocol-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--sage);
  letter-spacing: 0.18em;
}
.protocol-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.protocol-description {
  font-size: 12.5px;
  color: var(--fern);
  line-height: 1.6;
  margin-bottom: 14px;
  min-height: 40px;
}
.protocol-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.protocol-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
  margin-top: auto;
}
.protocol-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.protocol-stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.mode-btn {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px 24px 20px;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.mode-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.mode-btn.active {
  background: #333;
  border-color: #333;
}
.mode-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--clay);
}
.mode-btn-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--clay);
  letter-spacing: 0.15em;
}
.mode-btn-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.mode-btn.active .mode-btn-title { color: var(--text-light); }
.mode-btn-sub {
  font-size: 12px;
  color: var(--fern);
}
.mode-btn.active .mode-btn-sub { color: var(--sage-soft); }

/* ============ MEAL PHOTO LOG ============ */
.meal-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.meal-log-card {
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.meal-log-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
  cursor: pointer;
  display: block;
}
.meal-log-body { padding: 18px 20px; flex: 1; }
.meal-log-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.meal-log-time {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--clay);
  font-weight: 500;
}
.meal-log-desc {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 32;
}
.meal-log-foods {
  font-size: 11.5px;
  color: var(--fern);
  line-height: 1.55;
}
.meal-log-note {
  font-size: 11.5px;
  color: var(--sage);
  font-style: italic;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--paper);
  border-left: 2px solid var(--line-strong);
}

/* ============ REPORT TABLE ============ */
.sec-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--clay);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sec-heading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--clay);
}
.report-table {
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
}
.report-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr 1.2fr 1fr 0.7fr;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
}
.report-row:last-child { border-bottom: none; }
.report-row:hover { background: var(--paper); }
.report-header {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
  background: var(--paper);
  cursor: default;
  font-weight: 500;
}
.report-header:hover { background: var(--paper); }
.rr-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.rr-small { font-size: 11px; color: var(--fern); line-height: 1.5; }
.rr-delta { font-family: var(--font-mono); font-size: 10px; margin-left: 4px; }
.rr-delta.up { color: var(--fern); }
.rr-delta.dn { color: var(--clay); }
.rr-days { font-family: var(--font-mono); color: var(--sage); font-size: 10px; }

/* ============ ALERT PILLS ============ */
.alerts-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.alert-pill {
  padding: 14px 18px;
  border-left: 3px solid;
  background: var(--paper);
  position: relative;
}
.alert-pill-warn { border-color: var(--ochre); background: rgba(214,162,60,0.08); }
.alert-pill-err { border-color: var(--berry); background: rgba(122,46,46,0.06); }
.alert-pill-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  margin-bottom: 4px;
}
.alert-pill-warn .alert-pill-label { color: #6b4e10; }
.alert-pill-err .alert-pill-label { color: var(--berry); }
.alert-pill-detail {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* ============ CHARTS ============ */
.chart-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px 28px 18px;
  margin-bottom: 20px;
  position: relative;
}
.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--clay);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.01em;
}
.chart-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--clay);
  font-weight: 500;
}
.chart-delta.up { color: var(--fern); }
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}
.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 0 2px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fern);
}
.chart-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ============ ATLETA PORTAL ============ */
.atleta-body { background: #0e0e0e; }
.atleta-shell {
  max-width: 960px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 32px 40px;
  display: flex;
  flex-direction: column;
}
.atleta-topbar {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.atleta-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.atleta-brand-mark {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 300;
  line-height: 0.85;
  color: var(--clay);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-style: italic;
  letter-spacing: -0.04em;
}
.atleta-brand-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.atleta-brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
}
.atleta-brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--clay);
  margin-top: 6px;
}
.atleta-hero {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  position: relative;
}
.atleta-hero::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 2px;
  background: var(--clay);
}
.atleta-hero .topbar-eyebrow { margin-bottom: 12px; }
.atleta-hero .detail-name { font-size: 58px; }
.atleta-content-inner { flex: 1; }
.atleta-foot {
  margin-top: 60px;
  padding-top: 24px;
}
.atleta-foot-rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 18px;
}
.atleta-foot-text {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage);
  text-align: center;
}
.atleta-install-btn {
  margin: 16px auto 0;
  display: inline-flex;
  padding: 10px 18px;
  border: 1px solid var(--clay);
  background: transparent;
  color: var(--clay);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: all .18s;
}
.atleta-install-btn:hover {
  background: var(--clay);
  color: var(--text-light);
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: var(--fern); color: #fff; }
.toast-warn { background: var(--ochre); color: #fff; }
.toast-err { background: var(--berry); color: #fff; }

/* ============ ATLETA LIGHT MODE (toggle) ============ */
.atleta-body.light { background: #f5efdf; color: #0a1a0f; }
.atleta-body.light .atleta-topbar { border-bottom-color: #d8ccaa; }
.atleta-body.light .atleta-brand-title { color: #0a1a0f; }
.atleta-body.light .atleta-hero { border-bottom-color: #d8ccaa; }
.atleta-body.light .detail-name { color: #0a1a0f; }
.atleta-body.light .detail-sub, .atleta-body.light .detail-sub span { color: #7a9685; }
.atleta-body.light .tabs { border-bottom-color: #d8ccaa; }
.atleta-body.light .tab { color: #7a9685; }
.atleta-body.light .tab .tab-icon { color: #7a9685; }
.atleta-body.light .tab.active { color: #0a1a0f; }
.atleta-body.light .tab.active .tab-icon { color: var(--clay); }
.atleta-body.light .card { background: #fefcf5; border-color: #d8ccaa; }
.atleta-body.light .alert { background: #fefcf5; border-color: #d8ccaa; }
.atleta-body.light .meal { border-bottom-color: #d8ccaa; }
.atleta-body.light .meal-name { color: #0a1a0f; }
.atleta-body.light .meal-foods { color: #7a9685; }
.atleta-body.light .meal-kcal-val { color: #0a1a0f; }
.atleta-body.light .macro-val { color: #0a1a0f; }
.atleta-body.light .metric-grid { border-color: #d8ccaa; background: #fefcf5; }
.atleta-body.light .metric { border-color: #d8ccaa; }
.atleta-body.light .metric-val { color: #0a1a0f; }
.atleta-body.light .metric-label { color: #7a9685; }
.atleta-body.light .sec-heading { color: #7a9685; }
.atleta-body.light .day-tabs { border-bottom-color: #d8ccaa; }
.atleta-body.light .day-tab { color: #7a9685; }
.atleta-body.light .day-tab.active { color: #0a1a0f; }
.atleta-body.light .exercise { border-bottom-color: #d8ccaa; }
.atleta-body.light .ex-name { color: #0a1a0f; }
.atleta-body.light .ex-det { color: #7a9685; }
.atleta-body.light .ex-num { background: #ebe4d0; color: #7a9685; }
.atleta-body.light .phase-title { color: #0a1a0f; }
.atleta-body.light .health-strip { border-color: #d8ccaa; }
.atleta-body.light .health-item { border-color: #d8ccaa; color: #0a1a0f; }
.atleta-body.light .health-item b { color: #7a9685; }
.atleta-body.light .input, .atleta-body.light .select, .atleta-body.light .textarea {
  background: #fefcf5; border-color: #d8ccaa; color: #0a1a0f;
}
.atleta-body.light .btn { border-color: #d8ccaa; color: #0a1a0f; }
.atleta-body.light .btn:hover { background: #0a1a0f; color: #fefcf5; }
.atleta-body.light .tag { background: #ebe4d0; color: #7a9685; }
.atleta-body.light .checkin-row { border-bottom-color: #d8ccaa; }
.atleta-body.light .atleta-foot-rule { background: #d8ccaa; }
.atleta-body.light .atleta-foot-text { color: #7a9685; }
.atleta-body.light .meal-checkbox { border-color: #d8ccaa; }
.atleta-body.light .water-btn { background: #ebe4d0; border-color: #d8ccaa; color: #0a1a0f; }
.atleta-body.light .water-bar-fill { background: #b8a878; }
.atleta-body.light .label { color: #7a9685; }

/* ============ SHARE LINK BOX (coach view) ============ */
.share-box {
  background: #0a0a0a;
  color: var(--sage-soft);
  padding: 26px 30px;
  margin-bottom: 24px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.share-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 40px;
  background: var(--clay);
}
.share-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--clay);
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.share-box-label::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--clay);
}
.share-box-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  word-break: break-all;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  user-select: all;
  cursor: text;
}
.share-box-desc {
  font-size: 12px;
  color: var(--sage);
  margin-top: 10px;
  line-height: 1.6;
}
.share-box-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
}
.share-box-actions .btn {
  background: var(--clay);
  color: var(--text-light);
  border-color: var(--clay);
}
.share-box-actions .btn:hover {
  background: var(--clay-dark);
  border-color: var(--clay-dark);
}
.share-box-actions .btn-ghost {
  background: transparent;
  color: var(--sage-soft);
  border: 1px solid rgba(255,255,255,0.15);
}
.share-box-actions .btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-light);
  border-color: rgba(255,255,255,0.3);
}
.share-box-copied {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ochre);
  opacity: 0;
  transition: opacity .3s;
  text-align: center;
}
.share-box-copied.show { opacity: 1; }

/* ============ PRINT ============ */
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body { background: white; color: #000; font-size: 10.5pt; }
  .sidebar, .topbar-actions, .tabs, .day-tabs, .btn, .share-box,
  .alerts-row, .actions-row, .select-wrap, .back-link, .atleta-topbar, .atleta-foot,
  .print-hide, .chart-card { display: none !important; }
  .app { display: block; height: auto; }
  .main { overflow: visible; height: auto; }
  .content { padding: 0; }
  .topbar, .detail-header { padding: 0 0 14pt; margin-bottom: 18pt; border-bottom: 1pt solid #ccc; }
  .topbar::after, .detail-header::after { display: none; }
  .topbar-title, .detail-name { font-size: 22pt; color: #000; }
  .topbar-eyebrow { color: #666; font-size: 8pt; }
  .topbar-sub, .detail-sub { color: #555; font-size: 9pt; }
  .meal { page-break-inside: avoid; padding: 10pt 0; border-bottom: 0.5pt solid #ccc; }
  .meal-name { font-size: 13pt; color: #000; }
  .meal-foods { font-size: 10pt; color: #333; }
  .meal-kcal-val { font-size: 20pt; color: #000; }
  .meal-time { color: #666; }
  .macro-label { color: #666; }
  .macro-val { color: #000; }
  .day-section, .phase-header, .exercise { page-break-inside: avoid; }
  .phase-header {
    background: #000 !important;
    color: white !important;
    padding: 14pt 18pt;
    margin-bottom: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .phase-num { color: #ff8c66 !important; font-size: 44pt; }
  .phase-title { font-size: 16pt; }
  .exercise { padding: 8pt 0; border-bottom: 0.5pt solid #ddd; }
  .ex-name { font-size: 11pt; color: #000; }
  .ex-det { font-size: 9pt; color: #555; }
  .ex-num { color: #c15a36 !important; }
  .label, .lbl { color: #666; }
  .print-header {
    display: block !important;
    margin-bottom: 14pt;
    padding-bottom: 10pt;
    border-bottom: 2pt solid #000;
  }
  .print-header .ph-brand {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 14pt;
    color: #c15a36 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-header .ph-title {
    font-family: 'Fraunces', serif;
    font-size: 18pt;
    margin-top: 4pt;
    color: #000;
  }
  .print-header .ph-meta {
    font-size: 9pt;
    color: #666;
    margin-top: 3pt;
  }
  .metric-grid, .health-strip { display: none !important; }
  .print-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Geist Mono', monospace;
    font-size: 7pt;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #999;
    padding: 8pt 0;
    border-top: 0.5pt solid #ccc;
  }
}
.print-header { display: none; }
.print-footer { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .app { grid-template-columns: 220px 1fr; }
  .topbar-title { font-size: 36px; }
  .detail-name { font-size: 48px; }
  .metric-grid, .ci-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3n), .ci-metric:nth-child(4n) { border-right: 1px solid var(--line); }
  .metric:nth-child(2n), .ci-metric:nth-child(2n) { border-right: none; }
  .hero-params { grid-template-columns: 1fr 1fr; }
  .hero-param:nth-child(2) { border-right: none; }
  .hero-param:nth-child(1), .hero-param:nth-child(2) { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .client-grid, .phase-preview { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar, .detail-header, .content { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-top: 20px; padding-bottom: 16px; }
  .topbar::after, .detail-header::after { left: 16px; }
  .detail-name { font-size: 30px; }
  .topbar-title { font-size: 24px; }
  .topbar-sub { font-size: 11px; }
  .share-box { grid-template-columns: 1fr; }

  /* Atleta shell */
  .atleta-shell { padding: 0 16px 32px; }
  .atleta-topbar { padding: 20px 0 16px; margin-bottom: 24px; }
  .atleta-brand-mark { font-size: 28px; }
  .atleta-brand-title { font-size: 15px; }
  .atleta-hero .detail-name { font-size: 32px; }
  .atleta-hero .detail-sub { font-size: 13px; }
  .atleta-hero { padding-bottom: 20px; margin-bottom: 24px; }

  /* Day tabs - scroll horizontal */
  .day-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .day-tabs::-webkit-scrollbar { display: none; }
  .day-tab { padding: 10px 14px; font-size: 9px; white-space: nowrap; flex-shrink: 0; }

  /* Meals - stack vertical */
  .meal { grid-template-columns: 1fr !important; gap: 8px; padding: 18px 0; }
  .meal-check { justify-content: flex-start; padding: 0; }
  .meal-name { font-size: 18px; margin-bottom: 8px; }
  .meal-foods { font-size: 12px; }
  .meal-time { font-size: 10px; }
  .meal-kcal { text-align: left; display: flex; align-items: center; gap: 4px; }
  .meal-kcal-val { font-size: 24px; }
  .macro-row { gap: 16px; flex-wrap: wrap; }
  .macro-val { font-size: 14px; }
  .macro-label { font-size: 8px; }

  /* Metrics grid - 2 columns on mobile */
  .metric-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .metric { padding: 16px 14px; }
  .metric-val { font-size: 26px; }
  .metric-label { font-size: 8px; margin-bottom: 8px; }
  .metric-unit { font-size: 10px; }
  .ci-metric-delta { font-size: 9px; }

  /* Exercise cards */
  .exercise { gap: 12px; padding: 14px 0; }
  .ex-name { font-size: 16px; }
  .ex-det { font-size: 11px; }
  .ex-num { font-size: 10px; min-width: 28px; height: 28px; }
  .ex-tempo { font-size: 10px; }
  .phase-header { gap: 14px; padding: 20px 0; }
  .phase-title { font-size: 20px; }
  .phase-meta { font-size: 11px; }
  .phase-num { font-size: 28px; }

  /* Cards, alerts */
  .card { padding: 18px 16px; }
  .sec-heading { font-size: 10px; }
  .alert { padding: 14px 16px; font-size: 12px; }
  .alert-prefix { font-size: 8px; padding: 2px 6px; }

  /* Water panel - mobile */
  .water-hero {
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding: 20px 16px;
    text-align: center;
  }
  .water-ring-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }
  .water-actions { text-align: left; }
  .water-btn-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .water-btn { padding: 12px 8px; }
  .water-btn-val { font-size: 18px; }
  .water-btn-lbl { font-size: 8px; }
  .water-bars {
    grid-template-columns: repeat(7, 1fr);
    padding: 14px 10px;
    gap: 4px;
  }
  .water-bar-track { min-height: 80px; }
  .water-bar-fill { width: 16px; }
  .water-bar-val { font-size: 8px; }
  .water-bar-label { font-size: 7px; letter-spacing: 0.1em; }

  /* Health strip */
  .health-strip { grid-template-columns: repeat(2, 1fr); }

  /* Tabs */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 14px; font-size: 10px; white-space: nowrap; flex-shrink: 0; gap: 6px; }
  .tab .tab-icon { width: 16px; height: 16px; }

  /* Check-in form */
  .field label { font-size: 10px; }
  .input, .select, .textarea { font-size: 14px; }

  /* 1RM form */
  .report-row { font-size: 11px; }

  /* Portal link on cards */
  .client-portal-link { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Generate CTA */
  .generate-cta { padding: 32px 20px; }
  .generate-cta-title { font-size: 28px; }
  .generate-cta-sub { font-size: 13px; }

  /* Hero params */
  .hero-params { grid-template-columns: 1fr 1fr; }
  .hero-param { padding: 14px 16px; }
  .hero-param-val { font-size: 18px; }
  .hero-param-label { font-size: 8px; }

  /* Buttons */
  .btn-lg { font-size: 11px; padding: 12px 24px; }
}

@media (max-width: 400px) {
  .atleta-shell { padding: 0 12px 24px; }
  .atleta-hero .detail-name { font-size: 26px; }
  .atleta-brand-mark { font-size: 24px; }
  .atleta-brand-title { font-size: 14px; }
  .day-tab { padding: 8px 10px; font-size: 8px; letter-spacing: 0.12em; }
  .meal-name { font-size: 16px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .metric-val { font-size: 22px; }
  .metric { padding: 12px 10px; }
  .phase-title { font-size: 18px; }
  .generate-cta-title { font-size: 22px; }
  .hero-params { grid-template-columns: 1fr; }
  .card { padding: 14px 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .health-strip { grid-template-columns: 1fr; }
  .tabs { gap: 0; }
  .tab { padding: 8px 10px; font-size: 9px; gap: 5px; margin-right: 12px; }
  .tab .tab-icon { width: 14px; height: 14px; }
  .water-ring-wrap { width: 130px; height: 130px; }
  .water-btn-val { font-size: 16px; }
}
