@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-400.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/archivo-600.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo Expanded";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-variable.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
}

:root,
[data-theme="console"] {
  color-scheme: dark;
  --tx-bg: #0f1114;
  --tx-panel: #171a1f;
  --tx-line: #2b3038;
  --tx-muted: #7c8594;
  --tx-text: #eceae4;
  --tx-cue: #22c1d6;
  --tx-cue-ink: #16181c;
  --tx-on: #2fcb78;
  --tx-wait: #f5a524;
  --tx-off: #e5412d;
  --tx-link: #22c1d6;
  --tx-radius: 4px;
  --tx-radius-sm: 2px;
  --tx-row: 32px;
  --tx-font: "Archivo", sans-serif;
  --tx-display: "Archivo Expanded", "Archivo", sans-serif;
  --tx-mono: "IBM Plex Mono", ui-monospace, monospace;
  --tx-ease: 120ms ease-out;
  --tx-screen: #0a0c0e;
}

[data-theme="portal"] {
  color-scheme: light;
  --tx-bg: #f3f0e8;
  --tx-panel: #e7e2d6;
  --tx-line: #cfc8ba;
  --tx-muted: #5c6570;
  --tx-text: #16181c;
  --tx-cue: #22c1d6;
  --tx-cue-ink: #16181c;
  --tx-on: #166b3a;
  --tx-wait: #8a5a00;
  --tx-off: #b42318;
  --tx-link: #0e7484;
  --tx-screen: #14181c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background: var(--tx-bg);
  color: var(--tx-text);
  font-family: var(--tx-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--tx-cue);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.label {
  margin: 0;
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  line-height: 16px;
  color: var(--tx-muted);
}

.mono {
  font-family: var(--tx-mono);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--tx-muted);
}

.strong {
  font-weight: 600;
}

h1.label {
  color: var(--tx-text);
  font-size: 13px;
}

p {
  margin: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 8px 16px;
  background: var(--tx-panel);
  border-bottom: 1px solid var(--tx-line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.16em;
  font-size: 13px;
}

.brand-name {
  font-weight: 600;
  white-space: nowrap;
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  color: var(--tx-muted);
}

.clock-time {
  color: var(--tx-text);
  font-size: 14px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--tx-radius);
  border: 1px solid var(--tx-line);
  background: transparent;
  color: var(--tx-text);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--tx-ease), border-color var(--tx-ease), color var(--tx-ease);
}

.btn:hover:not(:disabled) {
  border-color: var(--tx-muted);
}

.btn-primary {
  background: var(--tx-cue);
  border-color: var(--tx-cue);
  color: var(--tx-cue-ink);
}

.btn-primary:hover:not(:disabled) {
  background: #1eb3c6;
  border-color: #1eb3c6;
}

.btn-primary:disabled {
  background: var(--tx-line);
  border-color: var(--tx-line);
  color: var(--tx-muted);
  opacity: 1;
}

.btn-quiet {
  border-color: transparent;
  color: var(--tx-link);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--tx-line);
}

.btn-danger {
  color: var(--tx-off);
  border-color: var(--tx-off);
}

.btn[aria-pressed="true"] {
  border-color: var(--tx-cue);
  color: var(--tx-link);
}

.cmd-key {
  gap: 8px;
}

kbd {
  font-family: var(--tx-mono);
  font-size: 11px;
  line-height: 16px;
  padding: 0 4px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
  color: var(--tx-muted);
}

.page {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  flex-wrap: wrap;
}

.section-head .spacer {
  flex: 1;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  overflow: hidden;
}

.seg button,
.seg a {
  height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--tx-muted);
  font-weight: 600;
  text-decoration: none;
}

