/* Shared by every page: the language / design menu, and the DATASHEET and LCD designs.
   The pixel design is each page's own <style>; [data-theme="datasheet"] (set by site.js on <html>)
   repaints the same markup as a printed technical reference sheet (design/concepts/4-datasheet). */

:root { --bus-off: #3d3a52; --bus-idle: #5f574f; --bus-act0: #83769c; --bus-on: #ffec27; }

/* ---------- a page shown inside index.html: the shell has the menu ---------- */
html.embedded body { padding-top: 0; }
html.embedded .topnav { display: none; }

/* ---------- menu, right end of the top bar ---------- */
.topnav .prefs { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topnav .pgroup { display: flex; border: 4px solid #000; }
.topnav .pgroup button {
  font: inherit; font-size: 10px; line-height: 16px; padding: 4px 10px; cursor: pointer;
  color: var(--grey); background: var(--ink); border: 0;
}
.topnav .pgroup button + button { border-left: 4px solid #000; }
.topnav .pgroup button:hover { color: var(--paper); }
.topnav .pgroup button[aria-pressed="true"] { color: var(--ink); background: var(--yellow); }
.topnav .pgroup button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }

/* ---------- DATASHEET ---------- */
[data-theme="datasheet"] {
  --ds-paper: #f3eee2; --ds-paper-dk: #e6dfcd; --ds-ink: #18264a; --ds-soft: #5b6480;
  --ds-red: #d42a3c; --ds-rule: #c7bfab; --ds-mark: rgba(255, 214, 64, .55);
  --paper: var(--ds-paper); --ink: var(--ds-ink); --red: var(--ds-red);
  --muted: var(--ds-soft); --grey: var(--ds-soft); --lo: #9aa0b4; --wire: var(--ds-soft);
  --bus-off: #c7bfab; --bus-idle: #c7bfab; --bus-act0: #5b6480; --bus-on: #d42a3c;
}
[data-theme="datasheet"] ::selection { background: var(--ds-mark); color: var(--ds-ink); }
[data-theme="datasheet"] body { background: #d9d2c1; color: var(--ds-ink); }
[data-theme="datasheet"] .stage { background: var(--ds-paper); outline: 2px solid var(--ds-ink); outline-offset: -16px; }

/* top bar */
[data-theme="datasheet"] .topnav { background: var(--ds-paper-dk); border-bottom: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .topnav a { color: var(--ds-soft); }
[data-theme="datasheet"] .topnav a + a { border-left: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .topnav a:hover { color: var(--ds-ink); }
[data-theme="datasheet"] .topnav a[aria-current="page"] { color: var(--ds-paper); background: var(--ds-ink); }
[data-theme="datasheet"] .topnav .pgroup { border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .topnav .pgroup button { color: var(--ds-ink); background: var(--ds-paper); }
[data-theme="datasheet"] .topnav .pgroup button + button { border-left: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .topnav .pgroup button[aria-pressed="true"] { color: var(--ds-paper); background: var(--ds-ink); }
[data-theme="datasheet"] :focus-visible { outline-color: var(--ds-red) !important; }

/* heading and controls */
[data-theme="datasheet"] header { border-bottom: 4px solid var(--ds-ink); padding-bottom: 14px; }
[data-theme="datasheet"] h1 { color: var(--ds-ink); text-shadow: none; }
[data-theme="datasheet"] h1 small { color: var(--ds-red); text-shadow: none; }
[data-theme="datasheet"] .meta { color: var(--ds-soft); }
[data-theme="datasheet"] .legend i { border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .ctrl button, [data-theme="datasheet"] .ctrl select, [data-theme="datasheet"] .btn {
  color: var(--ds-ink); background: var(--ds-paper); border: 2px solid var(--ds-ink); box-shadow: none;
}
[data-theme="datasheet"] .ctrl button:hover, [data-theme="datasheet"] .ctrl select:hover, [data-theme="datasheet"] .btn:hover { background: var(--ds-paper-dk); }
[data-theme="datasheet"] .ctrl button:active, [data-theme="datasheet"] .btn:active { transform: none; box-shadow: none; }
[data-theme="datasheet"] .ctrl #run { color: var(--ds-paper); background: var(--ds-ink); }
[data-theme="datasheet"] .ctrl #run.running { background: var(--ds-red); border-color: var(--ds-red); }

/* modules: ruled blocks with a tinted title strip */
[data-theme="datasheet"] .module { background: var(--ds-paper); border: 2px solid var(--ds-ink); box-shadow: none; }
[data-theme="datasheet"] .module h2 { color: var(--ds-ink); background: transparent; }
[data-theme="datasheet"] .module > h2,
[data-theme="datasheet"] .mod-head, [data-theme="datasheet"] .cw-head, [data-theme="datasheet"] .phead, [data-theme="datasheet"] .mhead,
[data-theme="datasheet"] .alu-head {
  background: var(--ds-paper-dk); color: var(--ds-ink); border-bottom: 2px solid var(--ds-ink);
}
[data-theme="datasheet"] .module h2 span, [data-theme="datasheet"] .dmem .phead span { color: var(--ds-red); }
[data-theme="datasheet"] .sig, [data-theme="datasheet"] .flags { color: var(--ds-soft); }
[data-theme="datasheet"] .cw-head .active { color: var(--ds-red); }
[data-theme="datasheet"] .module .val, [data-theme="datasheet"] .labeled span { color: var(--ds-ink); }

/* LEDs: printed squares, filled red when high */
[data-theme="datasheet"] .led { border: 2px solid var(--ds-ink); background: var(--ds-paper); box-shadow: none; }
[data-theme="datasheet"] .led.on { background: var(--ds-red); box-shadow: inset 0 0 0 3px var(--ds-paper); }
[data-theme="datasheet"] .led.sm.on, [data-theme="datasheet"] .led.xs.on { box-shadow: inset 0 0 0 2px var(--ds-paper); }
[data-theme="datasheet"] .eeprom {
  background: var(--ds-paper); color: var(--ds-ink);
  border: 2px solid var(--ds-ink); box-shadow: inset 0 0 0 4px var(--ds-paper), inset 0 0 0 6px var(--ds-rule);
  width: auto; min-width: 72px; padding: 0 8px; white-space: nowrap;
}

/* bus */
[data-theme="datasheet"] .bus .wires { background: var(--ds-paper); }
[data-theme="datasheet"] .bus .bin { border-bottom: 2px solid var(--ds-ink); }

/* outputs */
[data-theme="datasheet"] .display { background: var(--ds-paper); border: 2px solid var(--ds-ink); box-shadow: none; }
[data-theme="datasheet"] .seg { background: var(--ds-paper-dk); }
[data-theme="datasheet"] .seg.on { background: var(--ds-ink); }
[data-theme="datasheet"] .term { background: var(--ds-paper-dk); border: 2px solid var(--ds-ink); box-shadow: none; color: var(--ds-ink); text-shadow: none; }
[data-theme="datasheet"] .term span.cur { animation-name: blink-ds; }
@keyframes blink-ds { 50% { background: var(--ds-ink); color: var(--ds-paper); } }
[data-theme="datasheet"] .tlast b { background: var(--ds-paper); border: 2px solid var(--ds-ink); }

/* memory panels, editor, view switches */
[data-theme="datasheet"] .vswitch { border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .vswitch button { color: var(--ds-ink); background: var(--ds-paper); }
[data-theme="datasheet"] .vswitch button + button { border-left: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .vswitch button[aria-pressed="true"] { color: var(--ds-paper); background: var(--ds-ink); }
[data-theme="datasheet"] .mrow { border-bottom: 1px solid var(--ds-rule); }
[data-theme="datasheet"] .mrow.mar, [data-theme="datasheet"] .mhex .hx.mar,
[data-theme="datasheet"] .mhex .c.mar, [data-theme="datasheet"] .dgrid .c.mar,
[data-theme="datasheet"] .prow.cur { background: var(--ds-mark); }
[data-theme="datasheet"] .mhex .c.cur, [data-theme="datasheet"] .dgrid .c.cur { background: rgba(255, 214, 64, .25); }
[data-theme="datasheet"] .dgrid .c.wr { background: var(--ds-red); color: var(--ds-paper); }
[data-theme="datasheet"] .mrow .ptr, [data-theme="datasheet"] .prow.cur .pa::before,
[data-theme="datasheet"] .mlegend i { color: var(--ds-red); text-shadow: none; }
[data-theme="datasheet"] .mlegend { border-top: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .mlegend b { background: var(--ds-mark); border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .masm textarea { background: var(--ds-paper); color: var(--ds-ink); }
[data-theme="datasheet"] .masm textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--ds-red); }
[data-theme="datasheet"] .mstatus { border-top: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .mstatus .ok { color: #1f7a4a; }
[data-theme="datasheet"] .tip { background: var(--ds-ink); color: var(--ds-paper); border: 2px solid var(--ds-ink); box-shadow: none; }
[data-theme="datasheet"] .tip b { color: #f4c542; }
[data-theme="datasheet"] .tip .form { color: #f4c542; }

/* transistor / register pages: input buttons, tables, readouts */
[data-theme="datasheet"] .inbtn { color: var(--ds-ink); background: var(--ds-paper); border: 2px solid var(--ds-ink); box-shadow: none; }
[data-theme="datasheet"] .inbtn[aria-pressed="true"] { color: var(--ds-paper); background: var(--ds-red); border-color: var(--ds-red); box-shadow: none; }
[data-theme="datasheet"] .tt th { border-bottom: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .tt td.q, [data-theme="datasheet"] .tt th.q { border-left: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .tt tr.cur td { background: var(--ds-mark); }
[data-theme="datasheet"] .readout div { background: var(--ds-paper); border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .slider input { accent-color: var(--ds-red); }
[data-theme="datasheet"] .note b { color: var(--ds-red); }

/* schematics */
[data-theme="datasheet"] .sch text { fill: var(--ds-ink); }
[data-theme="datasheet"] .sch .small { fill: var(--ds-soft); }
[data-theme="datasheet"] .sch .val { fill: var(--ds-red); }
[data-theme="datasheet"] .sch .sym { stroke: var(--ds-ink); }
[data-theme="datasheet"] .sch .w { stroke: var(--ds-soft); stroke-width: 3; }
[data-theme="datasheet"] .sch .w.hi { stroke: var(--ds-red); }
[data-theme="datasheet"] .sch .w.z { stroke: var(--ds-rule); }
[data-theme="datasheet"] .sch .fl { stroke: #e8a317; }
[data-theme="datasheet"] .sch .dot, [data-theme="datasheet"] .sch .arrow { fill: var(--ds-ink); }
[data-theme="datasheet"] .sch .dot.hi { fill: var(--ds-red); }
[data-theme="datasheet"] .sch .res, [data-theme="datasheet"] .sch .body, [data-theme="datasheet"] .sch .gsym,
[data-theme="datasheet"] .sch .box { fill: var(--ds-paper); stroke: var(--ds-ink); }
[data-theme="datasheet"] .sch .body.on, [data-theme="datasheet"] .sch .box.on, [data-theme="datasheet"] .sch .gsym.on { fill: var(--ds-mark); }
[data-theme="datasheet"] .sch .pad, [data-theme="datasheet"] .sch .bub { fill: var(--ds-paper); stroke: var(--ds-ink); }
[data-theme="datasheet"] .sch .pad.hi, [data-theme="datasheet"] .sch .bub.hi { fill: var(--ds-red); }
[data-theme="datasheet"] .sch .ledtri { fill: var(--ds-paper); stroke: var(--ds-ink); }
[data-theme="datasheet"] .sch .ledtri.on { fill: var(--ds-red); }
[data-theme="datasheet"] .sch .glow { fill: var(--ds-red); }
[data-theme="datasheet"] .sch .wave { stroke: var(--ds-ink); }
[data-theme="datasheet"] .sch .wave.q { stroke: var(--ds-red); }
[data-theme="datasheet"] .sch .edge { stroke: var(--ds-mark); opacity: 1; }
[data-theme="datasheet"] .sch .sep { stroke: var(--ds-ink); }

/* register page: full-screen transistor view */
[data-theme="datasheet"] .zoom { background: #d9d2c1; }
[data-theme="datasheet"] .zbtn { background: var(--ds-mark); color: var(--ds-ink); border-color: var(--ds-ink); }
[data-theme="datasheet"] .sch .cap { fill: var(--ds-soft); }

/* register page: 8-bit bus demo */
[data-theme="datasheet"] .dev { background: var(--ds-paper); border: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .dev.bus { background: var(--ds-paper-dk); color: var(--ds-ink); }
[data-theme="datasheet"] .dev.bus .st { color: var(--ds-soft); }
[data-theme="datasheet"] .dev.bus .st.bad { color: var(--ds-paper); background: var(--ds-red); }
[data-theme="datasheet"] .dev.driving { box-shadow: inset 0 0 0 3px var(--ds-red); }
[data-theme="datasheet"] .dev.loading { box-shadow: inset 0 0 0 3px var(--ds-ink); }
[data-theme="datasheet"] .clkrow .inbtn { color: var(--ds-paper); background: var(--ds-ink); }
[data-theme="datasheet"] .clkrow .last { color: #1f7a4a; }

/* CPU pages: board on the left, instruction reference on the right */
body.has-isa { justify-content: flex-start; }
body.has-isa .stage { transform-origin: top left; }
.isa {
  position: absolute; margin: 8px; box-sizing: border-box; display: flex; flex-direction: column;
  background: #fff1e8; border: 4px solid #000; box-shadow: 6px 6px 0 #000; color: #1d2b53;
  font-family: 'Press Start 2P', 'Courier New', monospace;
}
.isa > h2 { margin: 0; padding: 7px 10px; background: #1d2b53; color: #fff1e8; font-size: 10px; line-height: 14px; font-weight: 400; }
.isa-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 10px 10px; }
.isa.below .isa-list { columns: 320px; column-gap: 24px; }
.isa section { padding: 8px 0 4px; border-bottom: 2px dashed #c2c3c7; break-inside: avoid; }
.isa h3 { margin: 0 0 4px; display: flex; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 14px; font-weight: 400; }
.isa h3 b { font-weight: 400; color: #ff004d; }
.isa h3 span { font-size: 7px; color: #5f574f; text-align: right; }
.isa code { display: inline-block; margin-top: 2px; padding: 1px 4px; font: inherit; font-size: 8px; line-height: 12px; background: #ffec2766; }
.isa p { margin: 3px 0 6px; font-size: 8px; line-height: 13px; }
[data-theme="datasheet"] .isa { background: var(--ds-paper); color: var(--ds-ink); border: 2px solid var(--ds-ink); box-shadow: none; }
[data-theme="datasheet"] .isa > h2 { background: var(--ds-paper-dk); color: var(--ds-ink); border-bottom: 2px solid var(--ds-ink); }
[data-theme="datasheet"] .isa section { border-bottom-color: var(--ds-rule); }
[data-theme="datasheet"] .isa h3 b { color: var(--ds-red); }
[data-theme="datasheet"] .isa h3 span { color: var(--ds-soft); }
[data-theme="datasheet"] .isa code { background: var(--ds-mark); }

/* ---------- LCD ----------
   A four-tone reflective dot-matrix screen in a plastic handheld (design/concepts/3-lcd):
   l0 darkest (lit pixel, ink) ... l3 the screen, l3g a ghost (unlit) pixel. */
[data-theme="lcd"] {
  --l0: #13221d; --l1: #2f5046; --l2: #6e9886; --l3: #b8d1c0; --l3g: #a9c4b2;
  --shell: #d3cec3; --shell-dk: #a39d90;
  --paper: var(--l3); --ink: var(--l0); --red: var(--l0); --yellow: var(--l2); --green: var(--l0); --blue: var(--l1);
  --muted: var(--l1); --grey: var(--l1); --lo: var(--l2); --wire: var(--l2);
  --bus-off: #93b5a3; --bus-idle: #93b5a3; --bus-act0: #6e9886; --bus-on: #13221d;
}
[data-theme="lcd"] ::selection { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] body { background: #2a2926; color: var(--l0); }
[data-theme="lcd"] .stage {
  background-color: var(--l3);
  background-image: linear-gradient(rgba(19,34,29,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(19,34,29,.07) 1px, transparent 1px);
  background-size: 4px 4px; border-radius: 18px;
  box-shadow: inset 0 0 0 12px var(--shell), inset 0 0 0 14px var(--shell-dk), inset 0 0 0 22px #4a4f4a, inset 0 0 0 24px #2f332f,
              inset 0 10px 24px 24px rgba(0,0,0,.28);
}

/* top bar: dark plastic strip with LCD-green labels */
[data-theme="lcd"] .topnav { background: var(--l0); border-bottom: 4px solid #000; }
[data-theme="lcd"] .topnav a { color: var(--l2); }
[data-theme="lcd"] .topnav a + a { border-left: 4px solid #000; }
[data-theme="lcd"] .topnav a:hover { color: var(--l3); }
[data-theme="lcd"] .topnav a[aria-current="page"] { color: var(--l0); background: var(--l3); }
[data-theme="lcd"] .topnav .pgroup { border: 4px solid #000; }
[data-theme="lcd"] .topnav .pgroup button { color: var(--l2); background: var(--l0); }
[data-theme="lcd"] .topnav .pgroup button + button { border-left: 4px solid #000; }
[data-theme="lcd"] .topnav .pgroup button:hover { color: var(--l3); }
[data-theme="lcd"] .topnav .pgroup button[aria-pressed="true"] { color: var(--l0); background: var(--l3); }
[data-theme="lcd"] :focus-visible { outline-color: var(--l0) !important; }

/* heading and controls */
[data-theme="lcd"] h1 { color: var(--l0); text-shadow: 3px 3px 0 var(--l2); }
[data-theme="lcd"] h1 small { color: var(--l1); text-shadow: none; }
[data-theme="lcd"] .meta, [data-theme="lcd"] .meta a { color: var(--l1); }
[data-theme="lcd"] .legend i { border: 2px solid var(--l0); }
[data-theme="lcd"] .ctrl button, [data-theme="lcd"] .ctrl select, [data-theme="lcd"] .btn {
  color: var(--l0); background: var(--l3); border: 3px solid var(--l0); box-shadow: 3px 3px 0 var(--l1);
}
[data-theme="lcd"] .ctrl select option { background: var(--l3); }
[data-theme="lcd"] .ctrl button:hover, [data-theme="lcd"] .ctrl select:hover, [data-theme="lcd"] .btn:hover { background: var(--l2); }
[data-theme="lcd"] .ctrl button:active, [data-theme="lcd"] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--l1); }
[data-theme="lcd"] .ctrl #run { color: var(--l3); background: var(--l0); }
[data-theme="lcd"] .ctrl #run.running { color: var(--l0); background: var(--l2); }

/* modules: chunky frame, inverted title bar */
[data-theme="lcd"] .module { background: rgba(184,209,192,.6); border: 3px solid var(--l0); box-shadow: none; }
[data-theme="lcd"] .module h2 { color: var(--l3); }
[data-theme="lcd"] .module > h2, [data-theme="lcd"] .mod-head, [data-theme="lcd"] .cw-head, [data-theme="lcd"] .phead, [data-theme="lcd"] .mhead, [data-theme="lcd"] .alu-head { background: var(--l0); color: var(--l3); border-bottom: 0; }
[data-theme="lcd"] .module h2 span, [data-theme="lcd"] .dmem .phead span { color: var(--l2); }
[data-theme="lcd"] .sig, [data-theme="lcd"] .flags { color: var(--l2); }
[data-theme="lcd"] .cw-head .active { color: var(--l3); }
[data-theme="lcd"] .module .val, [data-theme="lcd"] .labeled span { color: var(--l0); }

/* LEDs: one fat LCD pixel each; unlit pixels ghost */
[data-theme="lcd"] .led { border: 0; background: var(--l3g); box-shadow: inset 0 0 0 2px var(--l3), inset 0 0 0 3px rgba(19,34,29,.12); }
[data-theme="lcd"] .led.on { background: var(--l0); box-shadow: inset 0 0 0 2px var(--l3), 2px 2px 0 rgba(19,34,29,.25); }
[data-theme="lcd"] .mod-head .led, [data-theme="lcd"] .cw-head .led, [data-theme="lcd"] .phead .led, [data-theme="lcd"] .mhead .led, [data-theme="lcd"] .alu-head .led { background: var(--l1); box-shadow: none; }
[data-theme="lcd"] .mod-head .led.on, [data-theme="lcd"] .cw-head .led.on, [data-theme="lcd"] .phead .led.on, [data-theme="lcd"] .mhead .led.on, [data-theme="lcd"] .alu-head .led.on { background: var(--l3); }
[data-theme="lcd"] .eeprom {
  background: var(--l1); color: var(--l3); border: 3px solid var(--l0); box-shadow: none;
  width: auto; min-width: 72px; padding: 0 8px; white-space: nowrap;
}

/* bus */
[data-theme="lcd"] .module.bus { background: var(--l3); }
[data-theme="lcd"] .bus .wires { background: var(--l3); }
[data-theme="lcd"] .bus .bin { border-bottom: 3px solid var(--l0); }

/* outputs */
[data-theme="lcd"] .display { background: transparent; border: 3px solid var(--l0); box-shadow: none; }
[data-theme="lcd"] .seg { background: var(--l3g); }
[data-theme="lcd"] .seg.on { background: var(--l0); }
[data-theme="lcd"] .term { background: var(--l3g); border: 3px solid var(--l0); box-shadow: none; color: var(--l0); text-shadow: none; }
[data-theme="lcd"] .term span.cur { animation-name: blink-lcd; }
@keyframes blink-lcd { 50% { background: var(--l0); color: var(--l3); } }
[data-theme="lcd"] .tlast b { background: var(--l3g); border: 3px solid var(--l0); color: var(--l0); }

/* memory panels, editor, view switches */
[data-theme="lcd"] .vswitch { border: 2px solid var(--l3); }
[data-theme="lcd"] .vswitch button { color: var(--l3); background: var(--l0); }
[data-theme="lcd"] .vswitch button + button { border-left: 2px solid var(--l3); }
[data-theme="lcd"] .vswitch button[aria-pressed="true"] { color: var(--l0); background: var(--l3); }
[data-theme="lcd"] .mrow { border-bottom: 0; }
[data-theme="lcd"] .mrow.pc, [data-theme="lcd"] .mrow.cur, [data-theme="lcd"] .prow.cur, [data-theme="lcd"] .mhex .c.cur, [data-theme="lcd"] .dgrid .c.cur { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] .mrow.pc span, [data-theme="lcd"] .prow.cur span, [data-theme="lcd"] .mrow.cur span { color: var(--l3); }
[data-theme="lcd"] .mrow.mar, [data-theme="lcd"] .mhex .hx.mar, [data-theme="lcd"] .mhex .c.mar, [data-theme="lcd"] .dgrid .c.mar { background: repeating-linear-gradient(90deg, var(--l2) 0 2px, transparent 2px 4px); }
[data-theme="lcd"] .dgrid .c.wr { background: var(--l1); color: var(--l3); }
[data-theme="lcd"] .mrow .ptr, [data-theme="lcd"] .prow.cur .pa::before, [data-theme="lcd"] .mlegend i { color: var(--l0); text-shadow: none; }
[data-theme="lcd"] .prow.cur .pa::before { color: var(--l3); }
[data-theme="lcd"] .mlegend { border-top: 3px solid var(--l0); color: var(--l1); }
[data-theme="lcd"] .mlegend b { background: repeating-linear-gradient(90deg, var(--l2) 0 2px, transparent 2px 4px); border: 2px solid var(--l0); }
[data-theme="lcd"] .masm textarea { background: transparent; color: var(--l0); }
[data-theme="lcd"] .masm textarea:focus-visible { box-shadow: inset 0 0 0 3px var(--l0); }
[data-theme="lcd"] .mstatus { border-top: 3px solid var(--l0); }
[data-theme="lcd"] .mstatus .ok { color: var(--l1); }
[data-theme="lcd"] .tip { background: var(--l0); color: var(--l3); border: 3px solid var(--l1); box-shadow: none; }
[data-theme="lcd"] .tip b, [data-theme="lcd"] .tip .form { color: var(--l2); }

/* transistor / register pages */
[data-theme="lcd"] .inbtn { color: var(--l0); background: var(--l3); border: 3px solid var(--l0); box-shadow: 3px 3px 0 var(--l1); }
[data-theme="lcd"] .inbtn[aria-pressed="true"] { color: var(--l3); background: var(--l0); box-shadow: 3px 3px 0 var(--l2); }
[data-theme="lcd"] .tt th { color: var(--l1); border-bottom: 3px solid var(--l0); }
[data-theme="lcd"] .tt td.q, [data-theme="lcd"] .tt th.q { border-left: 3px solid var(--l0); }
[data-theme="lcd"] .tt tr.cur td { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] .readout div { background: transparent; border: 3px solid var(--l0); }
[data-theme="lcd"] .readout b { color: var(--l1); }
[data-theme="lcd"] .slider input { accent-color: var(--l0); }
[data-theme="lcd"] .note, [data-theme="lcd"] .note b { color: var(--l0); }

/* schematics: low wires are mid-green, high wires dark, current flows as moving gaps */
[data-theme="lcd"] .sch text { fill: var(--l0); }
[data-theme="lcd"] .sch .small, [data-theme="lcd"] .sch .cap { fill: var(--l1); }
[data-theme="lcd"] .sch .val { fill: var(--l1); }
[data-theme="lcd"] .sch .sym { stroke: var(--l0); }
[data-theme="lcd"] .sch .w { stroke: var(--l2); }
[data-theme="lcd"] .sch .w.hi { stroke: var(--l0); }
[data-theme="lcd"] .sch .w.z { stroke: var(--l3g); }
[data-theme="lcd"] .sch .fl { stroke: var(--l3); }
[data-theme="lcd"] .sch .dot, [data-theme="lcd"] .sch .arrow { fill: var(--l0); }
[data-theme="lcd"] .sch .dot { fill: var(--l2); }
[data-theme="lcd"] .sch .dot.hi { fill: var(--l0); }
[data-theme="lcd"] .sch .res, [data-theme="lcd"] .sch .body, [data-theme="lcd"] .sch .gsym, [data-theme="lcd"] .sch .box { fill: var(--l3); stroke: var(--l0); }
[data-theme="lcd"] .sch .body.on, [data-theme="lcd"] .sch .box.on, [data-theme="lcd"] .sch .gsym.on { fill: var(--l2); }
[data-theme="lcd"] .sch .pad, [data-theme="lcd"] .sch .bub { fill: var(--l3g); stroke: var(--l0); }
[data-theme="lcd"] .sch .pad.hi, [data-theme="lcd"] .sch .bub.hi { fill: var(--l0); }
[data-theme="lcd"] .sch .ledtri { fill: var(--l3g); stroke: var(--l0); }
[data-theme="lcd"] .sch .ledtri.on { fill: var(--l0); }
[data-theme="lcd"] .sch .glow { fill: var(--l2); }
[data-theme="lcd"] .sch .wave { stroke: var(--l1); }
[data-theme="lcd"] .sch .wave.q { stroke: var(--l0); }
[data-theme="lcd"] .sch .edge { stroke: var(--l2); opacity: .6; }
[data-theme="lcd"] .sch .sep { stroke: var(--l1); }

/* register page */
[data-theme="lcd"] .zoom { background: #2a2926; }
[data-theme="lcd"] .zbtn { background: var(--l3); color: var(--l0); border-color: var(--l3); }
[data-theme="lcd"] .dev { background: transparent; border: 3px solid var(--l0); }
[data-theme="lcd"] .dev.bus { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] .dev.bus .st { color: var(--l2); }
[data-theme="lcd"] .dev.bus .st.bad { color: var(--l0); background: var(--l3); }
[data-theme="lcd"] .dev.driving { box-shadow: inset 0 0 0 4px var(--l0); }
[data-theme="lcd"] .dev.loading { box-shadow: inset 0 0 0 4px var(--l2); }
[data-theme="lcd"] .clkrow .inbtn { color: var(--l3); background: var(--l0); }
[data-theme="lcd"] .clkrow .last { color: var(--l1); }

/* CPU pages: instruction reference */
[data-theme="lcd"] .isa { background: var(--l3); color: var(--l0); border: 3px solid var(--l0); box-shadow: inset 0 0 0 4px var(--l3), 6px 6px 0 #000; }
[data-theme="lcd"] .isa > h2 { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] .isa section { border-bottom: 2px dashed var(--l2); }
[data-theme="lcd"] .isa h3 b { color: var(--l0); }
[data-theme="lcd"] .isa h3 span { color: var(--l1); }
[data-theme="lcd"] .isa code { background: var(--l0); color: var(--l3); }
[data-theme="lcd"] .dgrid .c.zero { color: var(--l2); }
[data-theme="lcd"] .prow.lbl .ps { color: var(--l1); }
[data-theme="lcd"] polyline[stroke="#1d2b53"] { stroke: var(--l0); }
[data-theme="lcd"] .readout .region.act, [data-theme="lcd"] .readout .region.sat { color: var(--l0); }
[data-theme="lcd"] .readout .region.off { color: var(--l2); }
[data-theme="lcd"] .mrow.pc.mar { background: var(--l0); }
[data-theme="lcd"] .mrow.pc .led { background: var(--l1); box-shadow: inset 0 0 0 2px var(--l0); }
[data-theme="lcd"] .mrow.pc .led.on { background: var(--l3); }
[data-theme="lcd"] .zoom > .module { background-color: var(--l3); background-image: linear-gradient(rgba(19,34,29,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(19,34,29,.07) 1px, transparent 1px); background-size: 4px 4px; }
