/* ================= fabu ================= */

:root {
  --bg: #191714;
  --bg2: #201d19;
  --panel: #26221d;
  --panel2: #2f2a24;
  --panel3: #3a342c;
  --line: #35302a;
  --text: #efe8dd;
  --dim: #a89c8b;
  --faint: #6f6557;
  --accent: #e07a3f;
  --accent-soft: rgba(224, 122, 63, 0.14);
  --teal: #56b6a6;
  --green: #78b56a;
  --red: #d8594f;
  --orange: #d8a13a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.42), 0 1px 2px rgba(0, 0, 0, 0.4);
  --radius: 11px;
  --track-h: 84px;
  --heads-w: 208px;
  --ruler-h: 30px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
}

#dragbar {
  height: 12px;
  -webkit-app-region: drag;
  background: var(--bg);
}

.ic { width: 17px; height: 17px; fill: currentColor; display: block; pointer-events: none; }
.ic.dim { color: var(--dim); }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.11); border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- top bar ---------- */

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 7px 14px 9px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;
}
#topbar > .tb-group { flex: 0 1 auto; min-width: 0; }
#topbar > .tb-transport { flex: 0 0 auto; }   /* the transport never shrinks */
#topbar button, #topbar input, #topbar select, #posDisplay { -webkit-app-region: no-drag; }
body.is-mac #topbar { padding-left: 82px; }
body.is-mac.is-fullscreen #topbar { padding-left: 14px; }

.tb-group { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
#topbar > .tb-group:first-child,
#topbar > .tb-group:last-child { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
#topbar > .tb-group:first-child::-webkit-scrollbar,
#topbar > .tb-group:last-child::-webkit-scrollbar { display: none; }
#projName { min-width: 56px; flex: 0 1 auto; }

#logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-right: 6px;
  padding-left: 66px; /* room for macOS traffic lights */
  cursor: pointer;
}
.logo-fab { color: var(--text); }
.logo-u { color: var(--accent); }

#projName {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--dim);
  font-size: 13px;
  padding: 5px 8px;
  width: 130px;
  outline: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#projName:hover { border-color: var(--line); }
#projName:focus { border-color: var(--accent); color: var(--text); background: var(--panel); }

.tbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 32px;
  padding: 0 7px;
  background: var(--panel);
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.tbtn.labeled { padding: 0 11px; }
.tbtn-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; }

.tbtn:hover { background: var(--panel2); color: var(--text); }
.tbtn:active { transform: translateY(1px); }
.tbtn.big { height: 36px; min-width: 40px; }
.tbtn.accent { color: var(--text); }
.tbtn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.tbtn.playing { background: var(--accent); border-color: var(--accent); color: #fff; }
.tbtn.rec.on { background: rgba(216, 89, 79, 0.16); border-color: var(--red); color: var(--red); animation: recPulse 1.4s var(--ease) infinite; }
@keyframes recPulse { 50% { opacity: 0.62; } }

.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

#posDisplay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 36px;
  padding: 0 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  cursor: default;
}
#posBars { font-size: 14px; font-weight: 700; color: var(--teal); }
#posTime { font-size: 10px; color: var(--dim); }

.tb-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tb-field label { font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: 0.5px; }
.tb-field input[type="number"] {
  width: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: ns-resize;
}
.tb-field input[type="number"]::-webkit-inner-spin-button { display: none; }
.tb-unit { font-size: 10px; font-weight: 700; color: var(--faint); margin-left: -2px; }
.vdrag-overlay { position: fixed; inset: 0; z-index: 2000; cursor: ns-resize; }
.tb-field select, select {
  background: var(--panel);
  color: var(--text);
  border: none;
  outline: none;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- workspace / timeline ---------- */

#workspace { position: relative; flex: 1; overflow: hidden; display: flex; }
body { display: flex; flex-direction: column; }

#trackArea {
  flex: 1;
  display: flex;
  overflow: hidden;
  background:
    radial-gradient(1100px 460px at 72% -12%, rgba(224, 122, 63, 0.045), transparent),
    var(--bg);
}

#headsCol {
  width: var(--heads-w);
  min-width: var(--heads-w);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg2);
  z-index: 3;
}
#headsSpacer { height: var(--ruler-h); border-bottom: 1px solid var(--line); }
#trackHeads { flex: 1; overflow: hidden; }

.thead {
  height: var(--track-h);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  transition: background 0.15s var(--ease);
}
.thead.sel { background: var(--accent-soft); }
.thead-top { display: flex; align-items: center; gap: 6px; }
.tcolor { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.tname {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  min-width: 0;
}
.tdel { background: none; border: none; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 5px; }
.tdel:hover { color: var(--red); background: rgba(216, 89, 79, 0.12); }
.tdel .ic { width: 13px; height: 13px; }

.thead-mid { display: flex; align-items: center; gap: 5px; }
/* instrument picker button + custom menu */
.tinst-btn {
  flex: 1; min-width: 0; height: 24px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px 0 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 12px; cursor: pointer; text-align: left;
  transition: border-color 0.12s var(--ease);
}
.tinst-btn:hover { border-color: var(--accent); }
.tinst-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tinst-chev { color: var(--faint); font-size: 10px; flex-shrink: 0; }
.instr-menu {
  position: fixed; z-index: 4000;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
  padding: 6px; width: max-content; max-width: 280px;
}
.instr-search {
  width: 100%; box-sizing: border-box; margin-bottom: 4px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; color: var(--text); font-size: 12px; outline: none;
}
.instr-list { max-height: 340px; overflow-y: auto; }
.instr-cat {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--faint); padding: 8px 8px 3px;
}
.instr-item {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 6px; background: none; border: none;
  color: var(--text); font-size: 12.5px; cursor: pointer; text-align: left;
}
.instr-item > span:first-child { flex: 1; }
.instr-item:hover { background: var(--panel2); }
.instr-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.instr-check { color: var(--accent); font-size: 11px; }
.instr-new { color: var(--dim); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 9px; }
.instr-new .ic { width: 13px; height: 13px; }
.tinst-edit {
  width: 22px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.tinst-edit:hover { border-color: var(--accent); color: var(--accent); }
.tinst-edit .ic { width: 13px; height: 13px; }
.tinst-del:hover { border-color: var(--red); color: var(--red); }
.thead select { font-size: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; color: var(--dim); max-width: 92px; }
.ms-btn {
  width: 20px; height: 18px;
  font-size: 9.5px; font-weight: 800;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.ms-btn.mute.on { background: var(--orange); border-color: var(--orange); color: #201500; }
.ms-btn.solo.on { background: var(--teal); border-color: var(--teal); color: #06201c; }

.thead-vol { display: flex; align-items: center; gap: 6px; }
.thead-vol input[type="range"] { flex: 1; }
.tkind { font-size: 9px; color: var(--faint); letter-spacing: 0.5px; font-weight: 700; }

input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: var(--panel3);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 0.1s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.thead-add {
  height: calc(var(--track-h) / 2);
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  box-sizing: border-box;
}
.thead-add button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1.5px dashed var(--faint);
  border-radius: 10px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.thead-add button:hover { border-color: var(--accent); border-style: solid; color: var(--accent); background: var(--accent-soft); }
.thead-add button .ic { width: 14px; height: 14px; }
#lanes { padding-bottom: 48px; }

#tlScroll {
  flex: 1;
  overflow: auto;
  position: relative;
}
#tlScroll::-webkit-scrollbar { width: 10px; height: 10px; }
#tlScroll::-webkit-scrollbar-thumb { background: var(--panel3); border-radius: 5px; border: 2px solid var(--bg); }
#tlScroll::-webkit-scrollbar-corner { background: transparent; }

#ruler {
  position: sticky;
  top: 0;
  height: var(--ruler-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  z-index: 2;
}
#lanes { position: relative; }

.lane {
  height: var(--track-h);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.lane.sel { background: rgba(224, 122, 63, 0.035); }

#playhead {
  position: absolute;
  top: calc(-1 * var(--ruler-h));
  width: 1.5px;
  background: var(--teal);
  z-index: 5;
  pointer-events: none;
}
#playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 6px solid transparent;
  border-top: 8px solid var(--teal);
}

#dropGhost {
  position: absolute;
  width: 2px;
  background: var(--green);
  z-index: 6;
  pointer-events: none;
  display: none;
}
#dropGhost.preview {
  width: auto;
  border-radius: 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.5);
  background: rgba(224, 122, 63, 0.28);
  overflow: hidden;
  opacity: 0.85;
}
#dropGhost.preview .dp-name {
  position: absolute; left: 6px; top: 4px;
  font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); pointer-events: none;
}
#dropGhost.preview canvas { display: block; position: absolute; left: 0; bottom: 0; }

#trackInsert {
  position: absolute; left: 0; height: 0; z-index: 30;
  display: none; align-items: center; gap: 7px;
  pointer-events: none;
  border-top: 3px solid var(--accent);
  box-shadow: 0 0 14px rgba(224, 122, 63, 0.6);
}
#trackInsert .ti-plus {
  margin-left: 10px; margin-top: -12px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 900; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
#trackInsert .ti-label {
  margin-top: -12px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ---------- clips ---------- */

.clip {
  position: absolute;
  top: 4px;
  height: calc(var(--track-h) - 9px);
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  background: var(--panel2);
  border: 1px solid rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.14s var(--ease), border-color 0.14s var(--ease);
}
.clip:active { cursor: grabbing; }
.clip.sel { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), 0 5px 14px rgba(0,0,0,0.4); z-index: 4; }
.marquee {
  position: absolute;
  display: none;
  z-index: 6;
  border: 1px solid var(--accent);
  background: rgba(224, 122, 63, 0.12);
  border-radius: 3px;
  pointer-events: none;
}
.clip-label {
  height: 17px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(0, 0, 0, 0.72);
  pointer-events: none;
}
.clip canvas { display: block; pointer-events: none; }
.clip-resize {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 7px;
  cursor: ew-resize;
}
.clip-resize-l {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  cursor: ew-resize;
}
.clip-badge {
  position: absolute;
  right: 4px; top: 1px;
  font-size: 9px;
  font-weight: 800;
  color: rgba(0,0,0,0.65);
  pointer-events: none;
}

