html {
  width: 100%;
  height: 100%;
  min-width: 0;
}

body.stream-surface {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 30px;
  overflow: hidden;
}

.stream-topbar {
  min-height: 52px;
  height: 52px;
  padding: 0 20px;
  grid-template-columns: 210px minmax(0, 1fr) 400px;
}

.stream-topbar .wordmark { font-size: 14px; }
.stream-topbar .utilities { gap: 16px; }

.stream-topbar .signal-controls {
  padding-right: 14px;
  gap: 9px;
}

.stream-topbar .sound-control {
  width: 134px;
  min-height: 34px;
}

.stream-spec {
  color: var(--muted);
  font-family: "Spline Sans Mono", monospace;
  font-size: 8px;
  white-space: nowrap;
}

.stream-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 62%) minmax(440px, 38%);
  overflow: hidden;
  background: var(--paper);
}

.stream-hero {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  border-right: 1px solid var(--ink);
  background: var(--paper);
}

.stream-hero::before,
.stream-hero::after {
  content: "";
  width: 1px;
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  background: var(--rule);
  pointer-events: none;
}

.stream-hero::before { left: 12%; }
.stream-hero::after { right: 12%; }

.stream-hero .hero-copy {
  padding: 23px 30px 0;
  position: relative;
  z-index: 6;
  text-align: left;
}

.stream-hero .hero-copy p {
  margin-bottom: 5px;
  font-size: 8px;
}

.stream-hero .hero-copy h1 {
  font-size: 56px;
  line-height: 0.9;
}

.stream-hero .hero-line {
  margin-top: 9px;
  justify-content: flex-start;
  font-size: 14px;
}

.stream-hero .button-zone {
  width: 100%;
  min-height: 0;
  margin: 0;
  position: absolute;
  inset: 92px 0 0;
}

.stream-hero .button-zone::after {
  right: 30px;
  bottom: 20px;
  left: 30px;
}

.stream-hero .button-machine {
  width: 680px;
  max-width: 86%;
  transform: translateY(5px);
}

.stream-hero .stage-register {
  bottom: 36px;
  left: 30px;
  width: 164px;
}

.stream-hero .stage-register > strong { font-size: 64px; }

.stream-hero .machine-label {
  display: none;
}

.stream-console {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 164px 120px 172px minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
}

.stream-console .live-receipt {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 18px 16px;
  grid-template-columns: 76px 54px minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--ink);
}

.stream-console .receipt-counter {
  padding-right: 12px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "label"
    "meter"
    "state";
  gap: 7px;
}

.stream-console .receipt-counter > small {
  margin-top: 0;
  line-height: 1.35;
}

.stream-console .receipt-mark { align-self: center; }

.stream-console .receipt-copy strong {
  overflow: visible;
  font-size: 23px;
  line-height: 0.98;
  text-overflow: clip;
  white-space: normal;
}

.stream-console .receipt-copy > span { margin-bottom: 7px; }

.stream-console .receipt-copy small {
  margin-top: 8px;
  font-size: 8px;
}

.stream-console .live-receipt > a { display: none; }

.stream-console .button-round {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  grid-template-columns: 144px minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid var(--ink);
}

.stream-console .round-heading {
  padding: 12px 14px;
  gap: 6px 8px;
}

.stream-console .round-heading > b {
  font-size: 13px;
  gap: 4px;
}

.stream-console .round-heading > b i { font-size: 14px; }
.stream-console .round-heading > b > span { display: none; }

.stream-console .round-board {
  padding: 12px 14px;
  grid-template-rows: 30px 12px 13px;
  gap: 7px;
}

.stream-console .round-legend {
  align-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 7px;
  line-height: 1;
  white-space: normal;
}

.stream-console .round-track { height: 12px; }
.stream-console .round-board > small { font-size: 7px; }

.stream-console .metrics {
  width: 100%;
  height: 100%;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
  border-bottom: 1px solid var(--ink);
}

.stream-console .metrics > div {
  min-height: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}

.stream-console .metrics > div:nth-child(odd) { border-left: 0; }
.stream-console .metrics > div:nth-child(even) { border-left: 1px solid var(--rule); }
.stream-console .metrics > div:nth-child(n+3) { border-bottom: 0; }
.stream-console .metrics strong { font-size: 28px; }

.stream-console .recent-events {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 0;
}

.stream-console .recent-heading {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}

.stream-console .recent-events ol {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
}

.stream-console .recent-events li:nth-child(n+3) { display: none; }

.stream-console .recent-events li a,
.stream-console .recent-empty {
  height: 100%;
  min-height: 0;
  padding: 13px 14px;
}

.stream-console .recent-events li:nth-child(2) a { border-left: 1px solid var(--rule); }

.stream-console .recent-events li strong {
  font-size: 14px;
  white-space: normal;
}

.stream-footer {
  min-height: 30px;
  height: 30px;
  padding: 0 20px;
  font-size: 8px;
}

.stream-footer strong {
  font-family: "Spline Sans Mono", monospace;
  font-size: 9px;
}

@media (min-width: 1600px) and (min-height: 900px) {
  body.stream-surface { grid-template-rows: 64px minmax(0, 1fr) 36px; }
  .stream-topbar { height: 64px; padding: 0 28px; }
  .stream-frame { grid-template-columns: minmax(0, 64%) minmax(520px, 36%); }
  .stream-hero .hero-copy { padding: 34px 42px 0; }
  .stream-hero .hero-copy h1 { font-size: 72px; }
  .stream-hero .hero-line { font-size: 17px; }
  .stream-hero .button-zone { inset: 118px 0 0; }
  .stream-hero .button-machine { width: 820px; }
  .stream-console { grid-template-rows: 220px 154px 220px minmax(0, 1fr); }
  .stream-console .receipt-copy strong { font-size: 28px; }
  .stream-console .metrics strong { font-size: 34px; }
  .stream-footer { height: 36px; padding: 0 28px; }
}

@media (max-width: 900px), (max-aspect-ratio: 4 / 3) {
  html { height: auto; }
  body.stream-surface {
    height: auto;
    min-height: 100vh;
    display: block;
    overflow: auto;
  }
  .stream-topbar {
    grid-template-columns: 1fr auto;
    padding: 0 14px;
  }
  .stream-topbar .topbar-center,
  .stream-topbar .stream-spec,
  .stream-topbar .volume-control { display: none; }
  .stream-topbar .utilities { grid-column: 2; }
  .stream-topbar .signal-controls { padding: 0; border: 0; }
  .stream-frame { display: block; overflow: visible; }
  .stream-hero { min-height: 600px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .stream-hero .hero-copy { padding: 28px 20px 0; text-align: center; }
  .stream-hero .hero-copy h1 { font-size: 48px; }
  .stream-hero .hero-line { justify-content: center; flex-wrap: wrap; font-size: 14px; }
  .stream-hero .button-zone { inset: 118px 0 0; }
  .stream-hero .button-machine { width: 620px; max-width: 100%; }
  .stream-hero .stage-register { left: 16px; }
  .stream-hero .machine-label { right: 14px; }
  .stream-console { display: block; overflow: visible; }
  .stream-console .live-receipt { min-height: 150px; }
  .stream-console .button-round { min-height: 116px; }
  .stream-console .metrics { min-height: 172px; }
  .stream-console .recent-events { min-height: 170px; }
  .stream-footer { min-height: 40px; height: auto; flex-wrap: wrap; justify-content: center; }
  .stream-footer span:last-child { display: none; }
}
