/* Glowtale — all styles. Rebrand: change the tokens in this one :root block (colours, fonts, radii). */
:root {
  /* colour (Glowtale tokens v3 merged: same names as before, plus the brand ones below) */
  --bg-0: #1f1e1d; --bg-1: #262624; --bg-2: #30302e; --bg-3: #3a3936; --bg-4: #45443f; --bg-deep: #1a1918;
  --projector: #000000;                                   /* anything shown on the projector: black = no light */
  --line: rgba(222, 220, 209, .12); --line-2: #6a665f;    /* hairlines / input and control borders (3:1 on bg-1) */
  --fg-1: #faf9f5; --fg-2: #c8c3b8; --fg-3: #9c9a92; --fg-4: #75736c;
  --accent: #d97757; --accent-2: #c6613f; --accent-hi: #e58c6c; --accent-tint: rgba(217, 119, 87, .14); --accent-text: #e08a6d;
  --on-accent: #1a1210;                                   /* dark text on ember: 5.9:1 (white is only 3.1:1) */
  --light: #ffe3ae; --glow: #f2a65a; --frost: #a9c7d8;    /* candle, warm secondary, the only cool note */
  --danger-text: #f08a7e; --danger-tint: rgba(229, 103, 90, .14);
  --ok: #7faf8a; --warn: #d9a557;
  --overlay: rgba(31, 30, 29, .86); --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --preview: #0b0b0c;
  --ease: cubic-bezier(.22, .8, .24, 1);
  /* type: UI titles Lora 500 (self-hosted, OFL), body system sans / Inter */
  --serif: "Lora", "Iowan Old Style", Charter, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-xs: 12px; --t-sm: 13px; --t-md: 15px; --t-lg: 17px; --t-xl: 20px; --t-xl2: 22px; --t-2xl: 24px; --t-2xl2: 28px; --t-3xl: 40px;
  /* shape */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;
  --hit: 44px; --tabbar: 64px;
  /* aliases of the brand file's names, so its snippets drop in */
  --bg0: var(--bg-1); --bg1: var(--bg-0); --bg2: var(--bg-2); --line-strong: var(--line-2);
  --text: var(--fg-1); --text-2: var(--fg-2); --text-3: var(--fg-3); --ember: var(--accent); --candle: var(--light);
  --font-display: var(--serif); --font-ui: var(--sans);
}
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/lora-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/lora-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; background: var(--projector); overflow: hidden; color: var(--fg-1);
  font: var(--t-md)/1.4 var(--sans); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
body.idle, body.idle * { cursor: none !important; }
button { font: inherit; color: inherit; }
input { font: inherit; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.num, .code, .tval { font-variant-numeric: tabular-nums; }

/* ---------- the picture ---------- */
#app { position: fixed; inset: 0; overflow: hidden; background: var(--projector); }
#stage { position: absolute; inset: 0; touch-action: pan-y; }
.surface { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #000; overflow: hidden; }
.surface canvas, .surface video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.surface video { object-fit: cover; }
.surface.mirror canvas, .surface.mirror video { transform: scaleX(-1); }
body.editing #stage { cursor: move; }

/* mapping handles: above the top bar and the toolbar, so every corner can be grabbed */
#handles { position: fixed; inset: 0; pointer-events: none; z-index: 14; }
body.popopen #handles { z-index: 11; }
#outlines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#outlines polygon { fill: none; stroke: rgba(250, 249, 245, .7); stroke-width: 2; }
#outlines polygon.sel { stroke: var(--accent); stroke-width: 3; }
.handle {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  pointer-events: auto; touch-action: none; cursor: grab; display: grid; place-items: center;
}
.handle::before { content: ""; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-0); box-shadow: 0 0 0 2px var(--fg-1), 0 1px 4px rgba(0, 0, 0, .6); }
.handle.sel::before { background: var(--accent); box-shadow: 0 0 0 2px var(--fg-1), 0 0 0 12px var(--accent-tint); }
.handle.mover { cursor: move; }
.handle.mover::before { display: none; }
.handle.mover span { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--bg-0); box-shadow: 0 0 0 2px var(--fg-1); display: grid; place-items: center; color: var(--fg-1); }
.handle.mover.sel span { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--fg-1), 0 0 0 10px var(--accent-tint); }
body.mapped-remotely .handle, body.mapped-remotely #maptool, body.mapped-remotely #mapchip { display: none !important; }
#maplabel {
  position: absolute; transform: translate(-50%, -50%); padding: 6px 12px; border-radius: var(--r-full);
  background: var(--overlay); border: 1px solid var(--line); color: var(--fg-1); font-size: var(--t-md); font-weight: 600; white-space: nowrap;
}

/* ---------- overlays on the picture (.ov) ---------- */
.ov {
  background: var(--overlay); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); color: var(--fg-1);
}
#layer { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity .25s, transform .25s; }
#layer.in { opacity: 1; transition: opacity .15s, transform .15s; }
#layer.k-toast { top: 24px; min-width: 220px; padding: 10px 22px 12px; text-align: center; pointer-events: none; transform: translate(-50%, -6px); }
#layer.k-toast.in { transform: translate(-50%, 0); }
#layer.k-toast small { display: block; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
#layer.k-toast b { display: block; font: 500 var(--t-xl)/1.3 var(--serif); }
#layer.k-quick, #layer.k-undo { bottom: 24px; }
#layer.k-chip { left: auto; right: 24px; bottom: 24px; transform: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-size: var(--t-sm); color: var(--fg-2); border-radius: var(--r-full); white-space: nowrap; }
#layer.k-chip .ic { width: 18px; height: 18px; color: var(--fg-2); }
#layer.k-chip .code { font-size: var(--t-lg); font-weight: 600; color: var(--fg-1); letter-spacing: .12em; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-sm); background: var(--bg-3); color: var(--fg-1); font: 600 12px/1 var(--sans); margin-right: 4px; }
#layer.k-undo { height: 48px; max-width: 480px; display: flex; align-items: center; gap: 16px; padding: 0 8px 0 18px; white-space: nowrap; }
#layer.k-confirm { top: 50%; transform: translate(-50%, -50%); width: 400px; max-width: calc(100vw - 32px); padding: 24px; }
#layer.k-firstrun { inset: 0; transform: none; width: auto; max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  background: radial-gradient(60% 70% at 75% 55%, rgba(217, 119, 87, .07), transparent 70%), #0b0b0c; }
#layer.k-setup { bottom: 24px; width: 560px; max-width: calc(100vw - 32px); padding: 18px 22px 16px; border-radius: var(--r-xl); }
#layer.k-setup.top { bottom: auto; top: 24px; }
#layer.k-setup.chipmode { width: auto; max-width: calc(100vw - 32px); padding: 0; border-radius: var(--r-full); }
#layer.k-mapmenu { bottom: 24px; width: 320px; padding: 6px; }
@media (prefers-reduced-motion: reduce) { #layer, #layer.in { transform: translateX(-50%) !important; transition: opacity .15s; } #layer.k-chip { transform: none !important; } #layer.k-confirm { transform: translate(-50%, -50%) !important; } #layer.k-firstrun { transform: none !important; } }

/* first-run card */
.fr h2 { margin: 0 0 6px; font: 500 var(--t-2xl2)/1.2 var(--serif); }
.fr > p { margin: 0 0 24px; color: var(--fg-2); }
.fr .pair { display: flex; gap: 24px; align-items: center; }
.fr footer { margin-top: 24px; font-size: var(--t-sm); color: var(--fg-3); }
.fr .types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* pairing: QR on a white tile, address and code */
.qr { background: #fff; padding: 12px; border-radius: var(--r-lg); line-height: 0; flex: none; width: fit-content; }
.qr:empty { display: none; }
.qr img, .qr canvas { width: 200px; height: 200px; }
.qr.s160 img, .qr.s160 canvas { width: 160px; height: 160px; }
.pairtext small { display: block; font-size: var(--t-sm); color: var(--fg-3); }
.pairtext .addr { font-size: var(--t-lg); color: var(--fg-1); margin: 2px 0 10px; word-break: break-all; }
.pairtext .bigcode { display: inline-block; font-size: var(--t-3xl); font-weight: 700; letter-spacing: .16em; padding: 4px 6px 4px 14px; background: var(--bg-0); border-radius: var(--r-md); margin-top: 4px; }
.pairtext p { margin: 12px 0 0; color: var(--fg-2); }

/* quick bar: one row */
.qb { display: flex; align-items: center; gap: 6px; padding: 6px; height: 56px; max-width: min(960px, calc(100vw - 48px)); }
.qname { display: flex; flex-direction: column; min-width: 0; max-width: 220px; padding: 0 2px; line-height: 1.15; }
.qname b { font: 500 var(--t-lg) var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qname small { font-size: 11px; color: var(--fg-3); }
.sep { width: 1px; height: 28px; background: var(--line); flex: none; margin: 0 4px; }
.qset { display: flex; align-items: center; gap: 6px; }
.qset .seg { flex-wrap: nowrap; }
.qname { flex-shrink: 0; }
.qset .none { color: var(--fg-3); padding: 0 10px; }
.qset .vstat { font-size: var(--t-sm); color: var(--fg-2); padding: 0 6px; white-space: nowrap; }
.fxbtn { position: relative; }
.fxbtn .k { font-size: var(--t-sm); color: var(--fg-3); }
.fxlist { position: absolute; bottom: calc(100% + 8px); width: 220px; padding: 4px; z-index: 2; }
.fxlist .item { width: 100%; height: 40px; justify-content: flex-start; padding: 0 10px 0 34px; position: relative; border-radius: var(--r-md); }
.fxlist .item.on::before { content: "✓"; position: absolute; left: 12px; color: var(--accent-text); font-weight: 700; }
.popwrap { position: relative; display: flex; }

/* ---------- components ---------- */
.item { outline: none; }
body:not(.pointer) .item:focus-visible, body.kbd .item:focus { outline: 3px solid var(--fg-1); outline-offset: 3px; }
.btn, .ib {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--fg-2); font-size: var(--t-md); font-weight: 500; cursor: pointer; white-space: nowrap; flex: none;
}
.btn:disabled, .ib:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.secondary { background: var(--bg-2); border-color: var(--line-2); color: var(--fg-1); }
.btn.secondary:hover { background: var(--bg-3); }
.btn.ghost:hover, .ib:hover { background: var(--bg-3); color: var(--fg-1); }
.btn.danger { background: var(--danger-tint); color: var(--danger-text); border-color: rgba(240, 138, 126, .3); }
.btn.link { color: var(--accent-text); font-weight: 600; }
.btn.big { height: 52px; font-size: var(--t-lg); width: 100%; }
.ib { width: 44px; height: 44px; padding: 0; }
.ib.s40 { width: 40px; height: 40px; }
.ib.danger { color: var(--danger-text); }
.ib .ic { width: 20px; height: 20px; }
.btn .ic { width: 18px; height: 18px; }

.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); font-size: var(--t-sm); cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--bg-3); }
.chip.on, .sw.on { background: var(--accent-tint); border-color: var(--accent); color: var(--fg-1); box-shadow: inset 0 0 0 1px var(--accent); }
.sw { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 40px; height: 40px; padding: 0 9px; border-radius: var(--r-full); border: 1px solid var(--line-2); background: transparent; cursor: pointer; flex: none; }
.sw:hover { background: var(--bg-3); }
.sw i, .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; }
.sw.s36 { height: 36px; min-width: 36px; }
.dots { display: inline-flex; gap: 3px; }

