/* OpenHaldex.com
   Colour tokens are taken directly from the OpenHaldex-C6 firmware web UI (data/style.css)
   so the website and the controller interface look like one product. */
:root {
  /* Taken from the current OpenHaldex-C6 firmware web UI (v9) */
  --primary: #24D1C4;
  --primary-hover: #1FB9AD;
  --primary-soft: #153B3E;
  --secondary: #FFB02E;
  --success: #3FD07F;
  --warning: #FFB02E;
  --danger: #FF4D5E;
  --background: #0B0F14;
  --surface: #131A22;
  --surface-light: #182129;
  --border: #24303B;
  --text: #E6EDF3;
  --text-dim: #7D8EA0;
  --text-body: #C4CFDA;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1100px;
  --measure: 70ch;
  --radius: 10px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--primary); color: var(--background); }
.label-caps { text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 600; font-size: .95rem; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2rem); margin-bottom: .75rem; }
h3 { font-size: 1.17rem; margin-top: 1.8em; }
h4 { font-size: 1.02rem; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; max-width: var(--measure); }
li { margin-bottom: .35em; }
strong { color: var(--text); font-weight: 650; }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-light); padding: .1em .4em; border-radius: 4px; color: var(--text); }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; overflow-x: auto; max-width: var(--measure); }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--background); padding: .6rem 1rem; z-index: 100; font-weight: 700; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  /* gradient header as on the original site */
  background-image: linear-gradient(180deg, #151a21, rgba(15,20,25,.92));
  top: 0; z-index: 50;
  background: rgba(15, 20, 25, .92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand .led { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.nav { display: flex; gap: .15rem; margin-left: auto; align-items: center; }
.nav a { color: var(--text-dim); text-decoration: none; padding: .45rem .7rem; border-radius: 6px; font-size: .95rem; font-weight: 550; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-light); }
.nav .nav-buy { color: var(--background); background: var(--primary); margin-left: .5rem; font-weight: 700; }
.nav .nav-buy:hover { color: var(--background); background: var(--primary-hover); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: .45rem .7rem; font: inherit; font-size: .95rem; cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--background); border-bottom: 1px solid var(--border); padding: .5rem 1.25rem 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .75rem .5rem; font-size: 1.05rem; }
  .nav .nav-buy { margin: .5rem 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.25rem; border-radius: var(--radius); font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--surface-light); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--background); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--background); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }

/* ---------- Hero (centred, as on the original site) ---------- */
.hero { text-align: center; padding: clamp(2.5rem, 6vw, 3.5rem) 0 clamp(3rem, 6vw, 4rem); border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at top, rgba(36, 209, 196, .13), transparent 60%); }
.hero-grid { display: flex; flex-direction: column; align-items: center; }
.hero .tagline { color: var(--text); font-weight: 600; margin: 0 auto 1.25rem; }
.hero h1 { margin: 0 auto .9rem; }
.hero .lede { font-size: 1.05rem; color: var(--text-body); max-width: 70ch; margin: 0 auto 1rem; }
.hero .by { color: var(--text-dim); font-size: .95rem; margin: 1.25rem auto 0; }
.hero .actions { justify-content: center; margin-top: 1.5rem; }
.hero .panel { width: 100%; max-width: 560px; margin-top: 2.5rem; text-align: left; }
@media (max-width: 600px) { .hero .actions .btn { width: 100%; } }

