/* Studio Send and Return — shared theme (Midnight & coral) for the client folder and the Studio. */
:root {
  --bg: #0E1626; --panel: #16213A; --panel2: #1B2844; --line: #26324D; --text: #EEF1F6; --dim: #8A96AD;
  --accent: #F07A6A; --accent-dim: #6E3B44; --ok: #5FD3A6; --err: #FF5C7A;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 34px 20px 60px; }
.brand { letter-spacing: .22em; text-transform: uppercase; font-size: 11px; color: var(--dim); }
.brand b { color: var(--text); font-weight: 600; }
h1 { font-size: 26px; font-weight: 600; margin: 22px 0 2px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3.sub { font-size: 12px; color: var(--dim); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin: 22px 0 4px; }
.artist { color: var(--dim); margin: 0 0 6px; }
.note { font-size: 12.5px; color: var(--dim); margin: 4px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--dim); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.error, .err { color: var(--err); font-size: 13.5px; }
.error { min-height: 1.2em; margin-top: 10px; }
.okc { color: var(--ok); }
.hidden { display: none !important; }
button, .btn { background: var(--accent); color: #0E1626; border: 0; border-radius: 6px; padding: 9px 15px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
button.ghost { background: none; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover { border-color: var(--dim); }
button.danger { background: none; color: var(--err); border: 1px solid #5C2738; font-weight: 500; }
button.small { padding: 4px 9px; font-size: 12.5px; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input.bad { border-color: var(--err); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px; text-align: center; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--accent); background: #22233A; }
.drop .big { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
footer { margin-top: 30px; font-size: 12px; color: var(--dim); text-align: center; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 10; }

/* ---------- folders inside a client folder (public/lib/filetree.js) ---------- */
tr.ft-dir td { padding-top: 6px; padding-bottom: 6px; }
.ft-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ft-line .ft-name { font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-line .ft-name:hover { color: var(--accent); }
/* a folder's row: click anywhere to open / close; ⋯ (or right-click) for its menu */
tr.ft-dir { cursor: pointer; }
tr.ft-dir:hover td { background: color-mix(in srgb, var(--panel2) 75%, transparent); }
tr.ft-dir:focus { outline: none; }
tr.ft-dir:focus-visible td { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
tr.ft-dir input.ft-sel { cursor: default; }
.ft-more { background: none; border: 1px solid transparent; color: var(--dim); width: 30px; height: 26px; padding: 0; border-radius: 6px; flex: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; }
.ft-more svg { fill: currentColor; }
.ft-line .ft-more { margin-left: auto; }
.ft-line .ft-dl ~ .ft-more, .ft-line .ft-x ~ .ft-more { margin-left: 4px; }
tr.ft-dir:hover .ft-more, tr.ft-dir:focus-within .ft-more, .ft-more:focus-visible { opacity: 1; border-color: var(--line); color: var(--text); }
.ft-menu { position: fixed; z-index: 1000; min-width: 210px; max-width: 290px; background: var(--panel2); border: 1px solid #33405F; border-radius: 10px; padding: 5px; box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 13.5px; }
.ft-mh { color: var(--dim); font-size: 11.5px; padding: 4px 10px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-mi { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.ft-mi:hover:not([disabled]), .ft-mi:focus-visible { background: var(--accent); color: #1A0D08; outline: none; }
.ft-mi:hover:not([disabled]) .ft-mk, .ft-mi:focus-visible .ft-mk { color: #1A0D08; }
.ft-mi[disabled] { color: #5D6A82; cursor: default; }
.ft-mk { color: var(--dim); font-size: 11.5px; }
.ft-msep { height: 1px; background: var(--line); margin: 4px 6px; }
.ft-mform { padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 8px; }
.ft-mform select, .ft-mform input { width: 100%; padding: 7px 9px; }
.ft-mrow { display: flex; justify-content: flex-end; gap: 6px; }
.ft-mnote { color: var(--dim); font-size: 12.5px; padding: 2px 4px; }
.ft-merr { color: var(--err); font-size: 12px; }
.ft-merr:empty { display: none; }
.ft-ren { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ft-rin { padding: 3px 8px !important; border: 1.5px solid var(--accent) !important; font-weight: 600; min-width: 200px; max-width: 100%; }
.ft-ren.bad .ft-rin { border-color: var(--err) !important; }
.ft-rtip { font-size: 12px; color: var(--dim); }
.ft-rerr { font-size: 12px; color: var(--err); flex-basis: 100%; }
.ft-rerr:empty { display: none; }
.ft-line .ft-meta { font-size: 12px; color: var(--dim); white-space: nowrap; margin-left: 4px; }
.ft-ico { color: var(--dim); flex: none; }
.ft-tw { background: none; border: 0; color: var(--text, inherit); opacity: .75; padding: 0; width: 28px; height: 28px; margin: -3px 2px -3px -4px; border-radius: 6px; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.ft-tw:hover, .ft-tw:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.ft-tw svg { width: 18px; height: 18px; transition: transform .15s; }
.ft-tw[aria-expanded="true"] svg { transform: rotate(90deg); }
@media (max-width: 1100px) { .ft-tw { width: 34px; height: 34px; } .ft-tw svg { width: 20px; height: 20px; } }
.ft-x { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--dim); font-size: 11.5px; padding: 2px 8px; border-radius: 6px; }
.ft-sel { width: 15px; height: 15px; margin: 0 4px 0 0; flex: none; vertical-align: middle; }
.ft-file { display: inline-flex; align-items: center; gap: 2px; min-width: 0; word-break: break-word; }
tr.ft-target td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
tr.ft-over td { outline: 2px dashed var(--accent); outline-offset: -2px; }
tr[draggable="true"] { cursor: grab; }
.ft-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--accent-dim); border-radius: 8px; font-size: 13px; }
.ft-bar select, .ft-into select { max-width: 260px; font-size: 13px; padding: 4px 6px; }
.ft-into { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); margin: 8px 0 0; flex-wrap: wrap; }
.ft-new { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.ft-new input { flex: 1; min-width: 160px; }
.ft-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.ft-box { width: min(480px, 100%); margin: 0; }
.ft-box h2 { margin: 2px 0 4px; font-size: 17px; }
.ft-kick { color: var(--accent); font-size: 12px; }
.ft-lab { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); margin-top: 12px; }
.ft-in { font-size: 15px; padding: 9px 11px; }
.ft-prev { margin-top: 10px; font: 12px/1.6 var(--mono); color: var(--dim); background: var(--bg); border-radius: 7px; padding: 8px 10px; word-break: break-all; }
.ft-prev b { color: var(--text); font-weight: 500; }
.ft-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ---------- which way files go: green = studio → client, coral (accent) = client → studio ---------- */
:root { --lane-dl: var(--ok); --lane-up: var(--accent); }
.lane-dl { border-top: 3px solid var(--lane-dl) !important; }
.lane-up { border-top: 3px solid var(--lane-up) !important; }
.lane-dl .lane-h { color: var(--lane-dl); }
.lane-up .lane-h { color: var(--lane-up); }
.lane-h { display: inline-flex; align-items: center; gap: 7px; }
.lane-h svg { flex: none; }

/* ---------- Download all / a folder's Download → saved into a folder (public/lib/savefolder.js) ---------- */
.sf-panel { position: fixed; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); z-index: 40; margin: 0; }
.sf-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sf-top b { margin-right: auto; }
.sf-file { margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-sum { margin: 6px 0 0; }
.ft-dl { background: none; border: 1px solid var(--line); color: var(--text); font-size: 11.5px; padding: 2px 8px; border-radius: 6px; }
.ft-line .ft-dl { margin-left: auto; }
.sf-msg { margin: 6px 0; padding: 8px 10px; border: 1px solid var(--accent-dim); border-radius: 8px; font-size: 13px; }

/* versions: v2 on the newest (filled, the lane's color), v1 on earlier ones (outlined) */
.vp { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 9px; color: #0E1626; background: var(--accent); vertical-align: 1px; }
.lane-dl .vp { background: var(--lane-dl, var(--ok)); }
.lane-up .vp { background: var(--lane-up, var(--accent)); }
.vp.old { background: none !important; color: var(--dim); border: 1px solid var(--line); font-weight: 600; }
.ft-vers { background: none; border: 0; color: var(--accent); font-size: 12px; padding: 0 0 0 8px; cursor: pointer; font-weight: 500; }
.lane-dl .ft-vers { color: var(--lane-dl, var(--ok)); }
.lane-up .ft-vers { color: var(--lane-up, var(--accent)); }
tr.ft-vrow td { opacity: .85; }
.ft-where { margin-left: 8px; font-size: 12px; color: var(--dim); }
.vsug { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel2, #1B2844); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 8px 11px; margin: 8px 0; font-size: 13px; }
.vsug .spacer { flex: 1; }
.ft-file { flex-wrap: wrap; row-gap: 3px; }
.ft-file > span:not(.vp):not(.ft-where) { flex: 1 1 0; min-width: 5em; overflow-wrap: anywhere; word-break: normal; }
.ft-file > .ft-sel { flex: none; }
.vp, .ft-vers, .ft-where { white-space: nowrap; flex: none; }

/* tablets and phones: folder names wrap instead of being cut short */
@media (max-width: 1100px) {
  .ft-line { flex-wrap: wrap; row-gap: 2px; }
  .ft-more { opacity: 1; border-color: var(--line); color: var(--text); width: 36px; height: 32px; }
  .ft-mi { padding: 10px 12px; }
  .ft-rtip { display: none; }
  .ft-line .ft-name { white-space: normal; overflow-wrap: anywhere; overflow: visible; min-width: 0; flex: 0 1 auto; }
}
@media (max-width: 1100px) { .ft-file .ft-vers { flex-basis: 100%; padding-left: 0; text-align: left; } }
