/*
 * ════════════════════════════════════════════════════════════════
 *   SUPERHUMAN CODE — DESIGN SYSTEM
 *   Version: 1.0.0  |  Palette: Editorial Contrast (Gold)
 *
 *   Pattern: Cream body · Dark AI hero card · Gold accent · Dark nav
 *   Mirrors the landing page's editorial rhythm.
 *
 *   Usage:
 *     <link rel="stylesheet" href="/assets/design-system.css">
 *     <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
 * ════════════════════════════════════════════════════════════════
 */

/* ── Global text-selection lock ──────────────────────────────────
   Disable native iOS text-selection on the entire app. Was making
   onboarding / nutrition / training screens look like editable text
   when the user accidentally long-pressed (Copy / Writing Tools menu
   appearing over a question label).
   Re-enabled only on:
     • <input>, <textarea>, [contenteditable] — typing/editing
     • .selectable — opt-in marker for any surface that should allow
       copy (chat messages, code blocks, etc.)
   ───────────────────────────────────────────────────────────────── */
html, body {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}
input, textarea, [contenteditable], [contenteditable="true"], .selectable, .selectable *,
.msg, .msg-group, .chat-msg, .chat-bubble, .message-bubble {
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  user-select: text;
}


/* ═══════════════════════════════════════════
   0. ACCESSIBILITY — Focus visible styles
═══════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid #7eb8d4;
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════
   1. TOKENS  (CSS Custom Properties)
   Source of truth — change here, changes everywhere.
═══════════════════════════════════════════ */
:root {

  /* ── Core Palette ── */
  --sc-deep:          #1A1714;          /* main dark bg — landing hero */
  --sc-black:         #252525;          /* elevated dark — cards, nav */
  --sc-amber:         #443A35;          /* warm dark — deep cards, muted */
  --sc-dune:          #E4DDCC;          /* primary light text on dark */
  --sc-cream:         #FCFCFB;          /* light page background — Variant A (Linear/Vercel hairline) 2026-05-13 */
  --sc-white:         #FFFFFF;          /* pure white — card surfaces (Variant A) */

  /* ── Gold System ── */
  --sc-gold:          #C9A96E;          /* primary accent — replaces all greens */
  --sc-gold-light:    #D4B87A;          /* lighter gold — gradients, highlights */
  --sc-gold-dark:     #9A7040;          /* darker gold — pressed states */
  --sc-gold-dim:      rgba(201,169,110,0.10);   /* subtle gold bg */
  --sc-gold-border:   rgba(201,169,110,0.22);   /* gold outline */
  --sc-gold-glow:     rgba(201,169,110,0.18);   /* gold shadow/glow */

  /* ── Text Hierarchy ── */
  --sc-text-primary:  #252525;          /* main text on light bg */
  --sc-text-secondary:#6B6560;          /* muted text on light bg */
  --sc-text-subtle:   #9B958E;          /* very muted on light bg */
  --sc-text-on-dark:  #E4DDCC;          /* primary text on dark card */
  --sc-text-dim-dark: rgba(228,221,204,0.52);  /* muted on dark card */

  /* ── Semantic / UI ── */
  --sc-bg-page:       var(--sc-cream);
  --sc-bg-card:       var(--sc-white);
  --sc-bg-card-dark:  var(--sc-black);
  --sc-bg-hero:       var(--sc-deep);
  --sc-bg-nav:        var(--sc-deep);
  --sc-border-card:   #E8E2D6;          /* hairline card border — Variant A 2026-05-13 */
  --sc-border-pill:   #EFE9DE;          /* lighter hairline — inner pills/chips (Variant A) */
  --sc-border-dark:   rgba(228,221,204,0.06);  /* subtle border on dark */

  /* ── Typography ── */
  --sc-font-display:  'Libre Baskerville', 'Baskerville', Georgia, serif;
  --sc-font-body:     'Montserrat', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* ── Border Radius ── */
  --sc-radius-xs:     8px;
  --sc-radius-sm:     12px;
  --sc-radius-md:     16px;
  --sc-radius-lg:     24px;
  --sc-radius-xl:     32px;
  --sc-radius-pill:   999px;
  --sc-radius-card-A: 14px;             /* Variant A canonical card corner radius */

  /* ── Shadows ── */
  --sc-shadow-card:   0 1px 2px rgba(26,23,20,0.04);   /* Variant A hairline-card tiny shadow */
  --sc-shadow-dark:   0 2px 10px rgba(0,0,0,0.35);
  --sc-shadow-gold:   0 4px 20px rgba(201,169,110,0.25);

  /* ── Transitions ── */
  --sc-transition:    0.2s ease;
  --sc-transition-slow: 0.4s ease;

  /* ── Spacing Scale ── */
  --sc-space-xs:  6px;
  --sc-space-sm:  12px;
  --sc-space-md:  18px;
  --sc-space-lg:  24px;
  --sc-space-xl:  36px;

  /* ─────────────────────────────────────────────────────────
     Un-prefixed aliases — lets landing.html + onboarding.html
     use short names (--deep, --gold …) without re-declaring them.
     App pages can use either set interchangeably.
  ───────────────────────────────────────────────────────── */
  --deep:         var(--sc-deep);
  --black:        var(--sc-black);
  --amber:        var(--sc-amber);
  --dune:         var(--sc-dune);
  --cream:        var(--sc-cream);
  --white:        var(--sc-white);
  --gold:         var(--sc-gold);
  --gold-light:   var(--sc-gold-light);
  --gold-dark:    var(--sc-gold-dark);
  --gold-dim:     rgba(201,169,110,0.15);   /* slightly richer than --sc-gold-dim for landing */
  --gray-600:     var(--sc-text-secondary);
  --gray-400:     var(--sc-text-subtle);
  --font-display: var(--sc-font-display);   /* 'Libre Baskerville', Georgia, serif */
  --sc-space-2xl: 56px;

}


/* ═══════════════════════════════════════════
   1b. CROSS-DOCUMENT PAGE TRANSITIONS
   Eliminates the white flash when switching tabs.
   Native: iOS 18+ / Chrome 126+ via @view-transition.
   Fallback: JS adds .sc-leaving for older browsers (see nav-shared.js).
═══════════════════════════════════════════ */

/* Native cross-document transition — browser handles page swap */
@view-transition {
  navigation: auto;
}

/* Content fades out on the old page */
::view-transition-old(root) {
  animation: _sc-fade-out 0.14s ease forwards;
}

/* Content fades in on the new page */
::view-transition-new(root) {
  animation: _sc-fade-in 0.14s ease forwards;
}

@keyframes _sc-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes _sc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* JS fallback for older browsers: fade out before navigate */
body.sc-leaving {
  opacity: 0;
  transition: opacity 0.1s ease;
}

/* Fallback fade-in on page load */
@media (prefers-reduced-motion: no-preference) {
  body {
    animation: _sc-fade-in 0.14s ease forwards;
  }
  /* Suppress the load animation when native view transitions handle it */
  @supports (view-transition-name: none) {
    body { animation: none; }
  }
}


/* ═══════════════════════════════════════════
   2. BASE RESET
═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sc-font-body);
  background: var(--sc-bg-page);
  color: var(--sc-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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


/* ═══════════════════════════════════════════
   3. TYPOGRAPHY
═══════════════════════════════════════════ */

