/* =========================================================================
   SLIM — Athletic Editorial Design System
   No cards. No glass. No gradients. Depth through typography and space.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,700;0,800;0,900;1,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  font-family: "Space Grotesk", -apple-system, sans-serif;

  --bg:          #F0EDE6;
  --bg-alt:      #E8E4DB;
  --bg-alt2:     #E0DBCF;
  --dark:        #151210;
  --dark-2:      #1E1B18;
  --dark-3:      #2A2520;
  --text:        #1A1714;
  --text-2:      #6A6159;
  --text-3:      #9E9488;
  --accent:      #E5501A;
  --accent-dim:  rgba(229,80,26,0.11);
  --teal:        #0B9485;
  --teal-dim:    rgba(11,148,133,0.1);
  --green:       #1E8B3C;
  --green-dim:   rgba(30,139,60,0.09);
  --red:         #C82020;
  --red-dim:     rgba(200,32,32,0.07);
  --line:        #D4CCBF;
  --line-strong: #BFB7A8;

  --transition: 180ms ease;
  --chart-grid: rgba(0,0,0,0.07);
  --chart-text: rgba(70,60,50,0.72);
  --chart-bg:   #F0EDE6;
  --input-bg:   #FDFAF5;
  --surface-strong: #FDFAF5;
  --surface-hover: #E8E4DB;
}

[data-theme="dark"] {
  --bg:          #141210;
  --bg-alt:      #1C1916;
  --bg-alt2:     #24201C;
  --dark:        #EDE9E1;
  --dark-2:      #D8D4CC;
  --dark-3:      #A8A098;
  --text:        #EDE9E1;
  --text-2:      #8A8278;
  --text-3:      #5E5850;
  --line:        #2A2420;
  --line-strong: #3A342C;
  --accent:      #F0601E;
  --chart-grid: rgba(255,255,255,0.07);
  --chart-text: rgba(200,195,185,0.72);
  --chart-bg:   #141210;
  --input-bg:   #1C1916;
  --surface-strong: #1C1916;
  --surface-hover: #242018;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
body.app-booting main { visibility: hidden; }
[hidden] { display: none !important; }
input, button { font: inherit; color: inherit; }

input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 5px;
  padding: 10px 13px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder { color: var(--text-3); font-weight: 500; }

button {
  border: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: opacity var(--transition), background var(--transition), transform 100ms ease;
  white-space: nowrap;
}
button:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.btn-primary:hover:not(:disabled) { opacity: 0.86; }
.btn-primary:disabled { opacity: 0.32; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--bg-alt);
}

.card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  transition: background var(--transition), border-color var(--transition);
}
.topbar-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right { justify-content: flex-end; flex: 1; flex-wrap: nowrap; }
.topbar-brand { display: flex; align-items: center; }
.topbar-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}
.topbar-actions { display: flex; gap: 2px; padding-left: 4px; }
.auth-trigger, .settings-trigger {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: color var(--transition), background var(--transition);
}
.auth-trigger:hover, .settings-trigger:hover { color: var(--text); background: var(--bg-alt); }
.auth-trigger.is-signed-in { color: var(--accent); }
.auth-trigger.is-busy, .auth-trigger.is-unavailable { opacity: 0.55; }
.auth-trigger-icon, .settings-trigger-icon { width: 19px; height: 19px; display: block; }

/* ── MAIN ──────────────────────────────────────────────────────────────────── */
main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 80px;
  display: grid;
  gap: 0;
}

/* ── PLAN SECTION ──────────────────────────────────────────────────────────── */
.plan-shell { border-bottom: 1px solid var(--line); }
.plan-shell::before, .plan-shell::after { display: none; }

.plan-panel { display: grid; gap: 24px; padding: 36px 0 28px; }
.plan-shell.is-locked .plan-panel { padding: 24px 0 0; }

