/* ============================================================
       NORTE DESIGN TOKENS — Night Sky · Premium · Editorial
       Space Grotesk · DM Sans · Playfair Display
    ============================================================ */
    :root {
      /* Norte Gold — the north star */
      --fire:       #C4A45A;
      --fire-dark:  #9A7D3A;
      --fire-glow:  rgba(196,164,90,0.15);

      /* Gold aliases */
      --gold:       #C4A45A;
      --gold-dark:  #9A7D3A;
      --gold-glow:  rgba(196,164,90,0.12);

      /* Secondary accent */
      --ice:        #5DA882;

      /* Backgrounds: Night sky, not warm brown */
      --bg:         #0F1117;
      --surface:    #161820;
      --surface2:   #1E2028;
      --surface3:   #252830;
      --border:     #2A2D38;

      /* Text: Cool off-white */
      --text:       #EDF0F7;
      --text2:      #9BA3B8;
      --text3:      #5A6070;

      /* Semantic */
      --success:    #3D7A62;
      --danger:     #C45A4A;
      --warning:    #C4A45A;

      /* Phase Colors — Norte system */
      --phase1:     #C4A45A;   /* Norte Gold — Scotland Prep */
      --phase2:     #3D7A62;   /* Norte Forest — Scotland Trip */
      --phase3:     #5A7AC4;   /* Norte Steel — Mexico Shred */
      --p1-glow:    rgba(196,164,90,0.12);
      --p2-glow:    rgba(61,122,98,0.12);
      --p3-glow:    rgba(90,122,196,0.12);

      /* Geometry: Sharp, editorial */
      --radius-sm:  6px;
      --radius-md:  10px;
      --radius-lg:  16px;
      --radius-xl:  20px;
    }

    /* ============================================================
       RESET & BASE
    ============================================================ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { height: 100%; overflow: hidden; }
    body {
      font-family: 'Space Grotesk', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      height: 100%;
      overflow: hidden;
      -webkit-font-smoothing: antialiased;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      letter-spacing: -0.01em;
    }
    button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
    input { font: inherit; }
    a { color: inherit; text-decoration: none; }
    * { -webkit-overflow-scrolling: touch; }

    /* ============================================================
       APP SHELL
    ============================================================ */
    #app {
      display: flex;
      flex-direction: column;
      height: 100%;
      height: 100dvh;
      overflow: hidden;
    }

    /* ============================================================
       HEADER
    ============================================================ */
    #app-header {
      flex-shrink: 0;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 12px 20px 10px;
      padding-top: calc(12px + env(safe-area-inset-top));
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: relative;
      z-index: 10;
    }
    .header-logo {
      font-size: 17px;
      font-weight: 800;
      letter-spacing: 2.5px;
      text-transform: uppercase;
      color: var(--text);
    }
    .header-logo span {
      color: var(--fire);
    }
    .header-right {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .streak-pill {
      display: flex;
      align-items: center;
      gap: 5px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 5px 12px;
      font-size: 14px;
      font-weight: 700;
    }
    .streak-pill .fire-icon { font-size: 16px; }
    .header-settings {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: var(--surface2);
      border: 1px solid var(--border);
      display: flex; align-items: center; justify-content: center;
      font-size: 17px;
    }

    /* XP Bar under header */
    #xp-bar-wrap {
      flex-shrink: 0;
      background: var(--surface);
      padding: 0 20px 10px;
      border-bottom: 1px solid var(--border);
    }
    .xp-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 5px;
    }
    .xp-level-badge {
      font-size: 12px;
      font-weight: 700;
      color: var(--gold);
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
    .xp-numbers { font-size: 12px; color: var(--text3); }
    .xp-track {
      height: 5px;
      background: var(--surface3);
      border-radius: 10px;
      overflow: hidden;
    }
    .xp-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--fire), var(--gold));
      border-radius: 10px;
      transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* ============================================================
       MAIN SCROLL AREA
    ============================================================ */
    #main-scroll {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
    }

    /* ============================================================
       PAGE VISIBILITY
    ============================================================ */
    .page { display: none; padding-bottom: 100px; }
    .page.active { display: block; }

    /* ============================================================
       BOTTOM NAV
    ============================================================ */
    #bottom-nav {
      flex-shrink: 0;
      background: var(--surface);
      border-top: 1px solid var(--border);
      display: flex;
      padding-bottom: env(safe-area-inset-bottom);
      position: relative;
      z-index: 10;
    }
    .nav-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 10px 4px 8px;
      gap: 3px;
      transition: all 0.15s;
    }
    .nav-icon { font-size: 22px; line-height: 1; }
    .nav-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--text3);
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }
    .nav-item.active .nav-label { color: var(--fire); }
    .nav-item.active .nav-icon { transform: scale(1.1); }

    /* ============================================================
       CARDS
    ============================================================ */
    .card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px;
      margin: 0 16px 14px;
    }
    .card-sm { padding: 14px; }
    .card-title {
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text3);
      margin-bottom: 10px;
    }

    /* ============================================================
       BUTTONS
    ============================================================ */
    .btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 16px 24px;
      border-radius: var(--radius-lg);
      font-size: 17px;
      font-weight: 700;
      letter-spacing: 0.3px;
      transition: all 0.15s;
      min-height: 54px;
      width: 100%;
    }
    .btn:active { transform: scale(0.97); }
    .btn-primary {
      background: var(--fire);
      color: var(--text);
      letter-spacing: 0.8px;
      text-transform: uppercase;
      font-size: 14px;
    }
    .btn-secondary {
      background: transparent;
      color: var(--text2);
      border: 1px solid var(--border);
      letter-spacing: 0.5px;
      font-size: 14px;
    }
    .btn-gold {
      background: var(--gold);
      color: #0D0C0A;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      font-size: 14px;
    }
    .btn-success {
      background: var(--success);
      color: var(--text);
      letter-spacing: 0.8px;
      text-transform: uppercase;
      font-size: 14px;
    }
    .btn-sm {
      padding: 10px 18px;
      font-size: 12px;
      min-height: 40px;
      border-radius: var(--radius-sm);
      letter-spacing: 0.8px;
      text-transform: uppercase;
    }
    .btn:disabled {
      opacity: 0.5;
      pointer-events: none;
    }

    /* ============================================================
       SECTION HEADER
    ============================================================ */
    .section-header {
      padding: 20px 20px 8px;
      display: flex;
      align-items: baseline;
      justify-content: space-between;
    }
    .section-title {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.5px;
    }
    .section-sub { font-size: 13px; color: var(--text3); }

    /* ============================================================
       PAGE: HOME
    ============================================================ */
    .phase-banner {
      margin: 16px 16px 0;
      border-radius: var(--radius-md);
      padding: 18px 20px;
      position: relative;
      overflow: hidden;
    }
    .phase-banner.p1 {
      background: linear-gradient(135deg, #1a0f00, #2a1800);
      border: 1px solid rgba(255,159,10,0.4);
    }
    .phase-banner.p2 {
      background: linear-gradient(135deg, #001a08, #002a0f);
      border: 1px solid rgba(50,215,75,0.4);
    }
    .phase-banner.p3 {
      background: linear-gradient(135deg, #00081a, #00102a);
      border: 1px solid rgba(10,132,255,0.4);
    }
    .phase-banner-tag {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 2px;
      margin-bottom: 4px;
    }
    .phase-banner.p1 .phase-banner-tag { color: var(--phase1); }
    .phase-banner.p2 .phase-banner-tag { color: var(--phase2); }
    .phase-banner.p3 .phase-banner-tag { color: var(--phase3); }
    .phase-banner-name {
      font-size: 20px;
      font-weight: 900;
      letter-spacing: -0.5px;
      margin-bottom: 12px;
    }
    .phase-progress-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }
    .phase-progress-bar {
      flex: 1;
      height: 6px;
      background: rgba(255,255,255,0.1);
      border-radius: 10px;
      overflow: hidden;
    }
    .phase-progress-fill {
      height: 100%;
      border-radius: 10px;
      transition: width 1s ease;
    }
    .p1 .phase-progress-fill { background: var(--phase1); }
    .p2 .phase-progress-fill { background: var(--phase2); }
    .p3 .phase-progress-fill { background: var(--phase3); }
    .phase-progress-pct {
      font-size: 13px;
      font-weight: 700;
      min-width: 36px;
      text-align: right;
    }
    .phase-countdown {
      font-size: 13px;
      color: var(--text3);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .phase-countdown strong { color: var(--text2); }

    /* Today's workout card */
    .today-card {
      margin: 14px 16px 0;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    .today-card-header {
      padding: 16px 18px 12px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    }
    .today-card-tag {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--text3);
      margin-bottom: 4px;
    }
    .today-card-name {
      font-size: 19px;
      font-weight: 900;
      letter-spacing: -0.3px;
    }
    .today-card-emoji { font-size: 42px; line-height: 1; }
    .today-card-meta {
      display: flex;
      gap: 12px;
      padding: 0 18px 14px;
    }
    .today-meta-pill {
      display: flex;
      align-items: center;
      gap: 5px;
      background: var(--surface3);
      border-radius: 20px;
      padding: 5px 11px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text2);
    }
    .today-card-action { padding: 0 16px 16px; }
    .today-card-rest {
      padding: 16px 18px;
      background: rgba(255,255,255,0.03);
      text-align: center;
      color: var(--text3);
      font-size: 15px;
    }

    /* Quick stats row */
    .stats-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin: 14px 16px 0;
    }
    .stat-box {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px 10px;
      text-align: center;
    }
    .stat-box-val {
      font-size: 24px;
      font-weight: 900;
      color: var(--fire);
      line-height: 1;
      margin-bottom: 4px;
    }
    .stat-box-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text3);
    }

    /* Daily tip card */
    .tip-card {
      margin: 14px 16px 0;
      background: linear-gradient(135deg, #0d0d2e, #1a1a3e);
      border: 1px solid rgba(0,191,255,0.3);
      border-radius: var(--radius-md);
      padding: 16px 18px;
    }
    .tip-label {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--ice);
      margin-bottom: 6px;
    }
    .tip-text {
      font-size: 14px;
      line-height: 1.55;
      color: var(--text2);
    }

    /* Garmin sync note */
    .garmin-card {
      margin: 14px 16px 0;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 18px;
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .garmin-icon { font-size: 28px; }
    .garmin-text { flex: 1; }
    .garmin-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
    .garmin-sub { font-size: 12px; color: var(--text3); line-height: 1.4; }

    /* ============================================================
       PAGE: WORKOUT
    ============================================================ */
    .workout-hero {
      padding: 20px 20px 16px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
    }
    .workout-hero-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 14px;
    }
    .workout-hero-emoji { font-size: 52px; line-height: 1; }
    .workout-hero-info { flex: 1; margin-right: 12px; }
    .workout-hero-phase {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--text3);
      margin-bottom: 4px;
    }
    .workout-hero-name {
      font-size: 24px;
      font-weight: 900;
      letter-spacing: -0.5px;
      line-height: 1.1;
      margin-bottom: 8px;
    }
    .workout-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }
    .workout-badge {
      font-size: 12px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 20px;
      background: var(--surface3);
      color: var(--text2);
    }
    .workout-badge.xp { background: rgba(255,215,0,0.15); color: var(--gold); }

    /* Workout progress bar */
    .workout-progress {
      background: var(--surface3);
      border-radius: 10px;
      height: 8px;
      overflow: hidden;
    }
    .workout-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--fire), var(--gold));
      border-radius: 10px;
      transition: width 0.4s ease;
    }
    .workout-progress-label {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text3);
      margin-top: 6px;
    }

    /* Warmup note */
    .warmup-note {
      margin: 14px 16px 0;
      background: rgba(255,215,0,0.07);
      border: 1px solid rgba(255,215,0,0.2);
      border-radius: var(--radius-sm);
      padding: 12px 16px;
      font-size: 13px;
      color: var(--text2);
      line-height: 1.5;
    }
    .warmup-note strong { color: var(--gold); }

    /* Exercise card */
    .exercise-card {
      margin: 10px 16px 0;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
      transition: border-color 0.2s;
    }
    .exercise-card.done { border-color: var(--success); }
    .exercise-card-header {
      padding: 16px 16px 12px;
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }
    .exercise-number {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--surface3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
      color: var(--text3);
      flex-shrink: 0;
      margin-top: 1px;
    }
    .exercise-card.done .exercise-number {
      background: var(--success);
      color: #000;
    }
    .exercise-main { flex: 1; }
    .exercise-name {
      font-size: 17px;
      font-weight: 800;
      margin-bottom: 5px;
      letter-spacing: -0.2px;
    }
    .exercise-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-bottom: 8px;
    }
    .exercise-tag {
      font-size: 11px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 8px;
      background: var(--surface3);
      color: var(--text3);
    }
    .exercise-prescription {
      font-size: 15px;
      font-weight: 700;
      color: var(--fire);
    }
    .exercise-expand-btn {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--surface3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      transition: transform 0.2s;
    }
    .exercise-expand-btn.open { transform: rotate(180deg); }

    /* Exercise detail (expandable) */
    .exercise-detail {
      display: none;
      padding: 0 16px 14px 56px;
    }
    .exercise-detail.open { display: block; }
    .exercise-weight {
      font-size: 13px;
      font-weight: 700;
      color: var(--gold);
      margin-bottom: 8px;
    }
    .exercise-weight span { font-weight: 400; color: var(--text3); }
    .exercise-tip {
      font-size: 13px;
      line-height: 1.55;
      color: var(--text2);
      background: rgba(255,255,255,0.04);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      margin-bottom: 10px;
    }
    .exercise-tip-label {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text3);
      margin-bottom: 4px;
    }
    .exercise-caution {
      font-size: 12px;
      color: #FF9F0A;
      margin-bottom: 10px;
      display: flex;
      gap: 6px;
      align-items: flex-start;
    }
    .exercise-location {
      font-size: 12px;
      color: var(--text3);
      margin-bottom: 12px;
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .exercise-actions {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
    }
    .btn-video {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 11px;
      background: rgba(255,0,0,0.1);
      border: 1px solid rgba(255,0,0,0.25);
      border-radius: var(--radius-sm);
      font-size: 13px;
      font-weight: 700;
      color: #FF4444;
    }

    /* Set trackers */
    .sets-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .set-btn {
      min-width: 64px;
      padding: 10px 8px;
      border-radius: var(--radius-sm);
      background: var(--surface3);
      border: 1.5px solid var(--border);
      font-size: 12px;
      font-weight: 700;
      color: var(--text3);
      text-align: center;
      transition: all 0.2s;
    }
    .set-btn .set-label { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
    .set-btn.checked {
      background: rgba(48,209,88,0.15);
      border-color: var(--success);
      color: var(--success);
    }
    .set-btn:active { transform: scale(0.95); }

    /* Complete workout button area */
    .complete-workout-wrap {
      padding: 20px 16px;
    }

    /* ============================================================
       PAGE: CALENDAR
    ============================================================ */
    .cal-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px 8px;
    }
    .cal-month-title {
      font-size: 20px;
      font-weight: 800;
      letter-spacing: -0.3px;
    }
    .cal-arrow {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--surface2);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
    }
    .cal-grid {
      padding: 0 16px;
    }
    .cal-weekdays {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      text-align: center;
      margin-bottom: 6px;
    }
    .cal-wd {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--text3);
      padding: 4px 0;
    }
    .cal-days {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
    }
    .cal-day {
      aspect-ratio: 1;
      border-radius: 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      position: relative;
      background: var(--surface2);
    }
    .cal-day.empty { background: transparent; }
    .cal-day.today {
      background: var(--fire);
      color: #fff;
      box-shadow: 0 2px 12px var(--fire-glow);
    }
    .cal-day.completed { background: rgba(48,209,88,0.2); color: var(--success); }
    .cal-day.partial { background: rgba(255,215,0,0.15); color: var(--gold); }
    .cal-day.missed { background: rgba(255,69,58,0.15); color: var(--danger); }
    .cal-day.rest { background: var(--surface3); color: var(--text3); }
    .cal-day.future { background: var(--surface2); color: var(--text3); opacity: 0.5; }
    .cal-day.scotland { background: rgba(50,215,75,0.15); color: var(--phase2); }
    .cal-day-dot {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: currentColor;
      margin-top: 2px;
      opacity: 0.7;
    }
    .cal-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 14px 16px;
    }
    .cal-legend-item {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      color: var(--text3);
    }
    .cal-legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 3px;
    }
    .cal-phase-summary {
      margin: 0 16px 10px;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    .cal-phase-card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 12px 10px;
      text-align: center;
    }
    .cal-phase-card-emoji { font-size: 20px; margin-bottom: 4px; }
    .cal-phase-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text3); margin-bottom: 2px; }
    .cal-phase-card-date { font-size: 11px; color: var(--text2); font-weight: 600; }

    /* ============================================================
       PAGE: PROGRESS
    ============================================================ */
    .level-hero {
      margin: 16px 16px 0;
      background: linear-gradient(135deg, #1a0e00, #2d1a00);
      border: 1px solid rgba(255,215,0,0.3);
      border-radius: var(--radius-lg);
      padding: 24px 20px;
      display: flex;
      align-items: center;
      gap: 20px;
    }
    .level-circle {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      border: 3px solid var(--gold);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: rgba(255,215,0,0.1);
      box-shadow: 0 0 20px rgba(255,215,0,0.2);
    }
    .level-num {
      font-size: 28px;
      font-weight: 900;
      color: var(--gold);
      line-height: 1;
    }
    .level-lbl {
      font-size: 9px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--gold);
      opacity: 0.7;
    }
    .level-info { flex: 1; }
    .level-title {
      font-size: 22px;
      font-weight: 900;
      color: var(--gold);
      margin-bottom: 4px;
      letter-spacing: -0.3px;
    }
    .level-xp-text { font-size: 13px; color: var(--text3); margin-bottom: 8px; }
    .level-bar {
      height: 8px;
      background: rgba(255,215,0,0.15);
      border-radius: 10px;
      overflow: hidden;
    }
    .level-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--gold), #FFA500);
      border-radius: 10px;
      transition: width 1s ease;
    }

    /* Achievement grid */
    .achievements-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      padding: 0 16px;
    }
    .achievement-badge {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px 8px;
      text-align: center;
      transition: all 0.2s;
      position: relative;
    }
    .achievement-badge.unlocked {
      border-color: var(--gold);
      background: rgba(255,215,0,0.07);
    }
    .achievement-badge-emoji { font-size: 28px; margin-bottom: 6px; }
    .achievement-badge.locked .achievement-badge-emoji { filter: grayscale(1); opacity: 0.3; }
    .achievement-badge-name {
      font-size: 11px;
      font-weight: 700;
      color: var(--text2);
      line-height: 1.3;
      margin-bottom: 3px;
    }
    .achievement-badge.locked .achievement-badge-name { color: var(--text3); }
    .achievement-badge-xp {
      font-size: 10px;
      font-weight: 700;
      color: var(--gold);
    }
    .achievement-badge.locked .achievement-badge-xp { color: var(--text3); }
    .achievement-lock {
      position: absolute;
      top: 6px;
      right: 6px;
      font-size: 10px;
      opacity: 0.4;
    }

    /* Stats grid */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      padding: 0 16px;
    }
    .stat-card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 16px 14px;
    }
    .stat-card-val {
      font-size: 28px;
      font-weight: 900;
      line-height: 1;
      margin-bottom: 4px;
    }
    .stat-card-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text3);
    }

    /* Body log */
    .body-log-input {
      display: flex;
      gap: 10px;
      padding: 0 16px;
      margin-bottom: 12px;
    }
    .weight-input {
      flex: 1;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px 16px;
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
      -webkit-appearance: none;
    }
    .weight-input:focus {
      outline: none;
      border-color: var(--fire);
    }
    .weight-log-list {
      padding: 0 16px;
    }
    .weight-log-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
      font-size: 15px;
    }
    .weight-log-item:last-child { border-bottom: none; }
    .weight-log-date { color: var(--text3); font-size: 13px; }
    .weight-log-val { font-weight: 800; color: var(--fire); }
    .weight-log-delta { font-size: 12px; font-weight: 700; }
    .weight-log-delta.down { color: var(--success); }
    .weight-log-delta.up { color: var(--danger); }

    /* Milestones timeline */
    .milestone-timeline {
      padding: 0 16px;
    }
    .milestone-item {
      display: flex;
      gap: 14px;
      padding-bottom: 20px;
      position: relative;
    }
    .milestone-item:not(:last-child)::before {
      content: '';
      position: absolute;
      left: 15px;
      top: 32px;
      bottom: 0;
      width: 2px;
      background: var(--border);
    }
    .milestone-dot {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--surface3);
      border: 2px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
      z-index: 1;
    }
    .milestone-item.done .milestone-dot {
      background: rgba(48,209,88,0.2);
      border-color: var(--success);
    }
    .milestone-item.current .milestone-dot {
      background: rgba(255,107,53,0.2);
      border-color: var(--fire);
      box-shadow: 0 0 12px var(--fire-glow);
    }
    .milestone-content { flex: 1; padding-top: 4px; }
    .milestone-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
    .milestone-date { font-size: 12px; color: var(--text3); }

    /* ============================================================
       PAGE: NUTRITION
    ============================================================ */
    .nutrition-targets {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      padding: 0 16px;
    }
    .nutrition-target {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px 14px;
      text-align: center;
    }
    .nutrition-target-val {
      font-size: 32px;
      font-weight: 900;
      color: var(--fire);
      line-height: 1;
      margin-bottom: 4px;
    }
    .nutrition-target-unit {
      font-size: 14px;
      color: var(--text3);
      font-weight: 600;
      margin-bottom: 6px;
    }
    .nutrition-target-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text3);
    }
    .nutrition-ring {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      border: 4px solid var(--surface3);
      border-top-color: var(--fire);
      margin: 0 auto 8px;
      position: relative;
    }

    /* Medical context cards */
    .med-card {
      margin: 0 16px 12px;
      border-radius: var(--radius-md);
      padding: 16px 18px;
    }
    .med-card.tirze {
      background: linear-gradient(135deg, #1a0f00, #2a1a00);
      border: 1px solid rgba(255,159,10,0.4);
    }
    .med-card.trt {
      background: linear-gradient(135deg, #001020, #00152d);
      border: 1px solid rgba(10,132,255,0.4);
    }
    .med-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }
    .med-card-icon { font-size: 24px; }
    .med-card-title { font-size: 14px; font-weight: 800; }
    .med-card.tirze .med-card-title { color: var(--phase1); }
    .med-card.trt .med-card-title { color: var(--ice); }
    .med-card-body { font-size: 13px; line-height: 1.6; color: var(--text2); }
    .med-card-body ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
    .med-card-body li::before { content: '→ '; color: var(--phase1); font-weight: 700; }
    .med-card.trt .med-card-body li::before { color: var(--ice); }

    /* Meal timing */
    .meal-timeline {
      padding: 0 16px;
    }
    .meal-item {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      padding-bottom: 16px;
      position: relative;
    }
    .meal-item:not(:last-child)::before {
      content: '';
      position: absolute;
      left: 15px;
      top: 36px;
      bottom: 0;
      width: 2px;
      background: var(--border);
    }
    .meal-time-badge {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--surface3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      z-index: 1;
    }
    .meal-content { flex: 1; padding-top: 4px; }
    .meal-time { font-size: 12px; font-weight: 700; color: var(--text3); margin-bottom: 2px; }
    .meal-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
    .meal-desc { font-size: 13px; color: var(--text3); line-height: 1.45; }
    .meal-protein { font-size: 12px; font-weight: 700; color: var(--fire); margin-top: 4px; }

    /* ============================================================
       MODALS
    ============================================================ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.85);
      z-index: 100;
      display: none;
      align-items: flex-end;
      justify-content: center;
      backdrop-filter: blur(4px);
    }
    .modal-overlay.open {
      display: flex;
      animation: fadeIn 0.2s ease;
    }
    .modal-sheet {
      background: var(--surface);
      border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      padding: 20px 24px;
      padding-bottom: calc(32px + env(safe-area-inset-bottom));
      width: 100%;
      max-width: 480px;
      animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .modal-handle {
      width: 40px;
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin: 0 auto 20px;
    }
    .modal-title {
      font-size: 22px;
      font-weight: 900;
      text-align: center;
      margin-bottom: 8px;
    }
    .modal-sub {
      font-size: 15px;
      color: var(--text3);
      text-align: center;
      margin-bottom: 20px;
    }

    /* Rest Timer Modal */
    .timer-display {
      text-align: center;
      padding: 20px 0;
    }
    .timer-num {
      font-size: 80px;
      font-weight: 900;
      color: var(--fire);
      line-height: 1;
      font-variant-numeric: tabular-nums;
      letter-spacing: -3px;
    }
    .timer-label {
      font-size: 14px;
      color: var(--text3);
      text-transform: uppercase;
      letter-spacing: 2px;
      margin-top: 4px;
    }

    /* Completion Modal */
    .completion-xp {
      font-size: 64px;
      font-weight: 900;
      color: var(--gold);
      text-align: center;
      line-height: 1;
      margin-bottom: 4px;
    }
    .completion-xp-label {
      text-align: center;
      font-size: 14px;
      color: var(--text3);
      text-transform: uppercase;
      letter-spacing: 2px;
      margin-bottom: 20px;
    }
    .completion-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 20px;
    }
    .completion-stat {
      background: var(--surface2);
      border-radius: var(--radius-sm);
      padding: 12px;
      text-align: center;
    }
    .completion-stat-val { font-size: 20px; font-weight: 900; color: var(--text); }
    .completion-stat-label { font-size: 10px; color: var(--text3); font-weight: 700; text-transform: uppercase; margin-top: 2px; }

    /* Achievement Toast */
    .achievement-toast {
      position: fixed;
      top: calc(env(safe-area-inset-top) + 80px);
      left: 16px;
      right: 16px;
      background: linear-gradient(135deg, #1a1200, #2a2000);
      border: 1px solid rgba(255,215,0,0.5);
      border-radius: var(--radius-md);
      padding: 14px 18px;
      display: flex;
      align-items: center;
      gap: 14px;
      z-index: 200;
      animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
      box-shadow: 0 8px 32px rgba(255,215,0,0.2);
    }
    .achievement-toast-emoji { font-size: 32px; }
    .achievement-toast-text { flex: 1; }
    .achievement-toast-tag {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--gold);
      margin-bottom: 2px;
    }
    .achievement-toast-name { font-size: 16px; font-weight: 800; }
    .achievement-toast-xp { font-size: 12px; color: var(--gold); font-weight: 700; }

    /* Settings Modal */
    .settings-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 0;
      border-bottom: 1px solid var(--border);
    }
    .settings-row:last-child { border-bottom: none; }
    .settings-label { font-size: 16px; font-weight: 600; }
    .settings-value { font-size: 15px; color: var(--text3); }
    .settings-input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 8px 12px;
      font-size: 16px;
      font-weight: 700;
      color: var(--text);
      width: 90px;
      text-align: right;
      -webkit-appearance: none;
    }
    .settings-input:focus { outline: none; border-color: var(--fire); }

    /* ============================================================
       ANIMATIONS
    ============================================================ */
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideUp {
      from { transform: translateY(100%); opacity: 0; }
      to   { transform: translateY(0);    opacity: 1; }
    }
    @keyframes slideDown {
      from { transform: translateY(-20px); opacity: 0; }
      to   { transform: translateY(0);     opacity: 1; }
    }
    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50%       { transform: scale(1.05); }
    }
    @keyframes xpPop {
      0%   { transform: scale(0.8); opacity: 0; }
      60%  { transform: scale(1.2); opacity: 1; }
      100% { transform: scale(1);   opacity: 1; }
    }
    @keyframes confettiDrop {
      0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
      100% { transform: translateY(80px) rotate(360deg); opacity: 0; }
    }
    .xp-pop {
      animation: xpPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    .confetti-piece {
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 2px;
      animation: confettiDrop 1s ease forwards;
    }

    /* Hydration bar */
    .hydration-bar {
      display: flex;
      gap: 3px;
      padding: 0 16px;
      flex-wrap: wrap;
    }
    .hydration-cup {
      font-size: 22px;
      opacity: 0.3;
      transition: opacity 0.2s;
      cursor: pointer;
    }
    .hydration-cup.filled { opacity: 1; }

    /* Daily Checklist */
    .checklist-progress-bar {
      height: 6px;
      background: var(--surface3);
      border-radius: 3px;
      margin: 12px 16px 16px;
      overflow: hidden;
    }
    .checklist-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--fire), var(--gold));
      border-radius: 3px;
      transition: width 0.4s ease;
    }
    .checklist-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 13px 16px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.15s;
    }
    .checklist-row:last-child { border-bottom: none; }
    .checklist-row:active { background: var(--surface3); }
    .checklist-box {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      border: 2px solid var(--border);
      background: var(--surface3);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 13px;
      transition: all 0.2s;
    }
    .checklist-row.checked .checklist-box {
      background: var(--fire);
      border-color: var(--fire);
    }
    .checklist-emoji { font-size: 18px; flex-shrink: 0; }
    .checklist-label { flex: 1; }
    .checklist-name { font-size: 14px; font-weight: 700; color: var(--text); }
    .checklist-dose { font-size: 12px; color: var(--text3); margin-top: 1px; }
    .checklist-row.checked .checklist-name { color: var(--text3); text-decoration: line-through; }
    .streak-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      background: rgba(184,118,58,0.15);
      border: 1px solid var(--fire);
      border-radius: 20px;
      font-size: 12px;
      font-weight: 800;
      color: var(--fire);
    }

    /* Food photo upload */
    .photo-upload-zone {
      margin: 0 16px;
      border: 2px dashed var(--border);
      border-radius: var(--radius-lg);
      padding: 28px 20px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: var(--surface2);
    }
    .photo-upload-zone:active { background: var(--surface3); border-color: var(--fire); }
    .photo-upload-icon { font-size: 36px; margin-bottom: 8px; }
    .photo-upload-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
    .photo-upload-sub { font-size: 12px; color: var(--text3); }
    .photo-preview-wrap {
      margin: 0 16px;
      border-radius: var(--radius-md);
      overflow: hidden;
      position: relative;
      background: var(--surface2);
      border: 1px solid var(--border);
    }
    .photo-preview-img {
      width: 100%;
      max-height: 260px;
      object-fit: cover;
      display: block;
    }
    .photo-preview-actions {
      display: flex;
      gap: 8px;
      padding: 12px;
    }
    .meal-log-card {
      margin: 8px 16px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    .meal-log-thumb {
      width: 72px;
      height: 72px;
      object-fit: cover;
      border-radius: var(--radius-sm);
      flex-shrink: 0;
    }
    .meal-log-row {
      display: flex;
      gap: 12px;
      padding: 12px;
      align-items: flex-start;
    }
    .meal-log-info { flex: 1; }
    .meal-log-time { font-size: 11px; color: var(--text3); font-weight: 700; margin-bottom: 4px; }
    .meal-log-analysis { font-size: 13px; color: var(--text2); line-height: 1.45; }
    .meal-log-macros {
      display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap;
    }
    .macro-pill {
      padding: 3px 8px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 800;
      background: var(--surface3);
      color: var(--text3);
    }
    .macro-pill.protein { background: rgba(184,118,58,0.2); color: var(--fire); }
    .macro-pill.carbs   { background: rgba(107,127,168,0.2); color: var(--phase3); }
    .macro-pill.fat     { background: rgba(191,160,96,0.2); color: var(--gold); }
    .macro-pill.cals    { background: rgba(107,158,126,0.2); color: var(--success); }

    /* Log mode tabs (Photo / Describe) */
    .log-mode-tab {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 9px 0;
      background: transparent;
      border: none;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text3);
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s;
    }
    .log-mode-tab.active {
      background: var(--surface3);
      color: var(--text);
    }
    .log-mode-tab svg { flex-shrink: 0; }

    /* Meal type picker grid */
    .meal-type-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 4px;
    }
    .meal-type-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 10px 6px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 10px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text2);
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s;
    }
    .meal-type-btn:active { transform: scale(0.96); }
    .meal-type-btn.selected {
      background: var(--fire-glow);
      border-color: var(--fire);
      color: var(--fire);
    }
    .meal-type-btn span { font-size: 20px; }

    .api-key-notice {
      margin: 0 16px;
      padding: 14px 16px;
      background: rgba(184,118,58,0.08);
      border: 1px solid rgba(184,118,58,0.3);
      border-radius: var(--radius-md);
      font-size: 13px;
      color: var(--text3);
      line-height: 1.5;
    }

    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: var(--text3);
    }
    .empty-state-emoji { font-size: 48px; margin-bottom: 12px; }
    .empty-state-title { font-size: 18px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
    .empty-state-sub { font-size: 14px; line-height: 1.5; }

    /* ============================================================
       UTILITIES
    ============================================================ */
    .mt-4 { margin-top: 4px; }
    .mt-8 { margin-top: 8px; }
    .mt-14 { margin-top: 14px; }
    .mt-20 { margin-top: 20px; }
    .pb-4 { padding-bottom: 4px; }
    .text-fire { color: var(--fire); }
    .text-gold { color: var(--gold); }
    .text-success { color: var(--success); }
    .text-muted { color: var(--text3); }
    .font-bold { font-weight: 700; }
    .font-heavy { font-weight: 900; }
    .divider {
      height: 1px;
      background: var(--border);
      margin: 16px 0;
    }
    .inline-tag {
      display: inline-block;
      padding: 3px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      background: var(--surface3);
      color: var(--text3);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
/* ============================================================
   CHAT FAB + PANEL
============================================================ */
#chat-fab {
  position: fixed;
  right: 20px;
  bottom: calc(72px + env(safe-area-inset-bottom) + 16px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--fire);
  border: none;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(184,118,58,0.5);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#chat-fab:active { transform: scale(0.93); box-shadow: 0 2px 10px rgba(184,118,58,0.4); }
#chat-fab-icon { line-height: 1; }

.chat-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 16px 0 0;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--border);
}
.chat-context-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fire);
}
.chat-close {
  background: var(--surface3);
  border: none;
  color: var(--text3);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-chips {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chip {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.chat-chip:active { background: var(--surface3); border-color: var(--fire); color: var(--fire); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: 46vh;
}
.chat-bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.user {
  background: var(--fire);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.coach {
  background: var(--surface2);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.chat-bubble.typing {
  background: var(--surface2);
  color: var(--text3);
  align-self: flex-start;
  border: 1px solid var(--border);
  font-style: italic;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--text);
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  -webkit-appearance: none;
  font-family: inherit;
}
.chat-input:focus { outline: none; border-color: var(--fire); }
.chat-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--fire);
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.chat-send:active { transform: scale(0.92); }
.chat-send:disabled { background: var(--surface3); color: var(--text3); }

/* ============================================================
   VIDEO EMBEDS
============================================================ */
.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 14px;
}
.video-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
