/* ZlefRemote — phone remote. Full-viewport touch app on da.zlef.fr tokens. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* a class that sets `display` beats the UA [hidden] rule — force it everywhere
   so toggling the `hidden` attribute always works (topbar/stage/tabs/views). */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body {
  background: var(--zl-bg); color: var(--zl-text); font-family: var(--zl-font);
  display: flex; flex-direction: column; user-select: none; -webkit-user-select: none;
  touch-action: none; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font-family: inherit; color: inherit; cursor: pointer; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--zl-line); background: var(--zl-surface-1); flex: 0 0 auto;
}
.status { display: flex; align-items: center; gap: 9px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--zl-text-muted); box-shadow: 0 0 0 0 rgba(0,0,0,0); transition: background .3s; }
.dot.ok { background: var(--zl-olive-soft); box-shadow: 0 0 12px var(--zl-accent-glow); }
.dot.warn { background: #d8a13a; animation: pulse 1.2s ease-in-out infinite; }
.dot.bad { background: var(--zl-grape-soft); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.st-label { font-size: 14px; color: var(--zl-text-soft); font-weight: 600; }
.host { margin-left: auto; font-size: 13px; color: var(--zl-text-muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { background: var(--zl-surface-2); border: 1px solid var(--zl-line); border-radius: var(--zl-radius-md); width: 38px; height: 38px; font-size: 18px; display: grid; place-items: center; }
.iconbtn:active { transform: translateY(1px); }

/* stage holds views */
.stage { flex: 1 1 auto; position: relative; display: flex; min-height: 0; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view[hidden] { display: none; }
.view-enter { animation: view-enter .26s var(--zl-ease, cubic-bezier(.22,.61,.36,1)) both; }
@keyframes view-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet[hidden], .overlay[hidden] { display: none; }

/* trackpad */
.view-pad { padding: 14px; gap: 12px; }
.pad-area { flex: 1; display: flex; gap: 10px; min-height: 0; }
.pad {
  flex: 1; border-radius: var(--zl-radius-xl); position: relative; overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(157,174,80,.09), transparent 58%),
    radial-gradient(rgba(233,234,226,.045) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--zl-surface-1);
  border: 1px solid var(--zl-line-strong);
  display: grid; place-items: center; touch-action: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 0 60px rgba(0,0,0,.35);
  transition: border-color .18s, box-shadow .18s;
}
.pad:active { border-color: var(--zl-line-focus); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 0 60px rgba(0,0,0,.2), 0 0 0 1px rgba(157,174,80,.12); }
.pad-hint { color: var(--zl-text-muted); font-size: 13.5px; text-align: center; padding: 0 30px; line-height: 1.55;
  pointer-events: none; transition: opacity .35s, transform .35s; }
.pad-hint.hide { opacity: 0; transform: scale(.96); }

/* live touch feedback layer */
.pad-fx { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.pad-glow { position: absolute; left: 0; top: 0; width: 74px; height: 74px; margin: -37px 0 0 -37px;
  border-radius: 50%; opacity: .001; will-change: transform, opacity;
  background: radial-gradient(circle, rgba(157,174,80,.34), rgba(157,174,80,.10) 45%, transparent 70%);
  transition: opacity .16s ease, width .16s ease, height .16s ease, margin .16s ease; }
.pad-glow.grab { width: 92px; height: 92px; margin: -46px 0 0 -46px;
  background: radial-gradient(circle, rgba(176,149,179,.40), rgba(176,149,179,.12) 45%, transparent 70%); }
.pad-fx .pad-glow { opacity: 1; }            /* visible while attached, unless gone */
.pad-glow.gone { opacity: .001 !important; }
.pad-ripple { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid var(--zl-accent-soft); box-shadow: 0 0 10px var(--zl-accent-glow); pointer-events: none;
  animation: pad-ripple .5s var(--zl-ease, cubic-bezier(.22,.61,.36,1)) forwards; }
.pad-ripple.right { border-color: var(--zl-grape-soft); box-shadow: 0 0 10px rgba(176,149,179,.4); }
@keyframes pad-ripple { from { transform: scale(.35); opacity: .95; } to { transform: scale(3.6); opacity: 0; } }

/* single-finger scroll rail */
.scrollrail { flex: 0 0 46px; border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line-strong);
  background: linear-gradient(180deg, var(--zl-surface-2), var(--zl-surface-1));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 12px 0; touch-action: none; position: relative; transition: border-color .15s, background .15s; }
.scrollrail.active { border-color: var(--zl-line-focus); background: linear-gradient(180deg, var(--zl-surface-3), var(--zl-surface-2)); }
.rail-ch { color: var(--zl-text-muted); font-size: 15px; line-height: 1; pointer-events: none; }
.scrollrail.active .rail-ch { color: var(--zl-accent-soft); }
.rail-grip { flex: 1; align-self: stretch; margin: 10px 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--zl-line-strong) 0 2px, transparent 2px 9px);
  -webkit-mask: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
          mask: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent); opacity: .6; }
.scrollrail.active .rail-grip { opacity: .9; }

.mousebar { display: grid; grid-template-columns: 2.2fr 1fr 2.2fr 1.8fr; gap: 10px; flex: 0 0 auto; }
.mbtn {
  min-height: 56px; border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-2); font-size: 14px; font-weight: 700; color: var(--zl-text-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .12s, transform .05s, border-color .12s, box-shadow .15s;
}
.mbtn:active { background: var(--zl-surface-3); transform: translateY(1px); }
.mbtn.primary { color: var(--zl-text); border-color: rgba(157,174,80,.28); background: linear-gradient(180deg, var(--zl-surface-2), rgba(157,174,80,.05)); }
.mbtn.primary:active { background: var(--zl-accent); color: var(--zl-on-accent); border-color: var(--zl-olive-soft); }
.mbtn.mid { font-size: 12.5px; }
.mbtn.lock { color: var(--zl-accent-soft); border-color: rgba(157,174,80,.3); }
.mbtn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .55; transition: opacity .15s, box-shadow .15s; }
.mbtn.lock.active { background: var(--zl-accent); color: var(--zl-on-accent); border-color: var(--zl-olive-soft); box-shadow: 0 0 16px rgba(157,174,80,.3); }
.mbtn.lock.active .mbtn-dot { opacity: 1; box-shadow: 0 0 8px rgba(255,255,255,.6); }