.plan-shell.is-empty .plan-panel {
  align-content: start;
  justify-items: center;
  text-align: center;
  padding: 64px 0 44px;
  gap: 28px;
}
.plan-empty-intro { display: grid; gap: 14px; width: min(720px, 100%); }
.plan-shell.is-empty .plan-empty-intro { justify-items: center; }
.plan-empty-topline { display: flex; align-items: center; justify-content: center; }
.plan-empty-kicker {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-empty-kicker::before, .plan-empty-kicker::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.45;
}
.plan-empty-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-wrap: balance;
}
.plan-empty-line { display: block; }
.plan-empty-copy { font-size: 1.05rem; line-height: 1.72; color: var(--text-2); max-width: 46ch; padding: 14px 0; }

.plan-editor { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.plan-shell.is-empty .plan-editor {
  width: min(580px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.plan-field { display: grid; gap: 6px; }
.plan-field > span { font-size: 0.63rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.13em; }
.plan-shell.is-empty .plan-field > span { font-size: 0.82rem; color: var(--text-2); letter-spacing: 0.1em; }
.plan-shell.is-empty .plan-field input { font-size: 1.15rem; font-weight: 700; padding: 13px 15px; }

.plan-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-shell.is-locked .plan-footer { justify-content: center; flex-direction: column; align-items: center; }
.plan-shell.is-empty .plan-footer { width: min(580px, 100%); justify-content: center; }
.plan-actions { display: flex; gap: 10px; justify-content: center; }
.plan-shell.is-empty .plan-actions button { min-width: 200px; min-height: 46px; }

.plan-summary { display: grid; gap: 14px; }
.plan-summary-route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: none; border: none; border-radius: 0; box-shadow: none;
}
.plan-summary-stop { display: grid; gap: 4px; padding: 6px 0; position: relative; }
.plan-summary-stop::before, .plan-summary-stop::after { display: none; }
.plan-summary-stop-target { text-align: right; }
.plan-summary-stop strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan-summary-label { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-3); font-weight: 700; }
.plan-summary-date { font-size: 0.82rem; font-weight: 600; color: var(--text-2); line-height: 1; }
.plan-summary-path { display: grid; gap: 7px; padding: 6px 32px; align-content: center; }
.plan-summary-path-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-summary-interval { font-family: "Barlow Condensed", sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; color: var(--text-2); }
.plan-summary-path-line { position: relative; height: 2px; background: var(--line); border-radius: 0; }
.progress-fill, .progress-target { position: absolute; inset-block: 0; left: 0; border-radius: 0; }
.progress-target { background: color-mix(in srgb, var(--teal) 35%, transparent); }
.progress-fill { background: var(--accent); width: 0; transition: width 400ms cubic-bezier(0.16,1,0.3,1); }
.progress-meta { display: flex; gap: 14px; font-size: 0.8rem; font-weight: 600; color: var(--text-3); }

/* ── STATS STRIP ──────────────────────────────────────────────────────────── */
.stats-row { display: grid; gap: 0; border-bottom: 1px solid var(--line); }
.plan-merged-stats { border-top: 1px solid var(--line); padding-top: 0; margin-top: 0; }
.stats-band { display: flex; }
.stats-band-primary { border-bottom: 1px solid var(--line); }
.stat {
  flex: 1;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transition: background var(--transition);
}
.stat:last-child { border-right: none; }
.stat:hover { background: var(--bg-alt); }
.stat-feature { padding: 18px 22px; background: transparent; border-radius: 0; box-shadow: none; }
.stat-label { font-size: 0.57rem; text-transform: uppercase; letter-spacing: 0.17em; color: var(--text-3); font-weight: 700; }
.stat-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color var(--transition);
}
.stat-feature .stat-value { font-size: 2.3rem; }
.stat-note { font-size: 0.66rem; color: var(--text-3); font-weight: 500; }
.accent { color: var(--accent); }
.good   { color: var(--green); }
.bad    { color: var(--red); }

