/* KendaliPC
   Aturan visual:
   - Tampilan keycap (.cap) hanya untuk kontrol yang menekan tombol/klik di PC.
     Kontrol aplikasi sendiri (menu, setelan, file) datar.
   - LED kecil menyala = keadaan aktif (modifier terkunci, mode yang sedang dipakai).
   - Warna hanya membawa arti: aksen = aktif/utama, kuning/merah = masalah koneksi atau bahaya.
   - Area di sekitar gambar layar PC hitam polos, supaya warna layar PC tidak terpengaruh. */

:root {
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --r-key: 9px;
  --r-ctl: 10px;
  --r-panel: 14px;
  --kb: 0px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --top-h: calc(44px + var(--safe-t));
  --rail: calc(58px + var(--safe-r));
  --ease-out: cubic-bezier(.05, .7, .1, 1);
  --ease: cubic-bezier(.2, 0, 0, 1);
}
[data-theme=dark] {
  --deck: #17181b; --panel: #1e2024; --raise: #2a2d32; --pad: #0f1012; --line: #33363c;
  --key: #2d3036; --key-hi: #3c4047; --key-edge: #0a0b0d;
  --text: #eef0f3; --dim: #a9aeb7; --faint: #858a94;
  --accent: #4c9dff; --accent-edge: #1d5fb3; --on-accent: #03142b;
  --ok: #3fcf8e; --warn: #f2b84b; --bad: #ff6a5e; --on-bad: #2b0503;
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 4px 8px rgba(0, 0, 0, .28), 0 16px 32px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
[data-theme=light] {
  --deck: #e3e4e7; --panel: #f0f1f3; --raise: #ffffff; --pad: #d3d5d9; --line: #c6c9cf;
  --key: #fcfcfd; --key-hi: #ffffff; --key-edge: #aeb2b9;
  --text: #15171a; --dim: #4b5059; --faint: #646973;
  --accent: #1260d8; --accent-edge: #0b3f92; --on-accent: #ffffff;
  --ok: #0b7d4c; --warn: #8f5d00; --bad: #c2332a; --on-bad: #ffffff;
  --shadow: 0 1px 1px rgba(20, 24, 32, .08), 0 4px 8px rgba(20, 24, 32, .08), 0 16px 32px rgba(20, 24, 32, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--deck); color: var(--text); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
[data-icon] { display: grid; }

/* ------------------------------------------------------------ keycap */
.cap {
  position: relative; display: grid; place-items: center; min-height: 46px; padding: 0 8px;
  border: 0; border-radius: var(--r-key); background: var(--key); color: var(--text);
  font-size: 14px; font-weight: 620; line-height: 1.15;
  box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 var(--key-hi);
  transition: transform 60ms var(--ease), box-shadow 60ms var(--ease);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.cap.down, .cap:active, .cap.latched {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--key-edge), inset 0 1px 0 var(--key-hi);
}
.cap .led { position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 3px; background: var(--line); transition: width 120ms var(--ease), background 120ms; }
.cap.latched .led { background: var(--accent); }
.cap.locked .led { width: 14px; }
.cap-accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-edge); }
.cap-accent.down, .cap-accent:active { box-shadow: 0 1px 0 var(--accent-edge); }
.cap[disabled] { opacity: .45; pointer-events: none; }

