/*
 * Rogue Origin — Scoreboard V2: Cockpit
 * Aesthetic: Fighter jet HUD × luxury chronograph × mission control × ambient theater
 * Typography: Bebas Neue (hero), JetBrains Mono 500 (data), Manrope 300 (labels)
 * Palette: Near-black green undertone, warm cream, living gold, ambient status colors
 * Layout: COCKPIT — hero center stage, left instrument, right cluster, bottom strip
 * Written: February 2026 — Pass 5 radical redesign
 */

/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
  /* --- Background & Surfaces --- */
  --bg: #141918;
  --bg-green-tint: #151a18;
  --surface: #1c2220;
  --surface-raised: #242a28;
  --surface-glass: rgba(255, 255, 255, 0.035);
  --border: rgba(228, 170, 79, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(228, 170, 79, 0.3);

  /* --- Core Palette --- */
  --gold: #f7cc7a;
  --gold-dim: rgba(245, 195, 109, 0.15);
  --gold-glow: rgba(245, 195, 109, 0.12);
  --cream: #f2efe8;
  --cream-soft: rgba(242, 239, 232, 0.85);
  --cream-muted: rgba(242, 239, 232, 0.5);
  --cream-whisper: rgba(242, 239, 232, 0.22);
  --muted: #8a8578;

  /* --- Signal Colors (TV-readable) --- */
  --green: #5fbd84;
  --green-dim: rgba(95, 189, 132, 0.18);
  --green-glow: rgba(95, 189, 132, 0.15);
  --yellow: #e5bc55;
  --yellow-dim: rgba(229, 188, 85, 0.18);
  --red: #d97465;
  --red-dim: rgba(217, 116, 101, 0.18);
  --red-glow: rgba(217, 116, 101, 0.12);

  /* Legacy compat aliases */
  --lux-black: #060807;
  --lux-bg: var(--bg);
  --lux-surface: var(--surface);
  --lux-surface-raised: var(--surface-raised);
  --lux-surface-glass: var(--surface-glass);
  --lux-border: var(--border);
  --lux-border-subtle: var(--border-subtle);
  --lux-border-accent: var(--border-accent);
  --lux-gold: var(--gold);
  --lux-gold-dim: var(--gold-dim);
  --lux-gold-glow: var(--gold-glow);
  --lux-cream: var(--cream);
  --lux-cream-soft: var(--cream-soft);
  --lux-cream-muted: var(--cream-muted);
  --lux-cream-whisper: var(--cream-whisper);
  --lux-green: var(--green);
  --lux-green-dim: var(--green-dim);
  --lux-green-glow: var(--green-glow);
  --lux-red: var(--red);
  --lux-red-dim: var(--red-dim);
  --lux-yellow: var(--yellow);
  --lux-yellow-dim: var(--yellow-dim);
  --status-green: var(--green);
  --status-yellow: var(--yellow);
  --status-red: var(--red);
  --status-gray: #6b7370;

  /* --- Typography --- */
  --font-hero: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
  --font-data: 'JetBrains Mono', 'Space Mono', 'Courier New', monospace;
  --font-ui: 'Manrope', 'Inter', system-ui, sans-serif;

  /* --- Spacing --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* --- Radii --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-cinematic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast: 0.15s;
  --t-normal: 0.3s;
  --t-smooth: 0.6s;
  --t-dramatic: 1s;

  /* --- Layout --- */
  --header-height: 60px;
  --bottom-height: 28vh;
  --scale-size: 200px;
  --timer-size: 220px;
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */
@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.9; }
}

@keyframes glowBreathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes glowBreatheYellow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.92; }
}

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

@keyframes timerPulseRed {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(196, 92, 74, 0.4)) drop-shadow(0 0 20px rgba(196, 92, 74, 0.2)); }
  50% { filter: drop-shadow(0 0 14px rgba(196, 92, 74, 0.65)) drop-shadow(0 0 32px rgba(196, 92, 74, 0.35)); }
}

@keyframes timerPulseYellow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(212, 168, 67, 0.3)); }
  50% { filter: drop-shadow(0 0 10px rgba(212, 168, 67, 0.55)); }
}

@keyframes ringPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(196, 92, 74, 0.3)); }
  50% { filter: drop-shadow(0 0 14px rgba(196, 92, 74, 0.7)); }
}

@keyframes panelPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(228, 170, 79, 0.5), 0 0 24px rgba(228, 170, 79, 0.2); }
  50% { box-shadow: 0 0 16px rgba(228, 170, 79, 0.7), 0 0 32px rgba(228, 170, 79, 0.3); }
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 158, 107, 0); }
  50% { box-shadow: 0 0 0 8px rgba(74, 158, 107, 0.12); }
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(74, 158, 107, 0.6); }
  50% { box-shadow: 0 0 12px rgba(74, 158, 107, 0.9); }
}

@keyframes breakGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

@keyframes blueBreakGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes redBackgroundPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.92; }
}

@keyframes revealDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes confettiFall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes celebrateText {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  30% { transform: translate(-50%, -50%) scale(1); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ambientShift {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.05) translate(-1%, 1%); }
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  transition: background var(--t-dramatic) var(--ease-cinematic);
}

/* ========================================
   NOISE GRAIN OVERLAY (~3% opacity)
   ======================================== */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Legacy body::before noise — keep for compat */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: overlay;
  opacity: 0;
}

/* Radial vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   AMBIENT COLOR SYSTEM
   Body classes drive entire room mood
   ======================================== */

/* --- Production status backgrounds --- */
body.ahead {
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(74, 158, 107, 0.14) 0%, var(--bg) 70%);
}

body.on-target {
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(212, 168, 67, 0.10) 0%, var(--bg) 70%);
}

body.behind {
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(196, 92, 74, 0.12) 0%, var(--bg) 70%);
}

body.idle {
  background-color: var(--bg);
  background-image: none;
}

/* --- Timer-derived ambient --- */
body.timer-green {
  background: radial-gradient(ellipse 60% 55% at 50% 42%, rgba(74, 158, 107, 0.12) 0%, var(--bg) 65%);
}

body.timer-yellow {
  background: radial-gradient(ellipse 65% 60% at 50% 42%, rgba(212, 168, 67, 0.14) 0%, var(--bg) 65%);
  animation: glowBreatheYellow 4s ease-in-out infinite;
}

body.timer-red {
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(196, 92, 74, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 40%, rgba(196, 92, 74, 0.08) 100%),
    var(--bg);
  animation: urgentPulse 1.5s ease-in-out infinite;
}

body.timer-neutral {
  background-color: var(--bg);
  background-image: none;
}

/* ========================================
   SKIP LINK
   ======================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 24px;
  background: var(--gold);
  color: var(--lux-black);
  font-weight: 700;
  border-radius: var(--r-md);
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--gold);
}

/* ========================================
   MORNING REPORT (full-screen overlay)
   ======================================== */
#morningReportContainer {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 6000;
  overflow-y: auto;
  padding: var(--sp-6);
}

#morningReportContainer.active {
  display: block;
}

.mr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-7);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.mr-title {
  font-family: var(--font-hero);
  font-size: 32px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.02em;
}

.mr-subtitle {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--gold);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.mr-back-btn {
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: var(--r-md);
  color: var(--gold);
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast) var(--ease-out);
}

.mr-back-btn:hover {
  background: var(--gold-dim);
}

/* ========================================
   HISTORICAL DATE BANNER
   ======================================== */
.historical-date-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(228, 170, 79, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-accent);
  padding: 10px var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.historical-banner-content {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--cream-soft);
}

.historical-banner-content i {
  color: var(--gold);
  font-size: 18px;
}

.historical-banner-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 700;
  color: var(--cream-muted);
}

.historical-banner-date {
  font-family: var(--font-data);
  color: var(--gold);
  font-weight: 700;
}

.historical-banner-close {
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: var(--r-sm);
  color: var(--gold);
  padding: 6px 16px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t-fast);
}

