/* multibus.dev — one page, no framework, no external requests */

:root {
  --teal: #0b6b75;
  --teal-dark: #08525a;
  --teal-soft: #e6f3f4;
  --amber: #e0a01c;
  --ink: #14212b;
  --ink-2: #3b4a56;
  --muted: #66757f;
  --line: #dde5e9;
  --bg: #ffffff;
  --bg-alt: #f5f8f9;
  --code-bg: #0f1d26;
  --code-ink: #d9e6ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 8px 24px rgba(20, 33, 43, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --teal: #3fb7c2;
    --teal-dark: #69cbd4;
    --teal-soft: #11303a;
    --ink: #e6eef2;
    --ink-2: #c3d0d7;
    --muted: #93a3ad;
    --line: #253640;
    --bg: #0d171d;
    --bg-alt: #111f27;
    --code-bg: #0a1318;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: .98rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s, color .15s; }
.btn-sm { padding: 7px 12px; font-size: .9rem; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #071216; } }
.btn-light { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-link { background: none; color: var(--teal); padding-left: 6px; padding-right: 6px; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bolt { width: 22px; height: 22px; fill: var(--amber); flex: none; }
.menu { display: flex; gap: 4px; margin-left: auto; }
.menu a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.menu a:hover { background: var(--teal-soft); color: var(--teal); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang { font: 600 .85rem var(--font); border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.lang:hover { border-color: var(--teal); color: var(--teal); }
.gh svg { width: 16px; height: 16px; fill: currentColor; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; padding: 10px 9px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 960px) {
  .burger { display: flex; }
  .menu { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none; }
  .menu.open { display: flex; }
  .menu a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 520px) { .gh span { display: none; } }

/* ── hero ── */
.hero { padding: 64px 0 48px; background: radial-gradient(1200px 500px at 85% -10%, var(--teal-soft), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: 14px; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.lead-strong { font-weight: 700; font-size: 1.08rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 22px; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li { font-size: .82rem; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.hero-shot img { border-radius: var(--radius); box-shadow: var(--shadow), 0 30px 60px -20px rgba(11, 107, 117, .35); border: 1px solid var(--line); }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }

/* ── proof ── */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.proof p { margin: 0; padding: 22px 0; color: var(--ink-2); font-size: 1rem; }
.proof strong { color: var(--ink); }

/* ── sections ── */
.sec { padding: 80px 0; }
.sec-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-lead { color: var(--ink-2); font-size: 1.08rem; max-width: 760px; margin-bottom: 36px; }
@media (max-width: 640px) { .sec { padding: 56px 0; } }

/* ── how it works ── */
.flow { display: grid; grid-template-columns: 1fr auto 1.05fr auto 1fr; gap: 16px; align-items: stretch; }
.flow-col, .flow-core { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); box-shadow: var(--shadow); }
.flow-col h3 { color: var(--teal); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.flow ul { list-style: none; margin: 0; padding: 0; }
.flow li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.flow li:last-child { border-bottom: 0; }
.flow li span { color: var(--muted); font-size: .86rem; display: block; }
.flow-core { background: linear-gradient(160deg, var(--teal), var(--teal-dark)); color: #fff; border: 0; }
.flow-core li { border-bottom-color: rgba(255, 255, 255, .25); }
.core-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; }
@media (prefers-color-scheme: dark) { .flow-core { color: #071216; } .flow-core li { border-bottom-color: rgba(7, 18, 22, .25); } }
.flow-arrow { align-self: center; font-size: 1.8rem; color: var(--teal); }
@media (max-width: 960px) { .flow { grid-template-columns: 1fr; } .flow-arrow { transform: rotate(90deg); justify-self: center; } }

/* ── features ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { position: relative; padding-left: 14px; }
.card h3::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 2px; background: var(--amber); }
.card p { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* ── tour ── */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button { font: 600 .92rem var(--font); border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button[aria-selected="true"] { color: #071216; } }
.shot { margin: 0; }
.shot img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot figcaption { color: var(--muted); font-size: .93rem; margin-top: 12px; }

/* ── examples ── */
.examples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ex { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.ex p { color: var(--ink-2); font-size: .96rem; }
.ex-flow { font-family: var(--mono); font-size: .82rem !important; background: var(--teal-soft); color: var(--ink) !important; border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.ex-flow > span { color: var(--teal); }
.ex pre { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: .8rem; line-height: 1.55; margin: 0; }
@media (max-width: 860px) { .examples { grid-template-columns: 1fr; } }

/* ── editions ── */
.editions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
.edition { border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: var(--bg); box-shadow: var(--shadow); }
.edition h3 { font-size: 1.5rem; margin-bottom: 4px; }
.price { color: var(--muted); font-weight: 600; }
.edition-pro { border: 2px solid var(--teal); position: relative; }
.pro-lead { font-weight: 700; margin-bottom: 8px; }
.ticks { list-style: none; padding: 0; margin: 0 0 22px; }
.ticks li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .96rem; }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 12px; height: 7px; border-left: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(-45deg); }
.ticks b { color: var(--ink); }
.soon { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b4a00; background: #fde9b8; border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
@media (max-width: 860px) { .editions { grid-template-columns: 1fr; } }

/* ── get started ── */
.code-block { position: relative; }
.code-block pre { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 20px 22px; overflow-x: auto; font-size: .84rem; line-height: 1.65; margin: 0; }
.copy { position: absolute; top: 10px; right: 10px; font: 600 .8rem var(--font); background: rgba(255, 255, 255, .1); color: var(--code-ink); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .18); }
.links { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.links a { font-weight: 600; }

/* ── contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-points { list-style: none; padding: 0; margin: 0 0 18px; }
.contact-points li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.contact-points b { color: var(--ink); display: block; }
.direct { font-weight: 600; }
.form { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea { font: 400 1rem var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.form textarea { resize: vertical; min-height: 130px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-err { color: #b42318; margin: 0; font-weight: 600; }
@media (prefers-color-scheme: dark) { .form-err { color: #ff8a80; } }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ── footer ── */
.foot { border-top: 1px solid var(--line); padding: 36px 0 18px; background: var(--bg-alt); }
.foot-row { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot-row p { max-width: 380px; margin-top: 10px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--teal); }

/* narrow phones: the header row must fit 360 px */
@media (max-width: 430px) {
  .top-row { gap: 10px; }
  .brand { font-size: .95rem; gap: 6px; }
  .top-actions { gap: 6px; }
  .gh { padding: 7px 9px; }
}

/* ── animated diagrams (assets/scenes.js) ─────────────────────────────── */
.dg { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.dg-wide { padding: 18px; }
.dg.has-svg .flow { display: none; }
.dg:not(.has-svg) { background: none; border: 0; box-shadow: none; padding: 0; }
.dg-svg { display: block; width: 100%; height: auto; overflow: visible; }
.dg-svg text { font-family: var(--font); fill: var(--ink); }
.t-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; fill: var(--muted) !important; }
.t-title { font-size: 14px; font-weight: 700; }
.t-value { font-size: 15px; font-weight: 700; font-family: var(--mono) !important; fill: var(--teal) !important; }
.t-axis { font-size: 11px; fill: var(--muted) !important; }
.t-chip { font-size: 11.5px; font-weight: 700; }
.t-core { font-size: 17px; font-weight: 800; fill: #fff !important; }
.t-core-row { font-size: 12px; font-weight: 600; fill: #fff !important; }
.t-zone { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; fill: var(--muted) !important; }
.t-screen-title { font-size: 12px; font-weight: 700; fill: #9fd6dc !important; }
.t-tag { font-size: 11px; font-family: var(--mono) !important; fill: #c9d8df !important; }
.t-tag-v { font-size: 11px; font-family: var(--mono) !important; fill: #7fe0a8 !important; }
.t-count { font-size: 13px; font-weight: 700; fill: var(--teal) !important; }
.t-bar { font-size: 12px; font-weight: 700; font-family: var(--mono) !important; }
.t-th { font-size: 10.5px; font-weight: 700; }

/* nodes */
.n-box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; transition: fill .4s, stroke .4s; }
.n-accent { fill: var(--amber); transition: fill .4s; }
.n-core .n-box { fill: var(--teal-soft); stroke: var(--teal); }
.n-core .n-accent { fill: var(--teal); }
.n-out .n-accent { fill: var(--teal); }
.n-warn .n-box { stroke: var(--amber); fill: color-mix(in srgb, var(--amber) 10%, var(--bg)); }
.n-warn .n-accent { fill: var(--amber); }
.n-bad .n-box { stroke: #d14343; fill: color-mix(in srgb, #d14343 9%, var(--bg)); }
.n-bad .n-accent { fill: #d14343; }
.n-bad .t-value { fill: #d14343 !important; }
.n-off { opacity: .4; }
.node { transition: opacity .4s; }

/* the core of the architecture */
.core-box { fill: var(--teal); }
.core-ring { fill: none; stroke: var(--teal); stroke-width: 2; opacity: .35; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; }
.core-row { fill: rgba(255, 255, 255, .14); }
@keyframes ring { 0% { transform: scale(.98); opacity: .5; } 100% { transform: scale(1.06); opacity: 0; } }
@media (prefers-color-scheme: dark) {
  .t-core, .t-core-row { fill: #071216 !important; }
  .core-row { fill: rgba(7, 18, 22, .14); }
}

/* wires and packets */
.w { fill: none; stroke: var(--line); stroke-width: 2.2; transition: stroke .4s; }
.w-live { stroke: color-mix(in srgb, var(--amber) 55%, var(--line)); stroke-dasharray: 5 7; animation: dash 1.1s linear infinite; }
.w-out { stroke: color-mix(in srgb, var(--teal) 55%, var(--line)); }
.w-lan { stroke-dasharray: 10 6; }
.w-hb { stroke: color-mix(in srgb, #8b5cf6 60%, var(--line)); }
.w-hb2 { stroke: color-mix(in srgb, #0ea5e9 60%, var(--line)); }
.w-bad { stroke: #d14343; stroke-dasharray: 3 6; animation: none; opacity: .7; }
@keyframes dash { to { stroke-dashoffset: -24; } }
.pk { transition: opacity .3s; }
.pk-in { fill: var(--amber); }
.pk-out { fill: var(--teal); }
.pk-hb { fill: #8b5cf6; }
.pk-hidden { opacity: 0; }

/* chips (the story's status line) */
.chip-bg { fill: var(--teal-soft); stroke: var(--teal); stroke-width: 1; }
.chip .t-chip { fill: var(--teal-dark); }
.chip.warn .chip-bg { fill: color-mix(in srgb, var(--amber) 16%, var(--bg)); stroke: var(--amber); }
.chip.warn .t-chip { fill: #8a5a00; }
.chip.bad .chip-bg { fill: color-mix(in srgb, #d14343 12%, var(--bg)); stroke: #d14343; }
.chip.bad .t-chip { fill: #b42318; }
.chip.vip .chip-bg { fill: var(--amber); stroke: none; }
.chip.vip .t-chip { fill: #3b2a00; }
.chip.vip { transition: transform .9s cubic-bezier(.6, 0, .3, 1); }
@media (prefers-color-scheme: dark) { .chip.warn .t-chip { fill: #f5c45e; } .chip.bad .t-chip { fill: #ff8a80; } }

/* over-voltage chart */
.chart-bg { fill: var(--bg-alt); stroke: var(--line); }
.th { stroke-width: 1.5; stroke-dasharray: 5 4; }
.th0 { stroke: #e0a01c; fill: #b07a00; }
.th1 { stroke: #e46a1c; fill: #c4540c; }
.th2 { stroke: #d14343; fill: #b42318; }
.th-rel { stroke: var(--teal); opacity: .6; }
.v-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.v-dot { fill: var(--ink); stroke: var(--bg); stroke-width: 2; }
.bar-bg { fill: var(--bg-alt); stroke: var(--line); }
.bar { fill: var(--teal); transition: y .5s, height .5s, fill .5s; }
.bar-warn { fill: var(--amber); }
.bar-bad { fill: #d14343; }

/* SCADA screen */
.screen { fill: #0f1d26; stroke: #23404d; stroke-width: 2; }

/* solar and the pump */
.sun-core { fill: #f4b400; }
.sun-ray { stroke: #f4b400; stroke-width: 3; stroke-linecap: round; }
.sun { transform-box: fill-box; transform-origin: center; animation: spin 24s linear infinite; }
.cloud ellipse { fill: #cfd8dc; }
@media (prefers-color-scheme: dark) { .cloud ellipse { fill: #50616b; } }
.pump-body { fill: var(--bg-alt); stroke: var(--teal); stroke-width: 2; }
.blade { fill: var(--teal); }
.rotor { animation: spin 1s linear infinite; }
.rotor.r0 { animation-play-state: paused; }
.rotor.r1 { animation-duration: 2.4s; }
.rotor.r2 { animation-duration: 1.2s; }
.rotor.r3 { animation-duration: .6s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buses and zones */
.bus { stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.drop { stroke: var(--ink-2); stroke-width: 2; }
.drop-listen { stroke: var(--teal); stroke-dasharray: 3 4; }
.zone { fill: var(--bg-alt); stroke: var(--line); stroke-dasharray: 6 5; }

/* still or out of sight: no motion */
.dg-paused *, .dg-still * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .dg-svg * { animation: none !important; transition: none !important; } }

/* examples: the drawing beside its story */
.examples { grid-template-columns: 1fr; gap: 22px; }
.ex { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: center; }
.ex .dg { box-shadow: none; background: var(--bg-alt); }
.ex:nth-child(even) .dg { order: 2; }
.ex-text h3 { font-size: 1.2rem; }
.rule summary { cursor: pointer; font-weight: 600; color: var(--teal); margin-bottom: 8px; }
@media (max-width: 900px) { .ex { grid-template-columns: 1fr; } .ex:nth-child(even) .dg { order: 0; } }

/* high availability */
.ha-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.ha-points li { color: var(--ink-2); padding-left: 18px; position: relative; }
.ha-points li::before { content: ""; position: absolute; left: 0; top: .65em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.ha-points b { color: var(--ink); }
@media (max-width: 760px) { .ha-points { grid-template-columns: 1fr; } }

/* the story's status line under each drawing */
.dg-status { margin-top: 10px; font-size: .9rem; font-weight: 600; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--teal); background: var(--teal-soft); color: var(--teal-dark); transition: background .3s, border-color .3s, color .3s; min-height: 2.4em; }
.dg-status.warn { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, var(--bg)); color: #7a5000; }
.dg-status.bad { border-color: #d14343; background: color-mix(in srgb, #d14343 10%, var(--bg)); color: #a01d14; }
@media (prefers-color-scheme: dark) { .dg-status.warn { color: #f5c45e; } .dg-status.bad { color: #ff8a80; } }
.rotor { transform-box: fill-box; transform-origin: center; }
.rotor-hub { fill: transparent; }

/* phones: a drawing keeps a readable width and scrolls inside its frame */
.dg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) {
  .dg-scroll .dg-svg { min-width: 600px; }
  .dg-wide .dg-scroll .dg-svg { min-width: 760px; }
  .dg.has-svg::before { content: attr(data-swipe); display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
}
.dg, .ex > *, .ex-text { min-width: 0; max-width: 100%; }

/* export cap, MQTT control */
.v-free { stroke: var(--muted); stroke-dasharray: 4 5; stroke-width: 1.6; opacity: .7; }
.t-free { font-style: italic; }
.t-gate { font-size: 12.5px; font-weight: 600; fill: var(--muted) !important; }
.t-gate.g-ok { fill: #1f8a4c !important; }
.t-gate.g-bad { fill: #d14343 !important; }
.t-topic { font-size: 12px; font-family: var(--mono) !important; font-weight: 600; fill: var(--teal-dark) !important; }
.t-reply { fill: var(--ink-2) !important; }
.pro-tag { vertical-align: 2px; }
@media (prefers-color-scheme: dark) { .t-gate.g-ok { fill: #5fd38d !important; } }

/* possible situations */
.sits { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-top: 22px; }
.sit { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.sit h3 { font-size: 1.08rem; }
.sit p { color: var(--ink-2); font-size: .95rem; }
.sit-tags { font-size: .8rem !important; color: var(--teal) !important; font-weight: 600; margin-bottom: 8px; }
.sit pre { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: .76rem; line-height: 1.5; margin: 0; }
#situations .examples { margin-bottom: 4px; }
@media (max-width: 1180px) { .menu a { padding: 8px 7px; font-size: .9rem; } }
.pro-more { margin-top: 36px; }
.pro-more .ex { background: var(--bg); }

/* MQTT control */
.t-big { font-size: 24px; font-weight: 800; font-family: var(--mono) !important; fill: var(--teal) !important; }
.gate-bg { fill: rgba(255, 255, 255, .7); stroke: var(--line); transition: fill .3s, stroke .3s; }
.gate-dot { fill: var(--bg-alt); stroke: var(--line); stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.t-gate { font-size: 12.5px; font-weight: 600; fill: var(--ink-2) !important; }
.t-gate-mark { font-size: 12px; font-weight: 800; fill: #fff !important; }
.gate.ok .gate-dot { fill: #1f8a4c; stroke: #1f8a4c; }
.gate.ok .gate-bg { stroke: #1f8a4c; }
.gate.bad .gate-dot { fill: #d14343; stroke: #d14343; }
.gate.bad .gate-bg { stroke: #d14343; fill: color-mix(in srgb, #d14343 9%, var(--bg)); }
@media (prefers-color-scheme: dark) { .gate-bg { fill: rgba(13, 23, 29, .6); } }
.msg { transition: opacity .3s; }
.msg-hidden { opacity: 0; }
.msg-bg { stroke-width: 1.5; }
.msg-ask .msg-bg { fill: #fff7e0; stroke: var(--amber); }
.msg-ans .msg-bg { fill: var(--teal-soft); stroke: var(--teal); }
.t-msg { font-size: 11.5px; font-weight: 700; font-family: var(--mono) !important; fill: var(--ink) !important; }
@media (prefers-color-scheme: dark) { .msg-ask .msg-bg { fill: #3a2d0a; } }

/* the architecture: commands back, the Pro alerts output */
.pk-cmd { fill: #8b5cf6; }
.pk-pro { fill: #db2777; }
.w-pro { stroke: color-mix(in srgb, #db2777 50%, var(--line)); }
.n-pro .n-accent { fill: #db2777; }
.n-pro .n-box { stroke: color-mix(in srgb, #db2777 45%, var(--line)); }
.msg-cmd .msg-bg { fill: #efe9ff; stroke: #8b5cf6; }
@media (prefers-color-scheme: dark) { .msg-cmd .msg-bg { fill: #2a2140; } }
.n-cmd .n-box { stroke: #8b5cf6; fill: color-mix(in srgb, #8b5cf6 8%, var(--bg)); }
.n-cmd .n-accent { fill: #8b5cf6; }
.batt-shell { fill: var(--bg-alt); stroke: var(--ink-2); stroke-width: 2; }
.batt-fill { fill: #1f8a4c; transition: y .4s, height .4s; }
.batt-charging { fill: #8b5cf6; }

/* coming soon */
.soon-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.soon-card { background: var(--bg); border: 1px dashed color-mix(in srgb, var(--teal) 45%, var(--line)); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.soon-card b { color: var(--ink); font-size: 1rem; }
.soon-card b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: 2px; }
.soon-card span { color: var(--ink-2); font-size: .92rem; }
.soon-cta { margin: 22px 0 0; }
.sec-alt2 { background: var(--bg); }
.msg-alert .msg-bg { fill: #fde7f1; stroke: #db2777; }
@media (prefers-color-scheme: dark) { .msg-alert .msg-bg { fill: #3d1428; } }
.n-alerting .n-box { stroke: #db2777; fill: color-mix(in srgb, #db2777 12%, var(--bg)); }
.n-alerting .n-accent { fill: #db2777; }
.th3 { stroke: #8f1d1d; fill: #8f1d1d; }
@media (prefers-color-scheme: dark) { .th3 { stroke: #ff6b6b; fill: #ff6b6b; } }
.v-line.v-u1 { stroke: #0b6b75; } .v-line.v-u2 { stroke: #2563eb; } .v-line.v-u3 { stroke: #b45309; } .v-line.v-u4 { stroke: #9333ea; }
.t-u1 { fill: #0b6b75 !important; font-weight: 700; } .t-u2 { fill: #2563eb !important; font-weight: 700; }
.t-u3 { fill: #b45309 !important; font-weight: 700; } .t-u4 { fill: #9333ea !important; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .v-line.v-u1 { stroke: #3fb7c2; } .v-line.v-u2 { stroke: #60a5fa; } .v-line.v-u3 { stroke: #f59e0b; } .v-line.v-u4 { stroke: #c084fc; }
  .t-u1 { fill: #3fb7c2 !important; } .t-u2 { fill: #60a5fa !important; } .t-u3 { fill: #f59e0b !important; } .t-u4 { fill: #c084fc !important; }
}

/* the contact form */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form { position: relative; }
.captcha:empty { display: none; }
.form-msg { margin: 0; font-weight: 600; padding: 10px 12px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-dark); }
.form-msg.ok { background: color-mix(in srgb, #1f8a4c 12%, var(--bg)); color: #17653a; }
.form-msg.err { background: color-mix(in srgb, #d14343 10%, var(--bg)); color: #a01d14; }
@media (prefers-color-scheme: dark) { .form-msg.ok { color: #7fe0a8; } .form-msg.err { color: #ff8a80; } }
.btn[disabled] { opacity: .6; cursor: wait; }

/* the privacy page: one language at a time */
html[lang="ro"] .lang-en, html:not([lang="ro"]) .lang-ro { display: none; }
.legal .wrap { max-width: 820px; }
.legal h2 { font-size: 1.25rem; margin-top: 1.6em; }
.legal li { margin-bottom: .6em; color: var(--ink-2); }
.legal p { color: var(--ink-2); }
.form-note { margin: 0; font-size: .85rem; color: var(--muted); }
