/* ===================================================================
   arbhar library editor — Instruo styling
   Dark near-black background, warm gold/tan accent, light humanist type.
   =================================================================== */
:root {
  --bg:        #0d0c0a;
  --bg-2:      #141210;
  --panel:     #191510;
  --panel-2:   #211c15;
  --line:      rgba(201, 161, 91, 0.22);
  --line-soft: rgba(255, 255, 255, 0.06);
  --gold:      #c9a15b;
  --gold-br:   #e2c489;
  --gold-dim:  rgba(214, 178, 112, 0.66);
  --text:      #f3eee4;
  --muted:     #ada493;
  --danger:    #c56b5c;
  --ok:        #8ba86a;
  --radius:    10px;
  --shadow:    0 8px 30px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(201,161,91,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- brand ---------- */
.brandmark { display: flex; align-items: center; gap: 14px; }
.hourglass { width: 34px; height: 40px; }
.hourglass path { stroke: var(--gold); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; }
.brand-instruo { font-weight: 600; letter-spacing: 0.22em; font-size: 22px; }
.brandmark.small .brand-instruo { font-size: 16px; letter-spacing: 0.18em; }
.omacron { color: var(--gold); }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; margin-top: 3px; }
.brand-divider { color: var(--gold-dim); margin: 0 4px; }
.brand-arbhar { color: var(--gold-br); letter-spacing: 0.14em; font-size: 15px; }
.brand-arbhar-title { color: var(--gold-br); font-size: 24px; letter-spacing: 0.06em; }
.brand-sub-inline { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  padding: 8px 14px; transition: all .15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-br); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: #1a1409; border-color: var(--gold); font-weight: 500; }
.btn.primary:hover:not(:disabled) { background: var(--gold-br); color: #1a1409; }
.btn.ghost { padding: 7px 12px; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

/* ===================== SETUP ===================== */
.setup { min-height: 100%; display: grid; place-items: center; padding: 40px 20px; }
.setup-card {
  width: min(720px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 34px; box-shadow: var(--shadow);
}
.setup-lead { color: var(--muted); line-height: 1.6; margin: 22px 0 18px; }
.setup-lead code { color: var(--gold-br); background: var(--bg-2); padding: 2px 6px; border-radius: 5px; }

.picker { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.picker-bar { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line-soft); }
.path-input {
  flex: 1; background: var(--bg); border: 1px solid var(--line-soft); color: var(--text);
  border-radius: 7px; padding: 8px 12px; font: inherit; font-size: 13px;
}
.path-input:focus { outline: none; border-color: var(--gold-dim); }
.picker-body { display: grid; grid-template-columns: 190px 1fr; min-height: 240px; max-height: 320px; }
.shortcuts { list-style: none; margin: 0; padding: 8px; border-right: 1px solid var(--line-soft); overflow: auto; }
.shortcuts li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--muted); }
.shortcuts li:hover { background: var(--panel-2); color: var(--text); }
.dir-list { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.dir-list li { padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.dir-list li:hover { background: var(--panel-2); }
.dir-list li::before { content: "▸"; color: var(--gold-dim); }
.dir-list li.is-arbhar { color: var(--gold-br); }
.dir-list li.is-arbhar::before { content: "◆"; color: var(--gold); }
.picker-status { padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); min-height: 20px; }
.picker-status.good { color: var(--ok); }

.setup-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 16px; flex-wrap: wrap; }
.setup-buttons { display: flex; gap: 8px; align-items: center; }
.fsa-pick { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.fsa-pick .btn { flex: 0 0 auto; min-width: 210px; text-align: left; }
.fsa-name { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsa-name.set { color: var(--gold-br); }
.setup-hint { color: var(--muted); font-size: 12px; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--gold); }

/* ===================== APP LAYOUT ===================== */
.app { height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.root-info { display: flex; align-items: center; gap: 12px; }
.root-label { color: var(--gold-dim); font-size: 12px; letter-spacing: .02em; margin-right: -6px; }
.autoconv { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.autoconv input { accent-color: var(--gold); cursor: pointer; }
.root-path { color: var(--muted); font-size: 12px; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banks { padding: 10px 22px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 7px 16px; border-radius: 20px; border: 1px solid var(--line-soft);
  background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px;
  letter-spacing: .04em; transition: all .15s ease;
}
.tab:hover { color: var(--text); border-color: var(--line); }
.tab.active { background: var(--gold); color: #1a1409; border-color: var(--gold); font-weight: 500; }
.tab .lib-dot { color: var(--gold); font-size: 9px; vertical-align: middle; margin-left: 2px; }
.tab.active .lib-dot { color: #1a1409; }
.tab.scenes.active { background: var(--gold-br); }

.workspace {
  display: grid; grid-template-columns: 320px 1fr 320px; gap: 0;
  overflow: hidden; min-height: 0;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-br); }
.hint { color: var(--muted); font-size: 11px; }

/* ---------- staging ---------- */
.staging { border-right: 1px solid var(--line-soft); padding: 18px; overflow: hidden; background: var(--bg-2); display: flex; flex-direction: column; }
.staging .panel-head { flex: 0 0 auto; }
/* the dashed dropzone wraps the whole tree (folders + files) */
.staging-drop { flex: 1 1 auto; overflow-y: auto; padding: 10px; text-align: left; min-height: 0; }
.staging:not(.has-items) .staging-drop { display: flex; align-items: center; justify-content: center; text-align: center; }
.staging.has-items .staging-drop { display: block; }
.staging-drop-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.staging-drop-hint em { color: var(--gold-dim); font-style: normal; }
.staging.has-items .staging-drop-hint { display: none; }
.staging-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.stg-open-btn {
  flex: 0 0 auto; margin-top: 10px; width: 100%; padding: 8px; border-radius: 8px;
  border: 1px solid var(--line-soft); background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; letter-spacing: .02em; cursor: pointer; transition: all .13s ease;
}
.stg-open-btn:hover { border-color: var(--gold-dim); color: var(--gold-br); }
.staging-bar .mini { border: 1px solid var(--line-soft); border-radius: 6px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.staging-bar .mini:hover { border-color: var(--gold-dim); }
.stg-path { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-path b { color: var(--gold-br); font-weight: 500; }
.dir-item { list-style: none; }
.row-line {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line-soft); cursor: pointer; font-size: 13px;
  user-select: none; -webkit-user-select: none;
}
.row-line:hover { border-color: var(--gold-dim); color: var(--gold-br); }
.row-line.over { border-color: var(--gold); }          /* border only — no filled background */
.row-line .fic { color: var(--gold-dim); }
.row-line .caret { color: var(--muted); font-size: 10px; width: 10px; flex: 0 0 auto; }
.row-line .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* nested children: structural indentation + subtle tree guide */
.stage-sublist { list-style: none; margin: 6px 0 0 12px; padding: 0 0 0 10px;
  display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line-soft); }
/* discrete actions, revealed on hover */
.row-line .mini, .stage-item .mini { opacity: 0; transition: opacity .12s ease; padding: 2px 4px; }
.row-line:hover .mini, .stage-item:hover .mini { opacity: .55; }
.row-line .mini:hover, .stage-item .mini:hover { opacity: 1; }
.row-line .mini.x:hover, .stage-item .mini.x:hover { color: var(--danger); }
/* Empty reserve → the dropzone fills all remaining height. */
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 44px; border-radius: 8px; }
.file-list.list-drop-over { outline: 1.5px dashed var(--gold); outline-offset: 4px; background: rgba(201,161,91,0.06); }
.stage-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line-soft); cursor: pointer; font-size: 13px;
  user-select: none; -webkit-user-select: none;
}
.stage-item .play { color: var(--gold-dim); font-size: 11px; flex: 0 0 auto; }
.stage-item:hover .play, .stage-item.playing .play { color: var(--gold-br); }
.stage-item:hover { border-color: var(--gold-dim); }
.stage-item.dragging { opacity: .4; }
.stage-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 5px; }
.mini:hover { color: var(--gold-br); background: var(--panel-2); }
.mini.del:hover { color: var(--danger); }

/* ---------- dropzones ---------- */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px 12px;
  text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5;
  transition: all .15s ease;
}
.dropzone em { color: var(--gold-dim); font-style: normal; }
.dropzone.over { border-color: var(--gold); background: rgba(201,161,91,0.08); color: var(--gold-br); }

/* ---------- grid ---------- */
.grid-wrap { padding: 22px; overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.grid-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.grid-head h2 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: .04em; }
.make-active { align-self: center; }
.make-active.is-active { background: none; border-color: transparent; color: var(--gold); cursor: default; opacity: 1; padding-left: 0; padding-right: 0; }
.grid-legend { color: var(--muted); font-size: 12px; }
.grid-legend b { color: var(--gold-br); font-weight: 500; }
.kbd-hint { margin-left: auto; color: var(--muted); font-size: 11px; }
.kbd-hint kbd {
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 4px;
  padding: 1px 6px; font-family: inherit; font-size: 10px; color: var(--gold-dim);
}

.grid-banner {
  background: rgba(197, 107, 92, 0.12); border: 1px solid var(--danger);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  color: #f0c5bd; font-size: 13px; line-height: 1.5;
}
.grid-banner code { color: var(--gold-br); background: var(--bg-2); padding: 1px 6px; border-radius: 4px; }
.grid-banner span { color: var(--muted); }
.grid-banner .btn { margin-top: 8px; border-color: var(--danger); color: #f0c5bd; }
.grid-banner .btn:hover { background: var(--danger); color: #1a1409; }

.grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  grid-auto-rows: minmax(78px, auto); align-content: start;
}
.pad {
  position: relative; min-height: 78px; user-select: none; -webkit-user-select: none;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  cursor: pointer; padding: 8px 9px; display: flex; flex-direction: column;
  justify-content: space-between; transition: all .13s ease; overflow: hidden;
}
.pad:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.pad.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 6px 18px rgba(0,0,0,.4); }
.pad.over { border-color: var(--gold-br); background: rgba(201,161,91,0.12); }
.pad.filled::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold);
}
.tile-del {
  position: absolute; top: 4px; right: 4px; z-index: 2; width: 18px; height: 18px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: var(--muted);
  font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s ease;
  display: grid; place-items: center; padding: 0;
}
.pad:hover .tile-del { opacity: 1; }
.pad:hover.filled::after { opacity: 0; }         /* hide the dot while the × shows */
.tile-del:hover { background: var(--danger); color: #1a1409; }

.pad-id { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.pad-name { font-size: 12px; color: var(--text); line-height: 1.25; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pad.empty .pad-name { color: var(--muted); font-style: italic; }
.pad-count { font-size: 10px; color: var(--gold-dim); }

/* ---------- scenes view ---------- */
/* keep the inspector (editor) column; only the file list is library-specific */
.scenes-mode #insp-list, .scenes-mode #insp-drop, .scenes-mode #insp-empty { display: none; }
.scene-view { display: flex; flex-direction: column; gap: 18px; }
.scene-controls { display: flex; flex-direction: column; gap: 10px; }
.sel-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel-row > .sel-label { color: var(--muted); font-size: 12px; width: 54px; letter-spacing: .06em; }
.sel-btn {
  width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; font-size: 14px;
  transition: all .13s ease;
}
.sel-btn:hover { border-color: var(--gold-dim); color: var(--text); }
.sel-btn.active { background: var(--gold); color: #1a1409; border-color: var(--gold); font-weight: 600; }
.sel-btn.filled::after { content: "•"; color: var(--gold); margin-left: 1px; font-size: 11px; vertical-align: super; }
.sel-btn.active.filled::after { color: #1a1409; }
.sel-btn.over { border-color: var(--gold-br); background: rgba(201,161,91,0.18); }

.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; border-radius: var(--radius); }
.scene-grid.over { outline: 1.5px dashed var(--gold); outline-offset: 6px; }
.layer-tile {
  position: relative; min-height: 104px; user-select: none; -webkit-user-select: none;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel), var(--bg-2)); cursor: pointer;
  padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between;
  transition: all .13s ease; overflow: hidden;
}
.layer-tile:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.layer-tile.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.layer-tile.over { border-color: var(--gold-br); background: rgba(201,161,91,0.12); }
.layer-tile.empty .lt-name { color: var(--muted); font-style: italic; }
.lt-head { display: flex; justify-content: space-between; align-items: center; }
.lt-layer { font-size: 11px; color: var(--gold-dim); letter-spacing: .08em; }
.lt-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .13s ease; }
.layer-tile:hover .lt-actions { opacity: 1; }
.lt-name { font-size: 13px; color: var(--text); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lt-meta { font-size: 10px; color: var(--muted); }

/* ---------- editor (waveform + trim / fades) ---------- */
.editor { margin-bottom: 16px; }
.wave {
  width: 100%; height: 130px; display: block; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line-soft); cursor: pointer; touch-action: none;
}
.edit-info { font-size: 11px; color: var(--muted); margin: 8px 2px; font-variant-numeric: tabular-nums; }
.edit-warn { color: var(--danger); display: block; margin-top: 3px; }
.edit-info b { color: var(--gold-br); font-weight: 500; }
.edit-tools { display: flex; flex-direction: column; gap: 9px; }
.edit-row { display: flex; align-items: center; gap: 10px; }
.edit-row label { color: var(--muted); font-size: 12px; width: 62px; }
.edit-row input[type=range] { flex: 1; accent-color: var(--gold); }
.edit-row span { color: var(--gold-dim); font-size: 11px; width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.chk-inline { display: flex; align-items: center; gap: 6px; width: auto !important; color: var(--text) !important; cursor: pointer; }
/* dB stepper (custom arrows, no native spinner) */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-soft);
  border-radius: 6px; overflow: hidden; background: var(--bg); }
