/* ==========================================================
   CHI Training — dark premium
   Palette drawn from the studio itself: the teal logo wall,
   yellow accent walls, red plates, and green turf.
   ========================================================== */
:root{
  /* studio palette */
  --teal:       #1CB5C4;   /* logo wall */
  --teal-hi:    #35D0DF;
  --teal-deep:  #0E6E79;
  --yellow:     #FFC933;   /* accent wall / active day */
  --red:        #E0392E;   /* plates */
  --red-dk:     #B7261D;
  --turf:       #43B75A;   /* turf green — success/complete */

  /* dark ground */
  --bg:         #0B0E12;
  --bg-2:       #11151B;
  --card:       #161C23;
  --card-2:     #1C242D;
  --line:       #273038;
  --ink:        #EEF3F6;
  --muted:      #8E9CA8;

  /* legacy aliases — existing components restyle through these */
  --chi-blue:      var(--teal);
  --chi-blue-deep: #10333A;
  --chi-blue-ink:  var(--ink);
  --plate-red:     var(--red);
  --plate-red-dk:  var(--red-dk);
  --paper:         var(--bg);
  --ok:            var(--turf);

  --display: 'Anton', Impact, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r: 16px;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; margin:0; }
html,body{ height:100%; }
/* App rails: no rubber-band overscroll past the shell, no double-tap zoom,
   no accidental text selection on long-press — installed, it should feel
   native-solid. Form fields keep normal text selection. */
html, body{ overscroll-behavior:none; }
body{
  font-family:var(--body);
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
  touch-action:manipulation;
  -webkit-touch-callout:none;
  -webkit-user-select:none; user-select:none;
}
button, a, label{ touch-action:manipulation; }
input, textarea, select{ -webkit-user-select:text; user-select:text; }
.hidden{ display:none !important; }
.display{
  font-family:var(--display);
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:.02em;
  line-height:.95;
}
.muted{ color:var(--muted); font-size:.925rem; }
.mono{ font-family:var(--mono); }
img{ max-width:100%; }