.historical-banner-close:hover {
  background: var(--gold-dim);
}

/* ========================================
   TOP BAR — 60px header, thin, stays out of the way
   ======================================== */
.hud-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-7);
  z-index: 100;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(28, 34, 32, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Status color strip on header bottom */
.hud-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--gold-dim) 20%, rgba(228, 170, 79, 0.25) 50%, var(--gold-dim) 80%, transparent 95%);
  transition: background var(--t-smooth) var(--ease-cinematic);
}

body.ahead .hud-header::after {
  background: linear-gradient(90deg, transparent 5%, rgba(95, 189, 132, 0.15) 20%, rgba(95, 189, 132, 0.5) 50%, rgba(95, 189, 132, 0.15) 80%, transparent 95%);
}

body.behind .hud-header::after {
  background: linear-gradient(90deg, transparent 5%, rgba(217, 116, 101, 0.15) 20%, rgba(217, 116, 101, 0.5) 50%, rgba(217, 116, 101, 0.15) 80%, transparent 95%);
}

body.on-target .hud-header::after {
  background: linear-gradient(90deg, transparent 5%, rgba(229, 188, 85, 0.15) 20%, rgba(229, 188, 85, 0.5) 50%, rgba(229, 188, 85, 0.15) 80%, transparent 95%);
}

.strain-display {
  position: relative;
  z-index: 100;
}

.strain-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 2px;
}