.stepper:focus-within { border-color: var(--gold-dim); }
.db-input { width: 44px; background: transparent; border: none; color: var(--text);
  padding: 4px 4px 4px 8px; font: inherit; font-size: 12px; text-align: right; -moz-appearance: textfield; }
.db-input:focus { outline: none; }
.db-input::-webkit-outer-spin-button, .db-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btns { display: flex; flex-direction: column; border-left: 1px solid var(--line-soft); }
.stepper-btn { border: none; background: var(--panel-2); color: var(--muted); cursor: pointer;
  font-size: 7px; line-height: 1; padding: 0 7px; flex: 1; display: grid; place-items: center; transition: all .1s ease; }
.stepper-btn:hover { background: var(--gold); color: #1a1409; }
.stepper-btn + .stepper-btn { border-top: 1px solid var(--line-soft); }
.db-unit { color: var(--muted) !important; font-size: 11px; width: auto !important; text-align: left !important; }
.edit-btns { display: flex; gap: 6px; margin-top: 2px; }

/* ---------- themed range sliders ---------- */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--line-soft); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -6px;
  width: 13px; height: 13px; border-radius: 50%; background: var(--gold); border: 1px solid var(--bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5); transition: background .12s ease; }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { background: var(--gold-br); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line-soft); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--gold-dim); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--gold); border: 1px solid var(--bg); }