.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-2); font-size: var(--t-sm); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--fg-1); }
.seg button.on { background: var(--bg-3); color: var(--fg-1); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 -2px 0 var(--accent); }
.seg.h44 button { height: 40px; font-size: var(--t-md); }

.tg { width: 44px; height: 26px; border-radius: 13px; background: var(--bg-4); position: relative; flex: none; transition: background .15s; }
.tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
[aria-checked="true"] .tg { background: var(--accent); }
[aria-checked="true"] .tg::after { left: 21px; }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.list { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-top: 1px solid var(--line);
  background: transparent; text-align: left; color: var(--fg-1); font-size: var(--t-md); border-radius: 0;
}
.row:first-child { border-top: 0; }
button.row { cursor: pointer; }
button.row:hover { background: var(--bg-3); }
button.row:hover .val { color: var(--fg-2); }
.row .lbl { flex: 1; min-width: 0; font-weight: 500; }
.row .lbl small { display: block; font-weight: 400; color: var(--fg-3); font-size: var(--t-sm); }
.row .val { color: var(--fg-3); white-space: nowrap; }
.row .chev { color: var(--fg-4); width: 16px; height: 16px; }
.row.dim { opacity: .45; }
.row.colrow { flex-direction: column; align-items: flex-start; gap: 8px; }
.list.danger .row { color: var(--danger-text); }
.help { font-size: var(--t-sm); color: var(--fg-3); margin: 10px 4px 0; }
.sech { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 8px; }
.inp {
  width: 100%; height: 44px; border-radius: var(--r-md); background: var(--bg-0); border: 1px solid var(--line-2); color: var(--fg-1);
  padding: 0 12px; font-size: var(--t-md); -webkit-user-select: text; user-select: text;
}
.inp:focus { border-color: var(--accent); }
.inp::placeholder { color: var(--fg-3); }
.field { margin: 0 0 16px; }
.field label { display: block; font-size: var(--t-sm); color: var(--fg-2); margin: 0 0 6px; }
.field small { display: block; font-size: var(--t-xs); color: var(--fg-3); margin-top: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger-text); }
.status { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--fg-2); }
.status.bad { color: var(--danger-text); }
.vt { margin: 0; font: 500 var(--t-2xl2)/1.2 var(--serif); }

/* stepper (24 h times) */
.stp { display: flex; align-items: center; gap: 6px; position: relative; }
.sbtn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-1); display: grid; place-items: center; cursor: pointer; touch-action: none; }
.tval { height: 42px; min-width: 84px; padding: 0 12px; border-radius: var(--r-md); background: var(--bg-0); border: 1px solid var(--line-2); color: var(--fg-1); font-size: var(--t-lg); cursor: pointer; }
.tnative { position: absolute; left: 50%; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* scene tiles */
.tile { position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: visible; cursor: pointer; color: var(--fg-1); scroll-margin: 24px; transition: transform .12s; }
.tile:hover { background: var(--bg-3); }
.tile .pv { position: relative; aspect-ratio: 16 / 10; background: var(--preview); border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; overflow: hidden; display: grid; place-items: center; }
.pv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv .glyph { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--fg-3); }
.pv .glyph .ic { width: 32px; height: 32px; stroke-width: 1.5; }
.tile .nm { padding: 10px 12px; font-size: var(--t-md); font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .nm small { display: block; font-weight: 400; font-size: var(--t-sm); color: var(--fg-3); }
.tile .badge { display: none; position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-sm); }
.tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.on .badge { display: block; }
body:not(.pointer) .tile:focus-visible, body.kbd .tile:focus { transform: scale(1.03); }

