/* Layout: Vollbild-App. Breit = macOS-Aufbau (Seitenleiste, Deck, Tabelle), schmal = iOS-Aufbau (Tabs, Liste, Mini-Player).
   Monochrom nach Memoria; Farbe nur als Datenkodierung der Tonart (Camelot). Bewusst nur Dark Theme. */
:root {
  color-scheme: dark;
  --bg: #0c0c0e;
  --panel: #111114;
  --raised: #17171b;
  --hover: #1d1d22;
  --line: #24242a;
  --line-soft: #1a1a1f;
  --fg: #f1f1f3;
  --fg2: #b3b3bb;
  --fg3: #7b7b85;
  --fg4: #4c4c55;
  --danger-bg: rgba(239, 68, 68, .16);
  --danger-fg: #f39a9a;
  --font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-lg: 14px;
  --row: 38px;
  --ease: cubic-bezier(.25, .46, .45, .94);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); }
body { font-family: var(--font-ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--fg2); outline-offset: 2px; border-radius: 4px; }
.ic { flex: none; display: block; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
[hidden] { display: none !important; }

/* ---------- Anmeldung ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.login-box { width: min(340px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-or { font-size: 12px; color: var(--fg4); text-align: center; margin-top: 10px; }
.login-code { display: flex; gap: 8px; }
.login-code input { flex: 1; min-width: 0; font-family: var(--font-num); letter-spacing: .2em; text-align: center; }
.login-code .btn { height: 46px; }
.keylist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.keylist li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-soft); border-radius: 11px; padding: 10px 12px; }
.keylist li > .ic { color: var(--fg3); }
.keylist span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.keylist b { font-weight: 500; }
.keylist small { font-size: 12px; color: var(--fg3); }
.login .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.login h1 { margin: 6px 0 0; font-size: 24px; font-weight: 400; letter-spacing: -.02em; }
.login p { margin: 0 0 8px; color: var(--fg3); }
.login input { height: 46px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); padding: 0 14px; font-size: 16px; }
.login input:focus { outline: 0; border-color: var(--fg3); }
.login .btn { height: 46px; justify-content: center; font-size: 15px; }
.err { color: var(--danger-fg); font-size: 13px; margin: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; color: var(--fg); flex: none; }

/* ---------- Bausteine ---------- */
.btn { height: 32px; padding: 0 12px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg2); transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; }
.btn:not(:disabled):hover { background: var(--hover); border-color: var(--fg4); color: var(--fg); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 500; }
.btn-primary:not(:disabled):hover { background: #fff; color: var(--bg); border-color: #fff; }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.btn-danger:not(:disabled):hover { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-fg); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--fg3); transition: background .15s, color .15s; flex: none; }
.icon-btn:not(:disabled):hover { background: var(--hover); color: var(--fg); }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; transition: transform .15s var(--ease); flex: none; }
.play-btn:not(:disabled):hover { transform: scale(1.04); }
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 22px; padding: 0 7px; border-radius: 6px; font-family: var(--font-num); font-size: 12px; font-weight: 500; color: hsl(var(--h) 55% 74%); background: hsl(var(--h) 45% 55% / .15); border: 1px solid hsl(var(--h) 45% 60% / .22); }
.key.big { height: 30px; min-width: 52px; font-size: 17px; border-radius: 8px; }
.key.none { color: var(--fg4); background: none; border-color: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--fg3); }
.pill.bad { color: var(--danger-fg); border-color: var(--danger-bg); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2px; background: var(--fg); border-radius: 1px; height: 4px; }
.eq.on i { animation: eq .9s var(--ease) infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
.spin { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.empty { padding: 60px 20px; text-align: center; color: var(--fg3); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { color: var(--fg2); font-weight: 500; font-size: 15px; }
.empty .btn { margin-top: 8px; }
.empty code { font-family: var(--font-num); font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--fg2); max-width: 100%; overflow-x: auto; white-space: nowrap; display: block; }
input[type="checkbox"].chk { appearance: none; width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--fg4); display: grid; place-items: center; margin: 0; cursor: pointer; background: none; }
input[type="checkbox"].chk:checked { background: var(--fg); border-color: var(--fg); }
input[type="checkbox"].chk:checked::after { content: ""; width: 7px; height: 4px; border-left: 1.6px solid var(--bg); border-bottom: 1.6px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.sel-select { height: 30px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); padding: 0 8px; font-size: 12.5px; color: var(--fg2); }

/* ---------- macOS-Aufbau ---------- */
.mac { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.titlebar { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.wtitle { font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 32px; color: var(--fg3); width: 280px; transition: border-color .2s; }
.search:focus-within { border-color: var(--fg4); }
.search input { background: none; border: 0; outline: 0; width: 100%; font-size: 13px; color: var(--fg); }
.search input::placeholder { color: var(--fg4); }
.mac-body { flex: 1; display: flex; min-height: 0; }
.side { width: 236px; flex: none; border-right: 1px solid var(--line-soft); background: var(--panel); overflow-y: auto; padding: 10px 8px 0; display: flex; flex-direction: column; gap: 14px; }
.side-sec { display: flex; flex-direction: column; gap: 1px; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg4); }
.side-hint { text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--fg4); }
.side-add { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: var(--fg3); }
.side-add:hover { background: var(--hover); color: var(--fg); }
.side-row { position: relative; display: flex; align-items: center; border-radius: 7px; }
.side-row:hover { background: var(--raised); }
.side-row.on { background: var(--hover); }
.side-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 10px; font-size: 13px; color: var(--fg2); text-align: left; border-radius: 7px; }
.side-row.on .side-item { color: var(--fg); }
.side-item .ic { color: var(--fg3); }
.side-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .cnt { font-size: 11px; color: var(--fg4); }
.side-meta { display: block; font-size: 11px; color: var(--fg4); }
.side-none { padding: 6px 10px; font-size: 12.5px; color: var(--fg4); }
.side-share { position: absolute; right: 4px; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--fg3); background: var(--hover); opacity: 0; transition: opacity .15s; }
.side-row:hover .side-share, .side-share:focus-visible { opacity: 1; }
.side-row:hover .cnt { visibility: hidden; }
.side-share:hover { color: var(--fg); }
.side-foot { margin-top: auto; padding: 12px 10px 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--fg3); position: sticky; bottom: 0; background: var(--panel); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.foot-links { display: flex; gap: 12px; }
.foot-links button { font-size: 12px; color: var(--fg3); }
.foot-links button:hover { color: var(--fg); }
.meter { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--fg2); }
.mac-main { flex: 1; min-width: 0; display: flex; flex-direction: column; container-type: inline-size; }