.strain-name {
  font-family: var(--font-hero);
  font-size: 24px;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.04em;
  line-height: 1.1;
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.strain-rate-indicator {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--cream-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* Center marker — status badge */
.hud-center-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Clock */
.time-display {
  text-align: right;
  z-index: 100;
  position: relative;
}

.time-display .time {
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-display .date {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ========================================
   STATUS BADGE — Header center, gentle pulse
   ======================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 28px;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(228, 170, 79, 0.06);
  color: var(--gold);
  border: 1px solid rgba(228, 170, 79, 0.12);
  transition: all var(--t-normal) var(--ease-out);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: statusPulse 4s ease-in-out infinite;
}

.status-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.status-badge.ahead,
body.ahead .status-badge {
  background: rgba(95, 189, 132, 0.18);
  color: var(--green);
  border-color: rgba(95, 189, 132, 0.35);
  box-shadow: 
    0 0 32px rgba(95, 189, 132, 0.25), 
    0 0 60px rgba(95, 189, 132, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.status-badge.behind,
body.behind .status-badge {
  background: rgba(217, 116, 101, 0.18);
  color: var(--red);
  border-color: rgba(217, 116, 101, 0.35);
  box-shadow: 
    0 0 32px rgba(217, 116, 101, 0.25), 
    0 0 60px rgba(217, 116, 101, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.status-badge.on-target,
body.on-target .status-badge {
  background: rgba(229, 188, 85, 0.18);
  color: var(--yellow);
  border-color: rgba(229, 188, 85, 0.35);
  box-shadow: 
    0 0 32px rgba(229, 188, 85, 0.25), 
    0 0 60px rgba(229, 188, 85, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ========================================
   TIME CONTROLS
   ======================================== */
.time-controls {
  position: fixed;
  top: calc(var(--header-height) + var(--sp-3));
  left: var(--sp-7);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.start-day-btn {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 8px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast) var(--ease-out);
}

.start-day-btn:hover { background: var(--green-dim); }
.start-day-btn.pulse-green { animation: subtlePulse 2s ease-in-out infinite; }

.started-badge {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--cream-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}

.started-badge:hover { background: rgba(255, 255, 255, 0.04); }
.started-badge i { color: var(--gold); font-size: 14px; }

.date-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#morningReportBtn,
.historical-view-btn,

/* Lang / TV toggle — moved to FAB menu */
.lang-toggle {
  display: none !important;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--cream-muted);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  text-decoration: none;
  min-width: 36px;
  min-height: 36px;
}

.lang-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }
.lang-btn.active { color: var(--gold); border-color: var(--border-accent); }
.lang-btn i { font-size: 16px; }
.complaints-btn { color: var(--red); }
.help-btn { display: none !important; }

/* ========================================
   COCKPIT LAYOUT — The main stage
   Absolutely positioned regions overlapping
   ======================================== */
.cockpit {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* ========================================
   CENTER STAGE — 60% viewport height
   Hero number CENTERED, IS the page
   ======================================== */
.center-stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(100% - var(--bottom-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.center-stage > * {
  pointer-events: auto;
}

/* Radial spotlight on hero area */
.hero-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 80vw;
  height: 60vh;
  background: radial-gradient(ellipse at center, rgba(228, 170, 79, 0.06) 0%, rgba(228, 170, 79, 0.02) 30%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  transition: background var(--t-dramatic) var(--ease-cinematic);
}

body.ahead .hero-spotlight {
  background: radial-gradient(ellipse at center, rgba(95, 189, 132, 0.08) 0%, rgba(95, 189, 132, 0.02) 30%, transparent 60%);
}

body.behind .hero-spotlight {
  background: radial-gradient(ellipse at center, rgba(217, 116, 101, 0.08) 0%, rgba(217, 116, 101, 0.02) 30%, transparent 60%);
}

body.on-target .hero-spotlight {
  background: radial-gradient(ellipse at center, rgba(229, 188, 85, 0.07) 0%, rgba(229, 188, 85, 0.02) 30%, transparent 60%);
}

/* Status float ABOVE hero */
.hero-status-float {
  margin-bottom: var(--sp-2);
}

.daily-delta {
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 700;
  padding: 10px 32px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  transition: all var(--t-normal) var(--ease-out);
}

.daily-delta.positive {
  color: var(--green);
  background: var(--green-dim);
  box-shadow: 
    0 0 32px rgba(95, 189, 132, 0.25), 
    0 0 60px rgba(95, 189, 132, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.daily-delta.negative {
  color: var(--red);
  background: var(--red-dim);
  box-shadow: 
    0 0 32px rgba(217, 116, 101, 0.25), 
    0 0 60px rgba(217, 116, 101, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.daily-delta.neutral {
  color: var(--cream-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ====== THE HERO NUMBER ====== */
.hero-daily {
  text-align: center;
  position: relative;
  line-height: 1;
}

.daily-actual {
  font-family: var(--font-hero);
  font-size: clamp(180px, 22vw, 380px);
  font-weight: 400;
  color: var(--cream);
  line-height: 0.9;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 60px rgba(245, 195, 109, 0.22),
    0 0 120px rgba(245, 195, 109, 0.12),
    0 0 200px rgba(242, 239, 232, 0.08);
  transition: text-shadow var(--t-dramatic) var(--ease-cinematic);
}

/* Ambient color bleeds into hero text-shadow */
body.timer-green .daily-actual,
body.ahead .daily-actual {
  text-shadow:
    0 0 60px rgba(95, 189, 132, 0.15),
    0 0 120px rgba(95, 189, 132, 0.08),
    0 0 200px rgba(95, 189, 132, 0.04);
}

body.timer-yellow .daily-actual,
body.on-target .daily-actual {
  text-shadow:
    0 0 60px rgba(229, 188, 85, 0.15),
    0 0 120px rgba(229, 188, 85, 0.08),
    0 0 200px rgba(229, 188, 85, 0.04);
}

body.timer-red .daily-actual,
body.behind .daily-actual {
  text-shadow:
    0 0 60px rgba(217, 116, 101, 0.15),
    0 0 120px rgba(217, 116, 101, 0.08),
    0 0 200px rgba(217, 116, 101, 0.04);
}

/* Goal + progress below hero */
.hero-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--sp-2);
  gap: var(--sp-2);
}

.hero-goal {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.daily-sep {
  font-family: var(--font-data);
  font-size: 28px;
  color: var(--muted);
  font-weight: 400;
}

.daily-target {
  font-family: var(--font-data);
  font-size: 26px;
  color: var(--cream-muted);
  font-weight: 500;
}

.daily-unit {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

/* Progress bar — 60% width, centered */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: min(60vw, 600px);
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  border-radius: 5px;
  transition: width var(--t-smooth) var(--ease-out);
  position: relative;
  box-shadow: 0 0 12px rgba(245, 195, 109, 0.3);
}

body.ahead .progress-fill {
  background: linear-gradient(90deg, var(--green), #7dd9a3);
  box-shadow: 0 0 12px rgba(95, 189, 132, 0.35);
}

body.behind .progress-fill {
  background: linear-gradient(90deg, var(--red), #e89485);
  box-shadow: 0 0 12px rgba(217, 116, 101, 0.35);
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -3px;
  bottom: -3px;
  width: 16px;
  background: var(--gold);
  border-radius: 8px;
  animation: progressGlow 2s ease-in-out infinite;
}

body.ahead .progress-fill::after { background: var(--green); }
body.behind .progress-fill::after { background: var(--red); }

.progress-hours {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--cream-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

/* Projection row */
.daily-projection {
  margin-top: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-data);
  font-size: 13px;
}

.projection-label {
  color: var(--cream-muted);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.projection-value {
  color: var(--cream);
  font-weight: 700;
  font-size: 26px;
  text-shadow: 
    0 0 16px rgba(242, 239, 232, 0.1);
}

.projection-goal {
  color: var(--cream-muted);
  font-size: 18px;
}

.projection-delta {
  font-weight: 700;
  font-size: 24px;
}

.projection-delta.positive { color: var(--green); }
.projection-delta.negative { color: var(--red); }

/* Smalls display */
.smalls-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--cream-muted);
  opacity: 0.7;
}

.smalls-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.smalls-value {
  font-weight: 600;
  color: var(--cream-soft);
}

.smalls-unit {
  font-size: 11px;
}

/* Hidden compat wrappers */
.daily-header { display: none; }
.daily-numbers { display: none; }
.daily-progress { display: contents; }

/* ========================================
   LEFT INSTRUMENT — Overlapping center-left
   Glass cards, info bar, comparisons
   ======================================== */
.left-instrument {
  position: absolute;
  top: var(--sp-5);
  left: var(--sp-6);
  width: clamp(280px, 28vw, 420px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-height: calc(100% - var(--bottom-height) - var(--sp-7));
  overflow-y: auto;
  scrollbar-width: none;
}

.left-instrument::-webkit-scrollbar { display: none; }

/* Hour Cards */
.hour-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.hour-card {
  background: rgba(28, 34, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all var(--t-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.hour-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228, 170, 79, 0.12), transparent);
}

.hour-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(245, 195, 109, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hour-card-header {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cream-muted);
  margin-bottom: var(--sp-1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hour-card-header i {
  font-size: 12px;
  color: var(--gold);
}

.hour-card-timeslot {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--cream-muted);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.08em;
}

.lbs-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.actual-lbs {
  font-family: var(--font-hero);
  font-size: 72px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 
    0 0 24px rgba(242, 239, 232, 0.1),
    0 0 48px rgba(245, 195, 109, 0.06);
}

.separator {
  font-family: var(--font-data);
  font-size: 26px;
  color: var(--muted);
  font-weight: 400;
}

.target-lbs {
  font-family: var(--font-data);
  font-size: 32px;
  color: var(--cream-muted);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.lbs-unit {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 0;
  opacity: 0.6;
}

.percentage-display {
  margin-top: var(--sp-2);
}

.percentage-value {
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
  text-shadow: 
    0 0 14px rgba(242, 239, 232, 0.08);
}

.percentage-value.positive,
.percentage-value.green { 
  color: var(--green); 
  text-shadow: 
    0 0 12px rgba(95, 189, 132, 0.15);
}
.percentage-value.negative,
.percentage-value.red { 
  color: var(--red);
  text-shadow: 
    0 0 12px rgba(217, 116, 101, 0.15);
}

.percentage-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
  margin-top: 2px;
}

.hour-card.current-hour {
  border-color: rgba(228, 170, 79, 0.1);
}

.hour-card.current-hour::before {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.2;
}

/* Info Bar — Horizontal strip */
.info-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(28, 34, 32, 0.45);
  border: 1px solid rgba(228, 170, 79, 0.08);
  border-radius: var(--r-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  flex-wrap: wrap;
}

.info-section {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 500;
  color: var(--cream-soft);
}

.info-icon {
  color: var(--gold);
  font-size: 18px;
  display: flex;
}

.info-divider {
  width: 1px;
  height: 14px;
  background: var(--border-subtle);
}

.avg-best-container {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.avg-best-container.hidden { display: none; }

.stat-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.stat-group .label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

.stat-group .value {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.avg-best-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: color var(--t-fast);
}

.avg-best-toggle:hover { color: var(--gold); }

/* Comparisons */
.comparisons {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.comparison-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-family: var(--font-data);
  font-size: 11px;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all var(--t-fast);
}

.comparison-pill:hover {
  border-color: var(--border-accent);
}

.comparison-label {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.comparison-value {
  font-weight: 500;
  color: var(--cream);
}

.comparison-value.positive { color: var(--green); }
.comparison-value.negative { color: var(--red); }
.comparison-value.neutral { color: var(--cream-muted); }

.streak-pill {
  border-color: rgba(228, 170, 79, 0.25);
  background: rgba(228, 170, 79, 0.08);
}
.streak-icon { color: var(--gold); font-size: 18px; display: flex; }
.streak-value {
  font-family: var(--font-data);
  font-weight: 700;
  color: var(--gold);
  font-size: 18px;
}

/* ========================================
   ORDER QUEUE
   ======================================== */

.expand-icon {
  font-size: 10px;
  color: var(--muted);
  transition: transform var(--t-fast);
}

/* ========================================
   RIGHT INSTRUMENT CLUSTER
   Positioned absolute, center-right
   Scale ring + Timer ring + bag stats + button
   ======================================== */
.timer-panel {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-6);
  width: clamp(260px, 24vw, 380px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  max-height: calc(100% - var(--bottom-height) - var(--sp-7));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transition: all var(--t-smooth) var(--ease-out);
  background: rgba(28, 34, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.timer-panel::-webkit-scrollbar { display: none; }

/* Timer panel state accents — glow at the edge */
.timer-panel.green::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(74, 158, 107, 0.3), transparent);
  pointer-events: none;
}

.timer-panel.yellow::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(212, 168, 67, 0.3), transparent);
  pointer-events: none;
}

.timer-panel.red::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(196, 92, 74, 0.3), transparent);
  pointer-events: none;
  animation: panelPulse 1.5s ease-in-out infinite;
}

.timer-panel.neutral::before {
  content: none;
}

.drag-handle { display: none; }
.expand-hint { display: none; }

.fullscreen-toggle {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  display: flex;
  z-index: 10;
}

.fullscreen-toggle:hover { color: var(--gold); background: var(--gold-dim); }

/* ========================================
   SCALE RING — 200px, metallic bezel, top-right
   ======================================== */
.scale-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scale-header,
.timer-header {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cream-muted);
  margin-bottom: var(--sp-2);
}

.scale-display {
  position: relative;
  width: var(--scale-size);
  height: var(--scale-size);
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(245, 195, 109, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.timer-display {
  position: relative;
  width: var(--timer-size);
  height: var(--timer-size);
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(245, 195, 109, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.scale-ring,
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-ticks line {
  transition: stroke var(--t-normal);
}

.ring-ticks line.major {
  stroke-opacity: 0.35;
}

.ring-ticks line.minor {
  stroke-opacity: 0.08;
}

.scale-ring-bg,
.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.035);
  stroke-width: 2;
}

.scale-ring-progress {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.timer-ring-progress {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-ring-progress.green {
  stroke: var(--green);
}

.timer-ring-progress.yellow {
  stroke: var(--yellow);
  animation: timerPulseYellow 4s ease-in-out infinite;
}

.timer-ring-progress.red {
  stroke: var(--red);
  animation: timerPulseRed 1.5s ease-in-out infinite;
}

.timer-ring-progress.neutral {
  stroke: var(--cream-whisper);
  filter: none;
}

/* Ring glow layers */
.scale-ring-glow,
.timer-ring-glow {
  transition: opacity var(--t-smooth);
}

body.timer-green .timer-ring-glow { opacity: 0.3; }
body.timer-yellow .timer-ring-glow { opacity: 0.5; animation: glowBreatheYellow 4s ease-in-out infinite; }
body.timer-red .timer-ring-glow { opacity: 0.7; animation: glowBreathe 1.5s ease-in-out infinite; }

/* Center readout */
.scale-center,
.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scale-value {
  font-family: var(--font-hero);
  font-size: 44px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 
    0 0 16px rgba(242, 239, 232, 0.08);
}

.timer-value {
  font-family: var(--font-hero);
  font-size: 52px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 
    0 0 16px rgba(242, 239, 232, 0.08);
}

.timer-value.green { 
  color: var(--green);
  text-shadow: 
    0 0 20px rgba(95, 189, 132, 0.2);
}
.timer-value.yellow { 
  color: var(--yellow);
  text-shadow: 
    0 0 20px rgba(229, 188, 85, 0.2);
}
.timer-value.red { 
  color: var(--red);
  text-shadow: 
    0 0 20px rgba(217, 116, 101, 0.2);
}
.timer-value.neutral { 
  color: var(--cream-muted);
  text-shadow: 
    0 0 12px rgba(242, 239, 232, 0.06);
}

.scale-label,
.timer-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  margin-top: 4px;
  max-width: 100%;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
}

.scale-status-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-gray);
  transition: all var(--t-fast);
}

.scale-status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 158, 107, 0.6);
  animation: dotPulse 3s ease-in-out infinite;
}

.scale-status-dot.stale { background: var(--red); }

.scale-display.filling .scale-ring-progress { stroke: var(--gold); }
.scale-display.near-target .scale-ring-progress { stroke: var(--yellow); }
.scale-display.at-target .scale-ring-progress { stroke: var(--green); }

.timer-target {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--cream-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ========================================
   BAG STATS — Tight row below rings
   ======================================== */
.timer-stats {
  display: flex;
  gap: var(--sp-2);
  width: 100%;
}

.timer-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--t-fast);
}

.timer-stat:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.025);
}

.timer-stat-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
  margin-bottom: 3px;
}

.timer-stat-value {
  font-family: var(--font-data);
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  text-shadow: 
    0 0 10px rgba(242, 239, 232, 0.06);
}

.timer-stat-value.positive { 
  color: var(--green);
  text-shadow: 
    0 0 12px rgba(95, 189, 132, 0.12);
}
.timer-stat-value.negative { 
  color: var(--red);
  text-shadow: 
    0 0 12px rgba(217, 116, 101, 0.12);
}

/* ========================================
   BUTTON ROW — 5KG Bag Complete + Pause
   ======================================== */
.timer-btn-row {
  display: flex;
  gap: var(--sp-2);
  width: 100%;
}

.manual-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px var(--sp-4);
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: var(--r-md);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.manual-btn .icon { font-size: 18px; display: flex; }
.manual-btn:hover {
  background: var(--gold-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(228, 170, 79, 0.15);
}
.manual-btn:active { transform: translateY(0); }

.manual-btn.btn-green { border-color: var(--green); color: var(--green); }
.manual-btn.btn-green:hover { background: var(--green-dim); }
.manual-btn.btn-yellow { border-color: var(--yellow); color: var(--yellow); }
.manual-btn.btn-red { border-color: var(--red); color: var(--red); }
.manual-btn.btn-red:hover { background: var(--red-dim); }
.manual-btn.btn-neutral { border-color: var(--cream-whisper); color: var(--cream-muted); }

.manual-btn.loading { opacity: 0.6; pointer-events: none; }
.manual-btn.success { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.manual-btn.error { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.pause-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--cream-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.pause-btn:hover { border-color: var(--border-accent); color: var(--gold); }
.pause-btn.paused {
  border-color: #f97316;
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

/* ========================================
   BOTTOM STRIP — 25vh
   Left 60%: Chart | Right 40%: Cycle History
   ======================================== */
.bottom-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-height);
  display: flex;
  z-index: 15;
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-4) var(--sp-6);
  gap: var(--sp-5);
}

/* Left: Chart */
.chart-container {
  flex: 8;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  transition: all var(--t-normal) var(--ease-out);
}

.chart-header {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.chart-smalls-toggle {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2px 10px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.chart-smalls-toggle:hover {
  color: var(--cream);
  border-color: var(--border);
}
.chart-smalls-toggle.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold);
}

.chart-wrapper {
  position: relative;
  height: calc(var(--bottom-height) - 70px);
  overflow: visible;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Right: Cycle History */
.cycle-history {
  flex: 2;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.cycle-history::-webkit-scrollbar { display: none; }

.cycle-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.cycle-history-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

.cycle-history-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.cycle-nav-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--cream-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.cycle-nav-btn:hover { border-color: var(--border-accent); color: var(--gold); }

.cycle-mode-label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--cream-muted);
  min-width: 48px;
  text-align: center;
}

.cycle-history-toggle,
#cycleToggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast);
}

.cycle-history-toggle:hover { color: var(--gold); }

.cycle-content {
  transition: all var(--t-normal) var(--ease-out);
}

.cycle-history.collapsed .cycle-content { display: none; }

/* ========================================
   CYCLE HISTORY — All 5 modes
   ======================================== */

/* --- Stats Bar --- */
.cycle-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}

.cycle-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 2px;
}

.cycle-stat-value {
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cycle-stat-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

/* --- Cycle Donut Mode --- */
.cycle-donut {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.cycle-donut-ring {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.cycle-donut-ring canvas,
.cycle-donut-ring svg {
  width: 100%;
  height: 100%;
}

.cycle-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cycle-donut-count {
  font-family: var(--font-hero);
  font-size: 36px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
}

.cycle-donut-label {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 300;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* Donut legend (early/late counts) */
.cycle-donut-legend,
.cycle-donut-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cycle-donut-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cycle-donut-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--cream-muted);
}

.cycle-donut-stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cycle-donut-stat-value {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
}

.cycle-donut-latest {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.cycle-donut-latest-label {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 300;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 5px;
}

.cycle-donut-latest-items {
  display: flex;
  gap: 5px;
}

.cycle-donut-latest-item {
  flex: 1;
  padding: 5px;
  border-radius: var(--r-sm);
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
}

.cycle-donut-latest-time {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
}

.cycle-donut-latest-num {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--muted);
}

/* --- Cycle Sparkline Mode --- */
.cycle-sparkline {
  display: flex;
  flex-direction: column;
}

.cycle-sparkline-bars {
  position: relative;
  height: calc(var(--bottom-height) - 90px);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-bottom: 2px;
}

.cycle-sparkline-bar {
  flex: 1;
  min-width: 5px;
  max-width: 18px;
  border-radius: 4px 4px 0 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  cursor: default;
  position: relative;
}

.cycle-sparkline-bar:hover { opacity: 0.75; }
.cycle-sparkline-bar.early { background: var(--green); }
.cycle-sparkline-bar.on-time { background: var(--yellow); }
.cycle-sparkline-bar.overtime { background: var(--red); }

.cycle-sparkline-target {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--muted);
  pointer-events: none;
}

.cycle-sparkline-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 10;
  color: var(--cream);
  border: 1px solid var(--border-subtle);
}

.cycle-sparkline-bar:hover .cycle-sparkline-tooltip { opacity: 1; }

.cycle-sparkline-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Cycle Chips Mode --- */
.cycle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cycle-chip {
  padding: 4px 10px;
  min-width: 36px;
  height: 28px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  cursor: default;
  transition: transform var(--t-fast);
  position: relative;
}

.cycle-chip:hover { transform: scale(1.15); }

.cycle-chip.early {
  background: rgba(74, 158, 107, 0.2);
  color: var(--green);
  border: 1px solid rgba(74, 158, 107, 0.25);
}

.cycle-chip.on-time {
  background: rgba(212, 168, 67, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(212, 168, 67, 0.25);
}

.cycle-chip.overtime {
  background: rgba(196, 92, 74, 0.15);
  color: var(--red);
  border: 1px solid rgba(196, 92, 74, 0.25);
}

.cycle-chip-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  color: var(--cream);
  margin-bottom: 4px;
  z-index: 10;
  border: 1px solid var(--border-subtle);
}

.cycle-chip:hover .cycle-chip-tooltip { opacity: 1; }

.cycle-chips-legend {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: 10px;
}

.cycle-chips-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--cream-muted);
  font-family: var(--font-data);
}

.cycle-chips-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* --- Cycle Cards Mode --- */
.cycle-cards {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.cycle-cards::-webkit-scrollbar { height: 3px; }
.cycle-cards::-webkit-scrollbar-track { background: transparent; }
.cycle-cards::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 2px; }

.cycle-card {
  min-width: 74px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  text-align: center;
  flex-shrink: 0;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cycle-card:hover { border-color: var(--border-accent); }

.cycle-card.early { border-color: rgba(74, 158, 107, 0.12); }
.cycle-card.early::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--green);
  opacity: 0.4;
}

.cycle-card.overtime { border-color: rgba(196, 92, 74, 0.12); }
.cycle-card.overtime::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  opacity: 0.4;
}

.cycle-card .cycle-card-num,
.cycle-card-num {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--muted);
}

.cycle-card .cycle-card-time,
.cycle-card-time {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.cycle-card.early .cycle-card-time { color: var(--green); }
.cycle-card.on-time .cycle-card-time { color: var(--yellow); }
.cycle-card.overtime .cycle-card-time { color: var(--red); }

.cycle-card-delta {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
}

.cycle-card-delta.positive { color: var(--green); }
.cycle-card-delta.negative { color: var(--red); }

.cycle-card-meta {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cycle-card-trimmers {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--cream-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.carryover-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: rgba(228, 170, 79, 0.08);
  border: 1px solid rgba(228, 170, 79, 0.12);
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.cycle-card-progress {
  margin-top: 4px;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1px;
  overflow: hidden;
}

.cycle-card-progress-bar {
  height: 100%;
  border-radius: 1px;
  background: var(--gold);
  transition: width var(--t-normal) var(--ease-out);
}

.cycle-card.early .cycle-card-progress-bar { background: var(--green); }
.cycle-card.overtime .cycle-card-progress-bar { background: var(--red); }

/* --- Cycle List Mode --- */
.cycle-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(var(--bottom-height) - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.cycle-list::-webkit-scrollbar { width: 3px; }
.cycle-list::-webkit-scrollbar-track { background: transparent; }
.cycle-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 2px; }

.cycle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid transparent;
  box-shadow: 
    0 1px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  font-family: var(--font-data);
  font-size: 16px;
  color: var(--cream-soft);
  transition: all var(--t-fast);
}

.cycle-item:hover { border-color: var(--border-subtle); }

.cycle-item.early { border-left: 2px solid rgba(74, 158, 107, 0.3); }
.cycle-item.overtime { border-left: 2px solid rgba(196, 92, 74, 0.3); }

.cycle-item-num,
.cycle-item .cycle-num {
  color: var(--muted);
  font-size: 10px;
  min-width: 24px;
  font-family: var(--font-data);
}

.cycle-item-time,
.cycle-item .cycle-time {
  font-weight: 500;
  font-family: var(--font-data);
}

.cycle-item.early .cycle-time,
.cycle-item.early .cycle-item-time { color: var(--green); }
.cycle-item.on-time .cycle-time,
.cycle-item.on-time .cycle-item-time { color: var(--yellow); }
.cycle-item.overtime .cycle-time,
.cycle-item.overtime .cycle-item-time { color: var(--red); }

.cycle-item-delta,
.cycle-item .cycle-delta {
  font-size: 11px;
  font-family: var(--font-data);
}

.cycle-item-delta.positive,
.cycle-item .cycle-delta.positive { color: var(--green); }
.cycle-item-delta.negative,
.cycle-item .cycle-delta.negative { color: var(--red); }

.cycle-item-completed {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.cycle-item.carryover-badge { border-color: rgba(228, 170, 79, 0.08); }

/* ========================================
   CELEBRATION
   ======================================== */
.celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3000;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
}

.celebration-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-hero);
  font-size: 72px;
  font-weight: 400;
  color: var(--green);
  text-shadow:
    0 0 60px rgba(74, 158, 107, 0.6),
    0 0 120px rgba(74, 158, 107, 0.3);
  opacity: 0;
  animation: celebrateText 3s var(--ease-out) forwards;
  z-index: 3001;
  pointer-events: none;
  text-align: center;
  letter-spacing: -0.03em;
}

/* ========================================
   PAUSE MODAL & BANNER
   ======================================== */
.pause-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-normal) var(--ease-out), visibility var(--t-normal);
}

.pause-modal-overlay.visible { opacity: 1; visibility: visible; }

.pause-modal {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: var(--sp-7);
  max-width: 420px;
  width: 90%;
  border: 1px solid var(--border-accent);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.7), 
    0 0 80px rgba(245, 195, 109, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
  transform: scale(0.92);
  transition: transform var(--t-normal) var(--ease-spring);
}

.pause-modal-overlay.visible .pause-modal { transform: scale(1); }

.pause-modal-title {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.pause-modal-subtitle {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--cream-muted);
  margin-bottom: var(--sp-5);
  line-height: 1.5;
}

.pause-modal-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-5);
}