.seg button[aria-pressed="true"],
.seg a[aria-pressed="true"] {
  background: color-mix(in srgb, var(--tx-cue) 16%, transparent);
  color: var(--tx-text);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.status svg {
  display: block;
  flex: none;
}

.status-on { color: var(--tx-on); }
.status-wait { color: var(--tx-wait); }
.status-off { color: var(--tx-off); }

.tally {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.tally.is-live {
  animation: tally 1.6s steps(2, end) infinite;
}

@keyframes tally {
  50% { opacity: 0.35; }
}

.fault {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-off);
  border-radius: var(--tx-radius);
  flex-wrap: wrap;
}

.fault .fault-copy {
  min-width: 0;
  flex: 1;
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.racks,
.wall {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.rack {
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  background: var(--tx-bg);
}

.rack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 8px 8px 4px;
}

.rack-head .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rack-head .mono {
  flex: none;
}

.rack-head .label {
  color: var(--tx-text);
}

.row {
  display: grid;
  grid-template-columns: 28px 96px minmax(72px, 120px) 76px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: var(--tx-row);
  padding: 0 8px;
  border: 0;
  border-top: 1px solid var(--tx-line);
  background: transparent;
  text-align: left;
  transition: background var(--tx-ease);
}

.row:hover {
  background: color-mix(in srgb, var(--tx-text) 5%, transparent);
}

.row[aria-pressed="true"] {
  background: color-mix(in srgb, var(--tx-cue) 14%, transparent);
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.mini {
  position: relative;
  display: block;
  background: var(--tx-screen);
  border-radius: 1px;
  overflow: hidden;
}

.mini[data-shape="portrait"] {
  width: 14px;
  height: 24px;
}

.mini[data-shape="landscape"] {
  width: 26px;
  height: 16px;
}

.mini-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.mini-face {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 3px;
}

.monitor {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.monitor-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shot {
  width: 100%;
  height: auto;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
}

.frame {
  position: relative;
  margin: 0 auto;
  background: var(--tx-screen);
  border-radius: var(--tx-radius-sm);
  overflow: hidden;
}

.frame[data-shape="portrait"] {
  width: 188px;
  aspect-ratio: 9 / 16;
}

.frame[data-shape="landscape"] {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.frame-bar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.zones {
  position: absolute;
  inset: 4px 0 0;
  display: flex;
}

.zones.stack { flex-direction: column; }
.zones.side { flex-direction: row; }

.zone {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.zone-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.frame-bar {
  z-index: 2;
}

.zones.stack .zone + .zone {
  border-top: 1px solid rgb(0 0 0 / 40%);
}

.zones.side .zone + .zone {
  border-left: 1px solid rgb(0 0 0 / 40%);
}

.zone-kicker {
  font-family: var(--tx-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.zone-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

.frame-off,
.frame-notice {
  position: absolute;
  inset: 4px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 12px;
}

.frame-notice {
  background: #f3f0e8;
  color: #16181c;
}

.notice-word {
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 16px;
}

.screen-id {
  text-align: center;
  font-size: 12px;
}

.diagnosis {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.who {
  font-size: 12px;
  color: var(--tx-muted);
}

.review-preview {
  width: 120px;
  max-height: 180px;
  background: var(--tx-screen);
  border-radius: var(--tx-radius);
}

.play-line {
  display: block;
}

.sign-in {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, 100%);
  margin: 12vh auto 0;
}

.secret-key {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  background: var(--tx-panel);
  font-family: var(--tx-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-align: center;
}

.secret-uri {
  margin: 0;
  font-size: 11px;
  color: var(--tx-muted);
  overflow-wrap: anywhere;
}

.field.code {
  font-family: var(--tx-mono);
  letter-spacing: 0.2em;
  text-align: center;
}

.quiet-link {
  color: var(--tx-muted);
  font-size: 12px;
  text-align: center;
}

.recovery-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
  padding: 12px;
  list-style: none;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  background: var(--tx-panel);
}

.recovery-list li {
  letter-spacing: 0.06em;
}

.sign-in .field {
  height: 44px;
}

.sign-in .btn {
  height: 44px;
  margin-top: 8px;
}

.sign-error {
  margin: 0;
  color: var(--tx-text);
}

.pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

.pair-label { font-size: 12px; color: var(--tx-muted); }

.pair-code {
  width: 7.5rem;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--tx-line);
  border-radius: 4px;
  background: var(--tx-panel);
  color: var(--tx-text);
  font-family: var(--tx-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.meta div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: var(--tx-row);
  border-top: 1px solid var(--tx-line);
}

.meta dt {
  color: var(--tx-muted);
}

.meta dd {
  margin: 0;
}

.strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strip-track {
  position: relative;
  display: flex;
  height: 28px;
  border-radius: var(--tx-radius-sm);
  overflow: hidden;
}

.strip-block {
  height: 100%;
  min-width: 0;
  border: 1px solid transparent;
}

button.strip-block {
  flex: 0 0 auto;
  appearance: none;
  padding: 0 4px;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.strip-block.paid {
  background: color-mix(in srgb, var(--tx-text) 22%, var(--tx-bg));
}

.strip-block.venue {
  background-color: var(--tx-bg);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 3px,
    color-mix(in srgb, var(--tx-text) 40%, transparent) 3px 4px
  );
}

.strip-block.house {
  background: transparent;
  border-color: var(--tx-muted);
}

.strip-block[aria-current="true"] {
  background: color-mix(in srgb, var(--tx-cue) 35%, var(--tx-bg));
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--tx-cue);
  pointer-events: none;
}

.ruler {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--tx-muted);
}

.strip-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
}

.roll-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.order-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.order-head p {
  margin: 4px 0 0;
}

.order-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.order-rail a {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  color: var(--tx-muted);
  text-decoration: none;
}

.order-rail a[aria-pressed="true"] {
  border-color: var(--tx-cue);
  background: color-mix(in srgb, var(--tx-cue) 16%, transparent);
  color: var(--tx-text);
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.order-item {
  min-width: 0;
}

.order-row {
  display: grid;
  grid-template-columns: 10px 28px 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  background: var(--tx-panel);
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color var(--tx-ease), background var(--tx-ease);
}

.order-row:hover,
.order-item.is-lifted .order-row {
  border-color: var(--tx-cue);
}

.order-item.is-lifted .order-row {
  background: color-mix(in srgb, var(--tx-cue) 18%, var(--tx-bg));
  cursor: grabbing;
}

.order-grip {
  color: var(--tx-muted);
}

.order-num {
  color: var(--tx-muted);
}

.order-chip {
  width: 18px;
  height: 18px;
  border-radius: var(--tx-radius-sm);
  border: 1px solid transparent;
}

.order-chip.venue {
  background-color: var(--tx-bg);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 3px,
    color-mix(in srgb, var(--tx-text) 40%, transparent) 3px 4px
  );
}

.order-chip.house {
  background: transparent;
  border-color: var(--tx-muted);
}

.order-meta {
  color: var(--tx-muted);
}

.order-save {
  margin: 0;
}

.slot-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-preview .frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0c0e;
}

.zone-switch {
  display: flex;
  gap: 8px;
}

.zone-switch button,
.zone-switch a {
  border: 0;
  background: transparent;
  padding: 0;
  height: 24px;
  color: var(--tx-muted);
  font-weight: 600;
  text-decoration: none;
}

.zone-switch button[aria-pressed="true"],
.zone-switch a[aria-pressed="true"] {
  color: var(--tx-link);
}

.wall-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 132px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.tile[data-shape="landscape"] {
  width: 200px;
}

.tile-frame {
  position: relative;
  background: var(--tx-screen);
  border-radius: var(--tx-radius-sm);
  overflow: hidden;
}

.tile[data-shape="portrait"] .tile-frame {
  aspect-ratio: 9 / 16;
}

.tile[data-shape="landscape"] .tile-frame {
  aspect-ratio: 16 / 9;
}

.tile[aria-pressed="true"] .tile-frame {
  outline: 1px solid var(--tx-cue);
  outline-offset: 3px;
}

.tile-face {
  position: absolute;
  inset: 4px 0 0;
}

.tile-caption {
  font-size: 12px;
}

.pending {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  flex-wrap: wrap;
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.band {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.band-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.band-title .num {
  color: var(--tx-link);
}

.field {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.field:focus-visible {
  border-color: var(--tx-cue);
  outline: none;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--tx-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  transition: background var(--tx-ease);
}

.choice:hover:not(:disabled) {
  background: color-mix(in srgb, var(--tx-text) 5%, transparent);
}

.choice[aria-pressed="true"] {
  background: color-mix(in srgb, var(--tx-cue) 14%, transparent);
}

.choice:disabled {
  opacity: 1;
  color: var(--tx-muted);
}

.choice-name {
  display: block;
  font-weight: 600;
}

.choice-side {
  text-align: right;
  flex: none;
}

.summary {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--tx-panel);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.summary .btn-primary {
  align-self: flex-start;
}

.file {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file input {
  font-size: 13px;
}

.fit-ok { color: var(--tx-on); }
.fit-no { color: var(--tx-wait); }

.layouts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.layout-frame {
  position: relative;
  background: var(--tx-bg);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-sm);
}

.layout-frame[data-shape="landscape"] {
  width: 112px;
  aspect-ratio: 16 / 9;
}

.layout-frame[data-shape="portrait"] {
  width: 56px;
  aspect-ratio: 9 / 16;
}

.layout-zone {
  position: absolute;
  background: color-mix(in srgb, var(--tx-text) 8%, transparent);
  border: 1px solid var(--tx-line);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 148px;
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
  overflow: hidden;
}

.swatch-chip {
  height: 48px;
}

.swatch figcaption {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-island {
  padding: 16px;
  border-radius: var(--tx-radius);
  border: 1px solid var(--tx-line);
}

.type-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-card {
  background: var(--tx-panel);
  border-radius: var(--tx-radius);
  border: 1px solid var(--tx-line);
}

.portal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-top: 1px solid var(--tx-line);
}

.portal-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-block {
  width: 100%;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
}

.cmd-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--tx-bg) 55%, transparent);
  border: 0;
  padding: 0;
}

.cmd {
  position: fixed;
  z-index: 21;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  background: var(--tx-panel);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.cmd input {
  width: 100%;
  height: 44px;
  border: 0;
  border-bottom: 1px solid var(--tx-line);
  background: transparent;
  padding: 0 12px;
  font-family: var(--tx-mono);
  border-radius: var(--tx-radius) var(--tx-radius) 0 0;
}

.cmd input:focus-visible {
  outline: none;
}

.cmd-list {
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--tx-radius-sm);
  background: transparent;
  text-align: left;
}

.cmd-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--tx-cue) 16%, transparent);
}

.foot {
  color: var(--tx-muted);
  font-size: 12px;
}

[data-theme="portal"] .btn,
[data-theme="portal"] .field,
[data-theme="portal"] .portal-row,
[data-theme="portal"] .check {
  min-height: 44px;
}

[data-theme="portal"] .btn {
  height: 44px;
}

[data-theme="portal"] .field {
  height: 44px;
  background: #f7f4ee;
}

[hidden] {
  display: none !important;
}

a.btn,
a.row,
a.tile,
a.cmd-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.fault form,
.pending form {
  margin: 0;
}

#cmd-list form {
  margin: 0;
}

