/* ==========================================================================
   ZEN MINIMALIST HIIT WORKSTATION — ERGONOMIC LOW-STRAIN EDITION
   Softened Matte Palette • Red (Workout) • Green (Rest) • Amber (Prepare)
   ========================================================================== */

:root {
  /* Safe Area Insets */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Soft Matte Backgrounds (Reduces screen glare & pupil fatigue) */
  --day-bg-canvas: #f5f5f4;       /* Warm Stone Canvas */
  --day-bg-panel: #fcfcfb;        /* Soft Off-White Panel */
  --day-bg-subtle: #eaeae7;       /* Muted Surface / Pill */
  --day-bg-hover: #e2e2df;        /* Soft Hover Tone */
  
  /* Hairline Borders */
  --border-light: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.28);
  --border-dark: #27272a;

  /* Ink & Typography (Deep Charcoal instead of Harsh Black) */
  --ink-primary: #18181b;         /* Deep Graphite Ink */
  --ink-secondary: #3f3f46;       /* Neutral Charcoal */
  --ink-muted: #52525b;           /* Slate Mid-tone */
  --ink-faint: #71717a;           /* Wireframe Gray */
  --ink-white: #ffffff;           /* Pure Inverted White */

  /* Typography Stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-round: 9999px;

  /* Transitions */
  --timing-fast: 140ms ease;
  --timing-smooth: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --timing-ambient: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Precise Circumference for r=126 SVG Circle: 2 * PI * 126 = 791.68 */
  --ring-circumference: 792;

  /* Default Standby Tokens */
  --phase-accent: #27272a;
  --phase-contrast: var(--ink-white);
  --phase-subtle: #52525b;
  --phase-track: rgba(0, 0, 0, 0.06);
  --phase-surface: var(--day-bg-canvas);
}

/* ==========================================================================
   DYNAMIC COLOR PHASES: WORK (RED) & REST (GREEN)
   ========================================================================== */

/* WORKOUT: High-Exertion Ergonomic Crimson */
.phase-work {
  --phase-accent: #dc2626;                          /* Vibrant Athletic Red */
  --phase-contrast: var(--ink-white);
  --phase-subtle: #b91c1c;                          /* Deep Red Text */
  --phase-track: rgba(220, 38, 38, 0.12);           /* Soft Red Ring Track */
  --phase-surface: rgba(220, 38, 38, 0.035);        /* Ambient Red Tint */
}

/* REST: Restorative Sage Emerald */
.phase-rest {
  --phase-accent: #059669;                          /* Calming Recovery Green */
  --phase-contrast: var(--ink-white);
  --phase-subtle: #047857;                          /* Deep Green Text */
  --phase-track: rgba(5, 150, 105, 0.12);           /* Soft Green Ring Track */
  --phase-surface: rgba(5, 150, 105, 0.04);         /* Ambient Green Tint */
}

/* PREPARE / TRANSITION: Warm Amber */
.phase-transition {
  --phase-accent: #d97706;                          /* Golden Amber */
  --phase-contrast: var(--ink-white);
  --phase-subtle: #b45309;
  --phase-track: rgba(217, 119, 6, 0.12);
  --phase-surface: rgba(217, 119, 6, 0.035);
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--day-bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--phase-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   PRIMARY SHELL & HEADER
   ========================================================================== */
.day-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--day-bg-canvas);
}

.day-header {
  height: calc(56px + var(--safe-top));
  min-height: calc(56px + var(--safe-top));
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) calc(1.5rem + var(--safe-right)) 0 calc(1.5rem + var(--safe-left));
  background-color: var(--day-bg-panel);
  border-bottom: 1px solid var(--border-light);
  gap: 1.5rem;
  z-index: 40;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-primary);
}

.brand-divider {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.header-progress {
  flex: 1;
  max-width: 580px;
  display: flex;
  align-items: center;
}

.horizon-rail {
  width: 100%;
  height: 4px;
  background-color: var(--day-bg-subtle);
  border-radius: var(--radius-round);
  overflow: hidden;
}

.horizon-fill {
  width: 0%;
  height: 100%;
  background-color: var(--phase-accent);
  transition: width 0.3s ease-out, background-color var(--timing-ambient);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hotkey-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
}

.key-cap {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  background-color: var(--day-bg-subtle);
  border: 1px solid var(--border-medium);
  color: var(--ink-primary);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
}

.key-action {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-right: 0.4rem;
}

.day-icon-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--ink-secondary);
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--timing-fast);
}