.pause-reason-btn {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--cream-soft);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all var(--t-fast) var(--ease-out);
  text-align: left;
}

.pause-reason-btn:hover { background: var(--gold-dim); border-color: var(--border-accent); }
.pause-reason-btn.selected { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }

.pause-custom-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--lux-black);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 14px;
  margin-bottom: var(--sp-5);
  transition: border-color var(--t-fast);
}

.pause-custom-input:focus { outline: none; border-color: var(--gold); }
.pause-custom-input::placeholder { color: var(--muted); }

.pause-modal-buttons { display: flex; gap: var(--sp-3); }

.pause-modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  border: none;
}

.pause-modal-btn.cancel {
  background: var(--surface);
  color: var(--cream-muted);
  border: 1px solid var(--border-subtle);
}
.pause-modal-btn.cancel:hover { background: var(--surface-raised); color: var(--cream); }
.pause-modal-btn.confirm { background: var(--gold); color: var(--lux-black); }
.pause-modal-btn.confirm:hover { filter: brightness(1.1); }
.pause-modal-btn.confirm:disabled { opacity: 0.35; cursor: not-allowed; }

/* Pause Banner */
.pause-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4000;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: 12px var(--sp-6);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform var(--t-normal) var(--ease-out);
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.3);
}

.pause-banner.visible { transform: translateY(0); }