/* keyboard */
.view-keys { padding: 14px; gap: 12px; overflow-y: auto; }
.typerwrap { position: relative; }
.typer {
  width: 100%; min-height: 84px; resize: none; font-size: 17px; padding: 14px;
  background: var(--zl-surface-2); color: var(--zl-text); border: 1px solid var(--zl-line-strong);
  border-radius: var(--zl-radius-lg); line-height: 1.4; display: block;
}
.typer:focus { outline: none; border-color: var(--zl-line-focus); }
.typerwrap.echoing .typer { caret-color: transparent; }
.typerwrap.echoing .typer::placeholder { color: transparent; }

/* live echo of what's being typed — chars pop in, each batch fades out */
.typer-echo {
  position: absolute; inset: 0; padding: 0 16px; border-radius: var(--zl-radius-lg);
  display: flex; align-items: center; gap: 2px; overflow: hidden; pointer-events: none;
}
.tbatch { display: inline-flex; gap: 2px; transition: opacity .4s ease, transform .4s ease, filter .4s ease; }
.tbatch.out { opacity: 0; transform: translateY(-10px) scale(.94); filter: blur(3px); }
.tch {
  font-family: var(--zl-font-mono, ui-monospace, monospace); font-size: 26px; font-weight: 700;
  color: var(--zl-text); text-shadow: 0 0 14px var(--zl-accent-glow);
  animation: tch-in .16s var(--zl-ease, cubic-bezier(.22,.61,.36,1)) both;
}
.tch.ctl { color: var(--zl-accent-soft); }
.tch.del { color: var(--zl-grape-soft); text-shadow: 0 0 14px rgba(176,149,179,.4); }
@keyframes tch-in { from { opacity: 0; transform: translateY(9px) scale(1.25); } to { opacity: 1; transform: none; } }
.modrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.modkey {
  min-height: 48px; border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-2); font-weight: 700; font-size: 14px; color: var(--zl-text-soft);
}
.modkey.active { background: var(--zl-accent2); color: var(--zl-on-accent); border-color: var(--zl-grape-soft); box-shadow: 0 0 12px rgba(176,149,179,.25); }
.speckeys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.speckey {
  min-height: 52px; border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line);
  background: var(--zl-surface-1); font-size: 15px; font-weight: 600; color: var(--zl-text);
  transition: background .12s, transform .05s, border-color .12s;
}
.speckey:active { background: var(--zl-surface-3); transform: translateY(1px); border-color: var(--zl-line-focus); }