/* ---------- floating windows ---------- */

.fwin {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-height: calc(100vh - 120px);
  animation: winIn 0.15s var(--ease);
  overflow: visible;   /* so edge resize handles aren't clipped */
  transition: opacity 0.12s var(--ease);
}
.fwin-head { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.fwin-body { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.fwin.dragging { opacity: 0.62; }
@keyframes winIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes winOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(4px) scale(0.985); }
}
.fwin.fwin-closing {
  animation: winOut 0.13s var(--ease) forwards;
  pointer-events: none;
}
.fwin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
  cursor: grab;
  font-weight: 700;
  font-size: 12.5px;
}
.fwin-head:active { cursor: grabbing; }
.fwin-head .ic { width: 14px; height: 14px; color: var(--accent); }
.fwin-title { flex: 1; }
.fwin-close {
  background: var(--panel3); border: 1px solid var(--line); color: var(--dim);
  cursor: pointer; padding: 4px; border-radius: 7px; display: flex;
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.fwin-close:hover { color: #fff; background: var(--red); border-color: var(--red); }
.fwin-close .ic { width: 14px; height: 14px; color: currentColor; }
.fwin-body { padding: 12px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.fwin.resizing { user-select: none; }
.fwin-rz { position: absolute; z-index: 3; }
.fwin-rz.rz-r { top: 8px; right: -3px; width: 8px; bottom: 12px; cursor: ew-resize; }
.fwin-rz.rz-b { left: 8px; bottom: -3px; height: 8px; right: 12px; cursor: ns-resize; }
.fwin-rz.rz-c { right: -2px; bottom: -2px; width: 16px; height: 16px; cursor: nwse-resize; }
.fwin-rz.rz-c::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); border-bottom-right-radius: 2px;
}

.samp-scroll { overflow: visible; }

/* rows inside windows */
.frow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.frow label { width: 78px; color: var(--dim); font-size: 11.5px; flex-shrink: 0; }
.frow input[type="range"] { flex: 1; }
.frow .val { width: 52px; text-align: right; font-variant-numeric: tabular-nums; color: var(--teal); font-size: 11.5px; flex-shrink: 0; }
.frow select { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.fbtn {
  padding: 7px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease);
}
.fbtn:hover { border-color: var(--accent); color: var(--accent); }
.fbtn.danger:hover { border-color: var(--red); color: var(--red); }

/* mixer */
#mixerStrips { display: flex; gap: 10px; }
.strip {
  width: 116px;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 9px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
}
.strip.master { border-color: var(--accent); }
.strip-name { font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.strip-eq { display: flex; flex-direction: column; gap: 7px; }
.mix-row { display: flex; align-items: center; gap: 6px; }
.mix-lbl { font-size: 9px; font-weight: 800; color: var(--faint); width: 26px; letter-spacing: 0.3px; flex-shrink: 0; }
.mix-row input[type="range"] { flex: 1; min-width: 0; }
.auto-dot {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  font-size: 9px; font-weight: 800;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease), background 0.12s var(--ease);
}
.auto-dot:hover { border-color: var(--accent); color: var(--accent); }
.auto-dot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.auto-fx-label { font-size: 12.5px; font-weight: 700; color: var(--accent); padding: 2px 4px; }

.insp-num {
  flex: 1; min-width: 0; width: auto;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 7px;
  color: var(--accent); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums;
  padding: 5px 8px; outline: none; text-align: right;
}
.insp-num:focus { border-color: var(--accent); }
.insp-unit { flex: 0 0 auto; font-size: 11px; color: var(--faint); min-width: 30px; }

/* tidy, aligned clip-settings panel */
.insp-body .frow { gap: 8px; margin-bottom: 6px; min-height: 26px; }
.insp-body .frow > label { width: 74px; color: var(--dim); font-size: 11.5px; font-weight: 500; }
.insp-body .frow > input[type="text"] { flex: 1; }
.insp-body .insp-num { max-width: 96px; }
.insp-body .auto-dot { margin-left: -2px; }
.insp-body .insp-info { color: var(--faint); font-size: 11px; margin: 12px 0 8px; padding-top: 9px; border-top: 1px solid var(--line); }
.strip-div { height: 1px; background: var(--line); margin: 3px 0; }
.strip-db { font-size: 9px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; margin-top: -2px; }
.strip-ms { display: flex; gap: 4px; justify-content: center; margin-top: 2px; }

/* help table */
.kbd-table { width: 100%; border-collapse: collapse; }
.kbd-table td { padding: 4px 8px; font-size: 12px; border-bottom: 1px solid var(--line); }
.kbd-table td:first-child { width: 150px; }
kbd {
  display: inline-block;
  background: var(--panel3);
  border: 1px solid var(--faint);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  margin-right: 3px;
}

/* ---------- piano roll ---------- */

.proll-body { display: flex; flex-direction: column; padding: 0 !important; }
.proll-tools {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--dim);
  flex-wrap: wrap;
}
.proll-tools .pt-track { font-weight: 700; }
.proll-tools .pt-spacer { flex: 1; }
.pt-group {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2);
}
.pt-group > label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; color: var(--faint); }
.pt-group select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 4px; font-size: 11px;
}
.pt-toggle, .pt-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.pt-toggle:hover, .pt-btn:hover { color: var(--text); border-color: var(--faint); }
.pt-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pt-btn { color: var(--text); }
.pt-btn:active { transform: translateY(1px); }
.pt-quant { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--panel); }
.pt-qlabel { display: flex; align-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--faint); padding: 0 8px; background: var(--bg2); }
.pt-seg { border: none; border-left: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 11px; font-weight: 600; padding: 4px 9px; cursor: pointer; transition: background 0.12s var(--ease), color 0.12s var(--ease); }
.pt-seg:hover { background: var(--panel2); color: var(--text); }
.pt-seg:active { background: var(--accent-soft); color: var(--accent); }
.pt-vel-label {
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--faint);
  border-top: 1px solid var(--line); background: var(--bg2);
}
.proll-vel { display: block; cursor: ns-resize; border-top: 1px solid var(--line); }
.proll-ruler { display: block; border-bottom: 1px solid var(--line); cursor: pointer; }
.pt-ruler-spacer { background: #1b1e2b; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.proll-playhead {
  position: absolute; top: 0; width: 2px; margin-left: -1px;
  background: var(--accent); pointer-events: none; z-index: 5;
  box-shadow: 0 0 6px rgba(224, 122, 63, 0.55);
}
.proll-canvas-wrap { position: relative; }
.proll-canvas-wrap canvas { display: block; cursor: crosshair; }

/* ---------- keys panel ---------- */

#keysPanel {
  position: absolute;
  left: 50%;
  bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  gap: 18px;
  align-items: center;
  z-index: 30;
  transform: translateX(-50%);
  animation: keysIn 0.18s var(--ease);
}
@keyframes keysIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#keysInfo { display: flex; flex-direction: column; gap: 7px; min-width: 190px; }
.keys-row { display: flex; align-items: center; gap: 8px; }
.keys-close {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  background: transparent; color: var(--faint);
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.keys-close:hover { background: var(--panel2); color: var(--text); }
.keys-close .ic { width: 13px; height: 13px; }
.ki-label { font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: 0.5px; width: 74px; }
.keys-row select { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.mini-btn {
  width: 24px; height: 24px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
#octLabel { font-weight: 800; color: var(--teal); width: 16px; text-align: center; }
.keys-hint { font-size: 10px; color: var(--faint); max-width: 200px; line-height: 1.4; }

.rec-notes-btn {
  width: 100%;
  padding: 6px 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease), background 0.12s var(--ease);
}
.rec-notes-btn:hover { border-color: var(--red); color: var(--red); }
.rec-notes-btn.on { background: rgba(216, 89, 79, 0.16); border-color: var(--red); color: var(--red); animation: recPulse 1.4s var(--ease) infinite; }

#pianoKeys { display: flex; position: relative; height: 110px; }
.pkey {
  width: 34px;
  height: 110px;
  background: linear-gradient(#f2eee6, #dcd6c9);
  border: 1px solid #14110c;
  border-radius: 0 0 6px 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.06s var(--ease);
}
.pkey.down { background: linear-gradient(#f3b98a, #e07a3f); }
.pkey .klabel {
  position: absolute;
  bottom: 6px; left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #4a4235;
}
.pkey-black {
  position: absolute;
  width: 22px;
  height: 66px;
  background: linear-gradient(#2c2721, #16130f);
  border: 1px solid #000;
  border-radius: 0 0 5px 5px;
  z-index: 2;
  cursor: pointer;
  top: 0;
}
.pkey-black.down { background: linear-gradient(#e07a3f, #b85e2a); }
.pkey-black .klabel {
  position: absolute;
  bottom: 5px; left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #b6ab99;
}

/* ---------- count-in overlay ---------- */

#countOverlay {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px 10px;
  background: rgba(20, 17, 13, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 100;
  cursor: pointer;
}
#countNum {
  font-size: 46px;
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  animation: countPop 0.42s var(--ease);
}
.count-cancel { font-size: 10px; color: var(--faint); letter-spacing: 0.3px; }
#countNum.go { color: var(--accent); }
@keyframes countPop {
  from { transform: scale(1.18); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- toasts ---------- */

#toasts {
  position: fixed;
  right: 14px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.38);
  animation: toastIn 0.18s var(--ease);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.out { opacity: 0; transform: translateX(10px); }
.toast.red { border-left-color: var(--red); }
.toast.green { border-left-color: var(--green); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- tooltip ---------- */

#tooltip {
  position: fixed;
  max-width: 240px;
  background: #100e0b;
  border: 1px solid var(--panel3);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 300;
  pointer-events: none;
  animation: tipIn 0.11s var(--ease);
}
@keyframes tipIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- homescreen ---------- */

#home {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(224, 122, 63, 0.10), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(216, 161, 58, 0.06), transparent 60%),
    var(--bg);
  animation: homeIn 0.24s var(--ease);
}
#home::before, #home::after { content: ''; position: absolute; pointer-events: none; z-index: 0; }
#home::before {
  width: 78vw; height: 78vw; max-width: 1000px; max-height: 1000px;
  top: -40vh; right: -18vw;
  border-radius: 50%;
  filter: blur(90px);
  background: radial-gradient(circle, rgba(224, 122, 63, 0.42), rgba(224, 122, 63, 0.10) 46%, transparent 70%);
  animation: bloomBreathe 18s ease-in-out infinite alternate;
}
#home::after {
  width: 120vw; height: 120vw; max-width: 1500px; max-height: 1500px;
  opacity: 0.55;
  top: -66vh; right: -30vw;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      transparent 0 62px, rgba(240, 158, 100, 0.055) 62px 63px);
  mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 76%);
}
@keyframes bloomBreathe {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(1.1); opacity: 1; }
}
.home-inner, #homeLangs, #homeKofi, #homeVerWrap { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  #home::before, #home::after { animation: none; }
}
#home.closing { animation: homeOut 0.22s var(--ease) forwards; }
@keyframes homeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes homeOut { from { opacity: 1; } to { opacity: 0; transform: scale(1.01); } }

.home-inner {
  flex: 1;
  min-width: 0;
  padding: 46px 52px 26px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  overflow-y: auto;
}
.home-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.home-greet { font-size: 46px; font-weight: 700; letter-spacing: -1.4px; line-height: 1.05; margin: 0; }
.home-greet-sub { font-size: 15px; color: var(--dim); margin: 10px 0 30px; }
.home-brand { display: flex; flex-direction: column; gap: 3px; }
.home-logo {
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  display: inline-block;
  cursor: default;
}
.home-logo:hover { animation: logoJump 0.5s var(--ease); }
@keyframes logoJump {
  0% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-16px) rotate(-3deg); }
  55% { transform: translateY(0) rotate(0); }
  72% { transform: translateY(-7px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0); }
}
.home-tag { font-size: 14px; color: var(--dim); font-weight: 500; margin-left: 3px; }

