:root {
  --bg: #0b0b10;
  --text: #f6f6f8;
  --soft: rgba(255, 255, 255, .72);
  --faint: rgba(255, 255, 255, .45);
  --line: rgba(255, 255, 255, .10);
  --glass: rgba(255, 255, 255, .065);
  --glass-hi: rgba(255, 255, 255, .12);
  --accent: #ff4d6d;
  --accent-2: #6d7cff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --radius: 26px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.4 Outfit, system-ui, -apple-system, Segoe UI, sans-serif;
  padding: 18px 16px calc(110px + var(--safe-b));
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
.muted { color: var(--soft); }
.small { font-size: 13px; }

/* Slow drifting colour behind everything */
.bg { position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(255, 77, 109, .28), transparent 70%),
    radial-gradient(38% 32% at 85% 25%, rgba(109, 124, 255, .26), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, rgba(0, 190, 255, .16), transparent 70%),
    var(--bg);
  filter: blur(10px);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) scale(1.08) rotate(3deg); } }

.glass {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 20px 50px rgba(0, 0, 0, .35);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: var(--radius);
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .38em; font-size: 15px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px rgba(255,255,255,.8); }
.brand-sub { letter-spacing: .2em; color: var(--faint); font-weight: 400; margin-left: -4px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); font-size: 14px; color: var(--soft); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.chip.on .pulse { background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: ping 2s infinite; }
.chip.standby .pulse { background: var(--warn); }
.chip.off .pulse { background: #ff6b6b; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* Now playing */
.now { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 18px; overflow: hidden; }
.now::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 0% 50%, var(--now-tint, rgba(255,77,109,.25)), transparent 70%); pointer-events: none; transition: background .6s; }
.now-icon { width: 58px; height: 58px; border-radius: 16px; flex: none; background: var(--glass-hi) center/cover no-repeat; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.now-icon svg { width: 28px; height: 28px; }
.now-text { flex: 1; min-width: 0; position: relative; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--faint); }
.now-title { font-size: 22px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { font-size: 14px; color: var(--soft); }
.now-today { text-align: right; position: relative; }
.now-today-value { font-size: 22px; font-weight: 300; }

/* Tabs */
.tab { display: none; animation: rise .35s ease; }
.tab.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tabs { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 99px; z-index: 10; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 16px; border-radius: 99px; color: var(--faint); font-size: 11px; transition: .25s; }
.tabs button.on { color: #fff; background: rgba(255, 255, 255, .14); }

/* Cards */
.card { padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 500; }
.link { color: var(--soft); font-size: 14px; }

/* Remote */
.remote-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.side { min-width: 0; }
@media (min-width: 900px) { .remote-grid { grid-template-columns: 400px minmax(0, 1fr); align-items: start; } .remote { position: sticky; top: 18px; } }
.remote { padding: 26px 20px 22px; margin-bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 26px; }

.dial { position: relative; width: min(300px, 78vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.22), rgba(255,255,255,.06) 72%);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -20px 40px rgba(0,0,0,.25), 0 30px 60px rgba(0,0,0,.4);
}
.dial::after { content: ""; position: absolute; inset: 31%; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); pointer-events: none; }
.dial-btn { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(255,255,255,.88); font-size: 11px; letter-spacing: .06em; padding: 10px; border-radius: 20px; transition: color .2s, transform .15s, background .2s; }
.dial-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.dial-btn svg { width: 24px; height: 24px; }
.dial-top { top: 6%; left: 50%; transform: translateX(-50%); }
.dial-bottom { bottom: 6%; left: 50%; transform: translateX(-50%); }
.dial-left { left: 5%; top: 50%; transform: translateY(-50%); }
.dial-right { right: 5%; top: 50%; transform: translateY(-50%); }
.dial-center { position: absolute; inset: 33%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 25%, rgba(255,255,255,.42), rgba(255,255,255,.12));
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 12px 30px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .2s;
}
.dial-center svg { width: 34px; height: 34px; }
.dial-center:active { transform: scale(.94); }
.dial-btn:active { transform: translate(-50%, 0) scale(.92); }
.dial-left:active, .dial-right:active { transform: translateY(-50%) scale(.92); }

