/* ===== Display menu (all themes) ===== */
.display { position: fixed; right: 12px; top: 64px; width: 420px; z-index: 12; display: none; background: #141920f5; border: 1px solid #3c4655; border-radius: 8px; padding: 12px 14px; box-shadow: 0 10px 30px #0008; }
.display.open { display: block; }
.d-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-row { display: flex; flex-direction: column; gap: 5px; margin: 9px 0; } .d-row > span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8b97a5; }
.d-row .seg { flex-wrap: wrap; } .d-row .seg button { padding: 6px 10px; font-size: 12.5px; }
.d-cbs { display: flex; gap: 16px; font-size: 13px; } .d-cbs .cb { display: flex; gap: 6px; align-items: center; }
.d-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 10px 0 4px; color: #b8c3cf; }
.d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.smark { width: 16px; height: 16px; flex: none; }
.smark-run .disc { fill: #2fbf71; } .smark-stop .disc { fill: #6b7480; } .smark-tr .disc { fill: #f0b31e; } .smark-trip .disc { fill: #e5484d; }
.bt { width: 22px; height: 12px; display: inline-block; background: no-repeat center/contain; }
.bt.open { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M1 1 11 6 1 11Z M21 1 11 6 21 11Z' fill='none' stroke='%232fbf71' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bt.shut { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M1 1 11 6 1 11Z M21 1 11 6 21 11Z' fill='%239aa3ab' stroke='%239aa3ab' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* =====================================================================================================
   SCADA theme: control-room HMI. Dark neutral greys, bevelled controls, black value fields with monospaced
   readouts, no decoration. Colour is reserved for state and alarms (ISA-101: P1 red, P2 yellow, BAD magenta).
   ===================================================================================================== */
body.theme-scada {
  --s-bg: #2a2d30; --s-panel: #383c40; --s-panel2: #303437; --s-head: #1d2023; --s-edge: #16181a; --s-hi: #5a6066; --s-lo: #1e2124;
  --s-text: #d3d8db; --s-dim: #8e979d; --s-val: #e9f4f8; --s-cyan: #7fd8ef; --s-field: #0b0d0e;
  background: var(--s-bg); color: var(--s-text); font: 12.5px/1.35 "Segoe UI", Tahoma, "IBM Plex Sans", Arial, sans-serif;
}
.theme-scada button { background: #4a4f54; color: #e6eaec; border: 1px solid var(--s-edge); border-radius: 1px; box-shadow: inset 1px 1px 0 var(--s-hi), inset -1px -1px 0 var(--s-lo); padding: 6px 11px; }
.theme-scada button:hover:not(:disabled) { background: #555b61; }
.theme-scada button:active { box-shadow: inset 1px 1px 0 var(--s-lo), inset -1px -1px 0 var(--s-hi); background: #42474c; }
.theme-scada button.go { color: #7fe0a0; font-weight: 700; } .theme-scada button.stop { color: #ff9a9a; font-weight: 700; }
.theme-scada button.estop { background: #b00e27; color: #fff; border-color: #5c0814; box-shadow: inset 1px 1px 0 #e0485e, inset -1px -1px 0 #6d0a19; }
.theme-scada .seg button.on, .theme-scada .l-steps button.on, .theme-scada .l-parts button.on, .theme-scada .l-dots button.on, .theme-scada .tools button.on { background: #24272a; color: var(--s-cyan); box-shadow: inset 1px 1px 0 var(--s-lo), inset -1px -1px 0 var(--s-hi); }
.theme-scada header { background: var(--s-head); border-bottom: 1px solid #000; box-shadow: 0 1px 0 #3a3f44; height: 52px; color: var(--s-text); }
.theme-scada .brand b { color: #fff; letter-spacing: .08em; font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada .hgroup { background: #25282b; border: 1px solid #000; border-radius: 1px; box-shadow: inset 1px 1px 0 #111; }
.theme-scada .chip { border-radius: 1px; background: #2f3337; color: var(--s-dim); border: 1px solid #000; font: 600 11px "IBM Plex Mono", Consolas, monospace; letter-spacing: .04em; }
.theme-scada .chip.ok { background: #173d27; color: #8ef0b0; border-color: #0c2416; } .theme-scada .chip.warn { background: #f2c200; color: #000; } .theme-scada .chip.bad { background: #c8102e; color: #fff; }
.theme-scada .chip.train.sel { outline: 1px solid var(--s-cyan); outline-offset: 1px; }
.theme-scada .pill { background: var(--s-field); border: 1px solid #000; color: var(--s-dim); border-radius: 1px; font-family: "IBM Plex Mono", Consolas, monospace; } .theme-scada .pill b { color: var(--s-val); }
.theme-scada .pill .ico-flow { color: var(--s-cyan); }
.theme-scada .find { background: var(--s-field); border: 1px solid #000; border-radius: 1px; box-shadow: inset 1px 1px 0 #000; } .theme-scada .find input { color: var(--s-val); font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada select.views, .theme-scada .drawer select, .theme-scada .learn.studio .l-lib select, .theme-scada input[type=number] { background: var(--s-field); color: var(--s-val); border: 1px solid #000; border-radius: 1px; font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada .kpi, .theme-scada .faceplate, .theme-scada .learn, .theme-scada .display, .theme-scada .modal-body { background: var(--s-panel); color: var(--s-text); border: 1px solid #000; border-radius: 1px; box-shadow: inset 1px 1px 0 #4d5257, 3px 3px 0 #0006; }
.theme-scada .kpi-title { background: var(--s-head); margin: -10px -12px 8px; padding: 7px 12px; border-bottom: 1px solid #000; }
.theme-scada .d-head { background: var(--s-head); margin: -12px -14px 8px; padding: 6px 12px; border-bottom: 1px solid #000; }
.theme-scada .kpi-title, .theme-scada .fp-id, .theme-scada .l-title, .theme-scada .d-head b, .theme-scada .modal-head h2 { color: #fff; font-family: "IBM Plex Mono", Consolas, monospace; letter-spacing: .05em; text-transform: uppercase; font-size: 13px; }
.theme-scada .row span:first-child, .theme-scada .fp-desc, .theme-scada .l-sub, .theme-scada .hint, .theme-scada .d-row > span, .theme-scada .d-legend { color: var(--s-dim); }
.theme-scada .k-h { color: var(--s-cyan); background: var(--s-panel2); border-left: 3px solid var(--s-cyan); padding: 2px 6px; font: 600 11px "IBM Plex Mono", Consolas, monospace; letter-spacing: .08em; }
.theme-scada .row b, .theme-scada .big { font-family: "IBM Plex Mono", Consolas, monospace; color: var(--s-val); font-weight: 500; }
.theme-scada .row b span[data-kv], .theme-scada .row b span[data-v] { background: var(--s-field); border: 1px solid #000; box-shadow: inset 1px 1px 0 #000; padding: 0 5px; color: var(--s-val); }
.theme-scada .trend, .theme-scada .l-text, .theme-scada .l-info { background: var(--s-field); border: 1px solid #000; border-radius: 0; color: var(--s-text); }
.theme-scada .l-text b, .theme-scada .l-info b { color: #fff; }
.theme-scada .bar { background: var(--s-field); border: 1px solid #000; border-radius: 0; } .theme-scada .bar i { background: #8a949b; }
.theme-scada .drawer { background: #34322b; border: 1px solid #000; border-top: 3px solid #b8962e; border-radius: 1px; color: var(--s-text); }
.theme-scada .drawer h3 { color: #f0d27a; } .theme-scada .drawer h4 { color: #c9b26a; } .theme-scada .factive { color: #ff8a8a; }
.theme-scada footer { background: var(--s-head); border-top: 1px solid #000; color: var(--s-text); }
.theme-scada .al-head b { font-family: "IBM Plex Mono", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.theme-scada .al { background: #25282b; border-left-width: 8px; border-radius: 0; color: var(--s-text); font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; }
.theme-scada .al.p1 { border-color: #c8102e; } .theme-scada .al.p2 { border-color: #f2c200; } .theme-scada .al.p3 { border-color: #9a5fc4; }
.theme-scada .al.p1:not(.ack) { background: #c8102e; color: #fff; } .theme-scada .al.p2:not(.ack) { background: #f2c200; color: #000; } .theme-scada .al.p3:not(.ack) { background: #4b2c5e; color: #fff; }
@keyframes blink-scada { 50% { filter: brightness(0.7); } }
.theme-scada .al:not(.ack) { animation: blink-scada 1s steps(2) infinite; }
.theme-scada .badge:not(:empty) { background: #c8102e; border-radius: 1px; }
.theme-scada .lbl { border-radius: 0; font-family: "Segoe UI", Tahoma, "IBM Plex Sans", sans-serif; }
.theme-scada .lbl.eq { background: #2a2d30eb; border: 1px solid #000; color: var(--s-text); }
.theme-scada .lbl.eq .t { color: #fff; font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada .lbl.inst { background: #0b0d0ef0; border: 1px solid #4a5056; color: var(--s-val); font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada .lbl.inst .t { color: var(--s-cyan); }
.theme-scada .lbl.inst.alarm { background: #f2c200; border-color: #000; color: #000; } .theme-scada .lbl.inst.alarm .t { color: #000; }
.theme-scada .lbl.inst.bad, .theme-scada .lbl .bad { background: #ff00ff; color: #fff; border-color: #000; }
.theme-scada .lbl.area { color: #e9eef0; text-shadow: 0 0 3px #000, 0 0 6px #000; font-family: "IBM Plex Mono", Consolas, monospace; letter-spacing: .12em; }
.theme-scada .m-a { background: #5f6a72; color: #fff; } .theme-scada .m-m { background: #f2c200; color: #000; } .theme-scada .m-o { background: #0b0d0e; color: #fff; border: 1px solid #5a6066; }
.theme-scada .hovertip, .theme-scada .ltip { background: #0b0d0ef2; color: var(--s-text); border: 1px solid #5a6066; border-radius: 0; box-shadow: 3px 3px 0 #0008; }
.theme-scada .hovertip b { color: #fff; font-family: "IBM Plex Mono", Consolas, monospace; } .theme-scada .hovertip .tiphint { color: var(--s-dim); }
.theme-scada .card { background: var(--s-panel2); border: 1px solid #000; border-radius: 1px; color: var(--s-text); box-shadow: inset 1px 1px 0 #464b50; }
.theme-scada .card:hover { background: #3c4145; } .theme-scada .card .cic { color: var(--s-cyan); } .theme-scada .card .cs { color: var(--s-dim); } .theme-scada .card .cm { color: var(--s-cyan); font-family: "IBM Plex Mono", Consolas, monospace; }
.theme-scada .learnhdr, .theme-scada .learnbtn, .theme-scada .learnmini { background: #4a4f54; color: #e6eaec; }
.theme-scada .modal-head h2 .ico { color: var(--s-cyan); }
.theme-scada .ico { stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.7; }
.theme-scada .display { background: var(--s-panel); }
.theme-scada #toast { background: #0b0d0e; color: var(--s-val); border: 1px solid #5a6066; border-radius: 0; font-family: "IBM Plex Mono", Consolas, monospace; }

/* =====================================================================================================
   SMHcoders v3 theme: paper and ink, hairline frames, mono labels, Space Grotesk headings, teal → orange accent
   ===================================================================================================== */
body.theme-smh {
  --paper: #f3f2ee; --paper2: #eae8e1; --ink: #0c1517; --ink2: #33403f; --mute: #6b7675; --line: rgba(12, 21, 23, .14);
  --teal: #0e9e96; --teald: #0a7a74; --orange: #f07b1e; --night: #071114; --ntext: #c9d6d4;
  background: var(--paper); color: var(--ink); font: 13px/1.45 "IBM Plex Sans", system-ui, sans-serif;
}
.theme-smh button { background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: 0; font: 500 11px/1 "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; padding: 9px 12px; }
.theme-smh button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.theme-smh button.go { background: var(--ink); color: var(--paper); }
.theme-smh button.go:hover:not(:disabled) { background: var(--teald); border-color: var(--teald); }
.theme-smh button.stop { border-color: var(--orange); color: #b4560d; }
.theme-smh button.estop { background: #c8102e; border-color: #c8102e; color: #fff; }
.theme-smh .x { padding: 6px 9px; }
.theme-smh .seg button.on, .theme-smh .l-steps button.on, .theme-smh .l-parts button.on, .theme-smh .l-dots button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.theme-smh header { background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 0; color: var(--ink); backdrop-filter: blur(6px); }
.theme-smh header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--teal), #7c5cff, var(--orange)); }
.theme-smh .brand { font: 600 16px "Space Grotesk", sans-serif; letter-spacing: -.02em; } .theme-smh .brand b { color: var(--ink); }
.theme-smh .brand b::after { content: "·"; color: var(--orange); margin-left: 2px; }
.theme-smh .hgroup { background: transparent; border: 1px solid var(--line); border-radius: 0; }
.theme-smh .chip { border-radius: 0; background: transparent; border: 1px solid var(--line); color: var(--ink2); font: 500 10.5px/1 "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; padding: 7px 9px; }
.theme-smh .chip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #9aa3ab; margin-right: 6px; vertical-align: 1px; }
.theme-smh .chip.ok::before { background: #2fbf71; } .theme-smh .chip.warn::before { background: #f0b31e; } .theme-smh .chip.bad::before { background: #e5484d; }
.theme-smh .chip.ok, .theme-smh .chip.warn, .theme-smh .chip.bad { background: transparent; color: var(--ink); }
.theme-smh .chip.train.sel { border-color: var(--ink); }
.theme-smh .pill { background: transparent; border: 1px solid var(--line); border-radius: 0; color: var(--mute); font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .04em; }
.theme-smh .pill b { color: var(--ink); } .theme-smh .pill.bad { background: #c8102e; color: #fff; }
.theme-smh .find { background: #fff; border: 1px solid var(--line); border-radius: 0; } .theme-smh .find input { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.theme-smh select.views, .theme-smh .drawer select, .theme-smh .learn.studio .l-lib select, .theme-smh input[type=number] { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 0; font: 12px "IBM Plex Sans", sans-serif; }
.theme-smh .kpi, .theme-smh .faceplate, .theme-smh .learn, .theme-smh .display, .theme-smh .modal-body, .theme-smh .drawer { background: color-mix(in srgb, var(--paper) 96%, transparent); color: var(--ink); border: 1px solid var(--line); border-radius: 0; box-shadow: 0 18px 40px rgba(12, 21, 23, .12); }
.theme-smh .kpi { border-top: 3px solid var(--teal); } .theme-smh .faceplate { border-top: 3px solid var(--orange); } .theme-smh .drawer { border-top: 3px solid #b4560d; }
.theme-smh .kpi-title, .theme-smh .d-head b, .theme-smh .drawer h3, .theme-smh .modal-head h2 { font: 600 16px "Space Grotesk", sans-serif; letter-spacing: -.02em; color: var(--ink); }
.theme-smh .fp-id, .theme-smh .l-title { font: 600 22px/1.1 "Space Grotesk", sans-serif; letter-spacing: -.03em; color: var(--ink); }
.theme-smh .k-h, .theme-smh .d-row > span, .theme-smh .drawer h4, .theme-smh .l-steptitle, .theme-smh details > summary { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--teald); }
.theme-smh .row { border-bottom: 1px solid var(--line); padding: 5px 0; }
.theme-smh .row span:first-child, .theme-smh .fp-desc, .theme-smh .l-sub, .theme-smh .hint, .theme-smh .d-legend { color: var(--mute); }
.theme-smh .row b, .theme-smh .big { font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--ink); }
.theme-smh .big { font-size: 32px; letter-spacing: -.02em; }
.theme-smh .trend, .theme-smh .l-text, .theme-smh .l-info { background: var(--night); color: var(--ntext); border-radius: 0; }
.theme-smh .l-text b, .theme-smh .l-info b { color: #fff; }
.theme-smh .bar { background: var(--paper2); border-radius: 0; } .theme-smh .bar i { background: linear-gradient(90deg, var(--teal), var(--orange)); }
.theme-smh .factive { color: #b4560d; }
.theme-smh footer { background: var(--paper2); border-top: 1px solid var(--line); color: var(--ink); }
.theme-smh .al-head b { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.theme-smh .al { background: var(--paper); border-left-width: 3px; border-radius: 0; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink2); }
.theme-smh .al.p1 { border-color: #e5484d; } .theme-smh .al.p2 { border-color: var(--orange); } .theme-smh .al.p3 { border-color: var(--teal); }
@keyframes blink-smh { 50% { background: #fde7d6; } }
.theme-smh .al:not(.ack) { animation: blink-smh 1.2s steps(2) infinite; }
.theme-smh .badge:not(:empty) { background: var(--orange); border-radius: 0; }
.theme-smh .lbl { border-radius: 0; }
.theme-smh .lbl.eq { background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--line); color: var(--ink2); font-family: "IBM Plex Sans", sans-serif; }
.theme-smh .lbl.eq .t { color: var(--ink); font: 600 11px "IBM Plex Mono", monospace; letter-spacing: .06em; }
.theme-smh .lbl.inst { background: #071114e6; border: 1px solid #1d3a3c; color: var(--ntext); font-family: "IBM Plex Mono", monospace; }
.theme-smh .lbl.inst .t { color: var(--teal); }
.theme-smh .lbl.inst.alarm { background: #3a2408; border-color: var(--orange); }
.theme-smh .lbl.area { color: #fff; font: 600 15px "Space Grotesk", sans-serif; letter-spacing: .02em; text-shadow: 0 1px 6px #000c; }
.theme-smh .m-a { background: var(--teal); color: #fff; } .theme-smh .m-m { background: var(--orange); color: #fff; } .theme-smh .m-o { background: var(--ink); color: #fff; }
.theme-smh .hovertip, .theme-smh .ltip { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 0; font-family: "IBM Plex Sans", sans-serif; }
.theme-smh .hovertip b { color: var(--ink); font-family: "IBM Plex Mono", monospace; }
.theme-smh .card { background: #fff; border: 1px solid var(--line); border-radius: 0; color: var(--ink); text-transform: none; letter-spacing: 0; font: 13px/1.4 "IBM Plex Sans", sans-serif; padding: 16px; }
.theme-smh .card:hover:not(:disabled) { background: #fff; color: var(--ink); border-color: var(--teal); }
.theme-smh .card .ct { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.theme-smh .card .ct { font-family: "Space Grotesk", sans-serif; } .theme-smh .card .cs { color: var(--mute); } .theme-smh .card .cm { color: var(--teald); font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.theme-smh .learnhdr { background: var(--ink); color: var(--paper); }
.theme-smh .learnbtn, .theme-smh .learnmini { background: var(--night); color: #fff; border-color: var(--night); }
.theme-smh #toast { background: var(--ink); color: var(--paper); border-radius: 0; font-family: "IBM Plex Mono", monospace; }
.theme-smh .ico { stroke-width: 1.5; }
.theme-smh .card .cic { color: var(--teal); } .theme-smh .modal-head h2 .ico { color: var(--teal); } .theme-smh .pill .ico-flow { color: var(--teal); }
.theme-smh .lbl.partlbl { background: var(--ink); border-color: var(--ink); }
.theme-scada .modal-head { background: var(--s-head); margin: -16px -20px 12px; padding: 8px 20px; border-bottom: 1px solid #000; }
.d-range { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; } .d-range input { flex: 1; accent-color: #5ab0ff; } .d-range output { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.theme-scada .d-range input { accent-color: #7fd8ef; } .theme-smh .d-range input { accent-color: #0e9e96; } .theme-smh .d-range output { font-family: "IBM Plex Mono", monospace; }
.d-ramp { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #8b97a5; margin: 2px 0 6px; } .d-ramp i { display: inline-block; height: 10px; width: 18px; border-radius: 2px; } .d-ramp i:nth-of-type(2) { flex: 1; }

/* Rev. 9: missions button (flat buttons) */
button.missionhdr { background: #5a4a1a; border-color: #c8901a; color: #ffe2a8; font-weight: 700; }
.theme-scada button.missionhdr { background: #4a4f54; color: #f2c200; }
.theme-smh button.missionhdr { background: var(--orange); border-color: var(--orange); color: #fff; }