/* Deck */
.deck { flex: none; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "art meta stats" "wave wave wave"; gap: 14px 16px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.art { grid-area: art; width: 64px; height: 64px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; color: var(--fg4); overflow: hidden; }
.deck-meta { grid-area: meta; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.deck-title { font-size: 19px; font-weight: 400; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-sub { font-size: 13px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-stats { grid-area: stats; display: flex; align-items: center; gap: 26px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.stat-num { font-family: var(--font-num); font-size: 30px; font-weight: 400; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--fg4); }
.stat-lbl.keyname { text-transform: none; letter-spacing: .04em; font-size: 11px; }
.transport { display: flex; align-items: center; gap: 6px; }
.wave-wrap { grid-area: wave; position: relative; }
canvas.wave { display: block; width: 100%; height: 64px; cursor: pointer; touch-action: none; }
.wave-empty { height: 64px; display: grid; place-items: center; font-size: 12px; color: var(--fg4); border: 1px dashed var(--line); border-radius: 8px; }
.wave-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg4); margin-top: 6px; }

/* Werkzeugleiste */
.bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; flex-wrap: wrap; }
.bar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.bar-title h2, .pl-name { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.pl-name { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; width: 230px; }
.pl-name:hover { border-color: var(--line); }
.pl-name:focus { outline: 0; border-color: var(--fg4); background: var(--raised); }
.meta { font-size: 12px; color: var(--fg3); white-space: nowrap; }
.bar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tog { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--fg3); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; white-space: nowrap; }
.tog:not(:disabled):hover { color: var(--fg); border-color: var(--fg4); }
.tog[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.selinfo { font-size: 12.5px; color: var(--fg2); padding-right: 4px; white-space: nowrap; }

/* Titelliste (virtuell, feste Zeilenhöhe) */
.vscroll { flex: 1; overflow: auto; min-height: 0; position: relative; overscroll-behavior: contain; }
.tgrid { --cols: 34px 34px minmax(180px, 2.2fr) minmax(130px, 1.5fr) minmax(110px, 1fr) 72px 62px 58px 52px 92px; display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 10px; padding: 0 20px 0 20px; }
.thead { position: sticky; top: 0; z-index: 2; height: 33px; background: var(--bg); border-bottom: 1px solid var(--line-soft); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg4); }
.thead button { display: inline-flex; align-items: center; gap: 4px; text-transform: inherit; letter-spacing: inherit; color: inherit; white-space: nowrap; }
.thead button:hover, .thead .sorted button { color: var(--fg2); }
.vbody { position: relative; }
.trow { position: absolute; left: 0; right: 0; height: var(--row); border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--fg2); cursor: pointer; transition: background .12s; }
.trow:hover { background: var(--panel); }
.trow.is-sel { background: var(--raised); }
.trow.is-cur { color: var(--fg); }
.trow.is-cur .c-title { font-weight: 500; }
.trow > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r { text-align: right; justify-self: end; }
.t-muted { color: var(--fg3); }
.c-art { width: 28px; height: 28px; border-radius: 5px; background: var(--raised); display: grid !important; place-items: center; color: var(--fg4); overflow: hidden; }
@container (max-width: 900px) { .tgrid { --cols: 34px 34px minmax(150px, 2fr) minmax(110px, 1.4fr) minmax(100px, 1fr) 72px 62px 58px; } .c-br, .c-add { display: none !important; } }
@container (max-width: 720px) {
  .tgrid { --cols: 34px 34px minmax(140px, 2fr) minmax(100px, 1.3fr) 66px 58px 52px; }
  .c-genre { display: none !important; }
  .deck { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "art meta" "stats stats" "wave wave"; }
  .art { width: 56px; height: 56px; }
  .deck-stats { gap: 18px; justify-content: space-between; }
  .stat-num { font-size: 24px; }
}
@media (max-width: 1050px) { .side { width: 204px; } .search { width: 210px; } }

