/*
 * Wedding twin. Carried over unchanged from the approved Hilton CONEXION
 * client app (its additions are at the end, under "Twin"). One full-viewport
 * stage with the interface in fixed zones over it: identity, sections and
 * presenting along the top; where you stand at the left; the story at the
 * lower left; detail on demand at the right; the evening's cues along the
 * bottom. Separation is by alignment, then
 * space, then a hairline. One flat plate per region keeps text readable over
 * the room; there are no gradients, shadows or cards inside the plates.
 */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--stage); color: var(--ink);
  font: 400 var(--t-ui)/1.35 var(--font-ui); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden;
}
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Two rings: the ground-coloured halo keeps the gold ring visible over a
   bright ceiling and a dark audience alike. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--stage); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: var(--s-3); top: -80px; z-index: 50; padding: var(--s-3) var(--s-4); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--s-3); }

.mono, .idx, .readout, .counter, .card-meta, .seat-id, .count output, output, kbd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-stretch: 100%; }

/* ---------- Stage ---------- */
.app { position: fixed; inset: 0; overflow: hidden; isolation: isolate; }
.stage { position: absolute; inset: 0; background: var(--stage); }
/* Through the broadcast camera the stage shrinks to the free area (app.js sets
   the four insets), and LabRoom letterboxes the 16:9 frame inside it. */
@media (min-width: 701px) {
  .stage.through-lens { inset: var(--lens-top, 0px) var(--lens-right, 0px) var(--lens-bottom, 0px) var(--lens-left, 0px); }
}
.stage canvas { position: absolute; display: block; outline-offset: -4px; touch-action: none; }
.stage canvas:focus-visible { box-shadow: none; }
.poster, .film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster { transition: opacity var(--dur-veil) var(--ease-standard); pointer-events: none; }
[data-ready='true'] .poster { opacity: 0; }
.film { object-fit: contain; background: var(--stage); }
/* A flat veil in the ground colour: the title sits on it, and camera cuts
   pass behind it. Opacity only, so it is safe under reduced motion. */
.dim, .veil { position: absolute; inset: 0; background: var(--stage); opacity: 0; pointer-events: none; }
.dim { transition: opacity var(--dur-veil) var(--ease-standard); }
[data-mode='title'] .dim, [data-card='end'] .dim { opacity: .4; }
.veil { z-index: var(--z-veil); transition: opacity 160ms var(--ease-exit); }
.veil.is-up { opacity: 1; transition-duration: 160ms; }
.veil.is-lifting { transition: opacity var(--dur-enter) var(--ease-enter); }

/* The broadcast camera's frame: four corner marks and its lens, as a monitor shows them. */
.gate { position: absolute; pointer-events: none; }
.gate i { position: absolute; width: 22px; height: 22px; border: 1px solid var(--ink); opacity: .75; }
.gate i:nth-of-type(1) { left: 14px; top: 14px; border-right: 0; border-bottom: 0; }
.gate i:nth-of-type(2) { right: 14px; top: 14px; border-left: 0; border-bottom: 0; }
.gate i:nth-of-type(3) { left: 14px; bottom: 14px; border-right: 0; border-top: 0; }
.gate i:nth-of-type(4) { right: 14px; bottom: 14px; border-left: 0; border-top: 0; }
.gate span { position: absolute; left: 50%; top: 22px; translate: -50% 0; padding: 3px 9px; background: var(--plate); font: 500 var(--t-meta)/1.4 var(--font-mono); color: var(--ink); white-space: nowrap; }

/* ---------- HUD grid ---------- */
.hud {
  position: absolute; inset: 0; z-index: var(--z-hud);
  display: grid; gap: var(--s-4) var(--gutter);
  padding: var(--gutter);
  padding-top: max(var(--s-4), calc(var(--gutter) * .7));
  grid-template:
    'bar bar bar' auto
    'left . right' minmax(0, 1fr)
    'transport transport transport' auto / minmax(0, var(--panel)) minmax(0, 1fr) minmax(0, var(--sheet-w));
  pointer-events: none;      /* a drag on open scene reaches the room */
  transition: opacity var(--dur-enter) var(--ease-enter);
}
.hud > * { min-width: 0; min-height: 0; }
.hud :is(button, a, input, label, .plate) { pointer-events: auto; }
[data-mode='title'] .hud > :not(.bar, .sheet), [data-card='end'] .hud > :not(.bar, .sheet) { display: none; }
/* Behind a card or a film the room is a picture, not a control. */
[data-mode='title'] .stage canvas, [data-mode='film'] .stage canvas, [data-card='end'] .stage canvas { pointer-events: none; }