/* directional d-pad */
.dpad {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 9px; width: min(220px, 68vw); aspect-ratio: 3 / 2; margin: 6px auto 2px;
}
.dkey {
  border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line-strong);
  background: radial-gradient(120% 120% at 50% 0%, rgba(157,174,80,.06), var(--zl-surface-2));
  color: var(--zl-accent-soft); font-size: 22px; line-height: 1; display: grid; place-items: center;
  transition: background .12s, transform .05s, box-shadow .15s, border-color .12s;
}
.dkey:active { background: var(--zl-accent); color: var(--zl-on-accent); border-color: var(--zl-olive-soft);
  box-shadow: 0 0 16px rgba(157,174,80,.32); transform: translateY(1px); }
.dkey.up { grid-column: 2; grid-row: 1; }
.dkey.left { grid-column: 1; grid-row: 2; }
.dkey.down { grid-column: 2; grid-row: 2; }
.dkey.right { grid-column: 3; grid-row: 2; }

/* media — remote layout: volume row, then transport row with a big play */
.view-media { padding: 16px; justify-content: center; }
.mediagrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.mediakey {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  min-height: 104px; border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-1); color: var(--zl-text);
  transition: background .12s, transform .05s, border-color .12s, box-shadow .15s;
}
.mediakey:active { background: var(--zl-surface-3); transform: translateY(1px); border-color: var(--zl-line-focus); }
.mediakey.primary {
  border-color: rgba(157,174,80,.35);
  background: radial-gradient(130% 120% at 50% 0%, rgba(157,174,80,.14), var(--zl-surface-1));
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
}
.mediakey.primary .mk-ic { color: var(--zl-accent-soft); } .mediakey.primary .mk-ic svg { width: 40px; height: 40px; }
.mediakey.primary:active { background: var(--zl-accent); border-color: var(--zl-olive-soft); }
.mediakey.primary:active .mk-ic, .mediakey.primary:active .mk-l { color: var(--zl-on-accent); }
.mk-ic { display: inline-flex; color: var(--zl-accent-soft); } .mk-ic svg { width: 30px; height: 30px; }
.mk-l { font-size: 13.5px; color: var(--zl-text-soft); font-weight: 600; }

/* display brightness — a card under the media grid, agent-capability gated */
.brightwrap {
  max-width: 460px; width: 100%; margin: 14px auto 0; padding: 14px 16px 16px;
  border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-1);
  animation: brightIn .28s ease both;
}
.brightwrap[hidden] { display: none; }
@keyframes brightIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bright-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.br-ic { display: inline-flex; color: var(--zl-accent-soft); } .br-ic svg { width: 21px; height: 21px; }
.br-l { font-size: 13.5px; font-weight: 600; color: var(--zl-text-soft); }
.br-val { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--zl-text);
  font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