#cmd-empty {
  padding: 8px;
}

@media (max-width: 980px) {
  .desk,
  .book-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .monitor,
  .summary {
    position: static;
  }

  .clock {
    display: none;
  }

  .row {
    grid-template-columns: 28px 88px minmax(0, 1fr) 64px;
  }

  .row .layout-code,
  .row .uptime {
    display: none;
  }
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tally.is-live {
    animation: none;
  }

  .btn,
  .row,
  .choice,
  .order-row,
  .seg button,
  .seg a {
    transition: none;
  }
}

.market {
  font-size: 16px;
  line-height: 1.5;
}

.market a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.market-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--tx-line);
  background: var(--tx-bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.market-brand {
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
}

.market-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.market-nav a:not(.btn) {
  color: var(--tx-muted);
  text-decoration: none;
}

.market-nav a:not(.btn):hover {
  color: var(--tx-text);
}

.market-hero,
.market-split,
.market > main > section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 48px;
  align-items: end;
  padding: 72px 0 64px;
}

.market-hero h1 {
  margin: 12px 0 0;
  max-width: 14ch;
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.market-lead {
  max-width: 38em;
  margin-top: 20px;
  font-size: 18px;
}

.market-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.market-actions .btn {
  height: 40px;
  padding: 0 16px;
}

.market-frame {
  margin: 0;
}

.market-panel {
  aspect-ratio: 9 / 16;
  max-height: 420px;
  margin-left: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--tx-screen);
  color: #eceae4;
  border-radius: 6px;
  box-shadow: 0 0 0 10px #1c2128;
}

