:root { color-scheme: dark; --bg: #100d18; --surface: #191523; --surface-2: #241e33; --line: #3e3551; --text: #f3f0ff; --muted: #b1a8c8; --accent: #b69cff; --live: #c7f36b; --columns: 5; --rows: 2; --icon-size: 64px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { background: radial-gradient(ellipse at 78% -30%, #7749b533, transparent 58%), radial-gradient(ellipse at 0% 110%, #9ac64620, transparent 56%), var(--bg); }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: default; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { transition: background-color .18s ease, transform .18s cubic-bezier(.2,.7,.2,1), border-color .18s ease; }
button:active:not(:disabled) { transform: scale(.985); }
.icon { display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.eyebrow { margin: 0 0 5px; font-size: 9px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 650; letter-spacing: -.6px; }
.brand > [data-icon] { color: var(--accent); }
.brand__dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin-left: -7px; align-self: end; margin-bottom: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 19px; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; font-weight: 600; font-size: 13px; }
.button .icon { width: 18px; height: 18px; }
.button--primary { background: var(--accent); color: #20172f; }
.button--small { min-height: 36px; padding: 7px 13px; font-size: 11px; border-radius: 10px; }
.button--danger { background: #ed9695; color: #301516; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid transparent; background: transparent; border-radius: 12px; color: var(--muted); }
.icon-button .icon { width: 21px; height: 21px; }
.app { max-width: 1400px; margin: auto; height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) max(30px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(30px, env(safe-area-inset-left)); overflow: hidden; }
.bar { display: flex; align-items: center; gap: 14px; min-height: 73px; border-bottom: 1px solid #ffffff0d; }
.bar__divider { height: 18px; width: 1px; background: var(--line); }
.bar__host { font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar__state { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar__state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.bar__state[data-state="on"] { color: var(--live); }
#edit { background: #ffffff07; border-color: #ffffff0c; color: var(--muted); }
#edit[aria-pressed="true"] { background: var(--accent); color: #20172f; }
.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dock-heading { display: flex; align-items: end; justify-content: space-between; padding: 27px 9px 10px; }
.dock-heading h1 { font-size: 25px; font-weight: 450; letter-spacing: -.6px; margin: 2px 0 0; }
.dock-heading > p { color: #a0afaf; font-size: 10px; margin: 0 0 3px 10px; }
.dock { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; scroll-behavior: smooth; overscroll-behavior-x: contain; }
.dock::-webkit-scrollbar { display: none; }
.dock-page { display: grid; flex: 0 0 100%; width: 100%; min-width: 0; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); align-items: center; justify-items: center; gap: 7px 14px; padding: 10px 13px; scroll-snap-align: start; scroll-snap-stop: always; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; max-height: 160px; min-height: 0; min-width: 0; padding: 7px; border: 1px solid transparent; border-radius: 20px; background: transparent; color: var(--text); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile__glyph { display: grid; place-items: center; height: var(--icon-size); width: var(--icon-size); flex-shrink: 0; }
.tile__glyph > .icon { width: 42%; height: 42%; }
.tile--control .tile__glyph { border-radius: 23%; color: var(--accent); background: linear-gradient(145deg, #403458, #29213a); border: 1px solid #b69cff45; box-shadow: 0 6px 14px #0002; }
.app-icon { position: relative; display: inline-grid; place-items: center; width: 100%; height: 100%; flex-shrink: 0; }
.app-icon img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 5px #0003); pointer-events: none; }
.app-icon__fallback { display: none; place-items: center; width: 100%; height: 100%; border-radius: 23%; color: #dce9e2; background: #385749; font-size: 30px; font-weight: 550; }
.app-icon.icon-failed .app-icon__fallback { display: grid; }
.app-icon.icon-failed img { display: none; }
.tile__label { font-size: 12px; font-weight: 500; line-height: 1.3; flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #0005; }
.tile__hint { display: none; }
.tile__dot { position: absolute; bottom: -2px; width: 4px; height: 4px; background: var(--live); border-radius: 50%; }
.tile__edit { display: none; }
.tile.is-editing { cursor: grab; touch-action: none; animation: wobble .38s ease-in-out infinite alternate; }
.tile.is-editing:nth-child(even) { animation-delay: -.25s; }
.tile.is-editing::after { content: "−"; position: absolute; left: calc(50% - var(--icon-size) / 2 - 5px); top: max(2px, calc(50% - var(--icon-size) / 2 - 17px)); display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #cbd7d0; border: 1px solid #ffffff3b; color: #203128; font-size: 17px; }
.tile.is-dragging { opacity: .2; animation: none; }
.drag-ghost { position: fixed; z-index: 30; pointer-events: none; transform: translate(-50%, -50%) scale(1.12); filter: drop-shadow(0 15px 15px #0006); animation: none !important; opacity: .95; }
.drag-ghost::after { display: none; }
.dock.is-editing { touch-action: none; }
.page-dots { display: flex; align-items: center; justify-content: center; min-height: 32px; gap: 1px; }
.page-dot { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; }
.page-dot::before { content: ""; width: 5px; height: 5px; background: #697d75; border-radius: 50%; transition: width .15s; }
.page-dot[aria-current="page"]::before { width: 17px; background: var(--accent); }
.empty { width: 100%; align-self: center; text-align: center; padding: 18px; }
.empty__icon { display: inline-flex; padding: 15px; background: #b69cff0c; border: 1px solid #b69cff21; border-radius: 19px; color: var(--accent); }
.empty h3 { font-size: 21px; font-weight: 500; letter-spacing: -.4px; margin: 15px 0 7px; }
.empty p { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.foot { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 91px; padding-bottom: 25px; border-top: 1px solid #ffffff0b; touch-action: pan-x; }
.foot__button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; min-width: 140px; padding: 10px 18px; border: 1px solid #ffffff12; border-radius: 14px; background: #ffffff07; color: #d0dcd5; font-size: 12px; }
.foot__button .icon { width: 19px; height: 19px; color: var(--accent); }
.swipe-hint { position: absolute; display: flex; align-items: center; flex-direction: column; bottom: 0; left: 50%; transform: translateX(-50%); padding: 5px 20px 7px; min-width: 180px; font-size: 8px; letter-spacing: .05em; gap: 5px; background: none; border: 0; color: var(--muted); }
.swipe-hint > span { width: 37px; height: 3px; background: #64776d; border-radius: 3px; }
.swipe-hint:active { transform: translateX(-50%) !important; }
.nowplaying:empty { display: none; }
.nowplaying { max-width: 280px; }
.np { display: flex; gap: 10px; align-items: center; padding: 0 12px; }
.np__icon { color: var(--accent); }
.np__icon .icon { width: 19px; height: 19px; }
.np__text { display: flex; flex-direction: column; min-width: 0; }
.np__text .eyebrow { font-size: 7px; margin: 0; }
.np__title { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 135px; }
.np__artist { font-size: 9px; color: var(--muted); }
.sheet, .options, .confirm { color: var(--text); background: #152023; border: 1px solid #43524d; border-radius: 24px; box-shadow: 0 20px 80px #0008; padding: 0; }
.sheet::backdrop, .options::backdrop, .confirm::backdrop { background: #040a0cc4; backdrop-filter: blur(9px); }
.sheet { width: min(92vw, 850px); max-height: 91dvh; overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet-handle { flex-shrink: 0; width: 33px; height: 3px; background: #607267; border-radius: 4px; margin: 10px auto 0; }
.sheet__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 25px; }
.sheet__heading .eyebrow { font-size: 8px; }
h2 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -.6px; }
.sheet__heading .icon-button { background: #ffffff07; }
.picker__tools { display: flex; gap: 17px; margin: 0 25px; }
.picker__tabs { display: flex; flex: 1; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid #ffffff08; border-radius: 12px; }
.picker__tab { flex: 1; min-height: 38px; padding: 7px 15px; border: 0; color: var(--muted); background: none; border-radius: 9px; font-size: 12px; }
.picker__tab.is-active { color: var(--accent); background: var(--surface-2); }
.search-box { display: flex; flex: 1; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-box .icon { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; height: 42px; border: 0; background: none; color: var(--text); font-size: 14px; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-box input:focus-visible { outline: 0; }
.picker__status { font-size: 10px; color: var(--muted); margin: 11px 26px 4px; }
.folder-picker { padding: 12px 26px 24px; overflow-y: auto; min-height: 0; }
.folder-picker h3 { margin: 0 0 8px; font-size: 18px; }
.folder-picker p { max-width: 52ch; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.folder-picker .button { min-height: 44px; margin: 8px 0; }
.link-form { display: grid; gap: 8px; max-width: 36rem; }
.link-form label { font-size: 13px; }
.link-form label span { color: var(--muted); }
.link-form input { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--muted); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.picker__tabs { flex-wrap: wrap; }
.picker__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0 14px 18px; list-style: none; min-height: 60px; }
.picker__list li > button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 13px; text-align: left; min-height: 63px; }
.picker__list li > button:disabled { opacity: 1; color: var(--muted); }
.picker__list .app-icon { width: 39px; height: 39px; }
.picker__name { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.picker__name small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.picker__add { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); flex-shrink: 0; }
.picker__add .icon { width: 16px; height: 16px; }
.picker__list button:disabled .picker__add { color: var(--accent); background: #b69cff0a; border-color: #b69cff24; }
.picker__symbol { display: grid; place-items: center; width: 39px; height: 39px; background: var(--surface-2); border-radius: 11px; color: var(--accent); }
.picker__symbol .icon { width: 22px; height: 22px; }
.picker__group { grid-column: 1 / -1; padding: 17px 12px 5px; color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.picker__empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }
.settings__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 25px 25px; overflow: auto; }
.settings-credit { grid-column: 1 / -1; margin: 0; padding: 4px 2px 0; color: #d5ddf2; font-size: 11px; letter-spacing: .02em; }
.settings-credit span { color: var(--accent); }
.settings__card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 17px; }
.settings__card h3 { margin: 0; font-size: 15px; font-weight: 550; }
.settings__card > p { margin: 5px 0 13px; color: var(--muted); font-size: 11px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; min-height: 49px; border-top: 1px solid #ffffff0a; }
.setting-row select { max-width: 155px; min-height: 36px; background: var(--surface-2); color: var(--accent); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; font-size: 11px; }
.setting-action { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 61px; padding: 9px 0; border: 0; border-top: 1px solid #ffffff0a; background: none; font-size: 12px; }
.setting-action > [data-icon] { color: var(--accent); }
.setting-action .icon { width: 20px; height: 20px; }
.setting-action small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.setting-action > [data-icon]:last-child { margin-left: auto; width: 16px; }
.settings__card .settings__tip { font-size: 9px; line-height: 1.8; margin-top: 10px; margin-bottom: 0; }
.controls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 0 25px 25px; overflow: auto; }
.control-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 15px; }
.control-card__heading { display: flex; align-items: center; gap: 11px; }
.control-card__symbol { color: var(--accent); }
.control-card h3 { margin: 0; font-size: 14px; font-weight: 550; }
.control-card p { font-size: 9px; color: var(--muted); margin: 3px 0 0; }
.control-card__actions { display: flex; gap: 6px; margin-top: 15px; }
.control-card__actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; min-width: 0; min-height: 65px; padding: 8px 3px; border: 1px solid #ffffff07; background: var(--surface-2); border-radius: 11px; font-size: 10px; color: #dae4df; }
.control-card__actions .icon { width: 21px; height: 21px; }
.options, .confirm { width: min(90vw, 360px); padding: 0; text-align: center; max-height: 94dvh; overflow: hidden; }
.options__icon { display: block; width: 52px; height: 52px; margin: 0 auto 13px; }
.options h2 { font-size: 21px; }
.options p, .confirm p { color: var(--muted); font-size: 12px; }
.options__actions { display: grid; gap: 5px; margin-top: 17px; }
.options__actions button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; background: var(--surface-2); border: 0; border-radius: 10px; font-size: 12px; }
.options__actions .icon { width: 17px; height: 17px; }
.danger-text { color: #f1aaa6; }
.options__done { width: 100%; margin-top: 12px; background: #b69cff14; color: var(--accent); }
.confirm__icon { display: inline-flex; color: #f1aaa6; margin-bottom: 15px; }
.confirm__actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm__actions button { flex: 1; }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 40px); padding: 12px 18px; border: 1px solid #597462; border-radius: 13px; background: #2b4236; color: #e0f8e7; box-shadow: 0 5px 25px #0005; font-size: 12px; text-align: center; pointer-events: none; }
.toast[data-error="true"] { background: #462c2c; border-color: #8d5a5a; color: #ffe6e6; }
.pair { display: flex; align-items: center; justify-content: center; gap: 10vw; min-height: 100dvh; padding: 25px max(30px, env(safe-area-inset-left)); }
.pair__intro h1 { font-size: 49px; font-weight: 450; line-height: 1.05; letter-spacing: -2px; margin: 30px 0 18px; }
.pair__intro h1 em { font-style: normal; color: var(--accent); }
.pair__intro > p { color: var(--muted); font-size: 11px; }
.pair__card { width: 300px; text-align: center; }
.pair__hint { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 12px 0 18px; }
.pair__pin { width: 100%; height: 58px; padding-left: 12px; font-size: 27px; letter-spacing: 12px; text-align: center; background: var(--surface); color: var(--text); border: 1px solid #57715f; border-radius: 14px; }
.pair__pin::placeholder { color: #8ba794; }
.pair__error { min-height: 18px; margin: 7px 0; font-size: 11px; color: #f1aaa6; }
.pair__go { width: 100%; }
.pair__note { font-size: 9px; color: var(--muted); }
.rotate { display: none; }
@keyframes wobble { from { transform: rotate(-1.3deg); } to { transform: rotate(1.3deg); } }
@media (hover: hover) { .tile:hover { background: #ffffff06; } .picker__list button:not(:disabled):hover, .icon-button:hover, .foot__button:hover { background: #ffffff0c; } .button--primary:hover { background: #d8ff99; } }
@media (max-height: 550px) and (orientation: landscape) {
  .app { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .bar { min-height: 51px; gap: 12px; }
  .brand { font-size: 18px; }
  .brand .icon { width: 21px; height: 21px; }
  .brand__dot { margin-bottom: 7px; }
  .bar .icon-button { width: 38px; height: 38px; }
  .dock-heading { padding: 10px 8px 0; }
  .dock-heading h1 { font-size: 18px; }
  .dock-heading .eyebrow { font-size: 7px; }
  .dock-heading > p { font-size: 9px; }
  .dock-page { gap: 3px 10px; padding: 5px 8px; }
  .tile { gap: 5px; padding: 4px; }
  .tile__glyph { width: min(var(--icon-size), calc((100dvh - 204px) / var(--rows) - 24px)); height: min(var(--icon-size), calc((100dvh - 204px) / var(--rows) - 24px)); }
  .tile__label { font-size: 10px; }
  .tile__dot { bottom: 0; width: 3px; height: 3px; }
  .page-dots { min-height: 24px; }
  .page-dot { width: 28px; height: 24px; }
  .foot { min-height: 66px; padding-bottom: 19px; gap: 10px; }
  .foot__button { min-height: 38px; min-width: 125px; padding: 8px 14px; font-size: 11px; }
  .swipe-hint { font-size: 7px; padding-bottom: 3px; gap: 3px; }
  .swipe-hint > span { height: 2px; }
  .sheet { max-height: 96dvh; }
  .sheet__heading { padding: 10px 22px; }
  .sheet__heading h2 { font-size: 22px; }
  .sheet__heading .eyebrow { font-size: 7px; }
  .sheet-handle { margin-top: 6px; }
  .picker__status { margin-top: 6px; }
  .options { width: 400px; }
  .options__icon { width: 38px; height: 38px; margin-bottom: 6px; }
  .options h2 { font-size: 18px; }
  .options > p { display: none; }
  .options__actions { margin-top: 12px; grid-template-columns: 1fr 1fr; }
  .options__actions button:last-child { grid-column: 1 / -1; }
  .empty { padding: 10px; }
  .empty__icon { display: none; }
  .empty h3 { margin-top: 0; font-size: 19px; }
  .empty p { font-size: 11px; margin-bottom: 12px; }
}
@media (max-height: 360px) and (orientation: landscape) {
  .bar { min-height: 46px; }
  .dock-heading { min-height: 32px; padding-top: 5px; }
  .dock-heading .eyebrow { display: none; }
  .dock-heading h1 { font-size: 15px; }
  .dock-heading > p { font-size: 8px; }
  .tile__glyph { width: min(var(--icon-size), calc((100dvh - 176px) / var(--rows) - 25px)); height: min(var(--icon-size), calc((100dvh - 176px) / var(--rows) - 25px)); }
  .foot { min-height: 60px; }
  .page-dots, .page-dot { min-height: 20px; height: 20px; }
}
@media (orientation: portrait) and (max-width: 599px) {
  .pair { min-height: 100dvh; flex-direction: column; justify-content: center; gap: 18px; padding: 24px max(18px, env(safe-area-inset-left)); }
  .pair__intro { text-align: center; }
  .pair__intro h1 { font-size: 32px; letter-spacing: -1px; margin: 10px 0 6px; }
  .pair__intro > p { display: none; }
  .pair__card { width: min(100%, 360px); }
  .app { padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(14px, env(safe-area-inset-left)); }
  .bar { min-height: 58px; gap: 8px; }
  .brand { gap: 7px; font-size: 18px; }
  .bar__divider, .bar__host { display: none; }
  .bar__state { font-size: 9px; }
  .dock-heading { padding: 14px 5px 6px; }
  .dock-heading h1 { font-size: 19px; }
  .dock-heading .eyebrow { font-size: 8px; }
  .dock-heading > p { display: none; }
  .dock-page { --columns: 3; --rows: 3; gap: 4px; padding: 6px 2px; }
  .tile { gap: 5px; border-radius: 15px; }
  .tile__glyph { width: clamp(44px, 13vw, 60px); height: clamp(44px, 13vw, 60px); }
  .tile__label { font-size: 11px; }
  .foot { min-height: 72px; padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 8px; }
  .foot__button { min-width: 0; flex: 1; min-height: 44px; padding: 8px 10px; font-size: 11px; }
  .quick-controls-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swipe-hint { display: none; }
  .rotate { display: none !important; }
  .drawer-trigger, .quick-controls-trigger, .edit-done, .glass-drawer[open] { visibility: visible; }
  .input-pad[open] { visibility: visible; }
  .controls-curtain { width: calc(100vw - 20px); max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
  .controls-curtain .controls-grid { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Immersive surface and the glass drawers share one appearance palette. */
:root {
  --scene-image: none; --scene-base: #0a1a20; --scene-a: #2f9a72; --scene-b: #2b5d7a;
  --glass-bg: #273d493b; --glass-card: #ffffff08; --glass-border: #e1f0ff29; --glass-blur: 28px; --glass-lens-blur: 14; --glass-sheet-blur: 24;
  --light-x: 22%;
  --icon-scale: .44;
}
:root[data-background="aurora"] { --scene-image: url("wallpapers/aurora.webp"); }
:root[data-background="midnight"] { --scene-image: url("wallpapers/midnight.webp"); --scene-base: #050a18; --scene-a: #2c5db3; --scene-b: #122448; --accent: #d0e2ff; --live: #afc7e7; }
:root[data-background="dusk"] { --scene-image: url("wallpapers/dusk.webp"); --scene-base: #171228; --scene-a: #b0506f; --scene-b: #4a2a70; --accent: #e7d4ff; --live: #d1b3f3; }
:root[data-background="ember"] { --scene-image: url("wallpapers/ember.webp"); --scene-base: #1c0c0c; --scene-a: #b4582c; --scene-b: #4e2115; --accent: #f8dcc0; --live: #ebc4a1; }
:root[data-background="lagoon"] { --scene-image: url("wallpapers/lagoon.webp"); --scene-base: #042029; --scene-a: #1b8f9e; --scene-b: #0b3f50; --accent: #bdf5ee; --live: #8fe5d8; }
:root[data-background="silk"] { --scene-image: url("wallpapers/silk.webp"); --scene-base: #16060c; --scene-a: #8a2340; --scene-b: #3c0d20; --accent: #ffd9d6; --live: #f2b4b6; }
:root[data-background="obsidian"] { --scene-image: url("wallpapers/obsidian.webp"); --scene-base: #08090d; --scene-a: #5a6478; --scene-b: #1f232c; --accent: #e6eaf2; --live: #c3cbd9; }
:root[data-background="prism"] { --scene-image: url("wallpapers/prism.webp"); --scene-base: #08080f; --scene-a: #4a43c9; --scene-b: #2f89c7; --accent: #e2deff; --live: #c4bff5; }
:root[data-theme="frost"] { --glass-bg: #cadceb24; --glass-card: #edf5ff0c; --glass-border: #effaff47; --glass-blur: 44px; --glass-lens-blur: 26; --glass-sheet-blur: 36; }
:root[data-theme="smoke"] { --glass-bg: #09121dc4; --glass-card: #ffffff04; --glass-border: #c9ddee1c; --glass-blur: 32px; --glass-lens-blur: 18; --glass-sheet-blur: 26; }
body { background: var(--scene-base); }
.wallpaper { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--scene-base) var(--scene-image) center / cover no-repeat; }
/* A faint grain keeps dark gradients from banding once the art is compressed. */
.wallpaper::after { content: ""; position: absolute; inset: 0; background: url("wallpapers/grain.png") 0 0 / 64px, linear-gradient(0deg, #070f1845, transparent 60%); }
.wallpaper__fade { position: absolute; inset: 0; background: center / cover no-repeat; animation: scene-out .5s ease-out forwards; }
@keyframes scene-out { to { opacity: 0; } }
.app, .pair { position: relative; z-index: 1; }
body.is-immersive .app { max-width: none; padding: calc(44px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(20px, env(safe-area-inset-left)); }
body.is-immersive .bar, body.is-immersive .dock-heading, body.is-immersive .foot { display: none; }
body.is-immersive .workspace { position: relative; height: 100%; padding: 12px 0 22px; }
body.is-immersive .dock-page { padding: 12px max(14px, calc((100vw - 1150px) / 2)); column-gap: clamp(12px, 4vw, 60px); row-gap: 8px; }
body.is-immersive .tile, body.is-immersive .drag-ghost {
  --display-icon: min(var(--icon-size), calc((100dvh - 108px) * var(--icon-scale)), calc((100vw - 96px) / var(--columns) - 36px));
  max-height: none; gap: 0; padding: 8px; border-radius: 25px;
}
body.is-immersive .tile__glyph { width: var(--display-icon); height: var(--display-icon); }
body.is-immersive .tile__label { display: none; }
body.is-immersive.show-labels .tile { gap: 7px; }
body.is-immersive.show-labels .tile__label { display: block; font-size: 11px; }
body.is-immersive .app-icon img { filter: drop-shadow(0 12px 13px #0005); }
body.is-immersive .tile:hover { background: transparent; }
body.is-immersive .tile:focus-visible { outline: 0; }
body.is-immersive .tile:focus-visible .tile__glyph { outline: 2px solid var(--accent); outline-offset: 10px; border-radius: 22%; }
body.is-immersive .tile--control .tile__glyph {
  position: relative; background: linear-gradient(140deg, #ffffff13, #ffffff03); border-color: transparent;
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 10px 25px #0002; color: #edf5f5;
}
body.is-immersive .tile__dot { width: 4px; height: 4px; bottom: max(7px, calc(50% - var(--display-icon) / 2 - 15px)); opacity: .8; }
body.is-immersive .tile.is-editing::after { left: calc(50% - var(--display-icon) / 2 - 4px); top: calc(50% - var(--display-icon) / 2 - 6px); background: #e5edf0d9; backdrop-filter: blur(12px); }
body.is-immersive .page-dots { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); z-index: 3; min-height: 22px; height: 22px; opacity: 0; transition: opacity .4s; }
body.is-immersive .page-dots.is-awake, body.is-immersive .page-dots:focus-within, body.is-immersive.is-arranging .page-dots { opacity: .7; }
body.is-immersive .page-dot { width: 26px; height: 22px; }
body.is-immersive .page-dot::before { height: 4px; width: 4px; background: #e3eeec5e; }
body.is-immersive .page-dot[aria-current="page"]::before { width: 12px; background: #f1f7f3; }
body.is-immersive .empty > h3, body.is-immersive .empty > p, body.is-immersive .empty__icon { display: none; }
body.is-immersive .empty .button { position: relative; font-size: 0; width: 108px; height: 108px; border-radius: 28px; padding: 0; background: #ffffff0a; color: #eaf4f0; border-color: transparent; backdrop-filter: blur(24px); }
body.is-immersive .empty .button .icon { width: 36px; height: 36px; }
.drawer-trigger { position: fixed; z-index: 4; left: 25%; right: 25%; bottom: 0; height: max(24px, env(safe-area-inset-bottom)); padding: 0; border: 0; background: transparent; color: transparent; touch-action: none; }
.drawer-trigger > span { display: block; width: 35px; height: 3px; margin: auto; border-radius: 5px; background: #ebf7f370; opacity: 0; transition: opacity .2s; }
.drawer-trigger:focus-visible > span, .drawer-trigger:hover > span { opacity: 1; }
.quick-controls-trigger { position: fixed; z-index: 4; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; justify-content: center; width: 128px; height: 44px; padding: 0 4px 10px; border: 0; background: transparent; color: #d1eee5; touch-action: none; }
/* The quick controls notch. The button keeps its 44px touch area; only the glass is slim.
   The rim traces the same outline and the clip halves its stroke into a fine line. */
.controls-island {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 104px; height: 22px; padding-bottom: 1px;
  clip-path: path("M0 0A8 8 0 0 1 8 8A14 14 0 0 0 22 22H82A14 14 0 0 0 96 8A8 8 0 0 1 104 0Z");
  background: linear-gradient(180deg, #0a121a59, #ffffff17);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition: background-color .15s;
}
.controls-island::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='22'%3E%3ClinearGradient id='r'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.04'/%3E%3Cstop offset='.24' stop-color='%23fff' stop-opacity='.62'/%3E%3Cstop offset='.52' stop-color='%23fff' stop-opacity='.16'/%3E%3Cstop offset='.78' stop-color='%23fff' stop-opacity='.42'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.04'/%3E%3C/linearGradient%3E%3Cpath d='M0 0A8 8 0 0 1 8 8A14 14 0 0 0 22 22H82A14 14 0 0 0 96 8A8 8 0 0 1 104 0' fill='none' stroke='url(%23r)' stroke-width='2.5'/%3E%3C/svg%3E"); }
.island-grip { display: block; width: 18px; height: 2.5px; border-radius: 2px; background: #dff2ec8c; }
.island-idle { display: flex; align-items: center; gap: 8px; }
.quick-controls-trigger[data-media="true"] { width: 312px; height: 52px; padding-bottom: 8px; }
.quick-controls-trigger[data-media="true"] .controls-island {
  width: 288px; height: 40px; padding: 4px 24px;
  clip-path: path("M0 0A8 8 0 0 1 8 8V20A20 20 0 0 0 28 40H260A20 20 0 0 0 280 20V8A8 8 0 0 1 288 0Z");
}
.quick-controls-trigger[data-media="true"] .controls-island::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='288' height='40'%3E%3ClinearGradient id='r'%3E%3Cstop stop-color='%23fff' stop-opacity='.12'/%3E%3Cstop offset='.24' stop-color='%23fff' stop-opacity='.62'/%3E%3Cstop offset='.52' stop-color='%23fff' stop-opacity='.16'/%3E%3Cstop offset='.78' stop-color='%23fff' stop-opacity='.42'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.12'/%3E%3C/linearGradient%3E%3Cpath d='M0 0A8 8 0 0 1 8 8V20A20 20 0 0 0 28 40H260A20 20 0 0 0 280 20V8A8 8 0 0 1 288 0' fill='none' stroke='url(%23r)' stroke-width='2.5'/%3E%3C/svg%3E"); }
.quick-controls-trigger[data-media="true"] .island-idle { display: none; }
.island-media { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; text-align: left; }
.island-art { display: grid; place-items: center; width: 27px; height: 27px; flex-shrink: 0; border-radius: 7px; overflow: hidden; background: #ffffff14; }
.island-track { display: grid; min-width: 0; flex: 1; line-height: 1.25; gap: 2px; }
.island-track > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.island-track strong { font-size: 11px; font-weight: 600; color: #f0f7f4; }
.island-track > span { font-size: 9px; color: #d1eee5b3; }
.island-art img, .qc-music__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quick-controls-trigger .icon { width: 12px; height: 12px; }
.quick-controls-trigger:hover .controls-island, .quick-controls-trigger:focus-visible .controls-island, .quick-controls-trigger:active .controls-island { background: linear-gradient(180deg, #0a121a40, #ffffff30); }
.quick-controls-trigger:active { transform: translateX(-50%) !important; }
.edit-done { position: fixed; z-index: 5; right: max(14px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); background: var(--glass-bg); border-color: transparent; backdrop-filter: blur(25px); color: #ecf4ef; border-radius: 50%; }
.sheet, .options, .confirm, .glass-drawer, .glass-menu {
  background: var(--glass-bg); border-color: transparent;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: 0 18px 60px #0005, 0 2px 8px #0003; color: #f0f6f6;
}
.sheet::backdrop, .options::backdrop, .confirm::backdrop, .glass-drawer::backdrop { background: #050b1721; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* Rim and reflection, drawn the same in every engine. Each surface has a ring that
   is brightest where light enters and leaves, an arc of light along the top edge
   and a weaker bounce along the bottom. glass.js moves the light toward a finger.
   :where keeps these easy to override per surface. */
:where(.sheet, .options, .confirm, .glass-drawer, .glass-menu, .glass-select, .edit-done, .pc-clipboard__panel, .pointer-options, .recording-stop,
  body.is-immersive .tile--control .tile__glyph, body.is-immersive .empty .button) {
  &::before, &::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
  &::before {
    z-index: 3; padding: 1.25px;
    background: linear-gradient(135deg, #ffffffc4 0%, #ffffff42 20%, #ffffff0d 42%, #ffffff0a 60%, #ffffff30 82%, #ffffff94 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  &::after {
    z-index: 2;
    background:
      radial-gradient(70% 34px at var(--light-x) 0, #ffffff40, transparent 100%),
      radial-gradient(46% 26px at calc(100% - var(--light-x)) 100%, #ffffff20, transparent 100%);
    box-shadow: inset 0 0 14px #ffffff14, inset 0 -7px 18px #0000001c;
  }
  html.perf &::before, html.perf &::after { display: none; }
}

/* Refraction, once glass.js has fitted a lens. Chromium only; others keep the blur above.
   The dim behind a dialog stays, but its blur would leave the lens nothing sharp to bend. */
:root[data-bend]:not(.perf) :is(.sheet, .options, .confirm, .glass-drawer, .glass-menu) { backdrop-filter: var(--lens, blur(var(--glass-blur)) saturate(1.3)); }
:root[data-bend]:not(.perf) :is(.sheet, .options, .confirm, .glass-drawer)::backdrop { backdrop-filter: none; }

/* Sheets are mostly text, so they frost more than small floating glass. */
.sheet { --glass-lens-blur: var(--glass-sheet-blur); }

/* Dialogs scroll inside the glass, so the rim stays on the panel. */
.options[open], .confirm[open] { display: flex; }
.dialog-scroll { flex: 1; min-width: 0; padding: 23px; overflow: auto; overscroll-behavior: contain; }

/* Dropdowns. glass-select.js hides the native <select> and keeps it as the source of truth. */
.glass-select { position: relative; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 112px; max-width: 155px; min-height: 40px; padding: 0 13px 0 14px; border: 0; border-radius: 13px; background: #ffffff0d; color: #eef6f3; font-size: 12px; touch-action: manipulation; transition: background-color .15s, transform .15s; }
.glass-select::after { background: none; box-shadow: none; }
.glass-select:hover, .glass-select:focus-visible, .glass-select[aria-expanded="true"] { background: #ffffff1c; }
.glass-select:active { transform: scale(.97); }
.glass-select:disabled { opacity: .5; cursor: not-allowed; }
.glass-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass-select__chevron { flex-shrink: 0; width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: .65; transform: rotate(45deg); transition: transform .2s; }
.glass-select[aria-expanded="true"] .glass-select__chevron { transform: translateY(3px) rotate(225deg); }
.glass-menu { position: fixed; inset: auto; margin: 0; width: max-content; min-width: 164px; padding: 6px; border: 0; border-radius: 19px; font-size: 13px; opacity: 0; transform: translateY(-5px) scale(.98); transform-origin: top right; }
.glass-menu.is-placed { opacity: 1; transform: none; transition: opacity .16s, transform .22s cubic-bezier(.2,.7,.2,1); }
/* The pad's paper is bright, and white text needs dark glass over it. */
.input-pad .glass-menu { background: #151c29c9; }
.glass-menu__option { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 16px 0 11px; border-radius: 13px; cursor: pointer; }
.glass-menu__option .icon { width: 15px; height: 15px; visibility: hidden; color: var(--accent); }
.glass-menu__option[aria-selected="true"] .icon { visibility: visible; }
.glass-menu__option:hover, .glass-menu__option.is-active { background: #ffffff14; }
.glass-menu__option:active { background: #ffffff24; }
.glass-drawer { padding: 0 20px; width: min(92vw, 640px); margin: auto auto max(14px, env(safe-area-inset-bottom)); border-radius: 29px; overflow: hidden; }
.glass-drawer[open] { animation: drawer-in .25s cubic-bezier(.2,.7,.2,1); }
.drawer-grip { display: block; width: 100%; min-height: 29px; padding: 10px; background: none; border: 0; touch-action: none; }
.drawer-grip > span { display: block; width: 33px; height: 3px; margin: auto; border-radius: 3px; background: #ebf5f44d; }
.drawer-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 6px 0 16px; }
.drawer-actions button { display: flex; flex-direction: column; align-items: center; gap: 12px; border: 0; border-radius: 18px; padding: 15px 6px 13px; min-height: 88px; background: #ffffff06; box-shadow: inset 0 1px 0 #ffffff12; font-size: 11px; color: #eef6f5; transition: background-color .15s, transform .15s; }
.drawer-actions button:active { background: #ffffff1c; transform: scale(.97); }
.drawer-actions button > [data-icon] { width: 29px; height: 29px; }
.drawer-actions .icon { width: 27px; height: 27px; }
.drawer-actions button:hover, .drawer-actions button:focus-visible { background: #ffffff12; }
.drawer-connection { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid #ffffff12; padding: 12px 3px 15px; font-size: 10px; color: #d2dedbb3; }
#drawer-host { overflow-wrap: anywhere; flex: 1; min-width: 0; }
.drawer-connection-actions { display: flex; align-items: center; gap: 8px; }
.drawer-connection-actions button { min-height: 44px; padding: 8px 14px; border: 1px solid #ffffff20; border-radius: 12px; background: #ffffff08; color: #eef6f5; font: inherit; font-size: 12px; }
.drawer-connection-actions button:hover, .drawer-connection-actions button:focus-visible { background: #ffffff18; }
#drawer-conn { display: inline-flex; align-items: center; gap: 6px; }
#drawer-conn::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
#drawer-conn[data-state="on"] { color: var(--live); }
.settings__card { background: var(--glass-card); border-color: #ffffff13; }
.settings__card > p, .settings__tip { color: #c5d2d0; }
.layout-choices { display: flex; gap: 7px; margin: 14px 0 16px; }
.layout-choices button { display: flex; align-items: center; justify-content: center; flex-direction: column; flex: 1; min-height: 73px; gap: 9px; border-radius: 12px; border: 1px solid #ffffff12; background: #ffffff03; font-size: 11px; color: #c9d7d5; }
.layout-choices button[aria-pressed="true"] { border-color: #ecfff4a6; color: #f2fff9; background: #eafff010; }
.mini-grid { display: grid; grid-template-columns: repeat(var(--mini-columns), 6px); gap: 4px; }
.mini-grid i { width: 6px; height: 6px; border-radius: 1.5px; background: currentColor; opacity: .85; }
.switch { appearance: none; width: 36px; height: 22px; flex-shrink: 0; border: 1px solid #ffffff28; border-radius: 20px; background: #15242b61; cursor: pointer; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #b7c9c7; transition: transform .2s; }
.switch:checked { background: #d6f5e54f; border-color: #d6f5e57a; }
.switch:checked::after { background: #e5fff2; transform: translateX(14px); }
.settings__grid .settings__scenes { grid-column: 1 / -1; padding-inline: 0; padding-bottom: 8px; }
.settings__scenes h3 { padding-inline: 17px; }
/* The rail runs edge to edge, so a card cut off at the end shows there is more. */
.scene-choices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(116px, 1fr); gap: 11px; padding: 12px 17px 7px; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 17px; scroll-snap-type: x proximity; scrollbar-width: none; }
.scene-choices::-webkit-scrollbar { display: none; }
.scene-choices button { position: relative; display: grid; gap: 7px; padding: 0; border: 0; border-radius: 13px; background: none; color: #c5d2d0; font: inherit; font-size: 11px; line-height: 1.2; scroll-snap-align: start; }
.scene-choices img { display: block; width: 100%; height: auto; aspect-ratio: 15 / 7; border-radius: 13px; outline: 1px solid #ffffff26; outline-offset: -1px; background: #ffffff0a; transition: transform .15s; }
.scene-choices button:active img { transform: scale(.97); }
.scene-choices button[aria-pressed="true"] { color: #f4fbf8; font-weight: 550; }
.scene-choices button[aria-pressed="true"] img { outline: 2px solid var(--accent); outline-offset: 2px; }
.scene-choices button[aria-pressed="true"]::after { content: ""; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23101719' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.4 5 8.8l4.5-5.4'/%3E%3C/svg%3E") center / 12px no-repeat; box-shadow: 0 1px 4px #0000005c; }
.scene-choices button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.setting-row select { background: #ffffff08; border-color: #ffffff1f; color: #e4f4ee; }
.setting-row option { background: #1f2c32; color: #eef6f3; }
.settings__utilities { display: flex; gap: 8px; margin-top: 14px; }
.settings__utilities .button { flex: 1; font-size: 10px; padding: 8px 10px; background: #ffffff08; border-color: #ffffff13; }
.settings__utilities .icon { width: 17px; height: 17px; }
.picker__tabs, .search-box { background: #ffffff06; border-color: #ffffff15; }
.picker__tab.is-active { background: #ffffff10; }
.control-card, .control-card__actions button, .options__actions button { background: #ffffff07; border-color: #ffffff16; }
@keyframes drawer-in { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
/* Quick controls: pills for places to go, sliders for levels, a card for music.
   Solid light discs mark what can be pressed, so the glass around them stays quiet. */
.controls-curtain { --qc-gap: 10px; --qc-well: #ffffff0b; --qc-edge: inset 0 0 0 1px #ffffff14, inset 0 1px 0 #ffffff12; --qc-disc: #e8ddff; --qc-ink: #21172f; width: min(92vw, 780px);
  /* The panel starts above the screen, so its top corners and rim stay out of sight and
     it reads as part of the top edge. --qc-notch is the notch's box inside that panel:
     open and close are one transition between that box and the full panel. */
  --qc-reach: 36px; --qc-notch: inset(var(--qc-reach) calc(50% - 44px) calc(100% - var(--qc-reach) - 22px) calc(50% - 44px) round 0 0 14px 14px);
  position: fixed; inset-block-start: 0; inset-inline: 0; margin: calc(env(safe-area-inset-top) - var(--qc-reach)) auto auto; padding-top: var(--qc-reach);
  max-height: calc(100dvh + var(--qc-reach) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 10px);
  clip-path: var(--qc-notch);
  transition: clip-path .34s cubic-bezier(.22,1,.36,1), display .34s allow-discrete, overlay .34s allow-discrete;
}
.controls-curtain[open] { clip-path: inset(0 round 29px); }
@starting-style { .controls-curtain[open] { clip-path: var(--qc-notch); } }
.controls-curtain > * { transition: opacity .16s; }
/* A closing panel is on its way out, so taps go straight to the dock. */
.controls-curtain:not([open]) { pointer-events: none; }
.controls-curtain:not([open]) > * { opacity: 0; }
.controls-curtain[open] > * { transition: opacity .24s .08s; }
@starting-style { .controls-curtain[open] > * { opacity: 0; } }
.quick-controls-shortcuts { display: flex; flex-shrink: 0; gap: var(--qc-gap); padding: 14px 14px 0; }
.quick-controls-shortcuts button { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 58px; padding: 6px 14px 6px 6px; border: 0; border-radius: 29px; background: var(--qc-well); box-shadow: var(--qc-edge); color: #eef6f5; font-size: 12px; transition: background-color .15s, transform .15s; }
.quick-controls-shortcuts button > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-controls-shortcuts button:hover, .quick-controls-shortcuts button:focus-visible { background: #ffffff18; }
.quick-controls-shortcuts button:active, .qc-round:active { transform: scale(.96); }
.qc-disc { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--qc-disc); color: var(--qc-ink); }
.qc-disc .icon { width: 21px; height: 21px; }
.controls-curtain .controls-grid { grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: var(--qc-gap); min-height: 0; padding: var(--qc-gap) 14px 0; overscroll-behavior: contain; }
.qc-levels { display: grid; align-content: center; gap: var(--qc-gap); min-width: 0; }
.qc-level-row { display: flex; gap: var(--qc-gap); min-width: 0; }
.qc-level-row:not(:has(> :not([hidden]))) { display: none; }
.level { position: relative; display: block; flex: 1; min-width: 0; height: 60px; overflow: hidden; border-radius: 30px; background: #ffffff1a; box-shadow: var(--qc-edge); }
.level::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--level, 0) * 1%); border-radius: inherit; background: linear-gradient(90deg, #ffffffb0, #ffffffe8); }
.level__icon { position: absolute; z-index: 1; left: 20px; top: 50%; color: #eef6f5; transform: translateY(-50%); pointer-events: none; transition: color .15s; }
.level__icon .icon { width: 22px; height: 22px; }
.level[data-covered="true"] .level__icon { color: var(--qc-ink); }
/* The native range stays on top, invisible, so touch and keyboard work as usual. */
.level input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; touch-action: none; }
.level input:disabled { cursor: not-allowed; }
.level:has(input:disabled) { opacity: .45; }
.level:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.qc-round { display: grid; place-items: center; flex-shrink: 0; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--qc-disc); color: var(--qc-ink); transition: transform .15s; }
.qc-round .icon { width: 22px; height: 22px; }
.qc-music { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; padding: 12px 14px 8px; border-radius: 26px; background: var(--qc-well); box-shadow: var(--qc-edge); }
.qc-music__now { display: flex; align-items: center; gap: 11px; min-width: 0; }
.qc-music__art { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px; overflow: hidden; background: linear-gradient(140deg, var(--scene-a), var(--scene-b)); color: #f4fbf8; }
.qc-music__art .icon { width: 20px; height: 20px; }
.qc-music__text { display: grid; gap: 2px; min-width: 0; }
.qc-music__text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-music__text strong { font-size: 13px; font-weight: 550; }
.qc-music__text span { font-size: 11px; color: #d2dedbb3; }
.qc-music__transport { display: flex; align-items: center; justify-content: space-evenly; }
.qc-music__transport button { display: grid; place-items: center; width: 52px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: none; color: #eef6f5; transition: background-color .15s, transform .15s; }
.qc-music__transport button:hover, .qc-music__transport button:focus-visible { background: #ffffff14; }
.qc-music__transport button:active { transform: scale(.94); }
.qc-music__transport .icon { width: 22px; height: 22px; }
.qc-music__transport .qc-music__play { width: 44px; border-radius: 50%; background: var(--qc-disc); color: var(--qc-ink); }
.qc-music__transport .qc-music__play:hover, .qc-music__transport .qc-music__play:focus-visible { background: #ffffff; }
.controls-grip { flex-shrink: 0; min-height: 40px; }
.drawer-grip:focus-visible { outline: 0; }
.drawer-grip:focus-visible > span { outline: 2px solid var(--accent); outline-offset: 4px; }
.power-sheet { width: min(92vw, 560px); }
.power-sheet .controls-grid { grid-template-columns: 1fr; }
.toast[data-warning="true"] { color: #fff2cc; background: #483719; border-color: #d6ad5f80; }
@media (orientation: landscape) and (max-width: 699px) {
  .controls-curtain { --qc-gap: 7px; width: min(95vw, 640px); }
  .quick-controls-shortcuts { padding: 9px 9px 0; }
  .quick-controls-shortcuts button { gap: 6px; height: 46px; padding: 4px 8px 4px 4px; border-radius: 23px; font-size: 11px; }
  .qc-disc { width: 38px; height: 38px; }
  .qc-disc .icon { width: 18px; height: 18px; }
  .controls-curtain .controls-grid { padding: var(--qc-gap) 9px 0; }
  .level { height: 50px; border-radius: 25px; }
  .level__icon { left: 16px; }
  .qc-round { width: 50px; height: 50px; }
  .qc-music { padding: 8px 10px 4px; border-radius: 22px; }
  .qc-music__art { width: 34px; height: 34px; border-radius: 11px; }
  .qc-music__transport button { width: 44px; height: 40px; }
  .qc-music__transport .qc-music__play { width: 40px; }
}
@media (max-height: 400px) and (orientation: landscape) {
  .settings__grid { padding-bottom: 14px; }
  .settings__card { padding: 13px 15px; }
  .layout-choices { margin: 10px 0; }
  .layout-choices button { min-height: 57px; gap: 6px; }
  .setting-row { min-height: 40px; }
  .settings__card .settings__tip { margin-top: 6px; font-size: 8px; }
  .settings__scenes h3 { padding-inline: 15px; }
  .scene-choices { gap: 9px; padding: 10px 15px 6px; scroll-padding-inline: 15px; }
  .settings__utilities { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .glass-drawer[open] { animation: none; } }

/* Capture stays in the drawer; only an active recording adds a stop pill. */
.capture-sheet { width: min(92vw, 620px); overflow-y: auto; }
.capture-sheet > * { flex-shrink: 0; }
.capture-subtitle { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.capture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 24px; }
.capture-actions button { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 20px; min-height: 130px; border: 1px solid #ffffff16; border-radius: 20px; background: #ffffff09; text-align: left; }
.capture-actions button:hover { background: #ffffff12; }
.capture-actions button > span { color: var(--accent); margin-bottom: 5px; }
.capture-actions strong { font-size: 15px; font-weight: 600; }
.capture-actions small { color: var(--muted); font-size: 11px; }
.capture-actions .is-recording { border-color: #f5a49b66; background: #de72631a; }
.capture-actions .is-recording > span { color: #ffb0a8; }
.capture-status, .capture-file { font-size: 12px; color: var(--muted); margin: 17px 24px 0; overflow-wrap: anywhere; }
.capture-file { color: var(--accent); font-size: 11px; margin-top: 9px; }
.capture-tip { font-size: 10px; color: var(--muted); margin: 14px 24px 22px; opacity: .8; }
.recording-stop { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); z-index: 60; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 10px 16px; border: 1px solid #ffb8ad55; border-radius: 30px; background: #301b22d9; color: #ffe9e5; box-shadow: 0 5px 24px #0003; backdrop-filter: blur(18px); font-size: 12px; font-variant-numeric: tabular-nums; }
.recording-stop strong { padding-left: 10px; border-left: 1px solid #ffb8ad44; font-weight: 600; }
.recording-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff988b; }
@media (max-height: 440px) { .capture-actions button { min-height: 100px; padding: 14px 18px; gap: 5px; } .capture-tip { margin-top: 9px; } }

/* The entire display is the touch surface. Only the bottom controls float above it. */
.input-pad { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 16px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); border: 0; border-radius: 0; background: #080b10; color: #e1e7f0; box-shadow: none; overflow: hidden; --accent: #b69cff; --muted: #8490a2; }
.input-pad[open] { display: flex; flex-direction: column; gap: 12px; }
.input-pad::backdrop { background: #080b10; }
.input-pad[data-mode="touchpad"] { padding: 0; }
.input-pad[data-mode="touchpad"] .input-pad__header { display: none; }
.input-pad__header, .input-pad__tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0; }
.input-pad__tabs { display: flex; gap: 5px; padding: 0; }
.input-pad__tabs button { display: flex; align-items: center; gap: 9px; padding: 10px 18px; border: 0; border-radius: 10px; background: transparent; font-size: 13px; color: var(--muted); }
.input-pad__tabs button[aria-pressed="true"] { background: #b69cff12; color: var(--accent); }
.input-pad__tabs .icon { width: 18px; height: 18px; }
.input-pad__pane { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 12px; }
.presentation-controls { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: max(82px, calc(env(safe-area-inset-top) + 68px)) 22px max(160px, calc(env(safe-area-inset-bottom) + 140px)); background: linear-gradient(160deg, #100d18ed, #171222e8); }
.presentation-controls > div:first-child { text-align: center; }
.presentation-controls .eyebrow { color: var(--live); }
.presentation-controls h2 { font-size: clamp(21px, 4vw, 30px); }
.presentation-controls p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.presentation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.presentation-actions button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 104px; border: 1px solid #b69cff45; border-radius: 22px; color: var(--text); background: linear-gradient(145deg, #241e33, #191523); font-size: 15px; }
.presentation-actions button:active { background: #35294b; }
.presentation-actions button .icon { width: 22px; height: 22px; color: var(--live); }
.presentation-actions--small button { min-height: 44px; border-radius: 14px; color: var(--muted); font-size: 12px; }
#touchpad-pane { position: absolute; inset: 0; }
.touchpad-surface { position: absolute; inset: 0; border: 0; border-radius: 0; background-color: #080b10; background-image: linear-gradient(#91afd014 1px, transparent 1px), linear-gradient(90deg, #91afd014 1px, transparent 1px); background-size: 24px 24px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; overflow: hidden; }
.touchpad-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.touchpad-feedback { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.touchpad-feedback > span { position: absolute; left: 0; top: 0; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity 220ms ease-out; will-change: transform, opacity; }
.touchpad-feedback > span::before, .touchpad-feedback > span::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* Keep the local grid aligned with the surface, then gently expand it beneath each finger. */
.touchpad-feedback > span::before { background-color: #080b10; background-image: linear-gradient(#b69cff66 1px, transparent 1px), linear-gradient(90deg, #b69cff66 1px, transparent 1px); background-size: 24px 24px; background-position: calc(130px - var(--contact-x, 0px)) calc(130px - var(--contact-y, 0px)); mask-image: radial-gradient(circle, #000 10%, #000a 35%, transparent 68%); transform: scale(1); transition: transform 180ms ease-out; }
.touchpad-feedback > span::after { background: radial-gradient(circle, #a5e3ff99 0, #5caaff65 18%, #427cff2e 42%, #3758b600 70%); }
.touchpad-feedback > span.is-touching { opacity: 1; }
.touchpad-feedback > span.is-touching::before { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .touchpad-feedback > span.is-touching::before { transform: none; } }
.touchpad-hint { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 12px; margin: 0; padding: 24px; pointer-events: none; font-size: 12px; color: #788599; opacity: .7; transition: opacity .3s; }
.touchpad-hint span { color: #465063; }
.touchpad-surface[data-used="true"] .touchpad-hint, .touchpad-surface[data-ready="false"] .touchpad-hint { opacity: 0; }
.touchpad-toolbar { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.touchpad-toolbar button:disabled { opacity: .4; }
.touchpad-navigation, .touchpad-tools, .touchpad-options { position: absolute; top: max(12px, env(safe-area-inset-top)); display: flex; gap: 6px; }
.touchpad-navigation { left: max(14px, env(safe-area-inset-left)); }
.touchpad-tools { right: calc(max(14px, env(safe-area-inset-right)) + 100px); }
.input-pad:has(#pc-clipboard-toggle[hidden]) .touchpad-tools { right: calc(max(14px, env(safe-area-inset-right)) + 50px); }
.touchpad-options { right: max(14px, env(safe-area-inset-right)); }
:is(.touchpad-navigation, .touchpad-tools, .touchpad-options) button { width: 44px; border-radius: 50%; }
:is(.touchpad-navigation, .touchpad-tools, .touchpad-options) button:hover, :is(.touchpad-navigation, .touchpad-tools, .touchpad-options) button:focus-visible { background: #ffffff14; }
:is(.touchpad-navigation, .touchpad-tools, .touchpad-options) button:active { background: #ffffff24; transform: scale(.94); }
.touchpad-tools .has-text-focus, #pointer-options-toggle[aria-expanded="true"] { color: #c7f36b; background: #c7f36b26; }
.touchpad-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; min-height: 44px; padding: 0; background: none; color: #d7e0ec; touch-action: manipulation; pointer-events: auto; transition: opacity .2s, background-color .12s, color .12s, transform .1s; }
.touchpad-toolbar button:disabled { opacity: .4; }
.touchpad-toolbar .icon { width: 20px; height: 20px; }
.input-pad[data-keyboard="true"] .touchpad-toolbar { visibility: hidden; }
.pc-keys-toggle { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: calc(max(14px, env(safe-area-inset-left)) + 54px); display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: transparent; color: #98aaa9; font: inherit; font-size: 11px; touch-action: manipulation; transition: opacity .18s, color .18s, background-color .18s; }
.pc-keys-toggle .icon { width: 19px; height: 19px; }
.pc-keys-toggle[aria-expanded="true"] { color: #9ce8ce; background: #c7f36b12; }
.pc-keys-toggle:not(:disabled):hover { background: #ffffff10; }
.pc-keys-toggle:focus-visible, .pc-keys button:focus-visible { outline: 2px solid #c7f36b; outline-offset: 3px; }
.pc-keys { position: absolute; z-index: 1; inset: 0; pointer-events: none; transition: opacity .18s; }
.pc-key-bank { position: absolute; top: max(66px, calc(50% - 112px), calc(env(safe-area-inset-top) + 56px)); display: grid; gap: 5px; }
.pc-key-bank--editing { left: max(18px, env(safe-area-inset-left)); grid-template-columns: 52px; }
.pc-key-bank--navigation { right: max(18px, env(safe-area-inset-right)); grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 44px); }
.pc-keys button { min-width: 44px; height: 44px; padding: 0; border: 1px solid #a7e6d219; border-radius: 14px; background: radial-gradient(ellipse at 50% 120%, #c7f36b1c, #c7f36b04 75%); box-shadow: inset 0 1px #d5fff00b; color: #b6cec7; font: inherit; font-size: 11px; letter-spacing: .03em; touch-action: manipulation; pointer-events: auto; transition: background-color .15s, color .15s, transform .15s; }
.pc-keys button[data-pc-key^="Arrow"] { font-size: 20px; font-weight: 300; }
.pc-keys [data-pc-key="Home"] { grid-area: 1 / 1; }
.pc-keys [data-pc-key="End"] { grid-area: 1 / 3; }
.pc-keys [data-pc-key="ArrowUp"] { grid-area: 2 / 2; }
.pc-keys [data-pc-key="ArrowLeft"] { grid-area: 3 / 1; }
.pc-keys [data-pc-key="ArrowDown"] { grid-area: 3 / 2; }
.pc-keys [data-pc-key="ArrowRight"] { grid-area: 3 / 3; }
.pc-keys button:not(:disabled):hover { background-color: #c7f36b16; color: #dffff2; }
.pc-keys button:not(:disabled):active { background-color: #c7f36b33; color: #effff9; transform: scale(.94); }
.pc-keys button:disabled { opacity: .35; }
.pc-keys[data-touching="true"], .pc-keys-toggle[data-touching="true"] { opacity: .18; }
@media (max-height: 380px) {
  .pc-key-bank--editing { grid-template-columns: repeat(2, 46px); }
  .pc-key-bank--navigation { grid-template-rows: repeat(2, 44px); }
  .pc-keys [data-pc-key="ArrowUp"] { grid-area: 1 / 2; }
  .pc-keys [data-pc-key="ArrowLeft"] { grid-area: 2 / 1; }
  .pc-keys [data-pc-key="ArrowDown"] { grid-area: 2 / 2; }
  .pc-keys [data-pc-key="ArrowRight"] { grid-area: 2 / 3; }
}
.input-pad[data-keyboard="true"] .pc-keys-toggle { left: max(14px, env(safe-area-inset-left)); top: max(6px, env(safe-area-inset-top)); }
.input-pad[data-keyboard="true"] .pc-key-bank { top: max(60px, calc(env(safe-area-inset-top) + 50px)); display: flex; gap: 4px; }
.input-pad[data-keyboard="true"] .pc-keys button { width: 44px; }
html.perf .pc-keys button { background: #14202b; box-shadow: none; }
html.perf :is(.pc-keys, .pc-keys button, .pc-keys-toggle) { transition: none; }
@media (prefers-reduced-motion: reduce) { .pc-keys, .pc-keys button, .pc-keys-toggle { transition: none; } }
.remote-keyboard { position: absolute; z-index: 3; bottom: max(8px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 16px; background: #101722f5; }
.remote-keyboard input { min-width: 0; flex: 1; padding: 10px; font-size: 16px; border: 0; border-radius: 10px; background: #ffffff08; color: #e1e7f0; }
.remote-keyboard button { min-width: 44px; height: 44px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: #b69cff; font-size: 20px; }
.remote-keyboard .icon { width: 20px; height: 20px; }
.pc-clipboard { position: absolute; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: calc(max(14px, env(safe-area-inset-right)) + 50px); max-width: calc(100% - 78px); }
.pc-clipboard button { min-height: 44px; border: 0; border-radius: 12px; color: #d5e1f1; background: #b69cff0b; touch-action: manipulation; }
.pc-clipboard button:focus-visible { outline: 2px solid #b69cff; outline-offset: 2px; }
.pc-clipboard .icon { width: 18px; height: 18px; flex: 0 0 auto; }
.pc-clipboard .pc-clipboard__toggle .icon { width: 20px; height: 20px; }
.pc-clipboard .pc-clipboard__toggle { display: flex; align-items: center; justify-content: center; width: 44px; margin-left: auto; padding: 0; border-radius: 50%; background: none; color: #d7e0ec; transition: opacity .2s, background-color .12s, color .12s, transform .1s; }
.pc-clipboard .pc-clipboard__toggle:disabled { opacity: .4; }
.pc-clipboard .pc-clipboard__toggle:hover, .pc-clipboard .pc-clipboard__toggle:focus-visible { background: #ffffff14; }
.pc-clipboard .pc-clipboard__toggle:active { background: #ffffff24; transform: scale(.94); }
.pc-clipboard .pc-clipboard__toggle[aria-expanded="true"] { background: #c7f36b26; color: #c7f36b; }
.pc-clipboard__panel { position: relative; display: flex; width: min(350px, calc(100vw - 78px)); max-height: calc(100vh - 136px); max-height: calc(100dvh - 136px); overflow: hidden; margin-top: 8px; border-radius: 20px; background: #151c29c9; box-shadow: 0 16px 45px #0006; backdrop-filter: blur(20px); }
.pc-clipboard__scroll { flex: 1; min-width: 0; padding: 14px; overflow: auto; overscroll-behavior: contain; }
.pc-clipboard__heading { display: flex; align-items: center; gap: 4px; }
.pc-clipboard__heading strong { margin-right: auto; font-size: 13px; font-weight: 500; }
.pc-clipboard__heading button { display: grid; place-items: center; min-width: 44px; }
#pc-clipboard-status { margin: 6px 0 12px; font-size: 11px; line-height: 1.5; color: #9baac0; }
.pc-clipboard__list { display: grid; gap: 6px; max-height: 28vh; overflow-y: auto; overscroll-behavior: contain; }
.pc-clipboard__item { width: 100%; padding: 10px 12px; text-align: left; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.pc-clipboard__item[aria-pressed="true"] { background: #b69cff24; }
#pc-clipboard-editor { margin-top: 12px; }
#pc-clipboard-editor label { display: block; font-size: 11px; color: #9baac0; margin-bottom: 6px; }
#pc-clipboard-text { display: block; width: 100%; min-height: 70px; max-height: 180px; padding: 10px; resize: vertical; font-family: inherit; border: 1px solid #b69cff25; border-radius: 12px; color: #e1e7f0; background: #080b1070; font-size: 16px; }
#pc-clipboard-paste { width: 100%; margin-top: 8px; background: #b69cff22; font-size: 12px; }
/* Editing has its own compact view, sized to the visible area above the IME. */
.pc-clipboard__panel[data-editing="true"] { position: fixed; top: var(--clipboard-top, 8px); right: max(14px, env(safe-area-inset-right)); width: min(500px, calc(100vw - 28px)); height: min(300px, var(--clipboard-height, calc(100dvh - 16px))); max-height: none; margin: 0; }
.pc-clipboard__panel[data-editing="true"] .pc-clipboard__scroll { display: flex; flex-direction: column; padding: 8px; }
.pc-clipboard__panel[data-editing="true"] .pc-clipboard__heading { flex-shrink: 0; }
.pc-clipboard__panel[data-editing="true"] #pc-clipboard-status { margin: 4px 0; line-height: 14px; flex-shrink: 0; }
.pc-clipboard__panel[data-editing="true"] .pc-clipboard__list { display: none; }
.pc-clipboard__panel[data-editing="true"] #pc-clipboard-editor { display: flex; gap: 8px; flex: 1; min-height: 44px; margin: 0; }
.pc-clipboard__panel[data-editing="true"] #pc-clipboard-editor label { display: none; }
.pc-clipboard__panel[data-editing="true"] #pc-clipboard-text { flex: 1; min-width: 0; min-height: 44px; max-height: none; resize: none; }
.pc-clipboard__panel[data-editing="true"] #pc-clipboard-paste { flex: 0 0 96px; width: auto; height: 44px; align-self: flex-end; margin: 0; }
html.perf .pc-clipboard__panel { backdrop-filter: none; background: #151c29; }
.signature-actions { display: flex; gap: 8px; }
.signature-actions .button { padding: 10px 14px; min-height: 42px; font-size: 12px; }
.pointer-options { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; padding: 20px; pointer-events: auto; border: 0; border-radius: 18px; background: #151c29c9; box-shadow: 0 12px 45px #0008; backdrop-filter: blur(20px); }
.pointer-options input { display: block; width: 100%; height: 38px; margin: 10px 0 0; accent-color: var(--accent); touch-action: none; }
.pointer-speed { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #c0cada; font-size: 12px; }
.pointer-speed output { color: var(--accent); font-variant-numeric: tabular-nums; }
.pointer-speed-scale { display: flex; justify-content: space-between; color: #8490a2; font-size: 10px; }
.mouse-buttons, .signature-tools { display: flex; align-items: center; gap: 8px; }
.mouse-buttons { display: contents; }
#mouse-left, #mouse-right { position: absolute; bottom: 0; width: min(204px, 32vw); height: min(158px, 46vh); align-items: flex-end; gap: 9px; color: #eaf6f1; font-size: 14px; font-weight: 500; }
#mouse-left { left: 0; justify-content: flex-start; padding: 0 0 max(22px, calc(env(safe-area-inset-bottom) + 10px)) max(26px, calc(env(safe-area-inset-left) + 12px)); border-radius: 0 100% 0 0; background: radial-gradient(100% 100% at 0 100%, #c7f36b4d, #c7f36b2b 38%, #c7f36b10 70%, #c7f36b00 100%); }
#mouse-right { right: 0; justify-content: flex-end; padding: 0 max(26px, calc(env(safe-area-inset-right) + 12px)) max(22px, calc(env(safe-area-inset-bottom) + 10px)) 0; border-radius: 100% 0 0 0; background: radial-gradient(100% 100% at 100% 100%, #c7f36b4d, #c7f36b2b 38%, #c7f36b10 70%, #c7f36b00 100%); }
#mouse-left:active { background: radial-gradient(100% 100% at 0 100%, #c7f36b99, #c7f36b55 38%, #c7f36b1f 70%, #c7f36b00 100%); }
#mouse-right:active { background: radial-gradient(100% 100% at 100% 100%, #c7f36b99, #c7f36b55 38%, #c7f36b1f 70%, #c7f36b00 100%); }
:is(#mouse-left, #mouse-right):focus-visible { outline: 2px solid #c7f36b; outline-offset: -6px; }
#mouse-drag { position: absolute; left: calc(50% - 58px); bottom: max(14px, env(safe-area-inset-bottom)); width: 116px; border-radius: 22px; background: #ffffff12; color: #dfe7f1; font-size: 14px; font-weight: 500; }
#mouse-drag:active { background: #ffffff24; transform: scale(.97); }
#mouse-drag[aria-pressed="true"] { background: #ffb04038; color: #ffd79a; box-shadow: 0 0 26px #ffb04040; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.perf) .input-pad[data-touching="true"] :is(.touchpad-navigation, .touchpad-tools, .touchpad-options, .pc-clipboard__toggle) { opacity: .16; }
  html:not(.perf) .input-pad[data-touching="true"] :is(#mouse-left, #mouse-right, #mouse-drag:not([aria-pressed="true"])) { opacity: .4; }
}
.signature-tools button { border: 0; background: #ffffff08; border-radius: 12px; padding: 10px 18px; font-size: 12px; min-height: 44px; }
.input-pad__connection { display: flex; gap: 14px; align-items: center; justify-content: center; flex-shrink: 0; }
.input-pad[data-mode="touchpad"] .input-pad__connection { position: absolute; top: max(12px, env(safe-area-inset-top)); left: calc(max(14px, env(safe-area-inset-left)) + 154px); right: calc(max(14px, env(safe-area-inset-right)) + 206px); width: auto; min-height: 44px; margin-inline: auto; box-sizing: border-box; z-index: 2; pointer-events: none; text-align: center; }
.input-pad[data-mode="touchpad"][data-ready="false"][data-connecting="false"] .input-pad__connection { gap: 10px; padding: 0 5px 0 16px; border: 1px solid #ffb8ad55; border-radius: 14px; background: #301b22; }
.input-pad[data-mode="touchpad"][data-ready="false"][data-connecting="false"] .input-pad__status { color: #ffe9e5; }
.input-pad[data-mode="touchpad"] .input-pad__status { min-height: 0; font-size: 12px; }
.input-pad[data-mode="touchpad"][data-ready="true"][data-demo="false"] .input-pad__connection { visibility: hidden; }
.input-pad__status { margin: 0; min-height: 18px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; line-height: 1.5; }
#input-reconnect { pointer-events: auto; border: 0; border-radius: 10px; padding: 8px 14px; min-height: 34px; background: #b69cff18; color: var(--accent); font-size: 12px; flex-shrink: 0; }
.signature-space { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.signature-paper { position: relative; aspect-ratio: 8 / 3; height: 100%; max-width: 100%; max-height: 100%; border-radius: 15px; overflow: hidden; background: #f2f2ec; }
#signature-canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#signature-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; color: #69706f; font-size: clamp(18px, 3vw, 28px); letter-spacing: -.6px; }
#signature-placeholder span { font-size: 11px; letter-spacing: 0; opacity: .65; }
.signature-tools label { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.signature-tools select { background: #1b2a2a; color: var(--text); border: 1px solid #ffffff25; border-radius: 10px; padding: 9px; font-size: 12px; }
#signature-save { padding: 10px 18px; min-height: 42px; font-size: 12px; }
@media (max-height: 450px) { .input-pad { padding-top: 8px; padding-bottom: 8px; } .input-pad[open], .input-pad__pane { gap: 7px; } .input-pad__tabs button { padding: 7px 14px; } .input-pad__status { font-size: 10px; } }
@media (max-height: 550px) and (orientation: landscape) { .presentation-controls { gap: 10px; padding: 58px 18px 118px; } .presentation-controls h2 { font-size: 18px; } .presentation-controls p:not(.eyebrow) { font-size: 10px; margin-top: 3px; } .presentation-actions { gap: 8px; } .presentation-actions button { min-height: 66px; border-radius: 16px; } .presentation-actions--small button { min-height: 36px; } }
@media (max-width: 640px) { .input-pad__tools { gap: 8px; } .signature-tools button { padding: 8px 11px; } #mouse-left, #mouse-right, #mouse-drag { font-size: 13px; } .touchpad-hint { font-size: 10px; gap: 8px; } .pointer-options { width: 220px; } .drawer-actions { gap: 3px; } .drawer-actions button { font-size: 10px; padding-inline: 2px; } }
@media (orientation: portrait) and (max-width: 599px) {
  .input-pad[data-mode="touchpad"] .input-pad__connection { top: max(66px, calc(env(safe-area-inset-top) + 58px)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); }
  .touchpad-hint { text-align: center; padding-inline: 38px; }
  .pc-keys-toggle { left: calc(max(14px, env(safe-area-inset-left)) + 48px); padding-inline: 8px; }
  .pointer-options { right: 0; width: min(260px, calc(100vw - 28px)); }
  .pc-clipboard__panel { width: min(380px, calc(100vw - 28px)); }
  .signature-tools { flex-wrap: wrap; justify-content: center; }
}

/* Optional low-cost rendering. Removing .perf restores the selected glass style. */
html.perf .wallpaper::after { display: none; }
html.perf body :is(.sheet, .options, .confirm, .glass-drawer, .glass-menu, .tile--control .tile__glyph,
  .empty .button, .edit-done, .pointer-options, .mouse-buttons) {
  background: #17252d; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
}
html.perf body .recording-stop { background: #301b22; backdrop-filter: none; box-shadow: none; }
html.perf .controls-island { background: #17252d; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.perf .controls-island::before { display: none; }
html.perf body .tile.is-editing::after { background: #e5edf0; backdrop-filter: none; }
html.perf dialog::backdrop { background: #050b1773; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.perf .input-pad::backdrop { background: #080b10; }
html.perf body :is(.app-icon img, .drag-ghost) { filter: none; }
html.perf .dock { scroll-behavior: auto; }
html.perf :is(.tile.is-editing, .glass-drawer[open]) { animation: none; }
html.perf .controls-curtain, html.perf .controls-curtain > * { transition: none; }
html.perf body :is(button, .page-dots, .drawer-trigger > span, .switch, .touchpad-feedback > span, .touchpad-hint),
html.perf :is(.page-dot::before, .switch::after) { transition: none; }
html.perf .touchpad-feedback > span {
  width: 24px; height: 24px; margin: -12px 0 0 -12px;
  background: #a5e3ff66; border: 1px solid #a5e3ff; will-change: auto;
}
html.perf .touchpad-feedback > span::before, html.perf .touchpad-feedback > span::after { display: none; }
.setting-row select:disabled { opacity: .5; cursor: not-allowed; }

.updates-content { overflow-y: auto; padding: 0 24px 24px; display: grid; gap: 16px; }
.updates-content p { line-height: 1.5; overflow-wrap: anywhere; }
.updates-content .settings__utilities { flex-wrap: wrap; }
.updates-content a { text-decoration: none; }
@media (max-width: 650px) { .drawer-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Native Android deck: compact chrome stays visible and frequent actions stay in thumb reach. */
html.android-client {
  --bg: #0b1113;
  --surface: #121a1d;
  --surface-2: #1a2528;
  --line: #2a393c;
  --text: #f0f4f1;
  --muted: #a3b0ad;
  --accent: #b6ef83;
  --live: #77d9bd;
  --glass-bg: #121b1eeF;
  --glass-card: #172225e8;
  --glass-border: #304044;
  --glass-blur: 18px;
  --glass-lens-blur: 14;
  --glass-sheet-blur: 14;
}
html.android-client[data-background] { --accent: #b6ef83; --live: #77d9bd; }
html.android-client body { background-color: var(--bg); }
html.android-client .wallpaper::after { background: linear-gradient(180deg, #0b1113a8, #0b111344 48%, #0b1113a6); }
html.android-client body.is-immersive .app {
  max-width: 760px;
  padding: calc(47px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
html.android-client body.is-immersive .bar { display: flex; }
html.android-client body.is-immersive .dock-heading { display: flex; }
html.android-client body.is-immersive .foot { display: grid; }
html.android-client .bar { gap: 9px; min-height: 53px; border-bottom: 1px solid #d9eee110; }
html.android-client .brand { gap: 7px; font-size: 16px; letter-spacing: -.35px; }
html.android-client .brand > [data-icon] { color: var(--accent); }
html.android-client .brand .icon { width: 20px; height: 20px; }
html.android-client .brand__dot { width: 4px; height: 4px; margin-left: -5px; margin-bottom: 7px; }
html.android-client .bar__divider { height: 15px; background: #91a39e42; }
html.android-client .bar__host { display: inline; max-width: 36vw; color: #c1cbc7; font-size: 11px; }
html.android-client .bar__state { padding: 5px 8px; border: 1px solid #ffffff0d; border-radius: 20px; background: #ffffff06; font-size: 10px; }
html.android-client .bar__state::before { width: 6px; height: 6px; }
html.android-client #edit { min-height: 36px; background: #162125; border-color: #ffffff12; color: #d6dfda; }
html.android-client .bar .icon-button { width: 38px; height: 38px; border: 1px solid #ffffff0b; background: #ffffff06; color: #d6dfda; }
html.android-client .dock-heading { align-items: center; padding: 12px 2px 7px; }
html.android-client .dock-heading .eyebrow { margin-bottom: 1px; font-size: 8px; letter-spacing: .14em; color: #aab7b1; }
html.android-client .dock-heading h1 { font-size: 21px; line-height: 1.2; font-weight: 560; letter-spacing: -.45px; }
html.android-client .dock-heading > p { max-width: 46%; margin: 0 0 2px 8px; color: #98a6a0; font-size: 9px; text-align: right; }
html.android-client .dock { overscroll-behavior-x: contain; }
html.android-client .dock-page { --columns: unset; --rows: unset; }
html.android-client .dock-page { gap: 8px; padding: 6px 1px; }
html.android-client .tile { gap: 7px; max-height: 160px; padding: 7px 4px; border: 1px solid #d9eee10d; border-radius: 21px; background: #11191b9c; }
html.android-client .tile:active { background: #1b292b; }
html.android-client .tile--control .tile__glyph { border: 1px solid #b6ef8328; background: #1a2926; box-shadow: none; color: var(--accent); }
html.android-client .tile__glyph { width: min(var(--icon-size), clamp(52px, 16vw, 80px)); height: min(var(--icon-size), clamp(52px, 16vw, 80px)); }
html.android-client .tile__label { font-size: 11px; color: #eef3ef; text-shadow: none; }
html.android-client .page-dots { min-height: 24px; }
html.android-client .page-dot { width: 25px; height: 24px; }
html.android-client .page-dot::before { width: 5px; height: 5px; background: #71807b; }
html.android-client .page-dot[aria-current="page"]::before { width: 16px; background: var(--accent); }
html.android-client .foot {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch; gap: 7px; min-height: 62px; padding: 7px 0 0; border: 0;
}
html.android-client .foot__button {
  flex-direction: column; gap: 3px; min-width: 0; min-height: 52px; padding: 6px 3px;
  border: 1px solid #d9eee112; border-radius: 15px; background: #152023; color: #d6e0da; font-size: 9px; font-weight: 550;
}
html.android-client .foot__button .icon { width: 18px; height: 18px; color: var(--accent); }
html.android-client .foot__button:active { background: #22312e; transform: scale(.97); }
html.android-client .nowplaying { display: none; }
html.android-client #swipe-settings { display: none; }
html.android-client .drawer-trigger { bottom: calc(env(safe-area-inset-bottom) + 62px); height: 18px; }
html.android-client .drawer-trigger > span { opacity: .28; }
html.android-client .quick-controls-trigger { color: #dce9e1; }
html.android-client .controls-island { background: #172326; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.android-client .controls-island::before { display: none; }
html.android-client .sheet, html.android-client .options, html.android-client .confirm, html.android-client .glass-drawer, html.android-client .glass-menu {
  border: 1px solid #344447; background: #111a1deF; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px #0008;
}
html.android-client .sheet { width: min(96vw, 760px); max-height: 92dvh; border-radius: 25px; }
html.android-client .sheet__heading { padding: 14px 18px; }
html.android-client .sheet__heading h2 { font-size: 22px; font-weight: 570; letter-spacing: -.4px; }
html.android-client .picker__tools { flex-direction: column; gap: 9px; margin: 0 16px; }
html.android-client .picker__tabs { flex-wrap: nowrap; overflow-x: auto; }
html.android-client .picker__tab { min-width: 68px; padding-inline: 9px; }
html.android-client .picker__list { grid-template-columns: 1fr; padding-inline: 12px; }
html.android-client .picker__list li > button { min-height: 58px; }
html.android-client .settings__grid, html.android-client .controls-grid { grid-template-columns: 1fr; gap: 10px; padding-inline: 16px; }
html.android-client .settings__card, html.android-client .control-card { border-radius: 18px; }
html.android-client .drawer-actions button { background: #ffffff08; box-shadow: none; }
html.android-client .drawer-connection { font-size: 11px; }
html.android-client body :is(.sheet, .options, .confirm, .glass-drawer, .glass-menu, .tile--control .tile__glyph, .controls-island) { backdrop-filter: none; -webkit-backdrop-filter: none; }
html.android-client body :is(.sheet, .options, .confirm, .glass-drawer, .glass-menu)::before,
html.android-client body :is(.sheet, .options, .confirm, .glass-drawer, .glass-menu)::after { display: none; }
html.android-client body :is(button, .page-dot, .tile, .foot__button) { transition-duration: .13s; }
html.android-client .input-pad { --accent: #b6ef83; --muted: #a3b0ad; background: #0b1113; color: #eef3ef; }
html.android-client .input-pad[data-mode="touchpad"] { background: #0b1113; }
html.android-client .touchpad-surface {
  background-color: #0b1113;
  background-image: linear-gradient(#b6ef830d 1px, transparent 1px), linear-gradient(90deg, #b6ef830d 1px, transparent 1px);
  background-size: 28px 28px;
}
html.android-client .touchpad-feedback > span::before {
  background-color: #0b1113;
  background-image: linear-gradient(#b6ef834a 1px, transparent 1px), linear-gradient(90deg, #b6ef834a 1px, transparent 1px);
  background-size: 28px 28px;
}
html.android-client .touchpad-feedback > span::after { background: radial-gradient(circle, #b6ef8352, #77d9bd26 38%, transparent 72%); }
html.android-client .touchpad-hint { color: #a3b0ad; }
html.android-client .touchpad-toolbar button, html.android-client .pc-keys-toggle { color: #d5dfda; }
html.android-client .touchpad-tools .has-text-focus, html.android-client #pointer-options-toggle[aria-expanded="true"],
html.android-client .pc-keys-toggle[aria-expanded="true"], html.android-client .pc-clipboard .pc-clipboard__toggle[aria-expanded="true"] {
  color: var(--accent); background: #b6ef831a;
}
html.android-client .pc-keys button { border-color: #b6ef8324; color: #d0ddd4; background: #b6ef8308; box-shadow: none; }
html.android-client .pc-keys button:not(:disabled):active { background-color: #b6ef8333; }
html.android-client .remote-keyboard { background: #121b1fee; border: 1px solid #304044; }
html.android-client .remote-keyboard input { background: #0b1113; color: #eef3ef; }
html.android-client .remote-keyboard button { color: var(--accent); }
html.android-client .pc-clipboard__panel { background: #121b1fee; border: 1px solid #304044; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.android-client .pc-clipboard button { color: #d5dfda; }
html.android-client .pc-clipboard button:focus-visible, html.android-client .pc-keys button:focus-visible { outline-color: var(--accent); }
html.android-client .controls-curtain { --qc-disc: #b6ef83; --qc-ink: #172016; --qc-well: #172225; --qc-edge: inset 0 0 0 1px #d9eee116; transition-duration: .2s; }
html.android-client .controls-curtain[open] { clip-path: inset(0 round 24px); }
html.android-client .capture-actions button { min-height: 116px; border-color: #ffffff14; border-radius: 18px; background: #172225; }
html.android-client .capture-actions button > span { color: var(--accent); }
html.android-client .capture-status, html.android-client .capture-file, html.android-client .capture-tip { line-height: 1.55; }
html.android-client .recording-stop { background: #3a2422; backdrop-filter: none; border-color: #ffb8ad55; }
html.android-client .toast { max-width: calc(100vw - 28px); font-size: 12px; }

@media (max-width: 420px) {
  html.android-client .app { padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right)); }
  html.android-client .bar { gap: 6px; }
  html.android-client .brand { font-size: 15px; }
  html.android-client .bar__host { max-width: 31vw; font-size: 10px; }
  html.android-client .bar__state { padding: 5px 6px; font-size: 9px; }
  html.android-client .foot { gap: 5px; }
  html.android-client .foot__button { font-size: 8px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  html.android-client body.is-immersive .app { padding-top: calc(42px + env(safe-area-inset-top)); padding-inline: max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-left)); }
  html.android-client .bar { min-height: 44px; }
  html.android-client .dock-heading { padding: 5px 2px 3px; }
  html.android-client .dock-heading h1 { font-size: 16px; }
  html.android-client .dock-heading .eyebrow { display: none; }
  html.android-client .dock-page { gap: 5px 10px; padding-block: 2px; }
  html.android-client .tile { gap: 4px; max-height: 106px; }
  html.android-client .tile__glyph { width: min(var(--icon-size), 14vh) !important; height: min(var(--icon-size), 14vh) !important; }
  html.android-client .tile__label { font-size: 10px; }
  html.android-client .page-dots { min-height: 18px; }
  html.android-client .foot { min-height: 52px; padding-top: 4px; }
  html.android-client .foot__button { flex-direction: row; gap: 6px; min-height: 42px; font-size: 10px; }
  html.android-client .foot__button .icon { width: 17px; height: 17px; }
}
