/* Drawbridge-stop-rules explainer: a side view of a bus on the road approaching a drawbridge over water. Distance marks
   show 15, 35, 50 and 60 ft before the draw. Hero, film, course offer and return banner reuse spring-brakes.css
   (.sbp-*); this file styles only .db-*. The script sets the stage's data-ctrl (none, green, attendant), data-stop
   (30, 55), data-pos (approach, s30, s55, cross), data-speed (slow, fast), data-check (unchecked, closed), data-result
   (none, good, ok, bad) and data-compare (on, off). Without script the picture shows no signal or attendant, the 55 ft
   spot and the bus approaching. Every SVG text label is at least 11.5px in the 360-wide viewBox. */
.db-page{--db-go:#31d67b;--db-warn:#fbbf24;--db-red:#ef4444;--db-water:#38bdf8;--db-console:#151b20}
.db-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.db-demo{padding-block:64px 72px;background:var(--paper)}
.db-demo-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-areas:"head head" "stage panel";gap:24px 40px;align-items:start}
.db-head{grid-area:head}
.db-stage{grid-area:stage;margin:0;padding:10px;border-radius:16px;background:linear-gradient(170deg,#222a30,#0d1114 80%);box-shadow:0 30px 60px -34px rgb(0 0 0/.75),inset 0 1px 0 rgb(255 255 255/.06)}
.db-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0f1316}
.db-panel{grid-area:panel;display:grid;gap:14px;min-width:0}

/* the HUD: control, stop spot and result; script on */
.db-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.db-stage.is-js .db-hud{display:flex}
.db-chip{display:inline-flex;align-items:center;gap:7px;margin:0;padding:6px 10px 6px 8px;border-radius:8px;background:#080b0d;box-shadow:inset 0 0 0 1px rgb(255 255 255/.09);font-size:13px;line-height:1;white-space:nowrap}
.db-chip i{flex:none;width:9px;height:9px;border-radius:50%;background:#3a4246;box-shadow:inset 0 0 0 1.5px #586166;transition:background .2s,box-shadow .2s}
.db-chip span{color:#a9b3b8;font-weight:600}
.db-chip b{color:#e8eef0;font-weight:800}
.db-chip-ctrl i{background:var(--db-warn)}
.db-stage[data-ctrl="green"] .db-chip-ctrl i,.db-stage[data-ctrl="attendant"] .db-chip-ctrl i{background:var(--db-go)}
.db-chip-stop i{background:var(--db-water)}
.db-stage[data-result="good"] .db-chip-result i{background:var(--db-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.db-stage[data-result="good"] .db-chip-result b{color:var(--db-go)}
.db-stage[data-result="ok"] .db-chip-result i{background:var(--db-warn);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.db-stage[data-result="ok"] .db-chip-result b{color:#fde68a}
.db-stage[data-result="bad"] .db-chip-result i{background:var(--db-red);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.85)}
.db-stage[data-result="bad"] .db-chip-result b{color:#fca5a5}

/* scene, road, bridge and water */
.db-ripple{fill:none;stroke:#7dd3fc;stroke-opacity:.55;stroke-width:1.4;stroke-linecap:round}
.db-bank{stroke:#0b0d0f;stroke-width:1}
.db-road{fill:#3a3f44;stroke:#0b0d0f;stroke-width:1}
.db-lane{fill:none;stroke:#e8eef0;stroke-opacity:.6;stroke-width:1.2;stroke-dasharray:8 8}
.db-pier{fill:#4b5358;stroke:#1c2024;stroke-width:1}
.db-deck{fill:#59636a;stroke:#0b0d0f;stroke-width:1}
.db-truss{fill:none;stroke:#8f9a9d;stroke-width:1.8;stroke-linejoin:round}
.db-joint{fill:none;stroke:var(--db-warn);stroke-width:2;stroke-dasharray:3 3}

/* parts and labels: every label 11.5px or larger */
.db-part{fill:#d3dade;font-size:11.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}
.db-part-mid{text-anchor:middle}
.db-part-end{text-anchor:end}
.db-tick{fill:none;stroke:#d3dade;stroke-width:1.4}
.db-tick-min{stroke:var(--db-warn);stroke-width:2.2}
.db-tick-txt{fill:#e8eef0;font-size:11.5px;font-weight:800;text-anchor:middle;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}
.db-tick-txt-min{fill:#fde68a;font-size:12.5px}
.db-tick-cap{fill:#b6c0c5;font-size:11.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}

/* the stopping spot: only the chosen one shows */
.db-mark{display:none}
.db-stage[data-stop="55"] .db-mark-55,.db-stage[data-stop="30"] .db-mark-30{display:inline}
.db-mark-line{fill:none;stroke:var(--db-water);stroke-width:1.6;stroke-dasharray:4 3}
.db-mark-txt{fill:#bae6fd;font-size:11.5px;font-weight:800;text-anchor:middle;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}

/* the bridge control: the signal shows for a green light, the attendant for an attendant */
.db-signal,.db-attendant{display:none}
.db-stage[data-ctrl="green"] .db-signal,.db-stage[data-ctrl="attendant"] .db-attendant{display:inline}
.db-post{fill:none;stroke:#8f9a9d;stroke-width:3}
.db-head-box{fill:#080b0d;stroke:#59636a;stroke-width:1}
.db-lamp-red{fill:#3b1616}
.db-lamp-green{fill:var(--db-go)}
.db-person-head{fill:#e8c9a6}
.db-person-vest{fill:#f97316}
.db-person-limbs{fill:none;stroke:#d3dade;stroke-width:2.2;stroke-linecap:round}

/* the bus: drawn with its front at the 55 ft spot, moved by data-pos */
.db-bus{transform-box:view-box;transition:transform .9s cubic-bezier(.3,.8,.4,1)}
.db-stage[data-pos="approach"] .db-bus{transform:translateX(-12px)}
.db-stage[data-pos="s30"] .db-bus{transform:translateX(80px)}
.db-stage[data-pos="cross"] .db-bus{transform:translateX(254px)}
.db-stage[data-pos="cross"][data-speed="slow"] .db-bus{transition-duration:2.4s}
.db-stage[data-pos="cross"][data-speed="fast"] .db-bus{transition-duration:.6s;transition-timing-function:linear}
.db-body{stroke:#713f12;stroke-width:1}
.db-windows{fill:#1e293b;stroke:#0f172a;stroke-width:.8}
.db-stripe{fill:none;stroke:#1c1917;stroke-width:1.6}
.db-wheel{fill:#111417;stroke:#59636a;stroke-width:1.6}
.db-light{fill:#fff7cc}

/* cards: the draw check and the rule for this bridge */
.db-card-box{fill:#080b0d;fill-opacity:.88;stroke:#59636a;stroke-width:1;transition:stroke .2s}
.db-card-cap{fill:#b6c0c5;font-size:11.5px;font-weight:800;letter-spacing:.08em;text-anchor:middle;text-transform:uppercase}
.db-card-big{font-size:14px;font-weight:900;letter-spacing:.04em;text-anchor:middle}
.db-state,.db-rule{display:none}
.db-stage[data-check="unchecked"] .db-state-unchecked,.db-stage[data-check="closed"] .db-state-closed{display:inline}
.db-state-unchecked .db-card-big{fill:#fde68a}
.db-state-closed .db-card-big{fill:var(--db-go)}
.db-stage[data-check="closed"] .db-card:not(.db-card-ctrl) .db-card-box{stroke:var(--db-go)}
.db-stage[data-ctrl="none"] .db-rule-none,.db-stage[data-ctrl="green"] .db-rule-slow,.db-stage[data-ctrl="attendant"] .db-rule-slow{display:inline}
.db-rule .db-card-big{fill:#e8eef0}

/* the railroad against drawbridge reference: a strip over the bank and water, clear of the signal head and its label */
.db-compare{display:none}
.db-stage[data-compare="on"] .db-compare{display:inline}
.db-compare-box{fill:#080b0d;stroke:var(--db-warn);stroke-width:1.2}
.db-cmp-head{fill:#e8eef0;font-size:12.5px;font-weight:900;text-anchor:middle}
.db-cmp-val{fill:#fde68a;font-size:12px;font-weight:800;text-anchor:middle}
.db-cmp-num{fill:#b6c0c5;font-size:11.5px;font-weight:800;text-anchor:middle}
.db-cmp-axis{fill:none;stroke:#59636a;stroke-width:2;stroke-linecap:round}
.db-cmp-band{fill:none;stroke-width:6;stroke-linecap:round}
.db-cmp-rail{stroke:var(--db-water)}
.db-cmp-draw{stroke:var(--db-warn);stroke-linejoin:round}
.db-cmp-split{fill:none;stroke:#3a4246;stroke-width:1}

/* motion, script on: water ripples */
.db-stage.is-js .db-ripple{stroke-dasharray:8 6;animation:db-flow 1.6s linear infinite}
@keyframes db-flow{to{stroke-dashoffset:-14}}

/* controls: one dark console, every button the same dark face and white text, amber when active or focused */
.db-ask{margin:0;color:var(--ink);font-size:20px;line-height:1.25}
.db-ask[hidden],.db-controls[hidden]{display:none}
.db-ask b{font-weight:800}
.db-controls{display:grid;gap:10px;padding:14px;border-radius:16px;background:linear-gradient(180deg,#232b31,var(--db-console));box-shadow:0 18px 40px -28px rgb(0 0 0/.8),inset 0 1px 0 rgb(255 255 255/.07);color:#e8eef0}
.db-btn{position:relative;display:flex;align-items:center;gap:12px;min-width:0;min-height:48px;padding:10px 12px;border:0;border-radius:12px;background:linear-gradient(180deg,#303a41,#1b2227);box-shadow:inset 0 1px 0 rgb(255 255 255/.1),0 3px 0 #06090b,0 8px 16px -10px rgb(0 0 0/.7);color:#fff;font:inherit;font-size:16px;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;transition:transform .08s,box-shadow .12s,background .12s}
.db-btn:hover{background:linear-gradient(180deg,#38434b,#20282d)}
.db-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgb(255 255 255/.06),0 1px 0 #06090b}
.db-btn[aria-pressed="true"]{transform:translateY(2px);box-shadow:inset 0 0 0 2px var(--sbp-amber,#ffb400),0 1px 0 #06090b}
.db-btn:focus-visible{outline:3px solid var(--sbp-amber,#ffb400);outline-offset:3px}
.db-btn-wide{min-height:60px}
.db-name{display:grid;gap:3px;min-width:0}
.db-name small{color:#a9b3b8;font-size:13px;font-weight:600}
.db-group{display:grid;gap:6px}
.db-label{margin:0;color:#a9b3b8;font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.db-seg{display:grid;gap:6px}
.db-seg-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.db-seg-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.db-btn-seg{justify-content:center;padding:8px 6px;text-align:center;font-size:15px}
.db-icon{flex:none;width:30px;height:30px}
.db-icon-oct{fill:#b91c1c;stroke:#fecaca;stroke-width:1.2}
.db-icon-tri{fill:none;stroke:#fde68a;stroke-width:2;stroke-linejoin:round}
.db-icon-bar{fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round}
.db-icon-x{fill:none;stroke:#fca5a5;stroke-width:2.6;stroke-linecap:round}
.db-icon-cmp{fill:none;stroke:#bae6fd;stroke-width:2;stroke-linejoin:round}
.db-reset{justify-self:start;gap:8px;min-height:44px;padding:8px 16px 8px 12px;font-size:15px}
.db-reset-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.db-status{display:block;min-height:7.3em;padding:12px 14px 12px 16px;border-left:5px solid var(--db-warn);border-radius:0 10px 10px 0;background:var(--white,#fffffc);color:var(--ink);font-size:16px;font-weight:600;line-height:1.45;transition:border-color .2s}
.db-stage[data-result="good"]~.db-panel .db-status{border-left-color:var(--db-go)}
.db-stage[data-result="bad"]~.db-panel .db-status{border-left-color:var(--db-red)}
.db-text{margin:0;max-width:40em;color:var(--ink);font-size:17px;line-height:1.6}

@media (min-width:761px){
  .db-page .sbp-film-frame.is-wide{aspect-ratio:auto;padding-bottom:58px;background:#0b0d0f}
  .db-page .sbp-film-frame.is-wide video{aspect-ratio:16/9;width:100%;height:auto}
  .db-page .sbp-film-frame.is-wide .sbp-play{bottom:58px}
  .db-page .sbp-film-frame.is-wide .sbp-sound-on{left:12px;right:auto;top:auto;bottom:10px}
  .db-page .sbp-film-frame.is-wide .sbp-pause{right:12px;top:auto;bottom:10px}
}
@media (max-width:900px){
  .db-demo-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "stage" "panel";gap:16px}
}
@media (max-width:760px){
  .db-demo{padding-block:36px 44px}
  .db-stage{margin-inline:-8px;padding:8px 6px 6px;border-radius:14px}
  .db-svg{border-radius:8px}
  .db-hud{gap:4px;padding:0 0 6px}
  .db-chip{padding:4px 6px 4px 5px;font-size:11px;gap:4px}
  .db-chip i{width:8px;height:8px}
  .db-panel{gap:10px}
  .db-ask{font-size:18px}
  .db-controls{gap:8px;margin-inline:-8px;padding:12px 10px}
  .db-btn{padding:8px 9px;gap:8px;font-size:15px}
  .db-btn-wide{min-height:56px}
  .db-btn-seg{padding:8px 4px;font-size:13px}
  .db-icon{width:26px;height:26px}
  .db-name small{font-size:12px}
  .db-status{min-height:8.8em;padding:10px 12px;font-size:15px}
  .db-text{font-size:16px}
}
@media (max-width:380px){
  .db-chip{padding:4px 5px;font-size:11px;gap:4px}
  .db-chip-stop span,.db-chip-result span{display:none}
}
@media (prefers-reduced-motion:reduce){
  .db-page .db-demo *{transition:none!important;animation:none!important}
}
