:root {
  --bg: #0f1218;
  --panel: #161a22;
  --panel2: #1d222c;
  --line: #2a303c;
  --text: #e8eaef;
  --muted: #8d95a5;
  --a: #f2b544;
  --b: #5fb4ff;
  --danger: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--b); }
[hidden] { display: none !important; }

.top { padding: 18px 24px; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .2px; }
.logo { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--panel2); margin-right: 6px; font-weight: 800; }
.logo { color: var(--a); }
.logo i { color: var(--muted); font-style: normal; margin: 0 1px; }

main { max-width: 860px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 640px; }
.fine { color: var(--muted); font-size: 13px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], .share input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 13px; font: inherit;
}
input[type=text]:focus, .share input:focus { outline: 2px solid var(--b); outline-offset: -1px; }

.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.drop {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer;
  background: var(--panel); border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 20px; min-height: 140px; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--muted); background: var(--panel2); }
.drop.has { border-style: solid; }
.drop[data-slot=a].has { border-color: var(--a); }
.drop[data-slot=b].has { border-color: var(--b); }
.drop .slot { font-size: 34px; font-weight: 800; line-height: 1; }
.drop[data-slot=a] .slot { color: var(--a); }
.drop[data-slot=b] .slot { color: var(--b); }
.drop .fname { font-weight: 600; word-break: break-all; margin-top: 8px; }
.drop .finfo { color: var(--muted); font-size: 13px; }

button { font: inherit; cursor: pointer; border: none; border-radius: 10px; color: var(--text); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }
.primary { background: var(--a); color: #1a1406; font-weight: 700; padding: 12px 22px; }
.primary:not(:disabled):hover { filter: brightness(1.08); }
.ghost { background: transparent; border: 1px solid var(--line); padding: 9px 14px; color: var(--text); }
.ghost:hover { background: var(--panel2); }
.danger { color: var(--danger); border-color: #4a2a2e; margin-top: 18px; }

.status { margin: 16px 0; color: var(--muted); min-height: 1.5em; }
.status:empty { display: none; }
.status.err { color: var(--danger); }
.bar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; margin-top: 8px; max-width: 420px; }
.bar > i { display: block; height: 100%; background: var(--a); width: 0; transition: width .15s; }

.phead { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.phead h1 { flex: 1 1 300px; word-break: break-word; }
.share { display: flex; gap: 8px; flex: 1 1 320px; max-width: 420px; }
.share input { font-size: 13px; padding: 9px 11px; }
.share button { white-space: nowrap; }

.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 18px; }
.abbtn {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px;
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; min-height: 120px; transition: border-color .08s, background .08s, transform .05s;
}
.abbtn:active { transform: scale(.99); }
.abbtn .big { font-size: 44px; font-weight: 800; line-height: 1; color: var(--muted); }
.abbtn .tname { font-weight: 600; margin-top: 8px; word-break: break-all; }
.abbtn .tmeta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.abbtn[data-slot=a][aria-pressed=true] { border-color: var(--a); background: #221d12; }
.abbtn[data-slot=b][aria-pressed=true] { border-color: var(--b); background: #121c26; }
.abbtn[data-slot=a][aria-pressed=true] .big { color: var(--a); }
.abbtn[data-slot=b][aria-pressed=true] .big { color: var(--b); }

.wave { position: relative; height: 110px; background: var(--panel); border-radius: var(--radius); overflow: hidden; cursor: pointer; touch-action: none; user-select: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.cursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); left: 0; pointer-events: none; }
.loop { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.09); border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); pointer-events: none; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.round { width: 58px; height: 58px; border-radius: 50%; padding: 0; display: grid; place-items: center; }
.round svg { width: 26px; height: 26px; fill: #1a1406; }
.i-pause { display: none; }
.playing .i-play { display: none; }
.playing .i-pause { display: block; }
.switch { background: var(--panel2); border: 1px solid var(--line); padding: 14px 20px; font-weight: 600; }
.switch:hover { background: #262c38; }
kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text); }
.switch kbd { margin-left: 6px; }
.toggles { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.tog { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; cursor: pointer; }
.tog input { accent-color: var(--a); }
.volrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.volrow input { vertical-align: middle; accent-color: var(--a); width: 160px; }
.align { margin-top: 18px; padding: 14px 16px; background: var(--panel); border-radius: var(--radius); }
.align p { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.nudge { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nlabel { color: var(--muted); font-size: 13px; margin-right: 4px; }
.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.nudge input { width: 92px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-size: 13px; margin-right: 6px; }
.help { color: var(--muted); font-size: 13px; margin-top: 22px; line-height: 2; }

@media (max-width: 600px) {
  main { padding: 22px 14px 48px; }
  .drops, .ab { grid-template-columns: 1fr 1fr; gap: 10px; }
  .abbtn { min-height: 110px; padding: 14px; }
  .abbtn .big { font-size: 36px; }
  .toggles { margin-left: 0; }
  .help { display: none; }
}