.day-icon-btn:hover {
  background-color: var(--day-bg-subtle);
  color: var(--ink-primary);
  border-color: var(--ink-primary);
}

.day-svg {
  width: 18px;
  height: 18px;
}

.day-svg-sm {
  width: 14px;
  height: 14px;
}

.mobile-only-toggle {
  display: none;
}

.manifest-close-btn {
  display: none;
}

/* ==========================================================================
   WORKSTATION GRID STAGE (DESKTOP)
   ========================================================================== */
.day-stage {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr minmax(260px, 320px);
  min-height: 0;
  position: relative;
}

.dock-panel {
  display: flex;
  flex-direction: column;
  background-color: var(--day-bg-panel);
}

.dock-left {
  border-right: 1px solid var(--border-light);
  padding: clamp(1.25rem, 2.5vh, 2rem) 1.5rem;
  justify-content: space-between;
  gap: 1.25rem;
}

.dock-right {
  border-left: 1px solid var(--border-light);
  padding: clamp(1.25rem, 2.5vh, 2rem) 1.5rem;
  min-height: 0;
  overflow: hidden;
}

.dock-block {
  display: flex;
  flex-direction: column;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

/* Foresight Up Next Card */
.foresight-name {
  font-size: clamp(1.15rem, 2.2vh, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink-primary);
  margin-bottom: 0.5rem;
}

.foresight-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  border: 1px solid var(--border-medium);
  background-color: var(--day-bg-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  align-self: flex-start;
}

.target-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.day-ghost-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.7rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--timing-fast);
}

.day-ghost-btn:hover {
  background-color: var(--day-bg-subtle);
  border-color: var(--ink-primary);
  color: var(--ink-primary);
}

/* ==========================================================================
   CENTER HERO: GLANCEABLE FOCUS ENGINE
   ========================================================================== */
.dock-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.8vh, 2.25rem) clamp(1rem, 3vw, 2.5rem);
  background-color: var(--phase-surface);
  position: relative;
  min-height: 0;
  gap: clamp(0.75rem, 1.6vh, 1.75rem);
  transition: background-color var(--timing-ambient);
}

.center-status-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 680px;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-phase-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.status-phase {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--phase-accent);
  transition: color var(--timing-ambient);
}

.status-dot {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.status-section {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.status-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.counter-num {
  font-weight: 700;
  color: var(--ink-primary);
}

/* Radial Clock: High Contrast Ring */
.clock-stage {
  position: relative;
  width: clamp(200px, 34vh, 320px);
  height: clamp(200px, 34vh, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
}

.clock-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.clock-track {
  fill: none;
  stroke: var(--phase-track);
  stroke-width: 3.5;
  transition: stroke var(--timing-ambient);
}

.clock-progress {
  fill: none;
  stroke: var(--phase-accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: 0;
  transition: stroke var(--timing-ambient);
}

.clock-core {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.clock-digits {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(3.75rem, 8.5vh, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums lining-nums;
}

.clock-subtext {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.3vh, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--phase-subtle);
  margin-top: 0.65rem;
  transition: color var(--timing-ambient);
}

/* Active Movement Title */
.active-movement-card {
  text-align: center;
  max-width: 680px;
  padding: 0 0.5rem;
}

.movement-title {
  font-size: clamp(1.8rem, 10vh, 8rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink-primary);
}

/* Mirror Up-Next for Mobile Viewport */
.mobile-foresight-strip {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  background-color: var(--day-bg-panel);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-round);
}

.mobile-foresight-label {
  font-weight: 700;
  color: var(--ink-faint);
}

.mobile-foresight-value {
  color: var(--ink-primary);
  font-weight: 600;
}

/* Controls Deck */
.center-controls {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  margin-top: auto;
  padding-top: 0.5rem;
  padding-bottom: calc(0.5rem + var(--safe-bottom));
}

.day-step-btn {
  background-color: var(--day-bg-panel);
  border: 1px solid var(--border-medium);
  color: var(--ink-muted);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-round);
  transition: all var(--timing-fast);
}

.day-step-btn:hover {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
  background-color: var(--day-bg-subtle);
}

.day-step-btn:active {
  transform: scale(0.95);
}

.day-primary-btn {
  height: 54px;
  min-width: 190px;
  padding: 0 2rem;
  border: none;
  background-color: var(--phase-accent);
  color: var(--ink-white);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-round);
  user-select: none;
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.12);
  transition: all var(--timing-smooth);
}

.day-primary-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.day-primary-btn:active {
  transform: scale(0.97) translateY(0);
}

.day-svg-action {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   RIGHT COCKPIT: MANIFEST LIST
   ========================================================================== */
.manifest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.75rem;
}

.manifest-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.manifest-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.manifest-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.manifest-viewport::-webkit-scrollbar {
  width: 4px;
}

.manifest-viewport::-webkit-scrollbar-thumb {
  background-color: var(--border-medium);
  border-radius: var(--radius-round);
}

.manifest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-size: 0.82rem;
  color: var(--ink-muted);
  transition: all var(--timing-fast);
}