.home-actions { display: flex; gap: 20px; align-self: stretch; }
.home-go {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 26px 24px 24px;
  height: 250px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.004) 55%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease),
              box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.home-go:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 122, 63, 0.55);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01) 55%),
    var(--panel2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 10px 26px rgba(0, 0, 0, 0.42);
}
.home-go:active { transform: translateY(-1px); }
.home-go.hidden { display: none; }
.hc-ic { width: 34px; height: 34px; color: var(--accent); margin-bottom: auto; }
.hc-title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.hc-sub {
  font-size: 13.5px; color: var(--dim); margin-top: 7px; line-height: 1.4;
  min-height: 2.8em; max-width: 15ch;
}

.hc-art {
  position: absolute; left: 0; right: 0; bottom: 0; height: 62px;
  color: var(--accent); opacity: 0.14; pointer-events: none;
}
.hc-art-mp { color: #b07bd6; opacity: 0.3; }

.home-go.primary {
  background:
    linear-gradient(158deg, #ef8f57 0%, #e07a3f 34%, #c8632e 72%, #ae5325 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 6px 20px rgba(176, 79, 32, 0.3);
  color: #fff;
}
.home-go.primary .hc-ic { color: #fff; }
.home-go.primary .hc-sub { color: rgba(255, 255, 255, 0.85); }
.home-go.primary .hc-art { color: #fff; opacity: 0.26; }
.home-go.primary:hover {
  background: linear-gradient(158deg, #f79a61 0%, #e9854a 34%, #d16d36 72%, #b85c2b 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 12px 30px rgba(176, 79, 32, 0.42);
}

.home-example {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 12.5px; font-weight: 600;
  transition: color 0.14s var(--ease);
}
.home-example:hover { color: var(--accent); }
.home-example .ic { width: 15px; height: 15px; }

.home-recent-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.home-recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.home-empty {
  color: var(--faint);
  font-size: 13px;
  padding: 8px 0;
}
.home-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.004) 60%),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.13s var(--ease), background 0.13s var(--ease);
  opacity: 0;
  animation: cardIn 0.32s var(--ease) forwards;
  animation-delay: calc(var(--i) * 0.035s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-card:hover {
  border-color: rgba(224, 122, 63, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.008) 60%),
    var(--panel2);
}
.home-card-art {
  width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, hsl(var(--h) 42% 26%), hsl(var(--h) 38% 17%));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease);
}
.home-card-art .ic { width: 22px; height: 22px; color: rgba(255,255,255,0.9); }
.home-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.home-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-card-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

#homeLangs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lang-flag {
  width: 42px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  opacity: 0.65;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--dim);
  transition: opacity 0.14s var(--ease), transform 0.12s var(--ease), border-color 0.14s var(--ease);
}
.lang-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lang-flag:hover { opacity: 1; transform: translateY(-2px); }
.lang-flag.active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- update banner ---------- */

