:root {
  --cream: #f5f1e8;
  --cream-2: #ebe5d4;
  --ink: #1a1a1a;
  --ink-soft: #6b6b6b;
  --red: #e64a19;
  --blue: #003a70;
  --gold: #c8a24b;
  --line-dark: #c4bca8;
  --green: #2a7d3c;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(0,0,0,0.015) 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, rgba(0,0,0,0.01) 1px, transparent 1px),
    radial-gradient(circle at 40% 70%, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 100px 100px, 80px 80px, 120px 120px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  border-bottom: 4px solid var(--red);
  padding: 0 max(1rem, var(--sal)) 0 max(1rem, var(--sar));
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header::before {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 33.33%, var(--cream) 33.33%, var(--cream) 66.66%, var(--blue) 66.66%, var(--blue) 100%);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-badge {
  width: 38px; height: 38px;
  background: var(--red);
  display: grid; place-items: center;
  position: relative;
  border: 2px solid var(--cream);
  transform: rotate(-2deg);
  flex-shrink: 0;
}

.brand-badge::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px dashed var(--cream);
  opacity: 0.3;
}

.brand-badge-num {
  font-family: 'Racing Sans One', sans-serif;
  font-size: 1.2rem; color: var(--cream); line-height: 1;
}

.brand-text { display: flex; flex-direction: column; line-height: 1; }

.brand-name {
  font-family: 'Racing Sans One', sans-serif;
  font-size: 1.4rem; letter-spacing: 0.02em; color: var(--cream);
}

.brand-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.3em; color: var(--gold);
  text-transform: uppercase; margin-top: 4px;
}

.header-info { display: none; align-items: center; gap: 2rem; font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--cream); text-transform: uppercase; }

.header-item { display: flex; align-items: center; gap: 8px; }
.header-item span.label { color: rgba(245, 241, 232, 0.5); }

.header-status-mobile { display: flex; align-items: center; gap: 8px; font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--cream); text-transform: uppercase; }

.status-light {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  border: 1px solid rgba(255,255,255,0.3); flex-shrink: 0;
}

.status-light.recording {
  background: var(--red); box-shadow: 0 0 10px var(--red);
  animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0.4; } }

/* ===== PAGE ===== */
.page {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  padding: 1rem max(1rem, var(--sar)) calc(1rem + var(--sab)) max(1rem, var(--sal));
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}

/* ===== CARDS ===== */
.card { background: var(--cream-2); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); position: relative; }

.card-head {
  padding: 14px 1.25rem; background: var(--ink); color: var(--cream);
  display: flex; justify-content: space-between; align-items: center; position: relative;
}

.card-head::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--red) 50%, var(--blue) 50%);
}

.card-title {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}

.card-title::before { content: '►'; color: var(--gold); font-size: 0.7rem; }

.card-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--gold); text-transform: uppercase; }

.card-body { padding: 1.25rem; }

/* ===== DASHBOARD ===== */
.dashboard {
  background: var(--cream); border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); padding: 1.25rem;
  position: relative; margin-bottom: 1rem; overflow: hidden;
}

.corner-plate {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--ink); color: var(--cream);
  padding: 6px 10px; font-family: 'DM Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.15em; transform: rotate(3deg);
}

.stage-bar {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
  padding-bottom: 1.25rem; border-bottom: 1px dashed var(--line-dark); margin-bottom: 1.25rem;
}

.stage-info { display: flex; align-items: center; gap: 1rem; }

.stage-number {
  width: 52px; height: 52px; background: var(--red); color: var(--cream);
  display: grid; place-items: center;
  font-family: 'Racing Sans One', sans-serif; font-size: 1.6rem;
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); flex-shrink: 0;
}

.stage-details .stage-label {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 2px;
}

.stage-details .stage-name {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 1.4rem; line-height: 1.1;
}

.stage-meta { text-align: left; font-family: 'DM Mono', monospace; font-size: 0.75rem; line-height: 1.5; color: var(--ink-soft); }
.stage-meta strong { color: var(--ink); font-weight: 500; }

/* ===== GPS BAR ===== */
.gps-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; margin-bottom: 1rem;
  font-family: 'DM Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px dashed var(--line-dark);
}

.gps-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-soft); flex-shrink: 0; transition: background 0.3s;
}