.press { animation: press .45s ease; }
@keyframes press { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }

.volume { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 340px; }
.vol-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid var(--line); flex: none; transition: transform .15s; }
.vol-btn:active { transform: scale(.9); }
.vol-track { position: relative; flex: 1; min-width: 0; height: 48px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid var(--line); overflow: hidden; }
.vol-track input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; margin: 0; }
.vol-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.38)); transition: width .25s; }
.vol-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; pointer-events: none; }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: 20px; background: rgba(255,255,255,.04); border: 1px solid transparent; transition: transform .18s, background .2s, border-color .2s; }
.app:hover { background: rgba(255,255,255,.09); border-color: var(--line); transform: translateY(-2px); }
.app:active { transform: scale(.95); }
.app img, .app .ph { width: 56px; height: 56px; border-radius: 15px; object-fit: cover; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.app .ph { display: grid; place-items: center; background: var(--glass-hi); font-weight: 600; font-size: 22px; }
.app span { font-size: 12.5px; color: var(--soft); text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.app.live { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); }
.empty { color: var(--faint); font-size: 14px; padding: 10px 2px; grid-column: 1 / -1; }

.inline-form { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 18px; padding: 6px 6px 6px 12px; }
.inline-form input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 10px 2px; }
.inline-form input::placeholder { color: var(--faint); }
.field-icon { color: var(--faint); display: grid; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button { padding: 8px 13px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 13.5px; color: var(--soft); transition: .2s; }
.chips button:hover { color: #fff; background: rgba(255,255,255,.12); }

.btn-primary { padding: 11px 18px; border-radius: 14px; background: #fff; color: #0b0b10; font-weight: 500; transition: transform .15s, opacity .2s; }
.btn-primary:active { transform: scale(.96); }
.btn-primary:disabled { opacity: .4; }
.btn-ghost { width: 100%; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--soft); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); }

/* Today */
.day-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.day-title { text-align: center; position: relative; font-weight: 500; font-size: 17px; }
.day-title input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.day-summary { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.1) 0);
  -webkit-mask: radial-gradient(circle, transparent 52px, #000 53px); mask: radial-gradient(circle, transparent 52px, #000 53px); position: relative; }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; -webkit-mask: none; }
.day-summary .ring-wrap { position: relative; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 22px; font-weight: 500; }
.ring-label span { font-size: 12px; color: var(--faint); }
.day-facts { display: grid; gap: 8px; font-size: 14.5px; color: var(--soft); }
.day-facts b { color: #fff; font-weight: 500; }
.bar-day { position: relative; height: 34px; border-radius: 12px; background: rgba(255,255,255,.05); overflow: hidden; }
.bar-day i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar-hours { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 25px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { display: flex; align-items: center; gap: 14px; padding: 9px 0; position: relative; }
.timeline .t-icon { width: 50px; height: 50px; border-radius: 14px; flex: none; background: var(--glass-hi) center/cover no-repeat; display: grid; place-items: center; position: relative; z-index: 1; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.timeline .t-main { flex: 1; min-width: 0; }
.timeline .t-name { font-weight: 500; }
.timeline .t-time { font-size: 13.5px; color: var(--faint); }
.timeline .t-dur { font-size: 15px; color: var(--soft); white-space: nowrap; }
.timeline .t-bar { height: 3px; border-radius: 3px; margin-top: 6px; background: var(--c, #fff); opacity: .8; }
.timeline li.dim .t-name { color: var(--soft); font-weight: 400; }
.timeline li.power .t-icon { width: 50px; height: 26px; background: none; box-shadow: none; color: var(--faint); }

/* Stats */
.seg { display: flex; padding: 3px; border-radius: 99px; background: rgba(255,255,255,.06); }
.seg button { padding: 6px 12px; border-radius: 99px; font-size: 13px; color: var(--faint); }
.seg button.on { background: rgba(255,255,255,.16); color: #fff; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .b { width: 100%; max-width: 34px; border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.18)); min-height: 3px; transition: height .6s cubic-bezier(.2,.8,.2,1); position: relative; }
.chart .b.today { background: linear-gradient(180deg, var(--accent), rgba(255,77,109,.3)); }
.chart .b em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--faint); font-style: normal; white-space: nowrap; }
.chart .d { font-size: 11px; color: var(--faint); }
.chart-foot { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--soft); }
.app-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.app-bars li { display: flex; align-items: center; gap: 12px; }
.app-bars .ic { width: 40px; height: 40px; border-radius: 11px; flex: none; background: var(--glass-hi) center/cover no-repeat; }
.app-bars .m { flex: 1; min-width: 0; }
.app-bars .row { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 6px; }
.app-bars .row span:last-child { color: var(--soft); }
.app-bars .track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.app-bars .fill { height: 100%; border-radius: 6px; background: var(--c, #fff); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* More */
.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.info > div { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); }
.info .k { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.info .v { font-size: 18px; margin-top: 4px; }
.info .meter { height: 5px; border-radius: 5px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.info .meter i { display: block; height: 100%; background: #fff; border-radius: 5px; }
.logins { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.logins li { display: flex; justify-content: space-between; gap: 10px; color: var(--soft); }
.logins .bad { color: #ff8a8a; }
.logout { margin: 8px 0 20px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; padding: 11px 18px; border-radius: 99px;
  background: rgba(20,20,26,.85); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 14.5px; transition: .3s; z-index: 20; white-space: nowrap; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Login */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 32px 26px; }
.login-card h1 { font-weight: 400; font-size: 30px; margin: 26px 0 4px; }
.login-card form { display: grid; gap: 16px; margin-top: 22px; }
.login-card label { display: grid; gap: 8px; font-size: 14px; color: var(--soft); }
.login-card input { padding: 14px 16px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--line); outline: none; font-size: 17px; transition: border-color .2s; }
.login-card input:focus { border-color: rgba(255,255,255,.4); }
.login-card .btn-primary { padding: 15px; font-size: 16px; margin-top: 6px; }
.alert { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 90, 90, .14); border: 1px solid rgba(255, 90, 90, .3); color: #ffb0b0; font-size: 14px; }

@media (max-width: 520px) {
  .now-today { display: none; }
  .now-title { font-size: 19px; }
  .card { padding: 16px; }
  .apps { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Setup */
.setup-key { display: grid; gap: 4px; margin: 18px 0 8px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.setup-key .eyebrow { margin-top: 8px; }
.setup-key .eyebrow:first-child { margin-top: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: .06em; word-break: break-all; }
.login-card a { color: #fff; }

/* Phase 2 */
.tabs button { padding: 8px 13px; }
select, input[type=time], input[type=url], input[type=text]:not(.inline-form input) { font: inherit; color: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label, .l-fields label { display: grid; gap: 6px; font-size: 13px; color: var(--soft); }
.form-grid input, .form-grid select, .l-fields select, .l-fields input, .add-limit select {
  width: 100%; padding: 11px 12px; border-radius: 13px; background: rgba(0,0,0,.25); border: 1px solid var(--line); outline: none; color-scheme: dark; }
.form-grid input:focus, .form-grid select:focus { border-color: rgba(255,255,255,.35); }
.btn-primary.save { width: 100%; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn-primary { flex: 1; }
.small-btn { width: auto; padding: 11px 18px; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; z-index: 1; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.14); transition: .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: .25s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

.sched { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.sched li { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 18px; background: rgba(255,255,255,.05); }
.sched li.off { opacity: .5; }
.s-time { font-size: 20px; font-weight: 300; min-width: 92px; }
.s-main { flex: 1; min-width: 0; }
.s-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.small { width: 34px; height: 34px; flex: none; }
.icon-btn.small svg { width: 18px; height: 18px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.presets button { padding: 8px 13px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 13.5px; color: var(--soft); }
.sched-form { border-top: 1px solid var(--line); padding-top: 16px; }
.days { display: flex; gap: 6px; margin-bottom: 14px; }
.days button { flex: 1; height: 40px; border-radius: 12px; background: rgba(255,255,255,.06); color: var(--faint); font-weight: 500; transition: .2s; }
.days button.on { background: #fff; color: #0b0b10; }

.limits { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.limits li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.05); }
.limits img, .limits .ph { width: 44px; height: 44px; border-radius: 12px; flex: none; background: var(--glass-hi); }
.l-main { flex: 1; min-width: 0; }
.l-name { font-weight: 500; margin-bottom: 8px; }
.l-fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.l-fields select, .l-fields input { padding: 8px; font-size: 13.5px; }
.add-limit { margin-bottom: 12px; }
.add-limit select { border: 0; background: none; padding: 8px 2px; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-chip { display: inline-flex; align-items: center; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid var(--line); overflow: hidden; }
.link-chip button { padding: 8px 12px; font-size: 13.5px; }
.link-chip .x { padding: 8px 11px 8px 4px; color: var(--faint); }
#link-save { margin-top: 10px; }

.passkeys { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.passkeys li { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05); }
#pk-add { width: 100%; }
.btn-passkey { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; padding: 15px; border-radius: 16px; background: #fff; color: #0b0b10; font-weight: 500; font-size: 16px; }
.btn-passkey svg { width: 22px; height: 22px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 22px 0 -6px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 520px) {
  .tabs button { padding: 8px 10px; }
  .l-fields { grid-template-columns: 1fr 1fr; }
  .l-fields label:first-child { grid-column: 1 / -1; }
  .s-time { min-width: 76px; font-size: 18px; }
}

/* Power */
.top-right { display: flex; align-items: center; gap: 10px; }
.power { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); color: var(--faint); transition: .25s; }
.power svg { width: 20px; height: 20px; stroke-width: 2.2; }
.power.on { color: #fff; background: rgba(61, 220, 151, .18); border-color: rgba(61, 220, 151, .5); box-shadow: 0 0 18px rgba(61, 220, 151, .35); }
.power:active { transform: scale(.92); }
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center; padding: 16px 16px calc(16px + var(--safe-b)); background: rgba(0,0,0,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s; }
.sheet-wrap[hidden] { display: none; }
@media (min-width: 600px) { .sheet-wrap { place-items: center; } }
.sheet { width: min(420px, 100%); padding: 26px 22px 20px; text-align: center; animation: rise .3s ease; }
.sheet h3 { margin: 12px 0 6px; font-weight: 500; font-size: 22px; }
.sheet p { margin: 0 0 20px; font-size: 15px; }
.sheet-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.sheet-icon svg { width: 30px; height: 30px; stroke-width: 2.2; }
@keyframes fade { from { opacity: 0; } }
.power.standby { color: #ffd28a; background: rgba(255, 181, 71, .14); border-color: rgba(255, 181, 71, .45); }
.open-remote { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 340px; padding: 14px; border-radius: 18px; background: #fff; color: #0b0b10; font-weight: 500; text-decoration: none; transition: transform .15s; }
.open-remote svg { width: 20px; height: 20px; }
.open-remote:active { transform: scale(.97); }

/* Batch 2: people, kids, activity */
body.loading-role [data-need] { visibility: hidden; }
body.role-viewer #tab-remote .remote, body.role-viewer #tab-remote .side .card:not(:first-child), body.role-viewer .power { display: none; }
body.role-viewer .apps .app { pointer-events: none; }
body.role-kids #msg-form, body.role-kids #msg-chips, body.role-kids #link-save, body.role-kids .dial-bottom, body.role-kids .power { display: none; }
body.role-kids #msg-form { display: none; }
.app-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid transparent; cursor: pointer; font-size: 13.5px; }
.pick input { accent-color: #fff; width: 16px; height: 16px; margin: 0; }
.pick img { width: 26px; height: 26px; border-radius: 7px; }
.pick:has(input:checked) { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.05); }
.p-icon { font-size: 22px; }
.p-main { flex: 1; min-width: 0; }
.person-form { border-top: 1px solid var(--line); padding-top: 16px; }
.invite { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .3); }
.invite-row { display: flex; gap: 8px; margin-top: 10px; }
.invite-row input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: inherit; font: 13px ui-monospace, Consolas, monospace; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; max-height: 420px; overflow: auto; }
.activity li { display: flex; gap: 12px; }
.a-time { flex: none; width: 108px; color: var(--faint); font-size: 12.5px; padding-top: 2px; }
.signed-as { text-align: center; margin-bottom: 10px; }