.pause-banner-time {
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 500;
}

.pause-banner-reason { opacity: 0.85; font-size: 13px; }

/* ========================================
   START DAY MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: var(--sp-7);
  max-width: 480px;
  width: 90%;
  border: 1px solid var(--border-accent);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.7), 
    0 0 80px rgba(245, 195, 109, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.modal-title i { color: var(--gold); }

.modal-subtitle {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--cream-muted);
  margin-bottom: var(--sp-6);
  line-height: 1.5;
}

.time-input-wrapper { margin-bottom: var(--sp-5); }

.time-input-wrapper label {
  display: block;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

.time-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--lux-black);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--cream);
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 500;
  transition: border-color var(--t-fast);
}

.time-input:focus { outline: none; border-color: var(--gold); }

.impact-preview {
  background: var(--gold-glow);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--cream-soft);
}

.impact-preview i { color: var(--gold); font-size: 18px; }

.modal-actions { display: flex; gap: var(--sp-3); }

.btn-primary {
  flex: 1;
  padding: 12px 24px;
  background: var(--gold);
  color: var(--lux-black);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-secondary {
  flex: 1;
  padding: 12px 24px;
  background: var(--surface);
  color: var(--cream-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.btn-secondary:hover { background: var(--surface-raised); color: var(--cream); }

/* ========================================
   HELP MODAL
   ======================================== */