.gps-dot.acquiring { background: var(--gold); animation: blink 1s infinite; }
.gps-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green); }
.gps-dot.error { background: var(--red); }

#gpsStatus { color: var(--ink); }
#gpsDetail { color: var(--ink-soft); font-size: 0.65rem; }

/* ===== CHRONO ===== */
.chrono {
  display: grid; grid-template-columns: 1fr; align-items: center; gap: 1rem;
  padding: 1.25rem 0; border-bottom: 1px dashed var(--line-dark); margin-bottom: 1.25rem;
}

.chrono-label {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.25em;
  color: var(--red); text-transform: uppercase; margin-bottom: 0.5rem; font-weight: 500;
}

.chrono-digits {
  font-family: 'Racing Sans One', sans-serif;
  font-size: clamp(3rem, 16vw, 6.5rem); line-height: 0.9; color: var(--ink); letter-spacing: -0.01em;
}

.chrono-ms { font-size: 0.35em; color: var(--red); letter-spacing: 0; }

.gauge { width: 120px; height: 120px; position: relative; margin: 0 auto; }
.gauge svg { width: 100%; height: 100%; }

.gauge-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
}

.gauge-value { font-family: 'Racing Sans One', sans-serif; font-size: 1.4rem; color: var(--ink); line-height: 1; }

.gauge-unit { font-family: 'DM Mono', monospace; font-size: 0.5rem; letter-spacing: 0.1em; color: var(--ink-soft); text-transform: uppercase; margin-top: 2px; }

/* ===== STATS ===== */
.stats-row {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0; margin-bottom: 1.25rem; border: 1px solid var(--ink);
}

.stat-box {
  padding: 12px 1rem; border-right: 1px solid var(--ink);
  background: var(--cream-2); position: relative;
}

.stat-box:nth-child(even) { border-right: none; }
.stat-box:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }

.stat-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gold);
}

.stat-label { font-family: 'DM Mono', monospace; font-size: 0.6rem; letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 6px; }

.stat-value { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 1.3rem; line-height: 1; }
.stat-value .unit { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--ink-soft); margin-left: 4px; font-weight: 400; }