/* per-screen target chips (multi-display hosts only) */
.bright-mon { display: flex; gap: 7px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.bright-mon::-webkit-scrollbar { display: none; }
.bright-mon[hidden] { display: none; }
.brmon { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--zl-line-strong); background: var(--zl-surface-2);
  color: var(--zl-text-soft); font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s, box-shadow .15s; }
.brmon:active { transform: translateY(1px); }
.brmon.active { background: radial-gradient(130% 120% at 50% 0%, rgba(157,174,80,.16), var(--zl-surface-1));
  color: var(--zl-accent-soft); border-color: rgba(157,174,80,.4); box-shadow: 0 0 12px rgba(157,174,80,.12); }
.bright-row { display: flex; align-items: center; gap: 12px; }
.br-end { display: inline-flex; color: var(--zl-text-dim, var(--zl-text-soft)); flex: none; }
.br-end svg { width: 16px; height: 16px; }
.bright-slider {
  flex: 1; -webkit-appearance: none; appearance: none; height: 34px; background: transparent;
  touch-action: pan-x; /* vertical swipes keep scrolling the page */
}
.bright-slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(157,174,80,.55), rgba(157,174,80,.22)) no-repeat, var(--zl-surface-3);
}
.bright-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px;
  border-radius: 50%; background: var(--zl-accent-soft); border: 2px solid var(--zl-bg, #06060a);
  box-shadow: 0 2px 10px rgba(0,0,0,.4), 0 0 0 1px rgba(157,174,80,.4);
  transition: transform .12s, box-shadow .15s;
}
.bright-slider:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 2px 12px rgba(0,0,0,.5), 0 0 0 5px rgba(157,174,80,.18); }
.bright-slider::-moz-range-track { height: 6px; border-radius: 999px; background: var(--zl-surface-3); }
.bright-slider::-moz-range-progress { height: 6px; border-radius: 999px; background: rgba(157,174,80,.5); }
.bright-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: var(--zl-accent-soft);
  border: 2px solid var(--zl-bg, #06060a); box-shadow: 0 2px 10px rgba(0,0,0,.4), 0 0 0 1px rgba(157,174,80,.4);
}

/* screen — live view */
.view-screen { padding: 10px 10px 12px; gap: 10px; }
.screenwrap { flex: 1; position: relative; min-height: 0; border-radius: var(--zl-radius-lg);
  overflow: hidden; background: #000; border: 1px solid var(--zl-line-strong);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.screen-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.screen-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 24px; color: var(--zl-text-soft); font-size: 14.5px; line-height: 1.5;
  background: radial-gradient(120% 90% at 50% 0%, rgba(157,174,80,.06), transparent 60%), var(--zl-surface-1); }
.screen-msg[hidden] { display: none; }
.screen-hud { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--zl-text-soft); background: rgba(6,6,10,.55); border: 1px solid var(--zl-line);
  border-radius: 999px; padding: 3px 9px; pointer-events: none; backdrop-filter: blur(4px); }
.screen-hud:empty { display: none; }
/* monitor picker (multi-display computers only) */
.monbar { display: flex; gap: 8px; flex: 0 0 auto; }
.monbtn { flex: 1; min-height: 46px; border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-1); color: var(--zl-text-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s, color .12s, border-color .12s, box-shadow .15s; }
.monbtn:active { transform: translateY(1px); }
.monbtn .mon-ic { display: inline-flex; opacity: .85; } .monbtn .mon-ic svg { width: 19px; height: 19px; }
.monbtn .mon-n { font-size: 15px; font-weight: 800; }
.monbtn .mon-res { font-size: 11px; color: var(--zl-text-muted); font-weight: 600; letter-spacing: .2px; }
.monbtn.active { background: radial-gradient(130% 120% at 50% 0%, rgba(157,174,80,.16), var(--zl-surface-1));
  color: var(--zl-accent-soft); border-color: rgba(157,174,80,.4); box-shadow: 0 0 14px rgba(157,174,80,.12); }
