/* Wire Bond Bench, part of wirebond.svg: https://github.com/anfroholic/wirebond.svg. (c) Andrew Wingate, MIT licence.
   Evezor palette, as in evezor_ide/app/static/core/style.css and macro_sharer/app/static/style.css. */
:root {
  --green: #068770; --magenta: #d93aa7; --blue: #3ea9da;
  --shade-1: #0b6f5d; --shade-2: #105649; --shade-3: #12302b; --shade-4: #0c1311;
  --surface: #12302b; --element: #105649; --inset: #0c1311; --panel: #0f2420;
  --ink: #d4d4d4; --ink-high: #fef0fa; --muted: #7ba69c; --line: #1c4a40;
  --brand-ink: #36d9bb; --ok: #36d9bb; --warn: #e8a33d; --bad: #ff6b6b; --info: #8ad6fa;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--shade-4); color: var(--ink); font: 13px/1.45 var(--font); display: flex; flex-direction: column; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
kbd { font: 10.5px var(--mono); color: var(--muted); margin-left: 6px; }
small { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 0.93em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

#top { flex: 0 0 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--shade-3); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; color: var(--ink-high); font-size: 15px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
/* Logo: concept 28 "Period ball" from docs/logo/marks.html, built by docs/logo/make_brand.py. */
.brand .logo { display: block; height: 38px; width: auto; flex: none; }
.brand .logolink { display: block; flex: none; border-radius: 4px; }
.brand .app { padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); line-height: 20px; }
.brand .sub { font-weight: 400; font-size: 12px; color: var(--muted); }
.grow { flex: 1; }
#busy { display: flex; align-items: center; gap: 10px; margin-left: 18px; color: var(--ink-high); font-size: 12px; white-space: nowrap; }
.bar { width: 170px; height: 5px; background: var(--inset); border-radius: 3px; overflow: hidden; display: inline-block; }
.bar i { display: block; height: 100%; width: 0; background: var(--magenta); transition: width .12s; }

.btn { background: var(--element); border: 1px solid var(--shade-1); border-radius: 5px; padding: 5px 11px; cursor: pointer; color: var(--ink-high); white-space: nowrap; }
.btn:hover { background: var(--shade-1); }
.btn.primary { background: var(--green); border-color: #08a287; font-weight: 600; }
.btn.primary:hover { background: #079c82; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--ink-high); border-color: var(--shade-1); background: transparent; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--blue); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }

.menuwrap { position: relative; }
.menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 40; background: var(--shade-3); border: 1px solid var(--shade-1); border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.55); min-width: 310px; padding: 4px; }
.menu.right { left: auto; right: 0; }
.menu.pad { padding: 10px 12px; min-width: 230px; }
.menu > button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 4px; cursor: pointer; color: var(--ink-high); }
.menu > button:hover { background: var(--element); }
.menu > button[disabled] { opacity: .45; cursor: not-allowed; background: none; }
.menu small { display: block; font-size: 11.5px; }
.menu h5 { margin: 8px 0 4px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.menu h5:first-child { margin-top: 0; }
.menu label { display: flex; align-items: center; gap: 7px; padding: 2px 0; cursor: pointer; }

#layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 318px minmax(0, 1fr) 372px; }
#left, #right { background: var(--panel); overflow-y: auto; min-height: 0; }
#left { border-right: 1px solid var(--line); padding: 8px; }
#right { border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
#centre { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

#toolbar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--shade-1); border-radius: 5px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--ink); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--element); }
.seg button.on { background: var(--green); color: #fff; }
.seg button.on kbd { color: #c6efe6; }

#stage { flex: 1; min-height: 0; position: relative; background: var(--shade-4); }
.canvasbox { position: absolute; inset: 0; overflow: hidden; }
.canvasbox canvas { display: block; touch-action: none; }
.hint3d { position: absolute; left: 12px; top: 8px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.hint3d { white-space: nowrap; }
.hint3d input[type=range] { width: 90px; accent-color: var(--magenta); }
#coord { position: absolute; right: 12px; bottom: 8px; font: 11.5px var(--mono); color: var(--muted); pointer-events: none; }
#dropHint { position: absolute; inset: 10px; border: 2px dashed var(--magenta); border-radius: 10px; background: rgba(12,19,17,.82); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ink-high); text-align: center; z-index: 20; pointer-events: none; }
#dropHint small { display: block; font-size: 13px; margin-top: 4px; }

#empty { position: absolute; inset: var(--toolbar-h, 41px) 0 0 0; z-index: 5; display: flex; padding: 26px; overflow: auto; background: var(--shade-4); }
.welcome { max-width: 860px; margin: auto; padding-block: 8px 4px; }
.welcome .hero { margin-bottom: 22px; }
/* The wirebond.svg logo over the welcome, the same mark as the top bar, larger. */
.welcome .herologo { display: block; height: 64px; width: auto; margin: 0 0 14px -6px; }
.welcome h1 { color: var(--ink-high); font-size: 30px; font-weight: 600; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.01em; }
.welcome p { color: var(--ink); margin: 0 0 18px; font-size: 14px; }
.welcome .lede { max-width: 660px; font-size: 15px; line-height: 1.6; }
.welcome .btn.big { padding: 8px 16px; font-size: 13.5px; text-decoration: none; }
.welcome .droptip { display: block; margin-top: 10px; font-size: 12px; }
.welcome .status { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.welcome .status b { color: var(--ink); font-weight: 600; }
.welcome .status .repolinks { display: block; margin-top: 6px; }
.welcome .status .madewith { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.welcome .status .madewith img { width: 22px; height: 22px; flex: none; }
#top .btn .gh { vertical-align: -2px; margin-right: 6px; }
.welcome h2 { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; }
.exgroup { margin-bottom: 14px; }
.exgroup h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-high); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.exgroup h3 small { font-weight: 400; font-size: 12px; }
.excards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.excard { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; transition: border-color .12s, transform .12s; }
.excard:hover { border-color: var(--green); transform: translateY(-1px); }
.excard .t { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.excard b { color: var(--ink-high); font-size: 13px; }
.excard .t > span { color: var(--ink); font-size: 12px; line-height: 1.45; }
.excard .t > .ext { font: 11px var(--mono); color: var(--muted); margin-top: 3px; }
.exart { display: block; width: 100%; height: 84px; background: var(--inset); border-bottom: 1px solid var(--line); }
.exart .pcb { fill: #0e3b2a; stroke: #1d6a4d; stroke-width: 1; }
.exart .part { fill: #8a8f96; }
.exart .lands rect { fill: #d4a54a; }
.exart .die { fill: #2a2f3a; stroke: #6c7686; stroke-width: 1; }
.exart .die.fp { fill: none; stroke-dasharray: 3 2; }
.exart .art { fill: #4fb79d; opacity: .55; }
.exart .logo { fill: var(--magenta); }
.exart .pads rect { fill: #e0ae4a; }
.exart .wires line { stroke: #f0c860; stroke-width: 1.1; }
.exart .wires line.d2d { stroke: #5aa9e6; }
.exart .wires line.stk { stroke: #9b7fd4; }
.exart .bank { fill: var(--magenta); opacity: .45; }
.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.flow > div { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.flow b { display: flex; align-items: center; gap: 7px; color: var(--ink-high); margin-bottom: 5px; }
.flow b i { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--element); color: var(--brand-ink); font-size: 11px; }
.flow .ext { margin-top: auto !important; padding-top: 7px; }
.flow span { color: var(--ink); font-size: 12.5px; }
.flow .ext { display: block; font: 11.5px var(--mono); color: var(--muted); margin-top: 7px; }
.welcome .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

#bottom { flex: 0 0 172px; display: flex; border-top: 1px solid var(--line); min-height: 0; }
#loopBox { position: relative; flex: 1; min-width: 0; }
#inspector { flex: 0 0 264px; background: var(--panel); border-left: 1px solid var(--line); padding: 9px 11px; overflow-y: auto; font-size: 12.5px; }
#inspector h4 { margin: 0 0 6px; color: var(--ink-high); font-size: 13px; font-weight: 600; }
#inspector dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 0 0 7px; }
#inspector dt { color: var(--muted); }
#inspector dd { margin: 0; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
#inspector .acts { display: flex; flex-wrap: wrap; gap: 5px; }
#inspector input, #inspector select { width: 100%; }

/* left steps */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
.step > h3 { margin: 0; padding: 8px 10px 6px; font-size: 13px; font-weight: 600; color: var(--ink-high); display: flex; align-items: center; gap: 7px; }
.step > h3 .num { width: 18px; height: 18px; border-radius: 50%; background: var(--element); color: var(--ink-high); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step.done > h3 .num { background: var(--green); }
.step > h3 small { margin-left: auto; font-weight: 400; font-size: 11.5px; }
.step .body { padding: 0 10px 10px; }
.drop { display: block; width: 100%; border: 1px dashed var(--shade-1); border-radius: 6px; padding: 9px 10px; background: var(--inset); text-align: left; cursor: pointer; color: var(--ink); }
.drop:hover, .drop.over { border-color: var(--magenta); background: #15211e; }
.drop b { color: var(--ink-high); font-weight: 600; display: block; overflow-wrap: anywhere; }
.drop small { font-size: 11.5px; }
.field { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; }
.field > span { color: var(--muted); }
.field.wide { grid-template-columns: 1fr; }
input[type=text], input[type=number], select { background: var(--inset); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; min-width: 0; width: 100%; }
input[type=number] { font-family: var(--mono); font-size: 12px; }
input[type=range] { accent-color: var(--green); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.duo .field { grid-template-columns: auto minmax(0, 1fr); }
.note { margin-top: 7px; font-size: 12px; color: var(--muted); }
.note b { color: var(--ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.stats div { background: var(--inset); border-radius: 5px; padding: 4px 7px; }
.stats b { display: block; font: 600 13.5px var(--mono); color: var(--ink-high); }
.stats span { font-size: 11px; color: var(--muted); }
.warnline { margin-top: 7px; font-size: 12px; color: var(--warn); }
/* The checks at the zone's edges, under the tolerance */
.zoneout { margin: 4px 0 0; padding-left: 16px; font: 11.5px var(--mono); }
.zoneout .err { color: var(--bad); }
.zoneout .warn { color: var(--warn); }
details.more { margin-top: 8px; }
details.more > summary { cursor: pointer; color: var(--blue); font-size: 12px; }
.layerlist { max-height: 210px; overflow-y: auto; margin-top: 5px; background: var(--inset); border-radius: 5px; padding: 4px 6px; }
.layerlist label { display: grid; grid-template-columns: 16px 14px 1fr auto; gap: 6px; align-items: center; font: 11.5px var(--mono); padding: 1px 0; cursor: pointer; }
.layerlist input[type=color] { width: 14px; height: 14px; padding: 0; border: 0; background: none; cursor: pointer; }
.layerlist small { font: 10.5px var(--mono); }

/* right */
#tabs { display: flex; flex: 0 0 auto; border-bottom: 1px solid var(--line); background: var(--shade-3); }
#tabs button { flex: 1; background: none; border: 0; padding: 8px 4px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
#tabs button:hover { color: var(--ink-high); }
#tabs button.on { color: var(--ink-high); border-bottom-color: var(--magenta); }
#tabs .count { font: 10.5px var(--mono); padding: 0 5px; border-radius: 8px; margin-left: 4px; background: var(--element); color: var(--ink-high); }
#tabs .count.warn { background: var(--warn); color: #201400; }
#tabs .count.bad { background: var(--bad); color: #2c0606; }
#tabBody { flex: 1; overflow-y: auto; padding: 10px; min-height: 0; }
.lead { color: var(--ink); margin: 0 0 9px; font-size: 12.5px; }
.regime { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; margin-bottom: 7px; padding: 8px 10px; cursor: pointer; display: block; width: 100%; text-align: left; }
.regime:hover { border-color: var(--magenta); }
.regime.on { border-color: var(--green); box-shadow: inset 3px 0 0 var(--green); }
.regime.off { opacity: .55; cursor: default; }
.regime.off:hover { border-color: var(--line); }
.regime header { display: flex; align-items: center; gap: 6px; }
.regime header b { color: var(--ink-high); font-weight: 600; }
.regime header .tag { margin-left: auto; }
.regime p { margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.metrics div { font-size: 10.5px; color: var(--muted); }
.metrics b { display: block; font: 600 12.5px var(--mono); color: var(--ink-high); }
.metrics b.warn { color: var(--warn); }
.metrics b.bad { color: var(--bad); }
.tag { font-size: 10.5px; padding: 0 6px; border-radius: 8px; background: var(--element); color: var(--ink-high); white-space: nowrap; }
.tag.ok { background: #0d4a3f; color: var(--ok); }
.tag.warn { background: #4a3510; color: var(--warn); }
.tag.fail { background: #4a1a1a; color: var(--bad); }
.tag.info { background: #123a4a; color: var(--info); }
.tag.na { background: #2b3a37; color: var(--muted); }
.check { border-bottom: 1px solid var(--line); padding: 7px 2px; cursor: pointer; }
.check:hover, .check.on { background: var(--surface); }
.check.hit { box-shadow: inset 3px 0 0 var(--magenta); padding-left: 8px; }
.check header { display: flex; align-items: center; gap: 6px; }
.check header b { font-weight: 500; color: var(--ink-high); }
.check header .tag { margin-left: auto; }
.check .val { font: 12px var(--mono); }
.check small { display: block; font-size: 11.5px; }
.check .limit { display: inline-flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.check .limit input { width: 58px; padding: 0 4px; }
table.wires { width: 100%; border-collapse: collapse; font-size: 12px; }
table.wires th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; position: sticky; top: -10px; background: var(--panel); padding: 2px 4px; }
table.wires td { padding: 2px 4px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
table.wires td.net { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
table.wires tr { cursor: pointer; scroll-margin-top: 24px; }
table.wires tr:hover td { background: var(--surface); }
table.wires tr.on td { background: #3b1f35; }
table.wires:focus { outline: none; }
table.wires:focus-visible { outline: 1px solid var(--shade-1); outline-offset: 1px; }
#inspector .bulkpin { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--ink); }
#inspector .bulkpin input { width: auto; margin: 0; }
table.wires select { padding: 0 2px; font-size: 11px; font-family: var(--mono); }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.type { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin-bottom: 8px; }
.type.on { border-color: var(--magenta); box-shadow: inset 3px 0 0 var(--magenta); }
.type .head { display: grid; grid-template-columns: 16px 1fr auto; gap: 7px; align-items: center; }
.type .head input[type=color] { width: 16px; height: 16px; padding: 0; border: 0; background: none; cursor: pointer; }
.type .head input[type=text] { font-weight: 600; }
.type svg { display: block; width: 100%; height: 64px; background: var(--inset); border-radius: 4px; margin: 6px 0; }
.type .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.type label { display: block; font-size: 11px; color: var(--muted); }
.type label.span2 { grid-column: span 2; }
.type label.span4 { grid-column: span 4; }
.type .moves { font-family: var(--mono); font-size: 12px; }
.bad-input { border-color: var(--bad) !important; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) 96px 20px; gap: 5px; margin-top: 5px; align-items: center; }
.rule input { font-family: var(--mono); font-size: 12px; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; }
.x:hover { color: var(--bad); }
.dielist { display: grid; gap: 3px; margin-bottom: 8px; }
.dierow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 7px; align-items: center; background: var(--inset); border: 1px solid transparent; border-radius: 5px; padding: 3px 7px; cursor: pointer; font-size: 12px; }
.dierow:hover { border-color: var(--shade-1); }
.dierow.on { border-color: var(--blue); }
.dierow b { font: 600 12px var(--mono); color: var(--ink-high); }
.dierow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dierow small { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* Tips on controls and values (js/tips.js). A manual popover, so it sits above the DRC dialog too; the UA's centring is undone here. */
#uitip { position: fixed; inset: auto; margin: 0; z-index: 70; pointer-events: none; overflow: visible; max-width: 320px; width: max-content; padding: 6px 9px; background: var(--inset); color: var(--ink-high); border: 1px solid var(--shade-1); border-radius: 5px; box-shadow: 0 6px 22px rgba(0,0,0,.55); font: 12px/1.45 var(--font); text-align: left; white-space: normal; }
#uitip p { margin: 0; }
#uitip p + p { margin-top: 5px; }
#uitip.why { border-color: var(--warn); }
.info { display: inline-block; margin-left: 3px; color: var(--blue); font-size: 12px; line-height: 1; font-weight: 400; cursor: help; user-select: none; vertical-align: baseline; }
.info:hover, .info:focus-visible { color: var(--ink-high); }
.loopinfo { position: absolute; left: 8px; bottom: 5px; font-size: 13px; }
#tip { position: fixed; z-index: 50; pointer-events: none; background: #06100e; border: 1px solid var(--shade-1); border-radius: 5px; padding: 4px 8px; font-size: 12px; color: var(--ink-high); max-width: 300px; }
#tip small { display: block; font-size: 11.5px; }
#toasts { position: fixed; left: 332px; bottom: 186px; z-index: 60; display: flex; flex-direction: column; gap: 6px; max-width: 430px; pointer-events: none; }   /* text only, so clicks reach the plan under it */
.toast { background: var(--shade-3); border: 1px solid var(--shade-1); border-left: 4px solid var(--green); border-radius: 5px; padding: 7px 11px; color: var(--ink-high); box-shadow: 0 6px 20px rgba(0,0,0,.5); font-size: 12.5px; }
.toast.err { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }

@media (max-width: 1180px) { #layout { grid-template-columns: 280px minmax(0, 1fr) 310px; } .brand .sub { display: none; } .metrics { grid-template-columns: repeat(3, 1fr); } }

/* DRC rules: tier marks, and the panel. A placeholder is dashed and grey so it can't pass for a sourced number. */
.tier { font-size: 10px; padding: 0 5px; border-radius: 3px; white-space: nowrap; border: 1px solid; letter-spacing: .02em; }
.tier.standard { color: #36d9bb; border-color: var(--green); background: #0b3a32; }
.tier.vendor { color: #8ad6fa; border-color: var(--blue); background: #10324a; }
.tier.thumb { color: #f39bd8; border-color: var(--magenta); background: #3d1534; }
.tier.placeholder { color: #c9c9c9; border-style: dashed; border-color: #8a8a8a; background: repeating-linear-gradient(135deg, #2a2a2a 0 4px, #333 4px 8px); font-style: italic; }
.check header .tier { margin-left: auto; }
.check header .tier + .tag { margin-left: 0; }
.tag.off { background: #2b3a37; color: var(--muted); text-decoration: line-through; }
#drc { width: min(1040px, 94vw); max-height: 88vh; padding: 0; background: var(--shade-3); color: var(--ink); border: 1px solid var(--shade-1); border-radius: 8px; box-shadow: 0 16px 48px rgba(0,0,0,.6); }
#drc::backdrop { background: rgba(4, 10, 9, .6); }
#drcBody { padding: 0 16px 14px; }
/* Diagram view: the .wb.svg on white, as a browser shows the file, its code, or both side by side. */
#diagTools { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
#diagTools > span { display: inline-flex; gap: 4px; }
#diagTools label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; cursor: pointer; }
#diagTools input { accent-color: var(--magenta); margin: 0; }
#diagBox { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#diagBox.both { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.diagpane { min-height: 0; overflow: auto; margin: 0; }
#diagPicture { background: #fff; cursor: grab; }
#diagPicture.drag { cursor: grabbing; }
#diagCode { background: var(--inset); padding: 10px 14px 28px; font: 12px/1.55 var(--mono); color: var(--ink); white-space: pre; tab-size: 2; }
#diagBox.both #diagCode { border-left: 1px solid var(--line); }
#diagCode.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
#diagMsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center; background: var(--shade-4); color: var(--muted); font-size: 14px; }
#diagMeta { position: absolute; right: 10px; bottom: 8px; font: 11px var(--mono); color: var(--muted); background: rgba(12, 19, 17, .88); border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; }
#diagMeta:empty { display: none; }
.sx-t { color: var(--blue); }
.sx-a { color: var(--muted); }
.sx-wb { color: #f39bd8; }
.sx-v { color: #e3c98f; }
.sx-c { color: var(--muted); font-style: italic; }
#drc .drchead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 12px 0 8px; background: var(--shade-3); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
#drc h2 { margin: 0; font-size: 16px; color: var(--ink-high); font-weight: 600; }
#drc h3 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
#drc a { color: var(--blue); }
#drc .lead .tier { margin: 0 2px; }
.drcrule { display: grid; grid-template-columns: 34px minmax(0, 1fr) 190px; gap: 10px; align-items: start; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.drcrule.off { opacity: .55; }
.drcrule .key { font: 600 12px var(--mono); color: var(--ink-high); padding-top: 1px; }
.drcrule .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drcrule .top b { font-weight: 500; color: var(--ink-high); }
.drcrule .meaning { font-size: 12.5px; }
.drcrule .meta { font-size: 11.5px; color: var(--muted); }
.drcrule .ctl { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.drcrule .ctl input[type=number] { width: 78px; }
.drcrule .ctl .unit { min-width: 34px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .flow { grid-template-columns: minmax(0, 1fr); } }