/* ===== CONTROLS ===== */
.controls { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.controls-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.btn {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0 20px; min-height: 52px;
  border: 2px solid var(--ink); background: var(--cream); color: var(--ink);
  cursor: pointer; transition: all 0.1s;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn-primary { background: var(--red); color: var(--cream); }
.btn-primary::after { content: ''; position: absolute; top: 3px; left: 8px; right: 8px; height: 1px; background: rgba(255,255,255,0.3); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-blue { background: var(--blue); color: var(--cream); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled:hover { transform: none; box-shadow: 2px 2px 0 var(--ink); }

/* ===== FORM ===== */
.form-row { margin-bottom: 1rem; }

.form-row label {
  display: block; font-family: 'DM Mono', monospace; font-size: 0.65rem;
  letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 6px;
}

.form-row input, .form-row select {
  width: 100%; background: var(--cream); border: 2px solid var(--ink); color: var(--ink);
  padding: 12px 14px; font-family: 'Space Grotesk', sans-serif; font-size: 1rem;
  outline: none; transition: box-shadow 0.1s; border-radius: 0; -webkit-appearance: none;
}

.form-row input:focus, .form-row select:focus { box-shadow: 3px 3px 0 var(--red); }

.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* GPS toggle */
.gps-toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px dashed var(--line-dark); margin-top: 0.5rem;
}

.gps-toggle-row label {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase;
  cursor: pointer; display: flex; align-items: center; gap: 10px; margin-bottom: 0;
}

.gps-permission-note {
  color: var(--gold);
  font-size: 0.85em;
  letter-spacing: 0.12em;
}

/* Custom toggle switch */
.toggle-switch {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute; inset: 0;
  background: var(--line-dark); border: 2px solid var(--ink); cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 2px; top: 2px;
  background: var(--ink); transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track { background: var(--green); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); background: var(--cream); }

/* ===== SPLITS TABLE ===== */
.splits-table { width: 100%; border-collapse: collapse; }
.splits-header { background: var(--ink); color: var(--cream); font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; }
.splits-header th { padding: 10px 12px; text-align: left; font-weight: 400; }
.splits-header th:last-child { text-align: right; }
.splits-table tbody tr { border-bottom: 1px dashed var(--line-dark); transition: background 0.15s; }
.splits-table tbody tr:hover { background: var(--cream); }
.splits-table tbody tr:last-child { border-bottom: none; }
.splits-table td { padding: 11px 12px; font-family: 'DM Mono', monospace; font-size: 0.82rem; }
.split-num-cell { font-family: 'Racing Sans One', sans-serif; font-size: 1.1rem; color: var(--red); width: 46px; }
.split-wp-cell { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 0.9rem; }
.split-delta-faster { color: var(--green); font-weight: 500; }
.split-delta-slower { color: var(--red); font-weight: 500; }
.split-total-cell { text-align: right; color: var(--ink-soft); }
.split-delta-col { display: none; }
.best-mark { color: var(--gold); font-size: 0.8em; }

.empty-state { padding: 2.5rem 1.25rem; text-align: center; color: var(--ink-soft); }
.empty-state .checkered {
  display: inline-block; width: 40px; height: 24px;
  background-image: linear-gradient(45deg, var(--ink) 25%, transparent 25%), linear-gradient(-45deg, var(--ink) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ink) 75%), linear-gradient(-45deg, transparent 75%, var(--ink) 75%);
  background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  opacity: 0.15; margin-bottom: 1rem;
}
.empty-text { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 0.95rem; letter-spacing: 0.15em; text-transform: uppercase; }

/* ===== HISTORY ===== */
.run-item { padding: 14px 1.25rem; border-bottom: 1px dashed var(--line-dark); cursor: pointer; transition: background 0.15s; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; touch-action: manipulation; }
.run-item:hover { background: var(--cream); }
.run-item:last-child { border-bottom: none; }
.run-badge { width: 40px; height: 40px; background: var(--blue); color: var(--cream); display: grid; place-items: center; font-family: 'Racing Sans One', sans-serif; font-size: 1.1rem; border: 2px solid var(--ink); flex-shrink: 0; }
.run-info { min-width: 0; }
.run-info .run-name { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-info .run-meta { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--ink-soft); margin-top: 2px; }
.run-stats-right { text-align: right; }
.run-time { font-family: 'Racing Sans One', sans-serif; font-size: 1.05rem; }
.run-dist { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--ink-soft); margin-top: 2px; }

/* ===== FOOTER ===== */
.foot {
  max-width: 1400px; margin: 1.5rem auto 0;
  padding: 1.25rem max(1rem, var(--sar)) calc(1.5rem + var(--sab)) max(1rem, var(--sal));
  border-top: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: center;
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--ink-soft); text-transform: uppercase;
}

.foot-brand { font-family: 'Racing Sans One', sans-serif; font-size: 0.9rem; color: var(--ink); }

/* ===== MODAL ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(26,26,26,0.6); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.modal-bg.open { display: flex; }
.modal { background: var(--cream); border: 3px solid var(--ink); border-bottom: none; box-shadow: 0 -6px 0 var(--ink); width: 100%; max-height: 90dvh; overflow-y: auto; animation: slideUp 0.25s ease-out; padding-bottom: var(--sab); }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-head { background: var(--ink); color: var(--cream); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; }
.modal-head::after { content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--red), var(--blue)); }
.modal-title { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.modal-close { background: transparent; border: 2px solid var(--cream); color: var(--cream); width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; touch-action: manipulation; flex-shrink: 0; }
.modal-body { padding: 1.25rem; }

.modal-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 2px solid var(--ink); }
.modal-stat { padding: 1rem; background: var(--cream-2); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.modal-stat:nth-child(even) { border-right: none; }
.modal-stat:nth-last-child(-n+2) { border-bottom: none; }
.modal-stat-label { font-family: 'DM Mono', monospace; font-size: 0.6rem; letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 4px; }
.modal-stat-value { font-family: 'Racing Sans One', sans-serif; font-size: 1.5rem; }
.modal-stat-ms { font-size: 0.5rem; color: var(--red); }
.modal-stat-mono { font-family: 'DM Mono', monospace; font-size: 1rem; }
.modal-codriver { margin-top: 1rem; padding: 0.75rem; background: var(--cream-2); border: 1px solid var(--ink); }
.modal-codriver-label { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: var(--ink-soft); letter-spacing: 0.15em; text-transform: uppercase; }
.modal-codriver-name { font-family: 'Oswald', sans-serif; font-weight: 500; margin-left: 8px; }
.modal-splits-heading { margin-top: 1.5rem; margin-bottom: 0.5rem; font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.2em; color: var(--ink-soft); text-transform: uppercase; }
.modal-splits-table { border: 2px solid var(--ink); }

/* ===== STAGE NAME MODAL ===== */
.stage-name-modal { max-width: 620px; }

