/* DNA Sequencer – lab workbench theme (dark by default, light with data-theme="light"). */
:root {
  --bg: #16181d; --bg2: #1d2027; --bg3: #242830; --bg4: #2d323c; --bg5: #383e4a; --panel: #1d2027;
  --line: #0e1013; --line2: #343a45; --text: #e6e8ec; --text2: #aab0bb; --text3: #7b8290;
  --accent: #5ad1b5; --accent2: #86e4cc; --accent-dim: rgba(90, 209, 181, .18); --sel: rgba(90, 209, 181, .28); --sel2: rgba(224, 178, 63, .35);
  --blue: #4f8fd6; --red: #e0534f; --green: #3fbf5a; --amber: #e0b23f; --purple: #b07fd8; --warn: #f0a24b;
  --radius: 5px; --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; --mono: Consolas, "Cascadia Mono", "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
  --shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] {
  --bg: #f3f4f6; --bg2: #ffffff; --bg3: #f7f8fa; --bg4: #e9ebef; --bg5: #dde0e6; --panel: #ffffff;
  --line: #cfd3da; --line2: #e2e5ea; --text: #1d2026; --text2: #4b5260; --text3: #7b8290;
  --accent: #0f9d84; --accent2: #0b7f6a; --accent-dim: rgba(15, 157, 132, .14); --sel: rgba(15, 157, 132, .22); --sel2: rgba(200, 140, 20, .3);
  --blue: #2f6fc0; --red: #c83c38; --green: #2a9a44; --amber: #b8860b; --purple: #8a52b5; --warn: #d2822a;
  --shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
#app { display: flex; flex-direction: column; height: 100%; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 5px; border: 2px solid var(--bg2); } ::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- top bar */
#topbar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
#backlink { text-decoration: none; margin-right: 8px; font-size: 12px; }
#logo { display: flex; align-items: center; gap: 7px; margin-right: 10px; color: var(--accent2); white-space: nowrap; }
#logo b { font-weight: 600; letter-spacing: .2px; }
#menubar { display: flex; gap: 1px; }
.menu-btn { background: none; border: 0; color: var(--text); padding: 5px 9px; border-radius: var(--radius); cursor: default; }
.menu-btn:hover, .menu-btn.open { background: var(--bg4); }
#topcenter { flex: 1; min-width: 0; text-align: center; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top-title b { color: var(--text); }
#topright { display: flex; align-items: center; gap: 6px; flex: none; }
#quickfind { width: 190px; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; color: var(--text); outline: none; }
#quickfind:focus { border-color: var(--accent); }
#find-count { color: var(--text3); font-size: 11px; min-width: 40px; }
#version { color: var(--text3); font-size: 11px; margin-left: 4px; }

/* ---------------------------------------------------------------- generic controls */
.tbtn { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 9px; color: var(--text2); display: inline-flex; align-items: center; gap: 5px; cursor: default; white-space: nowrap; line-height: 1.2; }
.tbtn:hover { background: var(--bg4); color: var(--text); }
.tbtn.on { background: var(--accent-dim); color: var(--accent2); border-color: var(--accent); }
.tbtn.primary { background: var(--accent); color: #0e1b18; border-color: var(--accent); font-weight: 600; }
.tbtn.primary:hover { background: var(--accent2); }
.tbtn.danger:hover { background: var(--red); color: #fff; }
.tbtn:disabled { opacity: .45; pointer-events: none; }
.tbtn.small { padding: 2px 6px; font-size: 11px; }
.tbtn svg { width: 14px; height: 14px; }
.seg { display: inline-flex; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { background: none; border: 0; border-right: 1px solid var(--line); padding: 4px 9px; color: var(--text2); cursor: default; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--bg4); color: var(--text); }
.seg button.on { background: var(--accent-dim); color: var(--accent2); }
select.sel, input.inp, textarea.inp { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: 4px 7px; outline: none; }
select.sel:focus, input.inp:focus, textarea.inp:focus { border-color: var(--accent); }
input.inp.num { width: 72px; text-align: right; }
input.inp.short { width: 110px; }
textarea.inp { font-family: var(--mono); resize: vertical; min-height: 60px; width: 100%; }
label.chk { display: inline-flex; align-items: center; gap: 5px; color: var(--text2); white-space: nowrap; }
label.chk input { accent-color: var(--accent); }
.lbl { color: var(--text3); font-size: 11.5px; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 10px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
.toolbar .sep { width: 1px; height: 18px; background: var(--line2); margin: 0 2px; }
.toolbar .grow { flex: 1; }
.muted { color: var(--text3); }
.small { font-size: 11px; }
.mono { font-family: var(--mono); }
.warn { color: var(--warn); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.note { color: var(--text2); font-size: 12px; padding: 6px 0; }
.kbd { font: 11px var(--mono); background: var(--bg4); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
h3.sec { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); font-weight: 600; }
h3.sec:first-child { margin-top: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.card { background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.card .k { color: var(--text3); font-size: 11px; }
.card .v { font-size: 17px; font-weight: 600; margin-top: 2px; }
.card .v small { font-size: 11px; color: var(--text3); font-weight: 400; margin-left: 4px; }
.card .m { color: var(--text3); font-size: 10.5px; margin-top: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
pre.block { font: 12px/1.45 var(--mono); background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; overflow: auto; margin: 0; white-space: pre; user-select: text; }
.seqbox { font: 12.5px/1.6 var(--mono); word-break: break-all; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; user-select: text; max-height: 240px; overflow: auto; }

/* ---------------------------------------------------------------- dropdown menus */
.dropdown { position: fixed; z-index: 400; min-width: 210px; max-height: 80vh; overflow: auto; background: var(--bg3); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); padding: 4px; }
.dropdown .item { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: 4px; white-space: nowrap; color: var(--text); position: relative; cursor: default; }
.dropdown .item:hover { background: var(--blue); color: #fff; }
.dropdown .item.disabled { color: var(--text3); pointer-events: none; }
.dropdown .item .key { margin-left: auto; color: var(--text3); font-size: 11px; padding-left: 24px; }
.dropdown .item:hover .key { color: rgba(255, 255, 255, .8); }
.dropdown .item .check { width: 12px; display: inline-block; color: var(--accent2); }
.dropdown .sep { height: 1px; background: var(--line2); margin: 4px 6px; }
.dropdown .title { padding: 4px 8px 2px; color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }

/* ---------------------------------------------------------------- layout */
#main { display: flex; flex: 1; min-height: 0; }
#sidebar { width: 250px; flex: none; display: flex; flex-direction: column; background: var(--bg2); border-right: 1px solid var(--line); min-width: 0; }
#inspector { width: 290px; flex: none; display: flex; flex-direction: column; background: var(--bg2); border-left: 1px solid var(--line); }
#app.noinspector #inspector, #app.noinspector #right-split { display: none; }
#app.nosidebar #sidebar, #app.nosidebar #left-split { display: none; }
.hsplit { width: 4px; cursor: col-resize; background: transparent; flex: none; }
.hsplit:hover { background: var(--accent-dim); }
.vsplit { height: 4px; cursor: row-resize; flex: none; }
.vsplit:hover { background: var(--accent-dim); }
.panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#seqpanel { flex: 3; } #primerpanel { flex: 1.2; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); font-weight: 600; border-bottom: 1px solid var(--line); flex: none; }
.panel-tools { display: flex; gap: 3px; }
.panel-tools .tbtn { padding: 1px 6px; font-size: 12px; }
.panel-body { flex: 1; overflow: auto; min-height: 0; }
#center { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#tabs { display: flex; gap: 1px; background: var(--bg2); border-bottom: 1px solid var(--line); padding: 4px 6px 0; flex: none; overflow-x: auto; }
#tabs .tab { padding: 6px 9px; border-radius: 6px 6px 0 0; color: var(--text2); white-space: nowrap; cursor: default; border: 1px solid transparent; border-bottom: 0; font-size: 12.5px; }
#tabs .tab:hover { background: var(--bg4); color: var(--text); }
#tabs .tab.on { background: var(--bg); color: var(--accent2); border-color: var(--line); }
#tabs .tab .badge { font-size: 10px; background: var(--bg5); border-radius: 8px; padding: 0 5px; margin-left: 5px; color: var(--text2); }
#tabbody { flex: 1; min-height: 0; position: relative; }
.tabpane { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.tabpane .body { flex: 1; overflow: auto; padding: 12px 14px; min-height: 0; }
.tabpane .body.nopad { padding: 0; }
.empty { color: var(--text3); padding: 40px; text-align: center; }
.empty b { color: var(--text2); display: block; margin-bottom: 6px; font-size: 15px; }

/* ---------------------------------------------------------------- sequence list */
.seqitem { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-bottom: 1px solid var(--line2); cursor: default; }
.seqitem:hover { background: var(--bg3); }
.seqitem.on { background: var(--accent-dim); }
.seqitem .ico { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; color: #0e1b18; }
.seqitem .ico.dna { background: var(--accent); } .seqitem .ico.rna { background: var(--amber); } .seqitem .ico.protein { background: var(--purple); color: #fff; } .seqitem .ico.read { background: var(--blue); color: #fff; }
.seqitem .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seqitem .nm small { color: var(--text3); display: block; font-size: 10.5px; }
.seqitem .ln { color: var(--text3); font-size: 11px; white-space: nowrap; }
.seqitem input { width: 100%; background: var(--bg3); border: 1px solid var(--accent); border-radius: 3px; padding: 1px 4px; }
.primeritem { padding: 5px 10px; border-bottom: 1px solid var(--line2); cursor: default; }
.primeritem:hover { background: var(--bg3); }
.primeritem .nm { display: flex; justify-content: space-between; gap: 6px; }
.primeritem .nm span:last-child { color: var(--text3); font-size: 11px; }
.primeritem .sq { font: 11px var(--mono); color: var(--text2); word-break: break-all; }

/* ---------------------------------------------------------------- inspector */
#inspector-body { padding: 8px 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; margin-bottom: 8px; }
.kv .k { color: var(--text3); white-space: nowrap; }
.kv .v { color: var(--text); word-break: break-word; user-select: text; }
.kv .v.mono { font-family: var(--mono); font-size: 11.5px; }
.insp-title { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.insp-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------- tables */
table.tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
table.tbl th, table.tbl td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.tbl th { color: var(--text3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; position: sticky; top: 0; background: var(--bg); cursor: default; user-select: none; white-space: nowrap; }
table.tbl th.sortable:hover { color: var(--text); }
table.tbl th .arrow { color: var(--accent); font-size: 10px; margin-left: 3px; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.mono { font-family: var(--mono); font-size: 11.5px; user-select: text; }
table.tbl tr.row:hover td { background: var(--bg3); }
table.tbl tr.row.on td { background: var(--accent-dim); }
table.tbl tr.row { cursor: default; }
.tblwrap { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.tblwrap.tall { max-height: 70vh; }
.tblhead { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 5px; gap: 8px; }
.tblhead .t { font-weight: 600; }
.pill { display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 10.5px; background: var(--bg4); color: var(--text2); white-space: nowrap; }
.pill.ok { background: rgba(63, 191, 90, .2); color: var(--green); } .pill.bad { background: rgba(224, 83, 79, .2); color: var(--red); } .pill.warn { background: rgba(240, 162, 75, .2); color: var(--warn); } .pill.acc { background: var(--accent-dim); color: var(--accent2); }

/* ---------------------------------------------------------------- sequence viewer */
#seqviewer { font-family: var(--mono); position: relative; outline: none; }
#seqviewer .scroller { position: absolute; inset: 0; overflow: auto; }
#seqviewer .spacer { position: relative; }
.vrow { position: absolute; left: 0; right: 0; padding-left: 86px; white-space: nowrap; }
.vrow .pos { position: absolute; left: 8px; width: 70px; text-align: right; color: var(--text3); font-size: 11px; top: 0; user-select: none; }
.vrow .pos.bottom { color: var(--text3); }
.vrow .line { position: relative; height: var(--lh); line-height: var(--lh); letter-spacing: 0; }
.vrow .line.enz { height: 14px; line-height: 14px; font-size: 10px; color: var(--amber); }
.vrow .line.enz span { position: absolute; top: 0; white-space: nowrap; border-left: 1px solid var(--amber); padding-left: 2px; }
.vrow .line.enz span.multi { color: var(--text3); border-left-color: var(--text3); }
.vrow .line.enz span.uniq { color: var(--accent2); border-left-color: var(--accent2); }
.vrow .line.seq { font-size: var(--fs); cursor: text; }
.vrow .line.seq span { display: inline-block; width: var(--cw); text-align: center; }
.vrow .line.comp { font-size: var(--fs); color: var(--text3); }
.vrow .line.comp span { display: inline-block; width: var(--cw); text-align: center; }
.vrow .line.aa { font-size: calc(var(--fs) - 1px); height: calc(var(--lh) - 2px); line-height: calc(var(--lh) - 2px); color: var(--text2); }
.vrow .line.aa span { display: inline-block; width: var(--cw); text-align: center; }
.vrow .line.aa span.M { color: var(--green); font-weight: 700; } .vrow .line.aa span.stop { color: var(--red); font-weight: 700; }
.vrow .line.aa .fl { position: absolute; left: -46px; width: 40px; text-align: right; color: var(--text3); font-size: 10px; }
.vrow .sel { position: absolute; top: 0; height: 100%; background: var(--sel); pointer-events: none; border-radius: 2px; }
.vrow .cursor { position: absolute; top: 0; height: 100%; width: 2px; background: var(--accent2); pointer-events: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.vrow .hl { position: absolute; top: 0; height: 100%; background: var(--sel2); pointer-events: none; border-radius: 2px; }
.vrow .ftrack { position: relative; height: 15px; }
.vrow .ftrack .ft { position: absolute; top: 2px; height: 11px; border-radius: 3px; font: 10px/11px var(--font); color: #0e1216; overflow: hidden; white-space: nowrap; padding: 0 4px; cursor: pointer; opacity: .92; }
.vrow .ftrack .ft.rev { background-image: linear-gradient(90deg, rgba(0,0,0,.25), transparent 30%); }
.vrow .ftrack .ft.fwd { background-image: linear-gradient(270deg, rgba(0,0,0,.25), transparent 30%); }
.vrow .ftrack .ft.on { outline: 2px solid var(--text); }
.vrow .ftrack .ft:hover { opacity: 1; }
.vrow .ruler { height: 10px; position: relative; }
.vrow .ruler i { position: absolute; top: 4px; width: 1px; height: 5px; background: var(--text3); }
.vrow .ruler b { position: absolute; top: -4px; font-size: 9px; color: var(--text3); font-weight: 400; transform: translateX(-50%); }
.base-A { color: var(--green); } .base-C { color: var(--blue); } .base-G { color: var(--amber); } .base-T, .base-U { color: var(--red); } .base-N { color: var(--text3); } .base-X { color: var(--purple); }
#seqviewer.nocolor .line.seq span { color: var(--text); }
.vopts { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

/* ---------------------------------------------------------------- chromatogram */
#chromo { display: flex; flex-direction: column; height: 100%; }
#chromo .cv { flex: 1; position: relative; min-height: 0; background: var(--bg2); }
#chromo canvas { display: block; }
#chromo .ov { height: 44px; position: relative; border-top: 1px solid var(--line); background: var(--bg2); flex: none; }
#chromo .ov canvas { position: absolute; inset: 0; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--text2); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------------------------------------------------------------- map */
#mapwrap { display: flex; flex-direction: column; height: 100%; }
#mapwrap .mapbody { flex: 1; overflow: auto; position: relative; display: flex; align-items: center; justify-content: center; background: var(--bg2); min-height: 0; }
#mapwrap svg { max-width: 100%; max-height: 100%; }
#mapwrap .ft-arc { cursor: pointer; }
#mapwrap .ft-arc:hover { filter: brightness(1.2); }
#mapwrap text { font-family: var(--font); fill: var(--text); }
#mapwrap text.lbl { font-size: 11px; }
#mapwrap text.enz { font-size: 10px; fill: var(--text2); }
#mapwrap text.enz.uniq { fill: var(--accent2); }
#mapwrap text.title { font-size: 16px; font-weight: 600; }
#mapwrap text.sub { font-size: 11px; fill: var(--text3); }
#mapwrap .leader { stroke: var(--text3); stroke-width: .7; fill: none; }
#mapwrap .backbone { stroke: var(--text2); fill: none; }
#mapwrap .tick { stroke: var(--text3); }
#mapwrap text.tick { font-size: 9px; fill: var(--text3); }
#mapwrap text.orf { font-size: 9px; fill: var(--text3); }
#mapwrap .selbar { fill: var(--sel); }

/* ---------------------------------------------------------------- alignment & plots */
.alnview { font: 12px/1.5 var(--mono); white-space: pre; overflow: auto; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; user-select: text; max-height: 60vh; }
.alnview .nm { color: var(--text3); display: inline-block; width: 14ch; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.alnview .mm { background: rgba(224, 83, 79, .35); border-radius: 2px; }
.alnview .gp { color: var(--text3); }
.alnview .cons { color: var(--accent2); }
.alnview .conflict { background: rgba(240, 162, 75, .35); }
.alnview .hdr { color: var(--text3); }
.alnview .ins { background: rgba(176, 127, 216, .35); }
canvas.plot { display: block; width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
.plotwrap { position: relative; margin: 6px 0 12px; }
.plotwrap .readout { position: absolute; top: 6px; right: 58px; font: 11px var(--mono); color: var(--text2); background: var(--bg3); padding: 2px 6px; border-radius: 3px; pointer-events: none; }
canvas.gel { display: block; background: #111; border-radius: var(--radius); border: 1px solid var(--line); }
.gelwrap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }

/* ---------------------------------------------------------------- dialogs, toasts, menus */
#dialogs .backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 500; display: flex; align-items: center; justify-content: center; }
.dialog { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); min-width: 380px; max-width: min(92vw, 760px); max-height: 90vh; display: flex; flex-direction: column; }
.dialog.wide { width: 760px; }
.dialog .dhead { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dialog .dhead button { background: none; border: 0; color: var(--text3); font-size: 16px; }
.dialog .dbody { padding: 12px 14px; overflow: auto; }
.dialog .dfoot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 6px; }
.dialog .field { display: grid; grid-template-columns: 150px 1fr; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.dialog .field.full { grid-template-columns: 1fr; }
.dialog .field label { color: var(--text2); font-size: 12px; }
.dialog .field .help { grid-column: 2; color: var(--text3); font-size: 11px; margin-top: -3px; }
.dialog .field.full .help { grid-column: 1; }
.dialog .field input[type=text], .dialog .field input[type=number], .dialog .field select, .dialog .field textarea { width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: 5px 8px; outline: none; }
.dialog .field input:focus, .dialog .field select:focus, .dialog .field textarea:focus { border-color: var(--accent); }
.dialog .field textarea { font-family: var(--mono); min-height: 90px; resize: vertical; }
.dialog .info { color: var(--text2); font-size: 12px; margin-bottom: 8px; line-height: 1.5; }
.dialog .info b { color: var(--text); }
.dialog .row { display: flex; gap: 8px; align-items: center; }
#toasts { position: fixed; bottom: 34px; right: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 600; pointer-events: none; }
.toast { background: var(--bg4); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; box-shadow: var(--shadow); max-width: 420px; font-size: 12.5px; pointer-events: auto; animation: toastin .2s ease-out; }
.toast.warn { border-left-color: var(--warn); } .toast.error { border-left-color: var(--red); } .toast.ok { border-left-color: var(--green); }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }
#ctxmenu { position: fixed; z-index: 450; }
#tooltip { position: fixed; z-index: 700; background: var(--bg4); border: 1px solid var(--line); color: var(--text); padding: 5px 8px; border-radius: 5px; font-size: 11.5px; pointer-events: none; max-width: 320px; box-shadow: var(--shadow); }
#tooltip .mono { font-size: 11px; }
#dropzone { position: fixed; inset: 0; z-index: 800; background: rgba(90, 209, 181, .15); border: 3px dashed var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--accent2); text-align: center; pointer-events: none; }
#dropzone small { font-size: 13px; color: var(--text2); }

/* ---------------------------------------------------------------- status bar */
#statusbar { display: flex; align-items: center; gap: 18px; height: 24px; padding: 0 12px; background: var(--bg2); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text2); flex: none; white-space: nowrap; overflow: hidden; }
#st-hint { margin-left: auto; color: var(--text3); overflow: hidden; text-overflow: ellipsis; }
#st-save { color: var(--text3); }
#st-legal { color: var(--text3); flex: none; }
#st-legal a { color: var(--text3); text-decoration: none; }
#st-legal a:hover { color: var(--accent2); text-decoration: underline; }
.plotwrap .png { position: absolute; top: 6px; right: 10px; opacity: .55; }
.plotwrap:hover .png { opacity: 1; }
.filterrow { padding: 4px 8px; border-bottom: 1px solid var(--line2); }
.filterrow input { width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 7px; color: var(--text); outline: none; font-size: 12px; }
.filterrow input:focus { border-color: var(--accent); }
#st-pos, #st-sel { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- help */
.help h2 { font-size: 15px; margin: 14px 0 6px; color: var(--accent2); }
.help p, .help li { color: var(--text2); line-height: 1.55; }
.help ul { padding-left: 18px; }
.help code { font-family: var(--mono); background: var(--bg4); padding: 0 4px; border-radius: 3px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12px; }
.keys .k { font: 11px var(--mono); background: var(--bg4); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; white-space: nowrap; }

/* ---------------------------------------------------------------- print */
@media print {
  #topbar, #sidebar, #inspector, #statusbar, #tabs, .toolbar, .hsplit { display: none !important; }
  #tabbody, .tabpane { position: static; overflow: visible; }
  body { overflow: visible; background: #fff; color: #000; }
}
