/* TV Remote - mobile first. Dark by default, light via [data-theme=light]. */
:root {
  --bg: #0b1020; --bg2: #101730; --panel: #141c33; --panel2: #1a2340; --line: #26314f;
  --key: #1d2744; --key-hi: #2a3760; --ink: #eef1fa; --dim: #98a3c0;
  --accent: #7c5cff; --accent2: #9b82ff; --accent-ink: #fff;
  --ok: #3ddc97; --warn: #f5b84a; --bad: #ff5d6c; --power: #e8303f;
  --ring: #0f1630; --shadow: 0 8px 24px rgba(0,0,0,.35);
  --r: 16px; --topbar: 64px; --status: 40px; --bottom: 62px;
}
:root[data-theme=light] {
  --bg: #eef1f8; --bg2: #e4e9f5; --panel: #ffffff; --panel2: #f4f6fc; --line: #d5dcee;
  --key: #eceff8; --key-hi: #dfe4f3; --ink: #151b30; --dim: #5c6684;
  --accent: #6a47f5; --accent2: #5a38e0; --ring: #dde3f3; --shadow: 0 6px 18px rgba(30,40,90,.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 -apple-system, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif; }
body { min-height: 100dvh; padding-bottom: calc(var(--status) + var(--bottom) + env(safe-area-inset-bottom)); overscroll-behavior-y: contain; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p, ul, dl { margin: 0; }
h2, .t2 { font-size: 15px; font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 28px; height: 28px; } .ic-xl { width: 44px; height: 44px; }
.muted { color: var(--dim); font-size: 13px; }
.center-t { text-align: center; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: var(--topbar);
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand b { display: block; font-size: 17px; }
.brand small { color: var(--dim); font-size: 12px; }
.tabs { display: none; }
.tools { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--dim); }
.icon-btn:hover { background: var(--key); color: var(--ink); }

/* ---------- layout / views (mobile) ---------- */
.layout { padding: 12px 14px; max-width: 520px; margin: 0 auto; }
.right { display: contents; }
.side, .center, .panel-apps, .panel-keyboard, .panel-touchpad { display: none; }
body[data-view=devices] .side { display: block; }
body[data-view=remote] .center { display: block; }
body[data-view=apps] .panel-apps { display: block; }
body[data-view=keyboard] .panel-keyboard { display: block; }
body[data-view=touchpad] .panel-touchpad { display: block; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  background: var(--key); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; transition: transform .06s, background .15s; }
.btn:hover { background: var(--key-hi); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); border-color: transparent; color: var(--accent-ink); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent2); padding: 12px 0; text-decoration: underline; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row > input { flex: 1; min-width: 0; }
.row.two > * { flex: 1; }
input[type=text], input[type=password], select { width: 100%; min-height: 46px; padding: 0 14px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; }
input::placeholder { color: var(--dim); }
label { display: block; color: var(--dim); font-size: 12px; margin: 12px 0 4px; }
.hint { color: var(--dim); font-size: 12.5px; margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.hint .ic { width: 16px; height: 16px; margin-top: 2px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- TV header ---------- */
.tv-head { display: flex; gap: 14px; align-items: center; }
.tv-art { width: 92px; height: 60px; flex: none; border-radius: 6px; border: 3px solid #0a0e1c; position: relative; display: grid; place-items: center;
  background: linear-gradient(135deg, #1b4fd8, #0b7bd6 55%, #173a9c); color: #fff; font-weight: 800; letter-spacing: 1px; font-size: 12px; overflow: hidden; }
.tv-art::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 26px; height: 4px; background: #0a0e1c; transform: translateX(-50%); }
.tv-info { min-width: 0; flex: 1; }
.tv-select { display: flex; gap: 8px; align-items: center; }
.tv-info .tv-title { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-info select { width: auto; min-height: 36px; padding: 0 8px; flex: none; max-width: 44px; background: var(--key); }
.badge { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 4px; padding: 3px 12px 3px 8px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--dim) 18%, transparent); color: var(--dim); border: 1px solid var(--line); }
.badge .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
body[data-state=connected] .badge { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
body[data-state=pairing] .badge, body[data-state=connecting] .badge { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.meta { color: var(--dim); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.meta .ic { width: 16px; height: 16px; }

/* ---------- remote ---------- */
.remote { margin-top: 12px; display: grid; gap: 14px; transition: opacity .2s; }
body:not([data-state=connected]) .remote { opacity: .45; pointer-events: none; }
.key, .rocker button, .dpad button, .tp-scroll button { border: 0; color: var(--ink); }
.key { min-height: 52px; border-radius: 14px; background: var(--key); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; font-weight: 550; padding: 4px; transition: transform .06s, background .12s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.key:hover { background: var(--key-hi); }
.key:active, .key.down { transform: scale(.94); background: var(--key-hi); }
.key.power { background: var(--power); border-color: transparent; color: #fff; }
.r-top { display: grid; grid-template-columns: 1fr repeat(4, 1fr); gap: 8px; }
.r-top .key span { font-size: 11px; text-align: center; line-height: 1.1; }
.r-top .power { grid-row: auto; }

.r-mid { display: grid; gap: 8px; align-items: center; grid-template-columns: 62px repeat(3, 1fr) 62px;
  grid-template-areas: "vol pad pad pad ch" "vol back mute home ch"; }
.a-vol { grid-area: vol; } .a-ch { grid-area: ch; } .a-pad { grid-area: pad; justify-self: center; }
.a-back { grid-area: back; } .a-home { grid-area: home; } .a-mute { grid-area: mute; }
.rocker { display: grid; grid-template-rows: 1fr auto 1fr; align-self: stretch; background: var(--key); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-align: center; }
.rocker button { background: transparent; display: grid; place-items: center; min-height: 56px; touch-action: manipulation; }
.rocker button:active, .rocker button.down { background: var(--key-hi); }
.rocker span { font-size: 12px; color: var(--dim); font-weight: 600; padding: 4px 0; }

.dpad { position: relative; width: min(100%, 220px); aspect-ratio: 1; border-radius: 50%; background: var(--ring); border: 1px solid var(--line);
  box-shadow: inset 0 2px 14px rgba(0,0,0,.35); margin: 4px 0; }
.dpad button { position: absolute; background: transparent; display: grid; place-items: center; border-radius: 50%; width: 32%; height: 28%; touch-action: manipulation; }
.dpad button:active, .dpad button.down { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.dpad .u { top: 3%; left: 34%; } .dpad .d { bottom: 3%; left: 34%; } .dpad .l { left: 3%; top: 36%; } .dpad .r { right: 3%; top: 36%; }
.dpad .ok { left: 31%; top: 31%; width: 38%; height: 38%; background: var(--key); border: 1px solid var(--line); font-weight: 800; font-size: 19px; box-shadow: var(--shadow); }
.dpad .ok:active { background: var(--accent); color: #fff; }

.r-media { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.r-media .key { min-height: 46px; }
.r-nums summary { color: var(--dim); font-size: 13px; padding: 4px 0 10px; cursor: pointer; }
.r-nums-in { display: grid; gap: 10px; }
.nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nums .key { min-height: 46px; font-size: 18px; font-weight: 600; }
.colors { display: flex; gap: 10px; justify-content: center; }
.c { width: 64px; height: 32px; border-radius: 9px; border: 0; }
.c.red { background: #ef3b3b; } .c.green { background: #2fc25b; } .c.yellow { background: #f6c52b; } .c.blue { background: #2f7bf5; }
.c:active { transform: scale(.94); filter: brightness(1.2); }

/* ---------- right column panels ---------- */
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; background: var(--key); border: 1px solid var(--line); border-radius: 14px; min-height: 92px; font-size: 12.5px; font-weight: 550; }
.app:hover { background: var(--key-hi); }
.app i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 17px; color: #fff; }
.app:disabled { opacity: .35; cursor: not-allowed; }
.tp-wrap { display: flex; gap: 10px; }
.tp { flex: 1; min-height: 240px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--bg2); display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--dim); touch-action: none; user-select: none; -webkit-user-select: none; }
.tp.active { border-color: var(--accent2); background: color-mix(in srgb, var(--accent) 10%, var(--bg2)); }
.tp-scroll { display: grid; grid-template-rows: 1fr 1fr; width: 56px; background: var(--key); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tp-scroll button { background: transparent; display: grid; place-items: center; }
.tp-scroll button:active { background: var(--key-hi); }

/* ---------- devices ---------- */
.ph { font-size: 15px; font-weight: 650; margin: 0; }          /* panel headings (kept as <p>, styled like the old h2) */
.side .ph { margin: 18px 4px 10px; }
.tv-list { display: grid; gap: 8px; }
.tv-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.tv-item.on { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2) inset; }
.tv-item .logo { width: 48px; height: 48px; border-radius: 10px; background: var(--key); display: grid; place-items: center; font-weight: 800; font-size: 11px; letter-spacing: .5px; flex: none; }
.tv-item .t { flex: 1; min-width: 0; }
.tv-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-item small { color: var(--dim); display: block; font-size: 12.5px; }
.tv-item .st { color: var(--ok); }
.tv-item .x { background: none; border: 0; color: var(--dim); width: 34px; height: 34px; border-radius: 8px; }
.tv-item .x:hover { color: var(--bad); }
.empty { color: var(--dim); padding: 12px 4px; font-size: 13.5px; }
.quick { list-style: none; padding: 0; display: grid; gap: 2px; }
.quick button { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 12px 6px; border-radius: 10px; color: var(--ink); text-align: left; }
.quick button:hover { background: var(--key); }
.quick .ic { color: var(--dim); }

/* ---------- status bar & bottom nav ---------- */
.statusbar { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom) + env(safe-area-inset-bottom)); height: var(--status); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--bg2); border-top: 1px solid var(--line); font-size: 13px; z-index: 15; }
.statusbar #statusText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.chip .ic { width: 16px; height: 16px; }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.statusbar[data-kind=ok] .sdot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.statusbar[data-kind=wait] .sdot { background: var(--warn); animation: pulse 1.2s infinite; }
.statusbar[data-kind=err] .sdot { background: var(--bad); }
.statusbar[data-kind=err] #statusText { color: var(--bad); }
.hide-s { display: none; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottom) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--line); z-index: 16; }
.bottom button { background: none; border: 0; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; }
.bottom button.on { color: var(--accent2); }

/* ---------- overlay / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(4,7,18,.72); display: grid; place-items: end center; backdrop-filter: blur(4px); }
.sheet { position: relative; width: 100%; max-width: 460px; max-height: 92dvh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px 24px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet .t2 { font-size: 19px; text-align: center; margin-bottom: 14px; }
.close { position: absolute; top: 8px; right: 8px; }
.radar { position: relative; width: 140px; height: 140px; margin: 6px auto 14px; display: grid; place-items: center; color: var(--accent2); }
.radar i { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; animation: ripple 2.4s infinite; }
.radar i:nth-child(2) { animation-delay: 1.2s; }
.steps { list-style: none; padding: 12px; margin: 14px 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.steps li em { margin-left: auto; font-style: normal; color: var(--dim); font-size: 13px; }
.steps li[data-st=done] em { color: var(--ok); } .steps li[data-st=running] em { color: var(--warn); }
.bar { height: 6px; background: var(--bg2); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.found { display: grid; gap: 10px; margin-bottom: 12px; }
.found .tv-item { cursor: pointer; }
.found .tv-item.off { opacity: .75; cursor: default; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid; }
.pill.beta { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.experimental { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.pill.unsupported { color: var(--dim); border-color: var(--line); }
.pair-art { display: grid; place-items: center; margin-bottom: 12px; }
.mini-tv { width: 78%; padding: 14px; background: #10162b; border: 3px solid #05070f; border-radius: 8px; color: #e8ecf8; text-align: center; font-size: 12px; display: grid; gap: 6px; }
.mini-tv span { display: flex; gap: 8px; justify-content: center; } .mini-tv i { font-style: normal; padding: 3px 14px; border-radius: 4px; background: #2a3560; }
.mini-tv i.ok { background: #2f7bf5; }
.big { text-align: center; font-size: 15.5px; margin-bottom: 10px; }
.spinner { width: 44px; height: 44px; margin: 6px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent2); animation: spin 1s linear infinite; }
.tips { margin: 14px 0; padding: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; color: var(--dim); }
.tips ul { margin: 6px 0 0 18px; padding: 0; }
.help dt { font-weight: 650; margin-top: 12px; } .help dd { margin: 2px 0 0; color: var(--dim); font-size: 13.5px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + var(--status) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); z-index: 60; max-width: 92vw;
  background: #05070f; color: #fff; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes ripple { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(1.15); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- tablet / desktop dashboard ---------- */
@media (min-width: 560px) { .overlay { place-items: center; } .sheet { border-radius: 24px; } .hide-s { display: inline-flex; } }
@media (min-width: 1280px) {
  :root { --bottom: 0px; }
  body { padding-bottom: var(--status); }
  .bottom { display: none; }
  .statusbar { bottom: 0; padding: 0 22px; }
  .toast { bottom: calc(var(--status) + 16px); }
  .topbar { padding: 8px 22px; gap: 22px; }
  .tabs { display: flex; gap: 8px; margin: 0 auto; }
  .tabs button { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; background: none; border: 1px solid transparent; color: var(--dim); font-weight: 600; }
  .tabs button:hover { background: var(--key); color: var(--ink); }
  .tabs button.on { background: color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); color: var(--ink); }
  .tools { margin-left: 0; }
  .layout { max-width: 1480px; display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 18px; padding: 18px 22px; align-items: start; }
  .side, .center { display: block !important; }
  .right { display: grid; gap: 14px; }
  .right .card { display: block !important; margin: 0; }
  .side { position: sticky; top: calc(var(--topbar) + 18px); }
  .side .ph { margin-top: 22px; }
  .r-mid { grid-template-columns: 66px 74px 1fr 74px 66px; grid-template-areas: "vol back pad home ch" "mute . . . ."; gap: 10px; }
  .a-back, .a-home { align-self: center; min-height: 64px; }
  .a-mute { min-height: 56px; }
  .r-top .key { min-height: 62px; }
  .dpad { width: min(100%, 250px); }
  .r-media .key { min-height: 52px; }
  body[data-view] .highlight { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 22px; transition: outline-color .6s; }
}

/* =====================================================================
   Mobile design (< 1000px) - matches the six phone screens
   ===================================================================== */
.mhead, .seg { display: none; }
.dpad::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(45deg, transparent calc(50% - .6px), var(--line) 50%, transparent calc(50% + .6px)),
              linear-gradient(-45deg, transparent calc(50% - .6px), var(--line) 50%, transparent calc(50% + .6px)); }
.mic { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line); background: var(--key); color: var(--accent2); display: grid; place-items: center; justify-self: center; }
.mic:active { background: var(--key-hi); }
.txt-wrap { position: relative; flex: 1; }
textarea#txt { width: 100%; min-height: 70px; padding: 12px 40px 12px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; resize: none; font: inherit; color: inherit; }
textarea#txt:focus { border-color: var(--accent2); outline: none; box-shadow: 0 0 0 1px var(--accent2); }
.clear { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: none; color: var(--dim); border-radius: 50%; display: grid; place-items: center; }
.clear .ic { width: 18px; height: 18px; }
.menu { position: fixed; top: 58px; right: 10px; z-index: 50; min-width: 220px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.menu button { background: none; border: 0; text-align: left; padding: 12px 14px; border-radius: 10px; color: var(--ink); }
.menu button:hover { background: var(--key); }
.allow-h { font-weight: 650; text-align: center; font-size: 22px; margin: 4px 0 8px; }
.tip-ic { display: none; }
.steps li .st-ic { margin-left: auto; width: 22px; height: 22px; }

@media (max-width: 1279px) {
  .d-only { display: none !important; }
  :root { --topbar: 60px; --status: 34px; --bottom: 60px; --bg: #080d1c; --panel: #0f1730; }
  :root[data-theme=light] { --bg: #eef1f8; --panel: #fff; }
  body { padding-bottom: calc(var(--status) + var(--bottom) + env(safe-area-inset-bottom) + 6px); }

  /* header: icon + title/sub + gear (idle) or chevron (connected) */
  .topbar { min-height: var(--topbar); padding: 8px 16px; background: var(--bg); border-bottom: 0; }
  .topbar .brand, .topbar .tools { display: none; }
  .mhead { display: flex; align-items: center; gap: 12px; width: 100%; }
  .mlogo { color: #5aa2ff; width: 34px; height: 34px; }
  .mtxt { flex: 1; min-width: 0; }
  .mtxt b { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; }
  .mtxt small { color: var(--dim); font-size: 13px; }
  body[data-state=connected] .mtxt small { color: var(--ink); }
  .mtxt small .ok { color: var(--ok); }
  .seg { display: grid; grid-template-columns: repeat(4, 1fr); margin: 4px 14px 0; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: 492px; }
  .seg button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--dim); font-size: 14px; }
  .seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
  @media (min-width: 560px) { .seg { margin-left: auto; margin-right: auto; width: calc(100% - 28px); } }
  .layout { padding: 10px 14px; }
  .tv-head { display: none; }
  .bottom { grid-template-columns: repeat(6, 1fr); background: var(--bg); }

  /* remote card: one 12-column grid */
  .center .card.remote { margin-top: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .remote { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; align-items: center; }
  .r-top, .r-mid { display: contents; }
  .a-power { grid-column: 1 / span 3; grid-row: 1; min-height: 52px; border-radius: 14px; }
  .a-source { grid-column: 4 / span 4; grid-row: 1; flex-direction: row; gap: 8px; min-height: 52px; font-size: 15px; font-weight: 600; }
  .a-mute { grid-column: 8 / span 3; grid-row: 1; min-height: 52px; }
  .a-more { grid-column: 11 / span 2; grid-row: 1; min-height: 52px; }
  .a-pad { grid-column: 4 / span 6; grid-row: 2; width: 100%; max-width: 210px; }
  .a-back { grid-column: 1 / span 3; grid-row: 2; align-self: end; min-height: 56px; }
  .a-home { grid-column: 10 / span 3; grid-row: 2; align-self: end; min-height: 56px; }
  .a-menu { grid-column: 1 / span 4; grid-row: 3; min-height: 54px; }
  .a-info { grid-column: 5 / span 4; grid-row: 3; min-height: 54px; }
  .a-exit { grid-column: 9 / span 4; grid-row: 3; min-height: 54px; }
  .a-vol { grid-column: 1 / span 4; grid-row: 4; height: 118px; }
  .a-mic { grid-column: 5 / span 4; grid-row: 4; }
  .a-ch { grid-column: 9 / span 4; grid-row: 4; height: 118px; }
  .r-media { grid-column: 1 / -1; grid-row: 5; grid-template-columns: repeat(4, 1fr); }
  .r-media .key { min-height: 50px; }
  .r-nums { display: none; }
  .rocker { border-radius: 16px; }
  .rocker button { min-height: 0; }
  .key.power { background: var(--power); }

  /* full-screen stages */
  .overlay { display: block; background: var(--bg); backdrop-filter: none; }
  .sheet { max-width: none; width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; background: var(--bg); padding: max(14px, env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); }
  .close { top: max(12px, env(safe-area-inset-top)); right: 14px; }
  .s-top { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
  .s-top .ic { color: #5aa2ff; width: 34px; height: 34px; }
  .s-top b { display: block; font-size: 19px; } .s-top small { color: var(--dim); font-size: 13px; }
  #st-scan, #st-found { display: flex; flex-direction: column; min-height: calc(100dvh - 40px); }
  #st-scan[hidden], #st-found[hidden], #st-pair[hidden] { display: none; }
  #st-scan > .t2 { font-size: 26px; margin-top: 4px; }
  .radar { width: 210px; height: 210px; margin: 14px auto 18px; color: #5ad6c8; }
  .radar i { border-color: #1fb7a6; }
  .radar::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(#0d3b3b, #0a2a2e); border: 1px solid #1fb7a6; }
  .radar .ic { position: relative; width: 50px; height: 50px; }
  .steps { margin-top: 18px; background: var(--panel); }
  .steps li { padding: 4px 2px; }
  .steps li[data-st=done] em { font-size: 0; } .steps li[data-st=done] em::before { content: "✓"; font-size: 20px; color: var(--ok); }
  .steps li[data-st=running] em { font-size: 0; } .steps li[data-st=running] em::before { content: ""; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--dim); border-top-color: var(--accent2); border-radius: 50%; animation: spin 1s linear infinite; }
  .bar { height: 8px; margin: 8px 0 auto; }
  #st-scan .hint { margin-top: 18px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; align-items: center; font-size: 14px; color: var(--ink); }
  #st-scan .hint .ic { width: 28px; height: 28px; color: var(--accent2); }
  #st-found > .t2 { text-align: left; font-size: 20px; margin: 6px 2px 14px; }
  #st-found .found { flex: 1; align-content: start; }
  #st-found .row.two { margin-top: auto; padding-top: 10px; }
  .found .tv-item { position: relative; display: grid; grid-template-columns: 76px 1fr 22px; grid-template-areas: "logo name chev" "logo meta chev" "logo ip pill"; align-items: center; gap: 2px 14px; padding: 14px; border-radius: 16px; background: var(--panel); }
  .found .tv-item:first-child:not(.off) { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2) inset; }
  .found .tv-item .logo { grid-area: logo; width: 76px; height: 62px; border-radius: 8px; font-size: 12px; background: #0a2a5a; color: #fff; }
  .found .tv-item .t { display: contents; }
  .found .tv-item b { grid-area: name; font-size: 17px; }
  .found .tv-item small:nth-of-type(1) { grid-area: meta; }
  .found .tv-item small:nth-of-type(2) { grid-area: ip; font-size: 16px; color: var(--ink); }
  .found .tv-item small:nth-of-type(3) { grid-column: 2 / 4; }
  .found .tv-item .pill { grid-area: pill; justify-self: end; }
  .found .tv-item:not(.off)::after { content: ""; grid-area: chev; width: 10px; height: 10px; border-top: 2px solid var(--dim); border-right: 2px solid var(--dim); transform: rotate(45deg); justify-self: end; }
  .found .tv-item[data-brand=samsung] .logo { background: #12307a; } .found .tv-item[data-brand=lg] .logo { background: #fff; color: #a50034; } .found .tv-item[data-brand=roku] .logo { background: #6c2bd9; }
  #st-found .row .btn { min-height: 50px; }
  /* pairing */
  .s-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
  .s-bar .t2 { flex: 1; text-align: center; margin: 0 44px 0 0; font-size: 19px; }
  .pair-art .mini-tv { width: 100%; padding: 36px 18px 22px; background: #0a0f20; border-radius: 6px; }
  .mini-tv b { font-size: 16px; } .mini-tv small { font-size: 12px; } .mini-tv i { padding: 5px 20px; }
  .spinner { width: 64px; height: 64px; border: 3px solid var(--accent); border-color: var(--accent) var(--accent) var(--accent) transparent; margin: 18px auto 8px; }
  .big { color: var(--dim); font-size: 15px; padding: 0 10px; }
  .wait { margin-bottom: 12px; color: var(--ink); }
  .tips { display: grid; grid-template-columns: 24px 1fr; gap: 4px 10px; background: var(--panel); border-radius: 16px; padding: 14px; }
  .tip-ic { display: block; grid-row: 1 / span 2; color: var(--accent2); }
  .tips ul { grid-column: 2; }
  #pairCancel { background: none; border: 0; color: var(--dim); }

  /* apps */
  .panel-apps.card, .panel-keyboard.card, .panel-touchpad.card { background: none; border: 0; box-shadow: none; padding: 0; }
  .card-h .ph { font-size: 18px; }
  .apps { gap: 12px; }
  .app { min-height: 108px; padding: 16px 6px 12px; border-radius: 14px; background: var(--panel); font-size: 13px; gap: 10px; justify-content: center; }
  .app i { width: auto; height: 44px; background: none !important; font-size: 34px; }
  .app i.box { width: 52px; height: 36px; border-radius: 10px; font-size: 20px; color: #fff; }
  .all-apps { margin-top: 14px; justify-content: space-between; padding: 0 18px; min-height: 50px; background: var(--panel); }
  #appsNote { display: none; }

  /* keyboard */
  .panel-keyboard .txt-row { flex-direction: column; margin-top: 0; }
  .panel-keyboard #sendTxt { width: 100%; min-height: 52px; font-size: 16px; }
  .panel-keyboard .row.two .btn { min-height: 50px; background: var(--panel); }
  .panel-keyboard .hint { display: none; }
  .osk { margin: 12px -4px 0; padding: 10px 4px; background: var(--panel); border-radius: 14px; display: grid; gap: 10px; user-select: none; -webkit-user-select: none; }
  .osk-r { display: flex; justify-content: center; gap: 6px; }
  .osk button { flex: 1; max-width: 38px; height: 44px; border: 0; border-radius: 7px; background: var(--key); color: var(--ink); font-size: 18px; padding: 0; }
  .osk button:active { background: var(--key-hi); }
  .osk button.w { max-width: 50px; flex: 1.4; background: var(--panel2); font-size: 15px; }
  .osk button.sp { max-width: none; flex: 5; font-size: 15px; }
  .osk button.on { background: var(--accent); color: #fff; }
  .tp { min-height: 300px; }
  .toast { bottom: calc(var(--bottom) + var(--status) + 14px + env(safe-area-inset-bottom)); }
  .statusbar .chip { display: none; }
}
@media (min-width: 1280px) { .m-only { display: none !important; } }
@media (max-width: 1279px) {
  #st-scan > * { order: 5; }
  #st-scan > .s-top { order: 0; } #st-scan > .radar { order: 1; } #st-scan > .t2 { order: 2; text-align: center; margin: 0 0 6px; }
  #st-scan > .center-t { order: 3; } #st-scan > .steps { order: 4; } #st-scan > .bar { order: 5; } #st-scan > .hint { order: 6; }
  #st-scan > .t2 { font-size: 28px; }
}
@media (max-width:1279px){#st-found .row .btn{white-space:nowrap;padding:0 8px;font-size:14px}}

/* ---------- rename buttons ---------- */
.icon-btn.sm { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.tv-item .acts { display: flex; flex: none; }
.tv-item .x:hover { background: var(--key); color: var(--ink); }
.tv-item .x[data-forget]:hover { color: var(--bad); }
.mhead #mEdit { width: 38px; height: 38px; flex: none; }

/* ---------- responsive ---------- */
/* big phones / small tablets: same phone UI, centred and a little larger */
@media (min-width: 700px) and (max-width: 1279px) {
  .layout { max-width: 600px; }
  .seg, .bottom { max-width: 600px; }
  .bottom { left: 50%; transform: translateX(-50%); width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .a-pad { max-width: 250px; } .a-vol, .a-ch { height: 132px; }
  .key { min-height: 58px; } .a-power, .a-source, .a-mute, .a-more { min-height: 58px; }
  .apps { gap: 16px; } .app { min-height: 128px; }
}
/* compact phones (iPhone SE / mini, small Android) */
@media (max-width: 1279px) and (max-height: 720px) {
  .a-pad { max-width: 170px; } .a-vol, .a-ch { height: 96px; } .mic { width: 52px; height: 52px; }
  .a-power, .a-source, .a-mute, .a-more { min-height: 44px; } .a-back, .a-home { min-height: 48px; }
  .a-menu, .a-info, .a-exit { min-height: 46px; } .r-media .key { min-height: 44px; }
  .remote { gap: 8px; } .seg button { height: 32px; } :root { --bottom: 54px; --status: 30px; }
  .osk button { height: 38px; } textarea#txt { min-height: 56px; }
}
@media (max-width: 359px) {
  .layout { padding: 8px 10px; } .seg { margin: 4px 10px 0; } .mtxt b { font-size: 17px; }
  .key span { font-size: 11px; } .osk-r { gap: 4px; } .osk button { font-size: 16px; }
  .found .tv-item { grid-template-columns: 56px 1fr 18px; gap: 2px 10px; padding: 12px; } .found .tv-item .logo { width: 56px; height: 50px; font-size: 10px; }
  .apps { gap: 8px; } .app { font-size: 12px; }
}
/* phones held sideways: remote on the left, extra panels scroll on the right */
@media (max-width: 1279px) and (orientation: landscape) and (max-height: 520px) {
  :root { --topbar: 48px; --bottom: 0px; --status: 28px; }
  .bottom { display: none; }
  .topbar { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
  .mtxt small { display: none; }
  .seg { margin-top: 2px; }
  .layout { max-width: 760px; }
  .remote { grid-template-columns: repeat(12, 1fr); }
  .a-pad { max-width: 150px; } .a-vol, .a-ch { height: 84px; } .mic { width: 46px; height: 46px; }
  .a-power, .a-source, .a-mute, .a-more, .a-menu, .a-info, .a-exit, .a-back, .a-home, .r-media .key { min-height: 40px; }
  .sheet { height: auto; max-height: 100dvh; }
  #st-scan, #st-found { min-height: 0; }
  .radar { width: 110px; height: 110px; margin: 4px auto; }
}
/* dashboard: keep things from overflowing right above the breakpoint */
@media (min-width: 1280px) and (max-width: 1440px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr) 340px; gap: 14px; padding: 16px; }
  .tabs button { padding: 0 14px; }
}
@media (min-width: 1280px) { .tv-item .x { opacity: .5; } .tv-item:hover .x { opacity: 1; } }
@media (max-width: 1279px) { .mtxt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; } }
@media (max-width: 1279px) and (max-height: 640px) and (orientation: portrait) {
  .seg { display: none; }            /* the bottom bar already has the same four tabs */
  .a-pad { max-width: 150px; } .a-vol, .a-ch { height: 84px; } .mic { width: 46px; height: 46px; }
  .a-power, .a-source, .a-mute, .a-more { min-height: 40px; } .a-back, .a-home { min-height: 42px; }
  .a-menu, .a-info, .a-exit, .r-media .key { min-height: 40px; } .remote { gap: 6px; } .layout { padding-top: 6px; }
}
@media (min-width: 700px) and (max-width: 1279px) { .mhead { max-width: 600px; margin: 0 auto; } }

/* ================= content: hero, guide, footer (SEO sections) ================= */
main#content { display: block; }
.hero, .guide, .site-footer > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
.hero { padding: 14px 16px 2px; max-width: 560px; }
.hero h1 { font-size: 21px; line-height: 1.25; margin: 0 0 6px; font-weight: 750; letter-spacing: -.1px; }
.hero-lead { color: var(--dim); font-size: 14px; margin: 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 6px; padding: 0; font-size: 12.5px; color: var(--dim); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--dim); }
details.more > summary { list-style: none; cursor: pointer; color: var(--accent2); font-size: 14px; font-weight: 600; padding: 6px 0; display: inline-block; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .r-less, details.more[open] .r-more { display: none; }
details.more[open] .r-less { display: inline; }
.more-body { color: var(--dim); font-size: 14px; line-height: 1.6; }
.more-body p { margin: 0 0 10px; }
.more-body b { color: var(--ink); }
.guide { padding: 28px 16px 8px; max-width: 900px; line-height: 1.65; }
.guide h2 { font-size: 22px; margin: 30px 0 10px; line-height: 1.3; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 17px; margin: 22px 0 8px; }
.guide p, .guide li { color: var(--dim); font-size: 15px; }
.guide li b, .guide p b, .guide td b { color: var(--ink); }
.guide ol, .guide ul { padding-left: 22px; margin: 8px 0; }
.guide code { background: var(--key); padding: 1px 6px; border-radius: 6px; font-size: 13px; color: var(--ink); }
.guide a { color: var(--accent2); }
.plat { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.plat th, .plat td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.plat th { color: var(--ink); white-space: nowrap; }
.brand-grid { list-style: none; padding: 0 !important; margin: 14px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.brand-grid a { display: block; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.brand-grid a:hover { border-color: var(--accent2); background: var(--key); }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 0 14px; }
.faq summary { cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--ink); font-size: 15px; }
.faq details p { margin: 0 0 14px; }
.site-footer { margin-top: 36px; padding: 28px 16px 24px; background: var(--bg2); border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.site-footer .t2 { font-size: 15px; margin: 0 0 10px; }
.site-footer p, .site-footer li, .site-footer address { color: var(--dim); font-size: 14px; font-style: normal; line-height: 1.6; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-note { margin: 0; font-size: 13px; }
.legal { margin-top: 22px !important; font-size: 12.5px !important; }
@media (min-width: 700px) { .hero { padding-left: 0; padding-right: 0; } }
@media (min-width: 1280px) {
  .hero { max-width: 1480px; padding: 18px 22px 0; } .hero h1 { font-size: 28px; } .hero-lead, .more-body { max-width: 820px; }
  .guide { padding: 36px 22px 8px; max-width: 1480px; } .guide > * { max-width: 900px; } .guide > .brand-grid { max-width: none; }
  .site-footer { padding: 36px 22px 28px; }
}
@media (min-width: 700px) and (max-width: 1279px) { .hero { max-width: 600px; } .guide { max-width: 640px; } .site-footer > * { max-width: 640px; } }
@media (max-width: 1279px) { .guide, .site-footer { padding-left: 16px; padding-right: 16px; } }

/* bottom bar: full width so it lines up with the status bar on tablets */
@media (min-width: 700px) and (max-width: 1279px) {
  .bottom { left: 0; transform: none; max-width: none; width: 100%; border-left: 0; border-right: 0; }
  .bottom button { max-width: 150px; justify-self: center; width: 100%; }
}

/* ---------- feedback modal (native <dialog>, top layer) ---------- */
.linklike { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--ink); text-decoration: underline; }
.fb-open { margin-top: 10px; }
.fb-dialog { width: min(92vw, 520px); max-height: min(90dvh, 640px); padding: 0; border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.5); overscroll-behavior: contain; overflow: auto;
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .2s, transform .2s, overlay .2s allow-discrete, display .2s allow-discrete; }
.fb-dialog[open] { opacity: 1; transform: none; }
@starting-style { .fb-dialog[open] { opacity: 0; transform: translateY(14px) scale(.98); } }
.fb-dialog::backdrop { background: rgba(4, 7, 18, .7); backdrop-filter: blur(3px); transition: opacity .2s, overlay .2s allow-discrete, display .2s allow-discrete; opacity: 0; }
.fb-dialog[open]::backdrop { opacity: 1; }
@starting-style { .fb-dialog[open]::backdrop { opacity: 0; } }
body:has(dialog[open]) { overflow: hidden; }
.fb-dialog form { display: grid; gap: 12px; padding: 18px; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-h .t2 { margin: 0; font-size: 18px; }
.fb-dialog label { margin: 0; font-size: 13px; color: var(--dim); display: grid; gap: 5px; }
.fb-dialog input, .fb-dialog select, .fb-dialog textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); }
.fb-dialog textarea { resize: vertical; min-height: 110px; }
.dlg-f { display: flex; gap: 10px; justify-content: flex-end; }
.dlg-f .btn { min-width: 110px; }
.fb-dialog .fb-note { margin: 0; }
@media (max-width: 560px) {
  .fb-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; transform: translateY(40px); }
  .dlg-f .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .fb-dialog, .fb-dialog::backdrop { transition: none; } }

/* FAQ: question text is an <h3> inside <summary>, styled exactly like the old summary text */
.faq summary h3 { display: inline; margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; }

/* ---------- tooltips (data-tip): hover, keyboard focus, and a one-time hint on phones ---------- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; z-index: 30; padding: 6px 10px; border-radius: 8px; background: #05070f; color: #fff;
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.bottom [data-tip]::after { bottom: calc(100% + 6px); right: 4px; transform: translateY(4px); }
.tabs [data-tip]::after { top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px); }
[data-tip]:focus-visible::after, [data-tip].tip-show::after { opacity: 1; }
.bottom [data-tip]:focus-visible::after, .bottom [data-tip].tip-show::after { transform: none; }
.tabs [data-tip]:focus-visible::after { transform: translate(-50%, 0); }
@media (hover: hover) {
  [data-tip]:hover::after { opacity: 1; }
  .bottom [data-tip]:hover::after { transform: none; } .tabs [data-tip]:hover::after { transform: translate(-50%, 0); }
}
#scanTab.tip-show svg { animation: pulse 1s 3; }
@media (max-width: 359px) { .bottom button { font-size: 10.5px; } }

/* ---------- desktop: centre the content column ---------- */
@media (min-width: 1280px) {
  .guide, .reviews { max-width: 940px; margin-left: auto; margin-right: auto; padding-left: 22px; padding-right: 22px; }
  .guide > *, .guide > .brand-grid { max-width: none; }
  .site-footer > * { max-width: 1100px; }
}
/* ---------- reviews ---------- */
.reviews { max-width: 940px; margin: 0 auto; padding: 8px 22px 8px; line-height: 1.6; }
@media (max-width: 1279px) { .reviews { padding-left: 16px; padding-right: 16px; } }
.reviews h2 { font-size: 22px; margin: 30px 0 12px; line-height: 1.3; }
.rv-sum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rv-score { font-size: 34px; font-weight: 750; line-height: 1; }
.rv-count, .rv-note, .rv-empty, .rv-list time { color: var(--dim); font-size: 13.5px; }
.stars { --p: 0%; display: inline-block; font-size: 20px; letter-spacing: 2px; line-height: 1; position: relative; color: var(--line); }
.stars > span { background: linear-gradient(90deg, #f5b84a var(--p), var(--line) var(--p)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rv-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.rv-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rv-list p { margin: 6px 0 0; color: var(--dim); font-size: 14.5px; }
.rv-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .rv-h .stars { font-size: 15px; } .rv-h time { margin-left: auto; }
.rv-note { margin: 10px 0 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stars-in { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; border: 0; padding: 0; margin: 0; position: relative; }
.stars-in { margin-top: 22px; }
.stars-in legend { position: absolute; top: -22px; left: 0; padding: 0; color: var(--dim); font-size: 13px; }
.stars-in input { position: absolute; opacity: 0; pointer-events: none; }
.stars-in label { font-size: 34px; line-height: 1; color: var(--line); cursor: pointer; margin: 0; display: block; padding: 0 2px; }
.stars-in input:checked ~ label, .stars-in label:hover, .stars-in label:hover ~ label { color: #f5b84a; }
.stars-in input:focus-visible + label { outline: 2px solid var(--accent2); border-radius: 6px; }
@media (min-width: 700px) and (max-width: 1279px) { .reviews { max-width: 640px; } }

/* ---------- review cards ---------- */
.rv-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; }
.rv-list:not(.all) .rv-extra { display: none; }
.rv-card .rv-h b { font-weight: 650; }
.badge-sample { margin-left: auto; font-size: 11px; font-weight: 650; letter-spacing: .3px; text-transform: uppercase; color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); padding: 1px 8px; border-radius: 99px; }
.rv-more { margin: 0 0 14px; }

/* ---------- no-JavaScript support ---------- */
.nojs { display: none; max-width: 900px; margin: 14px auto; padding: 12px 16px; border: 1px solid var(--warn); border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, var(--panel)); font-size: 14.5px; }
/* details are open in the HTML; with JS they start collapsed (app.js adds .ready) - no flash of open content */
.js details[data-collapse]:not(.ready) > :not(summary) { display: none; }