input[type="range"]:hover::-moz-range-thumb { background: var(--gold-br); }

/* ---------- themed checkboxes ---------- */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; flex: 0 0 auto;
  border-radius: 4px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer;
  position: relative; margin: 0; transition: all .12s ease; }
input[type="checkbox"]:hover { border-color: var(--gold-dim); }
input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid #1a1409; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.edit-btns .btn { flex: 1; }
.edit-hint { font-size: 10px; color: var(--muted); line-height: 1.4; margin: 2px 0 0; }

/* ---------- inspector ---------- */
.inspector { border-left: 1px solid var(--line-soft); padding: 18px; overflow-y: auto; background: var(--bg-2); }
.empty-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 40px; }
.file-row {
  position: relative;
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line-soft); cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.file-row:hover { border-color: var(--gold-dim); }
.file-row.playing { border-color: var(--gold); }
.file-row.reorder-over { border-color: var(--gold-br); box-shadow: inset 0 2px 0 var(--gold-br); }
/* thin insertion line floating in the gap between rows (not the block outline) */
.file-row.insert-before::before,
.file-row.insert-after::after {
  content: ""; position: absolute; left: 2px; right: 2px; height: 2px;
  background: var(--gold-br); border-radius: 1px; pointer-events: none;
}
.file-row.insert-before::before { top: -4px; }
.file-row.insert-after::after { bottom: -4px; }
.file-row .play { color: var(--gold); font-size: 12px; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--panel-2);
  border: 1px solid var(--line-soft); color: var(--gold-dim); font-size: 9px; margin-right: 4px; }