/* Mode panel: a working replica of the firmware's mode selector */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-title { color: var(--text-dim); font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.panel-led { display: flex; align-items: center; gap: .55rem; font-size: .85rem; color: var(--text-dim); }
.panel-led i { width: 14px; height: 14px; border-radius: 50%; background: var(--led, #FF4D4D); box-shadow: 0 0 14px var(--led, #FF4D4D), 0 0 3px var(--led, #FF4D4D); transition: background .25s, box-shadow .25s; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.mode-btn { background: var(--surface-light); border: 1px solid var(--border); color: var(--text); padding: .8rem .4rem; border-radius: 8px; font: inherit; font-weight: 650; cursor: pointer; }
.mode-btn:hover { border-color: var(--primary); }
.mode-btn { color: var(--text-dim); }
.mode-btn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.split { margin-top: 1.4rem; }
.split-labels { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-dim); margin-bottom: .4rem; }
.split-labels b { color: var(--text); font-weight: 650; }
.split-bar { position: relative; height: 34px; border-radius: 6px; background: var(--surface-light); overflow: hidden; border: 1px solid var(--border); }
.split-front, .split-rear { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-family: var(--mono); font-size: .8rem; font-weight: 600; transition: width .45s cubic-bezier(.2,.8,.2,1); white-space: nowrap; overflow: hidden; }
.split-front { left: 0; background: var(--surface-light); color: var(--text); padding-left: .7rem; }
.split-rear { right: 0; background: var(--primary-soft); border-left: 2px solid var(--primary); color: var(--primary); justify-content: flex-end; padding-right: .7rem; }
.split-bar.oem .split-rear, .split-bar.map .split-rear { background: repeating-linear-gradient(135deg, rgba(36,209,196,.45) 0 8px, rgba(36,209,196,.18) 8px 16px); color: var(--text); }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; margin-top: 1.1rem; font-size: .9rem; }
.readout dt { color: var(--text-dim); }
.readout dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; }
.panel-note { font-size: .82rem; color: var(--text-dim); margin: 1rem 0 0; }
@media (prefers-reduced-motion: reduce) { .split-front, .split-rear, .panel-led i { transition: none; } }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
@media (max-width: 600px) { .section { padding: 2.5rem 0; } }
.section:last-of-type { border-bottom: 0; }
.section-intro { max-width: 60ch; margin-bottom: 2.5rem; }
.section-intro p { color: var(--text-body); font-size: 1.1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* Feature list: card style from the original site */
.feature-list { list-style: none; padding: 0; margin: 0; max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
/* navy card colours carried over from the original openhaldex.com */
.feature-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin: 0; }
.feature-list li:hover { border-color: var(--primary); }
.feature-list h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
.feature-list p { margin: 0; font-size: .98rem; color: var(--text-body); }

/* Signal path diagram */
.flow { margin: 0; }
.flow svg { width: 100%; height: auto; display: block; }
.flow figcaption { color: var(--text-dim); font-size: .9rem; margin-top: .75rem; }

/* Steps (a real sequence) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.4rem 3.2rem; margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.steps > li::after { content: ""; position: absolute; left: 1.05rem; top: 2.2rem; bottom: .2rem; width: 1px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps strong { display: block; margin-bottom: .15rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.25rem 0 2rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; background: var(--surface); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; vertical-align: -.05rem; box-shadow: 0 0 8px currentColor; background: currentColor; }

.status { display: inline-block; font-size: .8rem; font-weight: 650; padding: .15rem .55rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.status-ok { color: var(--success); border-color: rgba(46,160,67,.5); background: rgba(46,160,67,.1); }
.status-dev { color: var(--warning); border-color: rgba(255,166,87,.5); background: rgba(255,166,87,.1); }
.status-no { color: var(--danger); border-color: rgba(248,81,73,.45); background: rgba(248,81,73,.08); }

/* Callouts */
.note { border-left: 3px solid var(--primary); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; max-width: var(--measure); }
.note.warn { border-left-color: var(--warning); }
.note.danger { border-left-color: var(--danger); }
.note p:last-child { margin-bottom: 0; }

/* Figures */
.shot { margin: 1.5rem 0 2rem; }
.shot img { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.shot figcaption { color: var(--text-dim); font-size: .88rem; margin-top: .6rem; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .shots { grid-template-columns: 1fr; } }

/* Page header for inner pages */
.page-head { text-align: center; padding: 2.5rem 0 2.25rem; border-bottom: 1px solid var(--border); background: radial-gradient(circle at top, rgba(36, 209, 196, .10), transparent 60%); }
.page-head h1 { margin: 0 auto .5rem; }
.page-head p { font-size: 1.05rem; max-width: 70ch; margin: 0 auto; }

/* Docs layout with contents list */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; padding-top: 3rem; padding-bottom: 5rem; }
.toc { position: sticky; top: 88px; align-self: start; font-size: .92rem; }
.toc p { color: var(--text-dim); font-weight: 600; margin-bottom: .5rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0 .3rem 1rem; color: var(--text-dim); text-decoration: none; margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--primary); }
.doc-body > section { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.doc-body > section:last-child { border-bottom: 0; }
.doc-body h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; gap: 1.5rem; } .toc { position: static; } }