.monbtn.active .mon-res { color: var(--zl-accent-soft); opacity: .8; }

.qualbar { display: flex; gap: 8px; flex: 0 0 auto; }
.qbtn { flex: 1; min-height: 42px; border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-2); color: var(--zl-text-soft); font-size: 13.5px; font-weight: 700;
  transition: background .12s, color .12s, border-color .12s; }
.qbtn:active { transform: translateY(1px); }
.qbtn.active { background: var(--zl-accent); color: var(--zl-on-accent); border-color: var(--zl-olive-soft); }

/* bottom tabs */
.tabs { display: flex; border-top: 1px solid var(--zl-line); background: var(--zl-surface-1); flex: 0 0 auto; }
.tab { flex: 1 1 0; background: none; border: none; padding: 11px 0 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--zl-text-muted); font-size: 12px; font-weight: 600; border-top: 2px solid transparent; transition: color .15s; }
.tab .ti { display: inline-flex; transition: transform .18s var(--zl-ease, ease); }
.tab .ti svg { width: 22px; height: 22px; }
.tab:active .ti { transform: scale(.86); }
.tab.active { color: var(--zl-accent-soft); border-top-color: var(--zl-accent-soft); background: rgba(157,174,80,.05); }
.tab.active .ti { transform: translateY(-1px); }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(6,6,10,.92); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; }
.overlay[hidden] { display: none; }
.ov-card { text-align: center; max-width: 340px; }
.ov-card h2 { font-size: 22px; margin: 16px 0 10px; }
.ov-text { color: var(--zl-text-soft); font-size: 15px; line-height: 1.5; margin: 0 0 18px; }
.ov-icon { color: var(--zl-accent-soft); display: flex; justify-content: center; }
.ov-icon svg { width: 48px; height: 48px; }
.spinner { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--zl-surface-3); border-top-color: var(--zl-accent-soft); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* settings sheet */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; background: var(--zl-surface-1); border-top: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-xl) var(--zl-radius-xl) 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); animation: slideup .25s var(--zl-ease, ease); }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 19px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--zl-line); font-size: 15px; color: var(--zl-text-soft); }
.setrow input[type=range] { flex: 1; max-width: 60%; accent-color: var(--zl-olive-soft); }
.setrow.switch input { width: 22px; height: 22px; accent-color: var(--zl-olive-soft); flex: none; }
.setrow.switch.col { align-items: flex-start; }
.setrow .setrow-main { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.setrow .setrow-note { font-size: 12px; line-height: 1.35; color: var(--zl-text-muted); }
.sheet-foot { padding-top: 14px; text-align: center; }
.secure-note { font-size: 13px; color: var(--zl-text-muted); }

/* ══ HOME / device picker ══════════════════════════════════════════════════ */
/* the home screen scrolls (the list can grow); control mode stays locked. */
body.mode-home { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
.view-home { flex: 1 1 auto; display: flex; flex-direction: column; gap: 18px;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 17px; color: var(--zl-text-soft); }
.home-brand { display: inline-flex; align-items: center; gap: 9px; }
.home-top .brand-mark { color: var(--zl-accent-soft); font-size: 20px; }
.home-top .brand-name b { color: var(--zl-text); font-weight: 800; }
.home-top .brand-name { font-weight: 500; letter-spacing: .2px; }
.installpill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  color: var(--zl-accent-soft); background: var(--zl-accent-wash); border: 1px solid rgba(157,174,80,.35);
  border-radius: 999px; padding: 7px 14px; transition: background .15s, transform .06s; }
.installpill::before { content: '⤓'; font-size: 14px; line-height: 1; }
.installpill:active { transform: translateY(1px); background: rgba(157,174,80,.18); }
.home-head h1 { font-size: 27px; margin: 4px 0 6px; line-height: 1.1; letter-spacing: -.4px; }
.home-head p { margin: 0; color: var(--zl-text-muted); font-size: 15px; }

.dev-list { display: flex; flex-direction: column; gap: 12px; }
.devcard { position: relative; display: flex; align-items: stretch;
  background: var(--zl-surface-1); border: 1px solid var(--zl-line-strong);
  border-radius: var(--zl-radius-lg); overflow: hidden; transition: border-color .15s, transform .06s, box-shadow .2s; }
.devcard:active { transform: translateY(1px); }
.devmain { flex: 1; display: flex; align-items: center; gap: 14px; padding: 15px 14px;
  background: none; border: none; text-align: left; min-width: 0; }
.devcard:has(.devmain:active) { border-color: var(--zl-line-focus); box-shadow: 0 0 0 1px var(--zl-line-focus), 0 8px 24px rgba(0,0,0,.35); }
.dev-av { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; background: radial-gradient(120% 120% at 50% 0%, rgba(157,174,80,.16), var(--zl-surface-3));
  border: 1px solid var(--zl-line); }
.dev-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dev-name { font-size: 16.5px; font-weight: 700; color: var(--zl-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-sub { font-size: 12.5px; color: var(--zl-text-muted); }
.dev-go { margin-left: auto; flex: 0 0 auto; color: var(--zl-accent-soft); display: inline-flex; opacity: .8; }
.dev-go svg { width: 22px; height: 22px; }
.dev-more { flex: 0 0 auto; width: 44px; background: none; border: none; border-left: 1px solid var(--zl-line);
  color: var(--zl-text-muted); font-size: 22px; line-height: 1; }
.dev-more:active { background: var(--zl-surface-2); }
.dev-menu { position: absolute; top: 8px; right: 8px; z-index: 5; background: var(--zl-surface-3);
  border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md); overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; min-width: 150px; animation: pop .12s ease; }
.dev-menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.dev-menu button { background: none; border: none; text-align: left; padding: 13px 16px; font-size: 15px; color: var(--zl-text-soft); }
.dev-menu button:active { background: var(--zl-surface-2); }
.dev-menu button.danger { color: var(--zl-grape-soft); border-top: 1px solid var(--zl-line); }

.dev-empty { text-align: center; padding: 36px 20px; border: 1px dashed var(--zl-line-strong);
  border-radius: var(--zl-radius-xl); background: var(--zl-surface-1); }
.dev-empty .empty-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  color: var(--zl-accent-soft); background: var(--zl-accent-wash); }
.dev-empty .empty-ic svg { width: 28px; height: 28px; }
.dev-empty h2 { font-size: 18px; margin: 0 0 6px; }
.dev-empty p { margin: 0; color: var(--zl-text-muted); font-size: 14px; line-height: 1.5; }

.addbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; border-radius: var(--zl-radius-lg); border: 1px solid rgba(157,174,80,.35);
  background: var(--zl-accent-wash); color: var(--zl-accent-soft); font-size: 16px; font-weight: 700;
  transition: background .15s, transform .06s; }