#updateBanner {
  position: fixed;
  top: 54px;
  right: 18px;
  z-index: 1900;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
  padding: 14px 14px 14px 18px;
  background: linear-gradient(180deg, rgba(224, 122, 63, 0.18), var(--panel) 70%);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  animation: updIn 0.3s var(--ease), updPulse 2.6s var(--ease) 0.4s infinite;
}
@keyframes updIn { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes updPulse {
  0%, 100% { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(224, 122, 63, 0.10); }
  50% { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(224, 122, 63, 0.20); }
}
.upd-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: updDot 1.7s var(--ease) infinite; }
@keyframes updDot {
  0% { box-shadow: 0 0 0 0 rgba(224, 122, 63, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(224, 122, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 122, 63, 0); }
}
.upd-text { flex: 1; min-width: 0; }
.upd-title { font-size: 13px; font-weight: 800; color: var(--text); }
.upd-note { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
#updateBanner .fbtn { padding: 8px 15px; flex-shrink: 0; font-weight: 700; }
.upd-x {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: none; border: none; border-radius: 6px;
  color: var(--faint); cursor: pointer;
}
.upd-x:hover { color: var(--text); background: var(--panel3); }
.upd-x .ic { width: 13px; height: 13px; }

/* ---------- context menu ---------- */

.ctx-menu {
  position: fixed;
  z-index: 2500;
  min-width: 170px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 5px;
  animation: tipIn 0.1s var(--ease);
}
.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}
.ctx-item:hover { background: var(--panel2); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: rgba(216, 89, 79, 0.12); }

/* ---------- modals ---------- */

.modal-back {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 9, 7, 0.62);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: homeIn 0.16s var(--ease);
}
.modal-card {
  width: 330px; max-width: calc(100vw - 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: winIn 0.16s var(--ease);
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-sub { font-size: 12px; color: var(--dim); margin: 4px 0 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-card input[type="text"], .modal-card input[type="password"] {
  width: 100%;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 8px 10px; outline: none; margin-bottom: 8px; font-size: 13px;
}
.modal-card input:focus { border-color: var(--accent); }
.fbtn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.fbtn.accent:hover { background: #eb8b52; color: #fff; }
.fbtn[disabled] { opacity: 0.4; cursor: default; }

/* ---- export dialog ---- */
.export-card { width: min(430px, calc(100vw - 32px)); }
.export-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.export-meta { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.export-section {
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--dim); margin: 15px 0 7px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.export-formats { display: flex; gap: 8px; }
.exp-fmt {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 11px 10px; text-align: left; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); transition: border-color .12s, background .12s, transform .12s;
}
.exp-fmt:hover:not(:disabled) { border-color: var(--accent); background: var(--panel3); transform: translateY(-1px); }
.exp-fmt:disabled { opacity: .4; cursor: default; }
.exp-fmt-name { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.exp-fmt-desc { font-size: 10.5px; color: var(--dim); line-height: 1.25; }
.exp-fmt-size { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 1px; }
.exp-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 10px 12px; margin-top: 7px; text-align: left; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); transition: border-color .12s, background .12s;
}
.exp-row:hover:not(:disabled) { border-color: var(--accent); background: var(--panel3); }
.exp-row:disabled { opacity: .4; cursor: default; }
.exp-row-name { font-size: 12.5px; font-weight: 700; }
.exp-row-desc { font-size: 10.5px; color: var(--dim); line-height: 1.3; }
.export-prog { height: 8px; background: var(--panel3); border-radius: 4px; overflow: hidden; margin-top: 14px; }
#exportBar { height: 100%; width: 0; background: var(--accent); transition: width 0.15s var(--ease); }
.export-stat { font-size: 11px; color: var(--dim); margin-top: 8px; min-height: 14px; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tab { flex: 1; padding: 7px; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; color: var(--dim); cursor: pointer; font-weight: 600; }
.auth-tab.on { border-color: var(--accent); color: var(--accent); }
.auth-err { color: var(--red); font-size: 11.5px; min-height: 14px; margin-bottom: 4px; }

/* ---------- account management ---------- */
.acct-section {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.acct-head { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.acct-note { font-size: 11px; color: var(--dim); line-height: 1.5; margin-bottom: 8px; }
.acct-danger .acct-head { color: var(--red); }
.acct-danger .acct-note { color: var(--faint); }

/* ---------- jam ---------- */

#jamPanel {
  position: absolute;
  right: 14px;
  bottom: 40px;
  width: 260px;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  animation: winIn 0.15s var(--ease);
}
.jam-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12.5px; margin-bottom: 8px; }
.jam-head .ic { width: 15px; height: 15px; color: var(--accent); }
.jam-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.jam-status { font-size: 11px; color: var(--dim); min-width: 56px; text-align: right; }
.jam-hint { font-size: 10.5px; color: var(--faint); line-height: 1.5; margin-bottom: 10px; }
.jam-row { display: flex; gap: 8px; }
.jam-row input {
  flex: 1; min-width: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 6px 8px;
  outline: none;
  font-size: 12px;
}
.jam-row input:focus { border-color: var(--accent); }
.jam-row .fbtn { flex-shrink: 0; }
#btnJam.rec-on { border-color: var(--green); color: var(--green); }

.jam-code {
  width: 100%;
  margin-bottom: 10px;
  padding: 9px;
  background: var(--panel2);
  border: 1px dashed var(--faint);
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s var(--ease);
}
.jam-code:hover { border-color: var(--accent); color: var(--accent); }
.jam-code.revealed {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 5px;
}

#jamPlayers { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; max-height: 220px; overflow-y: auto; }
.jam-player { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; }
.jam-player:hover { background: var(--panel2); }
.jam-pdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.jam-pname { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jam-pname i { color: var(--faint); font-style: normal; font-size: 11px; }
.jam-crown { color: var(--orange); font-size: 13px; }
.jam-kick {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 5px;
  color: var(--faint); cursor: pointer;
}
.jam-kick:hover { color: var(--red); background: rgba(216, 89, 79, 0.12); }
.jam-kick .ic { width: 12px; height: 12px; }

.jam-req { width: 100%; margin-bottom: 8px; position: relative; }
.req-badge {
  display: inline-block;
  min-width: 17px; height: 17px;
  margin-left: 8px;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  animation: recPulse 1.4s var(--ease) infinite;
}
.req-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.req-row .fbtn { padding: 4px 10px; font-size: 11px; }
.req-empty { color: var(--faint); font-size: 12px; padding: 10px 4px; }

.jam-set { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.jam-set-sep { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.jam-check { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--dim); cursor: pointer; }
.jam-check-sub { margin-left: 21px; }
.jam-check input:disabled { opacity: 0.4; }
.jam-check:has(input:disabled) { opacity: 0.5; cursor: default; }

/* custom-audio review player (host) */
.ar-card { width: 560px; max-width: 92vw; }
.ar-name { font-size: 13px; font-weight: 700; color: var(--accent); margin: -4px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-player { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.ar-wave { display: block; width: 100%; height: 72px; border-radius: 6px; background: var(--bg2); }
.ar-scrub { position: relative; height: 6px; margin: 8px 0 4px; border-radius: 3px; background: var(--panel3); cursor: pointer; }
.ar-scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 3px; }
.ar-scrub-head { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.ar-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ar-play { width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ar-play.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ar-time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ar-vol-lbl { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.ar-vol { width: 90px; accent-color: var(--accent); }
.ar-more { margin-top: 10px; font-size: 11.5px; color: var(--faint); text-align: center; }
.ar-ban-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 12.5px; color: var(--dim); }
.ar-ban-num { width: 64px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 4px 6px; outline: none; }
.ar-ban-unit { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 4px 6px; outline: none; }

/* room code row + cycle */
.jam-code-row { display: flex; gap: 6px; align-items: stretch; }
.jam-code-row .jam-code { flex: 1; }
.jam-cycle { flex: 0 0 auto; width: 34px; display: flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--dim); cursor: pointer; }
.jam-cycle:hover { color: var(--accent); border-color: var(--accent); }
.jam-manage { width: 100%; margin-top: 4px; }
.jam-player.mp-selected { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 7px; background: var(--accent-soft); }

/* manage people */
.mg-card { width: 460px; max-width: 92vw; }
.mg-head { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.mg-h-name { flex: 1; }
.mg-h-col { width: 44px; text-align: center; }
.mg-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.mg-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 7px; }
.mg-row:hover { background: var(--panel2); }
.mg-name { flex: 1; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mg-away { color: var(--faint); font-size: 11px; }
.mg-badge { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: rgba(224,90,63,0.16); color: #e8836b; white-space: nowrap; }
.mg-tog { width: 44px; display: flex; justify-content: center; }
.mg-tog input { width: 15px; height: 15px; accent-color: var(--accent); }
.mg-unban { padding: 3px 10px; font-size: 11.5px; }
.jam-check input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }
.jam-check input[type="number"] {
  width: 52px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 2px 6px; outline: none;
}

#jamPill {
  position: fixed;
  right: 14px;
  bottom: 34px;
  z-index: 45;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
#jamPill:hover { border-color: var(--green); }

/* live cursors */
#cursorLayer { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.mp-cursor { position: absolute; transform: translate(-2px, -2px); transition: left 0.11s linear, top 0.11s linear; }

#remotePhLayer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.mp-playhead {
  position: absolute; top: 0; width: 2px;
  background: var(--pc, var(--accent));
  opacity: 0.55;
  transition: left 0.11s linear;
}
.mp-ph-flag {
  position: absolute; top: 2px; left: 2px;
  padding: 1px 5px; border-radius: 4px;
  background: var(--pc, var(--accent)); color: #fff;
  font-size: 9px; font-weight: 700; white-space: nowrap;
  opacity: 0.9;
}
.mp-cursor-dot { width: 10px; height: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-90deg); border: 1.5px solid rgba(0,0,0,0.35); }
.mp-cursor-name {
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* locked controls */
input[type="range"].locked { opacity: 0.45; filter: saturate(0.4); }
.clip.mp-locked { cursor: not-allowed; }

 }

/* multiplayer create: project picker */
.mp-projects { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.mp-proj { text-align: left; }
.mp-proj.on { border-color: var(--accent); color: var(--accent); }

/* ---------- snap coach ---------- */

#snapCoach {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  pointer-events: none;
}
#snapCoach.show { animation: coachIn 0.28s var(--ease); }
#snapCoach.hide { animation: coachOut 0.3s var(--ease) forwards; }
@keyframes coachIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes coachOut { to { opacity: 0; transform: translate(-50%, -10px); } }
.coach-card {
  position: relative;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 14px 22px 16px;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: coachBob 1.6s var(--ease) infinite;
}
@keyframes coachBob { 50% { transform: translateY(-4px); } }
.coach-title { font-size: 15px; font-weight: 800; }
.coach-sub { font-size: 13px; font-weight: 600; opacity: 0.92; margin-top: 2px; }
.coach-arrow {
  position: absolute;
  top: -11px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 11px solid var(--accent);
  filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.4));
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---- support link on the homescreen ---- */
#homeKofi {
  position: absolute;
  right: 18px;
  bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.12s var(--ease);
}
#homeKofi:hover { opacity: 1; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
#homeKofi .kofi-cup { font-size: 13px; }

#homeVerWrap {
  position: absolute;
  left: 18px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}
#homeVer { font-size: 11px; color: var(--faint); opacity: 0.6; }
.home-check-upd {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.home-check-upd:hover { border-color: var(--accent); color: var(--accent); }

/* ---- web-only mobile nudge ---- */
#webNudge {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  color: var(--text);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.26s var(--ease), opacity 0.26s var(--ease);
}
#webNudge.in { transform: translateY(0); opacity: 1; }
#webNudge .wn-txt { flex: 1; line-height: 1.35; color: var(--dim); }
#webNudge .wn-get {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
#webNudge .wn-x {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 7px;
}
#webNudge .wn-x:hover { background: var(--panel); color: var(--text); }

/* ---- phones / narrow screens ---- */
@media (max-width: 760px) {
  #logo { padding-left: 8px; }               /* no macOS traffic lights in the browser */
  #topbar { padding: 6px 10px 8px; gap: 8px; }
  #projName { width: 108px; }

}

/* ---- effects browser + per-clip effects ---- */
.fx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 12.5px; font-weight: 600;
  cursor: grab; user-select: none;
  transition: border-color 0.12s var(--ease), transform 0.12s var(--ease);
}
.fx-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.fx-item:active { cursor: grabbing; }
.fx-item .ic { width: 14px; height: 14px; color: var(--accent); }
.clip.fx-over { outline: 2px dashed var(--accent); outline-offset: 1px; }
/* ---- a pattern carrying effects ---- */
.clip.has-fx {
  box-shadow: inset 0 0 0 1.5px rgba(255, 211, 94, .7);
}

@keyframes fxLanded {
  0%   { opacity: 0;   background-position: 130% 0; }
  12%  { opacity: 1; }
  100% { opacity: 0;   background-position: -130% 0; }
}
.clip.fx-landed::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 32%, rgba(255, 211, 94, .38) 47%, rgba(255,255,255,.5) 50%,
    rgba(255, 211, 94, .38) 53%, transparent 68%);
  background-size: 260% 100%;
  animation: fxLanded 0.62s cubic-bezier(.3,.7,.4,1) 1 both;
}
@media (prefers-reduced-motion: reduce) { .clip.fx-landed::after { display: none; } }

.clip-fx-badge {
  position: absolute; left: 4px; bottom: 4px;
  display: flex; align-items: center; gap: 4px;
  max-width: calc(100% - 12px);
  padding: 2px 7px 2px 5px; border-radius: 999px;
  background: rgba(12, 10, 8, 0.72);
  border: 1px solid rgba(255, 211, 94, .45);
  color: #ffd35e;
  font-size: 9px; font-weight: 800; letter-spacing: 0.2px;
  pointer-events: auto;
  backdrop-filter: blur(3px);
}
.clip-fx-badge .fx-names {
  overflow: hidden; white-space: nowrap;
  max-width: 0; opacity: 0; margin-left: -4px;
  transition: max-width .32s ease, opacity .25s ease, margin-left .32s ease;
}
.clip-fx-badge.fresh .fx-names { max-width: 130px; opacity: 1; margin-left: 0; }
.fx-spark {
  flex: 0 0 auto; width: 9px; height: 9px;
  background: currentColor;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}
