:root {
  color-scheme: dark;
  --vert-orange: #ff5d02;
  --vert-ruby: #690032;
  --vert-green: #32fe6a;
  --vert-yellow: #e5fc55;
  --vert-forest: #173e50;
  --vert-black: #000000;
  --vert-white: #ffffff;
  --ink: var(--vert-white);
  --muted: rgba(255, 255, 255, 0.76);
  --subtle: rgba(255, 255, 255, 0.56);
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(20, 24, 23, 0.86);
  --panel-strong: var(--vert-black);
  --field: #07100f;
  --green: var(--vert-green);
  --red: var(--vert-ruby);
  --gold: var(--vert-yellow);
  --blue: var(--vert-forest);
  --orange: var(--vert-orange);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 93, 2, 0.16), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(50, 254, 106, 0.14), transparent 28%),
    var(--vert-black);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
.ghost-link {
  font: inherit;
}


.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 26px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h1,
.panel h2,
.binding-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill {
  min-width: 170px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  text-align: center;
}

.status-pill.ready {
  border-color: rgba(65, 214, 143, 0.55);
  color: var(--green);
}

.status-pill.not-ready {
  border-color: rgba(255, 107, 107, 0.7);
  color: var(--red);
}

.testing-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  border: 2px solid #ffd166;
  border-radius: 8px;
  background: #2c0716;
  color: #fff8d7;
  padding: 14px 16px;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.2);
}

.testing-banner[hidden] {
  display: none;
}

.testing-banner strong {
  color: #ffd166;
  text-transform: uppercase;
}

.hero-grid,
.work-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  gap: 18px;
}

.work-grid,
.admin-grid {
  margin-top: 18px;
}

.single-response {
  grid-template-columns: 1fr;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 1.28rem;
}

.station-hero {
  min-height: 420px;
  display: grid;
  align-content: space-between;
  border-color: rgba(255, 122, 61, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 122, 61, 0.14), transparent 42%),
    var(--panel-strong);
}


.station-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
}

.state-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--subtle);
  box-shadow: 0 0 0 6px rgba(140, 133, 120, 0.14);
}

.state-dot.idle {
  background: var(--subtle);
  box-shadow: 0 0 0 6px rgba(140, 133, 120, 0.14);
}

.state-dot.makeReady {
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(255, 200, 87, 0.16);
}

.state-dot.running {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(65, 214, 143, 0.16);
}

.state-dot.paused {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.16);
}

.state-dot.completed {
  background: var(--blue);
  box-shadow: 0 0 0 6px rgba(113, 183, 255, 0.16);
}

.hero-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin: 30px 0 16px;
}

.hero-title-row h2 {
  font-size: clamp(2.2rem, 5vw, 5.8rem);
  line-height: 0.92;
}

.hero-title-row strong {
  color: var(--green);
  font-size: clamp(2.4rem, 7vw, 6.2rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.state-dot.idle + span {
  color: var(--muted);
}

.hero-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.22);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.binding-card,
.timer-card {
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-radius: 8px;
  background: rgba(255, 200, 87, 0.09);
  padding: 16px;
}

.binding-card.bound {
  border-color: rgba(65, 214, 143, 0.42);
  background: rgba(65, 214, 143, 0.09);
}

.binding-card p:last-child,
.timer-card span,
.panel-note {
  color: var(--muted);
}

.panel-note {
  margin: -4px 0 16px;
  line-height: 1.5;
}

.panel-note.ok {
  color: var(--green);
}

.route-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.route-step {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.route-step.active {
  border-color: rgba(255, 122, 61, 0.65);
  color: var(--ink);
  background: rgba(255, 122, 61, 0.18);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.primary-button,
.secondary-button,
.ghost-button,
.ghost-link,
.workflow-button,
.pause-row button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  color: #07100f;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

.ghost-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  text-decoration: none;
}

.primary-button {
  background: var(--orange);
}

.secondary-button {
  background: var(--green);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}


.ghost-link {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.compact {
  min-height: 40px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.ghost-link:hover,
.workflow-button:hover,
.pause-row button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  filter: grayscale(0.15);
}

button:disabled:hover {
  transform: none;
  filter: grayscale(0.15);
}

.workflow-panel {
  margin-top: 18px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.workflow-button {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  background: var(--field);
  color: var(--ink);
  text-align: left;
}

.workflow-button span {
  color: var(--muted);
  font-size: 0.8rem;
}

.workflow-button.make-ready {
  border-color: rgba(255, 200, 87, 0.42);
}

.workflow-button.running {
  border-color: rgba(65, 214, 143, 0.42);
}

.workflow-button.interruption {
  border-color: rgba(255, 107, 107, 0.42);
}

.workflow-button.complete {
  border-color: rgba(113, 183, 255, 0.48);
}

.pause-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pause-row button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: var(--line);
}

.response-panel {
  min-height: 100%;
}

pre {
  min-height: 150px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050807;
  color: var(--muted);
  padding: 14px;
  white-space: pre-wrap;
}

.tablet-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 20px;
}

.tablet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tablet-topbar h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  line-height: 0.92;
}

.tablet-status {
  display: grid;
  gap: 8px;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 14px 16px;
  text-align: right;
}

.tablet-status strong {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.tablet-status span {
  color: var(--green);
  font-weight: 900;
}

.tablet-workspace {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 18px;
  min-height: 0;
}

.tablet-workspace .station-hero {
  min-height: 0;
  align-content: start;
  border: 2px solid rgba(248, 245, 237, 0.16);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 24px);
}

.tablet-workspace .hero-title-row {
  align-items: center;
  margin: 12px 0;
}

.tablet-workspace .hero-title-row h2 {
  font-size: clamp(1.9rem, 4vw, 4.8rem);
}

.tablet-workspace .hero-title-row strong {
  font-size: clamp(2.6rem, 6vw, 6.2rem);
}

.station-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.station-actions .workflow-button {
  min-height: 96px;
  align-content: center;
  justify-items: center;
  border-width: 2px;
  font-size: clamp(1.45rem, 2.3vw, 2.6rem);
  text-align: center;
}

.station-actions .workflow-button span {
  color: currentColor;
  opacity: 0.78;
  font-size: clamp(0.8rem, 1.2vw, 1.05rem);
  text-transform: uppercase;
}

.tablet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 12px 14px;
}