.addbtn:active { background: rgba(157,174,80,.18); transform: translateY(1px); }
.add-plus { font-size: 22px; line-height: 1; }

/* lock-screen controls promo card */
.lockcard { display: flex; align-items: center; gap: 14px; padding: 16px 16px;
  border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line-strong);
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(157,174,80,.10), transparent 55%),
    var(--zl-surface-1);
  transition: border-color .2s, box-shadow .25s, background .2s; }
.lockcard.on { border-color: rgba(157,174,80,.45); box-shadow: 0 0 0 1px rgba(157,174,80,.18), 0 8px 26px rgba(0,0,0,.28); }
.lockcard[hidden] { display: none; }
.lc-ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: var(--zl-accent-soft); background: var(--zl-accent-wash); border: 1px solid var(--zl-line);
  transition: color .2s, background .2s; }
.lc-ic svg { width: 24px; height: 24px; }
.lockcard.on .lc-ic { color: var(--zl-on-accent); background: var(--zl-accent); border-color: var(--zl-olive-soft); }
.lc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lc-title { font-size: 16px; font-weight: 700; color: var(--zl-text); }
.lc-desc { font-size: 12.5px; line-height: 1.45; color: var(--zl-text-muted); }
.lc-switch { flex: 0 0 auto; width: 50px; height: 30px; border-radius: 999px; padding: 0; position: relative;
  background: var(--zl-surface-3); border: 1px solid var(--zl-line-strong); transition: background .2s, border-color .2s; }