/* ---------- the shell (menu) ---------- */
#shell { position: fixed; inset: 0; z-index: 8; background: var(--bg-1); display: flex; flex-direction: column; }
.topbar { flex: none; height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 12px 0 20px; background: var(--bg-0); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 500 var(--t-xl)/1 var(--serif); white-space: nowrap; flex: 1; min-width: 0; }
#brandmark { height: 26px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; justify-content: center; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 0; background: transparent; color: var(--fg-2); font-size: var(--t-md); font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--fg-1); }
.tab.on { background: var(--bg-3); color: var(--fg-1); }
.tools { flex: 1; display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.tools .btn.on .ic { color: var(--accent); }
.tools .btn .ic.off { color: var(--accent); }
.tools .pwr.on { color: var(--accent); }
.tools .pwr { color: var(--fg-3); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-full); background: var(--bg-2); border: 1px solid var(--line); color: var(--fg-1); font-size: var(--t-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.pill .muted { color: var(--fg-2); font-weight: 500; }
.pillmenu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 12px; z-index: 3; }
.pillmenu p { margin: 0 0 12px; color: var(--fg-2); font-size: var(--t-sm); }
.banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--bg-3); color: var(--fg-1); font-size: var(--t-sm); }
.view { flex: 1; min-height: 0; overflow: auto; }
#v-scenes { display: grid; grid-template-columns: 260px 1fr; overflow: hidden; }
.rail { background: var(--bg-0); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.rail-h { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); padding: 4px 12px 10px; }
.cat { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--fg-2); font-size: var(--t-md); font-weight: 500; text-align: left; cursor: pointer; }
.cat:hover { background: var(--bg-2); color: var(--fg-1); }
.cat span { flex: 1; }
.cat small { color: var(--fg-3); font-size: var(--t-sm); font-weight: 400; }
.cat i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); visibility: hidden; }
.cat.has i { visibility: visible; }
.cat.on { background: var(--bg-3); color: var(--fg-1); }
.cat.on small { color: var(--fg-2); }
.nowcard { margin-top: auto; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); text-align: left; cursor: pointer; }
.nowcard .th { width: 64px; height: 40px; border-radius: var(--r-sm); background: var(--preview); position: relative; overflow: hidden; flex: none; display: grid; place-items: center; color: var(--fg-3); }
.nowcard .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nowcard .th .ic { width: 18px; height: 18px; }
.nowcard small { display: block; font-size: var(--t-xs); color: var(--fg-3); }
.nowcard b { display: block; font-weight: 500; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.content { overflow: auto; padding: 24px; }
.titlerow { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
.gtitle { flex: 1 1 200px; padding-top: 4px; }
.gtitle small { display: block; font-size: var(--t-sm); color: var(--fg-3); margin-top: 4px; }
.fts { flex: 0 1 640px; min-height: 104px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.fts.tall { flex-basis: 100%; }
.ftshead { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.ftshead span:last-child { text-transform: none; letter-spacing: 0; }
.ftsrow { display: flex; align-items: center; gap: 12px; }
.ftsrow > .seg, .ftsrow > .sws { flex: 1; min-width: 0; }
.ftsrow > .k { width: 56px; font-size: var(--t-sm); color: var(--fg-3); flex: none; }
.ftsrow .sws { display: flex; gap: 6px; flex-wrap: wrap; }
.fts .none { color: var(--fg-3); }
.vrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vrow > b { width: 64px; font-weight: 500; flex: none; }
.vrow .inp { flex: 1; min-width: 180px; height: 40px; }
.vrow small { width: 100%; padding-left: 74px; color: var(--fg-3); font-size: var(--t-sm); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 4px; }
.col { max-width: 640px; margin: 0 auto; padding: 32px 24px 48px; }
.col > .vt { margin-bottom: 20px; }
.subhead { display: flex; align-items: center; gap: 12px; margin: 0 0 20px -8px; }
.subhead .btn { height: 44px; padding: 0 10px; }
.foot { font-size: var(--t-sm); color: var(--fg-3); margin: 16px 4px; }
.pairpage { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.linktext { font: var(--t-sm)/1.5 var(--mono); color: var(--fg-2); word-break: break-all; -webkit-user-select: text; user-select: text; background: var(--bg-0); border-radius: var(--r-md); padding: 12px; margin-top: 12px; }
.copyrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
body.kbd .hide-kbd { display: none !important; }
#pairsheet { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.sheetcard { width: 520px; max-width: calc(100vw - 32px); padding: 24px; position: relative; }
.sheetcard .x { position: absolute; top: 10px; right: 10px; }
.sheetcard h2 { margin: 0 0 20px; font: 500 var(--t-xl2) var(--serif); }

/* mapping: the top bar stays (translucent), the rest lets the picture through */
#shell.mapping { background: transparent; pointer-events: none; bottom: auto; }
#shell.mapping .topbar { pointer-events: auto; background: var(--overlay); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#shell.mapping .view, #shell.mapping .banner { display: none !important; }
#maptool { position: fixed; z-index: 12; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; height: 56px; white-space: nowrap; max-width: calc(100vw - 16px); }
#maptool.top { bottom: auto; top: 72px; }
#maptool > .seg { flex-wrap: nowrap; }
.row.colrow .seg { max-width: 100%; }
body[data-layer=mapmenu] #mapchip, body[data-layer=undo] #mapchip, body[data-layer=confirm] #mapchip { display: none !important; }
body.editing:not(.kbd) #layer.k-undo { bottom: 96px; }
#maptool .mstatus { font-size: var(--t-sm); color: var(--fg-2); padding: 0 6px; }
#maptool .mstatus em { font-style: normal; color: var(--accent-text); }
.pop { position: absolute; bottom: calc(100% + 10px); left: 0; padding: 4px; min-width: 220px; z-index: 3; }
#maptool.top .pop { bottom: auto; top: calc(100% + 10px); }
.pop.right { left: auto; right: 0; }
.pop .item.listrow, .mlist .item { width: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 34px; border: 0; background: transparent; border-radius: var(--r-md); color: var(--fg-1); position: relative; cursor: pointer; font-size: var(--t-md); text-align: left; }
.pop .item.listrow:hover, .mlist .item:hover { background: var(--bg-3); }
.pop .item.listrow.on::before, .mlist .item.on::before { content: "✓"; position: absolute; left: 12px; color: var(--accent-text); font-weight: 700; }
.projpop { width: 340px; padding: 12px; white-space: normal; max-height: calc(100vh - 150px); overflow: auto; }
.projpop .card { margin-bottom: 12px; }
.projpop .btn { width: 100%; }
#mapchip { position: fixed; z-index: 12; left: 50%; bottom: 24px; transform: translateX(-50%); height: 40px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-radius: var(--r-full); font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; }
#mapchip b { font-size: var(--t-md); font-weight: 600; color: var(--accent-text); }
body.kbd #maptool, body:not(.kbd) #mapchip { display: none !important; }
.mlist .item { height: 48px; padding-left: 16px; }
.mlist .item.danger { color: var(--danger-text); }
.mlist .item.armed { background: var(--danger-tint); }
.mlist .item .v { margin-left: auto; color: var(--fg-2); }
.mlist .item.disabled { color: var(--fg-4); cursor: default; }
.mlist .head { padding: 10px 16px 6px; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.dlg h2 { margin: 0 0 8px; font: 500 var(--t-xl) var(--serif); }
.dlg p { margin: 0 0 20px; color: var(--fg-2); }
.dlg .btns { display: flex; gap: 12px; justify-content: flex-end; }

/* TV scale: everything on screen ×1.2 (?tv, or the first arrow key on a small projector screen) */
html.tv #shell, html.tv #layer, html.tv #maptool, html.tv #mapchip { zoom: 1.2; }
html.tv #layer.k-firstrun { zoom: 1; }

/* ---------- join screen ---------- */
#join { position: fixed; inset: 0; z-index: 30; background: var(--bg-1); overflow: auto; }
.joincol { max-width: 360px; margin: 18vh auto 32px; padding: 0 16px; text-align: center; }
.joincol .sub { color: var(--fg-2); margin: 8px 0 28px; }
.joincol .sub.small { color: var(--fg-3); margin: 20px 0 32px; }
.codeboxes { position: relative; display: flex; justify-content: center; gap: 8px; }
.codeboxes span { width: 52px; height: 64px; display: grid; place-items: center; background: var(--bg-0); border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 28px; font-weight: 600; }
.codeboxes span.cur { border: 2px solid var(--fg-1); }
#joincode { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; text-transform: uppercase; caret-color: transparent; border: 0; }
.err { color: var(--danger-text); font-size: var(--t-sm); min-height: 20px; margin: 10px 0 16px; }
#joinbtn:disabled { opacity: .4; }
#recent { text-align: left; }
#recent .row { background: var(--bg-2); border-radius: var(--r-lg); border: 1px solid var(--line); }

/* ---------- phone remote ---------- */
body.phone-ui { background: var(--bg-1); }
body.phone-ui #app, body.phone-ui #shell, body.phone-ui #maptool, body.phone-ui #mapchip, body.phone-ui #handles { display: none !important; }
#phone { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg-1); }
.ph-head { flex: none; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; background: var(--bg-1); position: relative; z-index: 3; }
.ph-head h1 { flex: 1; margin: 0; font: 500 var(--t-xl2)/1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-head .ib.pwr.on { color: var(--accent); }
.ph-head .ib.pwr { color: var(--fg-3); }
.ph-head .pill { height: 32px; position: relative; }
.ph-head .pill::after { content: ""; position: absolute; inset: -6px 0; }
.ph-main { flex: 1; min-height: 0; overflow: auto; position: relative; padding-bottom: 16px; }
.ph-main.withmini { padding-bottom: 96px; }
.ph-tabs { flex: none; display: flex; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg-0); border-top: 1px solid var(--line); position: relative; z-index: 3; }
.ph-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: var(--fg-3); font-size: var(--t-xs); font-weight: 500; cursor: pointer; }
.ph-tabs button .ic { width: 24px; height: 24px; }
.ph-tabs button.on { color: var(--fg-1); }
.ph-tabs button.on .ic { color: var(--accent); }
.hero { margin: 8px 16px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.hero .pv { aspect-ratio: 16 / 10; background: var(--preview); position: relative; display: grid; place-items: center; touch-action: pan-y; }
.hero .pv .off { color: var(--fg-3); }
.hero .body { padding: 16px; }
.hero .over { font-size: var(--t-sm); color: var(--fg-3); }
.hero h2 { margin: 2px 0 16px; font: 500 var(--t-2xl)/1.25 var(--serif); }
.hero .two { display: flex; gap: 12px; }
.hero .two .btn { flex: 1; height: 56px; font-size: var(--t-lg); }
.hero .btn.primary.wide { width: 100%; height: 56px; font-size: var(--t-lg); }
.pcard { margin: 0 16px 16px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-xl); }
.pcard .lab { font-size: var(--t-sm); color: var(--fg-2); margin: 0 0 8px; }
.pcard .block + .block { margin-top: 16px; }
.pcard .sws { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: space-between; }
.pcard .sw { width: 44px; height: 44px; min-width: 44px; padding: 0; gap: 2px; }
.pcard .sw i { width: 7px; height: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { height: 44px; padding: 0 16px; font-size: var(--t-md); font-weight: 500; }
.cap { font-size: var(--t-xs); color: var(--fg-3); margin-top: 8px; }
.pcard .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.pcard .seg button { height: 44px; font-size: var(--t-md); padding: 0 4px; white-space: normal; line-height: 1.1; }
.pcard .seg button.long { font-size: var(--t-sm); }
.pcard .vrow > b { width: auto; }
.pcard .vrow .inp { min-width: 0; height: 44px; flex-basis: 100%; }
.pcard .vrow { margin-bottom: 12px; }
.pcard .none { color: var(--fg-3); }
.pchips { position: sticky; top: 0; z-index: 2; background: var(--bg-1); padding: 4px 16px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.pchips .chip { height: 40px; font-size: var(--t-md); font-weight: 500; position: relative; }
.pchips .chip::after { content: ""; position: absolute; inset: -2px 0; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.pgrid .tile .nm { padding: 8px 10px; }
#miniplayer { position: absolute; left: 16px; right: 16px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); z-index: 4; height: 64px; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 6px; background: var(--bg-3); border-radius: var(--r-lg); box-shadow: var(--shadow); }
#miniplayer .th { width: 56px; height: 35px; border-radius: var(--r-sm); background: var(--preview); position: relative; overflow: hidden; flex: none; display: grid; place-items: center; color: var(--fg-3); }
#miniplayer .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#miniplayer .txt { flex: 1; min-width: 0; padding: 0 6px; border: 0; background: transparent; text-align: left; cursor: pointer; }
#miniplayer .txt small { display: block; font-size: var(--t-xs); color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#miniplayer .txt b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#miniplayer .ib { color: var(--fg-1); }
.ph-set { padding: 8px 16px 24px; }
.ph-set .col { padding: 0; }
.ph-set .vt { display: none; }
.ph-set .subhead .vt { display: block; font-size: var(--t-xl2); }
.ph-set .subhead { margin-bottom: 12px; }
.ph-set .row { min-height: 56px; }
body.phone-ui #layer.k-undo { bottom: calc(var(--tabbar) + 16px); }
body.phone-ui.ph-surfaces #layer.k-undo { bottom: calc(var(--tabbar) + 320px); }
body.phone-ui #layer.k-toast { top: 64px; }
/* bottom sheets */
.scrim { position: fixed; inset: 0; z-index: 9; background: rgba(0, 0, 0, .55); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 85vh; overflow: auto; background: var(--bg-2); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--bg-4); margin: 0 auto 10px; }
.sheet .sh { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.sheet .sh div { flex: 1; }
.sheet .sh small { display: block; font-size: var(--t-xs); color: var(--fg-3); }
.sheet .sh h2 { margin: 2px 0 0; font: 500 var(--t-xl2)/1.2 var(--serif); }
.sheet .sh .ib { margin: -6px -8px 0 0; }
.sheet .block + .block { margin-top: 20px; }
.sheet .lab { font-size: var(--t-sm); color: var(--fg-2); margin: 0 0 8px; }
.swgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swgrid .sw { flex-direction: column; height: 64px; border-radius: var(--r-lg); gap: 6px; padding: 6px 2px; }
.swgrid .sw small { font-size: var(--t-xs); color: var(--fg-2); line-height: 1.1; text-align: center; }
.sheet .card { background: var(--bg-1); }
.sheet .btn.wide { width: 100%; height: 52px; margin-top: 12px; }
.sheet .seg { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.sheet .seg button { height: 44px; font-size: var(--t-sm); white-space: normal; line-height: 1.15; }
.sheet .listrow { width: 100%; height: 52px; display: flex; align-items: center; padding: 0 16px 0 40px; border: 0; background: transparent; color: var(--fg-1); font-size: var(--t-md); border-radius: var(--r-md); position: relative; text-align: left; }
.sheet .listrow.on::before { content: "✓"; position: absolute; left: 14px; color: var(--accent-text); font-weight: 700; }
.offbanner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-3); font-size: var(--t-sm); color: var(--fg-1); }
/* phone mapping */
.pmap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pcanvas { flex: 1; min-height: 0; position: relative; background: #000; touch-action: none; }
.pcanvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pturn { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 36px; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 14px; border-radius: var(--r-full); font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; z-index: 2; }
.ppanel { flex: none; background: var(--bg-2); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 16px; border-top: 1px solid var(--line); }
.prow1 { display: flex; gap: 6px; align-items: center; }
.prow1 .seg { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.prow1 .seg button { flex: 1 0 auto; height: 38px; font-size: var(--t-md); }
.ptarget { font-size: var(--t-md); font-weight: 600; color: var(--accent-text); margin: 10px 0; }
.prow3 { display: flex; gap: 12px; align-items: flex-start; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 8px; flex: none; }
.dpad button { border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-1); display: grid; place-items: center; touch-action: none; cursor: pointer; padding: 0; }
.dpad button .ic { width: 22px; height: 22px; }
.dpad .nx { font-size: var(--t-sm); font-weight: 600; background: var(--bg-1); }
.pstack { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pstack .btn { width: 100%; height: 44px; }
.pstack .seg { width: 100%; flex-wrap: nowrap; }
.pstack .seg button { flex: 1; height: 38px; font-size: var(--t-md); padding: 0 4px; }
@media (orientation: landscape) {
  .pmap { flex-direction: row; }
  .ppanel { width: 300px; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); overflow: auto; padding: 12px; }
  .dpad { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: 6px; }
  .pstack .seg button { font-size: var(--t-sm); }
  .pstack .btn { padding: 0 8px; font-size: var(--t-sm); }
  .pstack .pfx { display: none; }
  .ptarget { margin: 6px 0; }
  .ph-head { height: 48px; }
}

/* a DISPLAY on a narrow screen (a phone used as the screen): the same shell, condensed */
@media (max-width: 700px) {
  .topbar { gap: 4px; padding: 0 6px 0 12px; }
  .brandname, .tab span, .tools .btn.ghost { font-size: 0; gap: 0; }
  .tools .btn.ghost { width: 40px; padding: 0; }
  .tab { padding: 0 10px; }
  #v-scenes { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-h, .nowcard, .cat small { display: none; }
  .cat { width: auto; white-space: nowrap; }
  .content { padding: 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ftsrow { flex-wrap: wrap; }
  .qb { flex-wrap: wrap; height: auto; }
}

/* =====================================================================
   Onboarding (onboarding.js): projector welcome, companion screens, TV-remote setup card, phone wizard, Help
   ===================================================================== */
/* ---------- projector: welcome (first run) ---------- */
.wel { position: absolute; inset: 0; color: var(--fg-1); }
.wel-brand { position: absolute; top: 7.2vh; left: 5.5vw; display: flex; align-items: center; gap: 12px; font: 500 25px/1 var(--serif); }
.wel-brand i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #ffe3ae, #f4b860 50%, #d97757); box-shadow: 0 0 14px rgba(244, 184, 96, .7); }
.wel-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; padding: 0 5.5vw; gap: 52px; }
.wel-l { padding-top: 40px; }
.wel h1 { margin: 0; font: 500 54px/1.06 var(--serif); letter-spacing: -.02em; }
.wel h1 em { font-style: italic; color: var(--light); }
.wel .sub { font-size: 19px; color: var(--fg-2); margin: 16px 0 30px; max-width: 470px; line-height: 1.45; }
.wel .steps { display: flex; flex-direction: column; gap: 16px; }
.wel .steps div { display: flex; gap: 14px; align-items: center; font-size: 18px; color: var(--fg-2); }
.wel .steps div b { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; background: rgba(244, 184, 96, .12); color: #f4b860; box-shadow: inset 0 0 0 1px rgba(244, 184, 96, .3); flex: none; }
.wel .steps div span b { width: auto; height: auto; background: none; box-shadow: none; display: inline; color: var(--fg-1); font-size: inherit; font-weight: 500; }
.wel-card { justify-self: end; width: 460px; padding: 30px; border-radius: 24px; background: #141312; border: 1px solid #2b2a27; box-shadow: 0 0 0 1px rgba(244, 184, 96, .06), 0 40px 100px -30px rgba(244, 184, 96, .16); text-align: center; }
.wel-qr { margin: 0 auto; padding: 11px; border-radius: 14px; background: #faf9f5; }
.wel-qr img, .wel-qr canvas { width: 178px; height: 178px; display: block; }
.wel-card .or { margin: 16px 0 8px; color: var(--fg-3); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.wel-card .or::before, .wel-card .or::after { content: ""; flex: 1; height: 1px; background: #2b2a27; }
.wel-card .addr { font-size: 17px; color: var(--fg-2); word-break: break-all; }
.wel-card .addr b { color: var(--fg-1); font-weight: 600; }
.wel-code { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.wel-code span { width: 50px; height: 62px; border-radius: 10px; background: var(--bg-0); border: 1px solid #3d3c39; display: grid; place-items: center; font-size: 34px; font-weight: 600; color: var(--light); font-variant-numeric: tabular-nums; }
.wel-card .st { margin-top: 12px; font-size: 13px; color: var(--fg-3); display: flex; gap: 8px; align-items: center; justify-content: center; }
.wel-card .st .dot.ok { box-shadow: 0 0 0 3px rgba(127, 175, 138, .2); }
.wel-card.norelay { text-align: left; }
.wel-card.norelay h2 { margin: 0 0 10px; font: 500 30px/1.2 var(--serif); }
.wel-card.norelay p { margin: 0 0 22px; color: var(--fg-2); font-size: 17px; }
.wel-card .press { font-size: 19px; color: var(--fg-1); display: flex; align-items: center; gap: 10px; }
.wel-card .press kbd { height: 34px; min-width: 40px; font-size: 15px; background: var(--accent); color: var(--on-accent); }
.wel-foot { position: absolute; bottom: 4.7vh; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 34px; font-size: 15px; color: var(--fg-3); }
.wel-foot button { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--fg-3); font-size: 15px; cursor: pointer; padding: 4px; border-radius: var(--r-md); }
.wel-foot kbd { height: 30px; min-width: 30px; font-size: 13px; border-radius: 7px; border: 1px solid var(--line-2); margin: 0; }
.wel-foot .on { color: var(--fg-1); }
.wel-foot .on kbd { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 87, .25); }
.wel-foot .hint { color: var(--warn); }
.wel-foot .hint.ok { color: var(--ok); }
@media (max-width: 900px) { .wel-grid { grid-template-columns: 1fr; gap: 24px; padding-top: 80px; align-content: center; } .wel-card { justify-self: start; } .wel h1 { font-size: 40px; } .wel-l { padding-top: 0; } .wel .sub { margin: 10px 0 16px; } }

/* ---------- projector: companion layer and "Hello, phone!" ---------- */
#companion { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 7; pointer-events: none; }
body:not(.setup) #companion { display: none; }
#compui { position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none; background: radial-gradient(50% 50% at 50% 50%, rgba(217, 119, 87, .06), transparent 70%); }
.hello-card { width: 560px; max-width: calc(100vw - 48px); padding: 40px 40px 36px; border-radius: 24px; background: #141312; border: 1px solid #2b2a27; text-align: center; }
.hello-card h2 { margin: 14px 0 8px; font: 500 32px/1.2 var(--serif); }
.hello-card p { margin: 0; font-size: 17px; color: var(--fg-2); }
.hello-card .pulse { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: wzpulse 1.6s ease-in-out infinite; }
@keyframes wzpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 87, .5); } 50% { box-shadow: 0 0 0 14px rgba(217, 119, 87, 0); } }
body.setup #maplabel { display: none !important; }

/* ---------- projector: the TV-remote setup card ---------- */
.tvs .over { display: block; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); font-weight: 600; }
.tvs h2 { margin: 4px 0 6px; font: 500 var(--t-2xl2)/1.2 var(--serif); }
.tvs p { margin: 0 0 12px; font-size: var(--t-lg); color: var(--fg-2); }
.tvs .keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.tvk { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--fg-2); font-size: var(--t-sm); padding: 0; cursor: pointer; }
.tvlist { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.tvrow { height: 48px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--fg-1); font-size: var(--t-lg); text-align: left; cursor: pointer; }
.tvrow.on { background: var(--accent-tint); border-color: var(--accent); }
.tvtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0; }
.tvtile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); color: var(--fg-1); cursor: pointer; text-align: left; font-size: var(--t-md); }
.tvtile .pv { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md); background: var(--preview); overflow: hidden; display: grid; place-items: center; }
.tvtile b { font-weight: 500; padding: 0 4px 2px; }
.tvtile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tvauto { display: flex; gap: 16px; align-items: center; }
.tvauto .tvlist { flex: 1; }
.tvqr { text-align: center; width: 120px; }
.tvqr .qr { padding: 6px; border-radius: var(--r-md); margin: 0 auto; }
.tvqr .qr img, .tvqr .qr canvas { width: 96px; height: 96px; }
.tvqr small { display: block; margin-top: 6px; font-size: var(--t-xs); color: var(--fg-3); line-height: 1.3; }
.tvs.chip { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 20px; font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; }
.tvs.chip b { font-size: var(--t-md); font-weight: 600; color: var(--accent-text); }
.tvs.chip b span { color: var(--fg-1); }

/* ---------- display Settings › Help & setup ---------- */
.dhelp .lead { font-size: var(--t-lg); color: var(--fg-1); margin: 0; max-width: 240px; }
.dacc .row.open { background: var(--bg-3); }
.dacc .ans { padding: 2px 16px 14px; background: var(--bg-3); }
.dacc .ans ol { margin: 0; padding-left: 22px; color: var(--fg-2); font-size: 18px; line-height: 1.45; }
.dacc .ans li { margin: 6px 0; }
.dacc .ans b { color: var(--fg-1); }

/* ---------- phone wizard: frame ---------- */
#wizard { position: fixed; inset: 0; z-index: 11; display: flex; flex-direction: column; background: var(--bg-1); color: var(--fg-1); }
.wz-head { flex: none; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.wz-head .mid { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.wz-head .over { font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); font-weight: 600; white-space: nowrap; }
.wz-head .mid b { font-size: var(--t-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.wz-head .ib { color: var(--fg-2); }
.wz-sp { width: 44px; flex: none; }
.wz-prog { flex: none; display: flex; gap: 4px; padding: 0 16px 8px; }
.wz-prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-3); }
.wz-prog i.done { background: var(--accent); }
.wz-prog i.cur { background: linear-gradient(90deg, var(--accent) 50%, var(--bg-3) 50%); }
.wz-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 16px 8px; -webkit-overflow-scrolling: touch; }
.wz-foot { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); background: var(--bg-1); }
.wz-primary { width: 100%; min-height: 56px; font-size: var(--t-lg); }
.wz-ghost { width: 100%; min-height: 44px; font-size: var(--t-lg); color: var(--fg-2); font-weight: 500; }
.wz-second { width: 100%; min-height: 52px; font-size: var(--t-lg); }
.wz-ill { border-radius: var(--r-xl); background: var(--bg-1); border: 1px solid var(--line); overflow: hidden; line-height: 0; display: flex; justify-content: center; }
.wz-ill img { display: block; max-width: 100%; }
.wz-t { margin: 16px 0 8px; font: 500 26px/1.2 var(--serif); }
.wz-t.first { margin-top: 6px; }
.wz-t.sm { font-size: var(--t-2xl); margin-top: 14px; }
.wz-lead { margin: 0; color: var(--fg-2); font-size: var(--t-md); line-height: 1.45; }
.wz-lead b { color: var(--fg-1); }
.wz-tip { margin: 10px 4px 0; font-size: var(--t-sm); color: var(--fg-3); line-height: 1.4; }
.wz-tip.warnc { color: var(--warn); }
.wz-warn { margin: 8px 0 0; font-size: var(--t-sm); color: var(--warn); }
.wz-sech { margin: 18px 4px 8px; }
.wz-link { display: inline-block; line-height: 40px; min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--accent-text); font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.wz-link b { font-weight: 600; }
.wz-checks { margin-top: 14px; }
.wz-check { min-height: 52px; padding: 8px 14px; gap: 14px; }
.wz-check .lbl { font-weight: 500; }
.wz-check .lbl b { font-weight: 700; }
.cb { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-2); flex: none; display: flex; align-items: center; justify-content: center; }
.cb .ic { width: 16px; height: 16px; stroke: var(--on-accent); stroke-width: 2.6; opacity: 0; }
[aria-checked="true"] > .cb { background: var(--accent); border-color: var(--accent); }
[aria-checked="true"] > .cb .ic { opacity: 1; }
.wz-proj { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--bg-0); border: 1px solid var(--line); font-size: var(--t-sm); color: var(--fg-2); line-height: 1.4; }
.wz-proj .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(127, 175, 138, .18); flex: none; }
.wz-proj.bad .pdot { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 165, 87, .18); }
.wz-proj.bad { color: var(--warn); }
.wz-proj .ic { color: var(--fg-2); }
.wz-proj b { color: var(--fg-1); font-weight: 600; }
.rico { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; color: var(--fg-2); flex: none; }
.ic.okc { color: var(--ok); stroke-width: 2.4; }
.val.acc { color: var(--accent-text); font-weight: 500; }
#wizard .row .lbl small { margin-top: 1px; }