/* Display / Brand headings */
.sc-display {
  font-family: var(--sc-font-display);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sc-display-xl { font-size: 32px; line-height: 1.2; }
.sc-display-lg { font-size: 24px; line-height: 1.25; }
.sc-display-md { font-size: 20px; line-height: 1.3; }
.sc-display-sm { font-size: 16px; line-height: 1.35; }

/* Body type */
.sc-body-lg { font-size: 15px; font-weight: 500; line-height: 1.65; }
.sc-body-md { font-size: 13px; font-weight: 500; line-height: 1.6; }
.sc-body-sm { font-size: 12px; font-weight: 500; line-height: 1.6; }

/* Labels / UI text */
.sc-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sc-label-sm {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Color utilities */
.sc-text-gold    { color: var(--sc-gold); }
.sc-text-dune    { color: var(--sc-dune); }
.sc-text-muted   { color: var(--sc-text-subtle); }
.sc-text-on-dark { color: var(--sc-text-on-dark); }


/* ═══════════════════════════════════════════
   4. PAGE SHELLS
═══════════════════════════════════════════ */

/* Standard light page */
.sc-page {
  min-height: 100vh;
  background: var(--sc-bg-page);
  color: var(--sc-text-primary);
  padding-bottom: 90px; /* bottom nav clearance */
}

/* Dark page (full dark mode) */
.sc-page-dark {
  min-height: 100vh;
  background: var(--sc-deep);
  color: var(--sc-dune);
  padding-bottom: 90px;
}


/* ═══════════════════════════════════════════
   5. CARDS
═══════════════════════════════════════════ */

/* Standard light card — Variant A (Linear/Vercel hairline) 2026-05-13 */
.sc-card {
  background: var(--sc-white);
  border: 1px solid var(--sc-border-card);   /* hairline */
  border-radius: var(--sc-radius-card-A);    /* 14px */
  box-shadow: var(--sc-shadow-card);
  padding: var(--sc-space-md);
}

/* Dark card (AI hero pattern) */
.sc-card-dark {
  background: linear-gradient(155deg, #1A1714 0%, #252525 55%, #2D2823 100%);
  border-radius: var(--sc-radius-lg);
  padding: var(--sc-space-md) var(--sc-space-md) 22px;
  position: relative;
  overflow: hidden;
}
.sc-card-dark::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.14) 0%, transparent 68%);
  pointer-events: none;
}

/* Elevated dark card */
.sc-card-elevated {
  background: var(--sc-black);
  border-radius: var(--sc-radius-md);
  box-shadow: var(--sc-shadow-dark);
  padding: var(--sc-space-md);
}

/* Warm cream card (soft warm bg) */
.sc-card-warm {
  background: #F5F0E8;
  border-radius: var(--sc-radius-md);
  padding: var(--sc-space-md);
}

/* Gold tinted card */
.sc-card-gold {
  background: var(--sc-gold-dim);
  border: 1px solid var(--sc-gold-border);
  border-radius: var(--sc-radius-md);
  padding: var(--sc-space-md);
}


/* ═══════════════════════════════════════════
   6. BUTTONS
═══════════════════════════════════════════ */

/* Primary — gold gradient */
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--sc-radius-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all var(--sc-transition);
  cursor: pointer;
  border: none;
  font-family: var(--sc-font-body);
}

.sc-btn-primary {
  background: linear-gradient(135deg, var(--sc-gold), var(--sc-gold-dark));
  color: var(--sc-deep);
  box-shadow: 0 4px 16px rgba(201,169,110,0.3);
}
.sc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,169,110,0.4);
}
.sc-btn-primary:active {
  transform: translateY(0);
}

/* Secondary — outlined */
.sc-btn-secondary {
  background: transparent;
  color: var(--sc-gold);
  border: 1.5px solid var(--sc-gold-border);
}
.sc-btn-secondary:hover {
  background: var(--sc-gold-dim);
  border-color: var(--sc-gold);
}

/* Ghost — subtle on light */
.sc-btn-ghost {
  background: transparent;
  color: var(--sc-text-secondary);
  border: 1.5px solid var(--sc-border-card);
}
.sc-btn-ghost:hover {
  color: var(--sc-text-primary);
  border-color: #c8bfb5;
}

/* Icon button */
.sc-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sc-white);
  box-shadow: var(--sc-shadow-card);
  transition: all var(--sc-transition);
}
.sc-btn-icon:hover {
  background: var(--sc-gold-dim);
}
.sc-btn-icon svg {
  width: 16px; height: 16px;
  stroke: var(--sc-text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}


/* ═══════════════════════════════════════════
   7. PILLS & BADGES
═══════════════════════════════════════════ */

/* Live badge — AI is active */
.sc-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sc-gold-dim);
  border: 1px solid var(--sc-gold-border);
  border-radius: var(--sc-radius-pill);
  padding: 4px 12px;
}
.sc-badge-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sc-gold);
  flex-shrink: 0;
}
.sc-badge-live-txt {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sc-gold);
}

/* Level badge (XP system) */
.sc-badge-level {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--sc-radius-pill);
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--sc-gold), var(--sc-gold-dark));
  color: var(--sc-deep);
}

/* Streak pill */
.sc-pill-streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--sc-white);
  border: 1px solid var(--sc-gold-border);
  border-radius: var(--sc-radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--sc-gold);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Tag pills (mission categories) */
.sc-tag {
  padding: 4px 9px;
  border-radius: var(--sc-radius-pill);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sc-tag-body { background: rgba(201,169,110,0.10); color: var(--sc-gold-dark); }
.sc-tag-biz  { background: #E8E2D6; color: #6B6560; }
.sc-tag-mind { background: rgba(212,184,122,0.13); color: var(--sc-gold-dark); }
.sc-tag-rest { background: #EDF4F0; color: #5A897A; }
.sc-tag-gold { background: var(--sc-gold-dim); color: var(--sc-gold); border: 1px solid var(--sc-gold-border); }


/* ═══════════════════════════════════════════
   8. PROGRESS BARS
═══════════════════════════════════════════ */

/* Micro progress bar (vitals cards) */
.sc-bar-track {
  height: 3px;
  border-radius: var(--sc-radius-pill);
  background: var(--sc-border-card);
  overflow: hidden;
}

.sc-bar-fill {
  height: 100%;
  border-radius: var(--sc-radius-pill);
  background: linear-gradient(90deg, var(--sc-gold), var(--sc-gold-light));
  transition: width 0.6s ease;
}

/* XP progress bar */
.sc-xp-track {
  height: 7px;
  border-radius: var(--sc-radius-pill);
  background: var(--sc-border-card);
  overflow: hidden;
}

.sc-xp-fill {
  height: 100%;
  border-radius: var(--sc-radius-pill);
  background: linear-gradient(90deg, var(--sc-gold), var(--sc-gold-light));
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ring / circular progress — use as CSS custom property */
.sc-ring {
  border-radius: 50%;
  background: conic-gradient(
    var(--sc-gold) calc(var(--pct, 70) * 1%),
    var(--sc-border-card) 0
  );
}


/* ═══════════════════════════════════════════
   9. MISSION / TASK ITEMS
═══════════════════════════════════════════ */

.sc-mission {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--sc-white);
  border-radius: var(--sc-radius-md);
  padding: 13px 14px;
  box-shadow: var(--sc-shadow-card);
  transition: all var(--sc-transition);
}
.sc-mission:active {
  transform: scale(0.99);
}

/* Checkbox */
.sc-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--sc-border-card);
  flex-shrink: 0;
  transition: all var(--sc-transition);
}
.sc-check.done {
  background: var(--sc-gold);
  border-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-check.done::after {
  content: '';
  width: 11px; height: 7px;
  border-left: 2.2px solid var(--sc-cream);
  border-bottom: 2.2px solid var(--sc-cream);
  transform: rotate(-45deg) translateY(-1px);
}

.sc-mission-body { flex: 1; min-width: 0; }
.sc-mission-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sc-text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}
.sc-mission-name.done { text-decoration: line-through; color: var(--sc-text-subtle); }
.sc-mission-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--sc-text-subtle);
}