/* ------------------------------------------------------------ kontrol datar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--raise); font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text);
}
.btn:active { opacity: .8; }
.btn svg.i { width: 18px; height: 18px; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-danger { background: var(--bad); color: var(--on-bad); }
.btn-wide { width: 100%; min-height: 50px; font-size: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.tool {
  min-width: 40px; height: 40px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--dim); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.tool:hover { color: var(--text); background: var(--raise); }
.tool.on { color: var(--accent); }
.tool[disabled] { opacity: .4; pointer-events: none; }
.linklike { border: 0; background: none; padding: 6px 4px; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.linklike.danger { color: var(--bad); }

/* ------------------------------------------------------------ login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; height: 100%; }
.login-box { width: 100%; max-width: 330px; display: grid; gap: 12px; }
.login-host { font-size: 34px; line-height: 1.1; font-weight: 720; letter-spacing: -.015em; overflow-wrap: anywhere; text-wrap: balance; }
.login-hint { color: var(--dim); max-width: 30ch; }
.pin-slots { display: none; gap: 8px; margin-top: 10px; }
.numeric .pin-slots { display: flex; }
.pin-slots i { flex: 1; max-width: 48px; height: 54px; border-radius: var(--r-ctl); background: var(--pad); display: grid; place-items: center; }
.pin-slots i::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--text); transform: scale(0); transition: transform 120ms var(--ease-out); }
.pin-slots i.filled::after { transform: scale(1); }
.pin-slots.shake { animation: shake 320ms var(--ease); }
@keyframes shake { 20% { transform: translateX(-8px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }
.pin-text {
  width: 100%; height: 54px; margin-top: 10px; padding: 0 14px; font-size: 20px; font-weight: 600; letter-spacing: .04em;
  background: var(--pad); border: 0; border-radius: var(--r-ctl);
}
.numeric .pin-text { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.login-error { min-height: 1.45em; color: var(--bad); font-weight: 600; font-size: 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px 8px; margin-bottom: 4px; }
.keypad .cap { min-height: 58px; font-size: 23px; font-weight: 560; }
.check { display: flex; align-items: center; gap: 10px; color: var(--dim); user-select: none; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.numeric #login-btn { display: none; }
@media (orientation: landscape) and (max-height: 560px) {
  .login { padding: 14px 24px; }
  .login-box.numeric { max-width: 620px; grid-template-columns: minmax(0, 1fr) 236px; column-gap: 44px; align-content: center; }
  .login-box.numeric > * { grid-column: 1; }
  .login-box.numeric .keypad { grid-column: 2; grid-row: 1 / span 6; align-self: center; gap: 9px 7px; }
  .login-box.numeric .keypad .cap { min-height: 50px; }
}

/* ------------------------------------------------------------ kerangka */
.app { position: fixed; inset: 0 0 var(--kb) 0; display: grid; background: var(--deck); }
.topbar { grid-area: top; display: flex; align-items: center; gap: 4px; min-width: 0; padding: var(--safe-t) max(6px, var(--safe-r)) 0 max(6px, var(--safe-l)); height: var(--top-h); }
.stage {
  grid-area: stage; position: relative; overflow: hidden; background: #000; min-width: 0; min-height: 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.deck { grid-area: deck; min-height: 0; min-width: 0; }
.nav { grid-area: nav; }
.screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; opacity: 0; transition: opacity 260ms var(--ease-out); }
.screen.live { opacity: 1; }
.cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .7)); will-change: transform; z-index: 2; }
.cursor svg { width: 100%; height: 100%; display: block; }
.app:not([data-layout=desk]) .desk-only { display: none; }

/* HP tegak: layar PC di atas, dek di bawah */
.app[data-layout=split] { grid-template: "top" auto "stage" var(--stage-h, 56vw) "deck" minmax(0, 1fr) "nav" auto / minmax(0, 1fr); }
.app[data-layout=split].kb-open .nav { display: none; }

/* HP mendatar: layar PC penuh, rel di kanan */
.app[data-layout=side] { grid-template: "stage nav" minmax(0, 1fr) / minmax(0, 1fr) auto; }
.app[data-layout=side] .topbar { display: none; }

/* PC: layar PC penuh, bilah atas mengambang */
.app[data-layout=desk] { grid-template: "stage" minmax(0, 1fr) / minmax(0, 1fr); }
.app[data-layout=desk] .nav { display: none; }