/* ── TODAY INLINE ─────────────────────────────────────────────────────────── */
.today-inline {
  border-top: 1px solid var(--line);
  padding: 18px 0 22px;
  width: 100%;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.today-inline.is-unavailable { opacity: 0.48; }
.today-inline-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.today-inline-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.today-inline-date { font-size: 0.74rem; font-weight: 600; color: var(--text-3); }
.today-inline-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 10px; align-items: end; }
.today-inline-field { display: grid; gap: 5px; }
.today-inline-field span { font-size: 0.6rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.13em; }
.today-inline-field input { font-size: 1rem; font-weight: 700; padding: 11px 13px; }
.today-inline-jump { padding: 11px 16px; font-size: 0.8rem; }
.today-inline-note { margin-top: 9px; font-size: 0.75rem; color: var(--text-3); font-weight: 500; line-height: 1.5; }

/* ── COACH SECTION ────────────────────────────────────────────────────────── */
.coach-banner {
  background: var(--dark);
  color: #EDE9E1;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
[data-theme="dark"] .coach-banner { background: #0C0A09; }
.coach-banner::before, .coach-banner::after { display: none !important; }

.coach-banner-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.coach-avatar, .coach-avatar-ring, .coach-avatar-mark { display: none !important; }

.coach-banner-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coach-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ↑ BIGGER fonts for the meta row items */
.coach-situation-badge {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(237,233,225,0.45);
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.coach-situation-badge::before { display: none !important; }

.coach-status-chip {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(237,233,225,0.65);
}
.coach-status-chip[data-tone="good"]  { color: #6ee7b7; border-color: rgba(110,231,183,0.3); background: rgba(110,231,183,0.08); }
.coach-status-chip[data-tone="bad"]   { color: #fca5a5; border-color: rgba(252,165,165,0.3); background: rgba(252,165,165,0.08); }
.coach-status-chip[data-tone="warn"]  { color: #fcd34d; border-color: rgba(252,211,77,0.3);  background: rgba(252,211,77,0.08); }

.coach-opener { display: none; }

.coach-stat-line {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(237,233,225,0.42);
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  display: inline;
}
.coach-stat-line::before { display: none !important; }

.coach-banner-body {
  padding: 16px 28px 24px;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.coach-headline {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3rem, 6.5vw, 5.6rem);
  font-weight: 900;
  line-height: 0.93;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #EDE9E1;
  max-width: 960px;
}

.coach-orders-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.coach-order {
  padding: 20px 24px;
  border-right: 1px solid rgba(255,255,255,0.07);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 5px;
  transition: background 160ms ease;
}
.coach-order:last-child { border-right: none; }
.coach-order:hover { background: rgba(255,255,255,0.03); }
.coach-order::before { display: none !important; }
.coach-order-head { display: flex; align-items: center; }
.coach-order-num {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}
.coach-order-text { font-size: 0.97rem; font-weight: 700; color: #EDE9E1; line-height: 1.35; letter-spacing: -0.01em; }
.coach-order-reason { font-size: 0.8rem; font-weight: 400; line-height: 1.55; color: rgba(200,195,185,0.58); }

.coach-signoff {
  margin: 0;
  padding: 12px 28px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(200,195,185,0.38);
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-left: none; border-right: none; border-bottom: none;
  border-radius: 0;
  font-style: italic;
}
.coach-signoff::before { display: none !important; }

/* ── CHART ─────────────────────────────────────────────────────────────────── */
.chart-section {
  padding: 28px 0 22px !important;
  gap: 16px !important;
  background: transparent !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: none !important;
}
.chart-section::before { display: none !important; }
.chart-wrap {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: none;
}
canvas { width: 100%; height: 280px; display: block; }
.chart-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
}
.legend-chip-actual { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.legend-chip-ideal  { color: var(--teal);   border-color: color-mix(in srgb, var(--teal) 28%, var(--line)); }
.legend-dot { width: 14px; height: 2px; border-radius: 0; background: currentColor; flex-shrink: 0; }
.legend-chip-goal .legend-dot { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px); }

/* ── DAYS ──────────────────────────────────────────────────────────────────── */
.days-section-open { display: grid; gap: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.day-card {
  background: var(--bg);
  border: none; border-radius: 0;
  padding: 0; display: grid; gap: 0;
  box-shadow: none;
  animation: card-in 240ms ease both;
  transition: background var(--transition);
}
.day-card:hover { background: var(--bg-alt); transform: none; box-shadow: none; }
.day-card.is-today  { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.day-card.is-good   { background: color-mix(in srgb, var(--green) 5%, var(--bg)); }
.day-card.is-bad    { background: color-mix(in srgb, var(--red) 4%, var(--bg)); }
.day-card.is-future { opacity: 0.35; }
.day-card.is-future:hover { background: var(--bg); }
[data-theme="dark"] .day-card           { background: var(--bg); }
[data-theme="dark"] .day-card:hover     { background: var(--bg-alt); }
[data-theme="dark"] .day-card.is-today  { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
[data-theme="dark"] .day-card.is-good   { background: color-mix(in srgb, var(--green) 8%, var(--bg)); }
[data-theme="dark"] .day-card.is-bad    { background: color-mix(in srgb, var(--red) 6%, var(--bg)); }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px 5px; }
.day-num { font-weight: 700; font-size: 0.77rem; color: var(--text-2); letter-spacing: 0.02em; }
.day-date { font-size: 0.68rem; color: var(--text-3); font-weight: 500; }
.day-badge { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; padding: 3px 6px; border-radius: 2px; }
.day-badge.today  { background: var(--accent-dim); color: var(--accent); }
.day-badge.logged { background: var(--green-dim);  color: var(--green); }
.day-badge.missed { background: var(--red-dim);    color: var(--red); }
.day-card label { display: grid; gap: 5px; padding: 3px 13px 7px; }
.day-card label > span { font-size: 0.56rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }
.day-card input {
  padding: 8px 11px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.day-card input:disabled { cursor: not-allowed; opacity: 0.2; }
.day-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin-top: 4px; }
.day-metric {
  padding: 7px 11px;
  background: var(--bg);
  border-radius: 0; border: none;
  display: grid; gap: 2px;
  transition: background var(--transition);
}
.day-card:hover .day-metric { background: var(--bg-alt); }
.day-card.is-today .day-metric { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.day-card.is-good  .day-metric { background: color-mix(in srgb, var(--green) 5%, var(--bg)); }
.day-card.is-bad   .day-metric { background: color-mix(in srgb, var(--red) 4%, var(--bg)); }
.day-metric strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em; line-height: 1;
}
.day-metric > span { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 700; }
.day-note { font-size: 0.69rem; color: var(--text-3); padding: 7px 13px 11px; line-height: 1.45; font-weight: 500; }

/* ── NUTRITION ─────────────────────────────────────────────────────────────── */
.nutrition-section {
  padding: 32px 0 !important;
  display: grid; gap: 22px;
  background: transparent !important;
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: none !important;
  border-left: none !important; border-right: none !important; border-top: none !important;
}
.nutrition-section::before { display: none !important; }
.nutrition-header { display: grid; gap: 3px; }
.nutrition-eyebrow { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal); }
.nutrition-title { font-family: "Barlow Condensed", sans-serif; font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; text-transform: uppercase; }
.protein-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--teal) 6%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
  border-radius: 4px; box-shadow: none;
  transition: background var(--transition), border-color var(--transition);
}
.protein-banner-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 4px; display: grid; place-items: center; font-size: 1.4rem;
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
}
.protein-banner-text { display: grid; gap: 2px; }
.protein-banner-headline { font-size: 0.92rem; font-weight: 700; }
.protein-banner-sub { font-size: 0.86rem; color: var(--text-2); }
.protein-banner-total {
  margin-left: auto; text-align: right; padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
  display: grid; gap: 2px; align-content: center;
}
.protein-banner-total-num { font-family: "Barlow Condensed", sans-serif; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; color: var(--teal); line-height: 1; }
.protein-banner-total-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 700; color: var(--text-3); }
.nutrition-block { display: grid; gap: 10px; }
.orders-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.order-card {
  display: grid; gap: 8px; padding: 12px 16px;
  background: var(--bg); border: none; border-radius: 0; box-shadow: none;
  transition: background var(--transition);
}
.order-card:hover { background: var(--bg-alt); }
.order-card-head { display: flex; align-items: center; justify-content: space-between; }
.order-card-slot { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.order-card-grams {
  font-family: "Barlow Condensed", sans-serif; font-size: 0.86rem; font-weight: 700; color: var(--teal);
  padding: 2px 8px; border-radius: 2px;
  background: var(--teal-dim); border: 1px solid color-mix(in srgb, var(--teal) 20%, transparent); letter-spacing: 0.04em;
}
.order-card-body { display: flex; align-items: center; gap: 12px; }
.order-card-emoji {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 4px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--bg-alt); border: 1px solid var(--line);
}
.order-card-main { display: grid; gap: 2px; min-width: 0; }
.order-card-name { font-size: 0.97rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.order-card-portion { font-size: 0.85rem; color: var(--text-2); line-height: 1.45; }
.orders-rule {
  padding: 11px 15px; font-size: 0.82rem; font-weight: 600; color: var(--text-2);
  background: transparent; border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: 0; line-height: 1.55;
}

/* ── MODALS ────────────────────────────────────────────────────────────────── */
.settings-modal, .auth-modal {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 24px;
}
.settings-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,10,5,0.52);
  backdrop-filter: blur(6px);
}
.settings-panel {
  position: relative; z-index: 1;
  width: min(500px, calc(100% - 32px));
  padding: 22px; border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 28px 56px rgba(0,0,0,0.14);
  display: grid; gap: 18px;
  transition: background var(--transition), border-color var(--transition);
}
.auth-panel {
  position: relative; z-index: 1;
  width: min(420px, calc(100% - 32px));
  padding: 26px; border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 28px 56px rgba(0,0,0,0.14);
  display: grid; gap: 18px;
  transition: background var(--transition), border-color var(--transition);
}
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings-kicker { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 800; color: var(--accent); }
.settings-title { margin-top: 4px; font-family: "Barlow Condensed", sans-serif; font-size: 1.6rem; letter-spacing: 0.02em; font-weight: 900; text-transform: uppercase; }
.settings-close { width: 34px; height: 34px; padding: 0; border-radius: 4px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--text-2); font-size: 0.82rem; }
.settings-close:hover { background: var(--bg-alt2); color: var(--text); }
.settings-body { display: grid; gap: 10px; }
.setting-row, .setting-action-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--line); background: transparent;
}
.setting-action-button { min-width: 76px; background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 7px 14px; font-size: 0.8rem; font-weight: 700; }
.setting-action-button:hover { background: var(--bg-alt); border-color: var(--line-strong); }
.setting-copy { display: grid; gap: 3px; }
.setting-name { font-size: 0.9rem; font-weight: 700; }
.setting-help { font-size: 0.76rem; line-height: 1.52; color: var(--text-2); max-width: 32ch; }
.setting-row input[type="checkbox"] {
  width: 42px; height: 22px; border-radius: 999px; appearance: none;
  background: var(--line); border: 1px solid var(--line-strong);
  position: relative; padding: 0; cursor: pointer; flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.setting-row input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}
