@font-face { font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap; src: url("./assets/fonts/Roboto-Regular.ttf") format("truetype"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap; src: url("./assets/fonts/Roboto-Medium.ttf") format("truetype"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 700; font-display: swap; src: url("./assets/fonts/Roboto-Bold.ttf") format("truetype"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 900; font-display: swap; src: url("./assets/fonts/Roboto-Black.ttf") format("truetype"); }
:root {
  color-scheme: light;
  --ink: #3D2438;
  --dashboard-bg: #7c5375;
  --brand-plum: #835177;
  --surface: #ffffff;
  --surface-raised: #F8F3F5;
  --line: rgba(59, 36, 56, 0.14);
  --line-strong: rgba(59, 36, 56, 0.24);
  --paper: #fffaf5;
  --muted: #5A4453;
  --green: #FDAB41;
  --green-dark: #835177;
  --red: #a13f4f;
  --amber: #d88f2e;
  --radius: 15px;
  font-family: Roboto, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--dashboard-bg);
  color: var(--paper);
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; }

[hidden] { display: none !important; }

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--dashboard-bg);
}

.auth-card {
  width: min(100%, 430px);
  padding: clamp(26px, 5vw, 42px);
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(45, 22, 42, 0.25);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: clamp(38px, 8vh, 68px);
}

.auth-brand > div { display: grid; gap: 2px; }
.auth-brand strong { font-size: 0.96rem; }
.auth-brand > div span { color: var(--muted); font-size: 0.67rem; letter-spacing: 0.12em; text-transform: uppercase; }

.auth-copy h1 {
  max-width: 340px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.98;
}

.auth-copy > p:last-child {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

#authForm { display: grid; gap: 15px; }

#authForm label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#authForm input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
}

#authForm input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(239, 182, 85, 0.2); }
#authForm .action { width: 100%; margin-top: 5px; }

.auth-link,
.sign-out {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-link { min-height: 42px; font-size: 0.75rem; font-weight: 700; }
.auth-link:hover { color: var(--ink); }
.sign-out:hover { color: var(--paper); }
.auth-link:focus-visible, .sign-out:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.auth-status {
  min-height: 1.3em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.auth-status.error { color: var(--red); }

.app-shell {
  --page-pad: clamp(22px, 3vw, 48px);
  width: 100%;
  max-width: 1540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--page-pad) max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(18px, 2.4vh, 28px);
}

.topbar {
  letter-spacing: 0.015em;
  word-spacing: 0.04em;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(28px, 4vw, 64px);
  min-height: 58px;
  margin: 0 calc(var(--page-pad) * -1);
  padding: max(12px, env(safe-area-inset-top)) var(--page-pad) 12px;
  border-bottom: 2px solid rgba(255, 250, 245, 0.75);
  background: var(--ink);
}

.brand,
.topbar-right,
.station-heading,
.station-identity,
.station-actions,
footer {
  display: flex;
  align-items: center;
}

.brand { gap: 13px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border-radius: 7px;
  background: var(--green);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.02rem;
  font-weight: 700;
  font-style: normal;
}

.brand > div { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand strong { font-size: 0.96rem; letter-spacing: 0.01em; }
.brand > div span { color: #cfbdcb; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.topbar-kitchen {
  margin: 0;
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-right { gap: clamp(18px, 2.5vw, 36px); }

.sign-out {
  min-height: 34px;
  padding: 0 2px;
  color: #cfbdcb;
  font-size: 0.7rem;
  font-weight: 700;
}

.service-state {
  min-width: 122px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f0e8ee;
  font-size: 0.78rem;
  font-weight: 700;
}

.service-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(239, 182, 85, 0.12);
}

.clock { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.clock strong { font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.clock span { color: #cfbdcb; font-size: 0.7rem; }

main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(18px, 2.4vh, 28px);
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.kitchen-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.kitchen-picker {
  display: grid;
  gap: 6px;
  min-width: 170px;
  color: #eadfe7;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kitchen-picker select {
  min-height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid rgba(255, 250, 245, 0.42);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
}

.kitchen-picker select:focus-visible {
  outline: 3px solid rgba(239, 182, 85, 0.5);
  outline-offset: 3px;
}

.eyebrow,
.station-label {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3.3vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
}

.shift-summary {
  margin-bottom: 4px;
  color: #eadfe7;
  font-size: 0.78rem;
}

.station-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr 1fr 0.82fr;
  gap: clamp(14px, 1.8vw, 24px);
}

.single-station {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(18px, 2.4vh, 28px);
  padding: clamp(20px, 2.4vw, 34px);
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(56, 29, 53, 0.18);
  overflow: hidden;
}

.timer-console {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, 1.35fr) minmax(300px, 0.75fr);
  align-items: stretch;
  gap: clamp(28px, 5vw, 76px);
}

.control-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(22px, 4vh, 42px);
  border-left: 1px solid var(--line);
  padding: 0 0 2px clamp(28px, 4vw, 58px);
}

.activity-panel {
  min-width: 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 28px rgba(56, 29, 53, 0.14);
}

.activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #d8c8d4;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.activity-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(239, 182, 85, 0.13);
}

.activity-connection {
  color: var(--green);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-connection[data-connected="false"] { color: #d8c8d4; }

.activity-current {
  display: block;
  margin-top: 10px;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.25;
}

.activity-list {
  display: grid;
  gap: 0;
  margin: 13px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 250, 245, 0.14);
  list-style: none;
}

.activity-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  color: #f4edf2;
  font-size: 0.69rem;
  line-height: 1.3;
}

.activity-item time {
  color: #bcaab8;
  font-variant-numeric: tabular-nums;
}

.activity-item.success span { color: var(--green); }
.activity-item.warning span { color: #f2a9b4; }

.activity-empty {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 250, 245, 0.14);
  color: #bcaab8;
  font-size: 0.69rem;
}

.station-control {
  width: 100%;
  align-self: end;
  display: grid;
  gap: 18px;
}

.control-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.single-station .station-copy strong {
  max-width: 430px;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.single-station .station-copy span {
  margin-top: 7px;
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
}

.single-station .station-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.single-station .station-actions .primary { grid-column: 1 / -1; }
.single-station .station-actions .danger,
.single-station .station-actions .complete { width: 100%; }

.action.complete {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.action.complete:hover { background: #503349; }

.station-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 2.3vw, 30px);
  border: 0;
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(56, 29, 53, 0.18);
  overflow: hidden;
}

.grill-card,
.chicken-card {
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
  gap: clamp(14px, 2vh, 22px);
}

.gyro-card {
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr) auto auto;
  gap: clamp(14px, 2vh, 22px);
  color: rgba(59, 36, 56, 0.66);
  background: rgba(251, 248, 244, 0.78);
}

.station-heading { justify-content: space-between; gap: 12px; }
.station-identity { gap: 13px; min-width: 0; }

.station-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.station-label { margin-bottom: 3px; color: var(--muted); font-size: 0.57rem; }
h2 { margin-bottom: 0; font-size: clamp(1.05rem, 1.7vw, 1.35rem); font-weight: 700; letter-spacing: -0.025em; }

.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-dark);
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.neutral { background: rgba(59, 36, 56, 0.1); color: var(--ink); }
.status-pill.upcoming { background: rgba(239, 182, 85, 0.24); color: #76501c; }

.timer-wrap { display: grid; place-items: center; min-height: 0; }

.timer-ring {
  --progress: 0deg;
  width: min(50vh, 410px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), rgba(59, 36, 56, 0.1) 0);
  box-shadow: none;
  transition: background 180ms linear, box-shadow 220ms ease;
}