/* choice cards (type, surfaces) */
.wz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.wz-opts.one { grid-template-columns: 1fr; margin-top: 16px; }
.wz-opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 12px; text-align: left; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; color: var(--fg-1); cursor: pointer; }
.opt.on { border-color: var(--accent); background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--bg-2); box-shadow: 0 0 0 1px var(--accent); }
.opt b { font-weight: 600; font-size: var(--t-md); display: block; }
.opt small { color: var(--fg-3); font-size: var(--t-sm); display: block; line-height: 1.35; }
.opt .rad { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.opt.on .rad { border: 6px solid var(--accent); background: var(--fg-1); }
.opt svg.g { width: 56px; height: 44px; stroke: var(--fg-2); fill: none; stroke-width: 1.8; stroke-linejoin: round; flex: none; }
.opt.on svg.g { stroke: var(--accent-text); }
.opt.row1 { min-height: 84px; flex-direction: row; align-items: center; gap: 14px; justify-content: flex-start; padding: 12px 44px 12px 12px; }
.opt.row1 .rad { top: 50%; margin-top: -11px; }
.opt.sm { min-height: 96px; }
.opt.sm svg.g { width: 44px; height: 36px; }
.wz-sub .wz-sech { margin-top: 18px; }
.wz-shape .spv { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex: none; }
.wz-shape .spv i { display: block; border: 1.8px solid var(--accent-text); border-radius: 2px; background: var(--accent-tint); }
.wz-count { margin-top: 12px; padding: 8px 0; border: 0; }
.wz-count .seg button { min-width: 44px; height: 38px; font-size: var(--t-md); }

/* place */
.wz-gate { padding: 14px 14px 4px; border-color: rgba(217, 165, 87, .4); }
.wz-gate .gh { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.wz-gate .gh b { color: var(--fg-1); font-weight: 600; }
.wz-gate p { margin: 6px 0 4px; font-size: var(--t-sm); color: var(--fg-2); }
.wz-gate .wz-check { padding: 8px 0; border-top: 1px solid var(--line); }
.wz-rear { flex-wrap: wrap; gap: 10px; }
.wz-rear .lbl { flex: 1 1 160px; }
.wz-rear .seg button { height: 34px; font-size: var(--t-sm); }
.wz-rear .seg button.on[data-v=no] { box-shadow: 0 1px 2px rgba(0, 0, 0, .4), inset 0 -2px 0 var(--danger-text); }
.wz-fix { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px 12px; background: var(--danger-tint); color: var(--danger-text); font-size: var(--t-sm); line-height: 1.4; }
.wz-fix b { color: var(--fg-1); }
.wz-fix .ic { flex: none; margin-top: 1px; }

/* corners */
.wz-body.corners { padding: 4px 0 0; overflow: auto; }
.wz-cn { padding: 0 16px; }
.wz-cn h1 { margin: 0; font: 500 var(--t-2xl)/1.2 var(--serif); }
.wz-cn h1 em { font-style: normal; color: var(--accent-text); }
.wz-cn p { margin: 4px 0 0; color: var(--fg-2); font-size: var(--t-md); line-height: 1.4; }
.wz-pips { display: flex; gap: 6px; margin-top: 10px; align-items: center; font-size: var(--t-sm); color: var(--fg-3); flex-wrap: wrap; min-height: 20px; }
.wz-pips i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--fg-3); display: block; }
.wz-pips i.d { background: var(--accent); border-color: var(--accent); }
.wz-pips i.c { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.wz-pips .psep { width: 1px; height: 12px; background: var(--line-2); margin: 0 6px; }
.wz-pips .pn { margin-left: 2px; }
.wz-pips .pflash { margin-left: 10px; color: var(--accent-text); font-weight: 600; }
.wz-cv { margin: 12px 16px 0; height: 300px; border-radius: var(--r-lg); background: #0b0b0c; border: 1px solid var(--line); position: relative; overflow: hidden; touch-action: none; }
.wz-cv.tall { height: 380px; }
.wz-cv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wz-tipc { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center; padding: 8px 6px 8px 12px; border-radius: var(--r-lg); font-size: var(--t-sm); color: var(--fg-2); line-height: 1.35; }
.wz-tipc b { color: var(--fg-1); font-weight: 600; }
.wz-tipc .ib { width: 36px; height: 36px; margin-left: auto; flex: none; }
.wz-pad { display: flex; gap: 16px; padding: 14px 16px 6px; align-items: center; }
.wz-dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 48px); gap: 6px; flex: none; }
.wz-dpad button { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md); display: grid; place-items: center; color: var(--fg-1); touch-action: none; cursor: pointer; padding: 0; }
.wz-dpad .nx { background: var(--bg-3); font-size: var(--t-sm); font-weight: 600; }
.wz-pad .side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wz-fine { display: flex; width: 100%; }
.wz-fine button { flex: 1; height: 38px; font-size: var(--t-md); }
.wz-pad .note { margin: 0; font-size: var(--t-sm); color: var(--fg-3); line-height: 1.4; }
.wz-pad .note.err { color: var(--danger-text); font-weight: 500; }
.wz-surfseg { padding: 10px 16px 0; }
.wz-surfseg .seg { display: flex; width: 100%; }
.wz-surfseg .seg button { flex: 1; height: 38px; font-size: var(--t-md); }

