[hidden] { display: none !important; }
:root { --lw: 380px; --bh: 40px; }
[data-theme="dark"] { --bg: #15181d; --panel: #1c2027; --panel2: #232831; --line: #2f3540; --fg: #dfe4ea; --muted: #8b95a3; --acc: #ff7a1a; --sel: #2b3a52; --btn: #2a303a; --btnh: #343b47;
  --g: #ff9f43; --m: #da77f2; --a: #74c0fc; --f: #69db7c; --n: #6c7684; --c: #7d8794; --k: #ffd43b; --v: #4dd4c6; --warn: #f0b429; --ovl: rgba(22, 25, 31, .82); }
[data-theme="light"] { --bg: #f4f6f8; --panel: #ffffff; --panel2: #eef1f4; --line: #d6dce3; --fg: #1f2933; --muted: #66727f; --acc: #e8590c; --sel: #d0e3ff; --btn: #e9edf1; --btnh: #dde3e9;
  --g: #d9480f; --m: #9c36b5; --a: #1864ab; --f: #2b8a3e; --n: #9aa5b1; --c: #7b8794; --k: #a07700; --v: #0b7285; --warn: #b7791f; --ovl: rgba(255, 255, 255, .88); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
body { display: flex; flex-direction: column; height: 100dvh; }
button, select, input { font: inherit; color: inherit; }
button, select { background: var(--btn); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; cursor: pointer; }
button:hover, select:hover { background: var(--btnh); }
button.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
button.on { background: var(--sel); border-color: var(--acc); }
a { color: var(--acc); }

/* banner */
:root { --bh: 60px; }
#banner { position: relative; z-index: 5; height: var(--bh); flex: 0 0 var(--bh); display: flex; align-items: center; gap: 14px; padding: 0 14px; overflow: hidden; color: #fff;
  background: linear-gradient(100deg, #2a0d04 0%, #6e1c06 22%, #c2410c 40%, #f97316 50%, #c2410c 60%, #6e1c06 78%, #2a0d04 100%); background-size: 260% 100%; animation: bnshift 9s ease-in-out infinite alternate; }
.nobanner #banner { display: none; }
.bn-flame { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90px 40px at 8% 125%, rgba(255, 200, 70, .55), transparent 70%), radial-gradient(120px 45px at 45% 135%, rgba(255, 150, 40, .45), transparent 70%), radial-gradient(100px 40px at 82% 130%, rgba(255, 210, 90, .4), transparent 70%),
  linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .16) 45%, transparent 60%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 250% 100%; animation: bnflick 2.6s ease-in-out infinite alternate, bnsweep 6s linear infinite; }
.bn-tag { position: relative; font-weight: 800; font-size: 14px; letter-spacing: .03em; white-space: nowrap; background: rgba(0, 0, 0, .3); padding: 4px 10px; border-radius: 12px; }
.bn-msgs { position: relative; flex: 1; height: 40px; overflow: hidden; min-width: 0; }
.bn-msg { position: absolute; left: 0; right: 0; top: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translate(24px, -50%); transition: opacity .6s ease, transform .6s ease; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.bn-msg b { font-weight: 700; } .bn-msg span { opacity: .92; }
.bn-msg.on { opacity: 1; transform: translate(0, -50%); }
.bn-msg.out { opacity: 0; transform: translate(-24px, -50%); }
.bn-dots { position: relative; display: flex; gap: 5px; }
.bn-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .4); transition: background .3s, transform .3s; }
.bn-dots i.on { background: #ffd8a8; transform: scale(1.3); }
.bn-btn { position: relative; color: #2b0f05; background: #ffe0b8; border-radius: 8px; padding: 7px 14px; text-decoration: none; font-weight: 700; white-space: nowrap; animation: bnglow 2.4s ease-in-out infinite; }
.bn-btn:hover, .bn-btn:focus-visible { background: #fff; }
.bn-x { position: relative; background: transparent; border: 0; color: #fff; font-size: 20px; padding: 0 4px; line-height: 1; opacity: .85; }
.bn-x:hover { background: transparent; opacity: 1; }
@keyframes bnshift { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@keyframes bnflick { from { opacity: .65; } to { opacity: 1; } }
@keyframes bnsweep { from { background-position: 0 0, 0 0, 0 0, 150% 0; } to { background-position: 0 0, 0 0, 0 0, -150% 0; } }
@keyframes bnglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 168, .0); } 50% { box-shadow: 0 0 14px 3px rgba(255, 216, 168, .75); } }
@media (max-width: 820px) {
  :root { --bh: 48px; }
  #banner { gap: 8px; padding: 0 8px; }
  .bn-msgs { height: 44px; }
  .bn-msg { white-space: normal; font-size: 12px; line-height: 1.25; max-height: 44px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .bn-msg span { display: inline; }
  .bn-dots { display: none; }
  .bn-btn { padding: 5px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { #banner, .bn-flame, .bn-btn { animation: none; } .bn-msg { transition: none; } }

/* top bar */
#top { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.brand .bt { font-size: 15px; } .brand .by { font-size: 11px; color: var(--muted); text-decoration: none; }
.brand .by:hover { color: var(--acc); }
.tb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.lbl { color: var(--muted); } .lbl select { color: var(--fg); max-width: 270px; }
.seg { display: inline-flex; } .seg button { border-radius: 0; } .seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; }

/* layout */
#main { flex: 1; display: flex; min-height: 0; }
#left { width: var(--lw); min-width: 200px; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); min-height: 0; }
#splitter { width: 5px; cursor: col-resize; background: transparent; flex: 0 0 5px; margin-left: -3px; z-index: 2; }
#splitter:hover { background: var(--acc); }
#right { flex: 1; position: relative; min-width: 0; display: flex; flex-direction: column; }
#view { flex: 1; min-height: 0; position: relative; touch-action: none; }
#view canvas { display: block; }
.lhead { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line); background: var(--panel2); min-height: 32px; }
#fileName { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#lineInfo { color: var(--muted); font-size: 12px; white-space: nowrap; }
.edbtns { display: flex; gap: 4px; }

/* editor */
#editor { flex: 1; position: relative; min-height: 0; outline: none; }
.ed-scroll { position: absolute; inset: 0; overflow: auto; font: 12.5px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ed-spacer { width: 1px; }
.ed-rows { position: absolute; left: 0; top: 0; right: 0; }
.ed-row { position: absolute; left: 0; right: 0; height: 20px; white-space: pre; cursor: pointer; padding-right: 8px; }
.ed-row:hover { background: rgba(127, 127, 127, .08); }
.ed-row.sel { background: var(--sel); }
.ed-row .ln { display: inline-block; text-align: right; color: var(--n); padding-right: 10px; user-select: none; border-right: 1px solid var(--line); margin-right: 8px; }
.ed-row.mk-warn .ln { box-shadow: inset 3px 0 0 var(--warn); }
.ed .g { color: var(--g); } .ed .m { color: var(--m); } .ed .a { color: var(--a); } .ed .f { color: var(--f); } .ed .n { color: var(--n); } .ed .c { color: var(--c); font-style: italic; } .ed .k { color: var(--k); } .ed .v, .ed .o { color: var(--v); }
.ed-ta { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; border: 0; outline: none; padding: 6px 8px; background: var(--panel); color: var(--fg); font: 12.5px/17px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }

/* notes */
#notes { border-top: 1px solid var(--line); max-height: 40%; overflow: auto; flex: 0 0 auto; }
#notes summary { cursor: pointer; padding: 5px 8px; color: var(--muted); font-size: 12px; user-select: none; }
#notes .badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--btn); color: var(--fg); text-align: center; margin-left: 3px; }
#notes .badge.w { background: var(--warn); color: #000; }
#notesList { font-size: 12px; }
#notesList h4 { margin: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.note { padding: 2px 8px 2px 10px; cursor: pointer; display: flex; gap: 8px; }
.note:hover { background: var(--sel); }
.note .nl { color: var(--n); min-width: 46px; font-family: ui-monospace, monospace; }
.note.w .nl::before { content: "\25CF "; color: var(--warn); }

/* overlays */
.ovl { position: absolute; background: var(--ovl); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; backdrop-filter: blur(4px); z-index: 3; }
#dro { left: 8px; top: 8px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-width: 240px; pointer-events: none; }
#dro table { border-collapse: collapse; } #dro td, #dro th { padding: 0 6px 0 0; text-align: right; } #dro th { color: var(--muted); font-weight: normal; text-align: left; }
#dro .hd th { text-align: right; font-size: 10.5px; text-transform: uppercase; }
#dro .ax { color: var(--a); text-align: left; font-weight: bold; }
#dro .st { margin-top: 4px; color: var(--muted); white-space: normal; max-width: 300px; }
#dro .st b { color: var(--fg); font-weight: 600; }
#vtools { right: 8px; top: 8px; display: flex; flex-direction: column; gap: 5px; max-width: 360px; }
#vtools .row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
#vtools label { white-space: nowrap; font-size: 12px; }
#vtools button, #vtools select { padding: 2px 7px; font-size: 12px; }
#summary { left: 8px; bottom: 54px; font-size: 11.5px; color: var(--muted); max-width: 320px; }
#summary b { color: var(--fg); font-weight: 600; }
#measureOut { left: 50%; transform: translateX(-50%); top: 8px; font: 12px ui-monospace, monospace; }
#busy { left: 50%; top: 45%; transform: translate(-50%, -50%); font-size: 14px; }
#play { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 6px 8px; background: var(--panel); border-top: 1px solid var(--line); }
#play button { min-width: 34px; }
#scrub { flex: 1; min-width: 60px; accent-color: var(--acc); }
#speed { width: 90px; accent-color: var(--acc); vertical-align: middle; }
#timeOut, #speedOut { font: 12px ui-monospace, monospace; white-space: nowrap; color: var(--muted); }
.spd { white-space: nowrap; color: var(--muted); }

dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; max-width: min(640px, 94vw); max-height: 90vh; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h3 { margin: 0 0 8px; } dialog menu { display: flex; justify-content: flex-end; gap: 6px; padding: 0; margin: 12px 0 0; }
.muted { color: var(--muted); font-size: 12px; }
.mf { display: grid; grid-template-columns: 150px 1fr; gap: 6px 10px; align-items: center; }
.mf input[type=number], .mf input[type=text] { width: 90px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }
.mf .trip { display: flex; gap: 4px; }
.rt { width: 100%; border-collapse: collapse; margin: 8px 0; } .rt td, .rt th { padding: 3px; text-align: left; font-size: 12px; }
.rt input { width: 80px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; }

@media (max-width: 820px) {
  #main { flex-direction: column; }
  #left { width: auto !important; height: 38%; order: 2; border-right: 0; border-top: 1px solid var(--line); }
  #splitter { display: none; }
  #right { order: 1; }
  .brand .by { display: none; }
  #summary { display: none; }
  #dro { min-width: 0; font-size: 11px; }
  #vtools { max-width: 60%; }
  .bn-tag { display: none; }
  #speed { width: 60px; }
}

/* panels menu */
.menu { position: relative; }
.pop { position: absolute; right: 0; top: 110%; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 200px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.pop label { white-space: nowrap; } .pop .row { display: flex; gap: 4px; margin-top: 4px; }
.hidepanel { display: none !important; }
@media (max-width: 820px) {
  #stockNote { display: none; }
  .lbl { font-size: 0; } .lbl select { font-size: 13px; max-width: 170px; }

  #top { gap: 6px; padding: 4px 6px; } .tb { gap: 4px; } .sep { display: none; }
  .brand .bt { font-size: 13px; }
}

#cube .f span { display: inline-block; transform: scaleX(-1); pointer-events: none; }

/* v1.3 compact toolbar */
#top { flex-wrap: nowrap; gap: 10px; padding: 6px 8px; }
.tb { flex-wrap: wrap; gap: 4px; min-width: 0; }
.tb button, .tb select { padding: 4px 8px; }
#machSel { max-width: 210px; }
.brand .by { font-size: 11px; }
.pop button, .pop a { text-align: left; width: 100%; display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--fg); background: transparent; border: 0; white-space: nowrap; }
.pop button:hover, .pop a:hover { background: var(--btnh); }
.mob, .narrowonly { display: none; }
@media (max-width: 1100px) { .brand .by { display: none; } .tb .wide { display: none; } .narrowonly { display: block; } }
@media (max-width: 1000px) { #top { flex-wrap: wrap; } }
/* job box badge */
.badge-ap { display: inline-block; background: var(--warn); color: #000; border-radius: 8px; padding: 0 6px; font-size: 10.5px; font-weight: 700; cursor: help; margin-left: 4px; }
.badge-ok { display: inline-block; background: #2f9e44; color: #fff; border-radius: 8px; padding: 0 6px; font-size: 10.5px; font-weight: 700; cursor: help; margin-left: 4px; }
/* phones and tablets: editor drawer, full-width 3D */
@media (max-width: 900px) {
  .mob { display: inline-block; }
  #main { flex-direction: column; position: relative; }
  #right { order: 1; flex: 1; min-height: 0; }
  #left { order: 2; position: absolute; left: 0; right: 0; bottom: 0; height: 55%; width: auto !important; z-index: 15; box-shadow: 0 -6px 24px rgba(0,0,0,.35); transform: translateY(100%); transition: transform .25s ease; border-top: 1px solid var(--line); }
  body.drawer #left { transform: none; }
  #splitter { display: none; }
  #summary { display: none; }
  #dro { font-size: 10.5px; min-width: 0; padding: 4px 6px; }
  #dro .st { max-width: 200px; }
  #vtools { max-width: 62%; }
  #play { gap: 3px; padding: 5px 4px; } #play button { min-width: 30px; padding: 3px 4px; }
  .spd { display: none; }
}
@media (max-width: 480px) { :root { --bh: 42px; } .bn-msg { font-size: 11px; } #timeOut { display: none; } }
@media (prefers-reduced-motion: reduce) { #left { transition: none; } }

/* v1.3 navigator widget */
#nav { position: absolute; right: 10px; bottom: 58px; z-index: 4; width: 148px; display: grid; grid-template-columns: 112px 30px; grid-template-rows: 14px 112px 26px; gap: 2px 4px;
  opacity: .55; transition: opacity .2s; user-select: none; touch-action: none; }
#nav:hover, #nav.active, #nav:focus-within { opacity: 1; }
#nav.c-tl { left: 10px; right: auto; top: 10px; bottom: auto; } #nav.c-tr { right: 10px; left: auto; top: 10px; bottom: auto; }
#nav.c-bl { left: 10px; right: auto; bottom: 58px; top: auto; } #nav.c-br { right: 10px; left: auto; bottom: 58px; top: auto; }
.nv-grip { grid-column: 1 / span 2; text-align: center; font-size: 10px; line-height: 14px; color: var(--muted); cursor: grab; letter-spacing: -2px; }
.nv-ring { width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(from 0deg, var(--line), var(--panel2), var(--line), var(--panel2), var(--line)); display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nv-ball { width: 88px; height: 88px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--panel), var(--panel2)); display: flex; align-items: center; justify-content: center; cursor: move; border: 1px solid var(--line); }
.cubewrap { width: 56px; height: 56px; perspective: 500px; display: flex; align-items: center; justify-content: center; }
#cube { width: 40px; height: 40px; position: relative; transform-style: preserve-3d; }
#cube .f { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 7.5px; font-weight: 700; color: var(--fg);
  background: color-mix(in srgb, var(--panel2) 85%, var(--acc)); border: 1px solid var(--line); backface-visibility: hidden; cursor: pointer; }
#cube .f:hover { background: var(--acc); color: #fff; }
#cube .f span { display: inline-block; transform: scaleX(-1); pointer-events: none; }
#cube .top { transform: translateZ(20px); } #cube .bottom { transform: rotateX(180deg) translateZ(20px); }
#cube .front { transform: rotateX(90deg) translateZ(20px); } #cube .back { transform: rotateX(-90deg) rotateZ(180deg) translateZ(20px); }
#cube .right { transform: rotateY(90deg) rotateZ(90deg) translateZ(20px); } #cube .left { transform: rotateY(-90deg) rotateZ(-90deg) translateZ(20px); }
.nv-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nv-side button, .nv-bot button { width: 28px; height: 26px; padding: 0; font-size: 13px; border-radius: 7px; }
.nv-pan { cursor: grab; touch-action: none; }
.nv-zoom { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nv-strip { width: 10px; height: 34px; border-radius: 5px; background: repeating-linear-gradient(0deg, var(--line) 0 2px, var(--panel2) 2px 6px); cursor: ns-resize; touch-action: none; border: 1px solid var(--line); }
.nv-bot { grid-column: 1 / span 2; display: flex; justify-content: center; gap: 6px; }
.nv-bot button { width: auto; padding: 0 10px; }
@media (max-width: 900px) { #nav { transform: scale(.9); transform-origin: right bottom; } #nav.c-bl, #nav.c-tl { transform-origin: left bottom; } }

#pickTip { position: absolute; pointer-events: none; font: 11.5px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 4px 7px; z-index: 6; white-space: nowrap; }

#toolsDlg { max-width: min(980px, 96vw); }
.tl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tl th, .tl td { padding: 4px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tl select { max-width: 300px; font-size: 12px; }
.tl input { width: 64px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; }
.tl .cm { color: var(--muted); font-size: 11px; max-width: 220px; }

.ed-row.tc { background: color-mix(in srgb, var(--acc) 8%, transparent); }
.ed-row.tc.sel { background: var(--sel); }
.tcico { position: absolute; left: 1px; top: 3px; width: 15px; height: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--acc); border-radius: 4px; }
.tcico:hover { background: var(--acc); color: #fff; }
#ctxMenu { position: fixed; z-index: 50; }

#findBar { padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--panel2); display: flex; flex-direction: column; gap: 4px; }
#findBar .fr { display: flex; gap: 3px; align-items: center; }
#findBar input { flex: 1; min-width: 60px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
#findBar button { padding: 2px 6px; font-size: 12px; }
#findBar .tg.on { background: var(--sel); border-color: var(--acc); }
#fCount { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 58px; text-align: center; }
.ed mark { background: #ffe066; color: #000; border-radius: 2px; }
.ed mark.fcur { background: #ff922b; }
#bPlot.dirty::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ffe066; margin-left: 5px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }

/* v1.4.2 tool & holder browser */
.utag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 0 4px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); vertical-align: 1px; line-height: 14px; }
.utag.other { color: #fff; background: var(--warn); border-color: var(--warn); }
#toolsDlg.tbdlg { max-width: none; max-height: none; padding: 0; width: min(1280px, 97vw); height: min(840px, 94vh); overflow: hidden; }
#toolsDlg.tbdlg:has(.compact) { width: min(1020px, 96vw); height: min(760px, 92vh); }
.tbx { display: grid; height: 100%; grid-template-columns: 250px minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "h h h" "t m s" "f f f"; }
.tbx.compact { grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "h h" "m s" "f f"; }
.tb-head { grid-area: h; display: flex; align-items: baseline; gap: 12px; padding: 10px 14px 8px; border-bottom: 1px solid var(--line); }
.tb-head h3 { margin: 0; } .tb-head .muted { font-size: 12px; flex: 1; }
.tb-x { background: transparent; border: 0; font-size: 20px; line-height: 1; padding: 0 4px; }
.tb-ts { grid-area: t; overflow: auto; border-right: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.tb-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 2px 4px; display: flex; align-items: center; gap: 8px; }
.tb-t { display: grid; grid-template-columns: 70px 1fr; grid-template-rows: auto auto auto auto; column-gap: 8px; text-align: left; padding: 6px; background: var(--panel2); border-radius: 7px; }
.tb-t.sel { border-color: var(--acc); background: var(--sel); }
.tb-t .tth { grid-row: 1 / span 4; width: 70px; height: 26px; object-fit: contain; align-self: center; }
.tb-t .tt2 { font-size: 12px; } .tb-t .tt3, .tb-t .tt4 { font-size: 11px; color: var(--muted); } .tb-t .warn, .tb-side .warn { color: var(--warn); }
.tb-t .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); }
.tb-main { grid-area: m; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tb-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.tb-tabs button { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.tb-tabs button.on { background: var(--sel); border-color: var(--acc); }
.tb-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tb-filters input[type=search] { width: 150px; } .tb-filters input, .tb-side input, .tb-editor input, .tb-editor select, .tb-side select { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }
.tb-dr input { width: 54px; }
.seg { display: inline-flex; } .seg button { border-radius: 0; margin-left: -1px; padding: 3px 8px; } .seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.tb-count { margin-left: auto; font-size: 12px; }
.tb-grid { flex: 1; overflow: auto; position: relative; padding: 8px 6px 8px 10px; min-height: 0; }
.tb-spacer { position: relative; }
.tb-card { position: absolute; width: 196px; height: 132px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); padding: 4px 7px; cursor: pointer; overflow: hidden; }
.tb-card:hover { border-color: var(--muted); } .tb-card.sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; background: var(--sel); }
.tb-card.nofit { opacity: .55; } .tb-card.oth .th { opacity: .85; }
.tb-card .th { display: block; width: 180px; height: 66px; object-fit: contain; margin: 0 auto 2px; background: radial-gradient(ellipse at 50% 60%, rgba(127, 140, 160, .12), transparent 70%); border-radius: 4px; }
.tb-card .nm { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-card .sp, .tb-card .mt { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-card .mt b { margin-left: 6px; font-weight: 600; } .tb-card .mt .my { color: var(--acc); }
.tb-side { grid-area: s; border-left: 1px solid var(--line); overflow: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tb-cur .hd { font-weight: 700; } .tb-cur .nm { font-weight: 600; } .tb-cur .sp, .tb-cur .cm { font-size: 12px; color: var(--muted); }
.tb-3d { height: 230px; flex: 0 0 230px; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(ellipse at 50% 40%, rgba(127, 140, 160, .16), transparent 75%); overflow: hidden; cursor: grab; position: relative; }
.tb-3d .lthumb { width: 100%; height: 100%; object-fit: contain; }
.tb-svg { flex: 0 0 auto; } .sideview { width: 100%; height: auto; display: block; }
.sideview polygon { stroke: var(--fg); stroke-width: .6; stroke-opacity: .55; }
.sideview .cut { fill: #d8a24a; fill-opacity: .55; } .sideview .sh { fill: #aeb4bc; fill-opacity: .45; } .sideview .hd { fill: #c9ced6; fill-opacity: .3; } .sideview .dk { fill: #4b525c; fill-opacity: .45; }
.sideview .axis { stroke: var(--muted); stroke-dasharray: 6 3 1 3; stroke-width: .7; }
.sideview .ext { stroke: var(--muted); stroke-width: .5; } .sideview .dim { stroke: var(--fg); stroke-width: .8; } .sideview .arh { fill: var(--fg); }
.sideview .dt { fill: var(--fg); font-size: 10px; } .sideview .dt.muted { fill: var(--muted); }
.sideview .so { stroke: var(--acc); } .sideview .dt.so { fill: var(--acc); } .sideview .gline { stroke: var(--acc); stroke-dasharray: 4 3; stroke-width: .8; }
.tb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.tb-fields label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); } .tb-fields label.wide { grid-column: 1 / -1; }
.tb-fields label input { width: 100%; color: var(--fg); } .tb-fields label span { display: none; }
.tb-fields select { width: 100%; color: var(--fg); }
.tb-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tb-err { grid-column: 1 / -1; color: var(--warn); margin: 0; padding-left: 18px; } .tb-fields .ok { grid-column: 1 / -1; color: var(--f); }
.tb-editor { flex: 1; overflow: auto; padding: 10px 12px; }
.ce-top, .ce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; margin-bottom: 10px; }
.tb-editor label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); } .tb-editor label.wide { grid-column: span 2; }
.tb-editor input, .tb-editor select { color: var(--fg); width: 100%; }
.tb-editor .iu { display: flex; align-items: center; gap: 4px; } .tb-editor .iu span { color: var(--muted); font-size: 11px; width: 22px; }
.ce-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; } .ce-msg { font-size: 12px; }
.ce-io { margin-left: auto; display: inline-flex; gap: 6px; text-transform: none; letter-spacing: 0; }
.filebtn { background: var(--btn); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer; color: var(--fg); font-size: 12px; flex-direction: row !important; }
.ce-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.viewer-tool-shelf-entry { display: flex; align-items: stretch; gap: 3px; min-width: 0; }
.viewer-tool-shelf-entry .ce-item { flex: 1; min-width: 0; }
.ce-item { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 12px; } .ce-item img { width: 72px; height: 27px; object-fit: contain; } .ce-item span { flex: 1; } .ce-item.sel { border-color: var(--acc); background: var(--sel); }
.tb-foot { grid-area: f; border-top: 1px solid var(--line); padding: 8px 14px; } .tb-foot menu { margin: 0; }
@media (max-width: 900px) {
  .tbx, .tbx.compact { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "h" "t" "m" "s" "f"; overflow: auto; }
  .tb-ts { flex-direction: row; max-height: 120px; border-right: 0; border-bottom: 1px solid var(--line); } .tb-t { min-width: 220px; }
  .tb-side { border-left: 0; border-top: 1px solid var(--line); } .tb-grid { min-height: 300px; }
}
.sv2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; } .svh { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* v1.4.3 define-tool popover */
.tpop { position: fixed; z-index: 60; width: min(400px, calc(100vw - 16px)); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .12); display: flex; flex-direction: column; font-size: 13px; outline: none; }
[data-theme="light"] .tpop { box-shadow: 0 12px 32px rgba(20, 30, 45, .16), 0 2px 6px rgba(20, 30, 45, .08); }
.tpop :focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.tp-arrow { position: absolute; width: 12px; height: 12px; background: var(--panel); border: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.tpop.down .tp-arrow { top: -7px; border-right: 0; border-bottom: 0; } .tpop.up .tp-arrow { bottom: -7px; border-left: 0; border-top: 0; } .tpop.sheet .tp-arrow { display: none; }
.tp-head { display: flex; gap: 12px; align-items: center; padding: 12px 12px 8px 16px; }
.tp-th { width: 88px; height: 34px; object-fit: contain; flex: 0 0 88px; border-radius: 6px; background: radial-gradient(ellipse at 50% 60%, rgba(127, 140, 160, .16), transparent 70%); }
.tp-ttl { flex: 1; min-width: 0; } .tp-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tp-nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tp-sp { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-x { align-self: flex-start; background: transparent; border: 0; font-size: 20px; line-height: 1; padding: 0 4px; color: var(--muted); } .tp-x:hover { color: var(--fg); background: transparent; }
.tp-hold { display: flex; gap: 8px; align-items: center; padding: 0 16px 8px; } .tp-hth { width: 56px; height: 22px; object-fit: contain; flex: 0 0 56px; }
.tp-hsel { flex: 1; min-width: 0; font-size: 12px; padding: 4px 8px; }
.tp-seg { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 16px 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.tp-seg button { border: 0; background: transparent; border-radius: 6px; padding: 5px 8px; font-size: 12px; color: var(--muted); } .tp-seg button:hover { color: var(--fg); background: transparent; }
.tp-seg button.on { background: var(--panel); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.tp-body { height: 204px; padding: 0 16px; overflow: hidden; display: flex; flex-direction: column; }
.tp-auto p { margin: 0 0 8px; line-height: 1.45; } .tp-auto code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; } .tpop .warn { color: var(--warn); }
.tp-lib, .tp-cus { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.tp-row1 { display: flex; gap: 8px; align-items: center; } .tp-row1 input[type=search] { flex: 1; min-width: 0; }
.tpop input[type=search], .tpop input[type=number], .tpop select { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--fg); }
.tp-all { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.tp-chips { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; padding-bottom: 2px; } .tp-chips::-webkit-scrollbar { display: none; }
.chip { border-radius: 999px; padding: 2px 10px; font-size: 12px; white-space: nowrap; } .chip.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.tp-list { flex: 1; overflow: auto; position: relative; border: 1px solid var(--line); border-radius: 8px; min-height: 0; }
.tp-sp2 { position: relative; }
.tp-it { position: absolute; left: 0; right: 0; height: 46px; display: grid; grid-template-columns: 72px 1fr auto; grid-template-rows: 1fr 1fr; column-gap: 8px; align-items: center; padding: 3px 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.tp-it img { grid-row: 1 / span 2; width: 72px; height: 28px; object-fit: contain; } .tp-it .a { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: end; } .tp-it .b { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: start; }
.tp-it .a { grid-column: 2; grid-row: 1; } .tp-it .b { grid-column: 2; grid-row: 2; } .tp-it .utag { grid-column: 3; grid-row: 1 / span 2; } .tp-it:hover { background: var(--btnh); } .tp-it.act { box-shadow: inset 2px 0 0 var(--acc); } .tp-it.sel { background: var(--sel); }
.tp-empty { padding: 16px; color: var(--muted); text-align: center; }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tp-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tp-grid .iu { display: flex; align-items: center; gap: 4px; } .tp-grid input { width: 100%; min-width: 0; } .tp-grid em { font-style: normal; font-size: 11px; width: 20px; color: var(--muted); }
.tp-msg { font-size: 12px; color: var(--f); } .tp-msg.bad { color: var(--warn); }
.tp-link { background: transparent; border: 0; padding: 4px 0; color: var(--acc); font-size: 12px; align-self: flex-start; } .tp-link:hover { background: transparent; text-decoration: underline; }
.tp-side { padding: 8px 16px 0; height: 112px; overflow: hidden; } .tp-sv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; height: 100%; } .tp-sv .sideview { height: 104px; width: 100%; }
.tp-note { color: var(--muted); font-size: 12px; padding-top: 8px; }
.tp-foot { display: flex; gap: 8px; align-items: center; padding: 8px 12px 12px 16px; border-top: 1px solid var(--line); margin-top: 8px; } .tp-foot .sp { flex: 1; } .tp-foot .tp-link { align-self: center; }
.tpop.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; border-bottom: 0; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
.tpop.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
/* v1.5 editor toolbar + menus */
.edtb { display: inline-flex; gap: 2px; margin-left: auto; }
.edtb + .edbtns { margin-left: 4px; }
.ib { width: 28px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--fg); }
.ib:hover:not(:disabled) { background: var(--btnh); border-color: var(--line); }
.ib:disabled, .pop button:disabled { opacity: .35; cursor: default; }
.ib:focus-visible, .pop button:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
@media (pointer: coarse) { .ib { width: 32px; height: 32px; } }
.pop .mi, #ctxMenu button { display: flex !important; align-items: center; gap: 8px; }
.pop .mi span, #ctxMenu button span { flex: 1; } .pop kbd, #ctxMenu kbd { font: 11px ui-monospace, monospace; color: var(--muted); }
#ctxMenu { min-width: 230px; }
.langpick { display: flex; align-items: center; gap: 8px; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; white-space: nowrap; }
.langpick select { flex: 1; }
:lang(zh) body, :lang(zh-Hans) body { font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }

/* v1.5.1 progress overlay */
#prog { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 30; width: min(360px, 86%); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; box-shadow: 0 10px 28px rgba(0,0,0,.25); border-radius: 10px; }
#prog .pl { grid-column: 1 / -1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#prog .pb { height: 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
#prog .pb i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .12s linear; }
#prog.ind .pb i { width: 30% !important; animation: progind 1.1s ease-in-out infinite alternate; }
@keyframes progind { from { margin-left: 0; } to { margin-left: 70%; } }

.docbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--btn); color: var(--fg); text-decoration: none; font-weight: 700; }
.docbtn:hover { background: var(--btnh); }
/* v1.5.2: keep the toolbar on one row at 1280 px in longer languages */
@media (min-width: 1001px) and (max-width: 1500px) {
 #machSel { max-width: 175px; }
  .tb > button, .tb .seg button, .tb .menu > button { padding-left: 7px; padding-right: 7px; }
  .brand .by { display: none; }
}
/* multi-line selection + "Edit selected lines" panel (Windfire Admin) */
.ed-rows { user-select: none; -webkit-user-select: none; }
.ed-row.rsel { background: color-mix(in srgb, var(--sel) 70%, transparent); }
.ed-row.rsel .ln { color: var(--fg); }
.ed-row.rsel.sel { background: var(--sel); }
#selInfo { font-size: 11px; font-weight: 600; color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.bpop { width: min(580px, calc(100vw - 16px)); }
.bpop .bp-ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; display: grid; place-items: center; color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.bpop.side .tp-arrow { left: -7px; transform: translateY(-50%) rotate(45deg); border-top: 0; border-right: 0; }
.bp-scroll { overflow: auto; min-height: 0; flex: 1 1 auto; padding: 0 16px; }
.bp-sec { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.bp-sec:first-child { border-top: 0; }
.bp-lbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.bp-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bp-range { display: flex; gap: 6px; align-items: center; } .bp-range input { width: 92px; }
.bpop input[type=text], .bpop input[type=number] { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--fg); min-width: 0; }
.bp-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.bp-chip { min-width: 34px; padding: 4px 8px; border-radius: 14px; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel2); }
.bp-chip small { font-size: 9px; color: var(--muted); margin-left: 1px; }
.bp-chip.on { background: var(--acc); border-color: var(--acc); color: #fff; } .bp-chip.on small { color: #fff; }
.bp-chip.absent:not(.on) { opacity: .6; border-style: dashed; }
.bp-ops { grid-template-columns: repeat(6, auto); margin: 0; }
.bp-ops button { padding: 5px 6px; white-space: nowrap; }
.bp-params { display: flex; flex-direction: column; gap: 6px; min-height: 30px; }
.bp-f { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bp-f .iu { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); } .bp-f input[type=text] { width: 120px; }
.bp-f input[type=range] { flex: 1; max-width: 220px; accent-color: var(--acc); } .bp-f output { min-width: 18px; font-weight: 700; color: var(--fg); }
.bp-sm { width: 70px !important; }
.bp-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bpop label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.bp-to > label { display: flex; }
.bp-note { margin: 0; font-size: 12px; color: var(--muted); }
.bp-warn p { margin: 6px 0 0; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.bp-prev { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.bp-spark { position: relative; } .bp-spark svg { display: block; width: 100%; height: 44px; background: var(--panel2); border-radius: 6px; }
.bp-spark polyline { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; } .bp-spark .b { stroke: var(--muted); stroke-dasharray: 3 2; } .bp-spark .a { stroke: var(--acc); stroke-width: 2; }
.bp-leg { position: absolute; right: 6px; top: 3px; display: flex; gap: 8px; font-size: 10px; color: var(--muted); }
.bp-leg span::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 4px; vertical-align: middle; background: var(--muted); } .bp-leg .a::before { background: var(--acc); height: 3px; }
.bp-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); } .bp-sum b { color: var(--fg); } .bp-sum em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--f); border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; margin-left: 2px; }
.bp-lim { font-size: 12px; border-radius: 6px; } .bp-lim:empty { display: none; }
.bp-lim.ok { color: var(--f); } .bp-lim.ok::before { content: "✓ "; }
.bp-lim.bad { color: #fff; background: #c92a2a; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; } .bp-lim.bad span { opacity: .9; }
.bp-tw { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.bp-tab { width: 100%; border-collapse: collapse; font: 11.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.bp-tab th { position: sticky; top: 0; background: var(--panel2); text-align: left; font: 600 11px system-ui, sans-serif; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.bp-tab td { padding: 2px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); white-space: nowrap; }
.bp-tab td.ln { color: var(--n); text-align: right; width: 1%; } .bp-tab td.rl { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bp-tab td.av { color: var(--acc); font-weight: 700; } .bp-tab td.av s { color: var(--muted); }
.bp-tab tr.dim td { opacity: .5; } .bp-tab tr.dim td.av { font-weight: 400; color: var(--muted); } .bp-tab .why { font: italic 11px system-ui, sans-serif; }
.bp-pa { color: var(--muted); }
.bpop .tp-foot button:disabled { opacity: .45; cursor: default; }
.bpop.sheet .bp-scroll { overflow: visible; }
.bpop.sheet { display: flex; }
@media (max-width: 600px) {
  .bp-sec { grid-template-columns: 1fr; gap: 4px; }
  .bp-lbl { padding-top: 0; }
  .bp-ops { grid-template-columns: repeat(3, 1fr); }
  .bp-tab td.rl { max-width: 110px; }
  .bpop .tp-foot { position: sticky; bottom: 0; background: var(--panel); }
}
.lhead { min-width: 0; overflow: hidden; }
#lineInfo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { #selInfo:not([hidden]) ~ #lineInfo { display: none; } .edtb { gap: 0; } }
.bp-spark { display: flex; flex-direction: column-reverse; gap: 2px; } .bp-leg { position: static; justify-content: flex-end; }
.bp-ops { display: flex; flex-wrap: wrap; } .bp-ops button { flex: 1 1 auto; }
#fileName { min-width: 4em; }
/* v1.7 controllers / M-code map / DMS-style router (Windfire Admin) */
#suggest { left: 50%; transform: translateX(-50%); top: 8px; width: min(520px, 56%); font-size: 12.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--acc); border-radius: 8px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; z-index: 6; }
#suggest[hidden] { display: none; }
#suggest span { flex: 1 1 260px; }
#suggest button { font-size: 12px; }
/* v1.7.2 machine prompt: suggested machine, Keep, full list with filter */
#suggest .sg-msg { flex: 1 1 100%; }
#suggest .sg-btns { display: flex; gap: 6px; flex-wrap: wrap; }
#suggest .sg-pick { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
#suggest .sg-pick label { font-size: 12px; opacity: .85; }
#suggest .sg-pick select { width: 100%; font-size: 12.5px; background: var(--bg); color: var(--fg); border: 1px solid var(--line, #444); border-radius: 6px; }
#suggest .sg-pick input { font-size: 12.5px; padding: 3px 6px; }
.tb .tbl { font-size: 12px; opacity: .8; margin-right: -2px; white-space: nowrap; }
#ctlSel { max-width: 120px; }
@media (max-width: 1400px) { #ctlSel { max-width: 96px; } .tb #machSel { max-width: 170px; } }
#summary .warnc { color: #e8a33c; }
.mtab input.mcode { width: 64px; } .mtab select { max-width: 260px; } .mtab tr.chg td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
.mtab .mdel { padding: 0 8px; }
#fileSel { max-width: 46%; font-size: 12px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; }
@media (max-width: 1100px) { .tb .tbl[for=ctlSel], #ctlSel { display: none; } }
@media (max-width: 900px) { #suggest { width: auto; left: 8px; right: 8px; transform: none; top: auto; bottom: 54px; } }
/* v1.8 machine editor */
dialog.medlg { max-width: min(1180px, 97vw); width: 1180px; }
.medtop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.medcols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; }
@media (max-width: 900px) { .medcols { grid-template-columns: minmax(0, 1fr); } }
.medview { height: 320px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.medsl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; }
.medslr { display: flex; align-items: center; gap: 6px; font-size: 12px; } .medslr input { flex: 1; min-width: 60px; } .medslr output { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.medtip { font-size: 12px; margin-top: 6px; }
.medscroll { overflow-x: auto; }
.medax input[type=number] { width: 62px; } .medax .alet { width: 26px; text-align: center; } .medax select { max-width: 130px; } .medax .trip input { width: 54px; }
.medax .nowrap { white-space: nowrap; } .medax .ib { padding: 2px 6px; }
.medax .alet { min-width: 30px; padding: 2px 0 !important; }
.medmsg { margin: 8px 0 0; font-size: 13px; } .medmsg.bad { color: #e5534b; } .medmsg.ok { color: #3fb950; }
.medpw { font-size: 12px; } .medpw.bad, .medpw:not(:empty) { color: #e5534b; } #medTpl { max-width: 260px; }
.trip3 { display: inline-flex; gap: 3px; white-space: nowrap; } .medax .trip3 input { width: 52px; }
#summary label.chk { white-space: nowrap; cursor: pointer; color: var(--fg); pointer-events: auto; }
#summary input[data-ch] { vertical-align: -2px; margin: 0 2px 0 0; }
.medinfo { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0 10px; font-size: 12.5px; }
.medinfo summary { cursor: pointer; font-weight: 600; }
.medinfo ul { margin: 2px 0 6px 18px; padding: 0; }
.medinfo p { margin: 6px 0 2px; }
.vfy { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; background: #e8a33c33; color: #b8741a; }
input.vfy-f { box-shadow: inset 3px 0 0 #e8a33c; }
#medFind { margin-right: 8px; }
/* ---------------------------------------------------------------- G-code Copilot (copilot.js) */
#bCopilot { display: inline-flex; align-items: center; gap: 4px; position: relative; }
#bCopilot svg { flex: 0 0 auto; }
.cp-badge { display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
.cp-badge.p { background: #e03131; color: #fff; } .cp-badge.w { background: var(--warn); color: #000; } .cp-badge.ok { background: #2f9e44; color: #fff; }
#copilot { right: 8px; top: 8px; width: min(430px, calc(100% - 16px)); max-height: calc(100% - 70px); display: flex; flex-direction: column; padding: 0; z-index: 7; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 12.5px; }
#copilot[hidden] { display: none; }
#copilot .cp-h, #cpExplain .cp-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
#copilot .cp-h b, #cpExplain .cp-h b { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#copilot .cp-sum { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-hb { display: flex; gap: 4px; margin-left: auto; } .cp-hb button { font-size: 12px; padding: 2px 8px; }
#copilot .cp-list { overflow: auto; padding: 6px 8px; flex: 1 1 auto; }
.cp-i { border: 1px solid var(--line); border-left: 4px solid var(--n); border-radius: 6px; margin: 0 0 6px; background: var(--panel2); }
.cp-i.problem { border-left-color: #e03131; } .cp-i.warning { border-left-color: var(--warn); } .cp-i.info { border-left-color: var(--a); }
.cp-i summary { cursor: pointer; display: flex; gap: 6px; align-items: baseline; padding: 6px 8px; list-style: none; }
.cp-i summary::-webkit-details-marker { display: none; }
.cp-sv { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cp-i.problem .cp-sv { color: #e03131; } .cp-i.warning .cp-sv { color: var(--warn); }
.cp-t { flex: 1; font-weight: 600; } .cp-l1 { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.cp-b { padding: 0 10px 8px; } .cp-b p { margin: 4px 0; } .cp-b ul { margin: 4px 0; padding-left: 18px; color: var(--muted); }
.cp-ln { display: inline-block; padding: 0 5px; margin: 1px 0; border-radius: 4px; background: var(--btn); text-decoration: none; font: 11.5px ui-monospace, monospace; }
.cp-ln:hover { background: var(--btnh); } .cp-more { color: var(--muted); }
.cp-fx { display: flex; flex-wrap: wrap; gap: 6px; } .cp-fx button { font-size: 12px; }
.cp-ok { padding: 12px 6px; color: var(--fg); }
#copilot .cp-foot { border-top: 1px solid var(--line); padding: 5px 10px; color: var(--muted); font-size: 11px; }
#cpExplain { position: fixed; z-index: 60; padding: 0; max-height: 70vh; overflow: auto; gap: 0; font-size: 12.5px; }
#cpExplain .cp-raw { display: block; margin: 8px 10px 4px; padding: 5px 7px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; font: 12px ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }
#cpExplain table { border-collapse: collapse; margin: 4px 10px 6px; width: calc(100% - 20px); }
#cpExplain th, #cpExplain td { text-align: left; vertical-align: top; padding: 3px 6px; border-bottom: 1px solid var(--line); }
#cpExplain th { white-space: nowrap; font: 600 12px ui-monospace, monospace; color: var(--acc); } #cpExplain .cp-st th { font: 600 12px system-ui, sans-serif; color: var(--muted); }
#cpExplain h4 { margin: 8px 10px 0; font-size: 12px; } #cpExplain p { margin: 4px 10px 8px; }
#cpExplain .cp-hb button { width: auto; display: inline-block; text-align: center; border: 1px solid var(--line); background: var(--btn); }
@media (max-width: 820px) {
  #bCopilot .cp-bl { display: none; }
  #copilot { left: 0; right: 0; top: auto; bottom: 48px; width: 100%; max-height: 62%; border-radius: 10px 10px 0 0; }
}
/* v1.8.6 axis flips: DRO quick toggles + machine dialog (Windfire Admin) */
#dro .flipb { pointer-events: auto; padding: 0 4px; margin-left: 2px; font-size: 11px; line-height: 15px; min-width: 0; border-radius: 4px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; vertical-align: middle; }
#dro .flipb.on { background: #ff7a1a; border-color: #ff7a1a; color: #fff; }
.flipd { color: #e8701a; font-weight: 600; }
#machForm fieldset.flipset { border: 1px solid #ff7a1a; border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
#machForm fieldset.flipset legend { font-weight: 600; padding: 0 4px; }
#machForm fieldset.flipset label { margin-right: 14px; }
#machForm fieldset.flipset p { margin: 4px 0; }
.bp-note.bp-warnc { color: #e8701a; font-weight: 600; }

/* v1.8.7 (Claude): assumed program units notice + switch */
button.unitsw { font: inherit; font-size: 11px; padding: 1px 7px; margin-left: 4px; border-radius: 10px; border: 1px solid #ff7a1a; background: transparent; color: var(--fg); cursor: pointer; pointer-events: auto; }
button.unitsw:hover, button.unitsw:focus-visible { background: #ff7a1a; color: #fff; outline: none; }
.note.units { color: #e8a33c; }
/* v1.8.9 (Claude): Edit selected lines > Move X Y Z */
.bpop .bp-mvrow { gap: 10px; flex-wrap: wrap; }
.bpop .bp-mv { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.bpop .bp-mv .iu small { margin-left: 4px; opacity: .7; font-weight: 400; }
.bpop .bp-mv input { width: 84px; }
/* v1.9.0 machine picker + machine search (js/machinesearch.js): toolbar popover, switch prompt, machine editor "Start from" */
.machpick { display: inline-flex; align-items: center; gap: 6px; max-width: 230px; text-align: left; }
.machpick #machPickName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.machpick .mpcaret { opacity: .7; font-size: 10px; flex: 0 0 auto; }
.machpick[aria-expanded="true"] { border-color: var(--acc); }
@media (max-width: 1400px) { .tb .machpick { max-width: 180px; } }
@media (max-width: 820px) { .tb .machpick { max-width: 150px; } }
.msp { position: fixed; z-index: 40; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.msp[hidden] { display: none; }
.msp.msp-full { left: 6px !important; right: 6px; width: auto !important; border-radius: 10px; }
.msp-in { position: absolute; left: 0; top: calc(100% + 4px); width: min(540px, 86vw); max-height: 60vh; }
.msp-in.msp-full { position: fixed; top: 8px; max-height: calc(100dvh - 16px); }
.medstart { position: relative; display: inline-block; }
.msx { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
.msx-q { width: 100%; box-sizing: border-box; font-size: 14px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.msx-q:focus { outline: 2px solid var(--acc); outline-offset: 0; }
.msx-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.msx-cg { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.msx-cl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.msx-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 12px; background: var(--btn); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
.msx-chip[aria-pressed="true"], select.msx-chip.on { background: var(--sel); border-color: var(--acc); }
select.msx-chip { max-width: 190px; padding-right: 4px; }
.msx-count { font-size: 11px; color: var(--muted); }
.msx-list { overflow-y: auto; min-height: 80px; max-height: 52vh; border-top: 1px solid var(--line); padding-top: 2px; overscroll-behavior: contain; }
.msp-full .msx-list { max-height: none; flex: 1 1 auto; }
.msx-in .msx-list { max-height: 190px; }
.msx-gh { position: sticky; top: 0; z-index: 1; background: var(--panel); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px 2px; }
.msx-row { padding: 5px 8px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.msx-row.act { background: var(--sel); }
.msx-row.cur { box-shadow: inset 3px 0 0 var(--acc); }
.msx-l1 { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.msx-n { font-size: 13px; min-width: 0; }
.msx-cur { color: var(--muted); font-size: 11px; }
.msx-bs { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.msx-badge { font-size: 10px; padding: 0 5px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.msx-fit { font-size: 11.5px; color: var(--fg); opacity: .9; }
.msx-fit.msx-dim { color: var(--muted); opacity: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-fl { color: var(--muted); }
.msx mark { background: rgba(255,122,26,.28); color: inherit; border-radius: 2px; padding: 0 1px; }
.msx-empty { padding: 14px 8px; color: var(--muted); text-align: center; }
.msx-empty button { margin-left: 6px; }
.msp-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; }
.msp-foot select { max-width: 200px; }
.msp-flip { display: inline-flex; gap: 6px; align-items: center; }
#suggest .sg-pick .msx { width: 100%; }
#suggest .sg-pick > .sg-lbl { flex: 0 0 auto; font-size: 12px; opacity: .85; }
#suggest .sg-pick > .msx { flex: 0 0 auto; }
@media (pointer: coarse) { .msx-row { padding: 8px; } .msx-chip { padding: 5px 10px; font-size: 12.5px; } }
#suggest .msx span { flex: 0 1 auto; } #suggest .msx .msx-n { flex: 1 1 auto; } #suggest .msx .msx-bs { flex: 0 0 auto; }
/* v1.9.2 (Claude): toolbar always on one row - js/toolbar.js steps items into the More menu (Windfire Admin) */
.tb { flex-wrap: wrap; }
.tbg { display: inline-flex; align-items: center; gap: 4px; }
#bMach .ml { display: none; }
#ctlSel { max-width: 150px; }
#top.tbc-1 #bDocs { display: none; }
#top.tbc-2 .tb .tbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#top.tbc-3 .tb #bEdit { display: none; } #top.tbc-3 #bEdit2 { display: block; }
#top.tbc-3 #ctlSel { max-width: 118px; } #top.tbc-3 #machPickName { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
#top.tbc-4 .brand .bt { font-size: 0; } #top.tbc-4 .brand .bt b { font-size: 14px; } #top.tbc-4 .brand .by { display: none; }
#top.tbc-5 #bCopilot .cp-bl { display: none; }
#top.tbc-5 #bPanels, #top.tbc-5 #bMore { font-size: 0; padding-left: 9px; padding-right: 9px; }
#top.tbc-5 #bPanels::before { content: '\25A6'; font-size: 15px; } #top.tbc-5 #bMore::before { content: '\2630'; font-size: 15px; }
#tbOvf { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
#tbOvf[hidden] { display: none; }
#tbOvf .inovf { width: 100%; max-width: none !important; }
#tbOvf select.inovf { padding: 6px 8px; }
#tbOvf .tbg.inovf { display: flex; gap: 8px; } #tbOvf .tbg.inovf .tbl { position: static; width: auto; height: auto; clip: auto; font-size: 13px; } #tbOvf .tbg.inovf select { flex: 1; max-width: none; }
#tbOvf #bMach.inovf .ml { display: inline; }
#tbOvf .seg.inovf { display: flex; } #tbOvf .seg.inovf button { flex: 1; text-align: center; }
#tbOvf #bStock.inovf { text-align: left; }
@media (max-width: 1000px) { #top { flex-wrap: wrap; } #top .tb { flex: 1 1 100%; } }
#top.tbc-6 #bAccount { font-size: 0; width: 34px; height: 30px; padding: 0; background-repeat: no-repeat; background-position: center; background-size: 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E"); }
#top.tbc-6 #machPickName { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
#top.tbc-6 .tb > button, #top.tbc-6 .tb .menu > button { padding-left: 7px; padding-right: 7px; }
#tbOvf #bOpen.inovf { order: -1; font-weight: 600; }
@media (max-width: 1100px) { .tb .tbl[for=ctlSel] { display: inline; } #ctlSel { display: inline-block; } }
#top.tbc-6 #bCopilot > svg { display: none; } #top.tbc-6 #machPickName { max-width: 66px; }
/* v1.9.3 Move X Y Z: unit of the amounts + blocked lines (Windfire Admin) */
.bpop .bp-mvunit { gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.bpop .bp-mvunit small { color: var(--muted); }
.bpop .bp-useg button { min-width: 44px; }
.bp-warn p.bad { color: #d93636; background: color-mix(in srgb, #d93636 12%, transparent); font-weight: 600; }
.bp-tab tr.blk td.av .why { color: #d93636; font-style: normal; }
/* v1.9.5 (Claude): clearer machine / stock / tool settings button */
#bMach { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
#bMach .gear { flex: 0 0 auto; color: var(--acc); }
#top.tbc-5 #bMach .bl { display: none; } #top.tbc-5 #bMach .gear { width: 19px; height: 19px; }
#tbOvf #bMach.inovf .bl { display: none; } #tbOvf #bMach.inovf { font-weight: 400; }
/* v1.9.5 (Claude): wait / progress indicators */
#topProg { position: relative; height: 3px; margin-top: -3px; z-index: 25; overflow: hidden; background: transparent; pointer-events: none; }
#topProg[hidden] { display: none; }
#topProg i { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--acc); border-radius: 2px; animation: tpmove 1.2s ease-in-out infinite; }
@keyframes tpmove { from { left: -40%; } to { left: 100%; } }
#busy { display: flex; align-items: center; gap: 10px; padding: 10px 16px; z-index: 29; }
#busy[hidden] { display: none; }
#busy .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--acc); animation: bspin .8s linear infinite; flex: 0 0 auto; }
@keyframes bspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #topProg i, #busy .spin, #bootLoad .bl-bar i { animation-duration: 3s; } }

/* app switcher (NC Viewer / CAM) - v1.9.6 */
.appsw { position: relative; display: inline-flex; }
.appsw .bt { background: none; border: 0; color: inherit; font: inherit; font-size: 15px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.appsw .bt:hover, .appsw .bt[aria-expanded="true"] { background: var(--btnh); }
.appsw .caret { font-size: 10px; opacity: .7; }
#appSwMenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 10px 30px #0007; display: flex; flex-direction: column; }
#appSwMenu[hidden] { display: none; }
#appSwMenu a { color: inherit; text-decoration: none; padding: 7px 10px; border-radius: 6px; font-weight: 600; }
#appSwMenu a small { display: block; font-weight: 400; color: var(--muted); }
#appSwMenu a em { font-style: normal; font-size: 10px; background: var(--acc); color: #111; border-radius: 8px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
#appSwMenu a:hover, #appSwMenu a.cur { background: var(--btnh); }
/* v1.9.16 Open window (Windfire Admin) */
dialog.wfopen { width: min(820px, 96vw); max-width: 96vw; max-height: 90vh; padding: 14px 18px 18px; overflow: auto; border-top: 3px solid var(--acc); }
.wfopen .op-head { display: flex; align-items: flex-start; gap: 10px; } .wfopen h2 { flex: 1; margin: 0 0 10px; font-size: 18px; }
.wfopen .op-x { min-width: 44px; min-height: 44px; padding: 2px 9px; }
.wfopen .op-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; border: 2px dashed var(--line); border-radius: 10px; background: var(--panel2); color: var(--muted); text-align: center; }
.wfopen .op-zone p { margin: 0 0 6px; font-size: 15px; color: var(--fg); } .wfopen .op-zone svg { color: var(--acc); }
.wfopen .op-zone.over { border-color: var(--acc); background: var(--sel); }
.wfopen .op-browse { padding: 8px 22px; font-size: 14px; font-weight: 600; }
.wfopen .op-msg { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: 6px; }
.wfopen .op-h { margin: 16px 0 2px; font-size: 15px; } .wfopen .op-h2 { margin: 14px 0 0; font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.wfopen .op-g { margin: 8px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wfopen .op-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.wfopen .op-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 10px; background: var(--panel2); }
.wfopen .op-n { font-weight: 600; } .wfopen .op-m { font-size: 12px; color: var(--muted); }
.wfopen button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (max-width: 520px) { dialog.wfopen { padding: 10px 12px 14px; } .wfopen .op-cards { grid-template-columns: 1fr; } .wfopen .op-zone { padding: 16px 10px; } }
#ncReject { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 45; display: flex; gap: 10px; align-items: center; max-width: min(560px, 94vw); padding: 10px 14px; background: var(--panel); border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }

/* The active line supplies native text selection and IME over the virtual, coloured code rows. */
.ed-line-input {
  position: absolute; height: 20px; box-sizing: border-box; margin: 0; padding: 0; border: 0;
  resize: none; outline: none; overflow: hidden; white-space: pre; background: transparent;
  color: transparent; caret-color: var(--fg); font: inherit; line-height: 20px; tab-size: inherit;
  box-shadow: inset 0 -1px 0 var(--acc);
}
.ed-line-input::selection { color: var(--fg); background: var(--sel); }
.ed-row .tx { cursor: text; }

.plot-draft { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.plot-draft > span { margin-right: auto; color: var(--warn); font-weight: 600; }
.plot-auto { display: block; padding: 6px; }
.plot-stale { position: absolute; z-index: 12; top: 8px; left: 50%; max-width: 70%; transform: translateX(-50%); border-radius: 5px; padding: 4px 9px; color: var(--panel); background: var(--warn); white-space: nowrap; pointer-events: none; }
.plot-outdated #view, .plot-outdated #summary, .plot-outdated #copilot, .plot-outdated #play { opacity: .52; }
.plot-outdated #copilot input, .plot-outdated #copilot button:not(.cp-x) { pointer-events: none; }
.plot-draft-dialog { max-width: min(400px, 91vw); }
.plot-draft-dialog .row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) {
  body.drawer #left { bottom: var(--code-keyboard, 0px); max-height: calc(100% - var(--code-keyboard, 0px)); }
}
