/* Enough to read the page, and no more: the sample teaches the layer, not a design system. The
   console below is plain CSS for one page — its own dark surface, in either colour scheme, because
   an operator console is one. */
:root {
  color-scheme: light dark;
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

main {
  margin: 0 auto;
  max-width: 60rem;
  padding: 2rem 1rem;
}

.lede {
  color: color-mix(in srgb, currentColor 70%, transparent);
}

.footnote {
  color: var(--dim, color-mix(in srgb, currentColor 60%, transparent));
  font-size: 0.8125rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
}

.console {
  --panel: #11151c;
  --edge: #242d3a;
  --ink: #dbe3ee;
  --dim: #8794a6;
  --live: #4ade80;
  --alarm: #fb7185;
  --key: #1b2431;
  color: var(--ink);
  display: grid;
  gap: 0.75rem;
}

.console h2 {
  color: var(--dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.console .bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.console .badge {
  background: var(--key);
  border: 1px solid var(--edge);
  border-radius: 999px;
  color: var(--dim);
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.25rem 0.75rem;
}

.console button {
  background: var(--key);
  border: 1px solid var(--edge);
  border-radius: 0.5rem;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0.5rem 1rem;
}

/* `:focus`, not `:focus-visible`: the agent moves focus programmatically, and the ring is how a
   person watching sees which button it is about to press. */
.console button:focus {
  outline: 2px solid var(--live);
  outline-offset: 2px;
}

.console button[disabled] {
  cursor: progress;
  opacity: 0.5;
}

.console .agent[aria-pressed='true'] {
  border-color: var(--live);
  color: var(--live);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 0.75rem;
  padding: 1rem;
}

.decks {
  align-items: start;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1.35fr 1fr;
}

/* The stage and the queue stack; the log sits beside them, so it is on screen from the first press. */
.column {
  display: grid;
  gap: 0.75rem;
}

@media (width < 52rem) {
  .decks {
    grid-template-columns: 1fr;
  }
}

.stage.ringing {
  animation: ring 1.2s ease-in-out infinite;
}

@keyframes ring {
  50% {
    border-color: var(--live);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage.ringing {
    animation: none;
    border-color: var(--live);
  }
}

.stage .number {
  font-family: ui-monospace, monospace;
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

.stage .idle {
  color: var(--dim);
}

.vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 0 1rem;
}

.vitals dt {
  color: var(--dim);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vitals dd {
  font-family: ui-monospace, monospace;
  margin: 0;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.console .key {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  min-width: 8rem;
  padding: 1rem 0.5rem;
}

.console .key:hover:not([disabled]) {
  border-color: var(--live);
}

.disposition {
  border: 1px solid var(--edge);
  border-radius: 0.5rem;
  margin: 1rem 0 0;
}

.disposition legend {
  color: var(--dim);
  font-size: 0.75rem;
  padding: 0 0.375rem;
}

.disposition input[type='text'] {
  background: var(--key);
  border: 1px solid var(--edge);
  border-radius: 0.375rem;
  color: var(--ink);
  font: inherit;
  padding: 0.375rem 0.5rem;
  width: 100%;
}

#call-list {
  display: grid;
  gap: 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#call-list button {
  display: grid;
  gap: 0.125rem;
  text-align: left;
  width: 100%;
}

#call-list button[aria-current='true'] {
  border-color: var(--live);
}

#call-list .who {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

#call-list .what,
.queue .done .what {
  color: var(--dim);
  font-size: 0.75rem;
}

.queue .when {
  color: var(--dim);
  font-size: 0.6875rem;
}

.queue .raw {
  font-family: ui-monospace, monospace;
}

.queue h3 {
  color: var(--dim);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin: 0.75rem 0 0.375rem;
  text-transform: uppercase;
}

/* Four closed calls fit without a scrollbar; the count below says what the log still holds. */
.queue ul {
  max-height: 19rem;
  overflow-y: auto;
}

.queue .done {
  display: grid;
  gap: 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.queue .done button {
  display: grid;
  gap: 0.125rem;
  opacity: 0.75;
  text-align: left;
  width: 100%;
}

.log {
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  position: sticky;
  top: 1rem;
}

.log ol {
  display: grid;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
  padding: 0;
}

.log .line {
  display: flex;
  gap: 0.5rem;
}

.log .voice {
  color: var(--dim);
  flex: none;
  width: 5rem;
}

.log .voice.agent,
.log .voice.note {
  color: var(--live);
}

/* Never colour alone: a refused line says `refused <code>` in its own words as well. */
.log .refused {
  color: var(--alarm);
}

#status {
  font-family: ui-monospace, monospace;
  min-height: 1.5rem;
}