.clip.group { border-style: dashed; }
.clip-group-badge {
  position: absolute; right: 3px; bottom: 3px;
  padding: 0 5px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.5); color: #dfe6f5;
  font-size: 9px; font-weight: 800;
  pointer-events: none;
}
.ctx-item.fx { color: #ffd35e; }
.fx-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fx-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.fx-sec-head .fbtn { padding: 3px 10px; font-size: 11px; }

/* ---- visual EQ in the mixer ---- */
.eq-canvas { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg2); cursor: ns-resize; }
.eq-canvas canvas { display: block; }
.eq-dots { display: flex; align-items: center; justify-content: space-around; gap: 6px; margin-top: 5px; width: 300px; max-width: 100%; font-size: 9px; color: var(--faint); font-weight: 700; }

/* ---- recent-project cards ---- */
.home-card-art { position: relative; }
.card-acts {
  position: absolute; inset: 0;
  display: flex; opacity: 0;
  transition: opacity 0.15s var(--ease);
  border-radius: 10px; overflow: hidden;
}
.home-card:hover .card-acts { opacity: 1; }
.card-act {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45); color: #fff;
}
.card-act + .card-act { border-left: 1px solid rgba(255, 255, 255, 0.25); }
.card-act:hover { background: rgba(0, 0, 0, 0.62); color: var(--accent); }
.card-act .ic { width: 20px; height: 20px; }

/* ---- global cursors ---- */
#cursorLayerWin { position: fixed; inset: 0; pointer-events: none; z-index: 950; }
.mp-cursor.mp-cursor-win { transition: left 0.09s linear, top 0.09s linear; }
.jam-player.clickable { cursor: pointer; border-radius: 7px; }
.jam-player.clickable:hover { background: var(--panel2); }
.jam-player.following { background: var(--accent-soft); }
.jam-eye { display: inline-flex; margin-left: auto; color: var(--accent); }
.jam-eye .ic { width: 13px; height: 13px; }
#followBar {
  position: fixed; top: 46px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center;
  z-index: 1900; pointer-events: auto;
  font-size: 12px; font-weight: 600;
}
#followBar .fb-following {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 12px; border-radius: 999px;
  background: var(--fc, var(--accent)); color: #fff;
  box-shadow: var(--shadow);
}
#followBar .fb-stop { background: rgba(0,0,0,0.25); color: #fff; border: none; border-radius: 999px; width: 18px; height: 18px; cursor: pointer; font-size: 11px; }
#followBar .fb-followers {
  padding: 5px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
  box-shadow: var(--shadow);
}

/* ---- home "now playing" bar ---- */
#homePlayer {
  position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; z-index: 2;
  padding: 8px 8px 8px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
#homePlayer .hp-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#homePlayer .hp-btn .ic { width: 14px; height: 14px; }
#homePlayer .hp-name { font-size: 13px; color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#homePlayer .hp-edit { background: transparent; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); padding: 5px 12px; font-size: 12px; cursor: pointer; }
#homePlayer .hp-edit:hover { border-color: var(--accent); color: var(--accent); }

/* ---- empty-project hint ---- */
.empty-hint {
  position: absolute; left: 24px;
  padding: 10px 16px; border-radius: 12px;
  border: 1.5px dashed var(--faint); color: var(--dim);
  font-size: 13px; font-weight: 600; pointer-events: none;
  animation: emptyPulse 2.4s var(--ease) infinite;
}
@keyframes emptyPulse { 50% { opacity: 0.5; } }

/* ---- samples / loops browser ---- */
.samp-cat { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--faint); margin: 10px 0 5px; }
.samp-item { justify-content: flex-start; gap: 8px; }
.samp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.samp-item .samp-nm {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.samp-meta {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
  overflow: hidden; white-space: nowrap;
}
.samp-item .samp-inst {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  font-size: 10px; color: var(--faint); font-weight: 600;
}
.samp-play {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel3);
  color: var(--accent); cursor: pointer;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
}
.samp-play:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.samp-play .ic { width: 12px; height: 12px; color: currentColor; }

/* ---- mixer ---- */
#mixEq { margin-bottom: 12px; }
.mixeq-head { font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.mixeq-head b { font-weight: 700; }
.mixeq-empty {
  padding: 22px 14px; text-align: center; color: var(--faint); font-size: 12.5px;
  border: 1.5px dashed var(--line); border-radius: 10px; background: var(--bg2);
}
.eq-canvas.big { width: 300px; }
.strip-name { cursor: pointer; border-radius: 6px; }
.strip.sel .strip-name { background: var(--accent-soft); }
.eq-dots span { min-width: 30px; text-align: center; }

/* ---- first-project tutorial ---- */
#tutorCard {
  position: fixed; z-index: 960; max-width: 260px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5); padding: 14px 16px;
  animation: winIn 0.18s var(--ease);
}
#tutorCard .tc-title { font-weight: 800; font-size: 13.5px; margin-bottom: 5px; }
#tutorCard .tc-body { font-size: 12.5px; color: var(--dim); line-height: 1.5; }
#tutorCard .tc-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 8px; }
#tutorCard .tc-step { font-size: 11px; color: var(--faint); }
#tutorCard .tc-btns { display: flex; gap: 6px; }
#tutorCard .tc-skip { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 12px; }
#tutorCard .tc-skip:hover { color: var(--dim); }
#tutorCard .tc-next { background: var(--accent); border: none; color: #fff; border-radius: 8px; padding: 6px 14px; font-weight: 700; font-size: 12px; cursor: pointer; }
#tutorHighlight {
  position: fixed; z-index: 955; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.45);
  transition: all 0.25s var(--ease);
}

/* change history (host) */
.hist-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; font-size: 12px; }
.hist-row:hover { background: var(--panel2); }
.hist-time { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; flex-shrink: 0; width: 34px; }
.hist-text { flex: 1; min-width: 0; color: var(--dim); }

