/* remote-kvm's page: the approved layout (2026-11-03). One
   viewport and no scroll on desktop; the screen centred, the turn's bar above
   it and the card row below it, both exactly as wide; nothing drawn over the
   screen, so the full screen <video> can take the display's overlay plane
   (player.js and scanout.js). Short viewports fold the cards to one line each;
   one opens at a time, and the screen gives up the height, never the page.
   Tokens: crowd-play's copy of nearglass-web packages/ui/src/tokens.css.
   The brand seam: every colour, radius and face below comes from a token on
   :root, so a site that serves this page under its own brand sets the tokens
   in a stylesheet loaded after this one and changes nothing else (README,
   "Another brand"). */
@font-face { font-family: "Inter Tight"; src: url("/hub/fonts/InterTight-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/hub/fonts/GeistMono-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter Tight Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"); size-adjust: 96.86%; ascent-override: 100.01%; descent-override: 24.90%; line-gap-override: 0%; }
:root {
  --ink: #0a1124; --ink-2: #3a4560; --muted: #687290;
  --line: #e4e8f0; --line-2: #eef1f6; --bg: #ffffff; --bg-soft: #f6f8fb;
  --accent: #2b4fff; --accent-ink: #1a36d6; --accent-wash: #edf0ff;
  --ok: #12b76a; --ok-ink: #0f7b4f; --warn: #b4530a; --warn-wash: #fff6e6;
  --frame: #070b18;
  /* Surfaces, buttons and the screen's own text */
  --surface: #ffffff; --kbd-bg: #ffffff; --line-hover: #cdd3e0;
  --btn: var(--accent); --btn-ink: #ffffff; --btn-hover: var(--accent-ink); --btn-hover-ink: #ffffff;
  --ghost: #ffffff; --ghost-ink: var(--ink);
  --link: var(--accent); --link-hover: var(--accent-ink);
  --ok-halo: rgba(18,183,106,.18); --avatar-ink: #ffffff; --mark-ink: #ffffff;
  --wipe-meter: linear-gradient(90deg, #12c8d6, #2b4fff);
  --on-frame: #ffffff; --on-frame-2: #c9d1ee; --on-frame-3: #9fb0e8;
  --r-card: 12px; --r-btn: 999px; --r-kbd: 5px; --r-note: 8px; --r-bar-phone: 21px;
  --text: "Inter Tight", "Inter Tight Fallback", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --top-h: 65px;     /* the shared header (examples/shell/header.js): 64 px, 56 px from 981 px wide, plus its 1 px hairline */
  --edge: 16px;      /* the gap around the arena */
  --bar-h: 52px;     /* the turn's bar above the screen */
  --gap: 12px;
  --cards-h: 176px;  /* the card row, open */
  --foot-h: 16px;    /* the credit line */
}
@media (min-width: 981px) { :root { --top-h: 57px; } }
/* Short viewports: the cards fold to one line; one opens at a time */
/* Short desktop windows fold the cards to one line each; a phone (narrow)
   scrolls instead, so its cards stay open */
@media (max-height: 860px) and (min-width: 901px) { :root { --cards-h: 44px; } body.details { --cards-h: 140px; } }
* { box-sizing: border-box; }
html { font-synthesis-weight: none; }
/* The header reserves a scrollbar gutter for pages that scroll; this one never
   does on desktop, and the screen's width is worked out from 100vw */
:root { scrollbar-gutter: auto; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg-soft); color: var(--ink-2); font: 400 14px/1.45 var(--text); -webkit-font-smoothing: antialiased; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
kbd { font: 500 11px var(--mono); color: var(--ink); background: var(--kbd-bg); border-radius: var(--r-kbd); padding: 1px 6px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-btn); cursor: pointer; white-space: nowrap;
  background: var(--btn); color: var(--btn-ink); font: 500 13px/1 var(--text);
}
.btn:hover { background: var(--btn-hover); color: var(--btn-hover-ink); }
.btn.ghost { background: var(--ghost); color: var(--ghost-ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { height: 28px; padding: 0 12px; font-size: 12px; }
.btn:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[hidden] { display: none; }

/* The arena: one centred column; the screen is the largest 16:9 that fits
   with the bar above and the card row and the credit line below */
.arena {
  --avail-h: calc(100dvh - var(--top-h) - 2 * var(--edge) - var(--bar-h) - var(--cards-h) - var(--foot-h) - 3 * var(--gap));
  --stream-w: min(calc(100vw - 2 * var(--edge)), calc(var(--avail-h) * 16 / 9));
  height: calc(100dvh - var(--top-h)); padding: var(--edge);
  display: grid; grid-template-columns: var(--stream-w); grid-template-rows: var(--bar-h) auto var(--cards-h) var(--foot-h);
  row-gap: var(--gap); justify-content: center; align-content: start;
}

/* The turn's bar, above the screen and exactly as wide */
.bar {
  display: flex; align-items: center; gap: 18px; min-width: 0;
  padding: 0 8px 0 14px; background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line);
  container-type: inline-size;
}
.title { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.title h1 { margin: 0; font: 600 16px/1 var(--text); color: var(--ink); letter-spacing: -.01em; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ok-ink); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-halo); }
.vsep { width: 1px; height: 24px; background: var(--line); flex: none; }
.turn { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--line-2); color: var(--avatar-ink); font: 600 12px/1 var(--text); }
.who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.who b { color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn.yours .eyebrow { color: var(--accent); }
.turn.wiping .avatar { display: none; }
.clock { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.meter { width: 120px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.turn.wiping .meter span { background: var(--wipe-meter); }
.time { font-size: 13px; color: var(--ink); min-width: 38px; }
.queue { display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
.queue .n { font-size: 18px; line-height: 1; color: var(--ink); }
.acts { display: flex; gap: 6px; flex: none; }
.acts .btn { flex: none; }
/* The bar sheds its least needed parts as the screen (and so the bar) narrows */
@container (max-width: 1100px) { .meter { display: none; } }
@container (max-width: 940px) { .live .count { display: none; } .queue .muted { display: none; } }
@container (max-width: 780px) { .title h1 { display: none; } .title + .vsep { display: none; } }

/* The screen: a bare box, square corners, nothing over it */
.screen { width: var(--stream-w); aspect-ratio: 16 / 9; background: var(--frame); position: relative; }
.screen canvas { display: block; width: 100%; height: 100%; }
.screen video { display: block; width: 100%; height: 100%; }
.screen video[hidden] { display: none; }
/* A browser that cannot play the stream: the reason in the screen's place
   (the canvas is hidden then, so nothing is over a picture) */
.cannot { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--on-frame-2); }
.cannot[hidden] { display: none; }
.cannot p { margin: 0; max-width: 46ch; }
.cannot .cannot-why { color: var(--on-frame); font-size: 16px; font-weight: 500; }
.cannot .muted { color: var(--on-frame-3); }
.screen.unsupported canvas { visibility: hidden; }
/* The wipe: the picture hidden (still decoding), black, one centred note */
.blank { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; background: #000; color: var(--on-frame-2); }
.blank[hidden] { display: none; }
.blank p { margin: 0; max-width: 46ch; }
.blank .blank-title { color: var(--on-frame); font-size: 16px; font-weight: 500; }
.blank .blank-step { font-size: 12px; color: var(--on-frame-3); }
.blank-meter { width: 160px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.blank-meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .5s linear; }
.screen.blanked canvas, .screen.blanked video { visibility: hidden; }
.nodrive { font-size: 12.5px; white-space: nowrap; }
.nodrive[hidden] { display: none; }
.screen.driving canvas { cursor: pointer; }
.screen.captured canvas, .screen.captured video { cursor: none; }

/* The card row: never taller than --cards-h */
.cards { display: grid; grid-template-columns: 1.1fr 1.3fr 1.2fr; gap: var(--gap); min-height: 0; }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line); padding: 12px 16px; min-width: 0; overflow: hidden; container-type: inline-size; }
.card[hidden] { display: none; }
.card h2 { margin: 0 0 8px; font: 500 13px/1.2 var(--text); color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; white-space: nowrap; }
.card h2 .muted { font-size: 11.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.meas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.meas b { display: block; font-weight: 500; font-size: 20px; line-height: 1.1; color: var(--ink); white-space: nowrap; }
@container (max-width: 260px) { .meas b { font-size: 16px; } }
.meas span { font-size: 11px; color: var(--muted); }
.path { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.path:empty { display: none; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.facts li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 12.5px; }
.facts li > span:first-child { color: var(--muted); }
.keys { display: grid; gap: 6px; font-size: 12.5px; }
.keys .no { color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; }
.steps li { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; }
.steps .mk { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--mark-ink); }
.steps .done .mk { background: var(--ok); box-shadow: none; }
.steps .now .mk { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.steps .now { color: var(--ink); }
.steps .t { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.note.warn { color: var(--warn); background: var(--warn-wash); border-radius: var(--r-note); padding: 6px 10px; }
.note[hidden] { display: none; }
/* While wiping, its steps take how to drive's place */
body.wiping .card.howto { display: none !important; }
.more { align-self: center; display: none; }
.line { display: none; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line b { color: var(--ink); font-weight: 500; }
@media (max-height: 860px) and (min-width: 901px) {
  body:not(.details) .card:not([hidden]) { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 100%; cursor: pointer; }
  body:not(.details) .card:hover { box-shadow: 0 0 0 1px var(--line-hover); }
  body:not(.details) .card h2 { margin: 0; }
  body:not(.details) .card h2 .muted, body:not(.details) .full { display: none; }
  body:not(.details) .line { display: block; }
  .cards { grid-template-columns: 1.1fr 1.3fr 1.2fr auto; }
  .more { display: block; }
  /* Details: one card at a time, across the row */
  body.details .cards { grid-template-columns: 1fr auto; }
  body.details .card { display: none !important; }
  body.details[data-open="meas"] .card[data-k="meas"], body.details[data-open="comp"] .card[data-k="comp"],
  body.details[data-open="drive"] .card[data-k="drive"], body.details[data-open="wipe"] .card[data-k="wipe"]:not([hidden]) { display: block !important; }
}

.foot { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); min-width: 0; line-height: var(--foot-h); }
.foot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot #caption { flex: 1; min-width: 0; }
.foot .status { color: var(--ink); flex: none; }
.foot .status:empty { display: none; }
.foot .me { flex: none; }
.foot strong { color: var(--ink); font-weight: 500; }

/* Full screen (app.js): page full screen, the player's <video> alone in its
   device pixel box (player.js scanoutBox), nothing painted above it. Hidden
   elements paint nothing, so no quad lands over the video. */
html.scanout, html.scanout body { background: #000; overflow: hidden; }
html.scanout body * { visibility: hidden; }
html.scanout #scan, html.scanout canvas.scan-target { visibility: visible; position: fixed; background: transparent; object-fit: fill; }
/* A wipe in full screen: the note over a black display, the video hidden
   (the overlay plane only matters while there is live video to show) */
html.scanout body.blanked #scan, html.scanout body.blanked canvas.scan-target { visibility: hidden; }
html.scanout body.blanked #blank, html.scanout body.blanked #blank * { visibility: visible; }
html.scanout body.blanked #blank { position: fixed; inset: 0; z-index: 2; }
/* The overlay full screen (iPhone, iPad): the page pinned, the way out in
   the corner clear of the notch, fading back after a moment */
html.pseudo, html.pseudo body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; }
.btn.fsexit { position: fixed; z-index: 3; gap: 6px; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px);
  background: rgba(10, 17, 36, .55); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fsexit-rest .4s ease 3s forwards; }
.btn.fsexit:hover { background: rgba(10, 17, 36, .75); }
.fsexit[hidden] { display: none; }
.fsexit .ico { display: block; }
html.scanout #fsexit, html.scanout #fsexit * { visibility: visible; }
@keyframes fsexit-rest { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .fsexit { animation: none; } }

/* The page's name and what it is: on phones only, where the bar has no
   room for its title */
.intro { display: none; }
.intro h2 { margin: 0; font: 600 17px/1.2 var(--text); color: var(--ink); letter-spacing: -.01em; }
.intro p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* Narrow screens: one column, the page may scroll */
@media (max-width: 900px) {
  :root { --edge: 12px; }
  body { overflow: auto; }
  .arena { height: auto; --stream-w: calc(100vw - 2 * var(--edge)); grid-template-rows: auto; grid-auto-rows: auto; }
  .intro { display: block; }
  .bar { flex-wrap: wrap; padding: 10px 12px; height: auto; }
  .bar .queue .muted { display: inline; }
  .queue { gap: 6px; }
  .cards { grid-template-columns: 1fr; }
  .foot { flex-wrap: wrap; row-gap: 4px; line-height: 1.4; }
  .foot span { white-space: normal; overflow: visible; }
  .foot #caption { flex-basis: 100%; }
  .card { padding: 10px 14px; }
  .card h2 { margin-bottom: 6px; }
  /* A touch-only phone watches: how to drive is not for it */
  body.watch-only .card.howto { display: none; }
}

/* The full screen button's icon, and the watch-only note: phones only */
.btn .ico { display: none; }
.watchnote { display: none; }

/* A phone upright: the bar one slim row (the live dot, who drives, how many
   wait, a full screen icon), no empty avatar, the watch-only note under the
   screen, and the title tighter so the screen sits higher */
@media (max-width: 900px) and (orientation: portrait) {
  .intro h2 { font-size: 15px; }
  .intro p { margin-top: 1px; font-size: 12px; }
  .bar { flex-wrap: nowrap; gap: 10px; height: 42px; padding: 0 5px 0 12px; border-radius: var(--r-bar-phone); box-shadow: 0 0 0 1px var(--line-2); }
  .bar .vsep, .turn .eyebrow, .clock .meter, .bar #nodrive { display: none; }
  .title .live > span { display: none; }
  .turn { flex: 0 1 auto; gap: 8px; }
  .avatar { width: 22px; height: 22px; font-size: 11px; }
  .avatar:empty { display: none; }
  .who b { font-size: 13.5px; }
  .clock { margin-left: 0; }
  .time { min-width: 0; font-size: 12px; color: var(--muted); }
  .queue { gap: 4px; font-size: 13px; }
  .queue::before { content: "\00b7"; color: var(--muted); }
  .queue .n { font-size: 13px; color: var(--ink-2); }
  .acts { margin-left: auto; }
  .acts .btn { height: 32px; padding: 0 12px; }
  .acts #full { width: 32px; padding: 0; }
  #full .ico { display: block; }
  #full .lbl { display: none; }
  .watchnote { display: block; margin: -4px 0 0; font-size: 12px; }
  .watchnote[hidden] { display: none; }
}

/* A phone on its side: the screen as tall as the window allows, on the
   left; the bar, the cards and the credit beside it */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  :root { --edge: 8px; }
  .arena {
    --avail-h: calc(100dvh - var(--top-h) - 2 * var(--edge));
    --stream-w: min(calc(100vw - 2 * var(--edge) - 200px - var(--gap)), calc(var(--avail-h) * 16 / 9));
    height: calc(100dvh - var(--top-h));
    grid-template-columns: var(--stream-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: var(--gap); row-gap: 8px;
  }
  body { overflow: hidden; }
  .intro { display: none; }
  .screen { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
  .bar { grid-column: 2; grid-row: 1; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px; }
  .bar .vsep { display: none; }
  .bar .queue .muted { display: inline; }
  .avatar { width: 24px; height: 24px; }
  .who b { font-size: 13px; }
  .acts { flex-wrap: wrap; align-items: center; }
  .nodrive { white-space: normal; font-size: 11.5px; }
  /* The cards one line each, scrolling beside the screen; the credit is the
     computer card's in short */
  .cards { grid-column: 2; grid-row: 2 / span 2; overflow: auto; align-content: start; gap: 6px; }
  .card { padding: 8px 12px; }
  .card h2 { margin: 0 0 2px; }
  .card h2 .muted, .card .full { display: none; }
  .card .line { display: block; white-space: normal; }
  .foot { display: none; }
}
.screen.noroute-on canvas { visibility: hidden; }