/* ═══════════════════════════════════════════
   10. VITALS / METRIC CARDS
═══════════════════════════════════════════ */

.sc-vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sc-vital {
  background: var(--sc-white);
  border-radius: 18px;
  padding: 14px 12px 13px;
  box-shadow: var(--sc-shadow-card);
}

.sc-vital-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc-text-subtle);
  margin-bottom: 7px;
}

.sc-vital-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1;
  color: var(--sc-text-primary);
}

.sc-vital-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--sc-gold);
  margin-top: 3px;
  margin-bottom: 8px;
}


/* ═══════════════════════════════════════════
   11. BOTTOM NAVIGATION
═══════════════════════════════════════════ */

/* FLOATING bottom nav — single source of truth so ALL client tabs (command/perform/
   nutrition/grow) are IDENTICAL and can't drift (operator 2026-06-06: it must be the
   same floating pill, same position, in every tab). Lifted off the bottom + side edges;
   env-safe floor so it stays lifted even when env(safe-area-inset-bottom)=0 on the
   WebView/preview. Per-THEME colors live in the skins; this shape never changes per tab.
   Coach pages do not use .sc-bottom-nav, so this is client-only. */
.sc-bottom-nav {
  position: fixed;
  left: 26px; right: 26px;
  bottom: calc(max(env(safe-area-inset-bottom, 0px), 18px) + 14px);
  width: auto;
  height: auto;
  min-height: 60px;
  background: var(--sc-deep);
  border: 0;
  border-radius: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px;
  z-index: 100;
  box-shadow: 0 8px 28px -8px rgba(20,18,16,.45), 0 2px 8px rgba(20,18,16,.22);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sc-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(228,221,204,0.28);
  text-decoration: none;
  transition: color var(--sc-transition);
  position: relative;   /* sit ABOVE the liquid pill */
  z-index: 1;
}
/* LIQUID-GLASS active pill (operator 2026-06-06) — a glassy lozenge behind the active
   tab that slides + stretches between tabs (driven by assets/sc-nav-liquid.js). Glass on
   the dark nav; skins may repaint --sc-nav-pill-bg. Overshoot easing + the JS width-
   stretch give the "liquid" morph. */
.sc-nav-pill {
  position: absolute;
  top: 7px; bottom: 7px;
  left: 0; width: 0;
  border-radius: 20px;
  z-index: 0;
  background: var(--sc-nav-pill-bg, rgba(255,255,255,0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 2px 10px rgba(0,0,0,0.20);
  backdrop-filter: blur(6px) saturate(1.25);
  -webkit-backdrop-filter: blur(6px) saturate(1.25);
  pointer-events: none;
  transition: left .44s cubic-bezier(.34,1.56,.64,1), width .44s cubic-bezier(.34,1.56,.64,1);
}
.sc-nav-item svg {
  width: 22px; height: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke-width var(--sc-transition);
}
.sc-nav-item.active {
  color: var(--sc-gold);
}
.sc-nav-item.active svg {
  stroke-width: 2.3;
}
.sc-nav-item:active { opacity: 0.7; }


/* ═══════════════════════════════════════════
   12. CAPTURE / CTA BANNER
═══════════════════════════════════════════ */

.sc-capture {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--sc-radius-lg);
  padding: 18px;
  background: linear-gradient(135deg, var(--sc-gold) 0%, var(--sc-gold-dark) 100%);
  box-shadow: var(--sc-shadow-gold);
  cursor: pointer;
  transition: all var(--sc-transition);
}
.sc-capture:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(201,169,110,0.35); }
.sc-capture:active { transform: scale(0.99); }

.sc-capture-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: rgba(26,23,20,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sc-capture-body { flex: 1; }
.sc-capture-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--sc-deep);
  margin-bottom: 3px;
}
.sc-capture-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(26,23,20,0.5);
}
.sc-capture-arrow {
  font-size: 22px;
  color: rgba(26,23,20,0.35);
}


/* ═══════════════════════════════════════════
   13. SECTION HEADERS
═══════════════════════════════════════════ */

.sc-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sc-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sc-text-primary);
}
.sc-section-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-gold);
}

/* On dark background */
.sc-section-title-light { color: var(--sc-dune); }


/* ═══════════════════════════════════════════
   14. INPUT FIELDS
═══════════════════════════════════════════ */

.sc-input-wrap { display: flex; flex-direction: column; gap: 6px; }
.sc-input-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-text-subtle);
}
.sc-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--sc-radius-sm);
  border: 1.5px solid var(--sc-border-card);
  background: var(--sc-white);
  font-size: 14px;
  font-weight: 500;
  color: var(--sc-text-primary);
  font-family: var(--sc-font-body);
  outline: none;
  transition: border-color var(--sc-transition), box-shadow var(--sc-transition);
}
.sc-input:focus {
  border-color: var(--sc-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}
.sc-input::placeholder { color: var(--sc-text-subtle); }

.sc-input-dark {
  background: var(--sc-black);
  border-color: rgba(228,221,204,0.08);
  color: var(--sc-dune);
}
.sc-input-dark:focus {
  border-color: var(--sc-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
}
.sc-input-dark::placeholder { color: var(--sc-amber); }


/* ═══════════════════════════════════════════
   15. AVATAR
═══════════════════════════════════════════ */

.sc-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sc-gold), var(--sc-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--sc-deep);
  flex-shrink: 0;
}

.sc-avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.sc-avatar-lg { width: 54px; height: 54px; font-size: 20px; }


/* ═══════════════════════════════════════════
   16. DIVIDERS
═══════════════════════════════════════════ */

.sc-divider {
  height: 1px;
  background: var(--sc-border-card);
  margin: var(--sc-space-md) 0;
}
.sc-divider-dark {
  height: 1px;
  background: var(--sc-border-dark);
  margin: var(--sc-space-md) 0;
}


/* ═══════════════════════════════════════════
   17. NOTIFICATION BANNER
═══════════════════════════════════════════ */