.plate {
  background: var(--plate);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: var(--radius);
}

/* Coming from a card, the panels arrive after it has left: a short rise, once. */
.narrative, .views, .transport { transition: opacity var(--dur-enter) var(--ease-enter), transform var(--dur-enter) var(--ease-enter); }
[data-arriving] :is(.narrative, .views, .transport) { opacity: 0; transform: translateY(var(--rise)); transition: none; }

/* ---------- Top bar ---------- */
.bar { grid-area: bar; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--s-4); transition: opacity var(--dur-veil) var(--ease-standard); }
.wordmark { justify-self: start; display: inline-flex; align-items: baseline; gap: var(--s-3); height: 44px; padding: 0 var(--s-4); line-height: 42px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark b { font-weight: 640; font-stretch: 125%; letter-spacing: .06em; font-size: var(--t-ui); }
.wordmark span { color: var(--muted); font-size: var(--t-ui); }
.modes { display: flex; height: 44px; padding: 0 var(--s-1); }
.modes button { position: relative; padding: 0 var(--s-4); color: var(--muted); font-weight: 500; white-space: nowrap; transition: color var(--dur-exit) var(--ease-standard); }
.modes button:hover:not(:disabled) { color: var(--ink); }
.modes button:disabled { opacity: .45; }
.modes button[aria-pressed='true'] { color: var(--ink); }
.modes button[aria-pressed='true']::after { content: ''; position: absolute; left: var(--s-4); right: var(--s-4); bottom: -1px; height: 2px; background: var(--accent); }
.bar-actions { justify-self: end; display: flex; align-items: center; gap: var(--s-1); height: 44px; padding: 0 var(--s-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-4); border-radius: var(--radius); font-weight: 600; white-space: nowrap; transition: background-color var(--dur-exit) var(--ease-standard), color var(--dur-exit) var(--ease-standard), border-color var(--dur-exit) var(--ease-standard), opacity var(--dur-exit); }
.btn:active:not(:disabled) { transform: translateY(1px); transition-duration: var(--dur-press); }
/* One filled action per state: the next thing to do. */
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { background: rgb(241 238 231 / .14); color: var(--muted); }
.btn-large { min-height: calc(52px * var(--density)); padding: 0 var(--s-5); font-size: var(--t-body); }
.btn-quiet { border: 1px solid var(--rule-strong); color: var(--ink); font-weight: 500; }
.btn-quiet:hover { background: var(--hover); }
.btn-icon { width: 44px; padding: 0; border: 1px solid var(--rule-strong); color: var(--ink); }
.btn-icon:hover:not(:disabled) { background: var(--hover); }
.btn-icon:disabled { opacity: .35; }
.btn-bare { border-color: transparent; color: var(--muted); }
.btn-bare:hover { color: var(--ink); }
.btn-text { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); color: var(--ink-2); font-weight: 500; white-space: nowrap; text-underline-offset: 5px; transition: color var(--dur-exit); }
.btn-text:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
.btn-text:disabled { opacity: .45; }
.btn-text[aria-pressed='true'] { color: var(--accent); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.segmented-2 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.segmented button { min-height: 40px; padding: 0 var(--s-2); color: var(--ink-2); font-weight: 500; border-left: 1px solid var(--rule); transition: background-color var(--dur-exit), color var(--dur-exit); }
.segmented button:first-child { border-left: 0; }
.segmented-2 button:nth-child(odd) { border-left: 0; }
.segmented-2 button:nth-child(n + 3) { border-top: 1px solid var(--rule); }
.segmented button:hover { background: var(--hover); color: var(--ink); }
.segmented button[aria-pressed='true'] { background: var(--ink); color: var(--stage); font-weight: 600; }

/* ---------- Where you stand ---------- */
.views { grid-area: left; align-self: start; width: var(--rail-w); max-height: 100%; display: flex; flex-direction: column; padding: var(--s-4) 0 var(--s-2); overflow: hidden; }
.views h2 { padding: 0 var(--s-4) var(--s-2); font-size: var(--t-ui); font-weight: 600; }
.view-list { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.view-group { padding: var(--s-3) var(--s-4) var(--s-1); color: var(--muted); font-size: var(--t-meta); border-top: 1px solid var(--rule); }
.view-group:first-child { border-top: 0; padding-top: var(--s-1); }
.view-list button { position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: var(--s-1); width: 100%; min-height: calc(34px * var(--density)); padding: 0 var(--s-4); text-align: left; color: var(--ink-2); transition: background-color var(--dur-exit), color var(--dur-exit); }
.view-list button:hover { background: var(--hover); color: var(--ink); }
.view-list .idx { color: var(--muted); font-size: var(--t-meta); }
.view-list .value { color: var(--muted); font: 400 var(--t-meta)/1 var(--font-mono); }
.view-list button[aria-pressed='true'] { color: var(--ink); font-weight: 600; }
.view-list button[aria-pressed='true']::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.view-list button[aria-pressed='true'] .idx { color: var(--accent); }
.reset { margin: var(--s-1) var(--s-1) 0; align-self: flex-start; color: var(--accent); }

/* ---------- The story ---------- */
.narrative { grid-area: left; align-self: end; display: grid; gap: var(--s-5); padding: var(--s-5); max-height: 100%; overflow: auto; }
.narrative-copy { display: grid; gap: var(--s-3); transition: opacity var(--dur-enter) var(--ease-enter), transform var(--dur-enter) var(--ease-enter); }
/* Leaving is faster than arriving, and nothing slides while the camera travels. */
.narrative-copy.is-out { opacity: 0; transition: opacity var(--dur-exit) var(--ease-exit); }
.narrative h2 { font-size: var(--t-h2); font-weight: 560; font-stretch: var(--display-stretch); line-height: 1.1; letter-spacing: -.012em; text-wrap: balance; }
.narrative .idx { margin-right: .5em; color: var(--muted); font-size: .62em; font-weight: 400; letter-spacing: 0; vertical-align: .32em; }
.lede { color: var(--ink-2); font-size: var(--t-body); line-height: 1.5; max-width: 44ch; text-wrap: pretty; }
.readout { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--muted); font-size: var(--t-meta); }
.readout span + span::before, .card-meta span + span::before { content: ''; display: inline-block; width: 3px; height: 3px; margin-right: var(--s-4); vertical-align: middle; background: currentColor; }
.narrative-actions { display: flex; gap: var(--s-2); }
.narrative-actions .btn-primary { flex: 1; }
#beat-next { justify-content: flex-start; padding: 0 var(--s-4); }
.next-name { margin-left: auto; font-weight: 450; opacity: .78; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Detail on demand ---------- */
.sheet { grid-area: right; align-self: end; display: flex; flex-direction: column; max-height: 100%; overflow: hidden; animation: sheet-in var(--dur-sheet) var(--ease-enter); }
@keyframes sheet-in { from { opacity: 0; transform: translateX(var(--rise)); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5); border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-size: var(--t-body); font-weight: 600; }
.sheet-body { padding: var(--s-4) var(--s-5) var(--s-5); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sheet-body section { display: grid; gap: var(--s-4); }
.sheet-body h3 { font-size: var(--t-ui); font-weight: 600; }
.sheet-body h3:not(:first-child) { padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.sheet-lede { color: var(--ink-2); line-height: 1.5; }
.fine { color: var(--muted); font-size: var(--t-meta); line-height: 1.5; }
.count { color: var(--muted); font-size: var(--t-meta); }
.count output { color: var(--ink); }
.check { display: flex; align-items: center; gap: var(--s-3); min-height: 32px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.field { display: grid; gap: var(--s-1); }
.field-line { display: flex; justify-content: space-between; align-items: baseline; }
.field-line label { font-weight: 600; }
input[type='range'] { width: 100%; height: 28px; margin: 0; accent-color: var(--accent); }

.notes { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3) var(--s-4); }
.notes dt { font-weight: 600; }
.notes dd { color: var(--ink-2); line-height: 1.5; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s-4); }
.keys dt, .keys dd { padding: var(--s-2) 0; border-top: 1px solid var(--rule); }
.keys dt:first-of-type, .keys dt:first-of-type + dd { border-top: 0; }
.keys dt { font: 500 var(--t-meta)/1.6 var(--font-mono); color: var(--ink); white-space: nowrap; }
.keys dd { color: var(--ink-2); }

/* The floor plan: a drawing with real buttons over it. */
.plan { position: relative; width: min(100%, 300px); margin: 0 auto; container-type: inline-size; }
.plan svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; stroke-width: 1px; stroke-linecap: butt; }
.plan svg * { vector-effect: non-scaling-stroke; }
.plan-wall { stroke: var(--rule-strong); }
.plan-stage { fill: rgb(241 238 231 / .08); stroke: var(--rule-strong); }
.plan-screen { stroke: var(--ink); stroke-width: 3px; }
.plan-delay { stroke: var(--muted); stroke-width: 2px; stroke-dasharray: 3 3; }
.plan-riser { stroke: var(--ink-2); }
.plan-sight { stroke: var(--accent); stroke-dasharray: 2 3; }
.plan-label { position: absolute; translate: -50% -50%; color: var(--muted); font-size: var(--t-meta); pointer-events: none; white-space: nowrap; }
.plan-label-side { translate: 0 -50%; margin-left: 2px; }
.plan-table { position: absolute; display: grid; place-items: center; width: 26px; height: 26px; translate: -50% -50%; border-radius: 50%; }
.plan-table::before { content: ''; width: max(11px, calc(var(--table) * 1cqw)); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--ink-2); background: rgb(241 238 231 / .12); transition: background-color var(--dur-exit), border-color var(--dur-exit); }
.plan-table:hover::before { background: rgb(241 238 231 / .5); border-color: var(--ink); }
.plan-table.is-current::before { border-color: var(--accent); }
.plan-table[aria-pressed='true']::before { background: var(--accent); border-color: var(--accent); }
.plan-table:focus-visible { box-shadow: none; outline-offset: -2px; }

.seat-detail { display: grid; grid-template-columns: 148px 1fr; gap: var(--s-4); align-items: center; padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.ring { position: relative; width: 148px; aspect-ratio: 1; }
.ring::before { content: attr(data-table); position: absolute; inset: 27%; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; background: rgb(241 238 231 / .06); color: var(--muted); font: 400 var(--t-meta)/1 var(--font-mono); }
.ring-chair { position: absolute; width: 28px; height: 28px; translate: -50% -50%; border: 1px solid var(--rule-strong); border-radius: 50%; color: var(--ink-2); font: 400 var(--t-meta)/1 var(--font-mono); transition: background-color var(--dur-exit), color var(--dur-exit), border-color var(--dur-exit); }
.ring-chair:hover { background: var(--hover); color: var(--ink); border-color: var(--ink); }
.ring-chair[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seat-side { display: grid; gap: var(--s-3); }
.seat-id { font-size: var(--t-lede); font-weight: 500; letter-spacing: -.01em; }

/* ---------- The cue stack ---------- */
.transport { grid-area: transport; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-5); min-height: calc(60px * var(--density)); padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); }
.transport-toggle { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4) 0 var(--s-3); white-space: nowrap; border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--ink); font-weight: 500; transition: background-color var(--dur-exit); }
.transport-toggle:hover { background: var(--hover); }
.transport-toggles { display: flex; gap: var(--s-2); }
.transport-toggle .i-play { display: none; fill: currentColor; stroke: none; }
/* The sound button: the speaker with its waves while on, struck through when off. */
.transport-toggle .i-muted { display: none; }
#sound[aria-pressed='false'] .i-waves { display: none; }
#sound[aria-pressed='false'] .i-muted { display: block; }
.transport-toggle[aria-pressed='false'] .i-play { display: block; }
.transport-toggle[aria-pressed='false'] .i-pause { display: none; }
.transport-toggle[aria-pressed='false'] { color: var(--ink-2); }
/* Each segment as wide as its name, with the spare width shared out, so short names make room for long ones. */
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, auto); gap: 3px; align-items: stretch; }
.segments button { display: flex; align-items: baseline; gap: var(--s-2); padding: var(--s-3) var(--s-2) var(--s-2) 0; border-top: 2px solid var(--rule-strong); text-align: left; color: var(--muted); white-space: nowrap; transition: color var(--dur-exit), border-color var(--dur-exit); min-width: 0; }
.segments button:hover { color: var(--ink); }
.segments .num { font: 400 var(--t-meta)/1.2 var(--font-mono); flex: none; }
.segments .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segments button[data-state='done'] { border-color: var(--ink-2); color: var(--ink-2); }
.segments button[aria-pressed='true'] { border-color: var(--accent); color: var(--ink); }
.segments button[aria-pressed='true'] .name { font-weight: 600; }
.segments button[aria-pressed='true'] .num { color: var(--accent); }
.transport-side { display: flex; align-items: center; gap: var(--s-3); }
.counter { color: var(--ink-2); font-size: var(--t-ui); white-space: nowrap; }
/* All that stays up while presenting: a hairline of how far along the story is. */
.progress { position: absolute; left: -1px; bottom: -1px; height: 2px; width: calc(var(--progress, 0) * (100% + 2px)); background: var(--accent); opacity: 0; pointer-events: none; }