.checklist-item:hover {
  background-color: var(--day-bg-subtle);
}

.checklist-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.item-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  width: 24px;
  flex-shrink: 0;
}

.item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-secondary);
}

.item-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  flex-shrink: 0;
}

/* Active & Done States */
.checklist-item.item-active {
  background-color: var(--day-bg-subtle);
  border-color: var(--phase-accent);
  color: var(--ink-primary);
}

.checklist-item.item-active .item-index {
  color: var(--phase-accent);
  font-weight: 700;
}

.checklist-item.item-active .item-label {
  color: var(--ink-primary);
  font-weight: 600;
}

.checklist-item.item-done {
  opacity: 0.45;
}

.checklist-item.item-done .item-label {
  text-decoration: line-through;
}

.checklist-item:focus-visible {
  outline: 2px solid var(--phase-accent);
  outline-offset: -2px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(24, 24, 27, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  transition: opacity var(--timing-smooth);
}

.manifest-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  margin-top: 0.75rem;
  display: none;
}

.drawer-reset-btn {
  width: 100%;
}

/* Play/Pause Button States */
.action-pause {
  background-color: var(--day-bg-panel);
  color: var(--phase-accent);
  border: 1.5px solid var(--phase-accent);
}

/* ==========================================================================
   COMPLETION MODAL
   ========================================================================== */
.day-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(245, 245, 244, 0.94);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.day-modal-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--day-bg-panel);
  border: 1px solid var(--border-medium);
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.12);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: var(--radius-sm);
}

.modal-seal {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  border: 1px solid var(--border-medium);
  padding: 0.25rem 0.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-xs);
}

.modal-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 0.35rem;
  margin-bottom: 1.5rem;
}

