/* kit-hero.css - hero scene styles for the kit demos (diesel generator, UPS battery).
   Brand tokens only (engine/engine.css :root). The page shows the whole alert list: no inner scroll. */
.alert-scroll { max-height: none; overflow: visible; }

.kh { padding: 14px 16px; }
.kh-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kh-card { background: var(--bq-elevated); border: 1px solid var(--bq-border); border-radius: 12px; padding: 10px 12px 12px; min-width: 0; transition: border-color .25s, box-shadow .25s; }
.kh-card.st-warning { border-color: var(--bq-warning); }
.kh-card.st-critical { border-color: var(--bq-critical); box-shadow: 0 0 0 1px var(--bq-critical), 0 0 18px rgba(229,72,77,.25); }
.kh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kh-name { font-size: 13px; font-weight: 700; }
.kh-name small { display: block; font-size: 10px; font-weight: 500; color: var(--bq-faint); }
.kh-pill { font-size: 10px; font-weight: 700; letter-spacing: .06em; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--bq-border); color: var(--bq-muted); white-space: nowrap; }
.kh-pill.on { color: var(--bq-ok); border-color: rgba(47,191,113,.5); }
.kh-pill.warn { color: var(--bq-warning); border-color: var(--bq-warning); }
.kh-pill.bad { color: var(--bq-text); background: var(--bq-critical); border-color: var(--bq-critical); }
.kh-svg { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
.kh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin-top: 6px; }
.kh-stat { background: var(--bq-panel); border-radius: 8px; padding: 5px 8px; min-width: 0; }
.kh-stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.kh-stat span { font-size: 10px; color: var(--bq-muted); text-transform: uppercase; letter-spacing: .03em; }
.kh-stat.st-warning b { color: var(--bq-warning); }
.kh-stat.st-critical b { color: var(--bq-critical); }
.kh-src { margin-top: 6px; font-size: 10px; color: var(--bq-faint); line-height: 1.4; }
.kh-src i { font-style: normal; color: var(--bq-orange); font-weight: 600; }

.kh-link { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11px; color: var(--bq-muted); flex-wrap: wrap; }
.kh-node { border: 1px solid var(--bq-border); background: var(--bq-elevated); border-radius: 8px; padding: 5px 10px; white-space: nowrap; }
.kh-node.gold { border-color: var(--bq-orange); color: var(--bq-orange); }
.kh-wire { position: relative; flex: 1 1 60px; height: 2px; min-width: 40px; background: repeating-linear-gradient(90deg, var(--bq-orange) 0 6px, transparent 6px 12px); background-size: 12px 2px; animation: khflow 1s linear infinite; opacity: .8; }
@keyframes khflow { to { background-position: 12px 0; } }

/* SVG parts */
.kh-svg .line { stroke: var(--bq-border); fill: none; stroke-width: 2; }
.kh-svg .body { fill: var(--bq-panel); stroke: var(--bq-border); stroke-width: 2; }
.kh-svg .louvre { stroke: var(--bq-border); stroke-width: 2; }
.kh-svg .gold { stroke: var(--bq-orange); fill: none; stroke-width: 1.5; }
.kh-svg .tagtxt { fill: var(--bq-orange); font: 600 9px var(--bq-font); }
.kh-svg .big { fill: var(--bq-text); font: 700 13px var(--bq-font); text-anchor: middle; }
.kh-svg .led { fill: var(--bq-muted); }
.kh-svg .led.on { fill: var(--bq-ok); }
.kh-svg .led.warn { fill: var(--bq-warning); }
.kh-svg .led.bad { fill: var(--bq-critical); animation: nbpulse 1s infinite; }
.kh-svg .fill { fill: var(--bq-orange); transition: fill .3s; }
.kh-svg .fill.bad { fill: var(--bq-critical); }
.kh-svg .fill.warn { fill: var(--bq-warning); }
.kh-svg .puff { fill: var(--bq-muted); opacity: 0; }
.kh-card.running .puff { animation: khpuff 2.4s ease-out infinite; }
.kh-card.running .puff:nth-child(2) { animation-delay: .8s; }
.kh-card.running .puff:nth-child(3) { animation-delay: 1.6s; }
@keyframes khpuff { 0% { opacity: .55; transform: translate(0, 0) scale(.5); } 100% { opacity: 0; transform: translate(10px, -34px) scale(1.7); } }
.kh-card.running .shake { animation: khshake .18s linear infinite; }
@keyframes khshake { 0% { transform: translateY(0); } 50% { transform: translateY(.8px); } 100% { transform: translateY(0); } }
.kh-svg .puff, .kh-svg .shake { transform-box: fill-box; transform-origin: center; }
.kh-svg .flow { stroke: var(--bq-orange); stroke-width: 3; fill: none; stroke-dasharray: 6 6; animation: khdash .7s linear infinite; }
.kh-svg .flow.off { stroke: var(--bq-critical); animation: none; stroke-dasharray: 3 7; opacity: .7; }
.kh-svg .flow.rev { animation-direction: reverse; stroke: var(--bq-warning); }
@keyframes khdash { to { stroke-dashoffset: -12; } }
.kh-svg .cell { fill: var(--bq-ok); transition: fill .4s; }
.kh-svg .cell.warn { fill: var(--bq-warning); }
.kh-svg .cell.bad { fill: var(--bq-critical); }