.sc-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sc-gold-dim);
  border: 1px solid var(--sc-gold-border);
  border-radius: var(--sc-radius-md);
  padding: 14px 18px;
  text-decoration: none;
  transition: all var(--sc-transition);
}
.sc-banner:hover {
  background: rgba(201,169,110,0.15);
  border-color: var(--sc-gold);
}
.sc-banner-icon { font-size: 22px; flex-shrink: 0; }
.sc-banner-body { flex: 1; }
.sc-banner-title { font-size: 14px; font-weight: 700; color: var(--sc-gold); margin-bottom: 2px; }
.sc-banner-sub   { font-size: 12px; font-weight: 500; color: var(--sc-text-subtle); }
.sc-banner-arr   { color: var(--sc-gold); font-size: 20px; }


/* ═══════════════════════════════════════════
   18. PAGE HEADER (app top bar)
═══════════════════════════════════════════ */

.sc-app-header {
  padding: 8px var(--sc-space-md) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sc-bg-page);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sc-app-logo {
  font-family: var(--sc-font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--sc-gold);
  letter-spacing: 0.04em;
}

.sc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ═══════════════════════════════════════════
   19. EMPTY STATE
═══════════════════════════════════════════ */

.sc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.sc-empty-icon { font-size: 40px; opacity: 0.4; }
.sc-empty-title {
  font-family: var(--sc-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--sc-text-primary);
}
.sc-empty-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-text-subtle);
  line-height: 1.6;
  max-width: 260px;
}


/* ═══════════════════════════════════════════
   20. LOADING STATES
═══════════════════════════════════════════ */

@keyframes sc-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.sc-skeleton {
  border-radius: 8px;
  background: var(--sc-border-card);
  animation: sc-pulse 1.8s ease-in-out infinite;
}

@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

.sc-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--sc-gold-border);
  border-top-color: var(--sc-gold);
  border-radius: 50%;
  animation: sc-spin 0.7s linear infinite;
}


/* ═══════════════════════════════════════════
   21. UTILITY CLASSES
═══════════════════════════════════════════ */

/* Layout */
.sc-flex         { display: flex; }
.sc-flex-center  { display: flex; align-items: center; justify-content: center; }
.sc-flex-between { display: flex; align-items: center; justify-content: space-between; }
.sc-flex-col     { display: flex; flex-direction: column; }
.sc-gap-xs  { gap: var(--sc-space-xs); }
.sc-gap-sm  { gap: var(--sc-space-sm); }
.sc-gap-md  { gap: var(--sc-space-md); }

/* Padding */
.sc-px { padding-left: var(--sc-space-md); padding-right: var(--sc-space-md); }
.sc-py { padding-top: var(--sc-space-md); padding-bottom: var(--sc-space-md); }
.sc-p  { padding: var(--sc-space-md); }