.timer-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: calc(100% - 10px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(59, 36, 56, 0.03);
}

.timer-value {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.timer-value strong {
  font-size: clamp(3.2rem, 6.7vw, 6.4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
}

.timer-value span,
.cut-label {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#grillCard { --timer-color: var(--ink); }
#grillCard[data-timer-tone="green"] { --timer-color: #237344; }
#grillCard[data-timer-tone="orange"] { --timer-color: #a95708; }
#grillCard[data-timer-tone="red"] { --timer-color: #bb263c; }

#grillCard .timer-ring {
  background: conic-gradient(var(--timer-color) var(--progress), rgba(59, 36, 56, 0.1) 0);
}

#grillCard .timer-value strong { color: var(--timer-color); }

#grillCard[data-timer-tone="green"] .timer-ring,
#grillCard[data-timer-tone="orange"] .timer-ring,
#grillCard[data-timer-tone="red"] .timer-ring {
  background: var(--timer-color);
}

#grillCard:is([data-timer-tone="green"], [data-timer-tone="orange"], [data-timer-tone="red"]) .timer-ring::before {
  background: transparent;
  box-shadow: none;
}

#grillCard:is([data-timer-tone="green"], [data-timer-tone="orange"], [data-timer-tone="red"]) .timer-value :is(strong, span) {
  color: #fff;
}

#grillCard[data-timer-tone="red"] .timer-ring {
  animation: timer-alert 1.2s ease-in-out infinite;
}

@keyframes timer-alert {
  0%, 100% { background: #bb263c; box-shadow: 0 0 0 3px rgba(187, 38, 60, 0.08); }
  50% { background: #861b2b; box-shadow: 0 0 0 12px rgba(187, 38, 60, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
  #grillCard[data-timer-tone="red"] .timer-ring {
    animation: none;
    box-shadow: 0 0 0 9px rgba(187, 38, 60, 0.2);
  }
}

.station-copy { display: grid; gap: 5px; }
.station-copy::before { content: ""; width: 52px; height: 3px; margin-bottom: 5px; background: var(--green); }
.station-copy strong { font-size: 0.89rem; font-weight: 700; }
.station-copy span { color: var(--muted); font-size: 0.73rem; line-height: 1.45; }

.station-actions { gap: 10px; }

.action {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--paper);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}

.action:focus-visible { outline: 3px solid rgba(239, 182, 85, 0.45); outline-offset: 3px; }
.action:active:not(:disabled) { transform: scale(0.98); }
.action:disabled { cursor: not-allowed; }

.action.primary {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green);
  color: var(--ink);
  box-shadow: none;
}