.lc-knob { position: absolute; top: 50%; left: 3px; transform: translateY(-50%); width: 24px; height: 24px;
  border-radius: 50%; background: var(--zl-text-muted); transition: transform .2s var(--zl-ease, ease), background .2s; }
.lc-switch[aria-checked="true"] { background: var(--zl-accent); border-color: var(--zl-olive-soft); }
.lc-switch[aria-checked="true"] .lc-knob { transform: translate(20px, -50%); background: var(--zl-on-accent); }
.lc-switch:active .lc-knob { width: 27px; }

@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reveal-in { animation: reveal-in .28s var(--zl-ease, ease) both; }

/* ── add-device sheet ── */
.add-card .getbtn { width: 100%; margin-top: 4px; }
.scanbox { position: relative; width: 100%; aspect-ratio: 1/1; max-height: 46vh; border-radius: var(--zl-radius-lg);
  overflow: hidden; background: #000; border: 1px solid var(--zl-line-strong); display: none; margin-bottom: 12px; }
.scanbox.live { display: block; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18%; border: 2px solid var(--zl-accent-soft); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(6,6,10,.35); }
.scan-hint { color: var(--zl-text-muted); font-size: 13px; line-height: 1.5; margin: 10px 2px 16px; text-align: center; }
.paste-l { display: block; font-size: 13px; color: var(--zl-text-soft); font-weight: 600; margin-bottom: 8px; }
.paste-row { display: flex; gap: 8px; }
.paste-in { flex: 1; min-width: 0; font-size: 15px; padding: 13px 12px; background: var(--zl-surface-2);
  color: var(--zl-text); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md);
  user-select: text; -webkit-user-select: text; }
.paste-in:focus { outline: none; border-color: var(--zl-line-focus); }
.add-err { color: var(--zl-grape-soft); font-size: 13.5px; line-height: 1.5; margin: 12px 2px 0; }

/* devices escape button on the overlay */
#ovHome { margin-top: 12px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  z-index: 80; max-width: min(90vw, 460px); background: var(--zl-surface-3); color: var(--zl-text);
  border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-lg); padding: 13px 18px; font-size: 14px;
  line-height: 1.45; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5); opacity: 0; transition: opacity .28s, transform .28s; }
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .spinner, .dot.warn, .sheet-card, .reveal-in, .dev-menu, .toast, .view-enter, .pad-ripple, .tch { animation: none; }
  .pad-glow, .pad-ripple { display: none; }
}

/* ── "you're on a computer" switch ─────────────────────────────────────────
   The agent prints one link; opened on a desktop this offers the desktop
   remote (/d/<room>) instead of a touch trackpad. */
.ui-switch {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: min(680px, 94vw);
  padding: 10px 14px; border-radius: 12px;
  background: var(--zl-surface-1, #0e0e13);
  border: 1px solid var(--zl-line, rgba(255,255,255,.07));
  border-top: 2px solid var(--zl-olive-mid, #59642a);
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
  font-size: 13.5px; color: var(--zl-text-soft, #b6b7ad);
  animation: uiSwitchIn .3s ease both;
}
@keyframes uiSwitchIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .ui-switch { animation: none; } }