[data-mode='walk'] #room-open, [data-mode='walk'] #resume, [data-mode='film'] #room-open, [data-mode='film'] #resume, [data-mode='explore'] .counter { display: none; }
[data-mode='film'] .hud > :is(.views, .narrative) { display: none; }

/* ---------- Title and end cards ---------- */
.card { position: absolute; z-index: var(--z-card); left: 0; right: 0; bottom: 0; display: grid; gap: var(--s-5); max-width: 980px; padding: var(--gutter); padding-bottom: clamp(var(--s-6), 7vh, var(--s-8)); animation: card-in var(--dur-veil) var(--ease-enter) backwards; }
@keyframes card-in { from { opacity: 0; transform: translateY(var(--rise)); } }
.card.is-leaving { opacity: 0; transition: opacity var(--dur-exit) var(--ease-exit); }
.card h1 { display: grid; gap: .06em; font-weight: 300; font-stretch: 125%; font-size: var(--t-h1); line-height: .96; letter-spacing: -.02em; }
.card h1 b { font-weight: 660; letter-spacing: .01em; }
.card h1 span { color: var(--ink-2); font-size: .46em; letter-spacing: -.01em; line-height: 1.1; }
.card h2 { font-weight: 560; font-stretch: 125%; font-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.25rem); line-height: 1; letter-spacing: -.02em; max-width: 14ch; text-wrap: balance; }
.card-lede { max-width: 46ch; color: var(--ink); font-size: var(--t-lede); line-height: 1.4; text-wrap: pretty; }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--muted); font-size: var(--t-meta); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.card-status { min-height: 1.4em; color: var(--muted); font-size: var(--t-meta); }
.card-status.is-alert { color: var(--alert); }
[data-ready='true'] .card-status:not(.is-alert) { visibility: hidden; }
/* A thin line while the room loads; it never claims a percentage it does not have. */
.load-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: load 1.6s var(--ease-standard) infinite; }
@keyframes load { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
[data-ready='true'] .load-line, [data-ready='failed'] .load-line { display: none; }

/* ---------- Small notices ---------- */
.hint, .notice { position: absolute; left: 50%; z-index: var(--z-card); translate: -50% 0; padding: var(--s-2) var(--s-4); background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); white-space: nowrap; pointer-events: none; }
.hint { top: 38%; animation: hint 3.2s var(--ease-standard) forwards; }
@keyframes hint { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
.notice { top: calc(var(--gutter) + 60px); white-space: normal; max-width: min(560px, 80vw); text-align: center; }
.blank { position: fixed; inset: 0; z-index: var(--z-blank); background: #000; cursor: none; }

/* ---------- Presenting ---------- */
/* Essential text stays out of the outer 5% of a projected picture. */
[data-presenting='true'] .hud { padding: max(var(--gutter), 5vh) max(var(--gutter), 5vw); }
[data-presenting='true'] .card { padding-left: max(var(--gutter), 5vw); padding-bottom: max(var(--s-7), 7vh); }
/* Presenting is driven by keys or a clicker, so the story panel is copy only. */
[data-presenting='true'] .narrative-actions { display: none; }
[data-presenting='true'] :is(.bar, .views, .sheet, .transport) { transition: opacity var(--dur-enter) var(--ease-enter); }
/* After 2.5 s without the pointer the chrome and the cursor step back. What
   stays up is the story and a hairline of how far through it the room is. */
[data-presenting='true'][data-idle] .app { cursor: none; }
[data-presenting='true'][data-idle] :is(.bar, .views, .sheet, .hint) { opacity: 0; pointer-events: none; transition: opacity var(--dur-veil) var(--ease-exit); }
[data-presenting='true'][data-idle] .transport { background: none; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
[data-presenting='true'][data-idle] .transport > :not(.progress) { opacity: 0; transition: opacity var(--dur-veil) var(--ease-exit); }
[data-presenting='true'][data-idle] [data-mode='walk'] .progress { opacity: 1; transition: opacity var(--dur-veil) var(--ease-exit); }

/* ---------- Narrower windows ---------- */
@media (max-width: 1180px) {
  :root { --panel: 380px; --sheet-w: 340px; --rail-w: 240px; }
  /* The current segment takes the room its name needs. */
  .segments { display: flex; }
  .segments button { flex: 1 1 0; }
  .segments button[aria-pressed='true'] { flex: 1.9 1 0; }
  .segments button:not([aria-pressed='true']) .num { display: none; }
}
@media (max-width: 960px) {
  .wordmark span { display: none; }
  .hud { grid-template-columns: minmax(0, var(--panel)) minmax(0, 1fr); grid-template-areas: 'bar bar' 'left right' 'transport transport'; }
  .sheet { justify-self: end; width: min(100%, var(--sheet-w)); }
  .segments button:not([aria-pressed='true']) .name { font-size: var(--t-meta); }
  #room-open { padding: 0 var(--s-3); }
}

/* Phones: stop overlaying. The room becomes a block at the top and the story,
   controls and detail flow below it on the same ground; one finger scrolls. */
@media (max-width: 700px) {
  body { overflow: auto; }
  .app { position: static; overflow: visible; min-height: 100svh; display: flex; flex-direction: column; }
  .stage { position: sticky; top: 0; z-index: 1; height: 56svh; flex: none; }
  .stage canvas { touch-action: pan-y; }
  .dim, .veil { position: absolute; height: 56svh; inset: 0 0 auto; z-index: 2; }
  .hud { position: static; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3) var(--s-4) var(--s-6); z-index: 3; background: var(--stage); }
  .hud > .bar { order: -1; position: fixed; top: 0; left: 0; right: 0; z-index: 4; padding: var(--s-2) var(--s-3); grid-template-columns: auto 1fr auto; gap: var(--s-2); }
  .wordmark { padding: 0 var(--s-3); }
  .modes button { padding: 0 var(--s-2); }
  .modes { justify-self: center; }
  /* Presenting is for a projector or a monitor; a phone has neither. */
  .bar-actions { display: none; }
  .plate { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .views, .narrative, .sheet, .transport { width: auto; max-height: none; align-self: stretch; }
  /* The rail gets the full width; its controls sit on the row under it. */
  .hud > .transport { order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-3); }
  .hud > .transport .segments { order: -1; flex: 1 1 100%; }
  .hud > .narrative { order: 2; border: 0; background: none; padding: var(--s-2) 0; }
  .hud > .views { order: 3; }
  .hud > .sheet { order: 2; }
  .transport-side { flex-wrap: wrap; margin-left: auto; }
  /* The current segment takes the room for its name; the rest are ticks. */
  .segments { display: flex; }
  .segments button { flex: 1 1 0; }
  .segments button[aria-pressed='true'] { flex: 6 1 0; }
  .segments button:not([aria-pressed='true']) .name { display: none; }
  .segments button { min-height: 44px; }
  .card { position: relative; z-index: 3; margin-top: -28svh; padding: var(--s-4); background: none; }
  .card h1 { font-size: clamp(2.5rem, 13vw, 3.6rem); }
  .hint { display: none; }
  .view-list button, .segmented button { min-height: 44px; }
  .plan-table { width: 30px; height: 30px; }
}

.phone-only { display: none; }
@media (max-width: 700px) { .phone-only { display: inline-flex; } }

@media (prefers-reduced-motion: reduce) {
  .load-line { animation: none; opacity: .6; }
  .card, .sheet { animation-duration: 1ms; }
}
@media (forced-colors: active) {
  .plate { background: Canvas; color: CanvasText; border: 1px solid; }
}

/* ---------- Twin: the date and its light ---------- */
.date-field { display: grid; gap: var(--s-1); }
.date-field label { font-weight: 600; }
input[type='date'] {
  min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: transparent; color: var(--ink); font: 500 var(--t-ui)/1 var(--font-mono); color-scheme: dark;
}
input[type='date']:hover { background: var(--hover); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.presets button { min-height: 32px; padding: 0 var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink-2); font-size: var(--t-meta); }
.presets button:hover { background: var(--hover); color: var(--ink); }
.presets button[aria-pressed='true'] { border-color: var(--accent); color: var(--ink); }
.sun-facts { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); }
.sun-facts dt { color: var(--muted); }
.sun-facts dd { font: 400 var(--t-ui)/1.4 var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }

/* The afternoon as a strip, one cell per five minutes: how much of the
   seating is in sun. Drawn, not animated; the accent marks the time shown. */
.daystrip { position: relative; display: grid; gap: var(--s-1); }
.daystrip-cells { position: relative; display: flex; height: 18px; border-radius: 2px; overflow: hidden; }
.daystrip-cells i { flex: 1 1 0; background: var(--sun-cell); }
.daystrip-cells i[data-light='sun'] { --sun-cell: rgb(241 238 231 / .62); }
.daystrip-cells i[data-light='part'] { --sun-cell: rgb(241 238 231 / .3); }
.daystrip-cells i[data-light='shade'] { --sun-cell: rgb(241 238 231 / .12); }
.daystrip-cells i[data-light='night'] { --sun-cell: rgb(241 238 231 / .04); }
.daystrip-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; translate: -1px 0; background: var(--accent); pointer-events: none; }
.daystrip-scale { display: flex; justify-content: space-between; color: var(--muted); font: 400 var(--t-meta)/1.2 var(--font-mono); }
.daystrip-key { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--muted); font-size: var(--t-meta); }
.daystrip-key span { display: inline-flex; align-items: center; gap: var(--s-2); }
.daystrip-key span::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--sun-cell); }