.tablet-footer p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}


.operator-hidden-config {
  display: none;
}

body.mode-idle {
  background: #111615;
}

body.mode-makeReady {
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.24), transparent 30%),
    #191307;
}

body.mode-running {
  background:
    linear-gradient(135deg, rgba(65, 214, 143, 0.22), transparent 30%),
    #06150f;
}

body.mode-qaInspection {
  background:
    linear-gradient(135deg, rgba(113, 183, 255, 0.24), transparent 30%),
    #07121a;
}

body.mode-colorCalibration {
  background:
    linear-gradient(135deg, rgba(184, 144, 255, 0.25), transparent 30%),
    #11091a;
}

body.mode-maintenance {
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.22), transparent 30%),
    #191307;
}

body.mode-break,
body.mode-lunch {
  background:
    linear-gradient(135deg, rgba(255, 107, 107, 0.2), transparent 30%),
    #170909;
}

body.mode-completed {
  background:
    linear-gradient(135deg, rgba(113, 183, 255, 0.22), transparent 30%),
    #07111a;
}

body.mode-makeReady .station-hero {
  border-color: var(--gold);
  background: rgba(255, 200, 87, 0.15);
}

body.mode-running .station-hero {
  border-color: var(--green);
  background: rgba(65, 214, 143, 0.14);
}

body.mode-qaInspection .station-hero,
body.mode-qaInspection .workflow-button.active {
  border-color: var(--blue);
  background: rgba(113, 183, 255, 0.14);
}

body.mode-colorCalibration .station-hero,
body.mode-colorCalibration .workflow-button.active {
  border-color: #b890ff;
  background: rgba(184, 144, 255, 0.16);
}

body.mode-maintenance .station-hero,
body.mode-maintenance .workflow-button.active {
  border-color: var(--gold);
  background: rgba(255, 200, 87, 0.14);
}

body.mode-break .station-hero,
body.mode-break .workflow-button.active,
body.mode-lunch .station-hero,
body.mode-lunch .workflow-button.active {
  border-color: var(--red);
  background: rgba(255, 107, 107, 0.14);
}

body.mode-completed .station-hero {
  border-color: var(--blue);
  background: rgba(113, 183, 255, 0.14);
}

.workflow-button.active {
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(248, 245, 237, 0.12);
}

@media (max-width: 920px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .top-actions,
  .hero-grid,
  .work-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-pill {
    width: 100%;
  }

  .hero-title-row,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .tablet-topbar,
  .tablet-footer {
    display: grid;
    grid-template-columns: 1fr;
    text-align: left;
  }

  .tablet-status {
    min-width: 0;
    text-align: left;
  }

  .station-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .form-grid,
  .route-flow {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .action-row button {
    width: 100%;
  }

  .pause-row button,
  .workflow-button {
    width: 100%;
  }

  .tablet-shell {
    padding: 14px;
  }

  .station-actions {
    grid-template-columns: 1fr;
  }

}