/* outside */
.wz-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.wz-tiles .tc { background: #0b0b0c; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 10px 10px; text-align: center; }
.wz-tiles .w { height: 64px; border-radius: 6px; background: rgba(217, 119, 87, .16); border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; font: 700 26px/1 var(--sans); letter-spacing: .06em; color: var(--fg-1); }
.wz-tiles .bad .w { border-color: var(--line-2); background: rgba(250, 249, 245, .05); }
.wz-tiles .bad .w span { transform: scaleX(-1); display: inline-block; }
.wz-tiles small { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: var(--t-sm); color: var(--fg-2); }
.wz-tiles small .ic { width: 16px; height: 16px; }
.wz-tiles .ok small .ic { color: var(--accent-text); }
.wz-mirror { margin-top: 14px; }
.wz-mirror .row .lbl { font-weight: 500; }

/* show */
.wz-trial { margin: 0; font-size: var(--t-sm); color: var(--fg-3); }
.wz-shows { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wz-show { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.wz-show.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.showbtn { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; border: 0; background: transparent; color: var(--fg-1); text-align: left; cursor: pointer; }
.showbtn .pv { position: relative; width: 112px; height: 70px; border-radius: var(--r-md); background: var(--preview); overflow: hidden; display: grid; place-items: center; flex: none; }
.showbtn .pv .glyph .ic { width: 26px; height: 26px; }
.showbtn .stx { min-width: 0; }
.showbtn .stx b { display: block; font: 500 var(--t-xl)/1.2 var(--serif); }
.showbtn .stx small { display: block; font-size: var(--t-sm); color: var(--fg-3); margin-top: 2px; line-height: 1.35; }
.showbtn .badge { position: absolute; top: 14px; left: 14px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 5px; border-radius: var(--r-sm); }
.wz-show .ssub { padding: 0 10px 10px; }
.wz-show .ssub .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.wz-show .ssub .seg button { height: 40px; padding: 0 2px; white-space: normal; line-height: 1.1; font-size: var(--t-sm); }
.wz-show .ssub.sws { display: flex; justify-content: space-between; gap: 4px; }
.wz-show .ssub .sw { width: 40px; min-width: 40px; padding: 0; gap: 2px; }
.wz-show .ssub .sw i { width: 7px; height: 7px; }

/* automatic */
.wz-sched { margin-top: 12px; }
.wz-sched .row { min-height: 60px; }
.wz-sched .lbl { font-weight: 500; }
.wz-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--r-md); background: var(--accent-tint); border: 1px solid var(--accent); color: var(--fg-1); font-weight: 500; white-space: nowrap; flex: none; }
.wz-pill .ic { color: var(--accent-text); }
.wz-guides .lbl { font-weight: 500; }
.wz-placecard { margin-top: 12px; }

/* done */
.wz-hero { margin: 0; }
.wz-hero .pv { aspect-ratio: 16 / 9; }
.wz-sum .row { min-height: 48px; padding: 10px 16px; }
.wz-sum .val { white-space: normal; text-align: right; max-width: 60%; color: var(--fg-2); }

/* offline / asleep */
.wz-block { padding: 22px 18px 18px; text-align: center; margin-top: 24px; }
.wz-block .ic.big { width: 40px; height: 40px; color: var(--warn); }
.wz-block h2 { margin: 8px 0 8px; font: 500 var(--t-xl2)/1.25 var(--serif); }
.wz-block p { margin: 0; color: var(--fg-2); }
.wz-block .card { text-align: left; margin-top: 14px; background: var(--bg-1); }

/* sheets over the wizard */
.wz-scrim { z-index: 12; }
.wz-sheet { z-index: 13; }
.wz-sheet .wz-primary { margin-top: 16px; }
.wz-sheet .card { background: var(--bg-1); }
.wz-sheet .listrow { justify-content: flex-start; }
.wz-sheet .listrow .lv { margin-left: auto; color: var(--fg-3); font-size: var(--t-sm); }
.wz-ol { margin: 0; padding-left: 22px; color: var(--fg-2); }
.wz-ol li { margin: 8px 0; line-height: 1.45; }
.wz-ol b { color: var(--fg-1); }
.wz-cities { max-height: 40vh; overflow: auto; margin-top: 10px; }
.wz-share { text-align: center; }
.wz-share .qr { margin: 4px auto 12px; }
.wz-share .bigcode { display: inline-block; font-size: var(--t-3xl); font-weight: 700; letter-spacing: .16em; padding: 4px 6px 4px 14px; background: var(--bg-1); border-radius: var(--r-md); }
.wz-sheet .field .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.wz-calcwhat { display: flex; width: 100%; margin-bottom: 14px; }
.wz-calcwhat button { flex: 1; height: 40px; font-size: var(--t-sm); }
.wz-wh { display: flex; align-items: center; gap: 8px; color: var(--fg-3); }
.wz-num { flex: 1; }
.wz-calcres { padding: 14px 16px; margin-top: 4px; }
.wz-calcres p { margin: 0 0 6px; color: var(--fg-2); font-size: var(--t-sm); }
.wz-calcres p.big { font-size: var(--t-lg); color: var(--fg-1); }
.wz-calcres p.dim { color: var(--fg-3); margin: 8px 0 0; }
.wz-side { display: flex; width: 100%; margin-top: 8px; }
.wz-side button { flex: 1; height: 40px; }

/* help */
.wz-head.help { justify-content: flex-start; gap: 4px; }
.wz-head.help h1 { margin: 0; font: 500 var(--t-xl2)/1 var(--serif); }
.wz-body.help { padding: 4px 16px 24px; }
.wz-pc .row { min-height: 60px; }
.wz-pc .lbl small { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--t-sm); }
.wz-pc .lbl small .dot { margin-left: 6px; }
.wz-pc .lbl small .dot:first-child { margin-left: 0; }
.wz-chk { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 2px 12px; font-size: var(--t-sm); color: var(--fg-2); }
.wz-chk span { display: inline-flex; align-items: center; gap: 6px; }
.wz-search { display: flex; align-items: center; gap: 10px; height: 44px; margin-top: 12px; border-radius: var(--r-md); background: var(--bg-0); border: 1px solid var(--line-2); padding: 0 12px; color: var(--fg-3); }
.wz-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--fg-1); font-size: var(--t-md); outline: none; -webkit-user-select: text; user-select: text; }
.wz-search input::placeholder { color: var(--fg-3); }
.wz-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.wz-search:focus-within { border-color: var(--accent); }
.wz-acc .row .lbl { font-weight: 500; }
.wz-acc .row.open { background: var(--bg-3); }
.wz-acc .row.open .lbl { font-weight: 600; }
.wz-acc .row.open .chev { color: var(--fg-2); }
.wz-acc .ans { padding: 4px 16px 16px; background: var(--bg-3); }
.wz-acc .ans ol { margin: 0; padding-left: 20px; color: var(--fg-2); font-size: var(--t-md); }
.wz-acc .ans li { margin: 6px 0; line-height: 1.45; }
.wz-acc .ans li b { color: var(--fg-1); font-weight: 600; }
.wz-acc .ans .act { display: flex; gap: 8px; margin-top: 12px; }
.wz-acc .ans .act .btn { flex: 1; min-height: 44px; background: var(--bg-2); white-space: normal; line-height: 1.15; }
.wz-rw .lbl { font-weight: 500; }