/* The ceremony seating chart: the arch at the top, rows below, the aisle
   down the middle. Every chair is a real button. */
.seat-chart { display: grid; gap: var(--s-2); justify-items: center; }
.seat-chart .arch-mark { color: var(--muted); font-size: var(--t-meta); }
.seat-rows { display: grid; gap: 3px; }
.seat-row { display: grid; grid-template-columns: 18px repeat(var(--per-side), 14px) 16px repeat(var(--per-side), 14px); gap: 3px; align-items: center; }
.seat-row .row-name { color: var(--muted); font: 400 var(--t-meta)/1 var(--font-mono); }
.seat-row button { width: 14px; height: 14px; border: 1px solid var(--rule-strong); border-radius: 2px; transition: background-color var(--dur-exit), border-color var(--dur-exit); }
.seat-row button:hover { background: rgb(241 238 231 / .5); border-color: var(--ink); }
.seat-row button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); }
.seat-row .aisle-gap { width: 16px; }

@media (max-width: 700px) {
  .seat-row { grid-template-columns: 18px repeat(var(--per-side), 1fr) 12px repeat(var(--per-side), 1fr); }
  .seat-row button { width: auto; height: 22px; }
}

/* ---------- Twin: the couple's plan ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field-block { display: grid; gap: var(--s-1); min-width: 0; }
.field-block > span, .field-label { font-weight: 600; }
.sheet-body :is(input:not([type]), input[type='text'], input[type='email'], input[type='tel'], input[type='number'], input[type='time'], select, textarea) {
  width: 100%; min-width: 0; min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: transparent; color: var(--ink); color-scheme: dark; transition: background-color var(--dur-exit);
}
.sheet-body :is(input, select, textarea):hover { background: var(--hover); }
.sheet-body textarea { padding: var(--s-2) var(--s-3); resize: vertical; line-height: 1.5; font: inherit; }
.sheet-body select option { background: var(--plate-solid); color: var(--ink); }
.sheet-body :is(input[type='time'], input[type='number'], #plan-peak) { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: var(--s-2); }
.stepper input { text-align: center; font-size: var(--t-body); }

/* The three looks as one list, each with its estimate. */
.look-options { display: grid; gap: 3px; }
.look-option { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3);
  border: 1px solid var(--rule); border-radius: var(--radius); text-align: left; color: var(--ink-2); transition: background-color var(--dur-exit), border-color var(--dur-exit); }