.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-normal) var(--ease-out), visibility var(--t-normal);
}

.help-modal.visible { opacity: 1; visibility: visible; }

.help-content {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: var(--sp-7);
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-accent);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.7), 
    0 0 80px rgba(245, 195, 109, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.help-content::-webkit-scrollbar { width: 4px; }
.help-content::-webkit-scrollbar-track { background: transparent; }
.help-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 2px; }

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.help-title {
  font-family: var(--font-hero);
  font-size: 28px;
  font-weight: 700;
  color: var(--cream);
}

.help-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--cream-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.help-close:hover { border-color: var(--border-accent); color: var(--gold); }

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.help-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.help-item-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: var(--sp-2);
}

.help-item-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--cream-soft);
  line-height: 1.5;
}

.help-colors {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.help-color {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--cream-soft);
}

.help-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.help-dot.green { background: var(--green); }
.help-dot.yellow { background: var(--yellow); }
.help-dot.red { background: var(--red); }

/* ========================================
   DEBUG PANEL
   ======================================== */
.debug-panel {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  z-index: 2000;
  min-width: 340px;
  max-width: 480px;
  display: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(245, 195, 109, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.debug-panel.active { display: block; }

.debug-indicator {
  position: fixed;
  top: var(--sp-2);
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2001;
  display: none;
}

body.debug-active .debug-indicator { display: block; }

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.debug-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--cream-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.debug-close:hover { border-color: var(--border-accent); color: var(--gold); }

.debug-controls {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.debug-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.debug-buttons {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.debug-buttons button {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--cream-soft);
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.debug-buttons button:hover { background: var(--gold-dim); border-color: var(--border-accent); color: var(--gold); }

.debug-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-2) 0;
}

.debug-reset {
  width: 100%;
  padding: 8px;
  background: rgba(196, 92, 74, 0.08);
  border: 1px solid rgba(196, 92, 74, 0.2);
  color: var(--red);
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}

.debug-reset:hover { background: rgba(196, 92, 74, 0.15); }

.debug-hint {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  margin-top: var(--sp-3);
  text-align: center;
}

.debug-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--cream-muted);
}

/* ========================================
   FAB MENU
   ======================================== */
.fab-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
  pointer-events: none;
}

.fab-button {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: var(--surface);
  color: var(--gold);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease-out);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.5), 
    0 0 20px rgba(245, 195, 109, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fab-button:hover {
  background: var(--gold-dim);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5), 0 0 30px rgba(228, 170, 79, 0.1);
}

.fab-button[aria-expanded="true"] {
  background: var(--gold);
  color: var(--lux-black);
  transform: rotate(45deg);
}

.fab-button.idle { animation: statusPulse 3s ease-in-out infinite; }
.fab-button.tv-fade { opacity: 0.3; transition: opacity var(--t-smooth); }
.fab-button.tv-fade:hover { opacity: 1; }

.fab-menu {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.6), 
    0 0 40px rgba(245, 195, 109, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transition: all var(--t-fast) var(--ease-out);
  min-width: 200px;
}

.fab-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-5);
  background: transparent;
  border: none;
  color: var(--cream-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  white-space: nowrap;
}

.fab-menu-item:hover { background: var(--gold-dim); color: var(--cream); }

.fab-menu-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--gold);
}

.fab-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  margin-left: auto;
  transition: background var(--t-fast);
}

.fab-indicator.on {
  background: var(--green);
  box-shadow: 0 0 6px rgba(74, 158, 107, 0.5);
}

.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast), visibility var(--t-fast);
}

.fab-backdrop.visible { opacity: 1; visibility: visible; }

/* ========================================
   STREAK BADGE (compat)
   ======================================== */
#streakBadge { display: none; }

/* ========================================
   SHIFT ENDED STATE
   ======================================== */
/* Hide controls and redundant elements post-shift */
body.shift-ended .timer-btn-row {
  display: none;
}

body.shift-ended .daily-projection {
  display: none;
}

body.shift-ended .timer-display,
body.shift-ended .timer-header,
body.shift-ended .timer-target,
body.shift-ended .timer-stats {
  display: none;
}

body.shift-ended .scale-section {
  opacity: 0.2;
  pointer-events: none;
}

body.shift-ended .shift-summary {
  display: flex !important;
}

/* Stop progress bar animation post-shift */
body.shift-ended .progress-fill::after {
  animation: none;
  box-shadow: none;
}

body.shift-ended .status-badge {
  background: rgba(95, 189, 132, 0.18);
  color: var(--green);
  border-color: rgba(95, 189, 132, 0.35);
  animation: none;
}

/* Shift Summary Card */
.shift-summary {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
}

.shift-summary-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.shift-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  width: 100%;
}

.shift-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.shift-summary-value {
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.shift-summary-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

html.tv-mode .shift-summary-value { font-size: 28px; }
html.tv-mode .shift-summary-label { font-size: 13px; }
html.tv-mode .shift-summary-title { font-size: 16px; }

/* ========================================
   TV MODE — Scales everything up 20%
   ======================================== */
html.tv-mode {
  zoom: 0.65;
}

html.tv-mode .daily-actual {
  font-size: clamp(240px, 26vw, 480px);
}

html.tv-mode .timer-display {
  --timer-size: 280px;
}

html.tv-mode .scale-display {
  --scale-size: 260px;
}

html.tv-mode .timer-value { font-size: 64px; }
html.tv-mode .scale-value { font-size: 52px; }
html.tv-mode .timer-label,
html.tv-mode .scale-label { font-size: 14px; }
html.tv-mode .scale-header,
html.tv-mode .timer-header { font-size: 14px; }
html.tv-mode .timer-btn-row { max-width: 400px; }
html.tv-mode .manual-btn { font-size: 17px; padding: 16px var(--sp-5); }
html.tv-mode .pause-btn { width: 54px; height: 54px; font-size: 20px; }
html.tv-mode .timer-stats { max-width: 400px; }
html.tv-mode .timer-stat { padding: var(--sp-3) var(--sp-3); }
html.tv-mode .timer-stat-label { font-size: 13px; }
html.tv-mode .timer-stat-value { font-size: 24px; }
html.tv-mode .actual-lbs { font-size: 72px; }
html.tv-mode .target-lbs { font-size: 34px; }
html.tv-mode .strain-name { font-size: 32px; }
html.tv-mode .time-display .time { font-size: 40px; }
html.tv-mode .expand-hint { display: none; }
html.tv-mode .cycle-donut-ring { width: 170px; height: 170px; }
html.tv-mode .daily-delta { font-size: 26px; padding: 10px 32px; }
html.tv-mode .status-badge { font-size: 16px; padding: 10px 32px; }
html.tv-mode .info-section { font-size: 18px; }
html.tv-mode .stat-group .value { font-size: 22px; }
html.tv-mode .stat-group .label { font-size: 13px; }
html.tv-mode .percentage-value { font-size: 28px; }
html.tv-mode .projection-value { font-size: 24px; }
html.tv-mode .projection-delta { font-size: 22px; }
html.tv-mode .hour-card-header { font-size: 14px; }
html.tv-mode .timer-target { font-size: 16px; }
html.tv-mode .daily-target { font-size: 30px; }
html.tv-mode .daily-unit { font-size: 16px; }
html.tv-mode .cycle-stat-value { font-size: 28px; }
html.tv-mode .cycle-stat-label { font-size: 14px; }
html.tv-mode .cycle-item { font-size: 20px; padding: 8px 14px; }
html.tv-mode .cycle-item-num,
html.tv-mode .cycle-item .cycle-num { font-size: 13px; }

/* ========================================
   IFRAME EMBED MODE
   ======================================== */
body.iframe-embed .hud-header { display: none; }
body.iframe-embed .cockpit { top: 0; }
body.iframe-embed .lang-toggle { display: none; }
body.iframe-embed .fab-container { display: none; }
body.iframe-embed .time-controls { display: none; }

/* ========================================
   AMBIENT LAYER (JS-driven)
   ======================================== */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  transition: background var(--t-dramatic);
}