.action.primary:hover { background: #f5c56f; }
.action.primary:disabled { background: #ded1db; color: #8f7d8b; box-shadow: none; }

.button-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(59, 36, 56, 0.13);
  font-size: 0.58rem;
}

.button-icon.plus { font-size: 1.05rem; line-height: 1; }

.action.danger {
  flex: 0 0 auto;
  background: rgba(161, 63, 79, 0.08);
  border-color: rgba(161, 63, 79, 0.28);
  color: var(--red);
}

.action.danger:hover { background: rgba(161, 63, 79, 0.14); }

.cut-display {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding-top: 4px;
}

.cut-display strong {
  font-size: clamp(3rem, 5.4vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cut-detail { color: var(--muted); font-size: 0.7rem; }

.cut-visual,
.gyro-visual {
  position: absolute;
  z-index: 0;
  opacity: 0.1;
  pointer-events: none;
}

.cut-visual { right: -30px; top: 27%; width: 160px; height: 250px; transform: rotate(9deg); }
.spit-rail, .gyro-rail { position: absolute; left: 77px; top: 0; width: 4px; height: 100%; border-radius: 9px; background: var(--paper); }
.spit-shape, .gyro-shape { position: absolute; left: 32px; top: 35px; width: 94px; height: 165px; border-radius: 46% 52% 41% 55% / 20% 25% 72% 76%; background: var(--paper); }
.cut-line { position: absolute; left: 27px; width: 105px; height: 2px; background: var(--ink); transform: rotate(-7deg); }
.cut-line-one { top: 94px; }
.cut-line-two { top: 132px; }

.chicken-card > *:not(.cut-visual),
.gyro-card > *:not(.gyro-visual) { position: relative; z-index: 1; }

.gyro-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(59,36,56,0.025));
  pointer-events: none;
}

.gyro-visual { inset: 84px 0 auto; height: 53%; opacity: 0.08; }
.gyro-rail { left: calc(50% - 2px); }
.gyro-shape { left: calc(50% - 57px); top: 20px; width: 114px; height: 78%; }
.gyro-glow { position: absolute; inset: 15% 12%; border-radius: 50%; background: rgba(239, 182, 85, 0.25); filter: blur(45px); }
.gyro-copy { margin-top: auto; }

.disabled-action {
  width: 100%;
  border-color: var(--line);
  background: rgba(59, 36, 56, 0.045);
  color: #8b7887;
  cursor: not-allowed;
}

footer {
  min-height: 22px;
  justify-content: center;
  gap: 12px;
  color: #eadfe7;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.environment-badge {
  display: inline-flex;
  min-width: 132px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid #8f7c8b;
  border-radius: 999px;
  box-sizing: border-box;
  white-space: nowrap;
  font-weight: 900;
}
.environment-badge[data-environment="production"] {
  border-color: #5a9270;
  background: #203a2a;
  color: #b9e8c6;
}
.environment-badge[data-environment="development"] {
  border-color: #bd8034;
  background: #432f1b;
  color: #ffd69a;
}
@media (max-width: 420px) {
  footer { gap: 8px; font-size: 0.58rem; }
  .environment-badge { min-width: 118px; }
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 16px 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
  font-size: 0.78rem;
  font-weight: 700;
  transform: translate(-50%, 0);
  animation: toast-in 180ms ease-out;
}

.toast[hidden] { display: none; }

.toast-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--green); color: var(--ink); font-weight: 900; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
}

@media (max-width: 900px) {
  .app-shell { min-height: 100dvh; }
  .timer-console { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) auto; gap: 18px; }
  .control-panel { display: block; padding: 22px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .activity-panel { margin-bottom: 22px; }
  .station-control { max-width: 620px; margin: 0 auto; }
  .single-station .station-actions { min-width: 300px; }
  .timer-ring { width: min(42vh, 390px); }
  .station-grid { grid-template-columns: 1fr 1fr; }
  .gyro-card { grid-column: 1 / -1; min-height: 280px; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; }
  .gyro-card .station-heading { grid-column: 1 / -1; }
  .gyro-card .gyro-copy { grid-column: 1; }
  .gyro-card .disabled-action { grid-column: 2; align-self: end; }
  .gyro-visual { inset: 68px 0 0 50%; height: auto; }
}