/* ---- mixer ---- */
#mixFocus { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 7px; }
.mixf-row { display: flex; align-items: center; gap: 8px; }
.mixf-lbl { width: 46px; flex-shrink: 0; font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--faint); }
.mixf-row input[type="range"] { flex: 1; min-width: 0; }
.mixf-val { width: 54px; flex-shrink: 0; text-align: right; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mixf-row.master { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
#mixPicker { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.mixchip { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; }
.mixchip:hover { background: var(--panel2); }
.mixchip.on { background: var(--accent-soft); border-color: var(--accent); }
.mixchip-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.mixchip-name { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-inline {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; margin-left: 2px;
}
.auth-inline:hover { filter: brightness(1.08); }

#restartBar {
  position: fixed; right: 16px; bottom: 16px; z-index: 5000;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 12.5px; color: var(--text); max-width: 420px;
}
#restartBar .rb-text { flex: 1; }
#restartBar .rb-x { background: none; border: none; color: var(--faint); font-size: 17px; cursor: pointer; line-height: 1; }
#restartBar .rb-x:hover { color: var(--text); }
/* quick section-name presets */
.ask-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ask-preset { padding: 4px 10px; font-size: 11.5px; }

/* ---------- top bar ---------- */
@media (max-width: 1500px) {
  #topbar .tbtn-label { display: none; }
  #topbar .tbtn.labeled { padding: 0 7px; }
}
@media (max-width: 1240px) { #topbar #posTime { display: none; } }
@media (max-width: 1180px) { #topbar .tb-zoom, #topbar .tb-zoom-sep { display: none; } }
@media (max-width: 1150px) { #topbar #posDisplay { display: none; } }
@media (max-width: 1100px) {
  #topbar { gap: 10px; padding-left: 10px; padding-right: 10px; }
  #topbar .tb-group { gap: 4px; }
  #topbar .tbtn { padding: 0 5px; min-width: 28px; }
  #topbar .tb-sep { display: none; }
  #projName { width: 92px; }
}
@media (max-width: 1040px) { #topbar #logo { display: none; } }

/* track colour picker */
.tcolor { cursor: pointer; }
.tcolor:hover { outline: 2px solid var(--line); outline-offset: 1px; }
.color-menu { position: fixed; z-index: 4000; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; box-shadow: 0 12px 34px rgba(0,0,0,.5); }
.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.color-sw { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.color-sw:hover { border-color: rgba(255,255,255,0.4); }
.color-sw.on { border-color: #fff; }
.color-custom { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }
.color-custom input { width: 34px; height: 24px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel2); cursor: pointer; }

/* load-test panel (dev) */
#ltPanel { position: fixed; left: 16px; bottom: 16px; z-index: 5000; width: 226px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 12px; color: var(--text); }
.lt-head { font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.lt-warn { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--red); }
.lt-stats { line-height: 1.6; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.lt-dim { color: var(--faint); font-size: 11px; }
.lt-row { display: flex; gap: 5px; margin-top: 5px; }
.lt-row .fbtn { flex: 1; padding: 4px 0; font-size: 11.5px; }

#mpBanner {
  position: fixed; top: 54px; left: 50%; transform: translateX(-50%);
  z-index: 4500; display: flex; align-items: center; gap: 11px;
  min-width: 300px; max-width: min(560px, calc(100vw - 32px));
  padding: 10px 12px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  animation: mpbIn .22s var(--ease);
}
@keyframes mpbIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#mpBanner .mpb-text { flex: 1; min-width: 0; }
#mpBanner .mpb-title { font-weight: 700; font-size: 13px; }
#mpBanner .mpb-body { font-size: 11.5px; color: var(--dim); margin-top: 2px; line-height: 1.35; }
#mpBanner .mpb-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#mpBanner .mpb-x { padding: 2px 8px; font-size: 15px; line-height: 1; }
#mpBanner .mpb-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
#mpBanner.mpb-working { border-color: var(--accent); }
#mpBanner.mpb-working .mpb-dot { background: var(--accent); animation: mpbPulse 1s ease-in-out infinite; }
#mpBanner.mpb-bad { border-color: var(--red); }
#mpBanner.mpb-bad .mpb-dot { background: var(--red); }
#mpBanner.mpb-ok { border-color: var(--green); }
#mpBanner.mpb-ok .mpb-dot { background: var(--green); }
@keyframes mpbPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* sustain pedal button in the keyboard panel */
#keysPedal { padding: 4px 12px; font-size: 12px; }
#keysPedal.on { background: var(--accent); color: #16130f; border-color: var(--accent); }

#bpmInput { user-select: text; -webkit-user-select: text; }

.set-head { display: flex; align-items: baseline; gap: 7px; margin: 12px 0 5px;
  padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.set-head:first-child { margin-top: 0; }
.set-head span { font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text); }
.set-head em { font-style: normal; font-size: 10.5px; color: var(--faint); }
.set-note { font-size: 11px; color: var(--faint); margin: 2px 0 4px 26px; line-height: 1.4; }

#posDisplay { cursor: pointer; }
#posDisplay:hover { background: var(--panel2); border-color: var(--accent); }
.pos-sub { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
#posSig { font-size: 9.5px; font-weight: 700; color: var(--faint); letter-spacing: .02em; }
@media (max-width: 1240px) { #topbar #posSig { display: none; } }

.choice-btns { flex-wrap: wrap; gap: 7px; }
.choice-btns .fbtn { flex: 1 1 auto; min-width: 110px; }
.fbtn.danger-outline { border-color: var(--red); color: var(--red); background: transparent; }
.fbtn.danger-outline:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }

.fwin.fwin-over-home { position: fixed; z-index: 1000; }

.card-lifted { opacity: 0.35; }
#dragGhostCard {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none;
  transform-origin: 50% -6px;          
  box-shadow: 0 14px 30px rgba(0,0,0,.5);
  opacity: .95;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) { #dragGhostCard { transform-origin: 50% 50%; } }

.clip { transition: transform 160ms cubic-bezier(.22,.9,.3,1); }
.clip.resizing { transition: none; }

#dragPixel { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0.01; pointer-events: none; }

/* ---- painting effects ---- */
body.fx-painting, body.fx-painting * {
  cursor: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'>\
<g transform='rotate(-38 15 15)'>\
<rect x='12' y='2' width='6' height='13' rx='1.6' fill='%23c8cbd6' stroke='%23202430' stroke-width='1.2'/>\
<rect x='11' y='14' width='8' height='4' rx='1' fill='%238b90a0' stroke='%23202430' stroke-width='1.2'/>\
<path d='M11.5 18 L15 27 L18.5 18 Z' fill='%234ad991' stroke='%23202430' stroke-width='1.2' stroke-linejoin='round'/>\
</g></svg>") 15 27, copy !important;
}
#dragGhostCard.ghost-paint {
  outline: 2px solid var(--green, #4ad991);
  outline-offset: -2px;
  box-shadow: 0 14px 30px rgba(0,0,0,.5), 0 0 20px rgba(74, 217, 145, .45);
}
#dragGhostCard.ghost-paint::after {
  content: '+';
  position: absolute; top: -9px; right: -9px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green, #4ad991); color: #0d1a13;
  font-size: 15px; font-weight: 900; line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
/* a clip the brush has just covered */
.clip.fx-over { outline: 2px solid var(--accent); outline-offset: -2px; }
body.fx-painting .clip.fx-over { outline-color: var(--green, #4ad991); }

body.shift-held .fx-item:not(.samp-item) {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green) inset, 0 0 14px rgba(120, 181, 106, .25);
}
body.shift-held .fx-item:not(.samp-item)::after {
  content: '+';
  position: absolute; top: -7px; right: -7px;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green); color: #0d1a13;
  font-size: 13px; font-weight: 900; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
body.shift-held .fx-item:not(.samp-item) { position: relative; overflow: visible; }

/* ---- the dragged card coming apart on release ---- */
@keyframes ghostDissolve {
  0%   { opacity: .95; transform: var(--gt) scale(1) translate3d(0, 0, 0); }
  40%  { opacity: .5; }
  100% { opacity: 0;   transform: var(--gt) scale(1.07) translate3d(0, -12px, 0); }
}
#dragGhostCard.ghost-dissolve {
  animation: ghostDissolve 0.52s cubic-bezier(.4,0,.7,1) forwards;
  pointer-events: none;
  will-change: opacity, transform;
}
@keyframes ghostDust {
  0%   { opacity: 0;   transform: translate3d(0, 0, 0) scale(1); }
  15%  { opacity: .95; }
  100% { opacity: 0;   transform: translate3d(var(--dx), var(--dy), 0) scale(.3); }
}
.ghost-dust {
  position: fixed; z-index: 9999; pointer-events: none;
  border-radius: 50%;
  background: var(--accent);
  animation: ghostDust 0.62s cubic-bezier(.25,.6,.4,1) forwards;
  will-change: opacity, transform;
}
.ghost-dust.paint { background: var(--green); }

/* ---- your own loops ---- */
.samp-new {
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 30px; margin-top: 4px; padding: 6px 9px;
  border: 1.5px dashed var(--line); border-radius: 8px;
  background: transparent; color: var(--faint);
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.samp-new:hover { border-color: var(--dim); color: var(--dim); }
.samp-new-plus { font-size: 17px; font-weight: 300; line-height: 1; }
.samp-new-over { border-color: var(--accent); color: var(--accent); background: rgba(224,122,63,.08); }
.samp-new.samp-new-hint { flex-direction: column; gap: 4px; padding: 9px; }
.samp-new-say { font-size: 10.5px; line-height: 1.35; text-align: center; color: var(--dim); }

.samp-item.samp-mine { padding-right: 26px; }
.samp-edit {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.samp-item.samp-mine { position: relative; }
.samp-edit:hover { background: var(--panel3); color: var(--text); }
.samp-edit .ic { width: 12px; height: 12px; }

.loop-field { display: flex; align-items: center; gap: 9px; margin-top: 9px; font-size: 12px; }
.loop-field > span { flex: 0 0 66px; color: var(--dim); }
.loop-field input, .loop-field select {
  flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 9px; color: var(--text); outline: none; font-size: 12px;
}
.loop-meta { font-size: 11px; color: var(--faint); margin: 9px 0 2px; }

.clip-label { cursor: grab; }
.clip-label:active { cursor: grabbing; }

.curve-ico { display: inline-flex; margin-right: 7px; vertical-align: -3px; color: var(--accent); }
#curveMenu .ctx-item { display: flex; align-items: center; }

.req-row.req-blocked { border-left: 2px solid var(--red); padding-left: 8px; flex-wrap: wrap; }
.req-row .req-who { flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.req-row.req-blocked .fbtn { margin-left: auto; }
.req-row.req-blocked .fbtn + .fbtn { margin-left: 0; }
.req-row .req-line { display: flex; align-items: center; gap: 8px; }
.req-row .req-why { font-size: 10px; color: var(--faint); margin-left: 16px; }
.req-row.req-blocked .fbtn { flex: 0 0 auto; white-space: nowrap; }

/* ---------- the loop gallery ---------- */
.gal-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gal-tabs { display: flex; gap: 4px; }
.gal-tab {
  flex: 1; padding: 5px 8px; font-size: 11px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim); border-radius: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gal-tab.on { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.gal-filters { display: flex; gap: 6px; }
.gal-filters input {
  flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 9px; color: var(--text); outline: none; font-size: 12px;
}
.gal-filters select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 6px; font-size: 11px; flex: 0 0 auto;
}
.gal-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 100%; }
.gal-note { color: var(--faint); font-size: 12px; padding: 12px 2px; line-height: 1.5; }

.gal-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg2);
  transition: border-color .12s;
}
.gal-card:hover { border-color: var(--accent); }
.gal-card.gal-reported { opacity: 0.45; }
.gal-main { flex: 1; min-width: 0; }
.gal-nm { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.gal-author {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 10.5px; font-weight: 600; color: var(--accent);
}
.gal-author:hover { text-decoration: underline; }
.gal-tag {
  font-size: 9.5px; color: var(--faint); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 6px;
}
.gal-acts { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.gal-acts .fbtn { padding: 4px 10px; font-size: 11px; }
.gal-like {
  display: flex; align-items: center; gap: 3px; cursor: pointer;
  background: none; border: none; color: var(--faint); font-size: 11px; padding: 2px;
}
.gal-like .ic { width: 14px; height: 14px; }
.gal-like.on { color: var(--red); }
.gal-like.on .ic { fill: var(--red); }
.gal-more {
  background: none; border: none; color: var(--faint); cursor: pointer;
  font-size: 13px; letter-spacing: 1px; padding: 0 4px; line-height: 1;
}
.gal-more:hover { color: var(--text); }

/* profiles */
.prof-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.prof-dot { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; }
.prof-name { font-size: 16px; font-weight: 800; }
.prof-bio { font-size: 12px; color: var(--dim); line-height: 1.5; margin-bottom: 10px; }
.prof-bio i { color: var(--faint); }
.prof-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.prof-stats b { color: var(--text); font-size: 13px; margin-right: 3px; }
.samp-from {
  font-size: 9px; color: var(--faint); flex: 0 1 auto;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- phones 
   fabu is a desktop tool and stays one, but a phone should be able to open a
   song, hear it, and move things around rather than showing a sliver of
   timeline behind a track list that eats the whole screen ---------- */
@media (max-width: 760px) {
  :root { --heads-w: 132px; }
  .thead { padding: 6px 7px; gap: 4px; }
  .thead select { max-width: 100%; font-size: 10.5px; }
  .thead-vol { display: none; }          /* the mixer has the same slider, larger */
  .thead-add { flex-direction: column; align-items: stretch; gap: 5px; padding: 6px 7px; }
  .thead-add > * { width: 100%; justify-content: center; }

  #topbar { flex-wrap: wrap; height: auto; row-gap: 6px; padding-bottom: 8px; }
  #topbar .tb-group { flex: 0 0 auto; }
  #topbar .tbtn { min-width: 34px; height: 34px; }
  #topbar .tb-sep { display: none; }

  .fwin {
    position: fixed !important;
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: 100% !important; max-width: 100%;
    height: auto !important; max-height: 76vh !important;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .55);
  }
  .fwin-body { max-height: calc(76vh - 44px); overflow-y: auto; }
  .fwin-rz { display: none; }             /* nothing to resize when it spans the screen */

  .proll-tools .pt-group { flex-wrap: wrap; }
  .proll-tools { gap: 6px; }
  .fwin-head { padding: 12px 12px; }      /* a drag handle you can actually hit */

  #webNudge { bottom: auto; top: 10px; }
  #webNudge { transform: translateY(-14px); }
  #webNudge.in { transform: translateY(0); }

  .modal-card { max-width: calc(100vw - 24px); }
  .gal-card { padding: 10px; }
  .gal-acts .fbtn { padding: 7px 12px; }
}

@media (pointer: coarse) {
  #lanes, #ruler, .clip,
  .proll-grid, .proll-keys, .proll-ruler, .proll-vel,
  .autom-canvas, .eq-canvas, .fwin-head, .fwin-rz {
    touch-action: none;
  }
}

.samp-links { display: flex; gap: 6px; margin-bottom: 8px; }
.samp-links .fbtn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 11.5px; }
.samp-links .fbtn { flex: 1; justify-content: center; }
.samp-links .ic { width: 14px; height: 14px; }

/* ---------- home sidebar 
   Everything the app can do used to be behind either a card or nothing at all,
   which is how the gallery and profiles ended up unreachable ---------- */
#homeNav {
  position: relative; z-index: 1;
  flex: 0 0 264px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 34px 22px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(12, 11, 10, 0.72), rgba(12, 11, 10, 0.55));
  backdrop-filter: blur(14px);
}
.hn-brand { padding: 0 6px 32px; }
#homeNav .home-logo { font-size: 40px; letter-spacing: -1.6px; }
#homeNav .home-tag { font-size: 12.5px; margin-left: 2px; }
.hn-items { display: flex; flex-direction: column; gap: 4px; }
.hn-item {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-radius: 12px;
  border: 1px solid transparent; background: none; color: var(--dim);
  font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.hn-item:hover { background: var(--panel2); color: var(--text); }
.hn-item.on {
  background: linear-gradient(180deg, rgba(224, 122, 63, 0.2), rgba(224, 122, 63, 0.09));
  border-color: rgba(224, 122, 63, 0.55);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.hn-item .ic { width: 19px; height: 19px; flex-shrink: 0; }
.hn-item { font-size: 14px; }

.hn-new {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer;
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease);
}
.hn-new {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.005) 60%),
    var(--panel);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.hn-new:hover { border-color: rgba(224, 122, 63, 0.5); background: var(--panel2); }
.hn-new .ic { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.hn-new-txt { display: flex; flex-direction: column; min-width: 0; }
.hn-new-title { font-size: 12.5px; font-weight: 700; }
.hn-new-sub { font-size: 10.5px; color: var(--faint); margin-top: 1px; }

#homeNav #homeVerWrap {
  position: static; left: auto; bottom: auto;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 4px 0; font-size: 10.5px; color: var(--faint);
}

/* recents shelf */
.home-recent-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.home-recent-head {
  margin-bottom: 0; font-size: 17px; font-weight: 700;
  letter-spacing: 0; text-transform: none; color: var(--text);
}
.home-viewall {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 600;
}
.home-viewall .ic { width: 13px; height: 13px; }
.home-viewall:hover { text-decoration: underline; }
.home-viewall.hidden { display: none; }

.home-foot {
  margin-top: auto; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.home-foot #homeLangs, .home-foot #homeKofi { position: static; margin: 0; }
.home-foot #homeKofi { margin-left: auto; }
.home-foot .home-example { margin-top: 0; font-size: 13.5px; color: var(--dim); }
.home-example .ex-chev { width: 12px; height: 12px; color: var(--accent); }
.home-foot #homeLangs { margin: 0 auto; }

/* what's new */
.news-card { max-width: 620px; width: 100%; }
.news-scroll { max-height: 58vh; overflow-y: auto; margin: 4px 0 10px; padding-right: 4px; }
.news-rel + .news-rel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.news-ver {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.news-item + .news-item { margin-top: 12px; }
.news-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.news-body { font-size: 12px; color: var(--dim); line-height: 1.55; }

.home-card-art {
  background: linear-gradient(152deg, hsl(var(--h) 66% 44%), hsl(var(--h) 60% 24%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border-color: transparent;
}
.home-card-more {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; color: var(--faint);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.home-card-more .ic { width: 17px; height: 17px; }
.home-card:hover .home-card-more { color: var(--dim); }
.home-card-more:hover { background: var(--panel3); color: var(--text); }

.fwin.samp-catch {
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
  background: var(--accent-soft);
}

/* ---------- home pages ---------- */
.home-page.hidden, #pageHome.hidden { display: none; }
.hp-head { margin-bottom: 4px; }
.hp-title { font-size: 34px; font-weight: 700; letter-spacing: -0.8px; margin: 0; }
.hp-sub { font-size: 14px; color: var(--dim); margin-top: 8px; }
.hp-body { flex: 1; min-height: 0; max-width: 900px; }
.hp-head { max-width: 900px; }

.hp-settings { max-width: 560px; }
.hp-settings .frow { margin-bottom: 4px; }

.hp-loops .gal-list { gap: 10px; }
.hp-loops { max-width: 820px; }
.hp-loops .gal-bar { max-width: 720px; }
.hp-loops .gal-tabs { gap: 6px; }
.hp-loops .gal-tab { flex: 0 0 auto; padding: 8px 16px; font-size: 12.5px; }
.gal-filters.hidden { display: none; }
.gal-tag-on { border-color: var(--accent); color: var(--accent); }

/* a literal list of every project */
.proj-list { display: flex; flex-direction: column; }
.proj-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px; border-radius: 10px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.11s var(--ease);
}
.proj-row:hover { background: var(--panel2); }
.proj-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.proj-name {
  flex: 1 1 40%; min-width: 0; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-when { flex: 0 0 auto; font-size: 12px; color: var(--faint); }
.proj-path {
  flex: 0 0 auto; max-width: 220px; font-size: 11.5px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.7;
}
.proj-more {
  flex: 0 0 auto; background: none; border: none; cursor: pointer;
  color: var(--faint); width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.proj-more .ic { width: 17px; height: 17px; }
.proj-more:hover { background: var(--panel3); color: var(--text); }

/* the profile page */
.pf-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.pf-dot { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; }
.pf-id { flex: 1; min-width: 0; }
.pf-name { font-size: 22px; font-weight: 700; }
.pf-bio { font-size: 13.5px; color: var(--dim); margin-top: 5px; line-height: 1.5; }
.pf-bio i { color: var(--faint); }
.pf-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.pf-stats { display: flex; gap: 34px; margin-bottom: 26px; }
.pf-stat { display: flex; flex-direction: column; gap: 2px; }
.pf-stat b { font-size: 22px; font-weight: 700; }
.pf-stat span { font-size: 11.5px; color: var(--faint); }
.pf-sec {
  font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); margin: 4px 0 12px;
}

.hn-item:focus-visible, .home-go:focus-visible, .home-card:focus-visible,
.home-viewall:focus-visible, .hn-new:focus-visible, .proj-row:focus-visible,
.gal-tab:focus-visible, .fbtn:focus-visible, .samp-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- the home screen on a phone 
   Kept at the end on purpose ---------- */
@media (max-width: 760px) {
  #home { flex-direction: column; align-items: stretch; justify-content: flex-start; overflow-y: auto; }
  #homeNav {
    flex: 0 0 auto; padding: 16px 14px 10px;
    border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .hn-brand { padding: 0 4px 14px; }
  #homeNav .home-logo { font-size: 30px; }
  #homeNav .home-tag { display: none; }
  .hn-items { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .hn-items::-webkit-scrollbar { display: none; }
  .hn-item { flex: 0 0 auto; padding: 9px 12px; font-size: 12.5px; }
  .hn-item span { white-space: nowrap; }
  .hn-new { margin-top: 10px; padding: 9px 12px; }
  .hn-new-sub { display: none; }
  .hn-new-title { font-size: 12px; }
  #homeNav #homeVerWrap { padding: 6px 4px 0; }
  #homeNav #homeVer { font-size: 10px; }

  .home-inner { padding: 24px 18px 18px; gap: 22px; }
  .home-greet { font-size: 30px; }
  .home-greet-sub { margin-bottom: 18px; }
  .home-actions { flex-wrap: wrap; gap: 12px; }
  .home-go { flex: 1 1 45%; min-width: 150px; height: 178px; padding: 18px 16px 16px; }
  .hc-ic { width: 26px; height: 26px; }
  .hc-title { font-size: 16px; }
  .hc-sub { font-size: 12px; min-height: 0; }
  .home-recent-list { grid-template-columns: 1fr; gap: 10px; }
  .hp-title { font-size: 26px; }
  .proj-path { display: none; }
  .pf-stats { gap: 20px; }

  .home-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .home-foot #homeKofi, .home-foot #homeLangs { margin: 0; align-self: center; }
  #homeLangs { position: static; margin: 6px 0 0; }
  #homeKofi { position: static; align-self: center; margin: 10px 0 0; }
  #homeVerWrap { position: static; align-self: center; margin: 8px 0 20px; }
}

/* ---------- movement between home pages 
   Switching pages was an instant swap, which reads as a redraw rather than as
   going somewhere ---------- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#pageHome, .home-page { animation: pageIn 0.22s var(--ease) both; }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.proj-row, .gal-card {
  animation: rowIn 0.24s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}

.gal-tab {
  transition: background 0.12s var(--ease), color 0.12s var(--ease),
              border-color 0.12s var(--ease);
}
.home-viewall { transition: color 0.12s var(--ease); }
.samp-links .fbtn, .pf-btns .fbtn { transition: border-color 0.12s var(--ease), background 0.12s var(--ease); }

.gal-tab.on { transition: background 0.16s var(--ease), color 0.16s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  #pageHome, .home-page, .proj-row, .gal-card { animation: none; }
  #home::before { animation: none; }
}

/* ---------- automation lanes under a track 
   The curve used to be in a floating window, so you could not see what a track
   was doing without going to look ---------- */
.autom-lane {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}
.al-canvas { display: block; position: absolute; inset: 0; cursor: crosshair; }
.al-label {
  position: sticky; left: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  margin: 5px 0 0 6px; padding: 2px 5px 2px 7px;
  border-radius: 6px;
  background: rgba(18, 16, 14, 0.86);
  border: 1px solid var(--line);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--dim);
  pointer-events: auto;
}
.al-del {
  display: flex; align-items: center; background: none; border: 0;
  padding: 0 1px; cursor: pointer; line-height: 1; color: var(--faint);
}
.al-del .ic { width: 11px; height: 11px; }
.al-del:hover { color: var(--red); }
.ms-btn.autom.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.autom-head {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.34);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s var(--ease);
}
.autom-head:hover { background: rgba(0, 0, 0, 0.46); }
.ah-fold {
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--dim);
}
.ah-fold .ic { width: 12px; height: 12px; transform: rotate(90deg); transition: transform 0.15s var(--ease); }
.autom-head.collapsed .ah-fold .ic { transform: rotate(0deg); }
.autom-head:hover .ah-fold { color: var(--accent); }
.ah-title {
  position: sticky; left: 30px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--faint);
}
.ah-count {
  position: sticky; left: 96px;
  min-width: 14px; text-align: center;
  font-size: 9px; font-weight: 700; color: var(--dim);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 4px;
}
@media (prefers-reduced-motion: reduce) { .ah-fold .ic { transition: none; } }

.modal-link {
  align-self: flex-start;
  background: none; border: 0; padding: 2px 0; margin: -2px 0 4px;
  color: var(--dim); font-size: 11.5px; font-weight: 600;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; text-decoration-color: var(--line);
  transition: color 0.12s var(--ease), text-decoration-color 0.12s var(--ease);
}
.modal-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---- the loop editor ---- */
.loop-field input[type="text"] { width: auto; margin-bottom: 0; }
.loop-field { margin-top: 10px; }
.loop-field > span { flex: 0 0 62px; }

.loop-send { display: flex; gap: 8px; margin-top: 16px; }
.loop-send .fbtn { flex: 1; justify-content: center; }
.modal-btns.loop-end { justify-content: space-between; margin-top: 8px; }
.gal-play { padding: 5px 8px; display: flex; align-items: center; }
.gal-play .ic { width: 13px; height: 13px; }
.gal-play.on { border-color: var(--accent); color: var(--accent); }
.gal-play.loading { opacity: 0.5; pointer-events: none; }
.pt-toggle.pt-wide { display: inline-flex; align-items: center; gap: 6px; }
.pt-toggle.pt-wide .ic { width: 13px; height: 13px; }

/* ========================================================================== touch screens ========================================================================== */

html, body { overflow-x: hidden; max-width: 100%; }

@media (pointer: coarse) {
  .fwin-close { width: 40px; height: 40px; }
  .fwin-close .ic { width: 18px; height: 18px; }
  .tbtn { min-height: 38px; }
  .fbtn { min-height: 38px; }
  .ms-btn { min-width: 30px; min-height: 30px; }
  .gal-tab, .hn-item { min-height: 40px; }
  .samp-item, .fx-item, .gal-card, .proj-row, .home-card { min-height: 44px; }
  .al-del, .home-card-more, .proj-more, .gal-more { min-width: 34px; min-height: 34px; }
}

/* ---- tablets ---- */
@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  :root { --heads-w: 180px; }
  #topbar { flex-wrap: wrap; height: auto; row-gap: 6px; padding-bottom: 8px; }
  #topbar .tb-group { flex: 0 0 auto; }
  .fwin { max-height: 78vh; }
  .fwin-body { overscroll-behavior: contain; }
}

/* ---- phones ---- */
@media (max-width: 760px) {
  .fwin {
    top: auto !important; bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: 100% !important;
    height: auto !important; max-height: 82vh !important;
    border-radius: 16px 16px 0 0;
  }
  .fwin-head {
    position: sticky; top: 0; z-index: 4;
    padding: 12px 14px;
    background: var(--panel);
    border-radius: 16px 16px 0 0;
  }
  /* a grab bar, so a sheet reads as a sheet */
  .fwin-head::before {
    content: ''; position: absolute; top: 5px; left: 50%;
    width: 36px; height: 4px; margin-left: -18px;
    border-radius: 99px; background: var(--line);
  }
  .fwin-title { font-size: 14px; font-weight: 700; }
  .fwin-body {
    max-height: calc(82vh - 58px) !important;
    overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .fwin-rz { display: none; }

  #sheetBack {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(8, 7, 6, 0.55);
    backdrop-filter: blur(2px);
  }

  .proll-tools { padding: 8px 10px; gap: 6px; }
  .proll-tools .pt-group { flex-wrap: wrap; }
  .proll-tools .pt-track { width: 100%; }
  .pt-toggle, .pt-btn, .pt-seg { min-height: 34px; padding: 6px 10px; }
  .proll-tools select { min-height: 34px; }

  :root { --heads-w: 118px; }
  .thead { padding: 6px; }
  .thead-top { gap: 4px; }
  .thead .tname { font-size: 11.5px; }

  .modal-card { max-width: calc(100vw - 20px); max-height: 86vh; overflow-y: auto; }
}

@media (max-width: 760px) {
  .fwin { animation: sheetIn 0.2s var(--ease) both; }
  @keyframes sheetIn {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .fwin.fwin-closing { animation: sheetOut 0.16s var(--ease) forwards; }
  @keyframes sheetOut {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(16px); opacity: 0; }
  }
  #sheetBack { animation: backIn 0.2s var(--ease) both; }
  @keyframes backIn { from { opacity: 0; } to { opacity: 1; } }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .fwin, #sheetBack { animation: none; }
}

@media (max-width: 760px) {
  .proll-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 7px 10px;
  }
  .proll-tools::-webkit-scrollbar { display: none; }
  .proll-tools .pt-group { flex-wrap: nowrap; flex: 0 0 auto; }
  .proll-tools .pt-track { display: none; }   /* the sheet title already says it */
  .proll-tools .pt-spacer { display: none; }
  .pt-toggle.pt-wide { white-space: nowrap; }

  .proll-wrap, .proll-scroll { min-height: 220px; }
}

@media (max-width: 760px) {
  .thead-mid { flex-wrap: wrap; row-gap: 4px; }
  .thead-mid .tinst-btn { flex: 1 1 100%; min-width: 0; }
  .thead select { max-width: 100%; }
  .thead-mid .ms-btn { flex: 0 0 auto; }

  #topbar .tb-group { flex-wrap: wrap; row-gap: 5px; }
  #topbar .tb-field { flex-wrap: nowrap; }
  #topbar > * { max-width: 100%; }
}

@media (max-width: 1180px) {
  #topbar { flex-wrap: wrap; height: auto; row-gap: 6px; padding-bottom: 8px; }
  #topbar .tb-group { flex: 0 0 auto; }
  #topbar .tb-sep { display: none; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  :root { --heads-w: 176px; }
}
.pt-oct {
  min-width: 30px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.proll-keys { cursor: ns-resize; }

/* the feedback button, beside support fabu */
.home-feedback {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease), background 0.12s var(--ease);
}
.home-feedback:hover { border-color: var(--accent); color: var(--accent); background: var(--panel2); }
.home-feedback .ic { width: 14px; height: 14px; }
.home-foot .home-feedback { margin-left: auto; }
.home-foot #homeKofi { margin-left: 10px; }

#fbModal .modal-card { max-width: 460px; width: 100%; }
#fbModal textarea {
  width: 100%; resize: vertical; min-height: 110px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 9px 11px; outline: none; margin-bottom: 8px;
  font-size: 13px; font-family: inherit; line-height: 1.5;
}
#fbModal textarea:focus, #fbModal input:focus { border-color: var(--accent); }
#fbModal textarea { margin-bottom: 4px; }
.fb-count {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; color: var(--faint); margin: 0 2px 9px;
  min-height: 14px;
}
.fb-count .over { color: var(--accent); }
#fbModal .fbtn.accent:disabled { opacity: 0.45; cursor: not-allowed; }
.samp-item.playing { border-color: var(--accent); }
.samp-item.playing .samp-play { color: var(--accent); }

.home-go.disabled {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}
.home-go.disabled .hc-ic { color: var(--faint); }
.home-go.disabled .hc-art { opacity: 0.06; }