/* ---------- iOS-Aufbau ---------- */
.ios { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.ios-screen { position: relative; flex: 1; overflow-y: auto; min-height: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: 12px; overscroll-behavior: contain; }
.ios-head { padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 10px; }
.ios-nav { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.ios-back { display: inline-flex; align-items: center; gap: 2px; color: var(--fg2); font-size: 16px; margin-left: -6px; }
.ios-actions { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.ios-txtbtn { font-size: 16px; color: var(--fg2); padding: 6px; }
.ios-title { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
.ios-sub { font-size: 13px; color: var(--fg3); margin-top: -4px; }
.ios-search { display: flex; align-items: center; gap: 8px; height: 40px; border-radius: 11px; background: var(--raised); padding: 0 11px; color: var(--fg3); }
.ios-search input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; color: var(--fg); min-width: 0; }
.ios-search input::placeholder { color: var(--fg4); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px max(18px, env(safe-area-inset-right)) 4px max(18px, env(safe-area-inset-left)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--fg2); display: inline-flex; align-items: center; gap: 6px; background: none; }
.chip[aria-pressed="true"], select.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 13px; }
.ios-vscroll { position: relative; margin-top: 8px; }
.ios-row { position: absolute; left: 0; right: 0; height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); cursor: pointer; }
.ios-row:active { background: var(--panel); }
.ios-row.is-cur .ios-t { font-weight: 500; }
.ios-art { width: 44px; height: 44px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; color: var(--fg4); flex: none; overflow: hidden; position: relative; }
.ios-art .eq { position: absolute; inset: 0; margin: auto; width: 14px; justify-content: center; align-items: center; }
.ios-art .eq.on { background: rgba(0,0,0,.45); width: 100%; height: 100%; }
.ios-txt { flex: 1; min-width: 0; align-self: stretch; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.ios-txt-main { flex: 1; min-width: 0; }
.ios-t { display: block; font-size: 15px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-a { display: block; font-size: 13px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ios-bpm { font-size: 12px; color: var(--fg3); }
.ios-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--fg4); flex: none; display: grid; place-items: center; color: var(--bg); }
.ios-check.on { background: var(--fg); border-color: var(--fg); }
.ios-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ios-plrow { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); }
.ios-plrow .ios-txt { cursor: pointer; }
.ios-card { margin: 0 18px 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.ios-card-top { display: flex; align-items: center; gap: 10px; }
.ios-card-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--fg3); }
.ios-new { margin: 6px 18px 14px; height: 46px; border-radius: 12px; border: 1px dashed var(--line); color: var(--fg2); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; width: calc(100% - 36px); }
.urlbox { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 4px 0 10px; height: 36px; }
.urlbox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--font-num); font-size: 12px; color: var(--fg2); }
.mini { flex: none; margin: 0 max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); height: 62px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); display: flex; align-items: center; gap: 11px; padding: 0 8px; position: relative; overflow: hidden; cursor: pointer; }
.mini .ios-art { width: 44px; height: 44px; }
.mini-txt { flex: 1; min-width: 0; }
.mini-prog { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--fg); }
.mini .play-btn { width: 40px; height: 40px; }
.selbar { flex: none; margin: 0 8px 6px; height: 62px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 0 14px; }
.ios-tabs { flex: none; display: flex; justify-content: space-around; border-top: 1px solid var(--line-soft); background: var(--panel); padding: 7px 0 max(10px, env(safe-area-inset-bottom)); }
.ios-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--fg4); width: 90px; }
.ios-tab[aria-current="page"] { color: var(--fg); }
.player { position: absolute; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 12px) 22px calc(env(safe-area-inset-bottom, 0px) + 22px); gap: 18px; animation: up .35s var(--ease); overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.grab { align-self: center; width: 44px; height: 24px; display: grid; place-items: center; flex: none; }
.grab::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--fg4); }
.player-art { width: 100%; aspect-ratio: 1; max-width: min(100%, 340px); align-self: center; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; color: var(--fg4); overflow: hidden; flex: none; }
.player-stats { display: flex; justify-content: space-between; align-items: flex-end; }
.player-ctrl { display: flex; align-items: center; justify-content: center; gap: 30px; }
.player-ctrl .play-btn { width: 64px; height: 64px; }