.modal-stats-matrix {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: var(--border-light);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.stat-cell {
  background-color: var(--day-bg-panel);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-dim {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.stat-num {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

.modal-quote-frame {
  width: 100%;
  padding: 0.9rem 1.15rem;
  border-left: 2px solid var(--ink-primary);
  background-color: var(--day-bg-subtle);
  text-align: left;
  margin-bottom: 1.75rem;
}

.quote-body {
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-primary);
}

.quote-author {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-style: normal;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}

.modal-action-btn {
  width: 100%;
  height: 48px;
  background-color: var(--ink-primary);
  color: var(--ink-white);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: opacity var(--timing-fast);
}

.modal-action-btn:hover {
  opacity: 0.9;
}

.reset-modal-card {
  max-width: 400px;
  padding: 1.75rem 1.5rem;
}

.modal-actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.25rem;
}

.modal-cancel-btn {
  flex: 1;
  height: 46px;
}

.modal-danger-btn {
  flex: 1;
  height: 46px;
  background-color: #dc2626;
  color: var(--ink-white);
}

.modal-danger-btn:hover {
  background-color: #b91c1c;
  opacity: 0.95;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */

/* Tablets / Medium Desktops (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .day-stage {
    grid-template-columns: 200px 1fr 220px;
  }
  .dock-left, .dock-right {
    padding: 1.25rem 0.85rem;
  }
  .hotkey-legend {
    display: none;
  }
  .clock-stage {
    width: clamp(180px, 30vh, 260px);
    height: clamp(180px, 30vh, 260px);
  }
  .clock-digits {
    font-size: clamp(3rem, 7vh, 4.75rem);
  }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
  .day-shell {
    height: 100dvh;
    overflow: hidden;
  }

  .day-header {
    padding: var(--safe-top) calc(1rem + var(--safe-right)) 0 calc(1rem + var(--safe-left));
    gap: 0.75rem;
  }

  .mobile-only-toggle {
    display: inline-flex;
  }

  .manifest-footer {
    display: block;
  }

  .day-stage {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 56px - var(--safe-top));
  }

  .dock-left {
    display: none;
  }

  .dock-center {
    flex: 1;
    padding: 1rem;
    justify-content: space-around;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .mobile-foresight-strip {
    display: inline-flex;
  }

  .dock-right {
    position: fixed;
    top: calc(56px + var(--safe-top));
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background-color: var(--day-bg-panel);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: calc(1rem + var(--safe-bottom));
  }

  .dock-right.drawer-open {
    transform: translateX(0);
  }

  .manifest-close-btn {
    display: inline-flex;
  }

  .clock-stage {
    width: clamp(180px, 40vw, 240px);
    height: clamp(180px, 40vw, 240px);
  }

  .clock-digits {
    font-size: clamp(3rem, 11vw, 4.5rem);
  }

  .movement-title {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  .day-primary-btn {
    min-width: 150px;
    height: 48px;
  }

  .day-step-btn {
    width: 44px;
    height: 44px;
  }
}

/* Short Screens / Small Heights (e.g. iPhone SE, Foldable cover, virtual keyboard) */
@media (max-height: 680px) and (max-width: 768px) {
  .dock-center {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .clock-stage {
    width: clamp(140px, 25vh, 180px);
    height: clamp(140px, 25vh, 180px);
  }

  .clock-digits {
    font-size: clamp(2.5rem, 6.5vh, 3.5rem);
  }

  .movement-title {
    font-size: clamp(1.1rem, 2.8vh, 1.35rem);
  }

  .center-controls {
    padding-top: 0.25rem;
    gap: 0.75rem;
  }

  .day-primary-btn {
    height: 44px;
    min-width: 140px;
  }

  .day-step-btn {
    width: 40px;
    height: 40px;
  }
}

/* Mobile Landscape Mode (Phone rotated during workout) */
@media (orientation: landscape) and (max-height: 520px) {
  .day-header {
    height: calc(44px + var(--safe-top));
    min-height: calc(44px + var(--safe-top));
    padding: var(--safe-top) calc(1rem + var(--safe-right)) 0 calc(1rem + var(--safe-left));
  }

  .day-stage {
    height: calc(100dvh - 44px - var(--safe-top));
    flex-direction: row;
  }

  .dock-left {
    display: none;
  }

  .dock-center {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1.5rem;
    gap: 0.75rem 1.5rem;
    overflow-y: auto;
  }

  .center-status-bar {
    width: 100%;
    order: 1;
  }

  .clock-stage {
    order: 2;
    width: 130px;
    height: 130px;
  }

  .clock-digits {
    font-size: 2.2rem;
  }

  .active-movement-card {
    order: 3;
    flex: 1;
    min-width: 200px;
    text-align: left;
  }

  .movement-title {
    font-size: 1.25rem;
  }

  .mobile-foresight-strip {
    order: 4;
    display: inline-flex;
  }

  .center-controls {
    order: 5;
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
  }

  .day-primary-btn {
    height: 42px;
    min-width: 130px;
  }

  .day-step-btn {
    width: 38px;
    height: 38px;
  }
}

/* Narrowest Viewports (< 360px, e.g. Galaxy Fold folded) */
@media (max-width: 360px) {
  .day-header {
    padding: var(--safe-top) 0.5rem 0 0.5rem;
    gap: 0.5rem;
  }

  .brand-sub {
    display: none;
  }

  .center-controls {
    gap: 0.4rem;
  }

  .day-primary-btn {
    min-width: 110px;
    padding: 0 1rem;
    font-size: 0.76rem;
  }

  .day-step-btn {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}