/* IoT Virtual Lab dark theme (2026-11-13). Turned on by js/prefs.js (html[data-theme="dark"]).
   Text and links keep at least 4.5:1 contrast on the dark surfaces. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7e9ee;
  --muted: #aab3bf;
  --line: #363a45;
  --panel: #14161b;
  --bench: #1b1e25;
  --grid: #2b2f39;
  --teal: #c2410c;          /* button fill with white text: unchanged */
  --teal-dark: #fdba74;     /* links and accent text: light orange (10:1) */
  --teal-tint: #3b2415;
  --stop: #c43b2f;
  --ok: #3ccf7d;
  --warn: #e8a63a;
  --brand-strong: #ff8a3d;
  --cream: #17191f;
  --peach: #2a1d13;
}

/* ---- generated by tools/gendark.py from the site stylesheets; do not edit by hand ---- */

/* style.css */
:where(html[data-theme="dark"]) .bar { background: #362614; }
:where(html[data-theme="dark"]) .title:focus { background: #191c21; }
:where(html[data-theme="dark"]) .btn { background: #191c21; }
:where(html[data-theme="dark"]) .btn.ghost[aria-pressed="true"] { border-color: #6d4f30; }
:where(html[data-theme="dark"]) .menu-list { background: #191c21; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.308); }
:where(html[data-theme="dark"]) .banner { background: #3b3216; border-bottom: 1px solid #615635; }
:where(html[data-theme="dark"]) .palette { background: #191c21; }
:where(html[data-theme="dark"]) .part-item { background: #191c21; }
:where(html[data-theme="dark"]) .part-item:hover { border-color: #6d4f30; }
:where(html[data-theme="dark"]) .toolbar { background: #191c21; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.132); }
:where(html[data-theme="dark"]) .inspector { background: #191c21; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); }
:where(html[data-theme="dark"]) .inspector input[type="text"], :where(html[data-theme="dark"]) .inspector select, :where(html[data-theme="dark"]) .inspector .res-row input { background: #191c21; }
:where(html[data-theme="dark"]) .swatch { border: 2px solid #3d3d3d; }
:where(html[data-theme="dark"]) .status { background: rgba(25, 28, 33, 0.92); }
:where(html[data-theme="dark"]) .status[data-state="running"] .dot { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.396); }
:where(html[data-theme="dark"]) .warn-text { color: #ffbe70; background: #3e3217; border: 1px solid #625435; }
:where(html[data-theme="dark"]) .empty-hint { background: rgba(25, 28, 33, 0.9); }
:where(html[data-theme="dark"]) .cl-wire-outline { stroke: rgba(230, 230, 230, 0.35); }
:where(html[data-theme="dark"]) .cl-wire-glow { stroke: rgba(247, 157, 121, 0.35); }
:where(html[data-theme="dark"]) .canvas:not(.simulating):not(.readonly) .cl-part:hover ~ .x, :where(html[data-theme="dark"]) .cl-pin:hover { fill: rgba(247, 157, 121, 0.35); }
:where(html[data-theme="dark"]) .cl-pin.hl { fill: rgba(135, 232, 181, 0.45); }
:where(html[data-theme="dark"]) .canvas.drawing .cl-pin { fill: rgba(247, 157, 121, 0.12); }
:where(html[data-theme="dark"]) .code-panel { background: #191c21; }
:where(html[data-theme="dark"]) .code-head select { background: #191c21; }
:where(html[data-theme="dark"]) .net-row { border-bottom: 1px solid #57412a; }
:where(html[data-theme="dark"]) .net-row.attacker > summary { background: #2d1816; }
:where(html[data-theme="dark"]) .net-dir.in { color: #beb5c8; }
:where(html[data-theme="dark"]) .net-ends { color: #cacdd1; }
:where(html[data-theme="dark"]) .net-proto.http { background: #3e3217; color: #ffcd70; }
:where(html[data-theme="dark"]) .net-proto.tls { background: #24362c; color: #88e7b1; }
:where(html[data-theme="dark"]) .net-proto.tcp { background: #382819; }
:where(html[data-theme="dark"]) .net-bad { color: #e4938b; background: #341d1b; }
:where(html[data-theme="dark"]) .net-good { color: #88e7b1; background: #24362c; }
:where(html[data-theme="dark"]) .net-bad code { background: #191c21; }
:where(html[data-theme="dark"]) .net-secret { background: #6b571f; color: #d4d8db; }
:where(html[data-theme="dark"]) .net-proto.udp { background: #1b2434; color: #8daee2; }
:where(html[data-theme="dark"]) .net-bar { background: #191c21; }
:where(html[data-theme="dark"]) .net-rate { color: #cacdd1; }
:where(html[data-theme="dark"]) .net-view { background: #191c21; color: #cacdd1; }
:where(html[data-theme="dark"]) .net-gateway { background: #191c21; }
:where(html[data-theme="dark"]) .net-dot { background: #494138; }
:where(html[data-theme="dark"]) .net-events li.bad { color: #e4938b; }
:where(html[data-theme="dark"]) .dialog { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); }
:where(html[data-theme="dark"]) .site-footer { background: #191c21; }
:where(html[data-theme="dark"]) .cookie-notice { background: #191c21; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.484); }
:where(html[data-theme="dark"]) .review-form textarea { border: 1px solid #564636; }
:where(html[data-theme="dark"]) .review-form .error { color: #e69089; }
:where(html[data-theme="dark"]) ul.notes li { border-top: 1px solid #534436; }
:where(html[data-theme="dark"]) .brand-name { color: #d5dae2; }
:where(html[data-theme="dark"]) .brand-name small { color: #bfc4c9; }
:where(html[data-theme="dark"]) .navtoggle { background: #191c21; }
@media (min-width: 861px) {
  :where(html[data-theme="dark"]) header.bar.has-drawer.nav-open > .drawer-only { background: #191c21; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.352); }
}
:where(html[data-theme="dark"]) .site-footer a { color: var(--teal-dark, #f09b7f); }
:where(html[data-theme="dark"]) .nav-ico { color: var(--teal-dark, #f09b7f); }

/* dashboard.css */
:where(html[data-theme="dark"]) .card { background: #191c21; }
:where(html[data-theme="dark"]) .form input, :where(html[data-theme="dark"]) .form textarea, :where(html[data-theme="dark"]) .form select { background: #191c21; }
:where(html[data-theme="dark"]) .empty { background: #191c21; }
:where(html[data-theme="dark"]) .project { background: #191c21; }
:where(html[data-theme="dark"]) table.list { background: #191c21; }
:where(html[data-theme="dark"]) table.list th, :where(html[data-theme="dark"]) table.list td { border-bottom: 1px solid #57412a; }
:where(html[data-theme="dark"]) .status-pill { background: #382819; }
:where(html[data-theme="dark"]) .status-pill.done { background: #24362c; color: #88e7b1; }
:where(html[data-theme="dark"]) .status-pill.progress { background: #3e3217; color: #ffcd70; }
:where(html[data-theme="dark"]) .site-notice { background: #372715; border-bottom: 1px solid #644a2c; color: #ed9d82; }
:where(html[data-theme="dark"]) .pw-meter[data-score="2"] { color: #ffcd70; }
:where(html[data-theme="dark"]) .pw-meter[data-score="3"], :where(html[data-theme="dark"]) .pw-meter[data-score="4"] { color: #88e7b1; }
:where(html[data-theme="dark"]) .ok-note { color: #88e7b1; background: #24362c; }
:where(html[data-theme="dark"]) .warn-note { color: #ffce70; background: #3e3217; border: 1px solid #625435; }
:where(html[data-theme="dark"]) .qr { background: #191c21; }
:where(html[data-theme="dark"]) .tag-quiz { color: #beb5c8; background: #261c33; }
:where(html[data-theme="dark"]) .quiz-q { background: #191c21; }
:where(html[data-theme="dark"]) .quiz-opt.is-answer { border-color: #415b4c; background: #24362c; }
:where(html[data-theme="dark"]) .quiz-opt.is-answer .mark { color: #88e7b1; }
:where(html[data-theme="dark"]) .quiz-opt.is-wrong { border-color: #5d3934; background: #341d1b; }
:where(html[data-theme="dark"]) .quiz .explain { color: #cacdd1; }
:where(html[data-theme="dark"]) .quiz-score { background: #191c21; }
:where(html[data-theme="dark"]) .quiz-tiles .tile { background: #191c21; }
:where(html[data-theme="dark"]) .role-card { background: #191c21; }
:where(html[data-theme="dark"]) .role-card:hover, :where(html[data-theme="dark"]) .role-card:focus-visible { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .status-pill.returned { background: #371d18; color: #e69a89; }
:where(html[data-theme="dark"]) .tag-note { background: #371d18; color: #e69a89; }
:where(html[data-theme="dark"]) .section-head .filter { border: 1px solid var(--line, #564636); }
:where(html[data-theme="dark"]) .form .consent a { color: var(--teal-dark, #f09b7f); }

/* home.css */
:where(html[data-theme="dark"]) body.home { background: #191c21; }
:where(html[data-theme="dark"]) .nav-menu-list { background: #191c21; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .ticker { background: #3b3216; border-bottom: 1px solid #615635; }
:where(html[data-theme="dark"]) .hero-shot { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .feature { background: #191c21; }
:where(html[data-theme="dark"]) .facts { background: #191c21; }
:where(html[data-theme="dark"]) .stat { background: #191c21; }
:where(html[data-theme="dark"]) .notice { background: #191c21; }
:where(html[data-theme="dark"]) .notice.pinned { border-color: #615635; background: #2f2912; }
:where(html[data-theme="dark"]) .badge.new { background: #371d18; color: #e69a89; }
:where(html[data-theme="dark"]) .badge.pin { background: #4b3f1d; color: #ffd070; }
:where(html[data-theme="dark"]) .empty-note { background: #191c21; }
:where(html[data-theme="dark"]) body.home { background: linear-gradient(160deg, #2b2210 0%, var(--cream) 45%, #423119 100%) fixed; }
:where(html[data-theme="dark"]) .home-bar { background: rgba(69, 49, 26, 0.96); border-bottom: 1px solid #634a2e; }
:where(html[data-theme="dark"]) .home-nav > a:hover, :where(html[data-theme="dark"]) .nav-menu > summary:hover, :where(html[data-theme="dark"]) .nav-menu[open] > summary { background: #191c21; }
:where(html[data-theme="dark"]) .home-footer { background: #423119; color: #cacdd1; }
:where(html[data-theme="dark"]) .ticker { background: #3a2816; border-bottom-color: #644a2c; }
:where(html[data-theme="dark"]) .hero-shot { border: 2px solid #6d4f30; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.352); }
:where(html[data-theme="dark"]) .block.alt { background: rgba(51, 37, 19, 0.85); border-color: #5e452b; }
:where(html[data-theme="dark"]) .feature, :where(html[data-theme="dark"]) .stat, :where(html[data-theme="dark"]) .facts, :where(html[data-theme="dark"]) .notice, :where(html[data-theme="dark"]) .empty-note { background: rgba(25, 28, 33, 0.92); border: 1.5px solid #644a2c; }
:where(html[data-theme="dark"]) .feature:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .feature .ico { background: #423119; }
:where(html[data-theme="dark"]) .milestone { background: rgba(25, 28, 33, 0.8); }
:where(html[data-theme="dark"]) .notice.pinned { border-color: #615635; background: #2f2912; }

/* iot.css */
:where(html[data-theme="dark"]) .channel-card { background: #191c21; }
:where(html[data-theme="dark"]) .chip { background: #382819; }
:where(html[data-theme="dark"]) .chip.switch, :where(html[data-theme="dark"]) .chip.slider { background: #3e3217; color: #ffcd70; }
:where(html[data-theme="dark"]) .key-box { background: #191c21; }
:where(html[data-theme="dark"]) .widget { background: #191c21; }
:where(html[data-theme="dark"]) .switch-btn { background: #191c21; }
:where(html[data-theme="dark"]) .switch-btn .knob { background: #433526; }
:where(html[data-theme="dark"]) .switch-btn .knob::after { background: #191c21; }
:where(html[data-theme="dark"]) .field-table input, :where(html[data-theme="dark"]) .field-table select { background: #191c21; }
:where(html[data-theme="dark"]) .chart-tip { background: #191c21; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .live-dot { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.396); }
:where(html[data-theme="dark"]) .key-safety { background: #191c21; }
:where(html[data-theme="dark"]) .key-safety ul { color: #cacdd1; }
:where(html[data-theme="dark"]) .key-safety li.warn { color: #ffcd70; }

/* manual.css */
:where(html[data-theme="dark"]) body.manual-page { background: var(--bench, #342718); }
:where(html[data-theme="dark"]) .man-toc { background: #191c21; }
:where(html[data-theme="dark"]) .man-hero { background: linear-gradient(135deg, #191c21, #3a2816); }
:where(html[data-theme="dark"]) .man-hero h1 { color: #d5dae2; }
:where(html[data-theme="dark"]) .unit > h2 { color: #d5dae2; }
:where(html[data-theme="dark"]) .note { background: #332513; }
:where(html[data-theme="dark"]) .exp { background: #191c21; }
:where(html[data-theme="dark"]) .exp-head h3 { color: #d5dae2; }
:where(html[data-theme="dark"]) .chips li { background: var(--bench, #342718); }
:where(html[data-theme="dark"]) .exp th { background: #362614; }
:where(html[data-theme="dark"]) .observe { background: #173122; }
:where(html[data-theme="dark"]) .viva { background: #2a2010; }
@media (max-width: 960px) {
  :where(html[data-theme="dark"]) .man-toc > ol > li > a { background: var(--bench, #342718); }
}
@media print {
  :where(html[data-theme="dark"]) body.manual-page { background: #191c21; }
  :where(html[data-theme="dark"]) .exp { border-color: #4e4e4e; }
}
:where(html[data-theme="dark"]) .nav-menu-list { background: #191c21; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .legal-page .unit h3 { color: #d5dae2; }
:where(html[data-theme="dark"]) .legal-table { background: #191c21; }
:where(html[data-theme="dark"]) .legal-table th { background: #3a2816; }

/* admin.css */
:where(html[data-theme="dark"]) body.admin .bar { border-bottom-color: #58657f; }
:where(html[data-theme="dark"]) body.admin .brand-logo { background: #191c21; }
:where(html[data-theme="dark"]) .desk-nav { background: #191c21; }
:where(html[data-theme="dark"]) .tile { background: #191c21; }
:where(html[data-theme="dark"]) .tile.attention { border-color: #625435; background: #312712; }
:where(html[data-theme="dark"]) .tile.attention .num { color: #ffcd70; }
:where(html[data-theme="dark"]) .panel { background: #191c21; }
:where(html[data-theme="dark"]) .bars .plot { border-bottom: 1px solid #564839; }
:where(html[data-theme="dark"]) .bars .gridline { border-top: 1px solid #57412a; }
:where(html[data-theme="dark"]) .chart-tip { background: #191c21; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.264); }
:where(html[data-theme="dark"]) .activity li { border-bottom: 1px solid #57412a; }
:where(html[data-theme="dark"]) .health li { border-bottom: 1px solid #57412a; }
:where(html[data-theme="dark"]) .health .bad svg { color: #ffd270; }
:where(html[data-theme="dark"]) table.list td .badge { background: #382819; }
:where(html[data-theme="dark"]) table.list td .badge.off { background: #341d1b; }
:where(html[data-theme="dark"]) table.list select { background: #191c21; }
:where(html[data-theme="dark"]) .switch-row { border-bottom: 1px solid #57412a; }
:where(html[data-theme="dark"]) .site-notice { background: #372715; border-bottom: 1px solid #644a2c; color: #ed9d82; }
:where(html[data-theme="dark"]) .chip { background: #191c21; }
:where(html[data-theme="dark"]) .chip[aria-pressed="true"] { border-color: #644a2c; }
:where(html[data-theme="dark"]) table.list td .badge.on { background: #24362c; color: #88e7b1; }
:where(html[data-theme="dark"]) table.list td .badge.muted-badge { background: #3e3217; color: #ffcd70; }
:where(html[data-theme="dark"]) .ok-pill { background: #24362c; color: #88e7b1; }
:where(html[data-theme="dark"]) .warn-pill { background: #4b3f1d; color: #ffd070; }
:where(html[data-theme="dark"]) .off-pill { background: #382819; color: #bec1c4; }
:where(html[data-theme="dark"]) body.admin .navtoggle { background: rgba(25, 28, 33, 0.12); border-color: rgba(61, 61, 61, 0.3); }
:where(html[data-theme="dark"]) body.admin header.bar.nav-open > nav { border-top-color: rgba(61, 61, 61, 0.2); }
:where(html[data-theme="dark"]) body.admin header.bar.nav-open > nav > a:hover, :where(html[data-theme="dark"]) body.admin header.bar.nav-open > nav > a[aria-current="page"] { background: rgba(25, 28, 33, 0.12); }
:where(html[data-theme="dark"]) body.admin header.bar.nav-open > .bar-actions { border-top-color: rgba(61, 61, 61, 0.2); }
@media (min-width: 861px) {
  :where(html[data-theme="dark"]) body.admin header.bar.has-drawer.nav-open > .drawer-only { border-color: rgba(61, 61, 61, 0.18); }
}
@media (min-width: 861px) {
  :where(html[data-theme="dark"]) body.admin header.bar.has-drawer.nav-open > .drawer-only > a:hover { background: rgba(25, 28, 33, 0.12); }
}

/* ---- hand-made adjustments ---- */
html[data-theme="dark"], html[data-theme="dark"] * { scrollbar-color: #4b5160 #1b1e25; }
html[data-theme="dark"] body { background: var(--panel); color: var(--ink); }
/* white chip logo on dark backgrounds */
html[data-theme="dark"] img[src*="iotvl-mark.svg"] { content: url("../img/iotvl-mark-light.svg"); }
/* serial plotter draws dark lines: keep a light card behind it */
html[data-theme="dark"] canvas.plotter { background: #f3efe9; border-radius: 6px; }
/* form fields */
:where(html[data-theme="dark"]) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), :where(html[data-theme="dark"]) select, :where(html[data-theme="dark"]) textarea { background-color: #1d2028; color: var(--ink); border-color: #434855; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8b93a1; }