/* Truncation */
.sc-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gold gradient text */
.sc-gold-gradient {
  background: linear-gradient(135deg, var(--sc-gold), var(--sc-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hidden until JS sets display */
.sc-hidden { display: none !important; }

/* Tap-safe touch */
.sc-tappable {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
}


/* ═══════════════════════════════════════════
   22. APP SHELL + DRAWER (migrated from nav-shared.js)
═══════════════════════════════════════════ */

      /* ── Overlay ── (light/cream redesign 2026-05-15) */
      .drawer-overlay {
        position: fixed; inset: 0;
        background: rgba(37,37,37,0.32);
        z-index: 900;
        opacity: 0; pointer-events: none;
        transition: opacity 0.3s;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
      }
      .drawer-overlay.show { opacity: 1; pointer-events: all; }

      /* ── Side Drawer ── */
      .side-drawer {
        position: fixed; top: 0; right: 0;
        width: 300px; max-width: 90vw;
        height: 100vh;
        height: 100dvh;
        background: #FEFEFE;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        overflow-y: auto; overflow-x: hidden;
        display: flex; flex-direction: column;
        box-shadow: -8px 0 40px rgba(0,0,0,0.12);
        border-left: 1px solid #E4DDCC;
      }
      .side-drawer.open { transform: translateX(0); }

      /* ── Drawer Header ── */
      .drawer-header {
        display: flex; align-items: flex-start; gap: 14px;
        /* SH15: notch-safe identity block */
        padding: max(52px, calc(env(safe-area-inset-top, 0px) + 44px)) 20px 20px;
        border-bottom: 1px solid #F1ECE2;
        flex-shrink: 0;
        background: #FEFEFE;
      }
      .drawer-avatar {
        width: 52px; height: 52px; border-radius: 50%;
        background: linear-gradient(135deg, #C9A96E, #9A7040);
        display: flex; align-items: center; justify-content: center;
        font-family: "Libre Baskerville", Georgia, serif;
        font-size: 20px; font-weight: 700; color: #1A1714;
        line-height: 1; text-align: center;
        flex-shrink: 0;
        box-shadow: 0 6px 16px rgba(154,112,64,0.28);
      }
      .drawer-user-info { flex: 1; min-width: 0; padding-top: 3px; }
      .drawer-user-name {
        font-family: "Libre Baskerville", Georgia, serif;
        font-size: 19px; font-weight: 700;
        color: #252525; margin-bottom: 4px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      }
      .drawer-user-role {
        font-size: 10px; font-weight: 800; color: #9B928B;
        letter-spacing: .08em; text-transform: uppercase;
      }
      /* SH15: Premium Plan status chip */
      .drawer-plan-chip {
        display: inline-flex; align-items: center; gap: 6px;
        margin-top: 10px;
        background: #FBF1DE;
        border: 1px solid #EBDDBE;
        border-radius: 999px;
        padding: 5px 12px;
        font-size: 11px; font-weight: 800;
        letter-spacing: .04em;
        color: #9A7040;
      }
      .drawer-plan-dot {
        width: 6px; height: 6px; border-radius: 50%;
        background: #C9A96E;
      }
      .drawer-close-btn {
        width: 34px; height: 34px; border-radius: 50%;
        background: #FAF8F4;
        border: 1px solid #E4DDCC; cursor: pointer;
        font-size: 13px; color: #252525;
        flex-shrink: 0; display: flex; align-items: center; justify-content: center;
        transition: all 0.2s;
      }
      .drawer-close-btn:hover { background: #F1ECE2; color: #252525; }

      /* ── Drawer Body ── */
      .drawer-body { flex: 1; padding: 12px 12px 40px; overflow-y: auto; background: #FAF8F4; }

      .drawer-section-label {
        font-size: 9px; font-weight: 800;
        letter-spacing: 0.2em; text-transform: uppercase;
        color: #C9A96E;
        padding: 14px 8px 6px;
      }
      .drawer-link {
        display: flex; align-items: center; gap: 12px;
        padding: 12px 14px; border-radius: 12px;
        text-decoration: none;
        font-size: 14px; font-weight: 600; color: #252525;
        transition: all 0.18s; margin-bottom: 4px;
        background: #FEFEFE;
        border: 1px solid #F1ECE2;
      }
      .drawer-link:hover, .drawer-link:active {
        background: #FAF8F4;
        border-color: #E4DDCC;
        color: #252525;
      }
      .drawer-link-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
      .drawer-link-lab { color: #C9A96E; }
      .drawer-link-lab:hover { color: #9A7040; }

      .drawer-divider {
        height: 1px; background: #E4DDCC;
        margin: 12px 8px;
      }
      .drawer-signout-btn {
        width: 100%; padding: 12px 14px; border-radius: 12px;
        background: #FEFEFE;
        border: 1px solid #E4DDCC;
        font-size: 13px; font-weight: 700; color: #C0392B;
        cursor: pointer; text-align: left;
        transition: all 0.2s; margin-top: 10px;
      }
      .drawer-signout-btn:hover {
        background: #FCEFEC; border-color: #F4D2CB; color: #C0392B;
      }

      /* ── App Shell ── */
      html, body { height: 100%; }
      body {
        margin: 0;
        font-family: 'Montserrat', -apple-system, 'Segoe UI', sans-serif;
        background: #FCFCFB;
        color: #252525;
        -webkit-font-smoothing: antialiased;
      }
      /* Only lock scroll on app tab pages, not landing.html */
      body:has(.app-shell) { overflow: hidden; }
      .app-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 100svh;
        display: flex; flex-direction: column;
        max-width: 480px; margin: 0 auto;
        position: relative;
        background: #FCFCFB;
        overflow: hidden;
      }
      .app-topbar {
        display: flex; align-items: center; justify-content: center;
        /* operator 2026-06-12 (round 2): brand text tucks a touch INTO the
           inset — env() reports the island's bottom edge but the visual dead
           zone ends slightly higher, so -8px reads "right after the dead
           zone" on device. 40px floor covers env=0 contexts (preview iframe). */
        padding: max(40px, calc(env(safe-area-inset-top, 0px) - 8px)) 20px 8px;
        min-height: 0;
        flex-shrink: 0;
        background: #FCFCFB;
        position: relative;
      }
      .app-logo {
        position: relative;
        left: auto; top: auto; transform: none;
        display: flex; align-items: center; gap: 8px;
        font-family: 'Montserrat', -apple-system, 'Segoe UI', sans-serif;
        font-size: 12px; font-weight: 800;
        color: #252525; letter-spacing: 0.13em;
        text-transform: uppercase;
        white-space: nowrap;
        pointer-events: none;
      }
      .app-logo-mark {
        width: 26px; height: 26px; flex-shrink: 0;
      }
      .hamburger-btn {
        width: 38px; height: 38px; border-radius: 50%;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: none; cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        flex-direction: column; gap: 4px;
        padding: 0; transition: all 0.2s;
        position: absolute;
        right: 16px;
        top: calc(50% + 14px);
        transform: translateY(-50%);
        z-index: 2;
      }
      .hamburger-btn span {
        display: block; width: 16px; height: 2px;
        background: #6B6560; border-radius: 2px;
        transition: all 0.2s;
      }
      .hamburger-btn:hover { background: #F5F0E8; }
      .hamburger-btn:hover span { background: #C9A96E; }

      .page-scroll {
        flex: 1;
        overflow-y: auto; overflow-x: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px;
      }
      .page-scroll::-webkit-scrollbar { display: none; }

      /* ── Bottom Nav — FLOATING (single source; matches the .sc-bottom-nav base
         at the top of this file so ALL client tabs are identical). This later
         duplicate used to force position:absolute/height:82 (full-width) which
         made perform/brain/grow NON-floating while command floated. Now floating
         everywhere. (operator 2026-06-06) ── */
      .sc-bottom-nav {
        position: fixed;
        left: 26px; right: 26px;
        bottom: calc(max(env(safe-area-inset-bottom, 0px), 18px) + 14px);
        width: auto; height: auto; min-height: 60px;
        background: #1A1714;
        border: 0;
        border-radius: 28px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 8px 6px;
        box-shadow: 0 8px 28px -8px rgba(20,18,16,.45), 0 2px 8px rgba(20,18,16,.22);
        overflow: hidden;
        z-index: 100;
      }
      .sc-nav-item {
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 4px; font-size: 10px; font-weight: 600;
        color: rgba(228,221,204,0.28);
        text-decoration: none; transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
      }
      .sc-nav-item svg {
        width: 22px; height: 22px;
        stroke: currentColor; fill: none;
        stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
        transition: stroke-width 0.2s;
      }
      .sc-nav-item.active { color: #C9A96E; }
      .sc-nav-item.active svg { stroke-width: 2.3; }
      .sc-nav-item:active { opacity: 0.7; }

      /* ── Common card patterns ── */
      .hero-card {
        margin: 0 18px 16px;
        border-radius: 22px; padding: 20px 20px 22px;
        background: linear-gradient(155deg, #1A1714 0%, #252525 55%, #2D2823 100%);
        position: relative; overflow: hidden;
      }
      .hero-card::before {
        content: '';
        position: absolute; top: -40px; right: -40px;
        width: 160px; height: 160px; border-radius: 50%;
        background: radial-gradient(circle, rgba(201,169,110,0.14) 0%, transparent 68%);
        pointer-events: none;
      }
      .live-badge {
        display: inline-flex; align-items: center; gap: 6px;
        background: rgba(201,169,110,0.08);
        border: 1px solid rgba(201,169,110,0.22);
        border-radius: 999px; padding: 4px 12px;
        margin-bottom: 12px;
      }
      .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #C9A96E; flex-shrink: 0; }
      .live-txt { font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #C9A96E; }
      .hero-greeting {
        font-family: 'Libre Baskerville', Georgia, serif;
        font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
        color: #E4DDCC; margin-bottom: 8px; position: relative; z-index: 1;
      }
      .hero-msg {
        font-size: 13px; font-weight: 500; line-height: 1.65;
        color: rgba(228,221,204,0.52); position: relative; z-index: 1;
      }
      .hero-msg strong { color: rgba(228,221,204,0.9); }
      .hero-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 14px 0; }
      .hero-next {
        display: flex; align-items: center; gap: 8px;
        font-size: 11px; font-weight: 700; color: #C9A96E;
      }
      .hero-next-dot { width: 4px; height: 4px; border-radius: 50%; background: #C9A96E; }

      /* Metric cards */
      .metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 18px 16px; }
      .metric-card {
        background: #fff; border-radius: 18px;
        padding: 14px 12px 13px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
      }
      .metric-lbl {
        font-size: 9.5px; font-weight: 700;
        letter-spacing: 0.1em; text-transform: uppercase;
        color: #9B958E; margin-bottom: 7px;
      }
      .metric-val {
        font-size: 24px; font-weight: 900;
        letter-spacing: -0.8px; line-height: 1; color: #252525;
      }
      .metric-sub { font-size: 10px; font-weight: 600; color: #C9A96E; margin-top: 3px; margin-bottom: 8px; }
      .bar-track { height: 3px; border-radius: 999px; background: #E8E2D6; overflow: hidden; }
      .bar-fill {
        height: 100%; border-radius: 999px;
        background: linear-gradient(90deg, #C9A96E, #D4B87A);
        transition: width 0.6s ease;
      }

      /* Section header */
      .sec-hd {
        display: flex; align-items: center; justify-content: space-between;
        padding: 4px 22px 12px;
      }
      .sec-title { font-size: 11px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: #252525; }
      .sec-link { font-size: 11px; font-weight: 600; color: #C9A96E; text-decoration: none; }

      /* White content card */
      .content-card {
        margin: 0 18px; border-radius: 18px;
        background: #fff; padding: 14px 16px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        margin-bottom: 12px;
      }
      .content-card-title { font-size: 13px; font-weight: 800; color: #252525; margin-bottom: 2px; }
      .content-card-sub { font-size: 11px; color: #9B958E; line-height: 1.55; }

      /* Row divider */
      .card-row {
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        padding: 10px 0; border-top: 1px solid #F3EDE7;
      }
      .card-row:first-of-type { border-top: none; }
      .card-row b { font-size: 13px; color: #252525; font-weight: 700; }
      .card-row small { display: block; font-size: 11px; color: #9B958E; margin-top: 2px; }
      .mini-btn {
        border: 1px solid #E6DDD7; border-radius: 999px;
        background: #fff; font-size: 11px; font-weight: 700;
        color: #776961; padding: 6px 12px; white-space: nowrap;
        cursor: pointer; transition: all 0.2s; flex-shrink: 0;
        font-family: inherit;
      }
      .mini-btn:hover { background: rgba(201,169,110,0.08); border-color: #C9A96E; color: #C9A96E; }
      .mini-btn:active { transform: scale(0.97); }

      /* Capture CTA */
      .capture-cta {
        margin: 0 18px 14px;
        display: flex; align-items: center; gap: 14px;
        border-radius: 20px; padding: 18px;
        background: linear-gradient(135deg, #C9A96E 0%, #9A7040 100%);
        box-shadow: 0 4px 20px rgba(201,169,110,0.25);
        text-decoration: none; cursor: pointer;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
      }
      .capture-cta:active { transform: scale(0.99); }
      .capture-icon {
        width: 44px; height: 44px; border-radius: 13px;
        background: rgba(26,23,20,0.18);
        display: flex; align-items: center; justify-content: center;
        font-size: 20px; flex-shrink: 0;
      }
      .capture-body { flex: 1; }
      .capture-title { font-size: 14px; font-weight: 800; color: #1A1714; margin-bottom: 3px; }
      .capture-sub { font-size: 11px; font-weight: 500; color: rgba(26,23,20,0.5); }
      .capture-arr { font-size: 22px; color: rgba(26,23,20,0.35); }

      /* XP card */
      .xp-card { margin: 0 18px 28px; }
      .xp-inner {
        background: #fff; border-radius: 18px; padding: 14px 16px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
      }
      .xp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
      .xp-left { display: flex; align-items: center; gap: 8px; }
      .xp-badge {
        font-size: 9px; font-weight: 800; padding: 3px 10px;
        border-radius: 999px; letter-spacing: 0.08em;
        background: linear-gradient(135deg, #C9A96E, #9A7040); color: #1A1714;
      }
      .xp-lvl-name { font-size: 13px; font-weight: 800; color: #252525; }
      .xp-pts { font-size: 11px; font-weight: 600; color: #9B958E; }
      .xp-bar-track { height: 7px; border-radius: 999px; background: #E8E2D6; overflow: hidden; }
      .xp-bar-fill {
        height: 100%; border-radius: 999px;
        background: linear-gradient(90deg, #C9A96E, #D4B87A);
        transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
      }

      /* Date row */
      .date-row { padding: 6px 22px 14px; display: flex; align-items: center; gap: 10px; }
      .date-text { font-size: 12px; font-weight: 600; color: #6B6560; }
      .streak-pill {
        display: inline-flex; align-items: center; gap: 5px;
        background: #fff; border: 1px solid rgba(201,169,110,0.28);
        border-radius: 999px; padding: 4px 12px;
        font-size: 11px; font-weight: 800; color: #C9A96E;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
      }

      /* Inner segmented control */
      .seg-control {
        margin: 0 18px 14px;
        padding: 4px; border-radius: 13px;
        background: #EDE7E1;
        display: grid; gap: 4px;
      }
      .seg-control.three { grid-template-columns: repeat(3, 1fr); }
      .seg-control.two { grid-template-columns: repeat(2, 1fr); }
      .seg-btn {
        border: none; border-radius: 10px;
        font-size: 12px; font-weight: 700;
        color: #A4978F; padding: 9px 6px;
        background: transparent; cursor: pointer;
        transition: all 0.2s; font-family: inherit;
      }
      .seg-btn.active {
        background: #fff; color: #252525;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      }

      /* Empty state */
      .empty-state {
        text-align: center; padding: 40px 24px;
        display: flex; flex-direction: column;
        align-items: center; gap: 10px;
      }
      .empty-icon { font-size: 36px; opacity: 0.4; }
      .empty-title { font-size: 16px; font-weight: 700; color: #252525; }
      .empty-sub { font-size: 12px; color: #9B958E; line-height: 1.6; max-width: 240px; }
      .empty-btn {
        margin-top: 4px;
        padding: 12px 24px; border-radius: 999px;
        background: linear-gradient(135deg, #C9A96E, #9A7040);
        color: #1A1714; font-size: 13px; font-weight: 700;
        border: none; cursor: pointer; font-family: inherit;
        box-shadow: 0 4px 16px rgba(201,169,110,0.3);
        transition: all 0.2s;
      }

      /* Skeleton loader */
      @keyframes sc-pulse { 0%,100%{opacity:.3}50%{opacity:.7} }
      .skeleton {
        border-radius: 8px; background: #E8E2D6;
        animation: sc-pulse 1.8s ease-in-out infinite;
      }

/* ═══════════════════════════════════════════
   WORKSHOP PREVIEW — additive overrides
   Codified 2026-05-13. When a page is iframed inside admin-workshop.html's
   live-preview pane (URL contains ?workshop=preview, page sets
   data-workshop-preview="1" on <html>), coaches must see the real bottom-tab
   navigation AND must NOT see first-run wizards / journey overlays / spotlights.
═══════════════════════════════════════════ */
body[data-workshop="preview"] .sc-bottom-nav {
  display: grid !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
}
body[data-workshop="preview"] #starter-workout-section,
body[data-workshop="preview"] .journey-overlay,
body[data-workshop="preview"] .journey-card,
body[data-workshop="preview"] [data-journey-step],
body[data-workshop="preview"] .onboarding-overlay,
body[data-workshop="preview"] .spotlight,
body[data-workshop="preview"] .introjs-overlay,
body[data-workshop="preview"] .introjs-helperLayer,
body[data-workshop="preview"] .introjs-tooltip,
body[data-workshop="preview"] .swo-sheet,
body[data-workshop="preview"] .swo-backdrop,
body[data-workshop="preview"] .habit-wizard-backdrop,
body[data-workshop="preview"] .habit-wizard-popover,
body[data-workshop="preview"] .coach-mark,
body[data-workshop="preview"] .tooltip-overlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* workshop-lane-D-palette-as-theme (codified 2026-05-18)
   When in workshop preview mode, consume the new --ws-* vars deep enough
   that swapping palettes feels like swapping apps, not buttons. Scoped
   strictly to body[data-workshop="preview"] so production is untouched. */
body[data-workshop="preview"] body {
  font-family: var(--ws-font-body, inherit);
  line-height: var(--ws-line-height, 1.55);
}
body[data-workshop="preview"] h1,
body[data-workshop="preview"] h2,
body[data-workshop="preview"] h3,
body[data-workshop="preview"] h4 {
  font-family: var(--ws-font-heading, inherit);
}
/* workshop-phase1-plumbing (2026-05-18) — per-card-type radius.
   Replaces the over-broad [class*="-card"] wildcard that broke compositions
   (nutrition overflow, workout image clipping, adjacent cards touching).
   Each card type now reads its own radius var; box-shadow / border still come
   from the palette-level vars. */
body[data-workshop="preview"] .cmd-nutrition-card,
body[data-workshop="preview"] .cmd-nutri-card,
body[data-workshop="preview"] .meal-card,
body[data-workshop="preview"] .naf2-card,
body[data-workshop="preview"] .nutaf-card {
  border-radius: var(--ws-radius-card-nutrition, var(--ws-card-radius, 18px));
  box-shadow: var(--ws-card-shadow, none);
  border: var(--ws-card-border, 1px solid rgba(0,0,0,0.06));
}
body[data-workshop="preview"] .cls-card,
body[data-workshop="preview"] .cal-wo-card,
body[data-workshop="preview"] .workout-card {
  border-radius: var(--ws-radius-card-workout, var(--ws-card-radius, 14px));
  box-shadow: var(--ws-card-shadow, none);
  border: var(--ws-card-border, 1px solid rgba(0,0,0,0.06));
}
body[data-workshop="preview"] .body-score-card,
body[data-workshop="preview"] .bodyv2-card,
body[data-workshop="preview"] .cmd-brain-card {
  border-radius: var(--ws-radius-card-bodyscore, var(--ws-card-radius, 14px));
  box-shadow: var(--ws-card-shadow, none);
  border: var(--ws-card-border, 1px solid rgba(0,0,0,0.06));
}
body[data-workshop="preview"] .cmd-card,
body[data-workshop="preview"] .card,
body[data-workshop="preview"] .sc-card,
body[data-workshop="preview"] [data-card] {
  border-radius: var(--ws-radius-card-default, var(--ws-card-radius, var(--ws-radius, 14px)));
  box-shadow: var(--ws-card-shadow, none);
  border: var(--ws-card-border, 1px solid rgba(0,0,0,0.06));
}

/* workshop-phase1-plumbing (2026-05-18) — --ws-on-accent contrast token.
   Any element whose BACKGROUND is var(--ws-accent) must read its text/icons
   from var(--ws-on-accent), never var(--ws-text). Fixes the sharp-minimal
   black-on-black disaster (accent=#0A0A0B + text=#0A0A0B). */
body[data-workshop="preview"] button.primary,
body[data-workshop="preview"] .btn-primary,
body[data-workshop="preview"] button.btn-primary,
body[data-workshop="preview"] .primary {
  color: var(--ws-on-accent, #FFFFFF) !important;
}
body[data-workshop="preview"] button.primary svg,
body[data-workshop="preview"] .btn-primary svg,
body[data-workshop="preview"] .primary svg {
  color: var(--ws-on-accent, #FFFFFF) !important;
  fill:  var(--ws-on-accent, #FFFFFF) !important;
  stroke: var(--ws-on-accent, #FFFFFF) !important;
}
/* Active-tab icon sits ON the accent-tinted bar treatment in some palettes —
   read on-accent when the bar treatment is the accent itself. */
body[data-workshop="preview"] [aria-current="page"][data-on-accent="1"],
body[data-workshop="preview"] [aria-current="page"][data-on-accent="1"] svg {
  color: var(--ws-on-accent, #FFFFFF) !important;
  fill:  var(--ws-on-accent, #FFFFFF) !important;
  stroke: var(--ws-on-accent, #FFFFFF) !important;
}
/* Pills / chips whose inline background is the accent surface. */
body[data-workshop="preview"] .pill[data-on-accent="1"],
body[data-workshop="preview"] .chip[data-on-accent="1"],
body[data-workshop="preview"] [class*="pill"][data-on-accent="1"] {
  color: var(--ws-on-accent, #FFFFFF) !important;
}
body[data-workshop="preview"] button,
body[data-workshop="preview"] .btn,
body[data-workshop="preview"] .primary,
body[data-workshop="preview"] [role="button"] {
  border-radius: var(--ws-button-radius, var(--ws-radius, 14px));
  font-family: var(--ws-font-button, var(--ws-font-body, inherit));
}
body[data-workshop="preview"] main,
body[data-workshop="preview"] .page,
body[data-workshop="preview"] [data-page] {
  padding: var(--ws-gutter, 22px);
}
body[data-workshop="preview"] nav.sc-bottom-nav {
  height: var(--ws-bar-height, 64px);
}

/* ─────────────────────────────────────────────────────────────────────
   workshop-palette-real-impact (codified 2026-05-18) — !important
   overrides for the page-inline rules. The vars above land on :root but
   the per-page CSS hardcodes radius/shadow/border/colors on .cmd-card,
   .app-topbar, .sc-bottom-nav so palette swaps were invisible. These
   rules force the var values to win when in workshop preview mode.
   ────────────────────────────────────────────────────────────────── */

/* Bottom nav — recolor + resize when palette swaps */
body[data-workshop="preview"] nav.sc-bottom-nav,
body[data-workshop="preview"] .sc-bottom-nav {
  background: var(--ws-bottom-bar-bg, var(--ws-lower-bar-bg)) !important;
  height: var(--ws-bar-height, 64px) !important;
  transition: background .25s ease, height .25s ease;
}
body[data-workshop="preview"] nav.sc-bottom-nav a,
body[data-workshop="preview"] nav.sc-bottom-nav button,
body[data-workshop="preview"] .sc-bottom-nav a,
body[data-workshop="preview"] .sc-bottom-nav button,
body[data-workshop="preview"] .sc-bottom-nav svg {
  color: var(--ws-bottom-bar-icon, var(--ws-lower-bar-icon)) !important;
  fill: var(--ws-bottom-bar-icon, var(--ws-lower-bar-icon)) !important;
  stroke: var(--ws-bottom-bar-icon, var(--ws-lower-bar-icon)) !important;
}
body[data-workshop="preview"] nav.sc-bottom-nav .active,
body[data-workshop="preview"] nav.sc-bottom-nav [aria-current="page"],
body[data-workshop="preview"] .sc-bottom-nav .active,
body[data-workshop="preview"] .sc-bottom-nav [aria-current="page"],
body[data-workshop="preview"] .sc-bottom-nav .active svg,
body[data-workshop="preview"] .sc-bottom-nav [aria-current="page"] svg {
  color: var(--ws-bottom-bar-icon-active, var(--ws-lower-bar-active), var(--ws-accent)) !important;
  fill: var(--ws-bottom-bar-icon-active, var(--ws-lower-bar-active), var(--ws-accent)) !important;
  stroke: var(--ws-bottom-bar-icon-active, var(--ws-lower-bar-active), var(--ws-accent)) !important;
}

/* Top bar */
body[data-workshop="preview"] .app-topbar,
body[data-workshop="preview"] .cmd-topbar,
body[data-workshop="preview"] header.app-topbar,
body[data-workshop="preview"] header {
  background: var(--ws-topbar-bg, var(--ws-page-bg)) !important;
  color: var(--ws-topbar-text, var(--ws-text)) !important;
  transition: background .25s ease, color .25s ease;
}
body[data-workshop="preview"] .app-topbar svg,
body[data-workshop="preview"] .app-topbar button,
body[data-workshop="preview"] .cmd-topbar-actions svg,
body[data-workshop="preview"] .cmd-topbar-actions button {
  color: var(--ws-topbar-icon, var(--ws-text)) !important;
  fill: var(--ws-topbar-icon, var(--ws-text)) !important;
  stroke: var(--ws-topbar-icon, var(--ws-text)) !important;
}

/* Cards — background / shadow / border take their var values, not hardcoded.
   workshop-phase1-plumbing (2026-05-18): the over-broad [class*="-card"]
   wildcard was DROPPED — it broke compositions (nutrition circle overflow,
   today's-workout image clipping, adjacent cards visually touching). Radius
   is now per-card-type (defined in the per-component rule blocks above).
   This block only sets background / shadow / border + the transition. */
body[data-workshop="preview"] .cmd-card,
body[data-workshop="preview"] .body-score-card,
body[data-workshop="preview"] .bodyv2-card,
body[data-workshop="preview"] .cls-card,
body[data-workshop="preview"] .cal-wo-card,
body[data-workshop="preview"] .checkin-card,
body[data-workshop="preview"] .meal-card,
body[data-workshop="preview"] .naf2-card,
body[data-workshop="preview"] .nutaf-card,
body[data-workshop="preview"] .cmd-nutrition-card,
body[data-workshop="preview"] .cmd-nutri-card,
body[data-workshop="preview"] .cmd-brain-card,
body[data-workshop="preview"] .workout-card,
body[data-workshop="preview"] .card,
body[data-workshop="preview"] .sc-card {
  background: var(--ws-card-bg) !important;
  box-shadow: var(--ws-card-shadow, none) !important;
  border: var(--ws-card-border, 1px solid rgba(0,0,0,0.06)) !important;
  transition: border-radius .25s ease, box-shadow .25s ease, border .25s ease, background .25s ease;
}

/* Buttons — pill / square / rounded shape from palette */
body[data-workshop="preview"] button:not(.ws-preset-tile):not(.ws-preset-card),
body[data-workshop="preview"] .primary,
body[data-workshop="preview"] .btn-primary,
body[data-workshop="preview"] .btn {
  border-radius: var(--ws-radius-button, var(--ws-button-radius, var(--ws-radius, 14px))) !important;
  font-family: var(--ws-font-button, var(--ws-font-body, inherit)) !important;
  transition: border-radius .25s ease;
}
/* workshop-phase1-plumbing (2026-05-18) — pill / chip radius */
body[data-workshop="preview"] .pill,
body[data-workshop="preview"] .chip,
body[data-workshop="preview"] [class*="status-pill"] {
  border-radius: var(--ws-radius-pill, 999px) !important;
}


/* ===== Sidebar drawer consistency (uniform rows) — default/base ===== */
/* ════════════════════════════════════════════════════════════════
   DEFAULT (Superhuman, no data-skin) SIDEBAR DRAWER — clean + consistent
   Base overrides. NOT scoped to any data-skin. Merge into design-system.css.
   Fixes ragged drawer-link boxes: every row uniform full-width, equal
   padding/height, consistent radius + 1px hairline, even vertical rhythm.
   Light SC tokens: page #FAF8F4 · card #FEFEFE · ink #252525 ·
   gold #C9A96E (sparingly) · hairline #E8E1D1.
   Wire-compat: every #drawer-*-btn / class preserved.
═══════════════════════════════════════════════════════════════════ */

/* ── Body: tighter, even rhythm ── */
.drawer-body {
  padding: 14px 14px 44px;
  background: #FAF8F4;
}

/* ── Section labels: aligned to row left edge, even spacing ── */
.drawer-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #B89A66;
  padding: 0 4px 8px;
  margin-top: 18px;
}
.drawer-body > .drawer-section-label:first-child,
.drawer-body > .drawer-link:first-child {
  margin-top: 2px;
}

/* ── SH15: section rows grouped into ONE rounded card with hairline
   dividers (kills the floating-pill monotony). ── */
.drawer-group {
  background: #FEFEFE;
  border: 1px solid #E8E1D1;
  border-radius: 16px;
  overflow: hidden;
  margin: 0 0 8px;
  box-shadow: 0 1px 2px rgba(37,37,37,0.03);
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  margin: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #F1ECE2;
  box-shadow: none;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: #252525;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.18s, transform 0.06s;
}
.drawer-group > .drawer-link:last-child { border-bottom: none; }
.drawer-link > span:nth-of-type(1) + span,
.drawer-link > .drawer-link-icon + span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-link:hover {
  background: #FAF8F4;
}
.drawer-link:active {
  transform: scale(0.992);
  background: #F4EFE5;
}

/* ── SH15: line-icon tile (transparent — the gold stroke carries it) ── */
.drawer-link-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 0;
  background: transparent;
  border: none;
}
.drawer-link-icon svg { width: 22px; height: 22px; }

/* ── SH15: per-row chevron affordance ── */
.drawer-link-chev {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #C2B49C;
}
.drawer-link-chev svg { width: 18px; height: 18px; }

/* ── Dividers: subtle, even gaps ── */
.drawer-divider {
  height: 1px;
  background: #ECE4D2;
  margin: 16px 4px 4px;
}

/* ── Language picker: same card geometry as a drawer-link ── */
#clientLangPickerSlot { display: block; }
.lang-picker-row {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  margin: 0 0 8px;
  border-radius: 14px;
  background: #FEFEFE;
  border: 1px solid #E8E1D1;
}
.lang-picker-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #F6F1E7;
  border: 1px solid #EFE7D5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B89A66;
}
.lang-picker-icon svg { width: 16px; height: 16px; }
.lang-picker-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #252525;       /* override dark-theme --text default (#e8e0d0) */
}
.lang-picker-btns { display: flex; gap: 5px; flex-shrink: 0; }
.lang-btn {
  background: #FAF8F4;
  border: 1px solid #E4DDCC;
  color: #8A8178;        /* override --muted #888 for crisp contrast */
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-btn.active {
  background: #C9A96E;
  border-color: #C9A96E;
  color: #1A1714;
}
.lang-btn:hover:not(.active) {
  border-color: #C9A96E;
  color: #9A7040;
}

/* ── SH15: Sign out — destructive leave-icon + 800-weight, centered ── */
.drawer-signout-btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  /* clear the home indicator */
  margin: 14px 0 max(34px, env(safe-area-inset-bottom, 0px));
  border-radius: 16px;
  background: #FEFEFE;
  border: 1px solid #ECD7D1;
  font-size: 15px;
  font-weight: 800;
  color: #C0392B;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s, border-color 0.18s;
}
.drawer-signout-icon { display: inline-flex; align-items: center; }
.drawer-signout-icon svg { width: 19px; height: 19px; }
.drawer-signout-btn:hover {
  background: #FCEFEC;
  border-color: #F0C5BC;
  color: #B5331F;
}