/* ------------------------------------------------------------ bilah atas */
.link { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: none; flex: none; }
.link:hover { background: var(--raise); }
.link-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.link-bars i { width: 3px; border-radius: 1px; background: var(--line); }
.link-bars i:nth-child(1) { height: 5px; } .link-bars i:nth-child(2) { height: 8px; }
.link-bars i:nth-child(3) { height: 11px; } .link-bars i:nth-child(4) { height: 14px; }
.link-bars[data-level="4"] i, .link-bars[data-level="3"] i:nth-child(-n+3) { background: var(--text); }
.link-bars[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.link-bars[data-level="1"] i:nth-child(1) { background: var(--bad); }
.link-text { display: flex; align-items: baseline; gap: 7px; font-size: 13.5px; white-space: nowrap; }
.link-text b { font-weight: 650; }
.link-text span { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tb-host { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 13px; text-align: right; padding: 0 6px; }
.tb-tools { display: flex; align-items: center; flex: none; }

.app[data-layout=desk] .topbar {
  position: fixed; top: 10px; left: 50%; z-index: 9; width: max-content; max-width: calc(100vw - 24px); height: 48px; padding: 0 4px;
  transform: translateX(-50%); background: var(--panel); border-radius: var(--r-panel); box-shadow: var(--shadow);
  transition: transform 250ms var(--ease-out), opacity 200ms;
}
.app[data-layout=desk] .topbar.away { transform: translate(-50%, calc(-100% - 20px)); opacity: 0; pointer-events: none; transition: transform 150ms var(--ease), opacity 150ms; }
.app[data-layout=desk] .tb-host { flex: none; max-width: 220px; text-align: left; padding: 0 12px 0 4px; }

/* ------------------------------------------------------------ navigasi */
.nav { display: flex; background: var(--deck); padding: 2px 4px calc(4px + var(--safe-b)); }
.nav-btn {
  position: relative; flex: 1; min-width: 0; height: 52px; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 0; background: none; color: var(--faint); font-size: 11.5px; font-weight: 600; border-radius: var(--r-ctl);
}
.nav-btn .nav-ico { display: grid; }
.nav-btn.on { color: var(--text); }
.nav-btn::before { content: ""; position: absolute; top: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 3px; background: transparent; transition: background 120ms, width 160ms var(--ease-out), margin 160ms var(--ease-out); }
.nav-btn.on::before { background: var(--accent); width: 16px; margin-left: -8px; }
.nav-link { display: none; }

.app[data-layout=side] .nav { flex-direction: column; justify-content: center; gap: 2px; width: var(--rail); padding: 4px var(--safe-r) 4px 0; }
.app[data-layout=side] .nav-btn { flex: none; height: 50px; margin: 0 4px; }
.app[data-layout=side] .nav-btn > span:last-child:not(.link-bars):not(.nav-ico) { display: none; }
.app[data-layout=side] .nav-btn::before { top: 50%; left: 1px; width: 4px; height: 5px; margin: -2.5px 0 0; }
.app[data-layout=side] .nav-btn.on::before { width: 4px; height: 18px; margin: -9px 0 0; }
.app[data-layout=side] .nav-link { display: grid; }

/* ------------------------------------------------------------ dek */
.pane { display: none; height: 100%; min-height: 0; padding: 10px max(12px, var(--safe-r)) 8px max(12px, var(--safe-l)); }
.app[data-deck=pad] .pane-pad, .app[data-deck=keys] .pane-keys, .app[data-deck=media] .pane-media, .app[data-deck=game] .pane-game, .app[data-deck=studio] .pane-studio { display: flex; }
.app[data-layout=split].typing .pane { display: none; }
.app[data-layout=split].typing .pane-keys { display: flex; }

/* touchpad */
.pane-pad { flex-direction: column; gap: 10px; }
.pad { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; }
.pad-surface { position: relative; overflow: hidden; border-radius: var(--r-panel); background: var(--pad); touch-action: none; user-select: none; -webkit-user-select: none; }
.pad-dot { position: absolute; left: -23px; top: -23px; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; transition: opacity 180ms; }
.pad-dot.on { opacity: .9; transition: none; }
.pad-dot.drag { background: var(--accent); opacity: .55; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--faint); font-size: 14px; pointer-events: none; text-wrap: balance; }
.pad-scroll { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0; border-radius: var(--r-panel); background: var(--pad); color: var(--faint); touch-action: none; }
.pad-scroll span { flex: 1; width: 2px; margin: 6px 0; border-radius: 1px; background: var(--line); }
.pad-scroll.down { color: var(--text); }
.pad-scroll.down span { background: var(--accent); }
.pad-buttons { display: grid; grid-template-columns: 1fr 58px 1fr; gap: 8px; padding-bottom: 3px; }
.pad-buttons .cap { min-height: 50px; touch-action: none; }
.pad-buttons .cap svg.i { width: 20px; height: 20px; color: var(--dim); }
.app.kb-open .pad-buttons .cap { min-height: 40px; }

/* tombol */
.pane-keys { flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; }
.type-row { display: flex; gap: 8px; align-items: center; flex: none; }
.cap-live { flex: none; width: 50px; min-height: 44px; }
.cap-live span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cap-live.latched { color: var(--accent); }
.compose { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; }
.compose input[type=text] { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 16px; }
.compose input[type=text]::placeholder { color: var(--faint); }
.compose .btn { min-height: 44px; }
.compose-enter { flex: none; display: grid; place-items: center; width: 40px; height: 44px; border-radius: var(--r-ctl); background: var(--raise); color: var(--faint); font-weight: 700; }
.compose-enter input { position: absolute; opacity: 0; pointer-events: none; }
.compose-enter:has(input:checked) { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px 6px; padding-bottom: 4px; flex: none; }
.keys .cap svg.i { width: 19px; height: 19px; }
.frow { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.frow::-webkit-scrollbar { display: none; }
.frow .cap { flex: 0 0 54px; font-size: 13px; color: var(--dim); }

/* media */
.pane-media { flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; }
.media-group { flex: none; }
.media-group h3 { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.media-row { display: grid; gap: 9px 6px; padding-bottom: 3px; }
.media-transport { grid-template-columns: 1fr 1.7fr 1fr; }
.media-transport .cap { min-height: 60px; }
.media-transport .cap svg.i { width: 26px; height: 26px; }
.cap-big { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-edge); }
.cap-big.down, .cap-big:active { box-shadow: 0 1px 0 var(--accent-edge); }
.media-volume { grid-template-columns: repeat(3, 1fr); }
.media-labels { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.media-labels .cap { min-height: 42px; font-size: 13.5px; }

/* gamepad */
.pane-game { display: none; flex-direction: column; gap: 10px; }
.game-bar { display: flex; gap: 8px; align-items: center; flex: none; }
.game-select { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-weight: 600; font-size: 14px; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.game-area { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; gap: 16px; }
.stick { position: relative; flex: none; width: 150px; height: 150px; border-radius: 50%; background: var(--pad); touch-action: none; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: var(--key); box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 var(--key-hi); transition: transform 120ms var(--ease-out); pointer-events: none; }
.stick.down .stick-knob { transition: none; }
.game-buttons { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 6px; padding-bottom: 4px; align-content: center; }
.gbtn { min-height: 44px; font-size: 13px; touch-action: none; }
.gbtn-wide { grid-column: span 2; }
/* posisi bebas (HP mendatar) */
.game-area.free { display: block; }
.game-area.free .game-buttons { display: contents; }
.game-area.free .gbtn, .game-area.free .stick { position: absolute; transform: translate(-50%, -50%); }
.game-area.free .gbtn { width: calc(58px * var(--s, 1)); height: calc(58px * var(--s, 1)); min-height: 0; border-radius: 50%; padding: 0 4px; font-size: calc(12.5px * min(var(--s, 1), 1.3)); }
.game-area.free .gbtn.down, .game-area.free .gbtn:active { transform: translate(-50%, calc(-50% + 2px)); }
.game-area.free .gbtn-wide { width: calc(96px * var(--s, 1)); border-radius: 29px; }
.game-area.free .stick { width: calc(150px * var(--s, 1)); height: calc(150px * var(--s, 1)); }
.pane-game.editing .gbtn, .pane-game.editing .stick { outline: 1.5px dashed var(--faint); outline-offset: 3px; cursor: grab; }
.pane-game.editing .selected { outline: 2px solid var(--accent) !important; }
.game-edit { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-panel); background: var(--panel); flex: none; min-width: 0; }
.game-edit .field-row { flex-wrap: wrap; min-width: 0; }
.game-edit .field-row input { min-width: 0; flex: 1 1 140px; }
.game-edit .seg { flex: none; }
.game-edit .field-row input { flex: 1; }
.game-edit .row { margin-top: 0; }
.game-edit .row .btn { flex: 1 1 90px; }
.ge-selected span { flex: 1 1 100%; font-weight: 650; font-size: 14px; }
.ge-selected .btn { flex: 1 1 0; }
.ge-selected .btn { min-width: 44px; }

/* dek di tata letak mendatar dan PC: mengambang di atas layar PC */
.app[data-layout=side] .deck, .app[data-layout=desk] .deck { display: none; grid-area: stage; z-index: 5; align-self: end; background: var(--deck); }
.app[data-layout=side].deck-open .deck, .app[data-layout=desk].deck-open .deck { display: block; }
.app[data-layout=side] .pane, .app[data-layout=desk] .pane { height: auto; padding: 8px max(8px, var(--safe-l)) 6px; }
.app[data-layout=side] .keys, .app[data-layout=desk] .keys { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.app[data-layout=side] .keys .cap, .app[data-layout=desk] .keys .cap { flex: 0 0 auto; min-width: 50px; min-height: 42px; }
.app[data-layout=side] .frow, .app[data-layout=desk] .frow { display: contents; }
.app[data-layout=side] .pane-keys, .app[data-layout=desk] .pane-keys { gap: 8px; overflow: visible; }
.app[data-layout=side][data-deck=media] .deck, .app[data-layout=side][data-deck=studio] .deck { align-self: stretch; justify-self: end; width: min(360px, 60%); overflow-y: auto; }
.app[data-layout=side][data-deck=media] .pane, .app[data-layout=side][data-deck=studio] .pane { padding: 12px; }
.app[data-layout=side][data-deck=game] .deck { align-self: stretch; background: none; pointer-events: none; }
.app[data-layout=side] .pane-game { height: 100%; padding: 8px max(8px, var(--safe-l)) 8px; }
.app[data-layout=side] .game-bar { pointer-events: auto; align-self: flex-start; opacity: .9; }
.app[data-layout=side] .game-select { flex: none; width: auto; max-width: 220px; }
.app[data-layout=side] .game-edit { pointer-events: auto; position: absolute; top: 8px; left: max(8px, var(--safe-l)); width: min(360px, 48%); z-index: 2; box-shadow: var(--shadow); max-height: calc(100% - 16px); overflow-y: auto; gap: 6px; padding: 8px; }
.app[data-layout=side] .game-edit .btn, .app[data-layout=side] .game-edit input { min-height: 34px; height: 34px; font-size: 13px; }
.app[data-layout=side] .game-edit .seg button { min-height: 28px; }
.app[data-layout=side] .game-edit .note { display: none; }
.app[data-layout=side] .game-area > *, .app[data-layout=side] .gbtn { pointer-events: auto; }
.app[data-layout=side] .game-area .gbtn, .app[data-layout=side] .game-area .stick { opacity: .85; }
.app[data-layout=side] .stick { background: color-mix(in srgb, var(--pad) 70%, transparent); }
.app[data-layout=side].game-editing .deck { background: color-mix(in srgb, #000 35%, transparent); pointer-events: auto; }
.app[data-layout=desk] .deck { justify-self: center; margin-bottom: 12px; max-width: min(960px, calc(100vw - 24px)); border-radius: var(--r-panel); background: var(--panel); box-shadow: var(--shadow); }
.app[data-layout=desk] .pane { display: none; }
.app[data-layout=desk] .pane-keys { display: flex; padding: 10px; }
.app[data-layout=desk] .cap-live { display: none; }

/* ------------------------------------------------------------ menu */
.sheet { z-index: 8; display: flex; flex-direction: column; min-height: 0; background: var(--panel); animation: sheet-in 240ms var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(14px); opacity: 0; } }
.app[data-layout=split] .sheet { position: fixed; left: 0; right: 0; top: calc(var(--top-h) + var(--stage-h, 56vw)); bottom: calc(56px + var(--safe-b) + var(--kb)); }
.app[data-layout=split] #sheet-close, .app[data-layout=side] #sheet-close { display: none; }
.app[data-layout=side] .sheet-head { padding-right: 8px; }
.app[data-layout=split] .sheet-head { padding-right: 8px; }
.app[data-layout=split] .tabs { justify-content: space-between; }
.app[data-layout=split].kb-open .sheet { bottom: var(--kb); top: var(--top-h); }
.app[data-layout=side] .sheet { position: fixed; top: 0; bottom: 0; right: var(--rail); width: min(400px, 64vw); box-shadow: var(--shadow); animation-name: panel-in; }
.app[data-layout=desk] .sheet { position: fixed; top: 12px; bottom: 12px; right: 12px; width: 430px; border-radius: 16px; box-shadow: var(--shadow); animation-name: panel-in; overflow: hidden; }
@keyframes panel-in { from { transform: translateX(16px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px 0 8px; box-shadow: inset 0 -1px 0 var(--line); flex: none; }
.tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 44px; padding: 0 11px; border: 0; background: none; color: var(--faint); font-weight: 600; font-size: 14.5px; }
.tabs button[aria-selected=true] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.sheet-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 14px max(14px, var(--safe-r)) 22px max(14px, var(--safe-l)); overscroll-behavior: contain; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.group-title { margin: 22px 0 8px; font-size: 13px; font-weight: 650; color: var(--dim); }
.tab-panel > .group-title:first-child, #sc-list > .group-title:first-child { margin-top: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row .btn { flex: 1 1 130px; }
.field-row { display: flex; gap: 6px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.note { margin: 6px 0 2px; color: var(--faint); font-size: 13px; }
.empty { padding: 22px 6px; color: var(--faint); font-size: 14px; text-wrap: pretty; list-style: none; }
.about { margin-top: 22px; color: var(--faint); font-size: 12.5px; }
input[type=text], input[type=url], input[type=search], textarea { caret-color: var(--accent); }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: var(--r-ctl); background: var(--pad); color: var(--faint); }
.search svg.i { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; color: var(--text); }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.field-row > input, .editor input, .field input {
  height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 15px; min-width: 0;
}
.field { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; }

/* pintasan */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px 7px; padding-bottom: 3px; }
.sc {
  display: grid; align-content: center; gap: 1px; width: 100%; min-height: 54px; padding: 6px 10px; text-align: left;
  border: 0; border-radius: var(--r-key); background: var(--key); color: var(--text);
  box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 var(--key-hi); transition: transform 60ms var(--ease), box-shadow 60ms var(--ease);
}
.sc:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge), inset 0 1px 0 var(--key-hi); }
.sc b { font-weight: 620; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc small { color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-wrap { position: relative; }
.sc-del { position: absolute; top: -7px; right: -5px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bad); color: var(--on-bad); }
.sc-del svg.i { width: 15px; height: 15px; }
.editor { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: var(--r-panel); background: var(--deck); }

.seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-ctl); background: var(--pad); }
.seg button { flex: 1; min-width: 0; min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--dim); font-weight: 600; font-size: 13.5px; }
.seg button.on { background: var(--raise); color: var(--text); }
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 120px; display: grid; padding: 5px 10px; }
.seg-wrap small { font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg + .seg { margin-top: 8px; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; margin-top: 12px; font-size: 14px; }
.slider output { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 13px; }
.slider input { grid-column: 1 / -1; width: 100%; height: 28px; accent-color: var(--accent); }
.slider input:disabled { opacity: .45; }
.switch { display: flex; gap: 12px; align-items: center; margin-top: 12px; font-size: 14px; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.act { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: var(--raise); text-align: left; font-weight: 560; font-size: 14px; }
.act:active { opacity: .8; }
.act [data-icon] { color: var(--dim); }
.act-danger [data-icon] { color: var(--bad); }
.confirm { margin-top: 10px; padding: 12px; border-radius: var(--r-panel); background: var(--deck); list-style: none; }
.confirm p { font-weight: 560; font-size: 14px; }
.help { margin-top: 22px; }
.help summary { font-weight: 650; font-size: 13px; color: var(--dim); cursor: pointer; padding: 6px 0; }
.help-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13.5px; }
.help-table th, .help-table td { text-align: left; padding: 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.help-table th { width: 46%; padding-right: 10px; font-weight: 600; }
.help-table td { color: var(--dim); }

/* file */
.crumbs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 8px; white-space: nowrap; }
.crumbs::-webkit-scrollbar { display: none; }
.crumb { flex: none; border: 0; background: none; padding: 6px 5px; color: var(--dim); font-size: 13.5px; font-weight: 560; border-radius: 6px; }
.crumb.on { color: var(--text); font-weight: 680; }
.crumb-sep { color: var(--faint); font-size: 12px; }
.newdir { margin-top: 8px; }
.newdir input { flex: 1; }
.files-list, .clip-list, .procs { list-style: none; margin: 8px 0 0; padding: 0; }
.files-list a, .files-list button {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 48px;
  padding: 6px 4px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--text); border-radius: 8px;
}
.files-list li + li { border-top: 1px solid var(--line); }
.files-list a:hover, .files-list button:hover { background: var(--raise); }
.files-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.files-list .meta { display: grid; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.files-list .ico-dir { color: var(--text); }
.files-list .ico-file { color: var(--faint); }
.files-list .hidden-file { opacity: .55; }
.uploads { display: grid; gap: 8px; margin-top: 8px; }
.upload { display: grid; gap: 5px; font-size: 13px; }
.upload-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar, .meter { height: 5px; border-radius: 3px; background: var(--pad); overflow: hidden; }
.bar i, .meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 150ms linear; }
.upload.done .bar i { background: var(--ok); }
.upload.fail { color: var(--bad); }
.dropzone { position: absolute; inset: 8px; display: grid; place-items: center; border-radius: var(--r-panel); background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 650; pointer-events: none; }
.preview { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #000; }
.preview img { width: 100%; height: 100%; object-fit: contain; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px max(12px, var(--safe-r)) calc(10px + var(--safe-b)) max(12px, var(--safe-l)); background: var(--deck); }
.preview-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--dim); }

