:root {
  --bg: #eef0f3;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --line: #dde1e7;
  --text: #1b2230;
  --muted: #687385;
  --accent: #ff6a1a;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e8;
  --top: #141922;
  --top-text: #e9edf3;
  --stage: #2a313d;
  --sheet: #f3e7d3;
  --danger: #d33a2c;
  --ok: #188a4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1319; --panel: #171c24; --panel-2: #1d232d; --line: #2b3340; --text: #e6eaf0; --muted: #9aa4b3;
    --accent-soft: #3a2416; --top: #0b0e13; --stage: #0f1319; --sheet: #d9ccb6; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1319; --panel: #171c24; --panel-2: #1d232d; --line: #2b3340; --text: #e6eaf0; --muted: #9aa4b3;
  --accent-soft: #3a2416; --top: #0b0e13; --stage: #0f1319; --sheet: #d9ccb6; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.top { height: 54px; flex: none; background: var(--top); color: var(--top-text); display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.brand .logo { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); position: relative; }
.brand .logo::after { content: ""; position: absolute; inset: 5px; background:
  linear-gradient(#fff 0 0) 0 0/6px 6px no-repeat, linear-gradient(#fff 0 0) 8px 0/6px 4px no-repeat,
  linear-gradient(#fff 0 0) 8px 6px/6px 8px no-repeat, linear-gradient(#fff 0 0) 0 8px/6px 6px no-repeat; }
.brand .sub { color: #9aa4b3; font-weight: 400; }
.project-name { flex: 1; min-width: 80px; max-width: 360px; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; color: var(--top-text); }
.project-name:hover, .project-name:focus { border-color: #3a4352; outline: none; background: #1d2430; }
.top-actions { margin-left: auto; display: flex; gap: 4px; }
.ghost { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px 10px; color: var(--top-text); }
.ghost:hover { background: #222a36; }
.ghost.dark { color: #dfe4ec; border-color: #46505f; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px 1fr; }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.panel.right { border-right: 0; border-left: 1px solid var(--line); padding: 14px 16px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 10px; }
.panel h4 { margin: 18px 0 8px; font-size: 13px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tab { flex: 1; background: none; border: 0; padding: 12px 6px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; line-height: 18px; }
.tabpane { display: none; padding: 14px 16px 24px; }
.tabpane.active { display: block; }

.drop { display: flex; gap: 12px; align-items: center; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); cursor: pointer; transition: border-color .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 12px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row.tight .field { margin: 0; }
.grow { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.field input, .field select, .sheet input { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px; color: var(--text); width: 100%; min-width: 0; }
.field input:focus, .field select:focus, .sheet input:focus, .part input:focus, .part select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.primary, .secondary { border-radius: 8px; padding: 8px 14px; font-weight: 600; border: 1px solid transparent; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.secondary { background: var(--panel); border-color: var(--line); color: var(--text); }
.secondary:hover { border-color: var(--accent); }
.full { width: 100%; margin-top: 10px; }
.link { background: none; border: 0; color: var(--accent); padding: 0 4px; font-weight: 600; }
.link.danger { color: var(--danger); }
.chip { border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 3px 9px; font-size: 12px; }
.chip:hover { border-color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }

.addrect { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 12px; }
.addrect summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.list-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; font-size: 12px; }
.parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.part { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.part.missing { border-color: var(--danger); }
.part svg { width: 52px; height: 52px; background: var(--panel-2); border-radius: 7px; }
.part .meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.part .name { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 2px 4px; font-weight: 600; width: 100%; }
.part .name:hover { border-color: var(--line); }
.part .dims { font-size: 12px; color: var(--muted); padding-left: 4px; }
.part .ctl { display: flex; gap: 6px; align-items: center; }
.part .ctl input { width: 64px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--panel); }
.part .ctl select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: var(--panel); font-size: 12px; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 4px 6px; border-radius: 5px; font-size: 15px; }
.icon-btn:hover { color: var(--danger); background: var(--panel-2); }
.notes { margin-top: 10px; font-size: 12px; color: var(--muted); }
.notes .warn { color: #a3610b; }

.sheets { display: flex; flex-direction: column; gap: 8px; }
.sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; background: var(--panel); box-shadow: var(--shadow); }
.sheet .full-row { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.sheet label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.sheet .tag { font-size: 11px; border-radius: 4px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sheet .order { display: flex; gap: 2px; margin-left: auto; }

.stage { display: flex; flex-direction: column; min-width: 0; background: var(--stage); }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; color: #dfe4ec; flex-wrap: wrap; }
.nest-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view-controls { display: flex; gap: 10px; align-items: center; }
#btnNest { padding: 9px 18px; font-size: 15px; }
.ico { font-size: 11px; margin-right: 4px; }
.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #c3cad6; }
.progress .bar { width: 160px; height: 6px; border-radius: 3px; background: #3b4452; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.canvas-wrap { flex: 1; position: relative; min-height: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#view:active { cursor: grabbing; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #c9d0da; padding: 24px; pointer-events: none; }
.empty h2 { color: #fff; margin: 0 0 10px; }
.empty p { line-height: 1.7; max-width: 480px; }
.empty button { pointer-events: auto; margin-top: 8px; }
.tooltip { position: absolute; pointer-events: none; background: rgba(10, 13, 18, .92); color: #fff; padding: 6px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.stale { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: #3a2c12; color: #ffd28a; border: 1px solid #6b5220; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
.sheet-strip { flex: none; display: flex; gap: 10px; padding: 10px 14px 14px; overflow-x: auto; }
.sheet-strip:empty { display: none; }
.thumb { flex: none; background: #353d4a; border: 2px solid transparent; border-radius: 8px; padding: 6px; color: #dfe4ec; font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.thumb.active { border-color: var(--accent); }
.thumb canvas { display: block; border-radius: 3px; }
.thumb .tl { display: flex; justify-content: space-between; gap: 8px; }
.thumb .rep { color: var(--accent); font-weight: 700; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.stats p { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.stat.wide { grid-column: 1 / -1; }
.stat.good { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.stat.good .v { color: var(--ok); }
.stat.bad { border-color: var(--danger); }
.stat.bad .v { color: var(--danger); }
.meter { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }

.export { display: flex; flex-direction: column; gap: 8px; }
.export-btn { text-align: left; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.export-btn span { font-size: 12px; color: var(--muted); }
.export-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.export-btn:disabled { opacity: .45; cursor: not-allowed; }
.export-btn[data-export="pdf"]:not(:disabled) { border-color: var(--accent); }
.legend { margin-top: 16px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.legend i { display: inline-block; width: 18px; height: 3px; margin-right: 8px; vertical-align: middle; border-radius: 2px; }

dialog { border: 0; border-radius: 14px; padding: 0; max-width: 560px; width: calc(100% - 32px); background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 13, 18, .55); }
dialog form { padding: 22px 24px; }
dialog h2 { margin: 0 0 6px; }
dialog h4 { margin: 16px 0 4px; }
dialog li { margin: 4px 0; line-height: 1.5; }
.dlg-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 760px) {
  body { height: auto; }
  .layout { display: flex; flex-direction: column; }
  .panel { border-right: 0; overflow: visible; }
  .stage { height: 70vh; }
  .top { gap: 8px; padding: 0 10px; }
  .brand .sub, .project-name { display: none; }
}

.tab-opts { border-left: 2px solid var(--line); padding-left: 10px; margin-top: 4px; }
.tab-opts.off { opacity: .45; pointer-events: none; }
.warn-text { color: #c77a0a; }
.edit-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.edit-bar .sel-name { font-size: 12px; color: #c3cad6; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.ghost.dark:disabled { opacity: .4; cursor: not-allowed; }
.ghost.dark.accent { border-color: var(--accent); color: #ffb48a; }
.toast { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); background: rgba(10, 13, 18, .92); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; pointer-events: none; }
.edit-hint { position: absolute; bottom: 10px; right: 12px; color: #8d97a6; font-size: 11px; pointer-events: none; }
@media (max-width: 760px) { .edit-hint { display: none; } }
dialog.wide { max-width: 760px; }
.adv-table-wrap { overflow-x: auto; margin-top: 10px; }
.adv-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.adv-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.adv-table td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adv-table tr.best td { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.adv-table tr.best td:first-child { font-weight: 700; }
.adv-table .tag-best { display: inline-block; margin-left: 6px; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--ok); color: #fff; font-weight: 700; vertical-align: middle; }
.adv-table .tag-est { color: var(--muted); font-size: 11px; }
.adv-table .pending { color: var(--muted); }
.adv-table button { padding: 4px 10px; font-size: 12px; }
.trace-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin-top: 10px; align-items: start; }
.trace-view { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; place-items: center; min-width: 200px; }
.trace-view canvas { display: block; max-width: 100%; height: auto; }
.trace-ctl input[type=range] { accent-color: var(--accent); width: 100%; }
.tr-h { font-size: 14px; color: var(--text); padding: 7px 0; }
.tr-info { font-weight: 600; margin: 12px 0 0; }
.dlg-actions { gap: 8px; }
@media (max-width: 760px) { .trace-grid { grid-template-columns: 1fr; } }

/* ---- simple layout ---- */
.step { padding: 14px 16px 16px; border-bottom: 1px solid var(--line); }
.step h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.step h3 .badge { margin-left: auto; }
.num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; letter-spacing: 0; }
.step .drop { padding: 10px 12px; }
.step .drop-icon { width: 32px; height: 32px; font-size: 17px; }
.step .list-head { margin: 10px 0 8px; }
.step .presets { margin: 10px 0 6px; }
.step .field input, .step .field select { font-size: 15px; padding: 8px 9px; }
.step .row.tight { margin-top: 8px; }
.step .row.tight:first-of-type { margin-top: 0; }
.more-sheets { margin-top: 10px; }
.more-sheets > summary, .step.more > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 4px 0; }
.step.more > summary { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.step.more[open] > summary { color: var(--text); }
.more-sheets[open] .sheets { margin-bottom: 4px; }
.step .link#btnAdvisor { padding: 2px 0; font-size: 13px; }

.seg { display: inline-flex; background: #1d232d; border: 1px solid #3a4352; border-radius: 8px; padding: 2px; }
.seg button { background: none; border: 0; color: #c3cad6; padding: 5px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.seg button.on { background: #3a4352; color: #fff; }
.stage-bar:not(:has(> :not([hidden]))) { display: none; }
.view-controls { margin-left: auto; }

.overview { position: absolute; inset: 0; overflow: auto; background: var(--stage); display: flex; flex-wrap: wrap; align-content: safe center; justify-content: safe center; gap: 14px; padding: 14px; }
.overview .thumb { background: transparent; padding: 0; border: 0; gap: 6px; align-items: flex-start; }
.overview .thumb canvas { box-shadow: 0 2px 10px rgba(0,0,0,.35); border-radius: 2px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s; }
.overview .thumb:hover canvas { outline-color: var(--accent); }
.overview .thumb .tl { width: 100%; font-size: 12px; color: #c3cad6; }

.action-bar { flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.pg { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; }
.pg:hover:not(:disabled) { border-color: var(--accent); }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.summary { flex: 1; min-width: 200px; font-size: 14px; }
.sum-text b { font-size: 15px; }
.sum-text .good { color: var(--ok); font-weight: 600; }
.sum-text .bad { color: var(--danger); font-weight: 600; }
.sum-text .link { padding: 0 0 0 6px; font-size: 13px; }
.action-bar .progress { color: var(--muted); }
.action-bar .progress .bar { background: var(--line); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.big { padding: 10px 18px; font-size: 15px; border-radius: 9px; font-weight: 700; }
.improve { background: #8ef0b0; color: #0f3d22; border: 1px solid #5ccf88; }
.improve:hover:not(:disabled) { filter: brightness(1.05); }
.improve:disabled, .dark-btn:disabled, .actions .secondary:disabled { opacity: .45; cursor: not-allowed; }
.dark-btn { background: var(--text); color: var(--panel); border: 1px solid transparent; }
.dark-btn:hover:not(:disabled) { filter: brightness(1.15); }
#exportDlg .export-btn { color: var(--text); }
#statsDlg .stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 12px 0 0; }
@media (max-width: 760px) {
  .action-bar { gap: 10px; }
  .actions { width: 100%; }
  .actions .big { flex: 1; padding: 10px 8px; }
}
.step .parts { max-height: 30vh; overflow-y: auto; padding: 2px; gap: 6px; }
.step .part { grid-template-columns: 40px 1fr; gap: 8px; padding: 6px; box-shadow: none; }
.step .part svg { width: 40px; height: 40px; }
.step .part .meta { gap: 3px; }

/* ---- day / night themes: top bar and stage follow the theme ---- */
:root {
  --top: #ffffff; --top-text: #1b2230; --top-muted: #687385; --top-hover: #eef0f3; --top-line: #dde1e7;
  --stage: #dfe3e9; --stage-text: #1b2230; --stage-muted: #5d6878; --stage-line: #c3c9d2;
  --stage-ctl: #ffffff; --stage-ctl-on: #1b2230; --stage-ctl-on-text: #ffffff; --thumb-bg: #ffffff;
  --thumb-shadow: 0 1px 6px rgba(16, 24, 40, .18);
  --stale-bg: #fff4dc; --stale-text: #7a5200; --stale-line: #ecc879;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --top: #0b0e13; --top-text: #e9edf3; --top-muted: #9aa4b3; --top-hover: #222a36; --top-line: #222a36;
    --stage: #0f1319; --stage-text: #dfe4ec; --stage-muted: #a9b2c0; --stage-line: #46505f;
    --stage-ctl: #1d232d; --stage-ctl-on: #3a4352; --stage-ctl-on-text: #ffffff; --thumb-bg: #353d4a;
    --thumb-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --stale-bg: #3a2c12; --stale-text: #ffd28a; --stale-line: #6b5220;
  }
}
:root[data-theme="dark"] {
  --top: #0b0e13; --top-text: #e9edf3; --top-muted: #9aa4b3; --top-hover: #222a36; --top-line: #222a36;
  --stage: #0f1319; --stage-text: #dfe4ec; --stage-muted: #a9b2c0; --stage-line: #46505f;
  --stage-ctl: #1d232d; --stage-ctl-on: #3a4352; --stage-ctl-on-text: #ffffff; --thumb-bg: #353d4a;
  --thumb-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --stale-bg: #3a2c12; --stale-text: #ffd28a; --stale-line: #6b5220;
}
.top { border-bottom: 1px solid var(--top-line); }
.brand .sub { color: var(--top-muted); }
.project-name:hover, .project-name:focus { border-color: var(--top-line); background: var(--top-hover); }
.ghost:hover { background: var(--top-hover); }
.ghost.dark { color: var(--stage-text); border-color: var(--stage-line); }
.ghost.dark:hover:not(:disabled) { background: var(--stage-ctl); }
.ghost.dark.accent { color: var(--accent); border-color: var(--accent); }
.stage-bar { color: var(--stage-text); }
.empty { color: var(--stage-muted); }
.empty h2 { color: var(--stage-text); }
.thumb { background: var(--thumb-bg); color: var(--stage-text); }
.edit-bar .sel-name, .edit-hint { color: var(--stage-muted); }
.seg { background: var(--stage-ctl); border-color: var(--stage-line); }
.seg button { color: var(--stage-muted); }
.seg button.on { background: var(--stage-ctl-on); color: var(--stage-ctl-on-text); }
.overview .thumb .tl { color: var(--stage-muted); }
.overview .thumb canvas { box-shadow: var(--thumb-shadow); }
.stale { background: var(--stale-bg); color: var(--stale-text); border-color: var(--stale-line); }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; border-color: var(--top-line) !important; }
.theme-btn .ti { font-size: 15px; line-height: 1; }

/* ---- copies and bulk quantities ---- */
.copies-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.copies-row input { width: 72px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--panel); color: var(--text); font-weight: 700; text-align: center; }
.bulk { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 8px; font-size: 12px; }
.bulk input { width: 58px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--panel); color: var(--text); text-align: center; }
.bulk .chip { color: var(--text); padding: 3px 8px; }
.file-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.file-head .fh-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-head .fh-meta { grid-column: 1; font-size: 11px; color: var(--muted); }
.file-head .fh-copies { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.file-head .fh-copies input { width: 64px; border: 1px solid var(--accent); border-radius: 7px; padding: 6px; background: var(--panel); color: var(--text); font-weight: 700; text-align: center; font-size: 14px; }
.part.in-file { margin-left: 10px; }
