/* ---------- header ---------- */
.bar { padding-top: max(14px, env(safe-area-inset-top)) !important; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 14px 28px; background: rgba(246,247,251,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { text-decoration: none; font-weight: 800; letter-spacing: -0.035em; font-size: 22px; display: inline-flex; }
.logo i { font-style: normal; color: var(--ink); }
.tabs { display: flex; gap: 4px; background: #eaecf4; padding: 4px; border-radius: 999px; }
.tabs a { text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--ink2); }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(20,25,60,.12); }
.bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.view { max-width: 1180px; margin: 0 auto; padding: 28px 28px 150px; }
.empty { padding: 70px 20px; text-align: center; color: var(--ink3); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
h2.page { font-size: 34px; letter-spacing: -0.035em; margin: 0 0 4px; font-weight: 800; }
.lede { color: var(--ink2); margin: 0 0 24px; }

/* ---------- type colours ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.beat { background: var(--beat2); color: #1f4fae; }
.pill.loop { background: var(--loop2); color: #17723f; }
.pill.none { background: #eceef4; color: var(--ink3); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.beat { background: var(--beatEdge); } .dot.loop { background: var(--loopEdge); }
.play { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.play svg { width: 13px; height: 13px; }
.beat .play { background: var(--beatD); } .loop .play { background: var(--loopD); }

/* ---------- packs grid ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.pcard { text-decoration: none; display: block; }
.pcard .img { aspect-ratio: 1; border-radius: 20px; background: linear-gradient(135deg, var(--beat), var(--loop)) center/cover; display: grid; place-items: center; font-size: 60px; font-weight: 800; color: rgba(23,24,28,.18); letter-spacing: -.05em; transition: transform .15s, box-shadow .15s; box-shadow: 0 6px 20px rgba(20,25,60,.08); }
.pcard:hover .img { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20,25,60,.14); }
.pcard .n { font-weight: 750; font-size: 17px; margin-top: 12px; letter-spacing: -.01em; }
.pcard .s { color: var(--ink2); font-size: 13px; margin-top: 4px; display: flex; gap: 12px; align-items: center; }
.pcard .s span { display: inline-flex; align-items: center; gap: 6px; }
.pcard.new .img { border: 2px dashed #ccd1e0; background: none; box-shadow: none; font-size: 15px; color: var(--ink2); font-weight: 650; letter-spacing: 0; }

/* ---------- pack page ---------- */
.phead { display: flex; gap: 28px; align-items: flex-end; margin-bottom: 26px; }
.cover { width: 230px; height: 230px; border-radius: 22px; object-fit: cover; flex: none; background: linear-gradient(135deg, var(--beat), var(--loop)); box-shadow: 0 12px 34px rgba(20,25,60,.14); display: grid; place-items: center; font-size: 70px; font-weight: 800; color: rgba(23,24,28,.15); }
.pmeta .label { font-size: 12px; font-weight: 750; letter-spacing: .08em;  color: var(--ink3); }
.pmeta h1 { font-size: 48px; line-height: 1.02; letter-spacing: -0.04em; margin: 6px 0 10px; font-weight: 800; }
.pmeta .sub { color: var(--ink2); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.pmeta .sub span { display: inline-flex; align-items: center; gap: 6px; }
.pmeta .note { margin-top: 10px; color: var(--ink2); font-size: 15px; white-space: pre-wrap; max-width: 520px; }
.chips { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink2); }
.chips button span { color: var(--ink3); font-weight: 500; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips button.on span { color: #b9bccb; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); position: relative; }
.row.beat { background: var(--beat); border-color: var(--beat2); }
.row.loop { background: var(--loop); border-color: var(--loop2); }
.row.playing { box-shadow: 0 6px 22px rgba(20,25,60,.12); }
.row .t { font-weight: 720; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; align-items: center; font-size: 13px; color: var(--ink2); }
.row .tags b { font-weight: 650; color: var(--ink); }
.row .actions { display: flex; gap: 6px; align-items: center; }
.row .wavebox { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; }
.row .wavebox canvas { flex: 1; }
.row .time { font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; width: 80px; text-align: right; flex: none; }
.row .btn { background: rgba(255,255,255,.75); border-color: rgba(23,24,28,.08); }

/* ---------- everything table ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=text] { width: 220px; }
.count { color: var(--ink3); font-size: 13px; margin-left: auto; }
.table { display: flex; flex-direction: column; gap: 6px; }
.tr { display: grid; grid-template-columns: 26px 36px minmax(160px, 2.4fr) 92px 74px 60px minmax(110px, 1fr) minmax(110px, 1.1fr) 52px 150px; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; font-size: 14px; background: var(--card); border: 1px solid var(--line); }
.tr.beat { background: var(--beat); border-color: var(--beat2); }
.tr.loop { background: var(--loop); border-color: var(--loop2); }
.tr.head { background: none; border: none; font-size: 11.5px; font-weight: 700; color: var(--ink3);  letter-spacing: .06em; padding-top: 0; padding-bottom: 0; }
.tr.head [data-sort] { cursor: pointer; user-select: none; }
.tr.head [data-sort]:hover, .tr.head .on { color: var(--ink); }
.tr .title { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .title small { display: block; font-weight: 500; color: var(--ink3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.tr .muted { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .muted a { text-decoration: none; } .tr .muted a:hover { text-decoration: underline; }
.tr .acts { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.tr .play { width: 30px; height: 30px; }
.tr.sel { outline: 2px solid var(--ink); outline-offset: -2px; }
.tr .blank { color: #b7bac6; }
.tr select.type { padding: 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.tr.beat select.type { background: var(--beat2); color: #1f4fae; }
.tr.loop select.type { background: var(--loop2); color: #17723f; }
.tr.none select.type { background: var(--butter); color: #8a6a00; border-color: #f0d76b; }
.iconbtn { border: none; background: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink2); text-decoration: none; }
.iconbtn:hover { background: rgba(23,24,28,.07); color: var(--ink); }
.iconbtn.ok { color: var(--loopD); }
.dl { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.8); border: 1px solid rgba(23,24,28,.08); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.dl:hover { background: #fff; }

.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 10px; align-items: center; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 14px; font-weight: 600; }
.selbar .btn { border-color: #444; background: #2b2c31; color: #fff; }

/* ---------- pack editing (logged in) ---------- */
.editbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: end; }
.editbox label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink3);  letter-spacing: .06em; margin-bottom: 5px; }
.editbox input, .editbox select, .editbox textarea { width: 100%; }
.editbox .full { grid-column: 1 / 3; }
.editbox .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox { display: flex; gap: 6px; } .linkbox input { flex: 1; min-width: 0; font-size: 12px; color: var(--ink2); }
.cover.editable { cursor: pointer; position: relative; overflow: hidden; }
.cover.editable:hover::after { content: "Change cover"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); color: #fff; font-size: 15px; font-weight: 650; }
.mover { display: flex; flex-direction: column; }
.mover .iconbtn { height: 18px; }

/* ---------- queue / player / modal ---------- */
.queue { position: fixed; right: 20px; bottom: 96px; width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 44px rgba(20,25,60,.16); z-index: 40; max-height: 56vh; overflow: auto; }
.queue .qh { padding: 12px 14px; font-weight: 750; font-size: 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.queue .qi { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f0f1f6; }
.queue .qi.beat { background: var(--beat); } .queue .qi.loop { background: var(--loop); }
.queue .qi .top { display: flex; gap: 8px; align-items: center; }
.queue .qi .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; flex: 1; }
.queue .qi .st { color: var(--ink2); margin-top: 3px; font-size: 12px; }
.queue .qi .pb { height: 4px; background: rgba(23,24,28,.08); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.queue .qi .pb i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.queue .qi.fail .st { color: var(--danger); }
.seg { display: inline-flex; background: rgba(23,24,28,.06); border-radius: 999px; padding: 2px; flex: none; }
.seg button { border: none; background: none; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 11.5px; color: var(--ink2); }
.seg button.on.beat { background: var(--beatD); color: #fff; } .seg button.on.loop { background: var(--loopD); color: #fff; }

.playerBar { padding-bottom: max(12px, env(safe-area-inset-bottom)) !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 12px 28px; display: flex; gap: 16px; align-items: center; }
.playerBar.beat { background: rgba(223,234,255,.96); } .playerBar.loop { background: rgba(219,244,229,.96); }
.playerBar .pt { width: 280px; min-width: 0; }
.playerBar .pt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playerBar .pt span { color: var(--ink2); font-size: 12px; }
.playerBar canvas { flex: 1; }
.playerBar .time { font-size: 12px; color: var(--ink2); width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.dropOverlay { position: fixed; inset: 0; z-index: 80; background: rgba(23,24,28,.45); display: grid; place-items: center; pointer-events: none; }
.dropOverlay div { background: var(--card); padding: 26px 40px; border-radius: 22px; font-weight: 750; font-size: 20px; border: 2px dashed #b9bfd3; }
.modalWrap { position: fixed; inset: 0; z-index: 85; background: rgba(20,22,35,.35); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--card); border-radius: 22px; padding: 24px; width: min(760px, 100%); max-height: 86vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.modal label { display: block; font-size: 12px; font-weight: 700; color: var(--ink3); margin-bottom: 4px; }
.modal input[type=text], .modal input[type=password] { width: 100%; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; align-items: center; }
.modal .hint { font-size: 12.5px; color: var(--ink2); background: #f3f4f9; padding: 8px 10px; border-radius: 10px; }
.pick { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.pick .tr { grid-template-columns: 26px minmax(160px, 2fr) 92px 74px 60px; cursor: pointer; }
.pick .tr.in { opacity: .4; cursor: default; }
.err { color: var(--danger); font-size: 13px; min-height: 16px; }

@media (max-width: 900px) {
  .bar { padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
  .view { padding: 18px 14px 150px; }
  .tr { grid-template-columns: 30px 1fr 64px 46px 96px; }
  .tr > .hs { display: none; }
  .phead { flex-direction: column; align-items: flex-start; gap: 18px; }
  .cover { width: min(100%, 300px); height: auto; aspect-ratio: 1; }
  .pmeta h1 { font-size: 36px; }
  .row { grid-template-columns: auto 1fr; }
  .row .actions { grid-column: 1 / 3; order: 10; }
  .row .wavebox { grid-column: 1 / 3; }
  .editbox { grid-template-columns: 1fr; } .editbox .full { grid-column: auto; }
  .playerBar { padding: 10px 14px; } .playerBar .pt { width: 140px; }
  .queue { left: 10px; right: 10px; width: auto; }
}

/* pack rows: editing controls + untyped tracks */
.row select.type { padding: 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.row.beat select.type { background: var(--beat2); color: #1f4fae; }
.row.loop select.type { background: var(--loop2); color: #17723f; }
.row.none { background: #fffaf0; border-color: #f3e3a6; }
.row.none select.type { background: var(--butter); color: #8a6a00; border-color: #f0d76b; }
/* player transport */
.transport { display: flex; align-items: center; gap: 4px; }
.transport .iconbtn { width: 34px; height: 34px; border-radius: 50%; color: var(--ink); }
.transport .iconbtn:disabled { opacity: .3; cursor: default; }
.transport .play { width: 40px; height: 40px; }
.transport .play svg { width: 14px; height: 14px; }
.queue .qi.cancelled { opacity: .55; }
.queue .qi .qx { width: 24px; height: 24px; flex: none; }

/* ================= phones ================= */
.tr .title .meta { display: none; }
@media (max-width: 700px) {
  .bar { padding: 10px 14px; gap: 10px; }
  .logo { font-size: 20px; }
  .tabs a { padding: 6px 13px; font-size: 13.5px; }
  .bar .right .btn { padding: 6px 11px; font-size: 13px; }
  .view { padding: 16px 14px 170px; }
  h2.page { font-size: 28px; }
  .lede { margin-bottom: 16px; font-size: 14px; }
  input[type=text], input[type=password], input[type=number], select, textarea { font-size: 16px; } /* stops iPhone zooming in */

  /* packs: two across */
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .pcard .img { border-radius: 16px; font-size: 44px; }
  .pcard .n { font-size: 15px; margin-top: 8px; }
  .pcard .s { flex-wrap: wrap; gap: 2px 10px; font-size: 12px; }

  /* pack page: small cover beside the name so the tracks show straight away */
  .phead { flex-direction: row; align-items: center; gap: 14px; margin-bottom: 16px; }
  .cover { width: 104px; height: 104px; border-radius: 16px; font-size: 40px; box-shadow: 0 6px 18px rgba(20,25,60,.12); aspect-ratio: auto; }
  .pmeta .label { font-size: 10.5px; }
  .pmeta h1 { font-size: 27px; margin: 3px 0 6px; }
  .pmeta .sub { font-size: 12.5px; gap: 4px 10px; }
  .pmeta .note { font-size: 14px; }
  .chips { gap: 6px; margin-bottom: 10px; }
  .chips button { padding: 6px 12px; font-size: 13.5px; }
  .rows { gap: 8px; }
  .row { grid-template-columns: auto 1fr auto; padding: 12px; gap: 4px 12px; border-radius: 14px; }
  .row .play { width: 42px; height: 42px; }
  .row .play svg { width: 14px; height: 14px; }
  .row .t { font-size: 15.5px; }
  .row .tags { font-size: 12.5px; margin-top: 3px; }
  .row .actions { grid-column: auto; order: 0; flex-direction: column; align-items: flex-end; gap: 5px; }
  .row .wavebox { grid-column: 1 / 4; }
  .row .wavebox canvas { height: 30px; }
  .row .time { width: auto; font-size: 11.5px; }
  .dl { padding: 7px 11px; font-size: 12.5px; } /* bigger tap targets */

  /* everything: name with key · BPM · month underneath */
  .toolbar { gap: 8px; }
  .toolbar input[type=text] { width: 100%; }
  .toolbar select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .count { width: 100%; margin: 0; text-align: right; }
  .tr { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 9px 10px; gap: 10px; }
  .tr > .hs, .tr > .k, .tr > .bp { display: none; }
  .tr.head { display: none; }
  .tr .play { width: 38px; height: 38px; }
  .tr .title { white-space: normal; }
  .tr .title .meta { display: block; font-weight: 500; color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
  .tr .acts { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }

  /* player: title row, then transport + waveform */
  .playerBar { flex-wrap: wrap; gap: 6px 10px; padding: 10px 14px; }
  .playerBar .pt { order: 1; width: auto; flex: 1 1 100%; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .playerBar .pt b { flex: 0 1 auto; font-size: 15px; }
  .playerBar .pt span { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .playerBar .transport { order: 2; }
  .playerBar canvas { order: 3; flex: 1 1 0; min-width: 0; height: 30px; }
  .playerBar .time { order: 4; width: auto; font-size: 11px; }
  .transport .iconbtn { width: 38px; height: 38px; }
  .toast { bottom: 140px; }
  .selbar { bottom: 140px; }
  .modal { padding: 18px; border-radius: 18px; }
}

/* spinning record */
.play.disc { background: transparent !important; padding: 0; color: #17181c; }
.beat .play.disc { color: var(--beatD); } .loop .play.disc { color: var(--loopD); }
.play.disc svg.rec { width: 100%; height: 100%; animation: spin 1.8s linear infinite; animation-play-state: paused; filter: drop-shadow(0 2px 4px rgba(20,25,60,.18)); }
.play.disc.spinning svg.rec { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .play.disc svg.rec { animation: none; } }
/* phone: keep the time inside the row */
.row .wavebox { min-width: 0; } .row .wavebox canvas { min-width: 0; }

/* logged in on a phone: edit buttons sit in a row under the track, not a tall column */
@media (max-width: 700px) {
  .admin .row .actions { grid-column: 1 / 4; order: 10; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 4px; border-top: 1px solid rgba(23,24,28,.07); padding-top: 6px; margin-top: 2px; }
  .admin .row .actions .mover { flex-direction: row; }
  .admin .row .actions .mover .iconbtn { height: 30px; }
  .admin .bar .right { margin-left: auto; }
}

/* pack page (simplified) */
.pmeta input.titleIn { font-size: 48px !important; color: var(--ink); font-family: inherit; line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; border: none !important; background: transparent !important; padding: 2px 0 !important; margin: 6px 0 8px; width: 100%; max-width: 640px; border-radius: 0 !important; border-bottom: 2px dashed transparent !important; text-transform: lowercase !important; }
.pmeta input.titleIn:hover, .pmeta input.titleIn:focus { border-bottom-color: #c9cede !important; }
.pmeta input.titleIn::placeholder { color: #c3c7d4; }
.packbtns { display: flex; gap: 8px; margin-top: 12px; }
.cover .addcover { font-size: 14px; font-weight: 650; color: var(--ink2); letter-spacing: 0; }
.addbox { border: 2px dashed #ccd1e0; background: rgba(255,255,255,.55); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--ink2); width: 100%; }
.addbox b { font-size: 16px; color: var(--ink); }
.addbox span { font-size: 13px; }
.addbox:hover { border-color: #a8aec4; background: #fff; }
@media (max-width: 700px) { .pmeta input.titleIn { font-size: 27px !important; margin: 3px 0 6px; } .packbtns { margin-top: 8px; } }

.pcard { position: relative; }
.ptrash { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: none; display: grid; place-items: center; background: rgba(255,255,255,.88); color: var(--ink2); box-shadow: 0 2px 8px rgba(20,25,60,.15); opacity: .85; }
.ptrash:hover { opacity: 1; color: var(--danger); background: #fff; }

/* ===================== cleanup: one set of controls, one rhythm ===================== */
:root { --h: 36px; }
h2.page { font-size: 30px; letter-spacing: -0.03em; margin: 4px 0 2px; }
.lede { font-size: 14px; margin-bottom: 20px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lede .dot { margin: 0 1px; }

/* dropdowns: custom pill, same height as everything else */
select { -webkit-appearance: none; appearance: none; height: var(--h); padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 550; color: var(--ink); line-height: calc(var(--h) - 2px); cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c5f6b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
select:hover { border-color: #cdd1de; }
/* little type pickers inside rows */
.tr select.type, .row select.type { height: 26px; line-height: 24px; padding: 0 24px 0 10px; font-size: 12px; font-weight: 700; background-position: right 9px center; background-size: 8px 5px; }

/* search box */
.search { display: inline-flex; align-items: center; gap: 8px; height: var(--h); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink3); width: 220px; }
.search:focus-within { border-color: #a8aec4; color: var(--ink2); }
.search input { border: none !important; padding: 0 !important; background: none !important; height: 100%; flex: 1; min-width: 0; font-size: 13.5px !important; }

/* beats / loops switch (matches the packs / everything tabs) */
.segbar { display: inline-flex; background: #eaecf4; border-radius: 999px; padding: 3px; height: var(--h); }
.segbar button { border: none; background: none; border-radius: 999px; padding: 0 13px; font-size: 13.5px; font-weight: 600; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.segbar button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(20,25,60,.12); }

.toolbar { gap: 8px; margin-bottom: 16px; }
.count { font-size: 12.5px; }
.btn { height: var(--h); padding: 0 16px; font-size: 13.5px; }
.btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; }
.tabs a { font-size: 14px; padding: 7px 18px; }
.tr { font-size: 13.5px; }
.tr.head { font-size: 11px; letter-spacing: .04em; }
.empty { padding: 56px 20px; }
.empty b { font-size: 17px; }

@media (max-width: 700px) {
  :root { --h: 40px; }
  select, .search input { font-size: 16px !important; } /* iPhone won't zoom */
  select { padding-left: 14px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar .search, .toolbar .segbar { grid-column: 1 / 3; width: 100%; }
  .segbar button { flex: 1; justify-content: center; font-size: 14px; }
  .toolbar select { width: 100%; }
  .count { grid-column: 1 / 3; text-align: right; }
  .tr select.type, .row select.type { font-size: 16px !important; height: 30px; }
  h2.page { font-size: 26px; }
}

/* legend line under page titles */
.lede { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lede .lg { display: inline-flex; align-items: center; gap: 6px; }
.lede .lg.muted { color: var(--ink3); }
.lede .lg.muted::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--ink3); margin-right: 8px; }
.needtype { border: 1px solid #f0d76b; background: var(--butter); color: #8a6a00; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 650; }
/* keep the little arrow on coloured type pickers */
.tr.beat select.type, .row.beat select.type { background-color: var(--beat2); }
.tr.loop select.type, .row.loop select.type { background-color: var(--loop2); }
.tr.none select.type, .row.none select.type { background-color: var(--butter); }
.tr select.type, .row select.type { background-position: right 9px center !important; background-size: 8px 5px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2317181c' stroke-opacity='.55' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; }
.acts .mob { display: none; }
.selbar .dot { margin-right: 2px; }
.queue .qall { padding: 8px 14px; font-size: 12.5px; color: var(--ink2); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fafbfd; }
.queue .qall .seg button { padding: 4px 10px; }
.queue .qall .seg button:hover { background: #fff; color: var(--ink); }
@media (max-width: 700px) {
  .bar { flex-wrap: nowrap; gap: 10px; }
  .tabs a { padding: 6px 12px; }
  .bar .right { flex: none; }
  #logout { padding: 0 8px; }
  .tr .title small { display: none; }
  .admin .tr { grid-template-columns: 38px minmax(0, 1fr); }
  .admin .tr .acts { grid-column: 1 / 3; justify-content: flex-start; max-width: none; border-top: 1px solid rgba(23,24,28,.07); padding-top: 6px; }
  .admin .tr .acts .mob { display: inline-flex; margin-right: auto; }
  .selbar { left: 10px; right: 10px; transform: none; flex-wrap: wrap; justify-content: center; border-radius: 18px; padding: 10px; }
}

/* ===================== compact rows + tags ===================== */
.keep, .tag { text-transform: none; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.72); box-shadow: inset 0 0 0 1px rgba(23,24,28,.06); white-space: nowrap; letter-spacing: -.005em; }
.tag.ty { text-transform: lowercase; color: var(--ink2); }
.row.beat .tag.ty { color: #1f4fae; } .row.loop .tag.ty { color: #17723f; }
.row .tags, .tr .meta { gap: 5px; }
.tr .title .meta { display: none; gap: 5px; align-items: center; flex-wrap: wrap; }
.tr .title .meta .mo { font-size: 12px; color: var(--ink3); margin-left: 2px; }

.rows { gap: 6px; }
.row { grid-template-columns: 34px minmax(160px, 300px) minmax(0, 1fr) auto; grid-template-rows: auto; gap: 0 16px; padding: 9px 12px; border-radius: 14px; min-height: 58px; }
.row .play { width: 34px; height: 34px; }
.row .info { min-width: 0; }
.row .t { font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.row .tags { margin-top: 4px; display: flex; flex-wrap: nowrap; overflow: hidden; }
.row .wavebox { grid-column: auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.row .wavebox canvas { height: 28px; }
.row .time { width: auto; min-width: 34px; font-size: 11.5px; }
.row .actions { gap: 2px; }
.row .actions .dl { margin-right: 4px; }
.row select.type { height: 22px; line-height: 20px; font-size: 11.5px; padding: 0 22px 0 8px; border-radius: 7px; }

@media (max-width: 700px) {
  .rows { gap: 6px; }
  .row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px 10px; padding: 8px 10px; min-height: 0; }
  .row .play { width: 38px; height: 38px; }
  .row .t { font-size: 14.5px; white-space: nowrap; }
  .row .tags { margin-top: 3px; }
  .row .wavebox { grid-column: 1 / 4; grid-row: 2; }
  .row .wavebox canvas { height: 20px; }
  .row .actions { grid-column: 3; grid-row: 1; flex-direction: row; align-items: center; order: 0; }
  .admin .row .actions { grid-column: 1 / 4; grid-row: 3; }
  .tag { height: 21px; font-size: 11.5px; padding: 0 7px; }
  .tr .title .meta { display: flex; margin-top: 3px; }
  .row select.type { font-size: 16px !important; height: 26px; transform: scale(.8); transform-origin: left center; margin-right: -14px; }
}

/* minimised upload panel */
.queue .qh { gap: 8px; justify-content: flex-start; }
.queue .qh > span { flex: 1; }
.queue .qmin { width: 26px; height: 26px; flex: none; margin-left: -6px; }
.queue.min { max-height: none; overflow: hidden; width: 300px; }
.queue.min .qh { border-bottom: none; }
.queue .qall-pb { height: 3px; margin: 0 14px 10px; background: rgba(23,24,28,.08); border-radius: 3px; overflow: hidden; }
.queue .qall-pb i { display: block; height: 100%; background: var(--ink); transition: width .2s; }

/* beat | loop switch */
.tswitch { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: rgba(255,255,255,.65); box-shadow: inset 0 0 0 1px rgba(23,24,28,.07); flex: none; }
.tswitch button { border: none; background: none; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; color: var(--ink3); line-height: 20px; }
.tswitch button:hover { color: var(--ink); }
.tswitch button.on { color: #fff; }
.tswitch.beat button.on { background: var(--beatD); }
.tswitch.loop button.on { background: var(--loopD); }
.tswitch.none { background: var(--butter); box-shadow: inset 0 0 0 1px #f0d76b; }
.tswitch.none button { color: #8a6a00; }
@media (max-width: 700px) { .tswitch button { height: 24px; padding: 0 10px; font-size: 12.5px; } }
