/* Loopmarks — neutral, light-first theme with an automatic dark mode. */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --inset: #ecebe6;
  --line: #dddad3;
  --line-2: #c9c5bc;
  --text: #1d1c1a;
  --muted: #6b675f;
  --accent: #3b5bdb;        /* indigo: actions, playhead, active states */
  --accent-ink: #ffffff;
  --accent-soft: #e5eafc;
  --ok: #2f9e6e;
  --warn: #b7791f;
  --wave-wave: rgba(59, 91, 219, 0.55);
  --wave-grid: rgba(0, 0, 0, 0.05);
  --wave-label: rgba(80, 76, 70, 0.75);
  --wave-beat: rgba(0, 0, 0, 0.06);
  --wave-beatStrong: rgba(0, 0, 0, 0.16);
  --playhead: #1d1c1a;
  --dock-bg: rgba(255, 255, 255, 0.94);
  --r: 12px;
  --dock-h: 112px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16161a;
    --surface: #1f1f24;
    --surface-2: #26262c;
    --inset: #121215;
    --line: #34343b;
    --line-2: #46464f;
    --text: #ecebe8;
    --muted: #9c9aa3;
    --accent: #7b93ff;
    --accent-ink: #0f1220;
    --accent-soft: #262c48;
    --ok: #5cc794;
    --warn: #e5b45a;
    --wave-wave: rgba(123, 147, 255, 0.6);
    --wave-grid: rgba(255, 255, 255, 0.05);
    --wave-label: rgba(200, 198, 206, 0.7);
    --wave-beat: rgba(255, 255, 255, 0.07);
    --wave-beatStrong: rgba(255, 255, 255, 0.18);
    --playhead: #ffffff;
    --dock-bg: rgba(22, 22, 26, 0.94);
  }
}
:root[data-theme="dark"] {
    --bg: #16161a;
    --surface: #1f1f24;
    --surface-2: #26262c;
    --inset: #121215;
    --line: #34343b;
    --line-2: #46464f;
    --text: #ecebe8;
    --muted: #9c9aa3;
    --accent: #7b93ff;
    --accent-ink: #0f1220;
    --accent-soft: #262c48;
    --ok: #5cc794;
    --warn: #e5b45a;
    --wave-wave: rgba(123, 147, 255, 0.6);
    --wave-grid: rgba(255, 255, 255, 0.05);
    --wave-label: rgba(200, 198, 206, 0.7);
    --wave-beat: rgba(255, 255, 255, 0.07);
    --wave-beatStrong: rgba(255, 255, 255, 0.18);
    --playhead: #ffffff;
    --dock-bg: rgba(22, 22, 26, 0.94);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }

/* --- top bar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.2px; font-size: 17px; }
.in-player .brand span { display: none; }
.tb-back { color: var(--accent); text-decoration: none; font-size: 15px; min-height: 40px; display: inline-flex; align-items: center; gap: 2px; padding-right: 4px; }
.tb-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand + .tb-title[hidden] + .tb-btn, .tb-btn { margin-left: auto; }
.tb-btn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--muted); cursor: pointer; min-height: 36px; }

/* --- buttons / controls ------------------------------------------------------ */
.btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; cursor: pointer; line-height: 1.2;
}
.btn:hover { border-color: var(--line-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.on, .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ctl-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.muted { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
select.mini { padding: 6px 8px; font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="number"], .edge-input {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px;
  font-size: 15px; font-variant-numeric: tabular-nums;
}
.status { font-size: 13px; color: var(--muted); margin: 0; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* --- library ----------------------------------------------------------------- */
.lib { max-width: 680px; margin: 0 auto; padding: 18px 16px 60px; }
.lib-hero { text-align: center; padding: 18px 0 20px; }
.lib-hero h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 10px; }
.lede { color: var(--muted); font-size: 16px; max-width: 32em; margin: 0 auto 18px; }
.lib-hero .status { margin-top: 10px; min-height: 18px; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lib-item { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 6px 8px; }
.lib-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--text); padding: 4px; min-height: 52px; }
.lib-play { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.lib-main { display: flex; flex-direction: column; min-width: 0; }
.lib-title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.lib-sub { font-size: 13px; color: var(--muted); }
.lib-act { flex: none; width: 44px; height: 44px; border-radius: 10px; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.lib-act:hover { background: var(--surface-2); color: var(--text); }
.lib-empty { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 28px 18px; text-align: center; color: var(--muted); }
.lib.dropping .lib-empty, .lib.dropping .lib-list { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: var(--r); }
.lib-foot { text-align: center; margin-top: 28px; }

/* --- player layout -------------------------------------------------------------- */
.player-main {
  max-width: 680px; margin: 0 auto; padding: 14px 14px calc(var(--dock-h) + 24px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
}
@media (min-width: 760px) { .player-main { max-width: 900px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stage { display: grid; gap: 8px; }
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lbl-short { display: none; }
@media (max-width: 420px) {
  .tools { flex-wrap: nowrap; gap: 5px; }
  .tools .btn { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 9px 8px; }
  #undoBtn { flex: none; }
  #undoBtn .lbl, #autoMarkers .lbl { display: none; }
  #autoMarkers .lbl-short { display: inline; }
}

/* --- waveform ----------------------------------------------------------------------- */
.timeline {
  position: relative; height: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
@media (min-width: 760px) { .timeline { height: 190px; } }
.timeline canvas { position: absolute; inset: 0; display: block; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid currentColor; pointer-events: none; }
.marker.picking { border-left-width: 3px; box-shadow: 0 0 8px currentColor; }
.marker-flag {
  position: absolute; left: 0; top: 4px; z-index: 2; pointer-events: auto; cursor: pointer;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 0 6px 6px 0;
  max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.marker-flag.flip { left: auto; right: 0; border-radius: 6px 0 0 6px; }
.marker-pin {
  position: absolute; top: 58px; left: -10px; z-index: 2; width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.marker.picking .marker-flag, .marker.picking .marker-pin { box-shadow: 0 0 0 2px var(--text); }
.editing .marker-flag, .editing .marker-pin { cursor: ew-resize; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--playhead); pointer-events: none; z-index: 3; }
.drag-tip {
  position: absolute; bottom: 20px; transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.count-big {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 84px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-variant-numeric: tabular-nums;
}
.analyze-overlay {
  position: absolute; inset: 0; z-index: 6; background: color-mix(in srgb, var(--surface) 85%, transparent);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px;
}
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loop-lanes { position: relative; width: 100%; overflow: hidden; }
.loop-bar { position: absolute; border: 1px solid; border-radius: 6px; display: flex; align-items: center; cursor: pointer; overflow: hidden; }
.loop-bar.active { box-shadow: inset 0 0 0 2px var(--text); }
.loop-bar-label { font-size: 12px; font-weight: 600; padding: 0 7px; white-space: nowrap; pointer-events: none; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

.view-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vbtn { min-width: 42px; height: 42px; border-radius: 10px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); font-size: 16px; }
.vbtn.wide { padding: 0 12px; font-size: 14px; }
.vbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.zoom-label { font-size: 12px; color: var(--muted); }
.zoom-label:empty { display: none; }
.snap-toggle { margin-left: auto; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

/* --- speed / count-in ----------------------------------------------------------------- */
.speed-panel { display: grid; gap: 10px; }
.speed-head { display: flex; align-items: baseline; gap: 8px; }
.speed-head b { font-variant-numeric: tabular-nums; font-size: 17px; }
.presets { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.presets button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 0; font-size: 13px; cursor: pointer; min-width: 0; }
.presets button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.countin-panel { display: grid; gap: 10px; }
.countin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bpm-input { width: 72px; }

/* --- lists ------------------------------------------------------------------------------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.nudge-ctl { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.empty { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; border-left: 4px solid var(--dot, var(--line));
}
.row.picking { box-shadow: inset 0 0 0 2px var(--accent); }
.row.pickable { cursor: pointer; }
.row-play, .row-go {
  flex: none; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.row-main { flex: 1; min-width: 0; }
.row-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; background: transparent; border: none; padding: 0; }
input.row-name { min-width: 60px; border-bottom: 1px dashed var(--line-2); padding: 4px 0; }
.row-main .row-name { display: block; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row-time { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-time.editable { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px; cursor: pointer; }
.row-time.editable.open { border-color: var(--accent); }
.edge { display: flex; flex-basis: 100%; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }
.edge button { width: 46px; height: 42px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; cursor: pointer; }
.edge-input { width: 100px; }
.del { flex: none; width: 42px; height: 42px; border-radius: 10px; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.del:hover { background: var(--surface); color: #d1495b; }
.loop-row.active { box-shadow: inset 0 0 0 2px var(--dot); }
.loop-row.active .row-play { background: var(--dot); border-color: var(--dot); color: #fff; }
.loop-badge { flex: none; font-size: 11px; font-weight: 700; color: var(--dot); border: 1px solid var(--dot); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.marker-row.current { background: var(--accent-soft); }
.marker-row.current .row-go { background: var(--dot); border-color: var(--dot); color: #fff; }
.edit-only { display: none; }
.editing .edit-only { display: flex; }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- bottom dock ------------------------------------------------------------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--dock-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 6px 14px calc(8px + env(safe-area-inset-bottom));
  display: grid; gap: 6px;
}
.dock > * { width: 100%; max-width: 680px; margin: 0 auto; }
@media (min-width: 760px) { .dock > * { max-width: 900px; } }
.dock-info { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.dock-info .status { margin-left: auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; font-size: 12px; }
.loop-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 60%;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; font-weight: 600;
}
.loop-chip::before { content: "↻"; }
.loop-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.loop-chip button { width: 30px; height: 26px; border: none; border-radius: 999px; background: rgba(0,0,0,.18); color: inherit; cursor: pointer; }
.pick-banner { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; background: var(--ok); color: #fff; border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 13px; font-weight: 600; }
.pick-banner #pickTxt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-cancel { background: rgba(0,0,0,.2); color: #fff; border: none; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.pick-banner:not([hidden]) ~ .status { display: none; }
.dock-main { display: flex; align-items: center; gap: 8px; }
.play { width: 58px; height: 58px; flex: none; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-size: 22px; cursor: pointer; }
.play.counting { background: var(--warn); color: #fff; font-size: 26px; font-weight: 800; }
.dbtn { width: 46px; height: 46px; flex: none; border-radius: 12px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); font-size: 17px; }
.time { margin-left: auto; font-size: 24px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-total { color: var(--muted); font-size: 15px; }
@media (max-width: 380px) { .dbtn { width: 42px; } .time { font-size: 20px; } }
@media (orientation: landscape) and (max-height: 500px) {
  :root { --dock-h: 72px; }
  .play { width: 48px; height: 48px; }
  .timeline { height: 130px; }
}
@media (pointer: coarse) {
  .marker-flag { padding: 5px 9px; }
  .marker-pin { width: 24px; height: 24px; left: -12px; }
  .vbtn { min-width: 44px; height: 44px; }
  .row-go, .row-play, .del { width: 44px; height: 44px; }
  input[type="number"], .edge-input, select { font-size: 16px; }
}

/* --- groups ------------------------------------------------------------------ */
.lib-groups { margin-top: 22px; }
.group-row .row-main { min-width: 120px; }
.group-search { margin-top: 12px; display: grid; gap: 10px; }
.group-search input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.group-card .panel-head .btn { flex: none; }
.set-row .row-main { min-width: 160px; }
.pub-form { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.pub-form .btn.primary { justify-self: start; }

/* --- install help -------------------------------------------------------------- */
.install-card { margin-bottom: 14px; border-color: var(--accent); background: var(--accent-soft); }
.install-card h2 { display: flex; align-items: center; gap: 8px; }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; }
.install-card p { margin: 0 0 4px; }
.install-card .btn.primary { margin-top: 10px; }
.ios-share { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 4px; font-size: 12px; line-height: 1.3; }
.lib-foot a { color: var(--accent); }

/* --- Studio hero (2026-10) ---------------------------------------------------- */
:root { --paper: #f6f4ef; --mark-a: #d1495b; --mark-b: #2f9e6e; }
:root { --paper-dark: #121216; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: var(--paper-dark); } }
:root[data-theme="dark"] { --paper: var(--paper-dark); }
body { background: var(--paper); }
.topbar { background: var(--paper); }
.lib-hero { text-align: left; padding: 22px 2px 6px; }
.hero-title {
  font-size: clamp(40px, 11vw, 60px); line-height: 1.0; letter-spacing: -0.035em;
  font-weight: 700; margin: 0 0 14px;
}
.hero-title span { display: block; }
.hero-title .accent { color: var(--accent); }
.hero-sub { font-size: 17px; color: var(--muted); margin: 0 0 22px; max-width: 26em; }
.hero-wave { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 0 24px; }
.hw-loop { fill: var(--accent); opacity: .12; }
.hw-mark1 { fill: var(--mark-a); }
.hw-mark2 { fill: var(--mark-b); }
.btn.pill { border-radius: 999px; }
.lib-hero .btn.big { padding: 14px 26px; font-size: 17px; }
.hero-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.lib-hero .status { margin-top: 8px; }

/* hero illustration */
.hw-bars { fill: var(--accent); opacity: .35; }
.hw-bars-in { fill: var(--accent); }
.hw-bars rect, .hw-bars-in rect { fill: inherit; opacity: 1; }
.hw-loop { fill: var(--accent); opacity: .12; }
.hw-ring { fill: var(--paper); }
.hw-badge { fill: var(--accent); }
.hw-glyph { stroke: var(--accent-ink); }
.hw-glyph-head { fill: var(--accent-ink); }
/* theme toggle */
.tb-theme { width: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tb-theme svg { width: 18px; height: 18px; }
.tb-btn + .tb-btn { margin-left: 6px; }

/* --- library rows (Studio) ----------------------------------------------------- */
.lib-head { display: flex; align-items: baseline; gap: 8px; margin: 26px 2px 10px; }
.lib-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.lib-count { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }
.lib-list { gap: 8px; }
.lib-item { padding: 8px 6px 8px 8px; border-radius: 14px; gap: 2px; transition: border-color .15s; }
.lib-item:hover { border-color: var(--line-2); }
.lib-open { gap: 14px; }
.lib-thumb { position: relative; flex: none; width: 56px; height: 48px; border-radius: 10px; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.lib-thumb canvas { width: 56px; height: 40px; display: block; }
.lib-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 88%, transparent); color: var(--accent-ink); opacity: 0; transition: opacity .15s; }
.lib-thumb-play svg { width: 22px; height: 22px; }
.lib-open:hover .lib-thumb-play, .lib-open:focus-visible .lib-thumb-play { opacity: 1; }
@media (hover: none) { .lib-thumb-play { opacity: 0; } }
.lib-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.lib-sub { margin-top: 2px; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 10px; border: none; background: none; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: #d1495b; }
.lib-empty { border-radius: 14px; }
/* groups */
.lib-groups { border-radius: 16px; }
.group-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.group-avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.group-row .row-main { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 100px; }
.role-chip { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; }
.role-chip.editor { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.group-row { background: transparent; }

/* --- player chrome (Studio) ------------------------------------------------------ */
.dock { grid-template-columns: minmax(0, 1fr); }      /* long status text can't widen the dock */
.ico { width: 18px; height: 18px; flex: none; display: block; }
.btn.tool { display: inline-flex; align-items: center; gap: 6px; }
.btn.tool .ico { width: 17px; height: 17px; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; }
.vbtn .ico { width: 18px; height: 18px; }
.dbtn { display: inline-flex; align-items: center; justify-content: center; }
.dbtn .ico { width: 20px; height: 20px; }
.play { display: inline-flex; align-items: center; justify-content: center; }
.play svg { width: 26px; height: 26px; }
.row-go, .row-play { color: var(--text); }
.row-go svg, .row-play svg { width: 18px; height: 18px; }
.loop-chip::before { content: none; }
.loop-chip .ico { width: 15px; height: 15px; }
.loop-chip button { display: inline-flex; align-items: center; justify-content: center; }
.loop-chip button .ico { width: 14px; height: 14px; }
.panel-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.card { border-radius: 16px; }
.timeline { border-radius: 16px; }