/* Now: finish setting up / another phone */
.wz-now { position: relative; margin-top: 8px; }
.wz-now .sech { margin-bottom: 4px; }
.wz-now h3 { margin: 0 0 12px; font: 600 var(--t-lg)/1.3 var(--sans); }
.wz-now .wz-prog { padding: 0 0 14px; }
.wz-now .btn.wide { width: 100%; height: 52px; font-size: var(--t-lg); }
.wz-now .two { display: flex; gap: 10px; }
.wz-now .two .btn { flex: 1; height: 48px; }
.wz-now .x { position: absolute; top: 6px; right: 6px; color: var(--fg-3); }

/* coach marks */
#wz-coach { position: fixed; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; font-size: var(--t-md); color: var(--fg-1); border-radius: var(--r-lg); box-shadow: var(--shadow); }
#wz-coach .ic { color: var(--fg-3); width: 16px; height: 16px; margin-left: auto; }
#wz-coach::before { content: ""; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; margin-left: -6px; background: inherit; border: 1px solid var(--line); transform: rotate(45deg); }
#wz-coach.down::before { top: -7px; border-right: 0; border-bottom: 0; }
#wz-coach.up::before { bottom: -7px; border-left: 0; border-top: 0; }
@media (prefers-reduced-motion: reduce) { .hello-card .pulse { animation: none; } }