.market-now,
.market-spot-meta {
  margin: 0;
  font-family: var(--tx-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3b2;
}

.market-spot {
  margin: 8px 0 4px;
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 120%;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-split {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 32px;
  align-items: end;
  padding: 28px 0 8px;
  border-top: 1px solid var(--tx-line);
}

.market h2 {
  margin: 0;
  font-family: var(--tx-display);
  font-weight: 700;
  font-stretch: 118%;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.market-split p,
.market-section-head p {
  margin-top: 12px;
  max-width: 40em;
}

.market-share {
  margin: 0;
  padding: 20px;
  background: var(--tx-panel);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.market-share .mono {
  display: block;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.market > main > section {
  padding: 56px 0;
}

.market > main > .market-hero {
  padding: 72px 0 64px;
}

.market-section-head {
  margin-bottom: 24px;
}

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

.market-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  padding: 16px;
  background: var(--tx-panel);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius);
}

.market-card h3,
.market-steps h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.market-price {
  margin-top: auto;
}

.market-price .mono {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.market-price span:last-child,
.market-length {
  color: var(--tx-muted);
  font-size: 13px;
}

.market-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
}

.market-steps li {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--tx-line);
}

.market-num {
  color: var(--tx-link);
  font-size: 13px;
}

.market-venues {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--tx-line);
}

.market-venues li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--tx-line);
}

.market-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--tx-line);
  color: var(--tx-muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .market-hero,
  .market-split,
  .market-grid,
  .market-steps {
    grid-template-columns: 1fr 1fr;
  }

  .market-hero {
    align-items: start;
  }

  .market-frame {
    grid-column: 1 / -1;
  }

  .market-panel {
    max-height: none;
    width: min(220px, 46vw);
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .market-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .market-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .market-hero,
  .market-split,
  .market > main > section,
  .market-foot {
    width: min(1120px, calc(100% - 32px));
  }

  .market-hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .market-split,
  .market-grid,
  .market-steps,
  .market-venues {
    grid-template-columns: 1fr;
  }

  .market-hero h1 {
    max-width: none;
  }
}