/* clipboard */
.clip-text { width: 100%; min-height: 84px; max-height: 30vh; resize: vertical; padding: 10px 12px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 15px; display: block; }
.clip-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.clip-list li + li { border-top: 1px solid var(--line); }
.clip-list p { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* monitor */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-panel); overflow: hidden; }
.tile { display: grid; gap: 1px; padding: 10px 12px 8px; background: var(--panel); min-width: 0; }
.tile-label { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.tile-when { color: var(--faint); }
.tile-value { font-size: 21px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.25; }
.spark { position: relative; height: 34px; margin-top: 2px; touch-action: pan-y; cursor: crosshair; }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.spark.probing .spark-dot { background: var(--text); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 14px 0 0; font-size: 14px; }
.facts dt, .facts dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--dim); }
.facts dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 12px; }
.disk { margin-top: 10px; }
.disk-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13.5px; }
.disk-top span { color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.meter i { background: var(--dim); transition: none; }
.disk.full .meter i { background: var(--warn); }
.disk.full .disk-top span { color: var(--warn); }
.procs-head { display: grid; grid-template-columns: minmax(0, 1fr) 52px 70px 56px; align-items: end; gap: 6px; }
.procs-head span { font-size: 12px; color: var(--faint); text-align: right; padding-bottom: 8px; }
.procs li:not(.confirm):not(.empty) { display: grid; grid-template-columns: minmax(0, 1fr) 52px 70px 56px; align-items: center; gap: 6px; min-height: 40px; border-top: 1px solid var(--line); font-size: 14px; }
.proc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-name small { color: var(--faint); }
.proc-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); font-size: 13px; }
.proc-self { text-align: right; font-size: 12px; color: var(--faint); }
.procs .linklike { text-align: right; padding-right: 0; }