.look-option:hover { background: var(--hover); color: var(--ink); }
.look-option[aria-pressed='true'] { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.look-option .idx { color: var(--muted); font-size: var(--t-meta); }
.look-option[aria-pressed='true'] .idx { color: var(--accent); }
.look-option .look-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.look-price { color: var(--muted); font-size: var(--t-meta); font-weight: 400; }
.look-line { color: var(--ink-2); line-height: 1.5; }

.bill { display: grid; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.bill-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.bill-total span { font-weight: 600; }
.bill-total output { font-size: var(--t-lede); }
.bill-details summary { display: flex; align-items: center; min-height: 32px; color: var(--ink-2); cursor: pointer; }
.bill-lines { width: 100%; margin-top: var(--s-1); border-collapse: collapse; font-size: var(--t-meta); }
.bill-lines th { padding: var(--s-1) var(--s-2) var(--s-1) 0; text-align: left; font-weight: 400; color: var(--ink-2); }
.bill-lines td { padding: var(--s-1) 0 var(--s-1) var(--s-2); text-align: right; white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bill-lines tr + tr > * { border-top: 1px solid var(--rule); }
.compare-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: end; }

/* The evening's moments: time, name, remove; sunset and blue hour among them. */
.moments { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.moment { display: grid; grid-template-columns: 108px minmax(0, 1fr) 36px; gap: var(--s-2); align-items: center; }
.sheet-body .moment input { min-height: 36px; }
.moment .btn-icon { width: 36px; min-height: 36px; }
.moment.is-sun { grid-template-columns: 108px minmax(0, 1fr); min-height: 30px; padding-left: var(--s-3); color: var(--muted); }
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.plan-actions .btn-primary { flex: 1 1 100%; justify-content: space-between; }

/* Two looks in one picture: the line marks where the second begins. It is
   part of the picture, so it sits on the stage under the interface. */
.split { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.split-line { position: absolute; top: 0; bottom: 0; left: calc(var(--split, .5) * 100%); width: 44px; translate: -50% 0; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.split-line::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; translate: -1px 0; background: var(--ink); }
.split-grip { position: absolute; top: 50%; left: 50%; width: 24px; height: 48px; translate: -50% -50%; background: var(--plate-solid); border: 1px solid var(--ink); border-radius: var(--radius); }
.split-grip::before { content: ''; position: absolute; inset: 14px 8px; border-left: 1px solid var(--ink-2); border-right: 1px solid var(--ink-2); }
.split-line:focus-visible { outline: none; box-shadow: none; }
.split-line:focus-visible .split-grip { outline: 2px solid var(--accent); outline-offset: 2px; }
.split-label { position: absolute; top: calc(var(--gutter) + 60px); padding: var(--s-1) var(--s-3); background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); font-weight: 500; white-space: pre; }
.split-a { right: calc((1 - var(--split, .5)) * 100% + var(--s-4)); }
.split-b { left: calc(var(--split, .5) * 100% + var(--s-4)); }
[data-presenting='true'][data-idle] .split-label { opacity: 0; transition: opacity var(--dur-veil) var(--ease-exit); }

/* The printed run sheet: never on screen; on paper, the only thing. */
.runsheet { display: none; }
@media print {
  @page { margin: 16mm; }
  html, body { height: auto; background: var(--paper); color: var(--paper-ink); overflow: visible; }
  .app, .skip-link { display: none !important; }
  .runsheet { display: block; font: 400 10.5pt/1.45 var(--font-ui); color: var(--paper-ink); }
  .runsheet h1 { font-size: 20pt; font-weight: 600; font-stretch: 118%; letter-spacing: -.01em; }
  .runsheet h2 { margin-top: 14pt; padding-bottom: 3pt; border-bottom: .5pt solid var(--paper-rule); font-size: 12pt; font-weight: 600; break-after: avoid; }
  .runsheet p { margin-top: 4pt; }
  .runsheet table { width: 100%; margin-top: 4pt; border-collapse: collapse; }
  .runsheet tr { break-inside: avoid; }
  .runsheet th, .runsheet td { padding: 2pt 8pt 2pt 0; text-align: left; vertical-align: top; }
  .runsheet th { width: 22%; font-weight: 500; }
  .runsheet-times th { width: 14%; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .runsheet-bill th { width: auto; font-weight: 400; }
  .runsheet-bill td { white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .runsheet-bill td:last-child { padding-right: 0; text-align: right; }
  .runsheet-bill .total > * { border-top: .5pt solid var(--paper-ink); font-weight: 600; }
  .runsheet-meta, .runsheet-foot { color: var(--paper-muted); }
  .runsheet-notes { white-space: pre-wrap; }
  .runsheet-foot { margin-top: 18pt; font-size: 8.5pt; }
}

/* The rain plan's switch, beside the Ceremony group's name in Where you stand.
   A small box that fills with the accent when the ceremony is indoors. */
.view-group-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--rule); padding-right: var(--s-2); }
.view-group-row:first-child { border-top: 0; }
.view-group-row .view-group { border-top: 0; }
.view-group-row:first-child .view-group { padding-top: var(--s-1); }
.view-list .view-switch { display: inline-flex; width: auto; min-height: 32px; padding: 0 var(--s-2); gap: var(--s-2); font-size: var(--t-meta); font-weight: 500; color: var(--ink-2); }
.view-list .view-switch::after { content: ''; width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 2px; }
.view-list .view-switch[aria-pressed='true'] { color: var(--ink); font-weight: 500; }
.view-list .view-switch[aria-pressed='true']::before { content: none; }
.view-list .view-switch[aria-pressed='true']::after { background: var(--accent); border-color: var(--accent); }
@media (max-width: 960px) { .view-list .view-switch { min-height: 44px; } }

/* A song from the couple's own device: the picker is a label styled as a
   button over a visually hidden file input, so it takes focus and keys. */
.song-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: var(--s-2) 0; }
.song-file .fine { margin: 0; flex: 1 1 10em; }
.file-pick { cursor: pointer; }
.file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