@media (max-width: 640px) {
  .app-shell { padding-inline: 14px; }
  .topbar { grid-template-columns: 1fr auto; row-gap: 9px; }
  .topbar-kitchen { grid-column: 1 / -1; grid-row: 2; font-size: 0.68rem; }
  .topbar-right { gap: 10px; }
  .service-state { min-width: 116px; font-size: 0.7rem; }
  .clock { display: none; }
  .sign-out { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .kitchen-controls { width: 100%; }
  .kitchen-picker { min-width: 0; flex: 1 1 170px; }
  .sound-control { flex: 1 1 110px; }
  .shift-summary { max-width: 90px; text-align: right; }
  .station-grid { grid-template-columns: 1fr; }
  .single-station { min-height: 620px; }
  .timer-console { grid-template-rows: minmax(310px, 1fr) auto; }
  .control-panel { grid-template-columns: 1fr; gap: 18px; }
  .single-station .station-actions { min-width: 0; }
  .timer-ring { width: min(38vh, 320px); }
  .station-card { min-height: 540px; }
  .gyro-card { grid-column: auto; min-height: 420px; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto; }
  .gyro-card .station-heading,
  .gyro-card .gyro-copy,
  .gyro-card .disabled-action { grid-column: auto; }
  .gyro-visual { inset: 75px 0 auto; height: 52%; }
}

@media (max-width: 380px) {
  .brand > div { display: none; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .app-shell { padding-top: 0; padding-bottom: 12px; gap: 13px; }
  main { gap: 14px; }
  .topbar { min-height: 42px; }
  .page-heading h1 { font-size: 2rem; }
  .station-card { padding: 18px; gap: 12px; }
  .single-station { padding: 18px 24px; gap: 10px; }
  .timer-ring { width: min(48vh, 350px); }
  .timer-value strong { font-size: 5.5rem; }
  .action { min-height: 48px; }
}

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

/* Keep activity, elapsed time and controls in one centered reading order. */
.single-station { position: relative; grid-template-rows: 1fr; min-height: 0; }
.timer-status { position: absolute; top: 20px; right: 24px; }
.timer-console { width: min(100%, 620px); margin-inline: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 24px; }
.timer-console .activity-panel { width: 100%; }
.timer-console .timer-ring { width: min(36vh, 360px); max-width: 100%; }
.timer-console .station-control { display: grid; align-content: start; gap: 12px; width: 100%; margin: 0; }
.timer-instruction { text-align: center; color: var(--muted); font-size: .78rem; }
.single-station .station-actions { min-width: 0; width: 100%; }
@media (max-width: 1100px) {
  .timer-status { position: static; display: flex; justify-content: flex-end; }
  .single-station { grid-template-rows: auto 1fr; }
  .timer-console { gap: 20px; }
}
@media (max-height: 740px) and (min-width: 1101px) {
  .timer-console { gap: 14px; }
  .timer-console .timer-ring { width: min(30vh, 260px); }
}
.single-station .station-actions { display: flex; }
.single-station .station-actions .action { flex: 1; }

.sound-control {
  min-height: 44px;
  min-width: 150px;
  padding: 10px 18px;
  border: 2px solid var(--green);
  border-radius: 12px;
  background: var(--green);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.sound-control:hover { filter: brightness(1.08); }
.sound-control:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.sound-control[data-enabled="true"] { background: transparent; color: var(--green); }
@media (max-width: 640px) {
  .sound-control { min-width: 0; }
}

/* The live activity panel already communicates the idle status. */
.single-station[data-state="ready"] .timer-status { display: none; }
.single-station[data-state="ready"] { grid-template-rows: 1fr; }

/* Recording is a separate workstation alongside the authoritative timer. */
.timer-workspace { width: min(100%, 980px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 620px) minmax(240px, 280px); gap: 32px; align-items: start; }
clip-recorder { display: block; min-width: 0; padding-top: 0; }
.clip-panel { padding: 22px; border-radius: 18px; border-top: 4px solid var(--gold, #f4b949); background: #3e263c; color: #fffaf6; box-shadow: 0 12px 28px #3d24351a; }
.clip-panel .eyebrow { margin: 0 0 18px; color: #f4bd55; }
.clip-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.clip-buttons button, .clip-cancel { min-height: 46px; border: 1px solid #ffffff24; border-radius: 12px; background: #ffffff0d; color: inherit; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.clip-buttons button:hover:not(:disabled) { background: #ffffff22; border-color: #f4bd55; }
.clip-buttons button:focus-visible, .clip-cancel:focus-visible { outline: 3px solid #f4bd55; outline-offset: 3px; }
.clip-buttons button:disabled, .clip-cancel:disabled { opacity: .5; cursor: not-allowed; }
.clip-progress { min-height: 38px; margin-top: 16px; font-size: 13px; line-height: 1.5; font-weight: 700; }
.clip-cancel { width: 100%; margin-top: 12px; border-color: #e0a7b5; }
.clip-cancel[hidden] { display: none; }
@media (max-width: 850px) { .timer-workspace { grid-template-columns: minmax(0, 1fr); max-width: 620px; gap: 24px; } .clip-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 380px) { .clip-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.timer-workspace .timer-wrap { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.timer-workspace .timer-ring { width: min(100%, 36vh, 360px); }
@media (max-width: 640px) { .app-shell { --page-pad: 14px; } }

/* PDF-inspired timer card grid. Activity and training remain available to the
   application but are intentionally absent from the customer-facing surface. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar-kitchen-picker {
  width: min(100%, 190px);
  min-width: 150px;
  color: #cfbdcb;
}

.topbar-kitchen-picker select {
  min-height: 36px;
  border-color: rgba(255, 250, 245, 0.3);
  background-color: rgba(255, 255, 255, 0.06);
}

.single-station,
.single-station[data-state="ready"] {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.timer-workspace {
  width: 100%;
  display: block;
  margin: 0;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
  align-items: stretch;
}

.timer-console {
  width: 100%;
  min-height: clamp(480px, 64vh, 650px);
  margin: 0;
  padding: clamp(18px, 2vw, 26px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  border: 2px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(56, 29, 53, 0.18);
}

.timer-placeholder {
  min-height: clamp(480px, 64vh, 650px);
  padding: clamp(18px, 2vw, 26px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  border: 2px dashed rgba(255, 250, 245, 0.22);
  border-radius: 20px;
  background: rgba(255, 250, 245, 0.06);
}

.placeholder-heading,
.placeholder-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.placeholder-heading span:first-child,
.placeholder-heading span:last-child,
.placeholder-control span {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.12);
}

.placeholder-heading span:first-child { width: 42%; }
.placeholder-heading span:last-child { width: 35%; }

.placeholder-display {
  border: 1px solid rgba(255, 250, 245, 0.1);
  border-radius: 16px;
  background: rgba(255, 250, 245, 0.035);
}

.placeholder-control {
  display: grid;
  gap: 12px;
}

.placeholder-control span:first-child { width: 68%; height: 10px; justify-self: center; }
.placeholder-control span:last-child { width: 100%; height: 54px; }

.timer-status,
.single-station[data-state="ready"] .timer-status {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
}

.timer-card-title {
  min-width: 0;
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timer-status .status-pill {
  width: 112px;
  text-align: center;
  white-space: nowrap;
}

.timer-console .timer-wrap,
.timer-workspace .timer-wrap {
  min-width: 0;
  display: grid;
  place-items: stretch;
}

.timer-console .timer-ring,
.timer-workspace .timer-ring {
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 16px;
  background: rgba(59, 36, 56, 0.055);
  box-shadow: inset 0 0 0 1px rgba(59, 36, 56, 0.045);
}

.timer-ring::before { display: none; }

#grillCard .timer-ring {
  background: rgba(59, 36, 56, 0.055);
}

#grillCard:is([data-timer-tone="green"], [data-timer-tone="orange"], [data-timer-tone="red"]) .timer-ring {
  background: var(--timer-color);
}

.timer-value strong {
  font-size: clamp(4.4rem, 7vw, 7.4rem);
}

.timer-console .station-control {
  width: 100%;
  margin: 0;
  gap: 12px;
}

.timer-instruction {
  min-height: 2.8em;
  display: grid;
  place-items: center;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .timer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timer-console,
  .timer-placeholder { min-height: 560px; }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto minmax(140px, 1fr);
    column-gap: 14px;
  }

  .topbar-kitchen-picker {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
  }

  .topbar-right {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .timer-grid { grid-template-columns: minmax(0, 1fr); }
  .timer-console { min-height: min(620px, 70vh); }
  .timer-placeholder { display: none; }
}

@media (max-width: 420px) {
  .topbar-kitchen-picker { min-width: 0; }
  .topbar-kitchen-picker select { width: 100%; }
  .timer-console { min-height: 520px; padding: 16px; }
  .timer-value strong { font-size: clamp(4rem, 25vw, 6rem); }
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 250, 245, 0.34);
  border-radius: 999px;
  background: #806e7c;
  pointer-events: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.theme-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.theme-switch input:checked + .theme-switch-track {
  border-color: var(--green);
  background: var(--green);
}

.theme-switch input:checked + .theme-switch-track::after {
  transform: translateX(16px);
  background: #3b2438;
}

.theme-switch input:focus-visible + .theme-switch-track {
  outline: 3px solid rgba(239, 182, 85, 0.48);
  outline-offset: 3px;
}

html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] body,
html[data-theme="dark"] .auth-shell {
  background: #120d13;
}

html[data-theme="dark"] .topbar { background: #171118; }

html[data-theme="dark"] .timer-console,
html[data-theme="dark"] .auth-card {
  border-color: #49384d;
  border-top-color: var(--green);
  background: #241a26;
  color: #fff8fc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .timer-placeholder {
  border-color: rgba(255, 248, 252, 0.075);
  background: rgba(255, 248, 252, 0.018);
}

html[data-theme="dark"] .placeholder-heading span,
html[data-theme="dark"] .placeholder-control span {
  background: rgba(255, 248, 252, 0.055);
}

html[data-theme="dark"] .placeholder-display {
  border-color: rgba(255, 248, 252, 0.045);
  background: rgba(255, 248, 252, 0.012);
}

html[data-theme="dark"] #grillCard { --timer-color: #fff8fc; }
html[data-theme="dark"] #grillCard[data-timer-tone="green"] { --timer-color: #237344; }
html[data-theme="dark"] #grillCard[data-timer-tone="orange"] { --timer-color: #a95708; }
html[data-theme="dark"] #grillCard[data-timer-tone="red"] { --timer-color: #bb263c; }

html[data-theme="dark"] #grillCard .timer-ring {
  background: #2f2331;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 252, 0.08);
}

html[data-theme="dark"] #grillCard:is([data-timer-tone="green"], [data-timer-tone="orange"], [data-timer-tone="red"]) .timer-ring {
  background: var(--timer-color);
}

html[data-theme="dark"] .timer-value span,
html[data-theme="dark"] .timer-instruction,
html[data-theme="dark"] .auth-copy > p:last-child,
html[data-theme="dark"] .auth-status {
  color: #c8b9c5;
}

html[data-theme="dark"] .action.primary { color: #3b2438; }

html[data-theme="dark"] .action.complete {
  border-color: #5a465d;
  background: #3e2b40;
  color: #fff8fc;
}

html[data-theme="dark"] .action.danger {
  border-color: rgba(239, 166, 180, 0.36);
  background: rgba(161, 63, 79, 0.18);
  color: #f0a6b4;
}

html[data-theme="dark"] .auth-copy h1,
html[data-theme="dark"] #authForm label { color: #fff8fc; }
html[data-theme="dark"] #authForm input { color: #3b2438; }

@media (max-width: 760px) {
  .theme-switch { font-size: 0.68rem; }
}

@media (max-width: 420px) {
  .brand > div span { display: none; }
}

/* Functional hold progress stays inside the existing action silhouette. */
.hold-action { position: relative; overflow: hidden; isolation: isolate; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding-inline: 10px; white-space: nowrap; }
.hold-action span { position: relative; z-index: 1; }
.hold-action::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: .16; transform: scaleX(0); transform-origin: left; pointer-events: none; }
.hold-action.holding::before { animation: hold-action-progress 1s linear forwards; }
@keyframes hold-action-progress { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .hold-action.holding::before { animation: none; transform: scaleX(1); } }

.fullscreen-control { background: transparent; color: var(--green); }
.app-shell.command-center-focused { max-width: none; grid-template-rows: 1fr; padding: 0; gap: 0; }
.command-center-focused > .topbar,
.command-center-focused > footer { display: none; }
main.command-center-fullscreen {
  box-sizing: border-box;
  width: 100%;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) var(--page-pad, 40px) max(24px, env(safe-area-inset-bottom));
  background: var(--dashboard-bg);
  overflow-y: auto;
}
main:fullscreen { height: 100dvh; }
.command-center-fullscreen .timer-grid { min-height: 0; }
.command-center-fullscreen .timer-console,
.command-center-fullscreen .timer-placeholder { min-height: max(480px, calc(100dvh - 180px)); }
@media (max-width: 640px) {
  main.command-center-fullscreen { padding-inline: 14px; }
  .command-center-fullscreen .timer-console { min-height: max(480px, calc(100dvh - 240px)); }
}

html[data-theme="dark"] { --dashboard-bg: #120d13; }

.command-center-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.command-center-logo { width: 58px; height: 78px; object-fit: contain; flex: none; }
#enableSound { border-color: transparent; background: transparent; color: var(--green); display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; padding-inline: 12px; }
.sound-toggle-track { width: 32px; height: 20px; flex: none; border: 1px solid currentColor; border-radius: 999px; background: rgba(59,36,56,.2); padding: 2px; }
.sound-toggle-track::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: currentColor; transition: transform 160ms ease; }
#enableSound[aria-checked="true"] .sound-toggle-track::before { transform: translateX(12px); }
@media (max-width: 640px) { .command-center-logo { width: 38px; height: 52px; } .command-center-brand { gap: 10px; } #enableSound { gap: 6px; font-size: .72rem; } }
@media (prefers-reduced-motion: reduce) { .sound-toggle-track::before { transition: none; } }

/* CC-5 brand palette; operational timer colors retain their existing meaning. */
html:not([data-theme="dark"]) body { color: var(--ink); }
html:not([data-theme="dark"]) .topbar { background: var(--ink); border-bottom-color: var(--ink); }
html:not([data-theme="dark"]) .brand,
html:not([data-theme="dark"]) .clock strong,
html:not([data-theme="dark"]) .theme-switch,
html:not([data-theme="dark"]) .service-state { color: #fff; }
html:not([data-theme="dark"]) .brand > div span,
html:not([data-theme="dark"]) .sign-out,
html:not([data-theme="dark"]) .clock span,
html:not([data-theme="dark"]) .topbar-kitchen-picker { color: #E0CFDA; }
html:not([data-theme="dark"]) .topbar-kitchen-picker select { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.32); }
html:not([data-theme="dark"]) .topbar-kitchen-picker select option { color: var(--ink); background: #fff; }
html:not([data-theme="dark"]) .page-heading h1,
html:not([data-theme="dark"]) .eyebrow { color: #fff; }
html:not([data-theme="dark"]) .timer-console { border-color: rgba(131,81,119,.18); border-top-color: var(--green); box-shadow: 0 12px 32px rgba(131,81,119,.09); }
html:not([data-theme="dark"]) .timer-placeholder { border-color: rgba(131,81,119,.18); background: #F8F3F5; }
html:not([data-theme="dark"]) .placeholder-heading span,
html:not([data-theme="dark"]) .placeholder-control span { background: rgba(131,81,119,.1); }
html:not([data-theme="dark"]) .placeholder-display { border-color: rgba(131,81,119,.1); background: rgba(131,81,119,.02); }
html:not([data-theme="dark"]) .status-pill { background: var(--brand-plum); color: #fff; }
html:not([data-theme="dark"]) .action.complete { background: var(--brand-plum); color: #fff; }
html:not([data-theme="dark"]) .fullscreen-control,
html:not([data-theme="dark"]) #enableSound { color: #fff; }
.sound-control:focus-visible { outline-color: var(--brand-plum); }
html[data-theme="dark"] .sound-control:focus-visible { outline-color: var(--green); }
html:not([data-theme="dark"]) footer { color: #F8F3F5; }
.brand-mark { background: var(--green); }

/* Release updates remain readable on narrow kitchen tablets. */
footer { flex-wrap: wrap; }
.update-controls { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.update-controls[hidden] { display: none; }
#updateNow { color: #3D2438; background: #FDAB41; border: 0; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; min-height: 44px; }
#updateNow:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
#updateNow:disabled { opacity: .65; cursor: wait; }

/* Compact kitchen layout for phones and portrait/landscape tablets. */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 12px 20px; }
  .topbar-kitchen-picker { grid-column: 2; grid-row: 1; justify-self: end; min-width: 0; width: min(100%, 280px); }
  .topbar-right { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
  .topbar-kitchen-picker select { min-height: 44px; width: 100%; }
  .theme-switch, .sign-out { min-height: 44px; }
  .brand { min-width: 0; }
}
@media (max-width: 900px) {
  .app-shell { --page-pad: 20px; gap: 16px; }
  .timer-grid { grid-template-columns: minmax(0, 1fr); }
  .timer-placeholder { display: none; }
  .single-station { min-height: 0; }
  .timer-console { min-height: clamp(340px, calc(100dvh - 280px), 650px); padding: 20px; gap: 14px; }
  .page-heading { align-items: center; flex-wrap: wrap; gap: 14px; }
  .page-heading h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
  .kitchen-controls { align-items: center; }
  .sound-control { min-height: 44px; }
  .timer-value strong { font-size: clamp(4rem, 13vw, 7rem); }
  .command-center-fullscreen .timer-console { min-height: max(300px, calc(100dvh - 160px)); }
  footer { line-height: 1.5; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 640px) {
  .app-shell { --page-pad: 14px; gap: 12px; }
  .topbar { column-gap: 12px; }
  .brand > div span { display: none; }
  .topbar-right { gap: 6px 12px; }
  .page-heading { align-items: stretch; gap: 10px; }
  .page-heading h1 { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .eyebrow { margin-bottom: 4px; }
  .kitchen-controls { gap: 8px; }
  .timer-console { min-height: clamp(320px, calc(100dvh - 285px), 520px); padding: 16px; border-radius: 16px; gap: 12px; }
  .timer-instruction { min-height: 1.4em; }
  .command-center-fullscreen .timer-console { min-height: max(280px, calc(100dvh - 180px)); }
  .auth-shell { padding: 16px; }
  .auth-card { padding: 24px; }
  #authForm input, .topbar-kitchen-picker select { font-size: 16px; }
  footer { gap: 8px 12px; font-size: .65rem; }
  .update-controls { width: 100%; }
}
@media (max-width: 900px) and (max-height: 500px) {
  .timer-console { min-height: 300px; }
  .command-center-fullscreen .timer-console { min-height: 280px; }
}

/* Allocate the available screen height instead of imposing a tall timer card. */
@media (max-width: 900px) {
  .app-shell { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  main { min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .single-station, .timer-workspace, .timer-grid { height: 100%; min-height: 0; }
  .timer-console { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
  .timer-console .timer-wrap, .timer-console .timer-ring { min-height: 0; width: 100%; }
  .timer-value { padding: 6px; }
  .timer-value strong { font-size: clamp(3rem, 10dvh, 6rem); }
  .timer-console .station-control { gap: 6px; }
  .timer-instruction { min-height: 0; font-size: .72rem; }
  .station-actions .action { min-height: 44px; }
  footer { padding-bottom: 0; }
  main.command-center-fullscreen { height: 100dvh; min-height: 0; overflow: visible; padding-top: 12px; padding-bottom: 12px; }
  .command-center-fullscreen .timer-console { min-height: 0; }
}
@media (max-width: 640px) {
  .app-shell { gap: 8px; }
  .topbar { row-gap: 4px; padding-top: 8px; padding-bottom: 4px; }
  .page-heading { gap: 6px; }
  .command-center-logo { height: 40px; width: 30px; }
  .page-heading .eyebrow { font-size: .58rem; }
  .page-heading h1 { font-size: clamp(1.3rem, 5vw, 1.65rem); }
  .timer-console { padding: 12px; gap: 8px; }
  footer { gap: 4px 10px; font-size: .6rem; }
  .update-controls { gap: 4px 8px; }
}
@media (max-width: 900px) and (max-height: 500px) and (min-width: 600px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-block: 4px; }
  .topbar .brand { display: none; }
  .topbar-kitchen-picker { grid-column: 1; grid-row: 1; justify-self: start; width: 210px; }
  .topbar-kitchen-picker > span { display: none; }
  .topbar-right { grid-column: 2; grid-row: 1; }
  .clock, .sign-out { display: none; }
  .page-heading { flex-direction: row; align-items: center; }
  .command-center-logo { height: 30px; width: 23px; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { font-size: 1.25rem; }
  .kitchen-controls { width: auto; }
  .sound-control { min-width: 110px; padding-inline: 8px; }
  .update-controls { width: auto; }
  .timer-console { padding: 8px 12px; gap: 4px; }
  .timer-instruction { display: none; }
  .timer-value strong { font-size: clamp(2rem, 12dvh, 3rem); }
  .timer-value span { font-size: .58rem; }
}

/* A single focused workspace with quiet surfaces and clear hierarchy. */
:root { --dashboard-bg: #f5f5f7; --ink: #1d1d1f; --muted: #6e6e73; --line: rgba(29,29,31,.08); }
.app-shell { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 2dvh, 24px); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.topbar { min-height: 64px; padding-block: 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); column-gap: 24px; }
html:not([data-theme="dark"]) .topbar { background: rgba(255,255,255,.7); border-bottom-color: var(--line); }
html:not([data-theme="dark"]) :is(.brand,.clock strong,.theme-switch,.service-state) { color: var(--ink); }
html:not([data-theme="dark"]) :is(.brand > div span,.clock span,.sign-out,.topbar-kitchen-picker) { color: var(--muted); }
.brand > div span { font-size: .6rem; letter-spacing: .08em; }
.brand-mark { border-radius: 9px; }
.topbar-kitchen-picker select { border-radius: 12px; min-height: 44px; }
html:not([data-theme="dark"]) .topbar-kitchen-picker select { background: #fff; color: var(--ink); border-color: rgba(29,29,31,.12); }
.topbar-right { gap: clamp(12px, 2vw, 28px); }
.theme-switch { min-height: 44px; }
.theme-switch-track { border-color: transparent; background: #d2d2d7; }
.theme-switch-track::before { background: #fff; }
.service-dot { background: #248a3d; box-shadow: none; }
.service-state.offline .service-dot { background: #b87500; }
main { min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 16px; }
.page-heading { align-items: center; gap: 12px; }
.command-center-brand { gap: 12px; }
.command-center-logo { width: 34px; height: 46px; }
.page-heading h1 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.12; letter-spacing: -.035em; }
.page-heading .eyebrow { font-size: .6rem; letter-spacing: .12em; margin-bottom: 5px; }
html:not([data-theme="dark"]) .page-heading h1 { color: var(--ink); }
html:not([data-theme="dark"]) .page-heading .eyebrow { color: var(--brand-plum); }
.kitchen-controls { gap: 8px; align-items: center; }
.sound-control { border-radius: 999px; border-width: 1px; min-width: 132px; min-height: 44px; font-weight: 500; }
html:not([data-theme="dark"]) .fullscreen-control, html:not([data-theme="dark"]) #enableSound { background: #fff; color: var(--ink); border: 1px solid rgba(29,29,31,.12); }
html[data-theme="dark"] .fullscreen-control, html[data-theme="dark"] #enableSound { background: #241a26; color: #fff8fc; border: 1px solid rgba(255,255,255,.16); }
.sound-toggle-track { border: 0; background: #d2d2d7; }
.sound-toggle-track::before { background: white; }
#enableSound[aria-checked="true"] .sound-toggle-track { background: var(--brand-plum); }
.single-station, .timer-workspace, .timer-grid { height: 100%; min-height: 0; }
.timer-workspace { max-width: 1080px; margin-inline: auto; }
.timer-grid { grid-template-columns: minmax(0, 1fr); }
.timer-console { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 28px; padding: clamp(16px, 2.5vw, 32px); gap: 16px; box-shadow: 0 4px 24px rgba(29,29,31,.04); }
html:not([data-theme="dark"]) .timer-console { border: 1px solid var(--line); box-shadow: 0 4px 24px rgba(29,29,31,.04); }
.timer-card-title { font-size: 1rem; font-weight: 500; }
html:not([data-theme="dark"]) .status-pill { background: #f0e8ef; color: #75456c; }
.timer-console .timer-ring { width: 100%; min-height: 0; border-radius: 20px; box-shadow: none; }
html:not([data-theme="dark"]) #grillCard:not([data-timer-tone="green"]):not([data-timer-tone="orange"]):not([data-timer-tone="red"]) .timer-ring { background: #f8f8fa; }
.timer-value strong { font-size: clamp(3rem, min(15vw, 25dvh), 12rem); font-weight: 500; letter-spacing: -.055em; }
.timer-value span { font-size: .65rem; letter-spacing: .15em; color: var(--muted); }
.timer-console .station-control { max-width: 600px; gap: 8px; margin-inline: auto; }
.station-actions .action { min-height: 48px; border-radius: 999px; }
.timer-instruction { min-height: 0; color: var(--muted); }
footer { font-size: .6rem; letter-spacing: .05em; gap: 8px 12px; }
html:not([data-theme="dark"]) footer { color: var(--muted); }
.environment-badge { min-width: 0; padding-inline: 10px; border-radius: 999px; }
html:not([data-theme="dark"]) .environment-badge { background: #ebe4ea; border-color: transparent; color: #75456c; }
#updateNow { background: var(--brand-plum); color: #fff; border-radius: 999px; }
main.command-center-fullscreen { background: var(--dashboard-bg); height: 100dvh; min-height: 0; padding-block: 16px; overflow: visible; }
.command-center-fullscreen .timer-console { min-height: 0; }
@media (max-width: 1100px) { .topbar-right { gap: 8px 16px; } }
@media (max-width: 640px) {
  .app-shell { gap: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .topbar { min-height: 0; padding-top: 6px; padding-bottom: 2px; column-gap: 12px; }
  .topbar-right { gap: 4px 12px; }
  .brand > div span { display: none; }
  main { gap: 10px; }
  .page-heading { gap: 8px; }
  .command-center-logo { width: 26px; height: 35px; }
  .page-heading h1 { font-size: 1.45rem; }
  .page-heading .eyebrow { display: none; }
  .timer-console { padding: 12px; gap: 8px; border-radius: 22px; }
  .timer-console .timer-ring { border-radius: 14px; }
  .timer-card-title { font-size: .9rem; }
  .timer-value strong { font-size: clamp(3rem, min(22vw, 15dvh), 6rem); }
  .station-actions .action { min-height: 44px; }
  .timer-instruction { font-size: .7rem; }
  footer { gap: 4px 8px; }
}
@media (max-width: 900px) and (max-height: 500px) and (min-width: 600px) {
  .topbar { padding-block: 2px; }
  main { gap: 6px; }
  .page-heading h1 { font-size: 1.25rem; }
  .page-heading .eyebrow { display: none; }
  .timer-console { padding: 8px 12px; gap: 4px; border-radius: 18px; }
  .timer-instruction { display: none; }
  .timer-value strong { font-size: clamp(2rem, 12dvh, 3rem); }
}

/* Three future stations remain part of the customer-facing workspace. */
.timer-workspace { max-width: none; }
.timer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 24px); }
.timer-placeholder { display: grid; height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; padding: clamp(16px, 2.5vw, 32px); border: 1px dashed rgba(131,81,119,.2); border-radius: 28px; background: rgba(255,255,255,.5); gap: 16px; }
html:not([data-theme="dark"]) .timer-placeholder { background: rgba(255,255,255,.5); border-color: rgba(131,81,119,.2); }
.placeholder-display { min-height: 0; border-radius: 20px; background: rgba(131,81,119,.025); border: 1px solid rgba(131,81,119,.05); }
.placeholder-heading span:first-child, .placeholder-heading span:last-child, .placeholder-control span { background: rgba(131,81,119,.09); }
.timer-value strong { font-size: clamp(3rem, min(7vw, 20dvh), 7rem); }
.command-center-fullscreen .timer-placeholder { min-height: 0; }
@media (max-width: 900px) {
  .timer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) clamp(44px, 9dvh, 72px); gap: 8px; }
  .timer-console { grid-column: 1 / -1; }
  .timer-placeholder { padding: 8px; border-radius: 14px; gap: 6px; grid-template-rows: auto minmax(0, 1fr); }
  .placeholder-heading { gap: 6px; }
  .placeholder-heading span:first-child, .placeholder-heading span:last-child { height: 5px; }
  .placeholder-display { border-radius: 6px; }
  .placeholder-control { display: none; }
  .timer-value strong { font-size: clamp(3rem, min(22vw, 15dvh), 6rem); }
}
@media (max-width: 900px) and (max-height: 500px) {
  .timer-grid { grid-template-rows: minmax(0, 1fr) 36px; gap: 6px; }
  .timer-placeholder { padding: 5px 8px; gap: 3px; border-radius: 10px; }
  .timer-value strong { font-size: clamp(2rem, 10dvh, 3rem); }
}

/* Keep release controls inside the native fullscreen surface. */
main.command-center-fullscreen { grid-template-rows: auto minmax(0, 1fr) auto; }
.command-center-fullscreen > footer { display: flex; min-width: 0; flex-wrap: wrap; }

/* Give the mascot and its glasses animation a little more presence. */
.command-center-logo { width: 43px; height: 58px; }
@media (max-width: 640px) {
  .command-center-logo { width: 33px; height: 44px; }
}
@media (max-width: 900px) and (max-height: 500px) and (min-width: 600px) {
  .command-center-logo { width: 28px; height: 38px; }
}

.fullscreen-kitchen-name { display: none; margin: 4px 0 0; font-size: .88rem; font-weight: 500; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; }
.command-center-fullscreen .fullscreen-kitchen-name { display: block; }
.command-center-brand > div { min-width: 0; }
@media (max-width: 640px) { .fullscreen-kitchen-name { font-size: .78rem; margin-top: 2px; } }

/* Alert preferences live in a dialog, preserving the timer workspace. */
.alert-settings-button { min-width: 44px; flex: none; padding-inline: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.alert-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 16px 64px #0003; }
.alert-dialog::backdrop { background: #0006; }
.alert-dialog h2 { margin: 0 0 12px; font-size: 1.4rem; }
.alert-dialog p { margin: 0 0 20px; line-height: 1.5; font-size: .9rem; }
.alert-dialog label { display: block; margin-bottom: 8px; font-weight: 700; }
.alert-dialog select { width: 100%; min-height: 48px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 16px; }
.alert-dialog .alert-setting-note { margin: 12px 0 20px; font-size: .78rem; color: var(--muted); }
.alert-dialog .action { width: 100%; min-height: 44px; }
html[data-theme="dark"] .alert-settings-button { background: #241a26; color: #fff8fc; }
@media (max-width: 640px) {
  .kitchen-controls { gap: 6px; }
  .fullscreen-control { min-width: 0; padding-inline: 8px; }
  #enableSound { min-width: 0; padding-inline: 6px; }
  .alert-settings-button { flex: none; min-width: 44px; padding-inline: 8px; font-size: .72rem; }
}

.alert-dialog .alert-sample { margin-top: 12px; width: 100%; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); }
.alert-dialog .alert-preview-status { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
.alert-preview-status:empty { display: none; }

/* Match Grill Monitor's header palette in both themes. */
html:not([data-theme="dark"]) .topbar,
html[data-theme="dark"] .topbar {
  background: #835177;
  border-bottom-color: #ffffff26;
  color: #fff;
}
html .topbar .brand,
html .topbar .brand strong,
html .topbar .theme-switch,
html .topbar .service-state,
html .topbar .clock strong,
html .topbar .clock span,
html .topbar .sign-out { color: #fff; }
html .topbar .topbar-kitchen-picker select {
  color: #fff;
  background: #ffffff15;
  border-color: #ffffff40;
}
html .topbar .topbar-kitchen-picker select option { color: #342032; background: #fff; }