.ambient-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.edge-glow {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity var(--t-smooth) var(--ease-cinematic), box-shadow var(--t-smooth);
}

.edge-glow-top { top: 0; left: 0; right: 0; height: 3px; }
.edge-glow-right { top: 0; right: 0; bottom: 0; width: 3px; }
.edge-glow-bottom { bottom: 0; left: 0; right: 0; height: 3px; }
.edge-glow-left { top: 0; left: 0; bottom: 0; width: 3px; }

body.ahead .edge-glow { opacity: 1; }
body.ahead .edge-glow-top { box-shadow: 0 0 30px 8px rgba(95, 189, 132, 0.15), 0 0 60px 15px rgba(95, 189, 132, 0.06); background: rgba(95, 189, 132, 0.2); }
body.ahead .edge-glow-bottom { box-shadow: 0 0 30px 8px rgba(95, 189, 132, 0.15), 0 0 60px 15px rgba(95, 189, 132, 0.06); background: rgba(95, 189, 132, 0.2); }
body.ahead .edge-glow-left { box-shadow: 0 0 30px 8px rgba(95, 189, 132, 0.1), 0 0 60px 15px rgba(95, 189, 132, 0.04); background: rgba(95, 189, 132, 0.12); }
body.ahead .edge-glow-right { box-shadow: 0 0 30px 8px rgba(95, 189, 132, 0.1), 0 0 60px 15px rgba(95, 189, 132, 0.04); background: rgba(95, 189, 132, 0.12); }

body.behind .edge-glow { opacity: 1; }
body.behind .edge-glow-top { box-shadow: 0 0 30px 8px rgba(217, 116, 101, 0.18), 0 0 60px 15px rgba(217, 116, 101, 0.08); background: rgba(217, 116, 101, 0.25); }
body.behind .edge-glow-bottom { box-shadow: 0 0 30px 8px rgba(217, 116, 101, 0.18), 0 0 60px 15px rgba(217, 116, 101, 0.08); background: rgba(217, 116, 101, 0.25); }
body.behind .edge-glow-left { box-shadow: 0 0 30px 8px rgba(217, 116, 101, 0.12), 0 0 60px 15px rgba(217, 116, 101, 0.05); background: rgba(217, 116, 101, 0.15); }
body.behind .edge-glow-right { box-shadow: 0 0 30px 8px rgba(217, 116, 101, 0.12), 0 0 60px 15px rgba(217, 116, 101, 0.05); background: rgba(217, 116, 101, 0.15); }

body.on-target .edge-glow { opacity: 1; }
body.on-target .edge-glow-top { box-shadow: 0 0 25px 6px rgba(229, 188, 85, 0.12), 0 0 50px 12px rgba(229, 188, 85, 0.05); background: rgba(229, 188, 85, 0.15); }
body.on-target .edge-glow-bottom { box-shadow: 0 0 25px 6px rgba(229, 188, 85, 0.12), 0 0 50px 12px rgba(229, 188, 85, 0.05); background: rgba(229, 188, 85, 0.15); }
body.on-target .edge-glow-left { box-shadow: 0 0 25px 6px rgba(229, 188, 85, 0.08); background: rgba(229, 188, 85, 0.1); }
body.on-target .edge-glow-right { box-shadow: 0 0 25px 6px rgba(229, 188, 85, 0.08); background: rgba(229, 188, 85, 0.1); }

/* Topo compat */
.topo-bg,
body .topo-contours {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -4;
}

.scoreboard {
  display: contents;
}

/* Legacy main-panel compat */
#main-panel,
.main-panel {
  /* cockpit class handles layout now */
}

/* ========================================
   TOUCH TARGETS (1024px and below)
   ======================================== */
@media (max-width: 1024px) {
  button,
  .pause-btn,
  .manual-btn,
  .start-day-btn,
  .lang-btn,
  .fab-button,
  .fab-menu-item,
  .cycle-nav-btn,
  .pause-reason-btn,

  .cycle-nav-btn { width: 44px; height: 44px; }
  .lang-btn { min-width: 44px; min-height: 44px; padding: 8px 12px; }
}

/* ========================================
   HOVER STATES — Disable on touch
   ======================================== */
@media (hover: none) {
  .hour-card:hover { transform: none; box-shadow: none; }
  .comparison-pill:hover { transform: none; }
  .manual-btn:hover { transform: none; box-shadow: none; }
  .fab-button:hover { transform: none; }
  .btn-primary:hover { transform: none; }
}

/* ========================================
   FOCUS STATES — Accessibility
   ======================================== */
button:focus-visible,
input:focus-visible,
a:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading {
  pointer-events: none;
  animation: breathe 1.5s ease-in-out infinite;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.hidden { display: none !important; }
.visible { display: block !important; }
.fade-in { animation: fadeIn var(--t-normal) var(--ease-out) forwards; }
.fade-out { animation: fadeOut var(--t-normal) var(--ease-out) forwards; }

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* --- 1600px: Slightly tighter instruments --- */
@media (max-width: 1600px) {
  .left-instrument { width: clamp(260px, 26vw, 380px); }
  .timer-panel { width: clamp(240px, 22vw, 340px); }
  :root { --scale-size: 180px; --timer-size: 200px; }
  .scale-value { font-size: 36px; }
  .timer-value { font-size: 42px; }
}

/* --- 1400px: Compact --- */
@media (max-width: 1400px) {
  :root { --scale-size: 170px; --timer-size: 190px; }
  .daily-actual { font-size: clamp(140px, 18vw, 300px); }
  .actual-lbs { font-size: 44px; }
  .strain-name { font-size: 20px; }
  .time-display .time { font-size: 24px; }
  .scale-value { font-size: 34px; }
  .timer-value { font-size: 38px; }
  .left-instrument { width: clamp(240px, 24vw, 350px); }
  .timer-panel { width: clamp(220px, 20vw, 320px); }
}

/* --- 1200px: Compact instruments --- */
@media (max-width: 1200px) {
  :root { --scale-size: 150px; --timer-size: 170px; }
  .scale-value, .timer-value { font-size: 32px; }
  .strain-name { font-size: 18px; }
  .daily-actual { font-size: clamp(120px, 16vw, 260px); }
  .actual-lbs { font-size: 40px; }
  .left-instrument { left: var(--sp-4); width: clamp(220px, 22vw, 320px); }
  .timer-panel { right: var(--sp-4); width: clamp(200px, 20vw, 300px); }
  .hud-header { padding: 0 var(--sp-5); }
}

/* --- 1024px: Tablet — Stacked layout --- */
@media (max-width: 1024px) {
  .cockpit {
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-4) var(--sp-8);
  }

  .center-stage {
    position: relative;
    height: auto;
    min-height: 40vh;
  }

  .left-instrument {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 500px;
    max-height: none;
  }

  .timer-panel {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 400px;
    max-height: none;
    flex-direction: column;
  }

  .bottom-strip {
    position: relative;
    height: auto;
    min-height: 200px;
    flex-direction: column;
  }

  .chart-container { flex: none; }
  .cycle-history { flex: none; }

  .daily-actual { font-size: clamp(80px, 20vw, 200px); }
  .progress-bar-container { width: 90%; }

  :root {
    --scale-size: 180px;
    --timer-size: 200px;
    --bottom-height: auto;
  }
}

