:root {
  --bg: #000;
  --text: rgba(255, 255, 255, .94);
  --dim: rgba(235, 235, 245, .58);
  --faint: rgba(235, 235, 245, .32);
  --glass: rgba(255, 255, 255, .07);
  --glass-hi: rgba(255, 255, 255, .13);
  --line: rgba(255, 255, 255, .11);
  --accent: #0a84ff;
  --green: #30d158;
  --amber: #ffd60a;
  --red: #ff453a;
  --spring: cubic-bezier(.2, 1.25, .35, 1);
  --sheet: cubic-bezier(.32, .72, 0, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
html { background: #02030a; min-height: 100vh; min-height: 100dvh; }
body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; background: transparent; font-size: 16px; letter-spacing: -.011em; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
svg { width: 24px; height: 24px; display: block; }
[hidden] { display: none !important; }

/* ambient background */
/* Static on purpose: animated blurred layers behind backdrop-filter glass make iPhones re-blur every frame, which delays touches. */
.bg { position: fixed; top: -140px; left: 0; right: 0; bottom: -140px; overflow: hidden; z-index: 0; background: #02030a; }
.bg i { position: absolute; width: 130vw; height: 130vw; border-radius: 50%; opacity: .55; }
.bg i:nth-child(1) { left: -45vw; top: -35vw; background: radial-gradient(closest-side, #1c2d86, transparent); }
.bg i:nth-child(2) { right: -60vw; bottom: -30vw; background: radial-gradient(closest-side, #4b1d7a, transparent); }

/* glass */
.glass { background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 30px rgba(0, 0, 0, .28); }
.glass-strong { background: rgba(32, 32, 40, .66); border: 1px solid rgba(255, 255, 255, .13); -webkit-backdrop-filter: blur(44px) saturate(180%); backdrop-filter: blur(44px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 20px 60px rgba(0, 0, 0, .5); }

#haptic { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: .01; pointer-events: none; z-index: -1; overflow: hidden; }

/* layout */
#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; z-index: 1; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 10px) 18px calc(var(--sab) + 12px); gap: 8px; max-width: 520px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 46px; }
.chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 14px; border-radius: 22px; text-align: left; transition: transform .35s var(--spring); }
.chip:active { transform: scale(.96); }
.chip-txt { display: flex; flex-direction: column; line-height: 1.15; }
.chip-txt b { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.chip-txt small { font-size: 12px; color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 214, 10, .18); transition: background .3s, box-shadow .3s; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(48, 209, 88, .18), 0 0 12px rgba(48, 209, 88, .6); }
.dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 69, 58, .18); }
.dot.sleep { background: #8e8e93; box-shadow: 0 0 0 3px rgba(142, 142, 147, .18); }

.round { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; transition: transform .38s var(--spring), background .2s; will-change: transform; }
.round.sm { width: 44px; height: 44px; }
.round svg { width: 25px; height: 25px; }
.round.sm svg { width: 22px; height: 22px; }
.round:active, .round.down { transform: scale(.88); background: var(--glass-hi); transition-duration: .08s; }

/* favorites */
.favs { margin: 2px -18px 0; }
.fav-row { display: flex; gap: 14px; overflow-x: auto; padding: 8px 18px 10px; scroll-snap-type: x proximity; scroll-padding: 0 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 26px), transparent 100%); }
.fav-row::-webkit-scrollbar { display: none; }
.fav-row::before, .fav-row::after { content: ""; flex: 0 0 4px; } /* real left/right margins inside the scroller (padding alone gets dropped at the end) */
.tile { flex: 0 0 auto; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; scroll-snap-align: start; transition: transform .4s var(--spring); }
.tile .lbl { font-size: 11px; color: var(--dim); max-width: 68px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.tile.press { transform: scale(.9); transition-duration: .1s; }
.ico { width: 62px; height: 62px; border-radius: 14.5px; overflow: hidden; position: relative; display: grid; place-items: center; font-weight: 700; font-size: 26px; color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.ico img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ico.wide img { object-fit: contain; padding: 10%; }
.ico .letter { text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.tile.launch .ico { animation: launch .55s var(--spring); }
@keyframes launch { 0% { transform: scale(1); } 30% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* pad */
.pad-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.pad { position: relative; width: min(100cqw, 100cqh, 384px); aspect-ratio: 1; border-radius: 50%; touch-action: none; overflow: hidden;
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(255, 255, 255, .20), transparent 70%),
    radial-gradient(60% 40% at 50% 104%, rgba(110, 130, 255, .22), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03));
  border-color: rgba(255, 255, 255, .16);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .22), inset 0 -34px 70px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(255, 255, 255, .03), 0 34px 80px rgba(0, 0, 0, .55), 0 0 90px rgba(60, 90, 255, .10); }
.pad .sheen { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 200deg, transparent 0, rgba(255, 255, 255, .06) 12%, transparent 30%, transparent 60%, rgba(160, 180, 255, .07) 78%, transparent); pointer-events: none; }
.pad .ring { position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .10); box-shadow: inset 0 0 40px rgba(255, 255, 255, .03), 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; transition: opacity .3s; }
.pad .core { position: absolute; left: 50%; top: 50%; width: 15%; aspect-ratio: 1; margin: -7.5% 0 0 -7.5%; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .85), rgba(190, 210, 255, .35) 55%, rgba(120, 150, 255, .22)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 0 34px rgba(110, 150, 255, .38), 0 6px 14px rgba(0, 0, 0, .35); pointer-events: none; transition: transform .4s var(--spring), background .25s; }
.pad.tap .core { animation: none; transform: scale(1.45); background: radial-gradient(circle at 35% 30%, #7cc0ff, var(--accent)); box-shadow: 0 0 40px rgba(10, 132, 255, .8); transition-duration: .06s; }
.pad .finger { position: absolute; width: 46%; aspect-ratio: 1; margin: 0; border-radius: 50%; left: 0; top: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(10, 132, 255, .42), rgba(10, 132, 255, .12) 55%, transparent); transition: opacity .25s; will-change: transform, opacity; }
.pad.active .finger { opacity: 1; }
.chev { position: absolute; width: 11%; height: 11%; color: #fff; opacity: 0; pointer-events: none; transition: opacity .35s ease-out, transform .35s var(--spring); }
.c-up { left: 44.5%; top: 6%; }
.c-down { left: 44.5%; bottom: 6%; transform: rotate(180deg); }
.c-left { left: 6%; top: 44.5%; transform: rotate(-90deg); }
.c-right { right: 6%; top: 44.5%; transform: rotate(90deg); }
.chev.flash { opacity: 1; transition-duration: 0s; }
.hint { position: absolute; left: 0; right: 0; bottom: 17%; text-align: center; font-size: 12px; color: var(--faint); letter-spacing: .01em; pointer-events: none; transition: opacity .6s; }
.hint.gone { opacity: 0; }
/* D-pad mode */
.pad.dpad .chev { opacity: .78; }
.pad.dpad .ring { inset: 29%; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
.pad.dpad .core { width: 20%; margin: -10% 0 0 -10%; opacity: .0; }
.pad.dpad .hint { opacity: 0; }
.pad.dpad .finger { display: none; }
.pad.dpad .ring::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), rgba(255, 255, 255, .14)); }
.pad.dpad.tap .ring { background: rgba(10, 132, 255, .5); border-color: rgba(120, 190, 255, .6); transition-duration: .05s; }
.pad.dpad .chev.flash { color: #7cc0ff; }

/* controls */
.controls { display: flex; flex-direction: column; gap: 12px; padding-top: 2px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.four { justify-content: space-between; }
.vol-row { gap: 14px; }
.vol { flex: 1; height: 60px; border-radius: 30px; display: flex; align-items: stretch; overflow: hidden; }
.vol button { flex: 1; display: grid; place-items: center; transition: background .15s, transform .3s var(--spring); }
.vol button svg { width: 24px; height: 24px; }
.vol button.mid { flex: 1.15; color: var(--dim); }
.vol button:active, .vol button.down { background: var(--glass-hi); }
.vol button:active svg, .vol button.down svg { transform: scale(.86); }
.vol svg { transition: transform .3s var(--spring); }
.apps-btn { height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 16px; position: relative; transition: transform .4s var(--spring); }
.apps-btn svg { width: 20px; height: 20px; }
.apps-btn .up { position: absolute; right: 18px; width: 20px; height: 20px; color: var(--faint); }
.apps-btn:active { transform: scale(.97); }
#powerBtn.asleep { color: var(--red); }
#powerBtn.pulse { animation: launch .5s var(--spring); }

/* toast */
#toast { position: fixed; left: 50%; top: calc(var(--sat) + 12px); z-index: 60; transform: translate(-50%, -120%) scale(.92); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 22px; font-size: 14px; font-weight: 500; white-space: nowrap; background: rgba(40, 40, 48, .78); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
  transition: transform .5s var(--spring), opacity .25s; }
#toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* sheets */
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .0); transition: background .4s; }
.sheet, .kb { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.sheet.open, .kb.open { pointer-events: auto; }
.sheet.open .scrim, .kb.open .scrim { background: rgba(0, 0, 0, .5); }
.panel { position: absolute; left: 0; right: 0; bottom: 0; height: min(88dvh, 100dvh - var(--sat) - 20px); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  border-radius: 30px 30px 0 0; background: rgba(30, 30, 38, .74); border: 1px solid rgba(255, 255, 255, .12); border-bottom: 0;
  -webkit-backdrop-filter: blur(46px) saturate(180%); backdrop-filter: blur(46px) saturate(180%); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .14);
  transform: translateY(104%); transition: transform .55s var(--sheet); will-change: transform; padding-bottom: var(--sab); }
.sheet.open .panel { transform: translateY(0); }
.panel.dragging { transition: none; }
.grab { padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; }
.grab i { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.panel-head { padding: 4px 18px 10px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(120, 120, 128, .24); color: var(--dim); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; color: var(--text); -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::placeholder { color: var(--faint); }
.grid { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; align-content: start; overscroll-behavior: contain; touch-action: pan-y; }
.grid .tile { width: auto; }
.grid .tile .lbl { max-width: 76px; font-size: 11.5px; color: var(--text); opacity: .86; }
.grid .ico { width: 66px; height: 66px; border-radius: 15.5px; }
.grid .empty { grid-column: 1 / -1; text-align: center; color: var(--faint); padding: 40px 0; }
.star { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: var(--amber); display: grid; place-items: center; }
.star svg { width: 11px; height: 11px; }
.tip { margin: 0; padding: 8px 20px 12px; text-align: center; font-size: 12px; color: var(--faint); }

/* keyboard */
.kb-card { position: absolute; left: 14px; right: 14px; top: calc(var(--sat) + 62px); max-width: 520px; margin: 0 auto; padding: 18px; border-radius: 28px; display: flex; flex-direction: column; gap: 14px;
  transform: translateY(-30px) scale(.94); opacity: 0; transition: transform .5s var(--spring), opacity .25s; }
.kb.open .kb-card { transform: none; opacity: 1; }
.kb-title { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.kb-title svg { width: 18px; height: 18px; }
#kbInput { width: 100%; height: 54px; padding: 0 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .3); font-size: 20px; outline: 0; color: var(--text); caret-color: var(--accent); }
#kbInput:focus { border-color: rgba(10, 132, 255, .7); box-shadow: 0 0 0 4px rgba(10, 132, 255, .2); }
.kb-actions { display: flex; gap: 10px; }
.pill { flex: 1; height: 46px; border-radius: 23px; display: flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; font-size: 16px; transition: transform .35s var(--spring); }
.pill svg { width: 19px; height: 19px; }
.pill:active { transform: scale(.94); }
.pill.solid { background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(10, 132, 255, .4); }

/* PIN */
.pin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 0%, #121638, #000 70%); padding: var(--sat) 20px var(--sab); }
.pin-card { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 340px; }
.pin-logo { border-radius: 19px; box-shadow: 0 14px 40px rgba(10, 132, 255, .25); margin-bottom: 18px; }
.pin h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.pin p { margin: 6px 0 22px; font-size: 14px; color: var(--dim); text-align: center; min-height: 20px; }
.dots { display: flex; gap: 16px; margin-bottom: 30px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .4); transition: background .15s, transform .35s var(--spring), border-color .15s; }
.dots i.f { background: #fff; border-color: #fff; transform: scale(1.12); }
.dots.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97); }
.dots.shake i { border-color: var(--red); background: var(--red); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
.keys { display: grid; grid-template-columns: repeat(3, 78px); gap: 14px 20px; }
.key { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 400; background: rgba(255, 255, 255, .09); transition: transform .35s var(--spring), background .15s; }
.key:active { transform: scale(.9); background: rgba(255, 255, 255, .24); transition-duration: .06s; }
.key.blank { background: none; pointer-events: none; }
.key.fn { background: none; font-size: 16px; color: var(--dim); }
.key svg { width: 26px; height: 26px; }

/* TV not found */
.lost { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; } }
.lost-card { width: 100%; max-width: 360px; border-radius: 30px; padding: 28px 22px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: rise .6s var(--spring); }
@keyframes rise { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.lost-ico { position: relative; width: 74px; height: 74px; border-radius: 22px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: var(--dim); margin-bottom: 16px; }
.lost-ico svg { width: 38px; height: 38px; }
.lost-ico u { position: absolute; width: 56px; height: 2.5px; border-radius: 2px; background: var(--red); transform: rotate(-38deg); }
.lost h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.lost p { margin: 0 0 18px; color: var(--dim); font-size: 14.5px; line-height: 1.4; }
#ipForm { display: flex; flex-direction: column; gap: 10px; width: 100%; }
#ipInput { height: 52px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .3); padding: 0 16px; font-size: 20px; text-align: center; outline: 0; font-variant-numeric: tabular-nums; }
#ipInput:focus { border-color: rgba(10, 132, 255, .7); box-shadow: 0 0 0 4px rgba(10, 132, 255, .2); }
#ipForm .pill { flex: none; height: 50px; }
.link { margin-top: 12px; color: var(--accent); font-size: 15px; padding: 8px 14px; }

/* install guide (plain Safari) */
.guide { position: fixed; inset: 0; z-index: 80; background: radial-gradient(120% 70% at 50% 0%, #131a44, #02030a 70%); display: flex; flex-direction: column; align-items: center; padding: calc(var(--sat) + 28px) 22px calc(var(--sab) + 110px); overflow-y: auto; }
.guide-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; margin: auto 0; }
.guide-logo { border-radius: 18px; box-shadow: 0 14px 40px rgba(10, 132, 255, .28); margin-bottom: 18px; }
.guide h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; }
.guide p { margin: 10px 0 22px; color: var(--dim); font-size: 15px; line-height: 1.4; }
.steps { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); animation: rise .6s var(--spring) backwards; }
.steps li:nth-child(2) { animation-delay: .08s; } .steps li:nth-child(3) { animation-delay: .16s; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.steps div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.steps b { font-size: 15.5px; font-weight: 600; }
.steps small { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.st-ico { width: 28px; height: 28px; color: var(--accent); flex: none; }
.st-img { border-radius: 7px; flex: none; }
.guide-other { margin-top: 18px; width: 100%; }
.guide-other p { margin: 0 0 12px; }
.guide-arrow { position: fixed; left: 0; right: 0; bottom: calc(var(--sab) + 8px); display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font-size: 13px; font-weight: 600; pointer-events: none; animation: bob 1.3s ease-in-out infinite; }
.guide-arrow svg { width: 34px; height: 34px; color: var(--accent); filter: drop-shadow(0 0 12px rgba(10, 132, 255, .7)); }
@keyframes bob { 50% { transform: translateY(8px); } }

/* hidden latency overlay */
#dbg { position: fixed; left: 12px; right: 12px; top: calc(var(--sat) + 62px); z-index: 90; margin: 0; padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, .82); border: 1px solid rgba(255, 255, 255, .18);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: #b8f5c8; white-space: pre; pointer-events: none; -webkit-user-select: none; user-select: none; }

/* header buttons */
.top-btns { display: flex; gap: 10px; }

/* pairing: name field */
.name-in { width: 100%; height: 52px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .07); padding: 0 16px; font-size: 19px; text-align: center; outline: 0; margin: 0 0 22px; color: var(--text); }
.name-in::placeholder { color: var(--faint); }
.name-in:focus { border-color: rgba(10, 132, 255, .7); box-shadow: 0 0 0 4px rgba(10, 132, 255, .2); }
.name-in.bad { animation: shake .5s; border-color: var(--red); }
.pin .pin-logo { width: 72px; height: 72px; margin-bottom: 14px; }
.pin p { margin-bottom: 18px; }
.dots { margin-bottom: 24px; }
@media (max-height: 780px) { .key { width: 66px; height: 66px; font-size: 27px; } .keys { grid-template-columns: repeat(3, 66px); gap: 10px 18px; } .pin .pin-logo { display: none; } }

/* now playing card */
.np { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 22px; min-height: 64px; animation: rise .5s var(--spring); }
.np-ico { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-weight: 700; }
.np-ico img { width: 100%; height: 100%; object-fit: cover; }
.np-ico.home { background: linear-gradient(150deg, #ff9f0a, #ff453a); color: #fff; }
.np-ico.home svg { width: 24px; height: 24px; }
.np-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.np-txt small { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.np-txt small i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: breathe2 1.6s ease-in-out infinite; }
@keyframes breathe2 { 50% { opacity: .35; } }
.np-txt b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.015em; margin-top: 2px; }
.np-txt span { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-peek { height: 38px; padding: 0 14px 0 11px; border-radius: 19px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; flex: none; transition: transform .35s var(--spring); }
.np-peek svg { width: 19px; height: 19px; }
.np-peek:active { transform: scale(.92); }
#app.has-np .favs { margin-top: -2px; }

/* people sheet */
.panel-head .sub { margin: -6px 0 0; font-size: 13px; color: var(--dim); }
.plist { flex: 1; overflow-y: auto; padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 10px; touch-action: pan-y; overscroll-behavior: contain; }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); transition: opacity .25s, transform .4s var(--spring); }
.prow.off { opacity: .6; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; background: linear-gradient(150deg, #3b5bdb, #7048e8); }
.prow.me .av { background: linear-gradient(150deg, #f59f00, #e8590c); }
.pmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pmeta b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta small { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.pmeta small i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.tog { position: relative; width: 52px; height: 32px; border-radius: 16px; background: rgba(120, 120, 128, .4); flex: none; transition: background .25s; }
.tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .4s var(--spring); }
.tog.on { background: var(--green); }
.tog.on::after { transform: translateX(20px); }
.del { height: 34px; min-width: 34px; padding: 0 8px; border-radius: 17px; color: var(--red); display: grid; place-items: center; font-size: 13px; font-weight: 600; transition: background .2s, color .2s; }
.del svg { width: 19px; height: 19px; }
.del.confirm { background: var(--red); color: #fff; padding: 0 12px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--amber); }
.phome { margin: 4px 16px 4px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.seg { display: flex; background: rgba(120, 120, 128, .28); border-radius: 12px; padding: 2px; flex: none; }
.seg button { padding: 7px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--dim); transition: background .25s, color .25s; }
.seg button.on { background: rgba(255, 255, 255, .92); color: #000; }
.pbulk { padding: 6px 16px calc(var(--sab) + 14px); display: flex; flex-direction: column; gap: 10px; }
.pbulk .pill { flex: none; height: 48px; }
.plist .empty { text-align: center; color: var(--faint); padding: 30px 0; }

/* peek */
.peekview { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .82); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); display: flex; flex-direction: column; padding: calc(var(--sat) + 12px) 14px calc(var(--sab) + 14px);
  opacity: 0; pointer-events: none; transform: scale(1.04); transition: opacity .3s, transform .5s var(--sheet); }
.peekview.open { opacity: 1; pointer-events: auto; transform: none; }
.peek-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.peek-bar b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; display: block; }
.peek-bar small { color: var(--dim); font-size: 12.5px; }
.peek-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #050505; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.peek-frame img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .3s; }
.peek-frame img.ready { opacity: 1; }
.peek-wait, .peek-black { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 14px; color: var(--dim); font-size: 14px; }
.peek-black { background: rgba(0, 0, 0, .55); color: #fff; font-weight: 600; font-size: 13.5px; }
.peek-wait.gone { display: none; }
.peek-foot { margin: 16px 4px 0; color: var(--dim); font-size: 13px; line-height: 1.5; }
.peek-foot b { color: var(--text); }

/* paused */
.paused { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 80% at 50% 0%, #1a1326, #000 70%); animation: fadein .35s; }
.paused-card { width: 100%; max-width: 340px; border-radius: 30px; padding: 32px 24px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: rise .6s var(--spring); }
.paused-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--dim); margin-bottom: 18px; }
.paused-ico svg { width: 36px; height: 36px; }
.paused h2 { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.paused p { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.4; }

@media (max-height: 700px) {
  .round { width: 54px; height: 54px; } .vol { height: 54px; } .apps-btn { height: 46px; }
  .controls { gap: 9px; } #app { gap: 4px; }
}