/* ------------------------------------------------------------ lapisan di atas layar PC */
.overlay { grid-area: stage; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px; background: rgba(0, 0, 0, .78); text-align: center; color: #eef0f3; }
.overlay p { font-weight: 560; max-width: 28ch; text-wrap: balance; font-size: 14.5px; }
.pulse { display: flex; gap: 6px; }
.pulse i { width: 8px; height: 8px; border-radius: 2px; background: #eef0f3; animation: pulse 1.05s var(--ease) infinite; }
.pulse i:nth-child(2) { animation-delay: .15s; } .pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.banner { grid-area: stage; z-index: 4; align-self: start; justify-self: center; margin: 8px; max-width: min(92%, 480px); padding: 7px 12px; border-radius: var(--r-ctl); background: var(--warn); color: #1d1300; font-size: 13px; font-weight: 600; text-align: center; }
[data-theme=light] .banner { color: #fff; }
.toasts { position: fixed; left: 50%; z-index: 30; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; width: max-content; max-width: min(92vw, 440px); pointer-events: none; top: calc(12px + var(--safe-t)); }
.app[data-layout=split] .toasts { top: auto; bottom: calc(70px + var(--safe-b) + var(--kb)); }
.toast { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--text); color: var(--deck); font-weight: 600; font-size: 13.5px; text-wrap: balance; text-align: center; box-shadow: var(--shadow); animation: toast-in 180ms var(--ease-out); }
.toast.error { background: var(--bad); color: var(--on-bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.sink { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; border: 0; padding: 0; font-size: 16px; resize: none; z-index: -1; caret-color: transparent; color: transparent; background: transparent; }

@media (max-width: 370px) {
  .tb-host { display: none; }
  .tb-tools { margin-left: auto; }
  .nav-btn { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ fitur 2.1 */
.chips { grid-area: stage; z-index: 4; align-self: start; justify-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 8px; pointer-events: none; }
.chip {
  pointer-events: auto; height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 16px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 650; box-shadow: var(--shadow);
}
.chip-rec { background: var(--bad); color: var(--on-bad); font-variant-numeric: tabular-nums; }
.chip-rec::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.chip-laser::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #e5251e; box-shadow: 0 0 0 2px rgba(229, 37, 30, .35); }
.chip-select { grid-area: stage; z-index: 4; align-self: end; justify-self: center; margin-bottom: 10px; padding-right: 4px; }
.chip-select button { height: 26px; padding: 0 10px; border: 0; border-radius: 13px; background: var(--raise); font-weight: 650; font-size: 12.5px; }
.app[data-layout=desk] .chips { margin-top: 68px; }
.select-layer { position: absolute; inset: 0; z-index: 3; cursor: crosshair; touch-action: none; background: rgba(0, 0, 0, .25); }
.select-rect { position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 4px; pointer-events: none; }
.cursor.laser svg { display: none; }
.cursor.laser::after { content: ""; position: absolute; left: -6px; top: -7px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #ffb1a8 0 22%, #e5251e 30% 60%, rgba(229, 37, 30, 0) 72%); }

.type-row .cap-live { width: 46px; }
.cap-live.listening { color: var(--bad); animation: listen 1.2s var(--ease) infinite; }
@keyframes listen { 50% { box-shadow: 0 3px 0 var(--key-edge), 0 0 0 4px color-mix(in srgb, var(--bad) 30%, transparent); } }

.audio-row { display: flex; gap: 8px; align-items: center; }
.audio-row .seg { flex: 1; }
.cap-toggle { grid-auto-flow: column; gap: 8px; padding: 0 14px; min-height: 46px; }
.cap-toggle svg.i { width: 20px; height: 20px; }
.cap-toggle.latched { color: var(--accent); }
.media-labels .cap-toggle { min-height: 42px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 7px; padding-bottom: 3px; }
.app-grid .empty { grid-column: 1 / -1; padding: 6px 2px; }
.app-tile { justify-items: start; gap: 6px; padding: 10px; min-height: 84px; align-content: start; }
.app-tile b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; }
.app-letter { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--pad); font-style: normal; font-weight: 750; font-size: 15px; color: var(--dim); }
.app-list { list-style: none; margin: 4px 0 0; padding: 0; }
.app-list li { display: flex; align-items: center; }
.app-list li + li { border-top: 1px solid var(--line); }
.app-open { flex: 1; min-width: 0; min-height: 46px; padding: 0 4px; border: 0; background: none; text-align: left; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-open:hover { color: var(--accent); }
.app-star { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--faint); }
.app-star svg.i { width: 20px; height: 20px; }
.app-star.on { color: var(--warn); }
.app-star.on svg.i { fill: currentColor; }

.dev-list { list-style: none; margin: 0; padding: 0; }
.dev-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.dev-list li + li { border-top: 1px solid var(--line); }
.dev-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dev-main b { font-weight: 620; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-main small { color: var(--faint); font-size: 12.5px; }
.dev-list li.online .dev-main small { color: var(--ok); }
.tag { font-size: 11.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; background: var(--raise); color: var(--dim); }
.link-box { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--pad); font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; color: var(--dim); user-select: all; }
.steps { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--dim); }
.steps li { margin: 4px 0; }
.steps b { color: var(--text); font-weight: 620; }
.field select { height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 14.5px; }
.acts-tight { margin-top: 8px; }
.win-list { list-style: none; margin: 8px 0 0; padding: 0; }
.win-list li + li { border-top: 1px solid var(--line); }
.win-list button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 6px 4px; border: 0; background: none; text-align: left; }
.win-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.win-size { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.win-list .empty { padding: 12px 4px; }

/* ------------------------------------------------------------ fitur 2.2 */
.nav-btn { font-size: 11px; }
.pane-studio { flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; }
.studio { display: flex; flex-direction: column; gap: 10px; }
.studio .group-title { margin: 6px 0 -2px; }
.studio-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px 6px; padding-bottom: 3px; }
.studio-actions .cap { min-height: 48px; }
.studio-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px 6px; padding-bottom: 3px; }
.studio-keys .cap { min-height: 42px; font-size: 13px; }
.render-card { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-panel); background: var(--pad); }
.rc-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rc-top b { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-top span { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-meter { background: var(--deck); }
.render-card.active .rc-meter i { background: var(--accent); }
.rc-meter i { background: var(--ok); transition: transform 400ms var(--ease); }
.render-card .note { margin: 0; }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.queue li + li { border-top: 1px solid var(--line); }
.q-main { flex: 1; min-width: 0; display: grid; }
.q-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-main small { font-size: 12.5px; color: var(--faint); }
.q-running .q-main small { color: var(--accent); }
.q-failed .q-main small { color: var(--bad); }
.q-done .q-main small { color: var(--ok); }
.queue .empty { padding: 8px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.gallery .empty { grid-column: 1 / -1; padding: 6px 0; }
.thumb { aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--pad); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.files-list.grid li { border-top: 0 !important; }
.files-list.grid li:not(.tile-img) { grid-column: 1 / -1; }
.files-list .tile-img button { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 0; min-height: 0; }
.tile-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--pad); display: block; }
.tile-img .name { font-size: 12px; color: var(--dim); }
.blend-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 10px 34px; }
.blend-actions .btn { flex: 1 1 120px; min-height: 38px; font-size: 13px; }
.sched-form { display: grid; gap: 2px; }
.sched-form .btn { margin-top: 12px; }
.sched-form input[type=time], .sched-form input[type=number] { height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 15px; }
.sched-active { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-panel); background: var(--deck); }
.sched-active p { font-weight: 560; font-size: 14px; }

/* HP sebagai layar kedua: hanya gambar layar PC */
.app.second { grid-template: "stage" minmax(0, 1fr) / minmax(0, 1fr) !important; }
.app.second .topbar, .app.second .nav, .app.second .deck, .app.second .chips, .app.second .banner { display: none !important; }
.second-exit {
  position: fixed; top: calc(6px + var(--safe-t)); right: calc(6px + var(--safe-r)); z-index: 30; height: 30px; padding: 0 12px;
  border: 0; border-radius: 15px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; opacity: .35;
}
.second-exit:hover, .second-exit:focus-visible { opacity: 1; }

/* ------------------------------------------------------------ fitur 2.3 */
.cam-pip { position: absolute; right: 8px; bottom: 8px; z-index: 3; width: min(38%, 220px); border-radius: 10px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.cam-pip.big { width: min(80%, 560px); }
.cam-pip canvas { display: block; width: 100%; height: auto; }
.cam-bar { display: flex; align-items: center; gap: 2px; padding: 2px 2px 2px 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11.5px; font-weight: 600; }
.cam-bar span { flex: 1; }
.cam-bar button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: #fff; }
.cam-bar svg.i { width: 16px; height: 16px; }
.dim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, .86); color: #9aa0a8; font-size: 14px; text-align: center; padding: 24px; }
.macro-box { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.macro-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.macro-head .group-title { margin: 4px 0; }
.macro-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.macro-list li { display: flex; gap: 6px; align-items: center; }
.macro-run { flex: 1; }
.macro-run.playing { box-shadow: 0 1px 0 var(--key-edge), inset 0 0 0 2px var(--accent); transform: translateY(2px); }
#macro-save { margin-top: 8px; }
.dest-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.dest-row select { height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 14px; min-width: 0; }
.tool.on { color: var(--warn); }
.tool.on svg.i { fill: currentColor; }
.clipimg-preview { display: grid; gap: 8px; margin-top: 8px; }
.clipimg-preview img { max-width: 100%; max-height: 240px; object-fit: contain; border-radius: var(--r-ctl); background: var(--pad); justify-self: start; }
.clipimg-preview .btn { justify-self: start; }
.switch-inline { margin-top: 0; flex: 1 1 160px; }
.notes { min-height: 160px; max-height: 50vh; font-size: 15px; line-height: 1.5; }
.guest-form { display: flex; gap: 6px; flex-wrap: wrap; }
.guest-form select { flex: 1 1 110px; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: var(--pad); font-size: 14px; }
.guest-new { display: grid; gap: 6px; margin-top: 8px; }
.guest-new .row { margin-top: 0; }
.meet-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.cap-two { display: grid; align-content: center; gap: 0; min-height: 50px; line-height: 1.15; }
.cap-two small { font-size: 11px; color: var(--faint); font-weight: 600; }
.cap-two b { font-size: 13.5px; font-weight: 650; }
#game-tilt.on { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* tamu: sembunyikan semua yang bukan untuk tamu */
.app.guest .tabs [data-tab=apps], .app.guest .tabs [data-tab=files], .app.guest .tabs [data-tab=clipboard],
.app.guest .tabs [data-tab=monitor], .app.guest .tabs [data-tab=devices], .app.guest #power-box, .app.guest .sched-form,
.app.guest .sched-active, .app.guest #a-windows, .app.guest #a-area, .app.guest #a-shot, .app.guest #a-rec, .app.guest .macro-box,
.app.guest #sc-add, .app.guest #cam-group, .app.guest #meet-group, .app.guest .group-title:has(+ .sched-active),
.app.guest-view .tabs [data-tab=shortcuts], .app.guest-view .deck, .app.guest-view .nav-btn:not([data-nav=menu]):not([data-nav=link]) { display: none !important; }
.app.guest-view[data-layout=split] { grid-template: "top" auto "stage" minmax(0, 1fr) "nav" auto / minmax(0, 1fr); }