.badge.ok { color: var(--ok); border-color: rgba(139,168,106,.4); }

/* ---- stacked library slot ---- */
.slot-stack-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 11px; color: var(--gold-dim); margin: 2px 2px 8px; letter-spacing: .02em;
}
.slot-stack-warn { color: var(--danger); }
.file-row.ignored { opacity: .55; }
.file-row.ignored:hover { opacity: .8; }
.ignored-tag { color: var(--danger); font-size: 9px; margin-left: 6px; letter-spacing: .02em; }
/* AIFF: managed but not previewable/editable in the browser — shown greyed */
.unsupported { opacity: .5; }
.unsupported:hover { opacity: .72; }
.file-row.unsupported .file-name::after, .stage-item.unsupported .nm::after { content: " · aif"; color: var(--gold-dim); font-size: 9px; }

/* ---- scene sub-tabs + preset editor ---- */
.scene-subtabs { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: -6px; }
.scene-clear {
  margin-left: auto; align-self: center; background: none; border: 1px solid var(--line-soft); border-radius: 7px;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 4px 10px; transition: all .13s ease;
}
.scene-clear:hover { border-color: var(--danger); color: #f0c5bd; }
.scene-subtab {
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 13px; padding: 6px 12px 8px; transition: all .13s ease;
}
.scene-subtab:hover { color: var(--text); }
.scene-subtab.active { color: var(--gold-br); border-bottom-color: var(--gold); }
.scene-subtab.has-preset::after { content: "◆"; color: var(--gold-dim); margin-left: 6px; font-size: 9px; vertical-align: middle; }

.preset-panel { max-width: 760px; }
.preset-loading { color: var(--muted); font-size: 13px; }
.preset-head { margin-bottom: 8px; }
.preset-loadhint { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 0 0 14px; }
.preset-loadhint b { color: var(--gold-dim); font-weight: 600; }
.preset-status { font-size: 12px; color: var(--muted); }
.preset-status.good { color: var(--gold-dim); }
.preset-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.preset-group {
  grid-column: 1 / -1; color: var(--gold-dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  margin-top: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft);
}
.preset-group:first-child { margin-top: 0; }
.preset-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preset-field--full { grid-column: 1 / -1; }
.preset-field--full .pf-control { flex: 1; }
.preset-field--full .pf-input { flex: 1; min-width: 0; }
.pf-label { color: var(--muted); font-size: 12px; }
.pf-control { display: flex; align-items: center; gap: 6px; }
.pf-unit { color: var(--gold-dim); font-size: 11px; }
.pf-input {
  min-width: 140px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 7px;
  color: var(--text); font: inherit; font-size: 13px; padding: 5px 8px;
}
.pf-input:focus { outline: none; border-color: var(--gold-dim); }
select.pf-input { cursor: pointer; }
input.pf-input[type=number] { min-width: 100px; }
.preset-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; }
.preset-hint { color: var(--muted); font-size: 11px; flex: 1; }