/* --- 768px: Phone --- */
@media (max-width: 768px) {
  .hud-header { padding: 0 var(--sp-4); }
  .strain-name { font-size: 16px; max-width: 200px; }
  .time-display .time { font-size: 20px; }
  .daily-actual { font-size: clamp(60px, 18vw, 140px); }
  .actual-lbs { font-size: 36px; }
  .hour-cards { flex-direction: column; }

  .left-instrument { padding: 0 var(--sp-2); }
  .timer-panel { padding: 0 var(--sp-2); }

  .help-grid { grid-template-columns: 1fr; }
  .hud-center-marker { display: none; }
}

/* ========================================
   PRINT / REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   PASS 7: MOMENTUM ARROW
   ======================================== */
.momentum-arrow {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  margin-left: 6px;
  display: inline-block;
  transition: color var(--t-normal) var(--ease-out);
}

html.tv-mode .momentum-arrow { font-size: 24px; }

/* ========================================
   PASS 7: RACE MODE OVERLAY
   ======================================== */
body.race-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(196, 92, 74, 0.03) 40px,
    rgba(196, 92, 74, 0.03) 80px
  );
  pointer-events: none;
  z-index: 1;
  animation: race-drift 4s linear infinite;
}

@keyframes race-drift {
  from { transform: translateX(0); }
  to { transform: translateX(113px); }
}

/* ========================================
   PASS 7: DENSITY TIGHTENING
   ======================================== */

/* Tighten hour card padding */
.hour-card { padding: var(--sp-3) var(--sp-4); }
.info-bar { padding: var(--sp-2) var(--sp-4); gap: var(--sp-3); }
.bottom-strip { gap: var(--sp-3); }

/* Push hero number bigger in TV mode */
html.tv-mode .daily-actual {
  font-size: clamp(280px, 30vw, 560px);
}

/* ========================================
   PASS 7: TIMELINE VIEW (cycle history)
   ======================================== */
.cycle-timeline {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 56px;
  gap: 2px;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}

.cycle-timeline-block {
  flex: 1;
  min-width: 6px;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: opacity var(--t-fast) var(--ease-out);
}

.cycle-timeline-block:hover { opacity: 0.8; }
.cycle-timeline-block.green {
  background: linear-gradient(180deg, var(--green), rgba(74, 158, 107, 0.7));
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.12);
}
.cycle-timeline-block.gold {
  background: linear-gradient(180deg, var(--gold), rgba(212, 168, 67, 0.7));
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.12);
}
.cycle-timeline-block.red {
  background: linear-gradient(180deg, var(--red), rgba(196, 92, 74, 0.7));
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.12);
}

.cycle-timeline-block .cycle-sparkline-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: var(--cream);
  font-family: var(--font-data);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.cycle-timeline-block:hover .cycle-sparkline-tooltip { display: block; }

.cycle-timeline-break {
  width: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cycle-timeline-break-label {
  font-family: var(--font-ui);
  font-size: 7px;
  color: var(--cream-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  writing-mode: vertical-rl;
  opacity: 0.6;
}

.cycle-timeline-labels {
  display: flex;
  justify-content: center;
  margin-top: 4px;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--cream-muted);
}

/* ========================================
   PASS 7: PACE CHART VIEW (cycle history)
   ======================================== */
.cycle-pace {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  position: relative;
  padding: 4px 0;
}

.cycle-pace-target {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px dashed var(--gold);
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

.cycle-pace-target-label {
  position: absolute;
  top: -14px;
  left: 4px;
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--gold);
  white-space: nowrap;
}

.cycle-pace-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cycle-pace-label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--cream-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.cycle-pace-track {
  flex: 1;
  height: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.cycle-pace-bar {
  height: 100%;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  transition: width var(--t-normal) var(--ease-spring);
}

.cycle-pace-bar.green { background: var(--green); }
.cycle-pace-bar.gold { background: var(--gold); }
.cycle-pace-bar.red { background: var(--red); }

.cycle-pace-time {
  font-family: var(--font-data);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

html.tv-mode .cycle-pace-track { height: 20px; }
html.tv-mode .cycle-pace-label { font-size: 13px; width: 36px; }
html.tv-mode .cycle-pace-time { font-size: 12px; }
html.tv-mode .cycle-pace-target-label { font-size: 11px; }

/* ========================================
   PASS 7: BAR RACE VIEW (cycle history)
   ======================================== */
.cycle-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100px;
  position: relative;
  padding-bottom: 18px;
}

.cycle-bars-target-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--gold);
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

.cycle-bars-target-label {
  position: absolute;
  right: 0;
  top: -14px;
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.cycle-bar {
  flex: 1;
  min-width: 12px;
  max-width: 40px;
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: height var(--t-normal) var(--ease-spring);
}

.cycle-bar.green { background: var(--green); }
.cycle-bar.red { background: var(--red); }

.cycle-bar.active {
  box-shadow: 0 0 8px 2px rgba(228, 170, 79, 0.35);
}
.cycle-bar.active.green {
  box-shadow: 0 0 8px 2px rgba(74, 158, 107, 0.4);
}
.cycle-bar.active.red {
  box-shadow: 0 0 8px 2px rgba(196, 92, 74, 0.4);
}

.cycle-bar-value {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-data);
  font-size: 8px;
  color: var(--cream-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}

.cycle-bar:hover .cycle-bar-value,
.cycle-bar.active .cycle-bar-value { opacity: 1; }

.cycle-bar-label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--cream-muted);
  white-space: nowrap;
}

html.tv-mode .cycle-bars { height: 150px; }
html.tv-mode .cycle-bar-label { font-size: 11px; }
html.tv-mode .cycle-bar-value { font-size: 10px; }
html.tv-mode .cycle-bars-target-label { font-size: 11px; }

/* ========================================
   CREW CHANGE TOAST
   ======================================== */
.crew-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--cream-soft);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal) var(--ease-out), transform var(--t-normal) var(--ease-out);
  z-index: 900;
}
.crew-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   UTILITY TEXT-COLOR CLASSES
   ======================================== */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--cream-muted); }

@media print {
  body { background: #fff; color: #000; }
  .noise-overlay,
  .ambient-layer,
  .ambient-particles,
  .edge-glow,
  .fab-container,
  .debug-panel,
  .debug-indicator { display: none !important; }
}

/* ============================================================
   BAG MODE TOGGLE — manager-only; drives 5kg vs 10lb button vis
   ============================================================ */
.bag-mode-toggle {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin: 8px 0;
}
.bag-mode-pill {
  padding: 8px 18px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b8b3a8;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.bag-mode-pill:hover {
  color: #e8e4dc;
}
.bag-mode-pill.active {
  background: var(--ro-green, #668971);
  color: #fff;
}
.bag-mode-pill:focus-visible {
  outline: 2px solid var(--ro-gold, #e4aa4f);
  outline-offset: 2px;
}

/* Weight outside the expected window, or scale offline.
   ADVISORY ONLY — the button stays fully pressable (see scale.js). A tooltip
   is invisible on a wall display, so the signal goes in the border STYLE, not
   its colour: the colour is already spoken for by the timer's pace state
   (.btn-green / .btn-yellow / .btn-red) and an amber border here would be
   indistinguishable from "behind pace". Dashed = the scale does not agree. */
.manual-btn[data-gated="true"]:not(:disabled) {
  border-style: dashed !important;
  border-width: 2px !important;
}

/* Disabled Log Bag button — now only while a log is in flight */
.manual-btn:disabled,
.manual-btn[aria-disabled="true"] {
  opacity: 0.4;
  filter: grayscale(0.7);
  cursor: not-allowed;
  pointer-events: auto;
  border-color: rgba(120, 120, 120, 0.3) !important;
  color: rgba(180, 180, 180, 0.7) !important;
  background: rgba(80, 80, 80, 0.1) !important;
  transform: none !important;
  box-shadow: none !important;
}