/* phone waiting for the projector to allow it */
#pairwait { position: fixed; inset: 0; z-index: 31; background: var(--bg-1); display: grid; place-items: center; padding: 16px; }
#pairwait .joincol { margin: 0; max-width: 420px; }
#pairwait .hello-card { width: auto; padding: 32px 24px 28px; }
#pairwait .hello-card h2 { font-size: var(--t-2xl2); }
#pairwait .waitcode { margin-top: 14px; font-size: var(--t-sm); color: var(--fg-3); }
#pairwait .waitcode span { letter-spacing: .12em; color: var(--fg-1); font-weight: 600; }

/* ---------- sign-in (login.js): hero with the live show + form; the projector's "sign in from your phone" ---------- */
#auth { position: fixed; inset: 0; z-index: 200; background: var(--bg-0); color: var(--fg-1); overflow: auto; -webkit-overflow-scrolling: touch;
  -webkit-user-select: text; user-select: text; font: var(--t-md)/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body.auth-open #auth, body.auth-open #auth * { cursor: auto !important; }
body.auth-open #auth button:not(:disabled), body.auth-open #auth a { cursor: pointer !important; }
:where(#auth) :where(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
:where(#auth) :where(button, input) { font: inherit; color: inherit; }
#auth .gt-field:focus-visible, #auth .gt-pcode:focus-visible, #auth #gt-code:focus-visible { outline: none; }
.gt-page { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, 1fr); }
.gt-hero { position: relative; margin: 14px 0 14px 14px; border-radius: 28px; overflow: hidden; background: #121110; min-height: 560px; isolation: isolate; }
.gt-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gt-hero::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(180deg, rgba(18, 17, 16, 0), rgba(18, 17, 16, .78)); pointer-events: none; }
.gt-brand { position: absolute; left: 32px; top: 28px; z-index: 2; display: block; line-height: 0; }
.gt-brand img { height: 30px; width: auto; }
.gt-now { position: absolute; right: 28px; top: 26px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px;
  background: rgba(20, 19, 18, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(250, 249, 245, .08); font-size: 13px; color: var(--fg-2); }
.gt-now i { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 0 3px rgba(242, 166, 90, .18); animation: gt-breathe 3.2s var(--ease) infinite; }
.gt-now b { color: var(--fg-1); font-weight: 500; }
.gt-copy { position: absolute; left: 40px; right: 40px; bottom: 36px; z-index: 2; max-width: 520px; }
.gt-copy h2 { font: 500 clamp(30px, 3.2vw, 46px)/1.08 var(--serif); letter-spacing: -.015em; margin: 0 0 12px; text-wrap: balance; }
.gt-copy h2 em { font-style: italic; color: var(--light); }
.gt-copy p { margin: 0; color: var(--fg-2); font-size: 16px; max-width: 430px; }
.gt-side { display: flex; flex-direction: column; padding: 28px 40px; min-width: 0; }
.gt-top { display: flex; justify-content: flex-end; }
.gt-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-1); border: 1px solid var(--line); }
.gt-lang button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--fg-3); min-width: 40px; }
.gt-lang button[aria-pressed=true] { background: var(--bg-2); color: var(--fg-1); }
.gt-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.gt-form { width: 100%; max-width: 400px; }
.gt-form h1 { font: 500 34px/1.12 var(--serif); letter-spacing: -.015em; margin: 0 0 8px; }
.gt-lead { margin: 0 0 26px; color: var(--fg-2); }
.gt-lead b, .gt-note b { color: var(--fg-1); font-weight: 600; overflow-wrap: anywhere; }
.gt-note b { white-space: nowrap; }
.gt-note { margin: 0 0 22px; padding: 12px 14px; border-radius: 12px; background: rgba(242, 166, 90, .1); border: 1px solid rgba(242, 166, 90, .25); color: var(--fg-2); font-size: 14px; }
.gt-label { display: block; font-size: 13px; font-weight: 500; color: var(--fg-2); margin: 0 0 8px; }
.gt-field { width: 100%; height: 50px; padding: 0 16px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--line-2); font-size: 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.gt-field::placeholder { color: #8a857c; }
.gt-field:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217, 119, 87, .2); }
.gt-field[aria-invalid=true] { border-color: var(--danger-text); }
.gt-codefield { text-align: center; letter-spacing: .2em; font-weight: 600; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.gt-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.gt-btn:active { transform: scale(.985); }
.gt-btn.primary { margin-top: 4px; background: var(--accent); color: var(--on-accent); }
.gt-btn.primary:hover:not(:disabled) { background: var(--accent-hi); }
.gt-btn.primary svg { transition: transform .3s var(--ease); }
.gt-btn.primary:hover:not(:disabled) svg { transform: translateX(3px); }
.gt-btn:disabled { opacity: .5; }
.gt-btn.ghost { background: var(--bg-1); border-color: var(--line-2); color: var(--fg-1); }
.gt-btn.ghost:hover { background: var(--bg-2); }
.gt-msg { min-height: 22px; margin: 8px 0 8px; font-size: 14px; color: var(--fg-2); }
.gt-msg.err { color: var(--danger-text); }
.gt-msg.info { color: var(--ok); }
.gt-fine { margin: 18px 0 0; font-size: 13px; color: var(--fg-3); text-align: center; }
.gt-fine.left { text-align: left; }
.gt-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.gt-linkbtn { border: 0; background: none; padding: 8px 0; color: var(--accent-text); font-weight: 600; font-size: 14px; text-align: left; }
.gt-linkbtn:disabled { color: var(--fg-3); font-weight: 500; }
.gt-linkbtn:hover:not(:disabled) { text-decoration: underline; }
.gt-form > .gt-linkbtn { display: block; margin: 16px auto 0; text-align: center; color: var(--fg-3); font-weight: 500; }
.gt-pair { margin-top: 30px; padding: 16px 16px 16px 18px; border-radius: 18px; background: var(--bg-deep); border: 1px dashed #4a4844; display: flex; align-items: center; gap: 14px; }
.gt-tv { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 166, 90, .1); color: var(--glow); }
.gt-pt { flex: 1; min-width: 0; }
.gt-pt strong { display: block; font-weight: 500; font-size: 14px; }
.gt-pt span { font-size: 13px; color: var(--fg-3); }
.gt-pair form { display: flex; gap: 6px; flex: none; }
.gt-pcode { width: 116px; height: 42px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line-2); text-align: center; font-weight: 600; font-size: 14px;
  letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.gt-pcode::placeholder { color: #8a857c; }
.gt-pcode:focus { outline: 0; border-color: var(--glow); box-shadow: 0 0 0 4px rgba(242, 166, 90, .16); }
.gt-go { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); display: grid; place-items: center; }
.gt-go:hover { border-color: var(--glow); color: var(--glow); }
.gt-env { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(242, 166, 90, .12); color: var(--glow); margin-bottom: 20px; }
.gt-env.ok { background: rgba(127, 175, 138, .14); color: var(--ok); }
.gt-env.warn { background: var(--danger-tint); color: var(--danger-text); }
.gt-boxes { position: relative; display: flex; align-items: center; gap: 8px; }
.gt-boxes span { flex: 1; max-width: 56px; height: 62px; display: grid; place-items: center; background: var(--bg-deep); border: 1px solid var(--line-2); border-radius: 12px;
  font: 600 26px/1 var(--sans); font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s; }
.gt-boxes span.on { border-color: #8a857c; }
.gt-boxes span.cur { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217, 119, 87, .2); }
.gt-boxes.bad span { border-color: var(--danger-text); animation: gt-shake .35s; }
.gt-dash { width: 10px; height: 2px; background: var(--line-2); flex: none; }
#gt-code { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; color: transparent; background: transparent; }
.gt-spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--bg-3); border-top-color: var(--accent); animation: gt-rot .9s linear infinite; margin-bottom: 22px; }
.gt-check { margin: 0 0 22px; padding: 16px 18px; border-radius: 16px; background: var(--bg-deep); border: 1px solid var(--line); }
.gt-check p { margin: 0; color: var(--fg-2); font-size: 14px; }
.gt-bigcode { margin: 10px 0 8px; font: 600 34px/1.1 var(--sans); letter-spacing: .14em; font-variant-numeric: tabular-nums; color: var(--light); }
.gt-dev span { color: var(--fg-3); }
.gt-two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.gt-two .gt-btn { margin: 0; }
.gt-foot { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--fg-3); }
@keyframes gt-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes gt-rot { to { transform: rotate(360deg); } }
@keyframes gt-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { #auth * { animation: none !important; transition: none !important; } }
@media (max-width: 860px) {
  .gt-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .gt-hero { margin: 10px 10px 0; min-height: 0; height: 250px; border-radius: 24px; }
  .gt-hero::after, .gt-copy, .gt-now { display: none; }
  .gt-brand { left: 20px; top: 18px; }
  .gt-brand img { height: 26px; }
  .gt-side { padding: 6px 20px calc(20px + env(safe-area-inset-bottom)); }
  .gt-top { position: absolute; right: 20px; top: 20px; z-index: 3; }
  .gt-top .gt-lang { background: rgba(20, 19, 18, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-color: rgba(250, 249, 245, .1); }
  .gt-wrap { align-items: flex-start; padding: 24px 0 8px; }
  .gt-form h1 { font-size: 30px; }
  .gt-lead { margin-bottom: 20px; }
  .gt-pair { margin-top: 24px; flex-wrap: wrap; padding: 14px; }
  .gt-pair form { width: 100%; }
  .gt-pcode { flex: 1; width: auto; height: 46px; }
  .gt-go { width: 46px; height: 46px; }
  .gt-foot { margin-top: 18px; justify-content: center; gap: 18px; }
  .gt-host { display: none; }
}
/* the projector: pure black (no light where nothing is shown), big type, readable from the sofa */
#auth.gt-device { background: var(--projector); }
.gt-dvpage { min-height: 100%; display: flex; flex-direction: column; padding: 40px 56px 32px; }
.gt-dvtop { display: flex; justify-content: space-between; align-items: center; }
.gt-dvtop img { height: 32px; width: auto; }
.gt-dvbody { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 64px; align-items: center; max-width: 1120px; width: 100%; margin: 0 auto; }
.gt-dvtext h1 { font: 500 52px/1.06 var(--serif); letter-spacing: -.02em; margin: 0 0 12px; }
.gt-dvtext .gt-lead { font-size: 20px; margin-bottom: 28px; max-width: 560px; }
.gt-steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 14px; }
.gt-steps li { display: flex; align-items: center; gap: 16px; font-size: 20px; color: var(--fg-2); }
.gt-steps li p { margin: 0; }
.gt-steps b { color: var(--fg-1); font-weight: 600; }
.gt-steps span { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(242, 166, 90, .14); color: var(--glow); font-weight: 600; font-size: 17px; }
.gt-dvor { margin: 0 0 6px; color: var(--fg-3); font-size: 18px; }
.gt-dvor b { color: var(--fg-1); font-weight: 600; }
.gt-dvcode { font: 600 64px/1.1 var(--sans); letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--light); }
.gt-dvwait { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--fg-3); font-size: 17px; }
.gt-dvwait i { width: 10px; height: 10px; border-radius: 50%; background: var(--glow); animation: gt-breathe 1.6s var(--ease) infinite; }
.gt-dvwait.ok i { background: var(--ok); animation: none; } .gt-dvwait.ok { color: var(--ok); }
.gt-dvwait.err i { background: var(--danger-text); animation: none; } .gt-dvwait.err { color: var(--danger-text); }
.gt-dvwait.warn { color: var(--glow); }
.gt-dvqr { padding: 22px; border-radius: 28px; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(242, 166, 90, .12); }
.gt-qr { width: 300px; height: 300px; }
.gt-qr img, .gt-qr canvas { width: 100% !important; height: 100% !important; display: block; image-rendering: pixelated; }
.gt-dvfoot { display: flex; justify-content: center; padding-top: 18px; }
.gt-dvfoot .gt-btn { width: auto; padding: 0 22px; height: 48px; background: transparent; border-color: #3d3c39; color: var(--fg-2); font-weight: 500; }
.gt-dvfoot .gt-btn:focus, .gt-lang button:focus-visible { outline: 3px solid var(--fg-1); outline-offset: 3px; color: var(--fg-1); }
@media (max-width: 900px) {
  .gt-dvpage { padding: 24px 20px; }
  .gt-dvbody { grid-template-columns: 1fr; gap: 28px; justify-items: start; }
  .gt-dvtext h1 { font-size: 36px; } .gt-dvcode { font-size: 44px; } .gt-qr { width: 220px; height: 220px; }
}
/* account rows in Settings, and "Your projectors" on the join screen */
.acct .lbl small { overflow-wrap: anywhere; }
.acct .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); font-weight: 600; margin-right: 12px; text-transform: uppercase; }
#mine { text-align: left; margin: 0 0 24px; }
#mine .row { background: var(--bg-2); border-radius: var(--r-lg); border: 1px solid var(--line); margin-bottom: 8px; width: 100%; }
#mine .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); margin-right: 6px; }
#mine .dot.ok { background: var(--ok); }
.lbl .who { color: var(--fg-3); font-weight: 400; overflow-wrap: anywhere; }
.acctline { margin: -6px 0 14px; color: var(--fg-3); font-size: var(--t-sm); overflow-wrap: anywhere; }
.acctline b { color: var(--fg-2); font-weight: 500; }