.stage-name-intro {
  margin-bottom: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.generated-stage {
  display: grid;
  gap: 6px;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  background: var(--cream-2);
  border: 2px dashed var(--ink);
}

.generated-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.generated-stage strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.stage-name-actions {
  display: grid;
  gap: 0.75rem;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(2rem + var(--sab)); left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: var(--cream);
  border: 2px solid var(--red); padding: 14px 22px;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  z-index: 300; opacity: 0; transition: all 0.3s ease;
  pointer-events: none; box-shadow: 4px 4px 0 var(--red); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== OFFLINE BANNER ===== */
.offline-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  background: var(--gold); color: var(--ink); text-align: center; padding: 8px;
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
}
.offline-banner.show { display: block; }

/* ===== INSTALL BAR ===== */
.install-bar {
  display: none; position: fixed;
  bottom: calc(var(--sab) + 0.75rem); left: 50%; transform: translateX(-50%);
  z-index: 150; background: var(--ink); color: var(--cream);
  border: 2px solid var(--gold); box-shadow: 4px 4px 0 var(--gold);
  padding: 12px 16px; align-items: center; gap: 12px;
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  max-width: calc(100vw - 2rem);
}
.install-bar.show { display: flex; }
.install-bar .btn { min-height: 36px; font-size: 0.75rem; padding: 0 14px; box-shadow: 2px 2px 0 var(--ink); }

/* ===== RACING STRIPE ===== */
.racing-stripes { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100px; height: 100vh; display: flex; gap: 4px; opacity: 0.04; pointer-events: none; z-index: 0; }
.racing-stripes::before, .racing-stripes::after { content: ''; flex: 1; background: var(--ink); }

/* ===== ANIMATIONS ===== */
@keyframes flashRow { 0% { background: rgba(230, 74, 25, 0.2); } 100% { background: transparent; } }
.splits-table tbody tr.new { animation: flashRow 0.6s ease-out; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream-2); }
::-webkit-scrollbar-thumb { background: var(--ink-soft); border: 1px solid var(--cream-2); }

/* ===== DESKTOP ≥ 640px ===== */
@media (min-width: 640px) {
  header { height: 76px; padding: 0 2rem; }
  .brand-badge { width: 44px; height: 44px; }
  .brand-badge-num { font-size: 1.4rem; }
  .brand-name { font-size: 1.8rem; }
  .header-status-mobile { display: none; }
  .header-info { display: flex; }
  .page { padding: 1.5rem; gap: 1.5rem; }
  .dashboard { padding: 1.75rem; box-shadow: 6px 6px 0 var(--ink); margin-bottom: 1.5rem; }
  .stage-bar { flex-direction: row; align-items: center; gap: 0; }
  .stage-meta { text-align: right; }
  .chrono { grid-template-columns: 1fr auto; gap: 2rem; }
  .gauge { width: 150px; height: 150px; margin: 0; }
  .gauge-value { font-size: 1.6rem; }
  .gauge-unit { font-size: 0.6rem; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .stat-box:nth-child(even) { border-right: 1px solid var(--ink); }
  .stat-box:last-child { border-right: none; }
  .stat-box:nth-child(-n+2) { border-bottom: none; }
  .controls { grid-template-columns: 2fr 1fr 1fr; gap: 0.75rem; }
  .controls-sub { display: contents; }
  .split-delta-col { display: table-cell; }
  .modal-bg { align-items: center; justify-content: center; padding: 2rem; }
  .modal { max-width: 540px; border-bottom: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding-bottom: 0; }
  .stage-name-modal { max-width: 620px; }
  .stage-name-actions { grid-template-columns: 1fr 1fr 1.2fr; }
}

@media (min-width: 1100px) {
  .page { grid-template-columns: 1fr 400px; padding: 2rem; gap: 2rem; }
}
