/* Copied from reference/samsung/app/css/app.css (lensor-samsung@f533551). LG changes: no `inset`/flex `gap`
   (LG webOS 5–6 run Chromium 68–79), the HDMI <video> and a separately fitted subtitle stage,
   the HDMI dropdown, the full-screen hint; LG additions are at the end. */
/* Direct port of MainActivity.kt dp/sp geometry, colors and focus states.
   960 x 540 logical Android TV canvas, uniformly scaled to the TV viewport. */
@font-face { font-family: LensorRoboto; src: url('../assets/fonts/Roboto.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root { --ink: #f5f6f8; --muted: #999da8; --accent: #f2691f; --green: #63d797; --red: #f47777; --bg: #101114; --card: #1a1c21; --button: #1e2026; }
* { box-sizing: border-box; }
html, body { width:100%; height:100%; margin:0; overflow:hidden; background:var(--bg); color:var(--ink); }
body, button, input, textarea { font-family:LensorRoboto, Roboto, sans-serif; font-size:15px; }
[hidden] { display:none !important; }
#viewport { position:absolute; width:960px; height:540px; transform-origin:top left; }

.dev-preview-badge { position:absolute; top:14px; right:20px; z-index:100; background:#e0313e; color:#fff; font-size:11px; font-weight:700; padding:4px 10px; border-radius:6px; letter-spacing:1px; pointer-events:none; }

/* Sign-in gate (unlinked full-screen view) */
.gate-view { display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; height:100%; padding:24px 30px; background:var(--bg); }
.gate-wordmark { display:block; object-fit:contain; width:170px; height:60px; margin-bottom:14px; }
.gate-card { width:640px; background:var(--card); border-radius:18px; padding:20px 24px; margin-bottom:16px; }
/* Shift the QR card left so the text column shares the page centre with the wordmark, title and footer:
   (padding 24 + QR 160 + gap 24 + half of the 408 px column) - half of 640 = 92 px. */
.gate-card-qr { position:relative; left:-92px; }
.gate-layout { display:flex; align-items:center; justify-content:center; }
.gate-qr-wrap { flex:0 0 160px; width:160px; height:160px; background:#fff; border-radius:12px; padding:6px; display:flex; align-items:center; justify-content:center; }
.gate-qr-wrap svg { width:100%; height:100%; display:block; }
.gate-info { flex:1; min-width:0; margin-left:24px; text-align:center; }
.gate-step-title { font-size:15px; font-weight:500; margin:0 0 4px; color:var(--ink); white-space:pre-line; }
.gate-code-row { display:flex; flex-direction:column; align-items:center; margin-bottom:8px; }
.gate-code-box { font-size:28px; font-weight:700; color:var(--accent); letter-spacing:3px; background:#111216; padding:8px 16px; border-radius:8px; display:inline-block; }
.gate-code-row .gate-countdown { margin:6px 0 0; font-size:14px; }
.gate-pc-hint { font-size:12px; color:var(--muted); margin:0; line-height:1.35; }
.gate-unavailable { text-align:center; padding:14px 10px; }
.gate-unavailable h3 { font-size:18px; font-weight:500; margin:0 0 8px; color:var(--ink); }
.gate-unavailable p { font-size:13px; color:var(--muted); margin:0; line-height:1.45; }
.gate-unavailable button { margin-top:14px; min-height:42px; padding:0 20px; font-size:14px; }
.gate-unavailable .gate-countdown { margin-top:10px; margin-bottom:0; font-size:12px; color:var(--accent); font-weight:500; }
.gate-unavailable .gate-error-detail { margin-top:8px; font-size:11px; color:var(--accent); font-family:monospace; word-break:break-all; }
.gate-countdown { font-size:12px; color:var(--accent); margin:0 0 8px; font-weight:500; }
.gate-footer { display:flex; justify-content:center; }
.gate-footer button { height:26px; min-height:0; font-size:8.5px; padding:0 9px; border-radius:6px; }
.gate-footer .icon { width:13px; height:13px; flex:0 0 13px; }
.gate-footer button > .icon + span { margin-left:6px; }

/* Waiting screen (unlinked/waiting full-screen view) */
.waiting-view { display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; height:100%; padding:24px 30px; background:var(--bg); }
.waiting-wordmark { display:block; object-fit:contain; width:170px; height:60px; margin-bottom:14px; }
.waiting-error-bar { width:680px; background:rgba(229,62,62,0.12); border:1px solid rgba(229,62,62,0.35); border-radius:12px; padding:10px 18px; margin-bottom:14px; color:#fc8181; font-size:13px; text-align:center; }
.waiting-card { width:680px; background:var(--card); border-radius:18px; padding:20px 24px; margin-bottom:16px; }
.waiting-layout { display:flex; align-items:flex-start; justify-content:space-between; }
.waiting-qr-col { flex:0 0 170px; display:flex; flex-direction:column; align-items:center; text-align:center; }
.waiting-qr-wrap { width:150px; height:150px; background:#fff; border-radius:12px; padding:6px; display:flex; align-items:center; justify-content:center; }
.waiting-qr-wrap svg { width:100%; height:100%; display:block; }
.waiting-qr-hint { font-size:12px; color:var(--muted); margin:10px 0 0; line-height:1.35; text-align:center; }
.waiting-list-col { flex:1; min-width:0; }
.waiting-list-title { font-size:13px; font-weight:500; color:var(--muted); margin:0 0 10px; text-transform:uppercase; letter-spacing:0.5px; }
.waiting-comp-list { display:flex; flex-direction:column; max-height:170px; overflow-y:auto; }
.waiting-no-comp { font-size:13px; color:var(--muted); margin:10px 0; font-style:italic; }
.waiting-comp-item { display:flex; align-items:center; justify-content:space-between; background:#111216; padding:10px 14px; border-radius:10px; }
.waiting-comp-info { flex:1; min-width:0; }
.waiting-comp-name { font-size:14px; font-weight:500; color:var(--ink); margin:0; }
.waiting-comp-platform { font-size:12px; color:var(--muted); margin:2px 0 0; }
.waiting-comp-status { font-size:12px; font-weight:500; padding:4px 8px; border-radius:6px; }
.waiting-comp-status.online { color:var(--green); background:rgba(99,215,151,0.12); }
.waiting-comp-status.offline { color:var(--muted); background:rgba(153,157,168,0.12); }
.waiting-footer { display:flex; justify-content:center; }
.waiting-footer button { height:36px; font-size:13px; padding:0 14px; }

/* Main app shell */
#shell { display:flex; height:100%; padding:30px 30px 24px; background:var(--bg); }
.rail { flex:0 0 175px; padding-right:14px; border-right:1px solid #292b31; display:flex; flex-direction:column; }
.wordmark { display:block; object-fit:contain; width:158px; height:56px; margin-left:2px; margin-bottom:30px; }
nav button { position:relative; width:160px; height:49px; margin-bottom:8px; text-align:left; justify-content:flex-start; padding:0 16px; }
nav button[aria-current="page"] { background:#24272e; }
nav button[aria-current="page"]::before { content:''; position:absolute; left:4px; top:50%; margin-top:-12px; width:4px; height:24px; border-radius:2px; background:var(--accent); }
nav button[aria-current="page"] .icon { color:var(--accent); }
nav button:focus { background:#d34d08; box-shadow:inset 0 0 0 2px var(--ink); }
nav button:focus::before { display:none; }
nav button:focus .icon { color:var(--ink); }
.rail-bottom { margin-top:auto; text-align:center; font-size:12px; color:var(--muted); }
.rail-bottom p { margin:10px 0 0; }
main { flex:1; min-width:0; margin-left:26px; padding:3px 5px 12px 3px; overflow:auto; scrollbar-width:none; }
main::-webkit-scrollbar { display:none; }
h1 { margin:0 0 22px; text-align:center; font-size:30px; font-weight:500; line-height:1.18; }
h1.has-subtitle { margin-bottom:4px; }
.heading-subtitle { margin:0 0 22px; font-size:14px; line-height:1.25; color:var(--muted); text-align:center; }
button { border:0; border-radius:12px; background:var(--button); color:var(--ink); font-weight:500; min-height:40px; padding:0 16px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; line-height:1.2; outline:0; }
button:focus, input:focus, textarea:focus { background:#d34d08; box-shadow:inset 0 0 0 2px var(--ink); outline:0; }
button:active { background:#444852; }
button:disabled { color:#737781; background:#1c1d21; cursor:default; }
button.primary { background:var(--accent); }
button.primary:focus { background:#d34d08; }
button.start { background:#1b8042; }
button.start:focus { background:#249652; }
button.stop { background:#c12733; }
button.stop:focus { background:#e0313e; }
.icon { width:20px; height:20px; flex:0 0 20px; vertical-align:middle; }
button > .icon + span { margin-left:10px; }
.panel { width:540px; margin-left:auto; margin-right:auto; }
.wide { width:640px; }
.row { display:flex; align-items:center; }
.row > .grow { flex:1; min-width:0; }
.row.gap12 > * + * { margin-left:12px; }
.row.gap12 > [hidden] + * { margin-left:0; }
.row.gap18 > * + * { margin-left:18px; }
.actions { margin-bottom:16px; }
.actions button { flex:1 1 0; min-width:0; height:54px; }
/* Start and the HDMI input share the row equally (19 Oct); same type size, one line. */
.actions button#toggle, .actions button.hdmi-source-btn { font-size:15px; padding:0 12px; white-space:nowrap; }
.actions button.hdmi-source-btn:focus { background:#d34d08; }
.connecting-status-line { margin-top:-8px; margin-bottom:12px; text-align:center; }
.home-no-companions { font-size:13px; color:var(--muted); margin:10px 0 0; text-align:center; }
.tv-ready-status { margin:0 auto 16px; padding:16px 18px; border-radius:14px; background:var(--card); font-size:22px; font-weight:600; text-align:center; color:var(--muted); }
.tv-ready-status.ready { color:var(--green); }
.tv-ready-status.translating { color:var(--accent); }
.card { background:var(--card); border-radius:18px; padding:14px 16px; }
.caption { font-size:12px; color:var(--muted); text-align:center; margin:0 0 7px; font-weight:400; }
.status { font-size:13px; color:var(--muted); text-align:center; margin:10px 0 0; line-height:1.3; }
.chips { justify-content:center; margin:14px 0 12px; }
.chip { display:inline-block; border-radius:14px; padding:6px 12px; background:#1e2026; color:var(--muted); font-size:13px; }
.chip + .chip { margin-left:10px; }
.positive { color:var(--green); }
.center { text-align:center; }
.center > button { margin:auto; }
.small { font-size:13px; }
.muted { color:var(--muted); }
.hint { font-size:12px; color:var(--muted); line-height:1.35; margin:10px auto 0; }

/* Subtitle page styles */
.preview-stage { height:110px; display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.preview-game-frame { position:relative; flex-direction:column; height:150px; overflow:hidden;
  background:linear-gradient(180deg, #1b2b4a 0%, #23406b 34%, #3f2b4d 62%, #101826 100%); }
.preview-game-frame::before { content:''; position:absolute; left:8%; right:8%; top:12px; height:44px; border-radius:8px;
  background:linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.04)); border:1px solid rgba(255,255,255,.08); }
.preview-original-line { position:relative; z-index:1; font-size:11px; color:rgba(255,255,255,.85); background:rgba(0,0,0,.45);
  border-radius:6px; padding:2px 10px; margin-bottom:8px; max-width:90%; text-align:center; }
.preview-game-frame .subtitle-panel { position:relative; z-index:2; max-width:92%; }
.subtitle-panel { text-align:center; font-size:20px; font-weight:500; border-radius:12px; padding:8px 18px; color:#fff; background:rgba(16,24,38,.78); }
.subtitle-panel.edge-none { text-shadow:none; }
.subtitle-panel.edge-shadow { text-shadow:0 1px 3px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
.subtitle-panel.edge-outline { -webkit-text-stroke:1px rgba(0,0,0,.9); paint-order:stroke fill; text-shadow:0 1px 2px rgba(0,0,0,.9); }
#subtitle.edge-none { text-shadow:none; }
#subtitle.edge-shadow { text-shadow:0 1px 3px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
#subtitle.edge-outline { -webkit-text-stroke:1px rgba(0,0,0,.9); paint-order:stroke fill; text-shadow:0 1px 2px rgba(0,0,0,.9); }
.mode-section { margin-bottom:14px; }
.mode-buttons button { height:48px; }
.mode-buttons button.selected { box-shadow:inset 0 0 0 2px var(--accent); background:#24272e; }
.mode-buttons button.selected:focus { box-shadow:inset 0 0 0 2px var(--ink); background:#d34d08; }
.stepper button { width:52px; height:46px; }
.stepper output { flex:1; text-align:center; font-weight:500; font-size:15px; }
.stepper-disabled { opacity:.45; }
.edge-section { margin-top:14px; }
.color-row { margin-top:14px; }
.opacity-row { margin-top:14px; }
.color-row button { width:100%; height:48px; }
.swatch { width:18px; height:18px; display:inline-block; border-radius:9px; border:1px solid #777; margin-right:10px; }
.reset { margin-top:14px; }
.reset button { width:234px; height:46px; }

/* Home / Account status styles */
.account-status-card { margin-top:14px; text-align:center; }
.account-info-line { font-size:14px; color:var(--ink); margin-bottom:6px; font-weight:500; }
.account-info-line .license-ok { color:var(--green); }
.account-info-line .license-none { color:var(--red); }
.license-hint { font-size:13px; color:var(--accent); font-weight:500; margin:0 0 6px; }
/* Outlined secondary button (Sign out, 19 Oct): a line frame, no icon. */
button.outline { background:transparent; box-shadow:inset 0 0 0 1.5px #4a4e58; }
button.outline:focus { background:#d34d08; box-shadow:inset 0 0 0 2px var(--ink); }
.companion-status-line { font-size:13px; color:var(--muted); }
.main-buttons-row { margin-top:14px; justify-content:center; }
.main-buttons-row button { height:44px; min-width:140px; font-size:13px; }
.hdmi-control-row { margin-top:12px; text-align:center; }
.hdmi-control-row button { height:38px; font-size:13px; padding:0 14px; }

/* Network Tip Card */
.network-tip-card { margin-top:12px; padding:10px 16px; background:#171a22; border-left:3px solid var(--accent); }
.network-tip-row { display:flex; align-items:center; justify-content:space-between; }
.network-tip-text { font-size:12px; line-height:1.4; color:var(--muted); margin:0; flex:1; padding-right:12px; text-align:left; }
.network-tip-dismiss { height:32px; min-height:32px; font-size:12px; padding:0 12px; flex-shrink:0; }

/* Home companions list */
.home-companions-card { margin-top:4px; }
.home-companions-section { margin-top:4px; text-align:left; }
.home-companions-title { font-size:15px; font-weight:600; color:var(--ink); margin:0 0 8px; text-align:center; }
.home-comp-item { display:flex; align-items:center; justify-content:space-between; padding:6px 10px; border-radius:8px; background:#111216; margin-bottom:6px; }
.home-comp-name { font-size:13px; color:var(--ink); font-weight:500; margin:0; }
.home-comp-platform { font-size:11px; color:var(--muted); margin:1px 0 0; }
.home-comp-info { flex:1; min-width:0; }
.home-comp-actions { display:flex; align-items:center; margin-left:10px; }
.home-comp-actions button { min-height:30px; height:30px; padding:0 10px; font-size:12px; border-radius:8px; }
.home-comp-actions .icon { width:15px; height:15px; flex:0 0 15px; }
.home-comp-actions button > .icon + span { margin-left:6px; }
.home-comp-selected { font-size:12px; font-weight:500; color:var(--accent); padding:0 6px; }
.home-comp-badge { font-size:11px; font-weight:500; padding:2px 8px; border-radius:4px; }
.home-comp-badge.online { color:var(--green); background:rgba(99,215,151,0.12); }
.home-comp-badge.connected { color:var(--accent); background:rgba(242,105,31,0.14); }
.home-comp-badge.connected { color:var(--accent); background:rgba(242,105,31,0.14); }
.home-comp-badge.offline { color:var(--muted); background:rgba(153,157,168,0.12); }

/* Dialog styles */
.tool-row { margin-top:14px; }
.tool-row button { flex:1; height:46px; font-size:13px; }
.field-label { display:block; color:var(--muted); font-size:12px; margin:0 0 5px; text-align:left; }
input, textarea { width:100%; height:44px; background:#111216; color:var(--ink); border:0; border-radius:10px; padding:10px 16px; outline:0; }
input:focus, textarea:focus { background:#111216; box-shadow:inset 0 0 0 2px var(--accent); }
textarea { resize:none; height:84px; }
.field + .field { margin-top:10px; }

.about-logo { display:block; width:224px; height:auto; margin:0 auto 12px; }
.about-tagline { font-size:19px; font-weight:500; margin:0 0 6px; }
.about-meta { font-size:13px; margin:4px 0; }
.about-card { width:580px; margin:10px auto 0; }
.about-card + .about-card { margin-top:8px; }
.about-card button { flex:1; height:46px; font-size:14px; }
.about-disclaimer { width:580px; font-size:11px; line-height:1.35; margin:10px auto; color:var(--muted); }
.support-card-compact { display:flex; flex-direction:row; align-items:center; justify-content:space-between; width:580px; margin:8px auto 0; padding:10px 18px; }
.support-info-col { flex:1; min-width:0; text-align:left; }
.support-info-col .caption { text-align:left; margin:0 0 2px; }
.support-email { font-size:14px; font-weight:500; color:#fff; margin:2px 0 4px; }
.support-info-col .hint { font-size:11px; margin:0; text-align:left; line-height:1.35; color:var(--muted); }
.support-card-compact .support-qr-box { flex-shrink:0; margin:0; }
.support-card-compact .support-qr { width:72px; height:72px; border-radius:8px; background:#fff; padding:3px; display:block; }
.support-qr-box { display:flex; align-items:center; justify-content:center; margin-top:8px; }
.support-qr { width:120px; height:120px; border-radius:10px; background:white; padding:6px; }

#modal-root { position:absolute; top:0; right:0; bottom:0; left:0; background:rgba(0,0,0,.72); display:flex; align-items:center; justify-content:center; z-index:10; }
.dialog { padding:22px; width:570px; max-height:470px; background:#17181c; border-radius:18px; overflow:auto; }
.dialog h2 { font-size:23px; font-weight:500; margin:0 0 14px; }
.dialog p { font-size:14px; line-height:1.5; margin:10px 0; white-space:pre-line; }
.dialog-buttons { display:flex; justify-content:flex-end; margin-top:18px; }
.dialog-buttons button { margin-left:10px; min-height:46px; }
.option { display:flex; width:100%; min-height:48px; margin:6px 0; text-align:left; justify-content:space-between; }
.options { max-height:310px; overflow:auto; }
.option[aria-pressed="true"] { box-shadow:inset 0 0 0 2px var(--accent); }
.option[aria-pressed="true"]:focus { box-shadow:inset 0 0 0 2px var(--ink); }
#toast { position:absolute; z-index:20; bottom:22px; left:210px; right:30px; background:#30333b; border-radius:12px; padding:12px 20px; text-align:center; font-size:14px; }

/* Stage styles */
#stage { position:absolute; left:0; top:0; width:960px; height:540px; transform-origin:0 0; background:transparent; z-index:1; }
#stage.demo { background:#101114; }
.stage-label { position:absolute; top:20px; left:28px; color:rgba(255,255,255,0.7); font-size:12px; font-weight:500; text-transform:uppercase; letter-spacing:0.5px; z-index:10; pointer-events:none; }
.stage-bar { position:absolute; top:24px; left:50%; transform:translateX(-50%); z-index:60; display:flex; background:rgba(23,24,28,0.94); padding:10px 18px; border-radius:14px; box-shadow:0 6px 24px rgba(0,0,0,0.7); }
.stage-bar button { min-height:42px; padding:0 20px; font-size:14px; }
#subtitle { position:absolute; bottom:44px; left:110px; right:110px; font-size:20px; font-weight:500; border-radius:12px; padding:8px 18px; overflow:hidden;
  display:flex; flex-direction:column; justify-content:center; -webkit-line-clamp:3; line-clamp:3; transform:translateZ(0); will-change:opacity; }
.subtitle-text { font-size:inherit; font-weight:inherit; color:inherit; text-align:center; line-height:1.4; white-space:pre-line; overflow-wrap:break-word; word-break:normal;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3; overflow:hidden; overflow:clip; overflow-clip-margin:content-box; max-height:4.2em; }
.choice-layer { position:absolute; top:0; right:0; bottom:0; left:0; pointer-events:none; }
.choice-row { position:absolute; box-sizing:border-box; border-radius:6px; font-weight:500; display:flex; align-items:center; overflow:hidden; }
.choice-row-text { font-size:inherit; color:inherit; text-align:left; line-height:1.04; white-space:pre-line; overflow-wrap:break-word; word-break:normal; }
.choice-row.edge-none { text-shadow:none; }
.choice-row.edge-shadow { text-shadow:0 1px 3px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
.choice-row.edge-outline { -webkit-text-stroke:1px rgba(0,0,0,.9); paint-order:stroke fill; text-shadow:0 1px 2px rgba(0,0,0,.9); }
@keyframes subtitleFade { from { opacity:0; } to { opacity:1; } }
#subtitle.subtitle-fade { animation:subtitleFade 120ms ease; }

/* Transparency for HDMI overlay */
html.hdmi, html.hdmi body, html.hdmi #viewport, html.hdmi #stage, html.hdmi #stage.demo { background:transparent; }
html.hdmi .stage-label { text-shadow:0 1px 4px rgba(0,0,0,.9); }

/* Menu over HDMI (semi-transparent shell over running HDMI picture) */
html.menu-over-hdmi, html.menu-over-hdmi body, html.menu-over-hdmi #viewport { background:transparent !important; }
html.menu-over-hdmi #shell { background:rgba(16,17,20,0.88); position:relative; z-index:20; }
html.menu-over-hdmi .rail { background:rgba(16,17,20,0.88); }

/* Reconnecting & No-signal stage indicators */
.stage-indicator { position:absolute; z-index:50; border-radius:10px; padding:8px 16px; font-size:13px; font-weight:500; }
.stage-reconnecting { top:20px; right:28px; background:rgba(234,88,12,0.9); color:#fff; box-shadow:0 4px 16px rgba(0,0,0,0.6); }
.stage-no-signal { bottom:120px; left:50%; transform:translateX(-50%); background:rgba(30,41,59,0.92); color:#fff; display:flex; align-items:center; box-shadow:0 4px 16px rgba(0,0,0,0.6); }
.stage-no-signal button { min-height:36px; padding:0 14px; font-size:12px; background:var(--accent); color:#fff; border:0; border-radius:8px; cursor:pointer; }


/* Flex gap replacements (Chromium < 84). */
.gate-footer > * + * { margin-left:10px; }
.waiting-layout > * + * { margin-left:24px; }
.waiting-comp-list > * + * { margin-top:8px; }
.waiting-footer > * + * { margin-left:16px; }
.home-comp-actions > * + * { margin-left:8px; }
.support-card-compact > * + * { margin-left:16px; }
.stage-bar > * + * { margin-left:12px; }
.stage-no-signal > * + * { margin-left:12px; }

/* ---------------------- LG additions ---------------------- */
body { background:#000; }
#viewport { z-index:2; }
.video-host { position:absolute; left:0; top:0; width:100%; height:100%; z-index:0; background:#000; }
.hdmi-video { position:absolute; left:0; top:0; width:100vw; height:100vh; object-fit:contain; background:#000; }
html.hdmi #viewport { pointer-events:none; }
html.hdmi #viewport > * { pointer-events:auto; }
html.hdmi body { background:#000; }
.stage-opening { top:20px; left:28px; background:rgba(23,24,28,0.9); color:var(--ink); }

/* Full-screen request (docs/TASK.md §4.8): visible until the page is full screen. */
.fullscreen-hint { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); z-index:40; background:rgba(242,105,31,0.95); color:#fff; font-size:12px; font-weight:600; padding:6px 14px; border-radius:8px; pointer-events:none; white-space:nowrap; }

/* Pairing code under the QR */
.gate-code-label { font-size:11px; color:var(--muted); letter-spacing:1.5px; margin:10px 0 6px; }

/* HDMI dropdown (js/hdmi-select.js) */
.hdmi-select { position:relative; flex:1 1 0; min-width:0; }
.hdmi-select-btn { width:100%; height:54px; font-size:15px; padding:0 14px; white-space:nowrap; justify-content:space-between; }
.hdmi-select-label { overflow:hidden; text-overflow:ellipsis; }
.hdmi-select-caret { margin-left:10px; width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent; border-top:7px solid var(--muted); }
.hdmi-select.open .hdmi-select-caret { border-top:0; border-bottom:7px solid var(--accent); }
.hdmi-select-btn:focus .hdmi-select-caret { border-top-color:var(--ink); }
.hdmi-select.open .hdmi-select-btn:focus .hdmi-select-caret { border-bottom-color:var(--ink); }
.hdmi-select-list { position:absolute; left:0; right:0; top:60px; z-index:30; background:#17181c; border-radius:14px; padding:8px; box-shadow:0 10px 30px rgba(0,0,0,0.75); }
.hdmi-select-title { font-size:11px; color:var(--muted); margin:4px 8px 6px; letter-spacing:0.4px; text-transform:uppercase; }
.hdmi-option { display:flex; width:100%; min-height:42px; justify-content:space-between; text-align:left; background:transparent; border-radius:10px; font-size:15px; }
.hdmi-option + .hdmi-option { margin-top:4px; }
.hdmi-option.selected { color:var(--accent); }
.hdmi-option.selected .hdmi-option-check { width:8px; height:14px; border:solid var(--accent); border-width:0 3px 3px 0; transform:rotate(45deg); margin-right:6px; }
.hdmi-option:focus { color:var(--ink); }
.hdmi-option.selected:focus .hdmi-option-check { border-color:var(--ink); }
.hdmi-status { margin:-6px auto 12px; text-align:center; color:var(--red); font-size:13px; }

/* Problem report */
.about-report { margin-top:10px; }
.about-report button { height:42px; font-size:13px; }
.report-log { text-align:left; white-space:pre-wrap; word-break:break-all; font:10px/1.35 monospace; color:#c8cbd3; background:#0d0e11; border-radius:10px; padding:10px 12px; max-height:300px; overflow:auto; margin:8px 0 0; }
.dialog .report-log { max-height:300px; }
.support-qr svg { width:100%; height:100%; display:block; }
.hdmi-select-title.error { color:var(--red); text-transform:none; font-size:13px; letter-spacing:0; }
html.toast-on .fullscreen-hint { display:none; }

/* ---------------------- LG home (21 Oct redesign) ---------------------- */
#content > .panel, .home-hero { width:640px; margin-left:auto; margin-right:auto; }
.home-hero { display:flex; align-items:center; background:var(--card); border-radius:18px; padding:18px 20px; margin-top:6px; margin-bottom:14px; box-shadow:inset 0 0 0 1px #262930; }
.home-hero.phone.ready, .home-hero.computer.ready { box-shadow:inset 0 0 0 1.5px rgba(99,215,151,0.45); }
.home-hero.translating { box-shadow:inset 0 0 0 1.5px rgba(242,105,31,0.6); }
.home-hero-icon { flex:0 0 56px; width:56px; height:56px; border-radius:28px; background:#24272e; display:flex; align-items:center; justify-content:center; color:var(--muted); }
.home-hero-icon .icon { width:28px; height:28px; flex:0 0 28px; }
.home-hero.ready .home-hero-icon { background:rgba(99,215,151,0.14); color:var(--green); }
.home-hero.translating .home-hero-icon { background:rgba(242,105,31,0.16); color:var(--accent); }
.home-hero-text { flex:1; min-width:0; margin-left:16px; }
.home-hero .tv-ready-status, .home-hero-title { margin:0 0 8px; padding:0; background:none; font-size:22px; font-weight:600; text-align:left; color:var(--ink); line-height:1.2; }
.home-hero .tv-ready-status.ready { color:var(--green); }
.home-hero .tv-ready-status.translating { color:var(--accent); }
.home-hero .tv-ready-status.connecting { color:var(--muted); }
.home-hero-meta { display:flex; flex-wrap:wrap; }
.home-hero-meta > * + * { margin-left:8px; }
.home-chip { display:inline-block; font-size:12px; font-weight:500; padding:4px 10px; border-radius:8px; background:#24272e; color:var(--muted); }
.home-chip.license-ok { color:var(--green); background:rgba(99,215,151,0.12); }
.home-chip.license-none { color:var(--red); background:rgba(244,119,119,0.12); }
.home-chip.device.ready { color:var(--ink); }
.home-chip.device.translating { color:var(--accent); }
.home-hero #toggle { flex:0 0 auto; height:50px; padding:0 22px; margin-left:16px; font-size:15px; }
.home-hero.phone #toggle { display:none; }
.home-license-hint { margin:-6px auto 12px; text-align:center; }

.home-section { margin-bottom:14px; }
.home-section-title { font-size:11px; font-weight:500; color:var(--muted); letter-spacing:0.6px; text-transform:uppercase; margin:0 0 8px 4px; }
.home-section .hdmi-select-btn { height:50px; }
.home-section .hdmi-status { margin:8px 0 0 4px; text-align:left; }
.home-section .hdmi-select { flex:none; }
.home-companions-card { background:var(--card); border-radius:18px; padding:14px 16px; }
.home-companions-card .home-section-title { margin-left:0; }
.home-companions-section { margin-top:0; }
.home-comp-item { padding:8px 10px; margin-bottom:0; border-radius:10px; }
.home-comp-item + .home-comp-item { margin-top:6px; }
.home-comp-dot { flex:0 0 8px; width:8px; height:8px; border-radius:4px; background:#5b5f69; margin-right:12px; }
.home-comp-dot.online { background:var(--green); box-shadow:0 0 0 3px rgba(99,215,151,0.18); }
.home-comp-badge { margin-left:10px; }
.home-no-companions { text-align:left; margin:2px 0 0; }

.home-footer { margin-top:4px; margin-bottom:6px; }
.home-tip { flex:1; min-width:0; margin:0; font-size:11px; line-height:1.4; color:var(--muted); }
.home-tip-dismiss { min-height:28px; height:28px; padding:0 10px; font-size:11px; margin-left:10px; flex:0 0 auto; }
.home-footer .grow { flex:1; }
.home-sign-out { min-height:32px; height:32px; padding:0 14px; font-size:12px; margin-left:12px; flex:0 0 auto; }

/* ---------------------- LG waiting screen (21 Oct redesign) ---------------------- */
.waiting-card { width:700px; }
.waiting-layout { align-items:stretch; }
.waiting-main { flex:1; min-width:0; }
.waiting-pulse { display:flex; align-items:center; margin:0 0 14px; font-size:14px; font-weight:500; color:var(--accent); }
.waiting-pulse-dot { width:10px; height:10px; border-radius:5px; background:var(--accent); margin-right:10px; -webkit-animation:lensorPulse 1.4s ease-in-out infinite; animation:lensorPulse 1.4s ease-in-out infinite; }
@-webkit-keyframes lensorPulse { 0%, 100% { opacity:0.25; } 50% { opacity:1; } }
@keyframes lensorPulse { 0%, 100% { opacity:0.25; } 50% { opacity:1; } }
.waiting-steps { list-style:none; margin:0 0 14px; padding:0; }
.waiting-step { display:flex; align-items:center; }
.waiting-step + .waiting-step { margin-top:10px; }
.waiting-step-num { flex:0 0 26px; width:26px; height:26px; border-radius:13px; background:#24272e; color:var(--ink); font-size:13px; font-weight:600; display:flex; align-items:center; justify-content:center; margin-right:12px; }
.waiting-step-text { font-size:14px; color:var(--ink); line-height:1.3; }
.waiting-devices { border-top:1px solid #292b31; padding-top:12px; }
.waiting-devices .waiting-list-title { font-size:11px; margin:0 0 8px; }
.waiting-devices .waiting-comp-item { padding:7px 12px; }
.waiting-devices .waiting-comp-item + .waiting-comp-item { margin-top:6px; }
.waiting-comp-name { flex:1; min-width:0; margin:0; font-size:13px; font-weight:500; color:var(--ink); }
.waiting-no-comp { font-style:normal; font-size:12px; margin:0; }
.waiting-qr-col { flex:0 0 150px; justify-content:center; border-left:1px solid #292b31; padding-left:24px; }
.waiting-qr-wrap { width:126px; height:126px; }
.waiting-qr-hint { font-size:11px; white-space:pre-line; }
/* Home content sits in the middle of the canvas, not at the top with an empty bottom. */
main.home-centered { display:flex; flex-direction:column; }
/* auto margins centre it but, unlike justify-content:center, never cut the top when it overflows. */
main.home-centered > :first-child { margin-top:auto; }
main.home-centered > :last-child { margin-bottom:auto; }
main.home-centered > * { flex:0 0 auto; }
.waiting-qr-col { flex-basis:160px; }

/* 'transparent' HDMI method (js/hdmi.js): the TV's own picture shows behind the page. */
html.hdmi-transparent, html.hdmi-transparent body, html.hdmi-transparent .video-host { background:transparent !important; }
.hdmi-broadcast { position:absolute; left:0; top:0; width:100vw; height:100vh; }