/* ---------- Dialoge ---------- */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; z-index: 41; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.mac .sheet { top: 52px; left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); border-radius: 0 0 16px 16px; border-top: 0; animation: drop .3s var(--ease); max-height: calc(100% - 72px); }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } }
.ios .sheet { left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0; animation: up .3s var(--ease); max-height: calc(100% - env(safe-area-inset-top, 0px) - 24px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; gap: 12px; }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 8px 18px 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.flabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg4); }
.sel, .txt { height: 38px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); padding: 0 10px; font-size: 13.5px; color: var(--fg); }
.txt:focus { outline: 0; border-color: var(--fg4); }
.ios .sel, .ios .txt { font-size: 16px; height: 44px; }
.hint { font-size: 12px; color: var(--fg3); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { text-align: left; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; color: var(--fg2); transition: border-color .15s, background .15s; }
.opt .ic { color: var(--fg3); margin-bottom: 4px; }
.opt b { font-weight: 500; font-size: 13.5px; color: var(--fg); }
.opt small { font-size: 11.5px; color: var(--fg3); }
.opt[aria-pressed="true"] { border-color: var(--fg2); background: var(--raised); }
.opt[aria-pressed="true"] .ic { color: var(--fg); }
.codebox { display: flex; gap: 8px; }
.codebox input { flex: 1; min-width: 0; height: 38px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); padding: 0 12px; font-family: var(--font-num); font-size: 16px; letter-spacing: .25em; text-transform: uppercase; color: var(--fg); }
.codebox input:focus { outline: 0; border-color: var(--fg4); }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 12.5px; color: var(--fg3); white-space: nowrap; padding: 0 6px; }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--fg); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; font-size: 13.5px; color: var(--fg); }
.switch-row small { font-size: 12px; color: var(--fg3); }
input.switch { appearance: none; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg3); transition: transform .2s var(--ease), background .2s; }
input.switch:checked { background: var(--fg); }
input.switch:checked::after { transform: translateX(16px); background: var(--bg); }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; flex-wrap: wrap; }
.ios .sheet-foot { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.ios .sheet-foot .btn { flex: 1; justify-content: center; height: 46px; font-size: 15px; border-radius: 12px; }
.done-head { display: flex; align-items: center; gap: 12px; }
.done-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; color: var(--fg); flex: none; }
.done-head b { display: block; font-weight: 500; font-size: 15px; }
.done-head span { font-size: 12.5px; color: var(--fg3); }
.code-show { font-family: var(--font-num); font-size: 26px; font-weight: 400; letter-spacing: .3em; color: var(--fg); user-select: all; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact { border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact b { font-weight: 400; font-size: 13.5px; color: var(--fg); }
.fact span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg4); }
.drop { border: 1px dashed var(--fg4); border-radius: 14px; padding: 26px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--fg3); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--fg2); background: var(--raised); }
.drop .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress .meter { height: 4px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--fg3); }
.progress-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg2); }
.fails { font-size: 12px; color: var(--danger-fg); max-height: 90px; overflow-y: auto; margin: 0; padding-left: 16px; }
.dropcover { position: absolute; inset: 0; z-index: 50; background: rgba(12,12,14,.85); display: grid; place-items: center; font-size: 15px; color: var(--fg2); border: 2px dashed var(--fg3); pointer-events: none; }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: 999px; display: flex; align-items: center; gap: 8px; white-space: nowrap; animation: toast .25s var(--ease); max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.bad { background: var(--danger-fg); }
.ios .toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
@keyframes toast { from { transform: translate(-50%, 10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