/* FAQ */
.faq details { border-top: 1px solid var(--border); max-width: 80ch; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; position: relative; color: var(--text); font-weight: 650; font-size: 1.08rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .9rem; font-size: 1.5rem; color: var(--primary); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 1.2rem; }

/* Updater */
.flasher { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; max-width: 560px; }
.flasher label { display: block; color: var(--text); font-weight: 650; margin-bottom: .5rem; }
.flasher select { width: 100%; background: var(--surface-light); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .75rem .9rem; font: inherit; margin-bottom: 1rem; }
.flasher .meta { font-size: .88rem; color: var(--text-dim); margin: 0 0 1.2rem; }
.flasher .unsupported { color: var(--warning); margin: 0; }

/* Callout band */
.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.band h2 { margin: 0 0 .3rem; font-size: clamp(1.4rem, 3vw, 1.75rem); }
.band p { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 3.5rem 0 2.5rem; color: var(--text-dim); font-size: .9rem; background: linear-gradient(180deg, #151a21, var(--background)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font-size: .95rem; color: var(--text); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .disclaimer { margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .75rem; line-height: 1.4; max-width: 80ch; text-align: center; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.muted { color: var(--text-dim); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Firmware screenshots */
.ui-shot { margin: 1.5rem 0 2rem; }
.ui-shot img { width: 100%; max-width: 380px; border-radius: 14px; border: 1px solid var(--border); background: var(--background); }
.ui-shot figcaption { color: var(--text-dim); font-size: .88rem; margin-top: .6rem; max-width: 380px; }
.ui-row { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; margin: 1.5rem 0 2rem; }
.ui-row .ui-shot { margin: 0; flex: 1 1 260px; max-width: 380px; }
.ui-scroll img { max-height: 720px; object-fit: cover; object-position: top; }
.wide-shot img { max-width: 100%; border-radius: 14px; border: 1px solid var(--border); }

/* Updater, laid out like the Forbes Automotive updater */
.fw-wrap { max-width: 980px; }
.fw-note { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.2rem; margin: 0 0 1rem; max-width: none; }
.fw-note p { max-width: none; margin: 0; }
.fw-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; margin: 0 0 1rem; }
.fw-card h2, .fw-card h3 { margin: 0 0 .9rem; font-size: 1.25rem; }
.fw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.fw-head h2 { margin: 0; }
.fw-badge { font-size: .8rem; color: var(--primary); border: 1px solid var(--border); background: var(--surface-light); padding: .25rem .7rem; border-radius: 999px; }
.fw-controls { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; }
.fw-controls label { display: block; color: var(--text); font-weight: 600; margin-bottom: .45rem; }
.fw-controls select { width: 100%; background: var(--surface-light); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; font: inherit; }
.fw-meta { color: var(--text-dim); font-size: .88rem; margin: .8rem 0 0; }
.fw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fw-card ul { padding-left: 1.1rem; margin: 0; max-width: none; }
.fw-card .fw-divider { border-top: 1px solid var(--border); margin: 1.1rem 0; }
.fw-card .muted { font-size: .92rem; margin: 0; max-width: none; }
@media (max-width: 760px) { .fw-controls, .fw-grid { grid-template-columns: 1fr; } }
esp-web-install-button button.btn { min-width: 180px; }
.flasher-warn { color: var(--warning); margin: 0; max-width: 32ch; }
esp-web-install-button:not(:defined) [slot="unsupported"], esp-web-install-button:not(:defined) [slot="not-allowed"] { display: none; }


/* ==========================================================================
   Homepage merge: hero treatment, feature tags and the mode cards
   ========================================================================== */

/* --- Hero with the car behind it --- */
.hero.has-photo { position: relative; overflow: hidden; isolation: isolate; }
.hero.has-photo::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: url("/assets/img/mk4-golf.jpg");
  background-size: cover; background-position: center 62%;
  opacity: .28;
}
.hero.has-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 0%, rgba(36,209,196,.18), transparent 58%),
    linear-gradient(180deg, rgba(11,15,20,.70) 0%, rgba(11,15,20,.88) 62%, var(--background) 100%);
}
.hero h1 .accent { color: var(--primary); }