@media (max-width: 760px) { .kh-row { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kh { padding: 10px; } .kh-node { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { .kh-wire, .kh-svg .flow, .kh-card.running .puff, .kh-card.running .shake { animation: none; } }

/* hero scene shell (.kit-*) for the kit demos that draw their own site view (an SVG plan or a
   Leaflet map) above the shared dashboard: outdoor air quality, fleet and fuel. Brand tokens only. */
.kit-hero { position: relative; background: var(--bq-elevated); border: 1px solid var(--bq-border); border-radius: 14px; overflow: hidden; }
.kit-hero.kit-road::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6.6%; max-height: 29px; background: var(--bq-border); }
.kit-stage { z-index: 1; position: relative; container-type: inline-size; width: 100%; max-width: 1000px; margin: 0 auto; }
.kit-stage > svg { display: block; width: 100%; height: auto; }
.kit-tag { position: absolute; left: 12px; top: 10px; z-index: 500; font-size: clamp(9px, 1.6cqw, 12px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bq-orange); background: var(--bq-bg); border: 1px solid var(--bq-border); border-radius: 999px; padding: 3px 10px; }
.kit-sim { position: absolute; right: 12px; top: 10px; z-index: 500; font-size: clamp(9px, 1.5cqw, 11px); color: var(--bq-muted); background: var(--bq-bg); border: 1px solid var(--bq-border); border-radius: 999px; padding: 3px 10px; }
.kit-pin { position: absolute; transform: translate(-50%, -118%); text-align: center; background: rgba(13, 27, 42, .9); border: 1px solid var(--bq-border); border-left: 3px solid var(--bq-ok); border-radius: 8px; padding: .5cqw 1.1cqw; font-size: clamp(8px, 1.5cqw, 12px); line-height: 1.25; pointer-events: none; white-space: nowrap; }
.kit-pin .pn { display: block; color: var(--bq-muted); font-weight: 600; }
.kit-pin .pv { font-size: clamp(11px, 2.5cqw, 20px); font-weight: 700; color: var(--bq-text); font-variant-numeric: tabular-nums; }
.kit-pin .pu { font-size: clamp(8px, 1.4cqw, 11px); color: var(--bq-muted); margin-left: 3px; font-style: normal; }
.kit-pin .ps { display: block; color: var(--bq-faint); font-size: clamp(7px, 1.25cqw, 10px); }
.kit-pin.st-warning { border-left-color: var(--bq-warning); }
.kit-pin.st-critical { border-left-color: var(--bq-critical); background: rgba(229, 72, 77, .22); }
.kit-pin.st-critical::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--bq-critical); border-radius: 10px; animation: kitring 1.2s ease-out infinite; }
@keyframes kitring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }
@container (max-width: 520px) { .kit-pin .ps { display: none; } .kit-pin .pn { font-size: 7px; } }
@media (prefers-reduced-motion: reduce) { .kit-pin.st-critical::after { animation: none; } }