/* ---------- Auth ---------- */
.auth{ display:flex; min-height:100dvh; background:var(--bg); }
.auth-brand{
  position:relative; flex:1.1; overflow:hidden;
  background:var(--bg-2); color:#fff;
  display:flex; align-items:flex-end;
}
.auth-brand-photo{
  position:absolute; inset:0;
  background:url('../assets/dumbbells.jpg') center/cover no-repeat;
  filter:grayscale(1) contrast(1.1) brightness(.75);
  opacity:.5;
}
.auth-brand::after{ /* teal duotone wash + turf baseline */
  content:''; position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(11,14,18,.25) 0%, rgba(11,14,18,.92) 80%),
    linear-gradient(160deg, rgba(28,181,196,.28), transparent 55%),
    linear-gradient(0deg, var(--teal) 0 6px, transparent 6px);
}
.auth-brand-inner{
  position:relative; z-index:1; padding:clamp(28px,5vw,64px);
}
.auth-logo{ width:96px; height:auto; margin-bottom:22px; filter:drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
.auth-brand h1{ font-size:clamp(2.6rem,6vw,4.6rem); color:#fff; }
.auth-tag{ margin-top:16px; font-size:.9rem; letter-spacing:.14em; text-transform:uppercase; color:var(--teal-hi); }

.auth-panel{
  flex:1; display:flex; align-items:center; justify-content:center;
  padding:clamp(20px,4vw,56px);
}
.auth-card{ width:min(400px,100%); }
.auth-card-title{ font-size:2.2rem; color:var(--ink); }
.auth-card .muted{ margin:6px 0 22px; }

/* ---------- Fields / buttons ---------- */
.field{ margin-bottom:14px; }
.field label{
  display:block; font-size:.75rem; font-weight:700;
  letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); margin-bottom:6px;
}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=tel]{
  width:100%; padding:12px 14px; font:500 1rem var(--body);
  color:var(--ink); background:var(--card);
  border:1.5px solid var(--line); border-radius:12px;
  transition:border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder{ color:#5C6A76; }
input:focus{ outline:none; border-color:var(--teal); box-shadow:0 0 0 3px rgba(28,181,196,.22); }
textarea{
  width:100%; padding:11px 13px; font:500 .95rem var(--body);
  color:var(--ink); background:var(--card); resize:vertical;
  border:1.5px solid var(--line); border-radius:12px;
  transition:border-color .15s, box-shadow .15s;
}
textarea:focus{ outline:none; border-color:var(--teal); box-shadow:0 0 0 3px rgba(28,181,196,.22); }
select{
  padding:8px 12px; border:1.5px solid var(--line); border-radius:10px;
  font:600 .9rem var(--body); color:var(--ink); background:var(--card); cursor:pointer;
}
select:focus{ outline:none; border-color:var(--teal); }

.btn{
  font:600 .95rem var(--body); border:none; cursor:pointer;
  padding:12px 20px; border-radius:12px; transition:transform .08s, background .15s, box-shadow .15s, color .15s;
}
.btn:active{ transform:translateY(1px); }
.btn:focus-visible{ outline:3px solid rgba(28,181,196,.5); outline-offset:2px; }
.btn-primary{ background:var(--teal); color:#04252A; box-shadow:0 6px 20px rgba(28,181,196,.3); }
.btn-primary:hover{ background:var(--teal-hi); }
.btn-ghost{ background:transparent; color:var(--teal-hi); }
.btn-ghost:hover{ background:rgba(28,181,196,.1); }
.btn-danger{ background:transparent; color:var(--red); }
.btn-block{ width:100%; margin-top:8px; }
.btn-sm{ padding:8px 14px; font-size:.85rem; }
.form-error{ color:var(--red); font-size:.875rem; min-height:1.2em; margin:2px 0 8px; }
.form-note{ color:var(--teal-hi); font-size:.875rem; margin:2px 0 8px; }
.auth-forgot{ display:flex; justify-content:flex-end; margin-top:8px; }
.auth-divider{
  display:flex; align-items:center; gap:12px;
  margin:16px 0; color:var(--muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.08em;
}
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background:var(--line); }

/* ---------- Google sign-in ----------
   Built to Google's own branding spec (white surface, #dadce0 hairline,
   Roboto Medium 14px, official 4-colour G). Deliberately NOT restyled to
   the dark theme: clients need to recognise this as the real Google
   button at a glance, and the white slab is the loudest thing on the card. */
.gsi-button{
  display:flex; align-items:center; justify-content:center; gap:12px;
  width:100%; height:44px; padding:0 12px;
  background:#fff; color:#1f1f1f;
  border:1px solid #dadce0; border-radius:12px;
  font:500 14px/1 "Roboto", var(--body); letter-spacing:.25px;
  cursor:pointer; transition:box-shadow .18s ease, background .18s ease;
}
.gsi-button:hover{ background:#f7f8f8; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.gsi-button:active{ background:#eef0f1; }
.gsi-button:focus-visible{ outline:3px solid var(--teal); outline-offset:2px; }
.gsi-icon{ display:flex; align-items:center; }

/* pulse the button when a failed password attempt smells like a Google account */
.gsi-button.gsi-nudge{ animation:gsiNudge 1.6s ease-out 2; }
@keyframes gsiNudge{
  0%,100%{ box-shadow:0 0 0 0 rgba(66,133,244,0); }
  30%    { box-shadow:0 0 0 5px rgba(66,133,244,.45); }
  60%    { box-shadow:0 0 0 9px rgba(66,133,244,0); }
}
@media (prefers-reduced-motion: reduce){
  .gsi-button.gsi-nudge{ animation:none; border-color:#4285f4; box-shadow:0 0 0 3px rgba(66,133,244,.45); }
}
.auth-google-hint{
  margin:10px 0 0; font-size:.85rem; line-height:1.45;
  color:var(--teal-hi); text-align:center;
}

/* ---------- Shell ---------- */
.shell{ min-height:100dvh; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px clamp(16px,4vw,40px);
  /* installed on a phone the page draws under the translucent status bar —
     push the logo/avatar row below the clock and battery */
  padding-top:calc(10px + env(safe-area-inset-top));
  background:rgba(11,14,18,.85); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  color:#fff; border-bottom:1px solid var(--line);
}
/* Trainer's read-only "view as client" banner — sticks just under the topbar */
.preview-bar{
  position:sticky; z-index:19;   /* top set from JS to match topbar height */
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:8px clamp(16px,4vw,40px);
  background:var(--yellow); color:#231A00;
  font-size:.9rem; font-weight:600;
}
.pv-eye{ font-size:1rem; line-height:1; }
.preview-bar .btn{
  background:rgba(0,0,0,.16); color:#231A00; font-weight:700;
  padding:5px 12px; margin-left:6px;
}
.preview-bar .btn:hover{ background:rgba(0,0,0,.26); }
.client-head-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }

.topbar-brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:inherit; -webkit-tap-highlight-color:transparent;
  border-radius:8px; transition:opacity .15s;
  background:none; border:0; padding:0; font:inherit; cursor:pointer;
}
.topbar-brand:hover{ opacity:.8; }
.topbar-brand:focus-visible{ outline:2px solid var(--teal); outline-offset:3px; }
.topbar-logo{ width:38px; height:auto; }
.topbar-word{ font-size:1.05rem; letter-spacing:.06em; }
.topbar-user{ display:flex; align-items:center; gap:10px; }
.topbar-name{ font-size:.875rem; color:var(--muted); }
.topbar .btn-ghost{ color:#fff; }
.topbar .btn-ghost:hover{ background:rgba(255,255,255,.1); }
/* Top-right profile button — avatar opens the profile page */
.topbar-profile{
  display:flex; align-items:center; gap:10px; cursor:pointer;
  background:none; border:none; padding:3px 3px 3px 10px; border-radius:99px;
  -webkit-tap-highlight-color:transparent; transition:background .15s;
}
.topbar-profile:hover{ background:rgba(255,255,255,.08); }
.topbar-profile:focus-visible{ outline:2px solid var(--teal); outline-offset:2px; }
.topbar-avatar{ width:36px; height:36px; font-size:.85rem; }

/* Profile page */
.about-panel{ margin-bottom:16px; }
.about-row{
  display:flex; align-items:center; gap:14px;
  padding:12px 14px; border-radius:14px; text-decoration:none;
  background:var(--bg-2); border:1.5px solid var(--line); color:var(--ink);
  transition:border-color .15s, transform .12s;
}
.about-row:hover{ border-color:var(--teal); transform:translateY(-1px); }
.ar-ic{ font-size:1.4rem; line-height:1; flex:0 0 auto; }
.ar-body{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.ar-body b{ font-size:.98rem; }
.ar-body span{ color:var(--muted); font-size:.82rem; }
.ar-arrow{ flex:0 0 auto; color:var(--teal); font-weight:700; }
.about-foot{ margin:12px 2px 0; color:var(--muted); font-size:.8rem; }

.avatar-lg{ width:88px; height:88px; font-size:2rem; }
.profile-photo-row{ display:flex; align-items:center; gap:18px; margin-bottom:20px; }
.profile-photo-actions{ display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.profile-photo-actions .btn{ padding-left:0; }
.profile-hint{ font-size:.78rem; margin:2px 0 0; }
.profile-divider{
  display:flex; align-items:center; gap:10px; margin:22px 0 14px;
  font-size:.75rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink);
}
.profile-divider::after{ content:""; flex:1; height:1px; background:var(--line); }
.profile-divider em{ font-style:normal; font-weight:500; letter-spacing:.04em; text-transform:none; color:var(--muted); order:1; }
.field-row{ display:flex; gap:14px; flex-wrap:wrap; }
.field-row .field{ flex:1 1 180px; }
.profile-actions{ margin-top:20px; }
.pw-note{ margin:-4px 0 16px; font-size:.875rem; line-height:1.5; }
.pw-actions{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-top:8px; }
input:disabled{ opacity:.55; cursor:not-allowed; }
.btn-danger-solid{ background:rgba(224,57,46,.12); color:var(--red); margin-top:16px; }
.btn-danger-solid:hover{ background:rgba(224,57,46,.2); }

.main{ width:min(880px,100%); margin:0 auto; padding:clamp(18px,4vw,40px); flex:1; }
.page-head{ margin:10px 0 22px; }
.eyebrow{
  font-size:.72rem; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:var(--teal-hi); margin-bottom:4px;
}
.page-title{ font-size:clamp(2rem,5vw,2.8rem); color:var(--ink); }

/* ---------- Panels & cards ---------- */
.panel{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:20px; margin-bottom:20px;
}
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.panel-head h3{ font-size:1.02rem; letter-spacing:.01em; }
.panel-head-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

.card-list{ display:flex; flex-direction:column; gap:10px; }
.row-card{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:14px 16px; cursor:pointer; text-align:left; width:100%;
  font:inherit; color:inherit; transition:border-color .15s, transform .12s;
}
.row-card:hover{ border-color:var(--teal); transform:translateX(2px); }
.row-card .rc-avatar{ width:44px; height:44px; font-size:1rem; flex-shrink:0; }
.row-card .rc-main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.row-card .rc-title{ font-weight:600; }
.row-card .rc-sub{ font-size:.83rem; color:var(--muted); margin-top:2px; }
.rc-chevron{ color:var(--teal); font-weight:700; }
.empty-note{ padding:8px 2px; }

/* ==========================================================
   CLIENT — landing page
   ========================================================== */
.landing-hero{
  position:relative; overflow:hidden;
  border-radius:20px; margin-bottom:18px;
  padding:clamp(28px,6vw,44px) clamp(20px,5vw,36px);
  background:var(--bg-2); min-height:270px;
  display:flex; flex-direction:column; justify-content:flex-end;
}
.landing-hero::before{
  content:''; position:absolute; inset:0;
  background:url('../assets/dumbbells.jpg') center/cover no-repeat;
  filter:grayscale(1) contrast(1.12) brightness(.62);
  opacity:.55;
}
.landing-hero::after{
  content:''; position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(11,14,18,.1) 0%, rgba(11,14,18,.9) 88%),
    linear-gradient(200deg, rgba(28,181,196,.3), transparent 50%);
}
.landing-user{
  position:absolute; top:18px; left:20px; z-index:1;
  display:flex; align-items:center; gap:12px;
}
.avatar{
  width:46px; height:46px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background:var(--teal); color:#04252A;
  display:flex; align-items:center; justify-content:center;
  font:700 1.1rem var(--body); letter-spacing:.02em;
  border:2px solid rgba(255,255,255,.85);
}
.avatar img{ width:100%; height:100%; object-fit:cover; }
.landing-user-name{ font-weight:700; font-size:1.02rem; color:#fff; line-height:1.15; }
.landing-user-sub{ font-size:.75rem; color:rgba(255,255,255,.75); letter-spacing:.08em; text-transform:uppercase; }
.landing-title{
  position:relative; z-index:1;
  font-size:clamp(2.3rem,7vw,3.4rem); color:#fff; margin-top:56px;
}
.landing-title em{ font-style:normal; color:var(--teal-hi); }
.landing-sub{ position:relative; z-index:1; color:rgba(255,255,255,.82); margin-top:8px; font-size:.95rem; }

.landing-cta{
  position:relative; display:flex; align-items:center; justify-content:space-between; gap:14px;
  width:100%; text-align:left; cursor:pointer; border:none;
  border-radius:18px; padding:22px 22px; margin-bottom:14px;
  background:linear-gradient(120deg, var(--teal) 0%, var(--teal-deep) 100%);
  color:#04252A; overflow:hidden;
  box-shadow:0 14px 34px rgba(28,181,196,.28);
  transition:transform .12s, box-shadow .2s;
}
.landing-cta:hover{ transform:translateY(-2px); box-shadow:0 18px 40px rgba(28,181,196,.38); }
.landing-cta:active{ transform:translateY(0); }
.landing-cta .cta-title{ display:block; font-family:var(--display); font-size:1.7rem; letter-spacing:.03em; text-transform:uppercase; color:#052B31; }
.landing-cta .cta-sub{ display:block; font:600 .85rem var(--body); color:rgba(4,37,42,.75); margin-top:3px; }
.landing-cta .cta-arrow{
  flex-shrink:0; width:44px; height:44px; border-radius:50%;
  background:rgba(255,255,255,.92); color:var(--teal-deep);
  display:flex; align-items:center; justify-content:center; font-size:1.3rem; font-weight:700;
}
.landing-cta.done{ background:linear-gradient(120deg, var(--turf) 0%, #2E7D3C 100%); box-shadow:0 14px 34px rgba(67,183,90,.25); }

.nav-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:12px; }
.nav-tile{
  position:relative; text-align:left; cursor:pointer;
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:18px 16px 16px; color:var(--ink); font:inherit;
  transition:border-color .15s, transform .12s, background .15s;
  overflow:hidden;
}
.nav-tile:hover{ border-color:var(--teal); transform:translateY(-2px); background:var(--card-2); }
.nav-tile .nt-ic{
  width:38px; height:38px; border-radius:11px; margin-bottom:12px;
  display:flex; align-items:center; justify-content:center; font-size:1.15rem;
  background:rgba(28,181,196,.14); color:var(--teal-hi);
}
.nav-tile b{ display:block; font-size:.98rem; }
.nav-tile span{ display:block; font-size:.78rem; color:var(--muted); margin-top:3px; }
.nav-tile.soon{ cursor:pointer; opacity:.65; }
.nav-tile.soon:hover{ border-color:var(--yellow); transform:none; background:var(--card); opacity:.85; }
.roadmap-block{ margin-top:34px; }
.roadmap-block .tpl-label{ margin-bottom:12px; }
.trainer-tools{ margin-top:22px; }

/* ---------- Trainer: Admin section ---------- */
.admin-block{ margin-bottom:34px; }
.admin-block .tpl-label{ margin-bottom:12px; }
.roster-block .tpl-label{ margin-bottom:12px; }
.admin-list{ display:flex; flex-direction:column; gap:12px; }
.admin-tile{
  display:flex; align-items:center; gap:16px; width:100%;
  padding:18px 20px;
}
.admin-tile .nt-ic{ margin-bottom:0; flex-shrink:0; width:44px; height:44px; font-size:1.3rem; }
.admin-tile-text{ flex:1; min-width:0; }
.admin-tile-text b{ display:block; font-size:1.05rem; }
.admin-tile-text span{ display:block; font-size:.82rem; color:var(--muted); margin-top:2px; }
.admin-tile .admin-tile-arrow{ color:var(--teal); font-size:1.3rem; font-weight:700; flex-shrink:0; margin-top:0; }
.admin-tile:hover .admin-tile-arrow{ color:var(--teal-hi); }

/* ==========================================================
   CHECK-INS — client notes to Doug + trainer inbox
   ========================================================== */
/* unread-count badges (inbox tile, client tile, roster card) */
.inbox-badge, .tile-badge, .rc-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:99px;
  background:var(--red); color:#fff; font:800 .7rem var(--body); vertical-align:middle;
}
.inbox-badge{ margin-left:4px; }
/* .nav-tile span forces block — keep count pills inline inside admin tiles */
.admin-tile .inbox-badge{ display:inline-flex; width:auto; margin-top:0; vertical-align:middle; }
.rc-badge.docs{ background:rgba(28,181,196,.16); color:var(--teal-hi); }
.row-card.has-new{ border-color:rgba(28,181,196,.45); }
.tile-badge{ position:absolute; top:12px; right:12px; }
.nav-tile{ position:relative; }
.rc-badge{ margin-left:8px; background:var(--red); font-size:.66rem; height:18px; min-width:18px; }

/* roster adherence pill — "2 of 3 this week" */
.rc-week{
  display:inline-flex; align-items:center;
  margin-right:8px; padding:1px 8px; border-radius:99px;
  font:700 .68rem var(--body); letter-spacing:.02em; white-space:nowrap;
  border:1px solid transparent;
}
.rc-week.good{ color:var(--teal); border-color:rgba(28,181,196,.45); background:rgba(28,181,196,.12); }
.rc-week.part{ color:var(--yellow); border-color:rgba(255,201,51,.45); background:rgba(255,201,51,.1); }
.rc-week.zero{ color:var(--muted); border-color:rgba(140,150,160,.35); }

/* client: check-in composer + history */
.checkin-attach{
  display:flex; align-items:center; gap:8px; margin:0 0 12px;
  font-size:.9rem; font-weight:600; color:var(--ink); cursor:pointer;
}
.checkin-attach input{ width:17px; height:17px; accent-color:var(--teal); }
.ci-history-label{ margin-top:22px; }
.ci-card{ padding:14px 16px; }
.ci-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.ci-you{ font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.ci-attach{ font-size:.72rem; color:var(--teal-hi); font-family:var(--mono); }
.ci-text{ font-size:.95rem; line-height:1.5; white-space:pre-line; }
.ci-reply{
  margin-top:12px; background:rgba(28,181,196,.07); border-left:3px solid var(--teal);
  border-radius:8px; padding:10px 12px;
}
.ci-reply-label{ font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--teal-hi); margin-bottom:3px; }
.ci-pending{ margin-top:10px; font-size:.78rem; color:var(--yellow); font-style:italic; }

/* trainer: inbox cards */
.ci-inbox{ padding:16px; }
.ci-inbox.unread{ border-color:var(--teal); box-shadow:0 0 0 1px var(--teal) inset; }
.ci-inbox-head{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.ci-inbox .ci-avatar{ width:40px; height:40px; font-size:.9rem; flex-shrink:0; }
.ci-inbox-who{ flex:1; min-width:0; display:flex; flex-direction:column; }
.ci-inbox-who b{ font-size:.98rem; }
.ci-inbox-who span{ font-size:.76rem; }
.ci-new-badge{
  font:800 .64rem var(--body); letter-spacing:.06em; text-transform:uppercase;
  background:var(--teal); color:#04252A; padding:3px 9px; border-radius:99px; flex-shrink:0;
}
.ci-actions{ margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.ci-reply-input{ width:100%; min-height:56px; }
.ci-action-row{ display:flex; gap:8px; }

/* ==========================================================
   METRICS — bodyweight & body comp
   ========================================================== */
.metric-inputs{ display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:12px; }
@media (max-width:520px){ .metric-inputs{ grid-template-columns:1fr; } }
.field label .opt{ font-weight:500; color:var(--muted); font-size:.78em; }
.metric-delta{
  display:inline-flex; align-items:center; padding:3px 11px; border-radius:99px;
  font:800 .82rem var(--body); background:rgba(140,150,160,.16); color:var(--ink);
}
.metric-delta.down{ background:rgba(28,181,196,.16); color:var(--teal); }
.metric-delta.up{ background:rgba(255,201,51,.16); color:var(--yellow); }
.metric-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 0; border-bottom:1px solid var(--line);
}
.metric-row:last-child{ border-bottom:0; }
.mr-main{ display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 10px; min-width:0; }
.mr-main b{ font-size:1.02rem; }
.mr-extra{ font-size:.85rem; color:var(--teal); font-weight:600; }
.mr-note{ font-size:.85rem; color:var(--muted); flex-basis:100%; }
.mr-side{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.mr-date{ font-size:.8rem; color:var(--muted); white-space:nowrap; }
.mr-del{
  border:0; background:none; cursor:pointer; color:var(--muted);
  font-size:.9rem; line-height:1; padding:4px; border-radius:6px; transition:color .12s, background .12s;
}
.mr-del:hover{ color:var(--red); background:rgba(224,57,46,.1); }




/* ==========================================================
   AWARDS, POINTS & LEADERBOARD
   ========================================================== */
.awards-stats{ margin-bottom:16px; }
.awards-stats .gt-sub{ font-size:.74rem; color:var(--muted); }
.rank-head{ display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.rank-ic{ width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:1.5rem; background:rgba(255,201,51,.14); }
.rank-name{ display:block; font-size:1.25rem; }
.rank-sub{ font-size:.85rem; color:var(--muted); }
.rank-bar{ height:10px; border-radius:99px; background:var(--bg-2); overflow:hidden; border:1px solid var(--line); }
.rank-fill{ height:100%; border-radius:99px; background:linear-gradient(90deg, var(--teal), var(--yellow)); transition:width .4s ease; }
.rank-ladder{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 10px; margin-top:10px; font-size:.72rem; color:var(--muted); }
.rank-ladder span{ white-space:nowrap; }
.rank-ladder .hit{ color:var(--ink); }
.rank-ladder .cur{ color:var(--yellow); font-weight:700; }
.badge-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:10px; margin-bottom:6px; }
.badge-card{
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:3px;
  padding:14px 10px 12px; border-radius:14px; background:var(--card-2); border:1px solid var(--line);
}
.badge-card .bc-ic{ font-size:1.7rem; line-height:1; margin-bottom:4px; }
.badge-card b{ font-size:.88rem; line-height:1.25; }
.badge-card .bc-desc{ font-size:.74rem; color:var(--muted); line-height:1.35; }
.badge-card .bc-pts{ margin-top:4px; font-size:.68rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--teal-hi); }
.badge-card.earned{ border-color:rgba(255,201,51,.55); background:linear-gradient(180deg, rgba(255,201,51,.10), var(--card-2)); }
.badge-card.locked{ opacity:.5; }
.badge-card.locked .bc-ic{ filter:grayscale(1); }
.lb-optin{ margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.lb-optin .muted{ margin:0 0 10px; }
.lb-optin-row{ display:flex; gap:10px; flex-wrap:wrap; }
.lb-optin-row input{ flex:1 1 200px; }
.lb-tabs{ margin-bottom:10px; }
.lb-list{ display:flex; flex-direction:column; }
.lb-row{ display:grid; grid-template-columns:34px minmax(0,1fr) auto auto; gap:10px; align-items:center; padding:10px 8px; border-bottom:1px solid var(--line); border-radius:10px; }
.lb-row:last-child{ border-bottom:none; }
.lb-row.me{ background:rgba(28,181,196,.10); box-shadow:inset 0 0 0 1px rgba(28,181,196,.35); }
.lb-pos{ font-family:var(--mono); font-weight:700; text-align:center; color:var(--muted); }
.lb-row:nth-child(-n+3) .lb-pos{ font-size:1.15rem; }
.lb-name{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lb-name em{ font-style:normal; font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--teal-hi); margin-left:4px; }
.lb-streak{ font-size:.75rem; color:var(--yellow); margin-left:6px; }
.lb-rank{ font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.lb-val{ font-family:var(--mono); font-weight:700; font-size:1.02rem; white-space:nowrap; }
.lb-val small{ font-family:var(--body); font-weight:500; font-size:.72rem; color:var(--muted); }
.lb-foot{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; font-size:.82rem; }
.lb-foot-actions{ display:flex; gap:14px; }
.lb-foot .link-btn.danger{ color:var(--red); }
@media (max-width:520px){
  .lb-row{ grid-template-columns:30px minmax(0,1fr) auto; }
  .lb-rank{ display:none; }
}

/* ==========================================================
   INFORMATION — shared reference library (Macro / Hormones / Vitamins)
   ========================================================== */
.info-cats{ display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin-bottom:14px; }
.info-cat{
  position:relative; text-align:left; cursor:pointer; font:inherit; color:var(--ink);
  background:var(--card); border:1px solid var(--line); border-radius:16px; padding:16px 16px 14px;
  display:flex; flex-direction:column; gap:3px; transition:border-color .15s, transform .12s, background .15s;
}
.info-cat:hover{ border-color:var(--teal); transform:translateY(-2px); background:var(--card-2); }
.info-cat.sel{ border-color:var(--teal); background:rgba(28,181,196,.08); box-shadow:inset 0 0 0 1px var(--teal); }
.info-cat.add{ border-style:dashed; color:var(--teal-hi); }
.info-cat .ic-ic{
  width:38px; height:38px; border-radius:11px; margin-bottom:8px; font-size:1.15rem;
  display:flex; align-items:center; justify-content:center; background:rgba(28,181,196,.14); color:var(--teal-hi);
}
.info-cat b{ font-size:1rem; }
.info-cat .ic-blurb{ font-size:.78rem; color:var(--muted); line-height:1.4; }
.info-cat .ic-count{ margin-top:6px; font-size:.7rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--teal); }
.info-cat.sel .ic-count{ color:var(--teal-hi); }
.info-toolbar{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:-4px 2px 12px; font-size:.82rem; }
.info-toolbar .link-btn.danger{ color:var(--red); }
.info-tabs{ margin-bottom:12px; }
.info-panel .info-tab-title{ font-size:1.2rem; margin:0 0 12px; }
.info-tab-tools{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; margin:-4px 0 8px; }
.info-prose{ font-size:.95rem; line-height:1.6; }
.info-prose p{ margin:0 0 12px; }
.info-prose h4{ margin:18px 0 6px; font-size:1rem; color:var(--teal-hi); letter-spacing:.01em; }
.info-prose h4:first-child{ margin-top:0; }
.info-prose ul{ margin:0 0 12px; padding-left:22px; }
.info-prose li{ margin:3px 0; }
.info-prose > :last-child{ margin-bottom:0; }
.info-prose + .info-prose{ margin-top:14px; }
.info-img{ margin:14px 0; }
.info-img img{ display:block; width:100%; max-height:520px; object-fit:contain; border-radius:12px; background:var(--bg-2); border:1px solid var(--line); }
.info-img figcaption{ margin-top:6px; font-size:.8rem; color:var(--muted); text-align:center; }
.info-edit-head{ margin-bottom:12px; }
.info-edit-hint{ font-size:.8rem; margin:4px 0 0; }
.info-edit-hint code{ font-family:var(--mono); background:var(--bg-2); padding:1px 5px; border-radius:5px; font-size:.78rem; }
.ieb{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 10px; align-items:start; padding:10px; margin-bottom:10px; border:1px solid var(--line); border-radius:12px; background:var(--bg-2); }
.ieb textarea{ min-height:96px; resize:none; overflow:hidden; font-size:.92rem; line-height:1.5; }
.ieb-image img{ grid-column:1; width:100%; max-height:320px; object-fit:contain; border-radius:10px; background:var(--card); }
.ieb-image .ieb-caption{ grid-column:1; font-size:.85rem; }
.ieb-image .ieb-controls{ grid-column:2; grid-row:1 / span 2; }
.ieb-controls{ display:flex; flex-direction:column; gap:4px; }
.ieb-controls button{
  width:30px; height:30px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink);
  cursor:pointer; font-size:.9rem; line-height:1; transition:border-color .12s, color .12s;
}
.ieb-controls button:hover:not(:disabled){ border-color:var(--teal); }
.ieb-controls button:disabled{ opacity:.35; cursor:default; }
.ieb-controls .ieb-del:hover{ border-color:var(--red); color:var(--red); }
.info-add-row{ display:flex; gap:8px; flex-wrap:wrap; margin:4px 0 14px; }


/* ==========================================================
   VISUAL LIBRARIES — food / supplement cards, catalog shelf, meal cards
   ========================================================== */
.lib-shelf-wrap{ margin-bottom:14px; }
.lib-shelf-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.lib-shelf-head .chip-strip{ margin-bottom:0; flex:1 1 auto; }
.lib-search{
  flex:0 1 190px; min-width:140px; padding:8px 12px; border-radius:99px; font:500 .85rem var(--body);
  color:var(--ink); background:var(--card); border:1.5px solid var(--line);
}
.lib-search:focus{ outline:none; border-color:var(--teal); }
.lib-shelf{
  display:flex; gap:10px; overflow-x:auto; padding:6px 2px 10px;
  scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; scrollbar-width:thin;
}
.lib-card{
  position:relative; flex:0 0 118px; width:118px; scroll-snap-align:start;
  display:flex; flex-direction:column; gap:3px; text-align:left; font:inherit; color:var(--ink);
  background:var(--card-2); border:1px solid var(--line); border-radius:14px; padding:6px 8px 9px; cursor:pointer;
  transition:transform .12s, border-color .15s, box-shadow .15s;
}
.lib-card:hover{ transform:translateY(-2px); border-color:var(--teal); box-shadow:0 8px 20px rgba(0,0,0,.35); }
.lib-card:active{ transform:scale(.97); }
.lib-card b{ font-size:.8rem; line-height:1.2; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.lib-card .lib-sub{ font-size:.66rem; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lib-art{
  position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden;
  width:100%; aspect-ratio:1; border-radius:10px; margin-bottom:4px;
  background:radial-gradient(120% 100% at 30% 20%, var(--la, rgba(28,181,196,.35)), rgba(0,0,0,.35));
}
.lib-art img{ width:100%; height:100%; object-fit:cover; display:block; }
.lib-art .lib-emoji{ font-size:2.2rem; line-height:1; filter:drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
.lib-art .fi-dot{ position:absolute; right:6px; bottom:6px; width:10px; height:10px; box-shadow:0 0 0 2px rgba(0,0,0,.5); }
.lib-card.cat-protein .lib-art{ --la:rgba(224,57,46,.55); }
.lib-card.cat-carbs .lib-art{ --la:rgba(255,201,51,.55); }
.lib-card.cat-fats .lib-art{ --la:rgba(67,183,90,.55); }
.lib-card.cat-cooking .lib-art{ --la:rgba(255,138,61,.55); }
.lib-card.cat-other .lib-art{ --la:rgba(28,181,196,.45); }
.lib-card.cat-vitamins .lib-art{ --la:rgba(255,201,51,.55); }
.lib-card.cat-minerals .lib-art{ --la:rgba(28,181,196,.55); }
.lib-card.cat-aminos .lib-art{ --la:rgba(155,123,255,.55); }
.lib-added{
  position:absolute; inset:auto 8px 8px 8px; padding:6px 0; text-align:center; border-radius:9px;
  background:var(--turf); color:#04252A; font:800 .72rem var(--body); letter-spacing:.04em;
  opacity:0; transform:translateY(6px); pointer-events:none;
}
.lib-card.picked .lib-added{ animation:libAdded .9s ease forwards; }
@keyframes libAdded{ 0%{ opacity:0; transform:translateY(6px); } 20%,70%{ opacity:1; transform:none; } 100%{ opacity:0; transform:translateY(-4px); } }

/* catalog shelf (full plans + blocks) */
.catalog-shelf .lib-card{ flex-basis:150px; width:150px; }
.cat-card .cat-art{ aspect-ratio:16 / 10; background:linear-gradient(150deg, var(--cc), rgba(0,0,0,.55)); flex-direction:column; gap:4px; }
.cat-card .cat-art .lib-emoji{ font-size:1.7rem; }
.cat-kind{ font-size:.6rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.85); }
.cat-card.is-plan{ border-color:rgba(28,181,196,.5); }
.cat-x{
  position:absolute; top:6px; right:6px; z-index:2; width:22px; height:22px; border-radius:50%;
  border:none; background:rgba(0,0,0,.55); color:#fff; font-size:.7rem; cursor:pointer;
}
.cat-x:hover{ background:var(--red); }

/* collapsible builder sections */
.nut-sec{ border:1px solid var(--line); border-radius:14px; background:var(--bg-2); margin-bottom:10px; }
.nut-sec summary{
  list-style:none; display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer;
  font-size:.78rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink);
}
.nut-sec summary::-webkit-details-marker{ display:none; }
.nut-sec .ns-hint{ font-weight:500; letter-spacing:.02em; text-transform:none; color:var(--muted); font-size:.78rem; flex:1; }
.nut-sec .ns-count{ min-width:22px; height:22px; padding:0 7px; border-radius:99px; display:inline-flex; align-items:center; justify-content:center; background:rgba(28,181,196,.16); color:var(--teal-hi); font:800 .7rem var(--body); }
.nut-sec .ns-count:empty{ display:none; }
.nut-sec .ns-chev{ margin-left:auto; color:var(--muted); transition:transform .2s; font-size:1rem; }
.nut-sec[open] .ns-chev{ transform:rotate(180deg); }
.nut-sec .ns-body{ padding:0 14px 14px; }
.nut-sec .nut-block-bar{ margin:4px 0 12px; }
.nut-sec .macro-grid{ margin-top:4px; }
.nut-sec .nut-group-intros{ margin-top:0; }
.nr-meal textarea{ width:100%; margin-top:8px; padding:9px 10px; font-size:.86rem; }

/* client view: art on food rows & supplement cards, meal timeline */
.food-item .fi-art{ width:34px; height:34px; flex:0 0 34px; border-radius:9px; margin:0; aspect-ratio:auto; align-self:center; }
.food-item .fi-art .lib-emoji{ font-size:1.25rem; filter:none; }
.food-item{ align-items:center; }
.supp-card{ display:flex; gap:12px; align-items:flex-start; }
.supp-card .sc-art{ width:46px; height:46px; flex:0 0 46px; border-radius:12px; margin:0; aspect-ratio:auto; --la:rgba(155,123,255,.5); }
.supp-card .sc-art .lib-emoji{ font-size:1.5rem; filter:none; }
.supp-card .sc-body{ flex:1; min-width:0; }
.meal-timeline{ position:relative; display:flex; flex-direction:column; gap:10px; padding-left:6px; }
.meal-timeline::before{ content:""; position:absolute; left:26px; top:24px; bottom:24px; width:2px; background:var(--line); }
.meal-card{ position:relative; display:flex; gap:12px; align-items:flex-start; }
.meal-ic{
  position:relative; z-index:1; width:42px; height:42px; flex:0 0 42px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:1.25rem; background:var(--card-2); border:2px solid var(--teal); box-shadow:0 0 0 4px var(--card);
}
.meal-body{ flex:1; background:var(--card-2); border:1px solid var(--line); border-radius:12px; padding:10px 14px; }
.meal-body b{ display:block; font-size:.95rem; margin-bottom:4px; }
.meal-body ul{ margin:0; padding-left:16px; font-size:.88rem; line-height:1.5; }
.meal-body li.alt{ list-style:none; margin-left:-16px; padding-left:16px; color:var(--muted); font-size:.82rem; }
.meal-body li.alt::before{ content:"or "; font-weight:700; color:var(--teal-hi); }

/* library admin */
.lib-kind{ margin-bottom:10px; }
.lib-tools{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.lib-tools .chip-strip{ margin-bottom:0; flex:1 1 300px; }
.lib-tools-right{ display:flex; gap:8px; align-items:center; }
#lib-admin-search{ width:170px; padding:8px 12px; border-radius:99px; font:500 .85rem var(--body); color:var(--ink); background:var(--card); border:1.5px solid var(--line); }
#lib-admin-search:focus{ outline:none; border-color:var(--teal); }
.lib-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(124px, 1fr)); gap:10px; }
.lib-grid .lib-card{ width:auto; flex:none; }
.lib-grid-card.no-photo::after{ content:"＋ photo"; position:absolute; top:10px; left:10px; font:700 .58rem var(--body); letter-spacing:.06em; text-transform:uppercase; color:rgba(255,255,255,.8); background:rgba(0,0,0,.45); padding:2px 6px; border-radius:99px; }
.lib-sheet{ max-width:520px; }
.lib-sheet-art{ display:flex; gap:16px; align-items:center; margin:14px 0 16px; }
.lib-art-lg{ width:110px; height:110px; flex:0 0 110px; border-radius:18px; aspect-ratio:auto; margin:0; }
.lib-art-lg .lib-emoji{ font-size:3rem; }
.lib-sheet-art-actions{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.lib-emoji-field{ margin:4px 0 0; }
.lib-emoji-field input{ width:80px; font-size:1.2rem; text-align:center; padding:6px 8px; }
.lib-sheet-actions{ margin-top:4px; }
.lib-sheet-actions .btn-danger{ margin-left:auto; }

/* ==========================================================
   CLIENT DOCUMENTS — bloodwork, nutrition screenshots, progress photos
   ========================================================== */
.link-btn{
  background:none; border:none; padding:0; cursor:pointer; text-decoration:none;
  color:var(--teal-hi); font:600 .85rem var(--body);
}
.link-btn:hover{ text-decoration:underline; }
.link-btn:focus-visible{ outline:3px solid rgba(28,181,196,.5); outline-offset:2px; border-radius:4px; }
.doc-drop{
  display:flex; flex-direction:column; align-items:center; gap:4px; text-align:center;
  padding:22px 16px; margin-bottom:14px; cursor:pointer;
  border:1.5px dashed var(--line); border-radius:14px; background:var(--bg-2);
  transition:border-color .15s, background .15s;
}
.doc-drop:hover, .doc-drop.over, .doc-drop:focus-visible{ border-color:var(--teal); background:rgba(28,181,196,.06); outline:none; }
.doc-drop-ic{ font-size:1.5rem; margin-bottom:4px; }
.doc-drop b{ font-size:.95rem; }
.doc-drop .muted{ font-size:.8rem; }
.doc-controls{ display:flex; gap:14px; flex-wrap:wrap; }
.doc-controls .field{ flex:1 1 160px; margin-bottom:0; }
.doc-controls .doc-note-field{ flex:2 1 220px; }
.doc-controls select{ width:100%; padding:11px 12px; border-radius:12px; }
.doc-uploads:not(:empty){ margin-top:14px; display:flex; flex-direction:column; gap:8px; }
.doc-up-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; font-size:.85rem; }
.doc-up-row .vl-row-bar{ grid-column:1 / -1; }
.doc-up-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.doc-up-status{ font-size:.78rem; white-space:nowrap; }
.doc-up-row.failed .doc-up-status{ color:var(--red); white-space:normal; grid-column:1 / -1; }
.doc-up-row.failed .vl-row-fill{ background:var(--red); width:100% !important; }
.doc-filters{ margin-top:4px; }
.doc-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:12px; }
.doc-card{
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  transition:border-color .15s;
}
.doc-card:hover{ border-color:var(--teal); }
.doc-card.is-new{ border-color:rgba(255,201,51,.6); }
.doc-thumb{
  display:flex; align-items:center; justify-content:center; aspect-ratio:4 / 3;
  background:var(--bg-2); font-size:2.2rem; overflow:hidden; text-decoration:none;
}
.doc-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.doc-body{ display:flex; flex-direction:column; gap:4px; padding:10px 12px 12px; min-width:0; flex:1; }
.doc-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.doc-cat{ font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--teal-hi); }
.doc-new{
  font-size:.66rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  padding:2px 7px; border-radius:99px; background:rgba(255,201,51,.16); color:var(--yellow);
}
.doc-name{
  font-weight:600; font-size:.88rem; color:var(--ink); text-decoration:none;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.doc-name:hover{ text-decoration:underline; }
.doc-note{ margin:0; font-size:.8rem; color:var(--muted); line-height:1.4; }
.doc-meta{ display:flex; flex-wrap:wrap; gap:5px; font-size:.74rem; color:var(--muted); }
.doc-who{ color:var(--teal); font-weight:600; }
.doc-actions{ display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:6px; }
@media (max-width:480px){
  .doc-grid{ grid-template-columns:repeat(2, 1fr); }
  .doc-thumb{ font-size:1.8rem; }
}

/* ==========================================================
   TRAINER — video library
   ========================================================== */
.vl-drop{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:38px 20px; margin-bottom:18px; text-align:center; cursor:pointer;
  background:rgba(28,181,196,.05); border:2px dashed var(--teal);
  border-radius:18px; transition:background .15s, border-color .15s, transform .12s;
}
.vl-drop:hover, .vl-drop.drag{ background:rgba(28,181,196,.12); border-color:var(--teal-hi); }
.vl-drop.drag{ transform:scale(1.01); }
.vl-drop-ic{ font-size:2rem; }
.vl-drop b{ font-size:1.05rem; color:var(--ink); }
.vl-drop span{ font-size:.83rem; color:var(--muted); max-width:420px; }

.vl-overall{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.vl-overall-bar{
  flex:1; height:8px; border-radius:99px; background:var(--card-2); overflow:hidden;
}
.vl-overall-fill{
  height:100%; width:0; border-radius:99px;
  background:linear-gradient(90deg, var(--teal), var(--teal-hi));
  transition:width .3s ease;
}
.vl-overall-text{ font:600 .8rem var(--mono); color:var(--muted); white-space:nowrap; }

.vl-queue{ display:flex; flex-direction:column; gap:10px; margin-bottom:22px; }
.vl-row{
  display:flex; align-items:flex-start; gap:14px;
  background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px;
}
/* big enough to read the burned-in title for manual entry */
.vl-row-thumb{
  position:relative;
  flex:0 0 304px; height:208px; border-radius:12px; overflow:hidden;
  background:var(--card-2); display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:2rem;
}
.vl-row-thumb img{ width:100%; height:100%; object-fit:cover; }
.vl-row-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.vl-row-file{ display:flex; align-items:center; gap:8px; min-width:0; }
.vl-file-name{
  font-family:var(--mono); font-size:.78rem; color:var(--muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;
}
.vl-copy{ flex-shrink:0; padding:4px 10px; font-size:.75rem; white-space:nowrap; }
.vl-row-main input{ padding:8px 10px; font-size:.92rem; }
.vl-row-status{ font-size:.75rem; color:var(--muted); }
.vl-row-status.ok{ color:var(--turf); }
.vl-row-status.err{ color:var(--red); }
.vl-row-status.match{ color:var(--yellow); }
.vl-row-bar{ height:5px; border-radius:99px; background:var(--card-2); overflow:hidden; }
.vl-row-fill{ height:100%; width:0; background:var(--teal); border-radius:99px; transition:width .25s; }
.vl-row-actions{ display:flex; flex-direction:column; gap:6px; flex-shrink:0; }
@media (max-width:720px){
  .vl-row{ flex-wrap:wrap; }
  .vl-row-thumb{ flex:1 1 100%; height:auto; aspect-ratio:16/10; }
  .vl-row-actions{ flex-direction:row; width:100%; }
  .vl-row-actions .btn{ flex:1; }
}

.vl-grid-label{ margin-bottom:12px; }
.vl-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:12px;
}
.vl-card{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  overflow:hidden; display:flex; flex-direction:column;
}
.vl-card-thumb{
  position:relative; aspect-ratio:16/10; background:var(--card-2);
  display:flex; align-items:center; justify-content:center; color:var(--muted);
}
.vl-card-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.vl-card-thumb svg{ width:30px; height:30px; stroke:var(--muted); fill:none; stroke-width:1.6; stroke-linecap:round; }
.vl-dur{
  position:absolute; bottom:6px; right:6px;
  font:600 .68rem var(--mono); color:#fff;
  background:rgba(0,0,0,.65); padding:2px 7px; border-radius:6px;
}
/* inline play — swaps the thumb for a <video> in place, no popup */
.vl-play{
  position:absolute; inset:0; margin:auto;
  width:52px; height:52px; border-radius:50%; z-index:2;
  border:none; cursor:pointer; padding:0;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.55); color:#fff; font-size:1.1rem;
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  transition:background .15s, transform .12s;
}
.vl-play span{ margin-left:3px; line-height:1; }
.vl-play:hover{ background:var(--teal); transform:scale(1.06); }
.vl-inline-video{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#000; z-index:1; }

.vl-card-body{ padding:10px 12px 12px; display:flex; flex-direction:column; gap:8px; flex:1; }
.vl-card-name{
  font-weight:600; font-size:.88rem; line-height:1.25;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.vl-card-actions{ display:flex; gap:6px; margin-top:auto; }
.vl-card-actions .btn{ padding:6px 10px; font-size:.75rem; flex:1; }

/* library management — delete, rename, add */
.vl-del{
  position:absolute; top:6px; right:6px; z-index:1;
  background:rgba(0,0,0,.6); border:none; border-radius:8px;
  color:#fff; font-size:.8rem; padding:4px 7px; cursor:pointer;
  opacity:.75; transition:opacity .15s, background .15s;
}
.vl-del:hover{ opacity:1; background:rgba(224,57,46,.85); }
.vl-card-name{
  background:none; border:none; padding:0; cursor:pointer; text-align:left;
  color:inherit; font-family:inherit;
}
.vl-card-name:hover{ color:var(--teal-hi); }
.vl-pencil{ font-size:.72rem; color:var(--muted); }
.vl-card-name:hover .vl-pencil{ color:var(--teal-hi); }
.vl-rename{ display:flex; gap:5px; }
.vl-rename input{ flex:1; min-width:0; padding:7px 9px; font-size:.85rem; }
.vl-rename .btn{ padding:6px 9px; font-size:.8rem; flex:0 0 auto; }
.vl-grid-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.vl-grid-head .vl-grid-label{ margin-bottom:0; margin-right:auto; }
.vl-grid-head #vl-search{ width:min(240px, 100%); padding:9px 12px; font-size:.88rem; }
.vl-add-row{
  display:flex; gap:8px; align-items:center; margin-bottom:14px;
  background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px;
}
.vl-add-row input{ flex:1; min-width:0; padding:9px 11px; font-size:.9rem; }

/* ---------- Client: inline exercise video ---------- */
.player-video-native{
  width:100%; border-radius:16px; margin-bottom:14px; display:block;
  background:#000; border:1px solid var(--line); max-height:340px;
}
.soon-badge{
  position:absolute; top:12px; right:12px;
  font:700 .6rem var(--body); letter-spacing:.1em; text-transform:uppercase;
  background:rgba(255,201,51,.15); color:var(--yellow);
  padding:3px 8px; border-radius:99px;
}

/* ==========================================================
   CLIENT — daily workout menu
   ========================================================== */
.wx-topline{ display:flex; align-items:center; gap:12px; margin-bottom:4px; }
.wx-topline .avatar{ width:52px; height:52px; }
.wx-topline-name{ font-family:var(--display); font-size:1.6rem; text-transform:uppercase; line-height:1; color:#fff; }
.wx-topline-sub{ font-size:.78rem; color:var(--muted); letter-spacing:.06em; text-transform:uppercase; margin-top:3px; }

.wx-heading{ font-size:clamp(1.9rem,6vw,2.6rem); color:#fff; margin:18px 0 16px; }

/* day-of-week strip — yellow pill on the selected day */
.daystrip{
  display:flex; justify-content:space-between; gap:4px;
  margin:0 0 20px; padding:12px 8px;
  background:var(--card); border:1px solid var(--line); border-radius:16px;
}
.day-cell{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:5px;
  background:none; border:none; cursor:pointer; padding:2px 0; border-radius:12px;
  font-family:var(--body); -webkit-tap-highlight-color:transparent;
}
.day-cell .dc-dot{
  position:relative;
  width:100%; max-width:46px; aspect-ratio:1; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--muted); background:var(--card-2);
  border:1.5px solid var(--line); transition:background .15s, border-color .15s, color .15s;
}
.day-cell .dc-abbr{
  font-size:.66rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
}
.day-cell:hover .dc-dot{ border-color:var(--teal); color:var(--ink); }
.day-cell.sel .dc-dot{ background:var(--yellow); border-color:var(--yellow); color:#231A00; }
.day-cell.sel .dc-abbr{ font-weight:800; }
.day-cell.today:not(.sel) .dc-dot{ border-color:var(--yellow); color:var(--ink); }
.day-cell.done .dc-dot{ background:var(--turf); border-color:var(--turf); color:#04250C; }
/* scheduled indicator sits below the circle; fixed height keeps the row aligned */
.day-cell .dc-sched{ height:6px; display:flex; align-items:center; justify-content:center; }
.day-cell .dc-sched .sched-dot{ width:5px; height:5px; border-radius:50%; background:var(--teal); }
/* little completion tick on today's finished circle */
.day-cell .dc-check{
  position:absolute; top:-3px; right:-3px;
  width:16px; height:16px; border-radius:50%;
  background:var(--turf); color:#04250C; border:2px solid var(--card);
  font-size:.6rem; font-weight:800; display:flex; align-items:center; justify-content:center;
}

/* exercise cards — photo left, details right, like the reference app */
.wx-list{ display:flex; flex-direction:column; gap:12px; }
.wx-card{
  display:flex; align-items:stretch; width:100%; text-align:left; cursor:pointer;
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  overflow:hidden; padding:0; font:inherit; color:inherit;
  transition:border-color .15s, transform .12s;
}
.wx-card:hover{ border-color:var(--teal); transform:translateY(-1px); }
.wx-thumb{
  flex:0 0 96px; min-height:96px; position:relative;
  background:
    linear-gradient(160deg, rgba(28,181,196,.5), rgba(14,110,121,.85)),
    var(--card-2);
  display:flex; align-items:center; justify-content:center;
}
.wx-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.wx-thumb svg{ width:34px; height:34px; stroke:rgba(255,255,255,.9); fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; position:relative; }
.wx-body{ flex:1; padding:13px 14px; display:flex; flex-direction:column; justify-content:center; min-width:0; }
.wx-routine{
  font-size:.68rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--teal-hi); margin-bottom:3px;
}
.wx-name{ font-weight:700; font-size:1.02rem; color:var(--ink); }
.wx-meta{ font-family:var(--mono); font-size:.78rem; color:var(--muted); margin-top:4px; }
.wx-side{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:0 14px; }
.wx-chevron{ color:var(--muted); font-size:1.1rem; }
.wx-card:hover .wx-chevron{ color:var(--teal); }
.wx-done-badge{
  font:700 .6rem var(--body); letter-spacing:.08em; text-transform:uppercase;
  background:rgba(67,183,90,.16); color:var(--turf);
  padding:3px 8px; border-radius:99px; white-space:nowrap;
}
.wx-card.complete{ border-color:rgba(67,183,90,.4); }
.wx-card.complete .wx-thumb{ background:linear-gradient(160deg, rgba(67,183,90,.5), rgba(31,105,48,.85)), var(--card-2); }
.wx-rest{
  text-align:center; padding:36px 18px; color:var(--muted);
  background:var(--card); border:1px dashed var(--line); border-radius:16px;
}
.wx-rest b{ display:block; font-family:var(--display); font-size:1.5rem; letter-spacing:.04em; text-transform:uppercase; color:var(--ink); margin-bottom:6px; }
.wx-extra{ justify-content:center; border-style:dashed; }
.wx-extra .wx-body{ flex:0 1 auto; text-align:center; }

/* ==========================================================
   CLIENT — exercise player
   ========================================================== */
.player-hero{
  position:relative; border-radius:20px; overflow:hidden;
  min-height:190px; margin-bottom:16px;
  background:
    linear-gradient(160deg, rgba(28,181,196,.45), rgba(11,14,18,.9)),
    var(--card-2);
  display:flex; flex-direction:column; justify-content:flex-end;
  padding:20px;
}
.player-hero img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; opacity:.7; }
.player-hero::after{
  content:''; position:absolute; inset:0; z-index:1;
  background:linear-gradient(180deg, transparent 30%, rgba(11,14,18,.88) 95%);
}
.player-routine{
  position:relative; z-index:2;
  font-size:.7rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--teal-hi);
}
.player-name{ position:relative; z-index:2; font-size:clamp(1.8rem,6vw,2.5rem); color:#fff; margin-top:2px; }
.player-target{
  position:relative; z-index:2; font-family:var(--mono); font-size:.88rem;
  color:rgba(255,255,255,.85); margin-top:8px;
}
.player-count{
  position:absolute; top:14px; right:16px; z-index:2;
  font:600 .75rem var(--mono); color:rgba(255,255,255,.8);
  background:rgba(11,14,18,.55); padding:4px 10px; border-radius:99px;
}
.player-video{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  color:var(--ink); font:600 .9rem var(--body); text-decoration:none;
  padding:12px 16px; margin-bottom:14px; width:100%;
  transition:border-color .15s;
}
.player-video:hover{ border-color:var(--teal); }
.player-video .pv-ic{
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  background:var(--red); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.8rem; padding-left:2px;
}
.player-notes{
  background:var(--card); border:1px solid var(--line); border-left:3px solid var(--teal);
  border-radius:12px; padding:14px 16px; margin-bottom:14px;
}
.player-notes h4{
  font-size:.7rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--teal-hi); margin-bottom:6px;
}
.player-notes p{ font-size:.92rem; line-height:1.55; white-space:pre-line; }
.player-next{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  width:100%; border:none; cursor:pointer; text-align:left;
  background:var(--card-2); border:1px solid var(--line); border-radius:16px;
  padding:16px 18px; margin-top:16px; color:var(--ink); font:inherit;
  transition:border-color .15s, background .2s, box-shadow .2s;
}
.player-next .pn-label{ font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.player-next .pn-name{ font-weight:700; font-size:1.05rem; margin-top:2px; }
.player-next .pn-arrow{ font-size:1.3rem; color:var(--teal); }
.player-next:hover{ border-color:var(--teal); }
.player-next.ready{
  background:linear-gradient(120deg, var(--teal) 0%, var(--teal-deep) 100%);
  border-color:transparent; box-shadow:0 10px 28px rgba(28,181,196,.3);
}
.player-next.ready .pn-label{ color:rgba(4,37,42,.7); }
.player-next.ready .pn-name{ color:#04252A; }
.player-next.ready .pn-arrow{ color:#04252A; }
.player-next.finish.ready{ background:linear-gradient(120deg, var(--turf) 0%, #2E7D3C 100%); box-shadow:0 10px 28px rgba(67,183,90,.3); }
.player-next.finish.ready .pn-label, .player-next.finish.ready .pn-name, .player-next.finish.ready .pn-arrow{ color:#04250C; }
.back-link{
  display:inline-flex; align-items:center; gap:6px;
  background:none; border:none; cursor:pointer; padding:6px 2px;
  font:600 .9rem var(--body); color:var(--muted); transition:color .15s;
}
.back-link:hover{ color:var(--ink); }
.player-extra-name{ margin-bottom:14px; }
.player-extra-name input{ font-weight:700; font-size:1.05rem; }

/* ---------- Plan table ---------- */
.plan-meta{ display:flex; align-items:baseline; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.plan-name{ font-weight:700; font-size:1.05rem; }
.badge{
  font:600 .7rem var(--body); letter-spacing:.08em; text-transform:uppercase;
  padding:3px 9px; border-radius:99px; background:rgba(67,183,90,.15); color:var(--turf);
}
/* table-layout:fixed + shared column widths so every routine table in a plan
   lines up its Sets × Reps / Load columns identically, regardless of content */
.ex-table{ width:100%; border-collapse:collapse; table-layout:fixed; }
.ex-table th{
  font-size:.7rem; letter-spacing:.12em; text-transform:uppercase; color:var(--muted);
  text-align:left; padding:6px 8px; border-bottom:1.5px solid var(--line);
}
.ex-table td{ padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.ex-table th:nth-child(2), .ex-table td:nth-child(2){ width:38%; }
.ex-table th:nth-child(3), .ex-table td:nth-child(3){ width:16%; }
.ex-table tr:last-child td{ border-bottom:none; }
.ex-name{ font-weight:600; word-break:break-word; }
.ex-target{ font-family:var(--mono); font-size:.9rem; color:var(--teal-hi); font-variant-numeric:tabular-nums; }
@media (max-width:520px){
  .ex-table th:nth-child(2), .ex-table td:nth-child(2){ width:40%; }
  .ex-table th:nth-child(3), .ex-table td:nth-child(3){ width:14%; }
  .ex-table th, .ex-table td{ padding-left:4px; padding-right:4px; }
}

/* ---------- Builder ---------- */
.builder-row{
  display:grid; grid-template-columns:1fr 70px 90px 100px 34px;
  gap:8px; align-items:center; margin-bottom:8px;
}
.builder-row input{ padding:10px 10px; font-size:.92rem; }
/* name cell hosts the type-ahead menu; the input fills it */
.ex-name-cell{ position:relative; min-width:0; }
.ex-name-cell input{ width:100%; }
.builder-row .btn-danger{ padding:8px 4px; }
.builder-head{
  display:grid; grid-template-columns:1fr 70px 90px 100px 34px; gap:8px;
  font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--muted);
  margin-bottom:6px; padding:0 2px;
}
.builder-actions{ display:flex; gap:10px; margin-top:16px; flex-wrap:wrap; }

/* ---------- Routines (day-split plans) ---------- */
.routine-block{
  border:1px solid var(--line); border-radius:14px;
  padding:14px; margin-bottom:14px; background:var(--bg-2);
}
.routine-top{ display:flex; gap:8px; margin-bottom:8px; }
.routine-top .routine-name{ flex:1; font-weight:600; }
.routine-top .routine-remove{ flex-shrink:0; }
.day-picker{ display:flex; gap:5px; margin:0 0 14px; flex-wrap:wrap; }
.day-chip{
  font:600 .75rem var(--body); padding:6px 10px; border-radius:8px;
  border:1.5px solid var(--line); background:var(--card); color:var(--muted);
  cursor:pointer; transition:all .12s;
}
.day-chip:hover{ border-color:var(--teal); color:var(--teal-hi); }
.day-chip.on{ background:var(--teal); border-color:var(--teal); color:#04252A; }
.routine-head{ display:flex; align-items:baseline; gap:10px; margin:16px 0 6px; }
.routine-head:first-of-type{ margin-top:4px; }
.routine-head b{ font-size:.98rem; }
.routine-days{
  font:600 .7rem var(--mono); text-transform:uppercase; letter-spacing:.04em;
  color:var(--yellow); background:rgba(255,201,51,.1);
  padding:2px 9px; border-radius:99px;
}
.chip-days{ font-size:.7rem; opacity:.8; font-family:var(--mono); }
.chip.today:not(.sel){ border-color:var(--yellow); }
.routine-block .routine-desc{ margin:0 0 14px; min-height:44px; font-size:.9rem; }
.routine-add-row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.lib-select{
  padding:8px 12px; border:1.5px solid var(--line); border-radius:10px;
  font:600 .85rem var(--body); color:var(--teal-hi); background:var(--card); cursor:pointer;
  max-width:260px;
}
.lib-select:focus{ outline:none; border-color:var(--teal); }

/* Type-ahead library picker (builder) */
.lib-pick{ position:relative; flex:1; min-width:200px; max-width:320px; }
.lib-search-input{
  width:100%; padding:8px 12px; border:1.5px solid var(--line); border-radius:10px;
  font:600 .85rem var(--body); color:var(--ink); background:var(--card);
}
.lib-search-input::placeholder{ color:var(--teal-hi); opacity:1; }
.lib-search-input:focus{ outline:none; border-color:var(--teal); }
.lib-menu{
  position:absolute; left:0; right:0; top:calc(100% + 5px); z-index:40;
  max-height:264px; overflow-y:auto; padding:4px;
  background:var(--card); border:1.5px solid var(--line); border-radius:12px;
  box-shadow:0 14px 34px rgba(0,0,0,.5);
}
.lib-opt{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; padding:9px 10px; border:0; border-radius:8px;
  background:none; color:var(--ink); font:600 .88rem var(--body);
  text-align:left; cursor:pointer;
}
.lib-opt:hover, .lib-opt.hi{ background:rgba(28,181,196,.14); }
.lib-opt-cam{ flex:0 0 auto; font-size:.8rem; }
.lib-none{ padding:10px 12px; color:var(--muted); font-size:.84rem; }

/* Per-exercise coaching details in the builder */
.builder-ex-tools{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:-2px 0 8px; }
.row-details-toggle{
  background:none; border:none; padding:2px 0; cursor:pointer;
  font:600 .78rem var(--body); color:var(--muted); transition:color .15s;
}
.row-details-toggle:hover{ color:var(--teal-hi); }
.ex-move{ display:flex; gap:4px; flex-shrink:0; }
.ex-move button{
  background:var(--card-2); border:1px solid var(--line); border-radius:8px;
  color:var(--muted); cursor:pointer; font-size:.72rem; line-height:1;
  width:30px; height:26px; display:flex; align-items:center; justify-content:center;
  transition:color .15s, border-color .15s, background .15s;
}
.ex-move button:hover{ color:var(--teal-hi); border-color:var(--teal); background:var(--card); }
/* first row can't go up, last row can't go down */
.builder-ex:first-child .ex-up,
.builder-ex:last-child .ex-down{ opacity:.3; pointer-events:none; }
@keyframes ex-moved{ from{ background:rgba(28,181,196,.14); } to{ background:transparent; } }
.builder-ex.moved{ animation:ex-moved .5s ease; border-radius:10px; }
@media (prefers-reduced-motion:reduce){ .builder-ex.moved{ animation:none; } }
.builder-details{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:12px; margin:0 0 12px;
}
.builder-details .bd-row{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.builder-details .bd-row input[data-f=tempo]{ width:180px; padding:9px 11px; font-size:.88rem; }
.ss-check{
  display:flex; gap:7px; align-items:center; cursor:pointer;
  font:600 .85rem var(--body); color:var(--muted);
}
.ss-check input{ width:16px; height:16px; accent-color:var(--teal); }
.builder-details textarea{ min-height:72px; font-size:.9rem; margin-bottom:10px; }
.builder-details input[data-f=video]{ font-size:.85rem; padding:9px 11px; }

/* Doug's reference guide + expandable exercise details */
.plan-guide{
  background:rgba(28,181,196,.06); border:1px solid var(--line);
  border-radius:12px; padding:10px 14px; margin-bottom:14px;
}
.plan-guide summary{ cursor:pointer; font-weight:700; font-size:.9rem; color:var(--teal-hi); list-style:none; }
.plan-guide summary::-webkit-details-marker{ display:none; }
.plan-guide-body{ margin-top:10px; font-size:.9rem; line-height:1.55; white-space:pre-line; color:var(--ink); }
.routine-desc-view{ font-size:.88rem; color:var(--muted); margin:2px 0 8px; white-space:pre-line; }
.ex-row.expandable{ cursor:pointer; }
.ex-row.expandable:hover .ex-name{ color:var(--teal-hi); }
.ex-caret{ display:inline-block; font-size:.7rem; color:var(--teal); transition:transform .15s; }
.ex-row.open .ex-caret{ transform:rotate(90deg); }
.ex-tempo{ font-size:.78rem; color:var(--muted); }
.ex-detail td{ background:rgba(28,181,196,.06); border-radius:8px; padding:12px 14px !important; }
.exd-bits{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.exd-bits:last-child{ margin-bottom:0; }
.tempo-chip{
  font:600 .74rem var(--mono); background:var(--teal-deep); color:#fff;
  padding:3px 10px; border-radius:99px; letter-spacing:.03em;
}
.exd-notes{ font-size:.88rem; line-height:1.55; white-space:pre-line; margin:0; }
.ss-row td{ padding:2px 8px !important; border-bottom:none !important; }
.ss-row span{
  font:600 .68rem var(--mono); text-transform:uppercase; letter-spacing:.1em;
  color:var(--yellow);
}

/* Coaching notes in the logger */
.ex-info{
  background:none; border:none; cursor:pointer; padding:0 2px;
  color:var(--teal-hi); font-size:.95rem; vertical-align:1px;
}
.ex-info:hover{ color:var(--yellow); }
.log-ex-notes{
  background:rgba(28,181,196,.07); border-left:3px solid var(--teal);
  border-radius:8px; padding:10px 12px; margin-top:10px;
}

/* ---------- Regimens: weeks & circuits ---------- */
.badge-week{ background:rgba(255,201,51,.15); color:var(--yellow); }
.client-week-row{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:-4px 0 14px; padding:10px 12px;
  background:var(--bg-2); border:1px solid var(--line); border-radius:12px;
}
.client-week-row b{ font-size:.95rem; min-width:96px; text-align:center; }
.client-week-row .muted{ font-size:.78rem; }
.client-week-row .btn:disabled{ opacity:.35; cursor:default; }

.week-section{
  border:1px solid var(--line); border-radius:12px;
  padding:10px 14px; margin-bottom:10px; background:var(--bg-2);
}
.week-section.current{ border-color:var(--yellow); }
.week-section summary{
  cursor:pointer; list-style:none;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.week-section summary::-webkit-details-marker{ display:none; }
.week-section .week-sum{ font-size:.8rem; }
.week-section-body{ margin-top:10px; }

.builder-week-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:12px; padding:10px 12px;
  background:var(--bg-2); border:1px solid var(--line); border-radius:12px;
}
.builder-week-bar .chip-strip{ margin-bottom:0; }
.builder-week-actions{ display:flex; gap:6px; }
.chip-add{ border-style:dashed; color:var(--teal-hi); }

.circuit-badge{
  font:600 .72rem var(--mono); letter-spacing:.03em;
  background:rgba(28,181,196,.14); color:var(--teal-hi);
  padding:3px 10px; border-radius:99px; white-space:nowrap;
}
.warmup-chip{
  font:600 .68rem var(--body); letter-spacing:.05em; text-transform:uppercase;
  background:rgba(255,201,51,.14); color:var(--yellow);
  padding:3px 9px; border-radius:99px; white-space:nowrap;
}
.circuit-row{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:0 0 14px; }
.circuit-rounds{
  display:flex; align-items:center; gap:8px;
  font:600 .85rem var(--body); color:var(--muted);
}
/* in a circuit, rounds replace per-exercise sets — park the sets column */
.routine-block.circuit [data-f=sets]{ opacity:.25; pointer-events:none; }

.wx-circuit-head{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:10px 4px 2px;
}
.wx-circuit-hint{ font-size:.72rem; color:var(--muted); margin-left:auto; }
.round-dots{ display:inline-flex; gap:5px; align-items:center; }
.rdot{
  width:10px; height:10px; border-radius:50%;
  border:1.5px solid var(--teal); background:transparent;
}
.rdot.done{ background:var(--turf); border-color:var(--turf); }
.wx-card.in-circuit{ margin-left:10px; border-left:3px solid rgba(28,181,196,.35); }

.tpl-filters{ margin-bottom:4px; }
.chip-xs{ padding:5px 11px; font-size:.75rem; }
.tpl-filter-sep{ width:1px; height:20px; background:var(--line); margin:0 4px; align-self:center; }
.tpl-diff{
  position:absolute; top:8px; left:8px; z-index:1;
  font:700 .6rem var(--body); letter-spacing:.1em; text-transform:uppercase;
  background:var(--diff, #888); color:#0B0E12;
  padding:3px 8px; border-radius:99px;
}
.tpl-card.tpl-blank .tpl-art{ opacity:.45; }
.tpl-editing-banner{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  margin-bottom:14px; padding:10px 14px;
  background:rgba(28,181,196,.1); border:1px solid var(--teal); border-radius:12px;
}
.tpl-editing-banner b{ color:var(--teal-hi); }
.tpl-save-row select{ padding:9px 12px; }
#player-target .warmup-chip{ vertical-align:1px; margin-left:6px; }

/* ---------- Plan templates ---------- */
.tpl-block{ margin-bottom:18px; }
.tpl-label{
  font-size:.75rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); margin-bottom:8px;
}
.tpl-strip{ display:flex; gap:10px; overflow-x:auto; padding-bottom:6px; -webkit-overflow-scrolling:touch; }
.tpl-empty{ font-size:.9rem; }

/* ── Cover-flow template shelf ── */
.tpl-strip.tpl-flow{
  --tplw: 172px; --tplh: 214px;
  gap:20px;
  padding:14px calc(50% - var(--tplw) / 2) 34px;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  overscroll-behavior-x:contain;
}
.tpl-strip.tpl-flow::-webkit-scrollbar{ display:none; }
.tpl-card{
  flex:0 0 var(--tplw); width:var(--tplw); height:var(--tplh);
  scroll-snap-align:center; position:relative;
  perspective:750px;
}
.tpl-tilt{
  width:100%; height:100%;
  transform-style:preserve-3d; will-change:transform;
  -webkit-box-reflect:below 8px linear-gradient(transparent 62%, rgba(255,255,255,.1));
}
.tpl-inner{
  position:relative; width:100%; height:100%;
  transform-style:preserve-3d;
  transition:transform .5s cubic-bezier(.25,.8,.3,1.05);
}
.tpl-card.flipped .tpl-inner{ transform:rotateY(180deg); }
.tpl-face{
  position:absolute; inset:0; overflow:hidden;
  backface-visibility:hidden; -webkit-backface-visibility:hidden;
  border-radius:14px; background:var(--card-2); border:1px solid var(--line);
  box-shadow:0 14px 28px rgba(0,0,0,.5);
  display:flex; flex-direction:column;
}
/* mobile WebKit ignores backface-visibility inside a reflected/flattened 3D
   context, so swap the faces' visibility at the flip's halfway point too */
.tpl-front{ visibility:visible; transition:visibility 0s .22s; }
.tpl-card.flipped .tpl-front{ visibility:hidden; }
.tpl-back{ visibility:hidden; transition:visibility 0s .22s; }
.tpl-card.flipped .tpl-back{ visibility:visible; }
.tpl-front{ cursor:pointer; }
.tpl-art{
  flex:1; position:relative; display:flex; align-items:center; justify-content:center;
  background:var(--tpl, var(--teal));
}
.tpl-art::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(150deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 42%, rgba(0,0,0,.5) 100%);
}
.tpl-art-title{
  position:relative; z-index:1; font-family:var(--display);
  font-size:1.35rem; line-height:1.02; letter-spacing:.02em; text-transform:uppercase;
  color:#fff; text-align:center; padding:0 14px;
  text-shadow:0 2px 8px rgba(0,0,0,.45);
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden;
}
.tpl-front-meta{ padding:10px 12px 12px; }
.tpl-front-meta b{
  display:block; font-size:.92rem; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tpl-diff-label{
  font:700 .72rem var(--body) !important; letter-spacing:.1em; text-transform:uppercase;
}
.tpl-front-meta span{ font-size:.74rem; color:var(--muted); }

.tpl-back{ transform:rotateY(180deg); padding:12px; border-top:5px solid var(--tpl, var(--teal)); }
.tpl-flip-back{
  position:absolute; top:6px; right:6px; z-index:2;
  background:none; border:none; cursor:pointer;
  color:var(--muted); font-size:.85rem; padding:4px 6px;
}
.tpl-flip-back:hover{ color:var(--ink); }
.tpl-back-name{
  display:block; font-size:.9rem; color:var(--ink);
  padding-right:22px; margin-bottom:8px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tpl-back-list{ flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:7px; }
.tpl-back-routine b{ display:block; font-size:.78rem; color:var(--ink); }
.tpl-back-routine span{ font-size:.7rem; color:var(--muted); }
.tpl-back-actions{ display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.tpl-back-actions .btn{ width:100%; }
.tpl-delete{ color:var(--muted); }
.tpl-delete.armed{
  background:var(--red); border-color:var(--red); color:#fff;
  animation:tpl-arm .3s ease;
}
@keyframes tpl-arm{ 0%{ transform:scale(.96); } 60%{ transform:scale(1.03); } 100%{ transform:scale(1); } }

@media (prefers-reduced-motion: reduce){
  .tpl-inner, .tpl-face{ transition:none; }
}
.tpl-save-row{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin-top:14px; padding:12px; background:var(--bg-2); border-radius:12px;
}
.tpl-save-row input{ flex:1 1 220px; padding:10px 12px; }
.tpl-colors{ display:flex; gap:6px; }
.tpl-color{
  width:26px; height:26px; border-radius:50%; cursor:pointer;
  border:2px solid transparent; padding:0;
}
.tpl-color.sel{ border-color:#fff; box-shadow:0 0 0 2px var(--bg) inset; }

/* ---------- Logger + the plate signature ---------- */
.log-ex{ padding:14px 0; border-bottom:1px solid var(--line); }
.log-ex:last-child{ border-bottom:none; }
.log-ex-head{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; }
.log-ex-target{ font-family:var(--mono); font-size:.82rem; color:var(--muted); }
.set-entry{ display:flex; gap:8px; align-items:center; margin-top:10px; }
.set-entry input{ width:92px; padding:9px 10px; font-family:var(--mono); }
.set-entry .x{ color:var(--muted); font-weight:600; }

/* Slide-to-log — drag the mini plate across to log the prescribed set */
.slide-log{ margin-top:12px; -webkit-tap-highlight-color:transparent; }
.slide-log:focus-visible{ outline:3px solid rgba(28,181,196,.5); outline-offset:2px; border-radius:99px; }
.slide-track{
  position:relative; height:56px; border-radius:99px; overflow:hidden;
  background:rgba(28,181,196,.08); border:1.5px dashed var(--teal);
  display:flex; align-items:center; justify-content:center;
  transition:background .2s, border-color .2s;
}
.slide-label{
  font:600 .88rem var(--body); color:var(--teal-hi);
  padding:0 14px 0 60px; text-align:center; pointer-events:none;
  transition:opacity .1s;
}
.slide-thumb{
  position:absolute; left:4px; top:50%; margin-top:-23px;
  width:46px; height:46px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #F0564B, var(--red) 55%, var(--red-dk));
  box-shadow:inset 0 0 0 3px rgba(255,255,255,.85), inset 0 0 0 5px var(--red-dk), 0 2px 6px rgba(0,0,0,.5);
  display:flex; align-items:center; justify-content:center;
  cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none;
  transition:transform .3s cubic-bezier(.2,1.3,.4,1);
}
/* lone star core — teal circle, white star */
.thumb-core{
  width:26px; height:26px; border-radius:50%; background:var(--teal-deep);
  display:flex; align-items:center; justify-content:center; pointer-events:none;
}
.thumb-core svg{ width:14px; height:14px; fill:#fff; display:block; }
.slide-thumb.dragging{ transition:none; cursor:grabbing; }
.slide-log.done .slide-track{ border-style:solid; border-color:var(--turf); background:rgba(67,183,90,.14); }
.slide-log.done .slide-label{ color:var(--turf); }
.set-count{ font-size:.8rem; margin-left:auto; text-align:right; }

/* Manual-entry disclosure — the slider is the main path, this is the override */
.entry-row{ display:flex; align-items:center; gap:10px; margin-top:8px; min-height:1.4em; }
.entry-toggle{
  background:none; border:none; padding:2px 0; cursor:pointer;
  font:600 .8rem var(--body); color:var(--muted);
  transition:color .15s;
}
.entry-toggle:hover{ color:var(--teal-hi); }
.entry-caret{ font-size:.7rem; }

/* Client-added exercises */
.extra-head{ display:flex; gap:8px; align-items:center; }
.extra-head .extra-name{ flex:1; padding:10px 12px; font-size:.95rem; font-weight:600; }
.extra-head .extra-remove{ flex-shrink:0; }

/* Logged sets render as fire chips — tap one to remove that set */
.plate-rack{ display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; align-items:center; }
.set-flame{
  display:flex; align-items:center; gap:6px;
  background:var(--card-2); border:1.5px solid var(--line); border-radius:99px;
  padding:5px 13px 5px 8px; cursor:pointer;
  animation:plate-in .28s cubic-bezier(.2,1.4,.4,1) both;
  transition:border-color .15s, background .15s, transform .12s;
}
.set-flame:hover{ border-color:var(--red); background:rgba(224,57,46,.1); transform:rotate(-3deg); }
.sf-emoji{ font-size:1.3rem; line-height:1; }
.sf-info{ font-family:var(--mono); font-size:.82rem; color:var(--muted); }
.sf-info b{ font-size:.95rem; color:var(--ink); }
@keyframes plate-in{ from{ transform:scale(.4) rotate(-18deg); opacity:0; } to{ transform:scale(1) rotate(0); opacity:1; } }
@media (prefers-reduced-motion:reduce){ .set-flame{ animation:none; } .row-card:hover{ transform:none; } }

/* ---------- Log history cards ---------- */
.log-card{
  background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px;
}
.log-card summary{
  cursor:pointer; font-weight:600; display:flex; justify-content:space-between; gap:10px;
  list-style:none;
}
.log-card summary::-webkit-details-marker{ display:none; }
.log-card summary .muted{ font-weight:500; }
.log-detail{ margin-top:10px; }
.log-delete{ margin-top:10px; padding:6px 10px; font-size:.8rem; }
.log-delete:hover{ background:rgba(224,57,46,.12); }
.log-detail .ld-ex{ margin-bottom:8px; }
.log-detail .ld-ex b{ font-size:.92rem; }
.log-detail .ld-sets{ font-family:var(--mono); font-size:.85rem; color:var(--teal-hi); }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(80px);
  background:var(--card-2); color:#fff; padding:12px 20px; border-radius:12px;
  font-size:.9rem; box-shadow:var(--shadow); opacity:0; transition:all .25s; z-index:50;
  border:1px solid var(--line); border-left:4px solid var(--teal);
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- First-run: Add to Home Screen (iOS) ---------- */

/* ---------- Lightbox ---------- */
.info-img-btn{ display:block; width:100%; padding:0; border:0; background:none; cursor:zoom-in; border-radius:12px; }
.info-img-btn:focus-visible{ outline:3px solid rgba(28,181,196,.5); outline-offset:2px; }
.lightbox{
  position:fixed; inset:0; z-index:220;
  display:flex; align-items:center; justify-content:center;
  padding:16px; padding-top:max(16px, env(safe-area-inset-top)); padding-bottom:max(16px, env(safe-area-inset-bottom));
  background:rgba(0,0,0,.92); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  cursor:zoom-out; animation:a2hs-fade .2s ease;
}
.lightbox-fig{ margin:0; max-width:100%; max-height:100%; display:flex; flex-direction:column; align-items:center; gap:10px; }
.lightbox-fig img{
  max-width:100%; max-height:calc(100dvh - 90px); object-fit:contain;
  border-radius:12px; box-shadow:0 20px 60px rgba(0,0,0,.7); cursor:default;
}
.lightbox-fig figcaption{ color:rgba(255,255,255,.85); font-size:.9rem; text-align:center; max-width:640px; }
.lightbox-close{
  position:absolute; top:max(12px, env(safe-area-inset-top)); right:12px; width:40px; height:40px;
  border-radius:50%; border:1px solid rgba(255,255,255,.2); background:rgba(0,0,0,.5); color:#fff;
  font-size:1.1rem; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.lightbox-close:hover{ background:rgba(255,255,255,.14); }

/* ---------- First-time tour ---------- */
.auth-tour{ margin-top:14px; font-size:.88rem; }
.landing-help{ text-align:center; margin:18px 0 0; }
.landing-help .link-btn{ font-size:.85rem; color:var(--muted); }
.landing-help .link-btn:hover{ color:var(--teal-hi); }
.about-row-btn{ width:100%; text-align:left; cursor:pointer; font:inherit; margin-top:10px; }
.tour{
  position:fixed; inset:0; z-index:210;
  display:flex; align-items:center; justify-content:center;
  padding:16px; padding-bottom:max(16px, env(safe-area-inset-bottom));
  background:rgba(0,0,0,.66); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  animation:a2hs-fade .25s ease;
}
.tour-sheet{
  position:relative; width:100%; max-width:440px; min-height:400px;
  display:flex; flex-direction:column;
  background:var(--card-2); border:1px solid var(--line); border-radius:22px; padding:26px 24px 20px;
  box-shadow:0 18px 60px rgba(0,0,0,.6);
  animation:a2hs-rise .38s cubic-bezier(.2,.85,.3,1);
}
.tour-ic{
  width:64px; height:64px; border-radius:18px; display:flex; align-items:center; justify-content:center;
  font-size:2rem; background:rgba(28,181,196,.14); margin-bottom:14px;
}
.tour-step{ margin:0 0 4px; font-size:.7rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--teal-hi); }
.tour h2{ font-size:1.6rem; color:var(--ink); margin:0 0 10px; line-height:1.05; }
.tour-body{ flex:1; }
.tour-body ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.tour-body li{ position:relative; padding-left:20px; font-size:.95rem; line-height:1.5; color:var(--ink); }
.tour-body li::before{ content:""; position:absolute; left:2px; top:.62em; width:8px; height:8px; border-radius:50%; background:var(--teal); }
.tour-body b{ color:var(--teal-hi); font-weight:700; }
.tour-dots{ display:flex; justify-content:center; gap:6px; margin:18px 0 14px; }
.tour-dots span{ width:7px; height:7px; border-radius:50%; background:var(--line); transition:background .2s, transform .2s; }
.tour-dots span.done{ background:rgba(28,181,196,.45); }
.tour-dots span.on{ background:var(--teal); transform:scale(1.35); }
.tour-nav{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tour-nav .link-btn{ color:var(--muted); }
@media (max-width:420px){
  .tour-sheet{ padding:22px 18px 16px; min-height:0; }
  .tour h2{ font-size:1.4rem; }
}

.a2hs{
  position:fixed; inset:0; z-index:200;
  display:flex; flex-direction:column; justify-content:flex-end;
  padding:16px; padding-bottom:max(16px, env(safe-area-inset-bottom));
  background:rgba(0,0,0,.6); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  animation:a2hs-fade .25s ease;
}
@keyframes a2hs-fade{ from{ opacity:0; } to{ opacity:1; } }
.a2hs-sheet{
  position:relative; width:100%; max-width:460px; margin:0 auto;
  background:var(--card-2); border:1px solid var(--line); border-radius:20px; padding:24px 22px 20px;
  box-shadow:0 -12px 44px rgba(0,0,0,.6);
  animation:a2hs-rise .38s cubic-bezier(.2,.85,.3,1);
}
@keyframes a2hs-rise{ from{ transform:translateY(34px); opacity:.4; } to{ transform:none; opacity:1; } }
.a2hs-close{
  position:absolute; top:12px; right:12px; padding:6px 8px;
  background:none; border:none; cursor:pointer; color:var(--muted); font-size:1rem; line-height:1;
}
.a2hs-close:hover{ color:var(--ink); }
.a2hs-logo{ width:46px; height:46px; border-radius:12px; border:1px solid var(--line); }
.a2hs h2{ font-size:1.5rem; color:var(--ink); margin:12px 0 6px; }
.a2hs-steps{ list-style:none; margin:20px 0 18px; padding:0; display:flex; flex-direction:column; gap:14px; }
.a2hs-steps li{ display:flex; align-items:flex-start; gap:12px; font-size:.95rem; line-height:1.4; }
.a2hs-num{
  flex:0 0 26px; width:26px; height:26px; border-radius:50%;
  background:var(--teal); color:#04252A; display:grid; place-items:center;
  font-family:var(--mono); font-size:.8rem; font-weight:600; margin-top:1px;
}
.a2hs-ic{
  width:22px; height:22px; vertical-align:-5px; margin:0 1px;
  stroke:var(--teal-hi); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.a2hs-pointer{
  text-align:center; color:#fff; font-size:.85rem; font-weight:600;
  margin-top:14px; text-shadow:0 1px 4px rgba(0,0,0,.6);
  animation:a2hs-bob 1.5s ease-in-out infinite;
}
@keyframes a2hs-bob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(6px); } }
@media (prefers-reduced-motion: reduce){
  .a2hs, .a2hs-sheet, .a2hs-pointer{ animation:none; }
}

/* ---------- Streak banner ---------- */
.streak-banner{
  display:flex; align-items:center; gap:14px;
  background:var(--card); color:#fff;
  border-radius:var(--r); border:1px solid var(--line); border-left:5px solid var(--yellow);
  padding:16px 18px; margin-bottom:20px;
}
.streak-main{ font-weight:700; font-size:1.05rem; }
.streak-sub{ font-size:.85rem; color:var(--muted); margin-top:2px; }

/* Week strip — scheduled days show a dot, completed days earn a lone star */
.week-strip{ display:flex; gap:4px; margin-left:auto; flex-shrink:0; }
.week-cell{
  width:34px; padding:5px 0 4px; border-radius:9px;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  border:1.5px solid transparent;
}
.week-cell.sched{ background:rgba(255,255,255,.05); border-color:var(--line); }
.week-cell.today{ border-color:var(--yellow); }
.week-cell.done{ background:var(--teal-deep); border-color:var(--teal-deep); }
.week-cell.done.today{ border-color:var(--yellow); }
.wc-letter{ font-size:.62rem; font-weight:700; letter-spacing:.05em; color:var(--muted); }
.week-cell.done .wc-letter{ color:rgba(255,255,255,.85); }
.wc-mark{
  height:16px; display:flex; align-items:center; justify-content:center;
  font-size:1.05rem; line-height:1; color:var(--teal);
}
.wc-mark svg{ width:13px; height:13px; fill:#fff; display:block; }

/* ---------- Notes from Doug ---------- */
.note-callout{
  background:var(--card); border:1px solid var(--line); border-left:5px solid var(--teal);
  border-radius:var(--r); padding:14px 16px; margin-bottom:20px;
}
.log-note{
  margin-top:10px; background:rgba(28,181,196,.07);
  border-left:3px solid var(--teal); padding:10px 12px; border-radius:8px;
}
.log-note-label{
  font-size:.68rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--teal-hi); margin-bottom:3px;
}
.note-flag{ font-size:.8rem; }
.note-hint{ margin:-6px 0 12px; font-size:.83rem; }
.note-edit{ margin-top:12px; display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.note-edit textarea{ min-height:64px; }

/* ---------- Progress charts ---------- */
.chip-strip{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.chip{
  font:600 .82rem var(--body); padding:7px 13px; border-radius:99px;
  border:1.5px solid var(--line); background:var(--card); color:var(--ink);
  cursor:pointer; transition:border-color .15s, background .15s;
}
.chip:hover{ border-color:var(--teal); }
.chip.sel{ background:var(--teal); border-color:var(--teal); color:#04252A; }
.chart-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.chart-title{ font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.pr-badge{
  font:600 .78rem var(--mono); padding:3px 10px; border-radius:99px;
  background:rgba(224,57,46,.14); color:#F58A82;
}
.pr-badge.new{ background:var(--red); color:#fff; box-shadow:0 3px 10px rgba(224,57,46,.4); }
.chart-svg{ width:100%; height:auto; display:block; }
.chart-svg .grid{ stroke:var(--line); stroke-width:1; }
.chart-svg .trend{ fill:none; stroke:var(--teal); stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round; }
.chart-svg .dot{ fill:var(--card); stroke:var(--teal); stroke-width:2.5; }
.chart-svg .dot.best{ fill:var(--red); stroke:var(--red-dk); }
.chart-svg text{ font-family:var(--mono); font-size:11px; fill:var(--muted); }
.chart-svg .abar{ fill:var(--teal); }
.chart-svg .abar.today{ fill:var(--yellow); }
.chart-svg .abar-rest{ stroke:var(--line); stroke-width:2; }
.chart-svg .abar-rest.today{ stroke:var(--yellow); }

/* ---------- Exercise video links ---------- */
.ex-video{
  display:inline-block; text-decoration:none; font:600 .68rem var(--body);
  background:var(--red); color:#fff; border-radius:99px;
  padding:2px 8px; margin-left:7px; vertical-align:1px; letter-spacing:.03em;
  transition:background .15s;
}
.ex-video:hover{ background:var(--red-dk); }

/* ---------- Nutrition ---------- */
.nut-sec-label{
  font-size:.75rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--ink); margin:22px 0 10px; display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
}
.nut-sec-label span{ font-weight:500; letter-spacing:.02em; text-transform:none; color:var(--muted); font-size:.8rem; }
.nut-view-label{
  font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--teal-hi); margin:20px 0 10px;
}
.nut-view-label:first-child{ margin-top:0; }

/* macro + metabolism stat cards */
.macro-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:12px; }
.macro-row{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; }
.macro-card{
  background:var(--card-2); border:1px solid var(--line); border-radius:12px;
  padding:12px 14px; display:flex; flex-direction:column; gap:2px;
}
.macro-card .mc-label{ font-size:.68rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.macro-card b{ font-family:var(--mono); font-size:1.3rem; color:var(--teal-hi); font-variant-numeric:tabular-nums; }
.macro-card.meta b{ color:var(--yellow); }
.macro-card .mc-unit{ font-size:.72rem; color:var(--muted); }

/* supplements */
.supp-list{ display:flex; flex-direction:column; gap:10px; }
.supp-card{ background:var(--card-2); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.supp-card .sc-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.supp-card .sc-head b{ font-size:.96rem; }
.supp-card .sc-dose{ font-family:var(--mono); font-size:.82rem; color:var(--teal-hi); margin-top:3px; }
.supp-card .sc-note{ font-size:.85rem; color:var(--muted); margin:6px 0 0; }

/* food traffic light */
.food-legend{ display:flex; gap:16px; margin-bottom:12px; font-size:.78rem; color:var(--muted); }
.food-legend span{ display:flex; align-items:center; gap:6px; }
.fi-dot{ display:inline-block; width:11px; height:11px; border-radius:50%; flex-shrink:0; }
.fi-dot.green{ background:var(--turf); }
.fi-dot.yellow{ background:var(--yellow); }
.fi-dot.red{ background:var(--red); }
.food-groups{ display:flex; flex-direction:column; gap:16px; }
.food-group > b{ display:block; font-size:.9rem; margin-bottom:8px; }
.food-item{ display:flex; align-items:baseline; gap:9px; padding:6px 0; border-bottom:1px solid var(--line); }
.food-item:last-child{ border-bottom:none; }
.food-item .fi-dot{ position:relative; top:1px; }
.fi-text{ display:flex; flex-direction:column; gap:1px; }
.fi-name{ font-weight:600; font-size:.92rem; }
.fi-note{ font-size:.8rem; color:var(--muted); }

/* prose blocks (goals, sample day) */
.nut-prose{
  font-size:.92rem; line-height:1.6; white-space:pre-line;
  background:var(--card-2); border:1px solid var(--line); border-radius:12px; padding:14px 16px;
}

/* builder rows (supplements & foods) */
/* section header + block catalog controls (builder) */
.nut-block-hint{ margin:18px 0 -6px; font-size:.82rem; line-height:1.45; }
.nut-sec-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.nut-sec-head .nut-sec-label{ flex:1 1 200px; }
.nut-block-bar{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:22px 0 10px; }
.nut-block-bar .lib-select{ max-width:240px; }
.nut-group-intros{ margin:0 0 12px; border:1px dashed var(--line); border-radius:12px; padding:10px 12px; background:var(--bg-2); }
.nut-group-intros summary{ cursor:pointer; font-size:.85rem; font-weight:600; }
.nut-group-intros summary .muted{ font-weight:500; font-size:.8rem; }
.nut-intro-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; margin-top:12px; }
.nut-intro-grid .field{ margin-bottom:0; }
.nut-intro-grid textarea{ font-size:.85rem; }

/* client view: recommendations / avoid lists and recipe cards */
.nut-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.nut-list li{ display:flex; gap:10px; align-items:flex-start; padding:8px 0; border-bottom:1px solid var(--line); }
.nut-list li:last-child{ border-bottom:none; }
.nl-mark{
  flex-shrink:0; width:22px; height:22px; border-radius:50%; margin-top:1px;
  display:flex; align-items:center; justify-content:center; font-size:.78rem; font-weight:800;
}
.nut-list.rec .nl-mark{ background:rgba(67,183,90,.16); color:var(--turf); }
.nut-list.avoid .nl-mark{ background:rgba(224,57,46,.14); color:var(--red); }
.nl-body{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.nl-text{ font-weight:600; font-size:.93rem; line-height:1.4; }
.nl-why{ font-size:.82rem; color:var(--muted); line-height:1.45; }
.recipe-list{ display:flex; flex-direction:column; gap:10px; }
.recipe-card{ background:var(--card-2); border:1px solid var(--line); border-left:3px solid var(--teal); border-radius:12px; padding:12px 14px; }
.recipe-card .rc-head{ display:flex; flex-direction:column; gap:2px; margin-bottom:8px; }
.recipe-card .rc-head b{ font-size:.98rem; }
.rc-purpose{ font-size:.82rem; color:var(--teal-hi); }
.rc-ing{ margin:0; padding-left:18px; font-size:.88rem; line-height:1.55; }
.rc-method{ margin:8px 0 0; font-size:.86rem; color:var(--muted); }
.food-group-intro{ margin:-4px 0 8px; font-size:.82rem; color:var(--muted); line-height:1.45; }

.nut-row{ border:1px solid var(--line); border-radius:12px; padding:10px; margin-bottom:10px; background:var(--bg-2); }
.nut-row .nr-line.nr-list{ grid-template-columns:1fr 34px; }
.nut-row.nr-recipe textarea{ width:100%; margin-top:8px; padding:9px 10px; font-size:.86rem; }
.nut-row .nr-line{ display:grid; grid-template-columns:1.2fr 1fr 34px; gap:8px; margin-bottom:8px; }
.nut-row .nr-line:last-child{ margin-bottom:0; }
.nut-row .nr-line.nr-food{ grid-template-columns:1.4fr 110px 130px 34px; }
.nut-row input, .nut-row select{ padding:9px 10px; font-size:.88rem; }
.nut-row .nr-x{ padding:6px 4px; }
.nut-row .nr-note{ width:100%; font-size:.82rem; color:var(--muted); }
.nut-row .nr-note:focus{ color:var(--ink); }

/* comments */
.nut-comments{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.nut-comment{
  background:rgba(28,181,196,.06); border-left:3px solid var(--teal);
  border-radius:8px; padding:9px 12px; font-size:.9rem;
}
.nut-comment .nc-meta{ font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--teal-hi); margin-bottom:3px; }
.nut-comments-wrap{ margin-bottom:18px; padding-bottom:16px; border-bottom:1px solid var(--line); }

/* nutrition template chips */
.nut-tpl-chip{ display:inline-flex; align-items:center; gap:2px; padding:0; overflow:hidden; }
.nut-tpl-chip .ntc-use{
  background:none; border:none; cursor:pointer; color:inherit;
  font:600 .82rem var(--body); padding:7px 6px 7px 13px;
}
.nut-tpl-chip .ntc-x{
  background:none; border:none; cursor:pointer; color:var(--muted);
  font-size:.75rem; padding:7px 10px 7px 4px;
}
.nut-tpl-chip .ntc-x:hover{ color:var(--red); }

@media (max-width:600px){
  .nut-row .nr-line{ grid-template-columns:1fr 1fr 34px; }
  .nut-row .nr-line.nr-food{ grid-template-columns:1fr; }
  .nut-row .nr-line.nr-food .nr-x{ justify-self:end; }
}

/* ---------- Weekly goal (trainer) ---------- */
.goal-row{ display:flex; align-items:center; gap:10px; margin:-10px 0 20px; flex-wrap:wrap; }
.goal-row label{
  font-size:.75rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width:760px){
  .auth{ flex-direction:column; }
  .auth-brand{ min-height:38dvh; }
  .builder-head{ display:none; }
  /* narrow screens: exercise name gets its own full-width line */
  .builder-row{
    grid-template-columns:1fr 1fr 1.2fr 34px;
    grid-template-areas:
      "name name name name"
      "sets reps weight del";
  }
  .builder-row .ex-name-cell{ grid-area:name; }
  .builder-row [data-f=sets]{ grid-area:sets; }
  .builder-row [data-f=reps]{ grid-area:reps; }
  .builder-row [data-f=weight]{ grid-area:weight; }
  .builder-row .btn-danger{ grid-area:del; }
  .routine-block{ padding:10px; }
  .set-entry input{ width:78px; }
  .streak-banner{ padding:14px; gap:10px; flex-wrap:wrap; }
  .week-strip{ margin-left:0; width:100%; justify-content:space-between; }
  .week-cell{ width:auto; flex:1; }
  .topbar-word{ font-size:.95rem; }
  .wx-thumb{ flex-basis:86px; }
}

/* ---------- Flow mode ----------
   Full-screen overlay: looping demo video under a gradient, exercise text
   bottom-left, one action button. Swipe left = next. */
/* Lock BOTH — <html> is the scrolling element, so body-only left the page
   scrollable behind the overlay (and a scrolling page retracts the mobile URL
   bar, growing the visual viewport past the overlay = sliver at the bottom). */
html.flow-open, body.flow-open{ overflow:hidden; height:100%; overscroll-behavior:none; }
.flow{
  /* inset:0 alone — deliberately NOT height:100dvh, which falls short of the
     home-indicator safe area in the installed app and let the page background
     show through as a black strip. The scroll lock below is what keeps the
     browser's URL bar from moving, so dvh isn't needed. The video runs truly
     edge-to-edge and the home indicator floats on top of it. */
  position:fixed; inset:0; z-index:120; background:#000;
  /* none, not pan-y: this surface is swipe-only, and pan-y was handing every
     vertical gesture to the browser to scroll the page underneath */
  touch-action:none; overscroll-behavior:contain; user-select:none;
}
.flow-stage{
  position:absolute; inset:0;
  transition:transform .17s ease, opacity .17s ease;
}
.flow-stage.no-anim{ transition:none; }
.flow-stage.slide-out-l{ transform:translateX(-14%); opacity:0; }
.flow-stage.slide-out-r{ transform:translateX(14%);  opacity:0; }
.flow-stage.slide-in-r{  transform:translateX(14%);  opacity:0; }
.flow-stage.slide-in-l{  transform:translateX(-14%); opacity:0; }
#flow-video{
  position:absolute; inset:0; width:100%; height:100%;
  /* contain, not cover: Doug's clips are framed inconsistently, so cropping
     to fill routinely cuts off the movement. Letterboxing is invisible on
     the black overlay, and biasing upward keeps the clip clear of the
     name/target text at the bottom. */
  object-fit:contain; object-position:center 30%; background:#000;
  /* --flow-scale is computed per clip in fitFlowVideo() */
  transform:scale(var(--flow-scale, 1));
}
/* portrait: growth pushes downward into the dead space under the clip */
@media (orientation: portrait){
  #flow-video.wide{ transform-origin:center 25%; }
}
/* landscape: no upward bias — the clip meets the top and bottom edges, so any
   remaining slack is horizontal and splits evenly */
@media (orientation: landscape){
  #flow-video{ object-position:center center; transform-origin:center center; }
}
.flow-fallback{
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:18px; background:var(--bg, #0B0E12);
}
.flow-fallback img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; opacity:.55;
}
.flow-big{ font-size:5rem; line-height:1; filter:saturate(1.2); }
.flow-ext{
  position:relative; z-index:1; padding:10px 18px; border-radius:999px;
  background:rgba(255,255,255,.14); color:#fff; font-weight:600;
  text-decoration:none; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.flow-shade{
  position:absolute; inset:0; pointer-events:none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.62), transparent 22%),
    /* bottom shade at half strength — Doug often works at the very bottom of
       frame and the heavier fade made him hard to see */
    linear-gradient(to top, rgba(0,0,0,.41), rgba(0,0,0,.18) 34%, transparent 55%);
}
.flow-top{
  position:absolute; top:calc(10px + env(safe-area-inset-top)); left:12px; right:12px;
  display:flex; align-items:center; gap:12px; z-index:2;
}
.flow-close{
  flex:0 0 auto; width:38px; height:38px; border-radius:50%;
  border:none; cursor:pointer; font-size:1rem; color:#fff;
  background:rgba(255,255,255,.16);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.flow-progress{ display:flex; gap:3px; flex:1; }
.flow-progress span{
  flex:1; height:3px; border-radius:2px; background:rgba(255,255,255,.28);
}
.flow-progress span.past{ background:var(--teal); }
.flow-progress span.cur{ background:#fff; }
.flow-info{
  position:absolute; left:0; right:0;
  bottom:calc(14px + env(safe-area-inset-bottom));
  padding:0 18px; z-index:2; color:#fff;
}
.flow-routine{
  font-size:.78rem; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:var(--teal-hi); margin-bottom:4px;
}
.flow-name{ font-size:clamp(1.9rem,6vw,3rem); line-height:1.02; margin:0 0 6px; }
.flow-target{ color:rgba(255,255,255,.85); font-size:.95rem; margin-bottom:14px; }
/* Doug's coaching cue. Capped and scrollable so a long note can never push the
   log button off screen; pan-y lets it scroll internally without leaking to the
   page (which is locked anyway while flow is open). */
.flow-notes{
  margin:0 0 14px; padding-left:10px; border-left:2px solid var(--teal);
  color:rgba(255,255,255,.82); font-size:.84rem; line-height:1.45;
  max-height:20vh; overflow-y:auto;
  touch-action:pan-y; overscroll-behavior:contain;
}
.fn-label{
  display:block; margin-bottom:3px;
  font:700 .62rem var(--body); letter-spacing:.14em;
  text-transform:uppercase; color:var(--teal-hi);
}
.flow-action .flow-log{ box-shadow:0 8px 30px rgba(0,0,0,.45); }
.flow-note{
  text-align:center; padding:12px; border-radius:12px;
  background:rgba(255,255,255,.1); color:rgba(255,255,255,.85);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); font-size:.9rem;
}
.flow-arrow{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:44px; height:44px; border-radius:50%; border:none; cursor:pointer;
  font-size:1.5rem; line-height:1; color:#fff; background:rgba(255,255,255,.14);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  display:none;   /* touch: you swipe */
}
.flow-arrow.prev{ left:14px; }
.flow-arrow.next{ right:14px; }
@media (hover:hover){ .flow-arrow{ display:block; } .flow-arrow.hidden{ display:none; } }
.flow-hint{
  position:absolute; left:50%; bottom:32%; transform:translateX(-50%);
  z-index:3; padding:9px 16px; border-radius:999px; white-space:nowrap;
  background:rgba(0,0,0,.6); color:#fff; font-size:.9rem;
  opacity:0; transition:opacity .4s ease; pointer-events:none;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.flow-hint.show{ opacity:1; }

/* Left-edge swipe rail — landscape-phone replacement for the bottom note pill.
   Hidden everywhere else; portrait keeps the wordy .flow-note. */
.flow-swipe-rail{
  display:none; position:absolute;
  right:calc(10px + env(safe-area-inset-right)); top:50%; transform:translateY(-50%);
  z-index:3; flex-direction:column; align-items:center; gap:10px;
  padding:14px 9px; border-radius:999px; border:0; cursor:pointer;
  background:rgba(0,0,0,.48); color:#fff;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.fsr-arrow{ font-size:1.05rem; line-height:1; animation:fsr-nudge 1.6s ease-in-out infinite; }
.fsr-word{
  writing-mode:vertical-rl; transform:rotate(180deg);   /* reads bottom-up */
  font:700 .68rem var(--body); letter-spacing:.22em;
}
.flow-swipe-rail.logged{ background:rgba(28,181,196,.35); }
.flow-swipe-rail.logged .fsr-arrow{ animation:none; }
@keyframes fsr-nudge{ 0%,100%{ transform:translateX(0); } 50%{ transform:translateX(-4px); } }
@media (prefers-reduced-motion: reduce){ .fsr-arrow{ animation:none; } }

/* ── Flow mode, phone held sideways ──
   Doug often stands at the very bottom of frame, so nothing may sit there:
   the name shrinks and docks top-left under the progress bar, the log button
   tucks bottom-right, the note pill is swapped for the left-edge rail. The
   max-height guard keeps desktop/tablet landscape on the portrait layout. */
@media (orientation: landscape) and (max-height: 520px){
  .flow-info{ display:contents; }   /* children place themselves on the stage */
  .flow-text{
    position:absolute; z-index:2; color:#fff;
    top:calc(46px + env(safe-area-inset-top));
    left:calc(18px + env(safe-area-inset-left)); right:18px;
    max-width:72vw;
  }
  .flow-routine{ font-size:.6rem; margin-bottom:2px; }
  .flow-name{ font-size:clamp(1.05rem, 6vh, 1.5rem); margin-bottom:2px; }
  .flow-target{ font-size:.78rem; margin-bottom:0; }
  .flow-info .flow-action{
    position:absolute; z-index:2;
    right:calc(14px + env(safe-area-inset-right));
    bottom:calc(10px + env(safe-area-inset-bottom));
    left:auto; max-width:46vw;
  }
  .flow-action .flow-log{ width:auto; }
  .flow-note{ display:none; }
  .flow-notes{ display:none; }   /* no room sideways — portrait carries the cue */
  .flow-swipe-rail:not(.hidden){ display:flex; }
}

/* ---------- Coach dashboard: radar, sort, glance ---------- */
.radar-block{ margin-bottom:22px; }
.radar-list{ display:flex; flex-direction:column; gap:8px; }
.radar-clear{
  padding:12px 14px; border-radius:14px; background:var(--card);
  border:1.5px solid var(--line); color:var(--muted); font-size:.9rem;
}
.radar-card{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  padding:11px 14px; border-radius:14px; cursor:pointer;
  background:var(--card); border:1.5px solid var(--line); border-left-width:4px;
  color:var(--ink); transition:transform .15s ease, border-color .15s ease;
}
.radar-card:hover{ transform:translateY(-1px); }
.radar-card b{ flex:0 0 auto; }
.radar-card > span:not(.rc-chevron){ flex:1; color:var(--muted); font-size:.85rem; }
.radar-card.sev3{ border-left-color:var(--red); }
.radar-card.sev2{ border-left-color:var(--yellow); }
.radar-card.sev1{ border-left-color:var(--teal); }

.roster-sort{ display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.sort-chip{
  padding:7px 14px; border-radius:999px; font-size:.82rem; font-weight:600;
  background:var(--card); color:var(--muted);
  border:1.5px solid var(--line); cursor:pointer;
}
.sort-chip.sel{ color:#04252a; background:var(--teal); border-color:var(--teal); }
.vl-modes{ display:flex; gap:8px; flex-wrap:wrap; margin:0 0 14px; }
.rc-nut{ margin-left:6px; font-size:.85rem; }

/* client page: at-a-glance */
.glance-flags{ display:flex; flex-wrap:wrap; gap:8px; }
.glance-flags:not(:empty){ margin-bottom:14px; }
.flag{
  padding:6px 12px; border-radius:999px; font-size:.8rem; font-weight:600;
  background:var(--card-2); color:var(--ink);
}
.flag.sev3{ color:#ff8d85; background:rgba(224,57,46,.14); }
.flag.sev2{ color:var(--yellow); background:rgba(255,201,51,.1); }
.flag.sev1{ color:var(--teal-hi); background:rgba(28,181,196,.1); }
.flag.ok{ color:var(--teal-hi); background:rgba(28,181,196,.1); }

.glance-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
}
@media (max-width:640px){ .glance-grid{ grid-template-columns:repeat(2,1fr); } }
.glance-tile{
  display:flex; flex-direction:column; gap:2px;
  padding:12px 14px; border-radius:14px; background:var(--card-2);
  border-left:3px solid transparent;
}
.glance-tile.good{ border-left-color:var(--teal); }
.glance-tile.part{ border-left-color:var(--yellow); }
.glance-tile.zero{ border-left-color:var(--red); }
.gt-label{
  font-size:.68rem; font-weight:700; letter-spacing:.1em;
  text-transform:uppercase; color:var(--muted);
}
.gt-value{ font-size:1.5rem; line-height:1.15; font-family:var(--mono); }
.gt-value i{ font-style:normal; font-size:1rem; color:var(--muted); }
.gt-sub{ font-size:.75rem; color:var(--muted); line-height:1.35; }

.weekbars{
  display:flex; align-items:flex-end; gap:6px; padding:4px 2px 0;
}
.wb-col{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:4px;
}
.wb-count{ font-family:var(--mono); font-size:.7rem; color:var(--muted); min-height:1em; }
.wb-bar{
  width:100%; max-width:38px; border-radius:6px 6px 2px 2px;
  background:var(--card-2); border:1px solid var(--line);
}
.wb-bar.hit{ background:var(--teal-deep); border-color:var(--teal); }
.wb-bar.cur{ outline:1.5px solid var(--teal-hi); }
.wb-lab{ font-size:.65rem; color:var(--muted); font-family:var(--mono); }
.glance-hitline{ margin-top:8px; font-size:.8rem; }

/* ---------- Nutrition daily check-in ---------- */
.nut-ci-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:4px;
}
@media (max-width:560px){ .nut-ci-grid{ grid-template-columns:repeat(2,1fr); } }
.nut-ci-feedback{ display:flex; flex-wrap:wrap; gap:8px; margin:2px 0 12px; }
.nut-ci-feedback:empty{ margin:0 0 8px; }
.ci-chip{
  padding:5px 10px; border-radius:999px; font-size:.78rem; font-weight:600;
  background:var(--card-2); color:var(--muted);
}
.ci-chip.hit{ color:var(--teal-hi); background:rgba(28,181,196,.12); }
.ci-chip.under, .ci-chip.over{ color:var(--yellow); background:rgba(255,201,51,.1); }

/* 7-day strip — one column per day, macro totals colored by status */
.nut-strip{
  display:flex; gap:4px; margin-top:10px; overflow-x:auto; padding-bottom:4px;
}
.ns-day{
  flex:1; min-width:52px; display:flex; flex-direction:column; gap:3px;
  align-items:center; padding:8px 4px; border-radius:12px; background:var(--card-2);
}
.ns-day.today{ outline:1.5px solid var(--teal-deep); }
.ns-day.ns-legend{ flex:0 0 34px; min-width:34px; background:none; }
.ns-legend .ns-val{ color:var(--muted); font-weight:700; }
.ns-abbr{
  font-size:.65rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); min-height:1em; margin-bottom:2px;
}
.ns-val{
  font-family:var(--mono); font-size:.72rem; line-height:1.3; color:var(--muted);
}
.ns-val.hit{ color:var(--teal-hi); }
.ns-val.under, .ns-val.over{ color:var(--yellow); }
.ns-val.logged{ color:var(--ink); }
#nut-ci-strip .nut-view-label{ margin-top:16px; }

/* entry point on the workout menu */
.flow-cta{
  display:flex; align-items:center; gap:14px; width:100%;
  margin:0 0 16px; padding:14px 16px; border-radius:16px; cursor:pointer;
  border:1.5px solid var(--line); background:var(--card); color:var(--ink);
  text-align:left; transition:border-color .15s ease, transform .15s ease;
}
.flow-cta:hover{ border-color:var(--teal); transform:translateY(-1px); }
.flow-cta-ic{
  flex:0 0 auto; width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--teal); color:#04252a; font-size:.95rem;
}
.flow-cta-body{ flex:1; display:flex; flex-direction:column; gap:2px; }
.flow-cta-body b{ font-size:1rem; }
.flow-cta-body span{ color:var(--muted); font-size:.82rem; }

/* ═══════════ PRINT — nutrition handout ═══════════ */
#print-sheet{ display:none; }
.nut-block-bar .nut-clear{ margin-left:auto; color:var(--muted); }
.nut-block-bar .nut-clear:hover{ color:var(--red); }
@media print{
  @page{ margin:14mm; }
  body.print-nut{ background:#fff !important; color:#111 !important; }
  body.print-nut > *:not(#print-sheet){ display:none !important; }
  body.print-nut #print-sheet{
    display:block; max-width:none; margin:0; padding:0;
    color:#111; font:11.5pt/1.45 Georgia, "Times New Roman", serif;
  }
  body.print-nut #print-sheet *{ color:#111 !important; background:transparent !important; box-shadow:none !important; text-shadow:none !important; animation:none !important; }
  body.print-nut #print-sheet a{ text-decoration:none; }
  body.print-nut #print-sheet .ex-video{ display:none; }
  body.print-nut #print-sheet .ps-head{ display:flex; align-items:center; gap:14px; padding-bottom:10px; margin-bottom:12px; border-bottom:2px solid #111 !important; }
  body.print-nut #print-sheet .ps-logo{ width:64px; height:64px; }
  body.print-nut #print-sheet .ps-head-text{ display:flex; flex-direction:column; }
  body.print-nut #print-sheet .ps-kicker{ font:700 8.5pt/1.2 Arial, sans-serif; letter-spacing:.16em; text-transform:uppercase; color:#555 !important; }
  body.print-nut #print-sheet .ps-title{ font:700 18pt/1.15 Arial, sans-serif; margin:2px 0; }
  body.print-nut #print-sheet .ps-sub{ font:9.5pt/1.2 Arial, sans-serif; color:#555 !important; }
  body.print-nut #print-sheet .ps-foot{ margin-top:18px; padding-top:8px; border-top:1px solid #bbb !important; font:8.5pt Arial, sans-serif; color:#777 !important; text-align:center; }
  body.print-nut #print-sheet .nut-view-label{ font:700 9.5pt/1.2 Arial, sans-serif; letter-spacing:.14em; text-transform:uppercase; margin:16pt 0 6pt; padding-bottom:3pt; border-bottom:1px solid #bbb !important; break-after:avoid; }
  body.print-nut #print-sheet .macro-row{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8pt; }
  body.print-nut #print-sheet .macro-card{ border:1px solid #999 !important; border-radius:6pt; padding:6pt 8pt; break-inside:avoid; }
  body.print-nut #print-sheet .macro-card b{ font-size:14pt; }
  body.print-nut #print-sheet .nut-prose{ white-space:pre-wrap; }
  body.print-nut #print-sheet .nut-list li{ border-bottom:1px dotted #bbb !important; padding:4pt 0; break-inside:avoid; }
  body.print-nut #print-sheet .nl-mark{ width:14pt; height:14pt; border:1px solid #333 !important; border-radius:50%; font-size:8pt; flex:0 0 14pt; }
  body.print-nut #print-sheet .nl-why{ color:#555 !important; font-style:italic; }
  body.print-nut #print-sheet .recipe-list, body.print-nut #print-sheet .supp-list{ display:flex; flex-direction:column; gap:8pt; }
  body.print-nut #print-sheet .recipe-card, body.print-nut #print-sheet .supp-card{ border:1px solid #999 !important; border-radius:6pt; padding:8pt 10pt; break-inside:avoid; }
  body.print-nut #print-sheet .food-groups{ gap:10pt; }
  body.print-nut #print-sheet .food-group{ break-inside:avoid; }
  body.print-nut #print-sheet .food-group > b{ display:block; font:700 11.5pt Arial, sans-serif; margin-bottom:2pt; }
  body.print-nut #print-sheet .food-group-intro{ color:#444 !important; font-style:italic; margin:0 0 4pt; }
  body.print-nut #print-sheet .food-item{ border-bottom:1px dotted #ccc !important; padding:3pt 0; }
  body.print-nut #print-sheet .fi-dot{ border:1px solid #333 !important; }
  body.print-nut #print-sheet .fi-dot.green{ background:#43b75a !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body.print-nut #print-sheet .fi-dot.yellow{ background:#e5b130 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body.print-nut #print-sheet .fi-dot.red{ background:#e0392e !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  body.print-nut #print-sheet .food-legend{ display:flex; gap:14pt; font-size:9pt; margin-bottom:6pt; }
  body.print-nut #print-sheet .lib-art{ border:1px solid #ccc !important; }
  body.print-nut #print-sheet .lib-art img{ filter:none; }
  body.print-nut #print-sheet .meal-timeline::before{ background:#bbb !important; }
  body.print-nut #print-sheet .meal-card{ break-inside:avoid; }
  body.print-nut #print-sheet .meal-ic{ border:1px solid #bbb !important; }
  body.print-nut #print-sheet .meal-body li.alt::before{ color:#777 !important; }
}

/* Profile → "Edit the website" row: teal-accented so it reads as an admin action */
.about-row-admin{
  border-color:rgba(28,181,196,.45);
  background:rgba(28,181,196,.07);
  margin-bottom:10px;
}
.about-row-admin:hover{ border-color:var(--teal); background:rgba(28,181,196,.13); }
.about-row-admin .ar-body b{ color:var(--teal-hi); }