.setting-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(20px); }
.auth-head { margin-bottom: 0; }
.auth-body { display: grid; justify-items: center; text-align: center; gap: 16px; padding: 6px 0; }
.auth-modal-copy { display: grid; gap: 5px; }
.auth-modal-name { font-family: "Barlow Condensed", sans-serif; font-size: 1.4rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.auth-modal-meta { font-size: 0.86rem; line-height: 1.62; color: var(--text-2); max-width: 30ch; }
.auth-modal-button {
  min-width: 200px; padding: 11px 20px; border-radius: 4px;
  background: var(--accent); color: #fff;
  font-family: "Barlow Condensed", sans-serif; font-size: 0.95rem;
  font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; box-shadow: none;
}
.auth-modal-button:disabled { opacity: 0.5; cursor: default; }
.auth-modal-button:hover:not(:disabled) { opacity: 0.86; }

/* ── MISC ──────────────────────────────────────────────────────────────────── */
.section-pad { padding: 28px 0 22px; display: grid; gap: 14px; }

@keyframes card-in { from { opacity: 0; } to { opacity: 1; } }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .plan-summary-route { grid-template-columns: 1fr; gap: 8px; }
  .plan-summary-path { padding: 0; }
  .plan-summary-stop-target { text-align: left; }
  .coach-orders-row { grid-template-columns: 1fr; }
  .coach-order { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .coach-order:last-child { border-bottom: none; }
  .stats-band { flex-wrap: wrap; }
  .stat { min-width: calc(33.33% - 1px); flex-basis: calc(33.33% - 1px); }
}

@media (max-width: 700px) {
  main { width: 100%; }
  .plan-panel { padding: 32px 16px 22px; }
  .plan-shell.is-empty .plan-panel { padding: 44px 16px 28px; }
  .plan-shell.is-locked .plan-panel { padding: 18px 16px 0; }
  .plan-shell.is-empty .plan-editor { grid-template-columns: 1fr; }
  .plan-empty-title { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .stat { min-width: 50%; flex-basis: 50%; }
  .stat-feature .stat-value { font-size: 1.9rem; }
  .coach-banner-top { padding: 16px 16px 10px; }
  .coach-banner-body { padding: 12px 16px 18px; }
  .coach-signoff { padding: 10px 16px; }
  .coach-orders-row { grid-template-columns: 1fr; }
  .coach-order { padding: 14px 16px; }
  .days-section-open { padding: 18px 0; }
  .days-grid { grid-template-columns: 1fr 1fr; }
  .nutrition-section { padding: 22px 0 !important; }
  .protein-banner { flex-wrap: wrap; gap: 12px; }
  .protein-banner-total { width: 100%; margin-left: 0; padding-left: 0; border-left: none; border-top: 1px solid color-mix(in srgb, var(--teal) 18%, transparent); padding-top: 10px; text-align: left; }
  .topbar-inner { height: 46px; width: calc(100% - 24px); }
  .topbar-title { font-size: 1.3rem; }
  .today-inline { padding: 14px 16px 18px; }
  .today-inline-row { grid-template-columns: 1fr; }
  .plan-editor { grid-template-columns: 1fr 1fr; }
  .chart-section { padding: 18px 0 14px !important; }
  canvas { height: 220px; }
  .settings-panel, .auth-panel { padding: 16px; border-radius: 4px; }
  .days-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ── OVERRIDES ───────────────────────────────────────────────────────────── */
.today-inline-row {
  grid-template-columns: minmax(140px, 200px) auto !important;
  justify-content: center;
}
.plan-shell.is-locked .today-inline {
  max-width: 480px;
}
.plan-summary-path-meta .plan-summary-interval,
.plan-summary-path-meta .progress-meta,
.plan-summary-path-meta .progress-meta span {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-2);
}
.coach-order-num { font-size: 0.82rem !important; letter-spacing: 0.22em !important; }
.coach-order-text { font-size: 1.15rem !important; line-height: 1.3 !important; }
.coach-order-reason { font-size: 0.92rem !important; line-height: 1.55 !important; }
.stats-band-secondary .stat-label {
  font-size: 0.82rem !important;
  letter-spacing: 0.22em !important;
  font-weight: 700 !important;
}
.stats-band-secondary .stat-value {
  font-size: 1.7rem !important;
}
.stats-band-primary .stat-label {
  font-size: 0.82rem !important;
  letter-spacing: 0.22em !important;
  font-weight: 700 !important;
}
.stats-band-primary .stat-value {
  font-size: 2rem !important;
}
.stats-band-primary .stat-feature .stat-value {
  font-size: 2.6rem !important;
}