.hero-meta {
  list-style: none; margin: 1.5rem auto 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
}
.hero-meta li {
  font-size: .8rem; font-weight: 600; color: var(--text-dim);
  background: rgba(24,33,41,.75); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .8rem;
}

/* --- Feature cards: a short label instead of a number, so it says something --- */
.feature-cards .feature-tag {
  display: block; font-family: var(--mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .12em; color: var(--primary); margin-bottom: .6rem;
}

/* --- Mode cards --- */
.mode-cards {
  list-style: none; margin: 0; padding: 0;
  max-width: none;            /* escape the global p/ul/ol 70ch cap */
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 560px) { .mode-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .mode-cards { grid-template-columns: repeat(3, 1fr); } }

.mode-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.15rem 1.25rem; margin: 0;
}
.mode-card .mode-name {
  display: block; font-size: 1.2rem; font-weight: 800;
  color: var(--text); letter-spacing: -.01em;
}
.mode-card .mode-meta {
  display: block; font-family: var(--mono); font-size: .76rem;
  color: var(--primary); margin-bottom: .55rem;
}
.mode-card .mode-bar {
  display: block; height: 6px; border-radius: 4px;
  background: var(--surface-light); overflow: hidden; margin: 0 0 .9rem;
}
.mode-card .mode-bar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}
.mode-card p { margin: 0; font-size: .93rem; color: var(--text-dim); }

.mode-card.is-expert { border-color: var(--secondary); }
.mode-card.is-expert .mode-meta { color: var(--secondary); }
.mode-card.is-expert .mode-bar i {
  background: linear-gradient(90deg, var(--secondary), var(--warning));
}

/* --- "Try the controller interface" demo page --- */
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  padding: .85rem 1.1rem; background: var(--surface);
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.demo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); flex: none; }
.demo-status { margin: 0; flex: 1 1 16rem; font-size: .88rem; color: var(--text-dim); }
.demo-status[data-kind="ok"] { color: var(--success); }
.demo-status[data-kind="error"] { color: var(--danger); }
.demo-bar:has(.demo-status[data-kind="ok"]) .demo-dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
.demo-bar:has(.demo-status[data-kind="busy"]) .demo-dot { background: var(--warning); }
.demo-bar:has(.demo-status[data-kind="error"]) .demo-dot { background: var(--danger); }
.demo-reload { padding: .45rem .9rem; font-size: .85rem; }
.demo-reload:disabled { opacity: .5; pointer-events: none; }

.device {
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden; background: #0F1419;
}
.device iframe {
  display: block; width: 100%; height: min(78vh, 900px);
  min-height: 560px; border: 0; background: #0F1419;
}
@media (max-width: 720px) {
  .device iframe { height: min(70vh, 700px); min-height: 480px; }
}

.demo-toast {
  position: fixed; left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(150%);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--warning); color: var(--text-body);
  font-size: .9rem; padding: .8rem 1.1rem; border-radius: var(--radius);
  max-width: min(92vw, 32rem); z-index: 900; transition: transform .25s ease;
}
.demo-toast.is-on { transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .demo-toast { transition: none; } }

/* Section intro that lets its heading run the full width (keeps prose at a readable measure) */
.section-intro.wide { max-width: none; }
.section-intro.wide h2 { text-wrap: balance; }
.section-intro.wide p { max-width: var(--measure); }