.name-edit { display: flex; gap: 6px; margin-top: 8px; }
.name-edit input { flex: 1; background: var(--bg); border: 1px solid var(--line-soft); color: var(--text);
  border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 12px; }
.name-edit input:focus { outline: none; border-color: var(--gold-dim); }

/* ---------- player ---------- */
.player {
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  border-top: 1px solid var(--line); background: var(--bg-2);
}
.play-btn { width: 40px; height: 40px; border-radius: 50%; padding: 0; font-size: 14px;
  border-color: var(--gold-dim); color: var(--gold-br); }
.play-btn:hover:not(:disabled) { background: var(--gold); color: #1a1409; }
.pl-meta { flex: 1; min-width: 0; }
.pl-name { font-size: 13px; color: var(--text); display: block; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-track { height: 4px; background: var(--panel-2); border-radius: 3px; cursor: pointer; overflow: hidden; }
.pl-progress { height: 100%; width: 0; background: var(--gold); }
.pl-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--gold-dim); color: var(--text);
  padding: 11px 20px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow);
  z-index: 50; transition: opacity .25s ease;
}
.toast.err { border-color: var(--danger); color: #f0c5bd; }
.toast-undo {
  margin-left: 14px; background: transparent; border: 1px solid var(--gold-dim);
  color: var(--gold-br); border-radius: 6px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px;
}
.toast-undo:hover { background: var(--gold); color: #1a1409; border-color: var(--gold); }

/* whole reserve panel as a drop target */
.staging.drop-active { box-shadow: inset 0 0 0 2px var(--gold-dim); }
.staging.drop-active .staging-drop { border-color: var(--gold); background: rgba(201,161,91,0.08); color: var(--gold-br); }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2c261c; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; }
  .staging, .inspector { border: none; border-bottom: 1px solid var(--line-soft); }
}

/* ---------- about / support (? in the top bar → dropdown) ---------- */
.support-q {
  width: 30px; padding: 4px 0; text-align: center;
  color: var(--gold-br); border-color: var(--gold-dim); font-weight: 500;
}
.support-q:hover:not(:disabled) { background: var(--gold); color: #1a1409; border-color: var(--gold); }
.support-card {
  position: fixed; top: 56px; right: 16px; z-index: 60; width: 250px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 13px 14px; font-size: 12px; line-height: 1.55; color: var(--text);
}
.support-card p { margin: 0 0 11px; }
.support-card a { color: var(--gold-br); }
.support-links { display: flex; flex-wrap: wrap; gap: 7px; }
.support-btn {
  text-decoration: none; font-size: 11.5px; padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--gold-dim); color: var(--text); background: var(--bg-2); transition: all .13s ease;
}
.support-btn:hover { background: var(--gold); color: #1a1409; border-color: var(--gold); }
