/* F = ma Garage: a garage test lane (speed logger, pegboard, rail, test cart with engine pod, crates and brake pad).
   Scene by art.js, colors from the --fg-* properties below (light and dark). */
html {
  --fg-wall1: #e8edf1; --fg-wall2: #cfd8df; --fg-seam: rgba(43, 58, 68, .14); --fg-floor1: #a6aeb5; --fg-floor2: #7f8890; --fg-line: #1d2a33;
  --fg-peg: #c9a46e; --fg-peg-hole: rgba(60, 40, 15, .55); --fg-banner: #1f5f8b; --fg-stripe: #f2c230; --fg-vel: #5b6670;
  --fg-engine: #c2410c; --fg-friction: #2f6fb0; --fg-net: #6b3fa0; --fg-label: #1d2a33; --fg-halo: #f4f7f9;
  --fg-ink: #17242c; --fg-panel-bg1: #f6f9fb; --fg-panel-bg2: #e7eef3; --fg-accent: #1f5f8b; --fg-ok: #13704a; --fg-bad: #b3261e;
  --fg-chip: #ffffff; --fg-chip-on: #d9e9f5;
}
html[data-theme="dark"] {
  --fg-wall1: #26313a; --fg-wall2: #1b242b; --fg-seam: rgba(220, 230, 238, .08); --fg-floor1: #4a535b; --fg-floor2: #31383e; --fg-line: #05090c;
  --fg-peg: #7d6340; --fg-peg-hole: rgba(0, 0, 0, .6); --fg-banner: #15476b; --fg-stripe: #c9a22a; --fg-vel: #b9c3cb;
  --fg-engine: #ff8a4c; --fg-friction: #7cb6f0; --fg-net: #c9a2f2; --fg-label: #eef3f6; --fg-halo: #1b242b;
  --fg-ink: #e8eff3; --fg-panel-bg1: #1f2a32; --fg-panel-bg2: #182128; --fg-accent: #8cc4ec; --fg-ok: #4fd08c; --fg-bad: #ff8a80;
  --fg-chip: #172027; --fg-chip-on: #1d3a52;
}
.fg { position: absolute; inset: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.fg input, .fg button { font: inherit; }
.fg-controls { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--fg-panel-bg1), var(--fg-panel-bg2)); color: var(--fg-ink); border: 3px solid var(--fg-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.fg-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.fg-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-accent); }
.fg-step { display: grid; gap: 3px; }
.fg-step-b { display: grid; gap: 3px; }
.fg-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.fg-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--fg-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .fg-n { color: #0d1a24; }
.fg-step.is-done .fg-n { background: var(--fg-ok); }
.fg-mark { margin-left: auto; font-weight: 800; white-space: nowrap; }
.fg-mark.is-ok, .fg-fmark.is-ok { color: var(--fg-ok); }
.fg-mark.is-bad, .fg-fmark.is-bad { color: var(--fg-bad); }
.fg-fixed, .fg-mass, .fg-cmp { margin: 0; line-height: 1.3; }
.fg-fixed { padding: 3px 8px; border-radius: 8px; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(31,95,139,.08) 6px 12px); border: 1px dashed var(--fg-accent); }
.fg-slider { display: grid; gap: 1px; }
.fg-slider-h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.fg-slider-v { font-weight: 800; color: var(--fg-accent); white-space: nowrap; }
.fg-slider.is-unset .fg-slider-v { font-weight: 600; font-style: italic; color: var(--fg-ink); opacity: .8; }
.fg-slider-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 6px; }
.fg-slider input { width: 100%; min-height: 32px; margin: 0; accent-color: var(--fg-accent); cursor: pointer; }
.fg-slider.is-unset input { opacity: .55; }
.fg-step-btn { min-height: 40px; border-radius: 10px; border: 2px solid var(--fg-accent); background: var(--fg-chip); color: var(--fg-ink); font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer; }
.fg-step-btn:disabled { opacity: .45; cursor: default; }
.fg input:focus-visible, .fg button:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.fg-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fg-num { display: grid; gap: 1px; min-width: 0; }
.fg-num-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-weight: 700; line-height: 1.2; }
.fg-fmark { font-weight: 800; }
.fg-num-row { display: flex; align-items: center; gap: 6px; }
.fg-num input { flex: 1 1 auto; min-width: 0; width: 100%; font-size: 17px; min-height: 40px; padding: 3px 8px; border: 2px solid #8796a1; border-radius: 8px; background: #fff; color: #17242c; }
html[data-theme="dark"] .fg-num input { background: #10171c; color: #eef3f6; border-color: #6d7f8c; }
.fg-unit { flex: none; font-weight: 700; }
.fg-chips { display: grid; gap: 4px; }
.fg-chip { position: relative; display: flex; align-items: center; min-height: 38px; padding: 4px 26px 4px 10px; border: 2px solid #9fb0bc; border-radius: 10px;
  background: var(--fg-chip); color: var(--fg-ink); font-size: 16px; line-height: 1.15; text-align: left; cursor: pointer; }
html[data-theme="dark"] .fg-chip { border-color: #4d606d; }
.fg-chip:hover:not(:disabled) { border-color: var(--fg-accent); }
.fg-chip.is-on { border-color: var(--fg-accent); background: var(--fg-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--fg-accent); }
.fg-chip.is-on::before { content: '●'; margin-right: 6px; color: var(--fg-accent); }
.fg-chip-m { position: absolute; right: 8px; font-weight: 800; }
.fg-chip.is-key { border-color: var(--fg-ok); box-shadow: inset 0 0 0 2px var(--fg-ok); }
.fg-chip.is-key .fg-chip-m { color: var(--fg-ok); }
.fg-chip.is-wrong { border-color: var(--fg-bad); border-style: dashed; }
.fg-chip.is-wrong .fg-chip-m { color: var(--fg-bad); }
.fg-chip:disabled { cursor: default; opacity: 1; }
.fg-brief { flex: none; padding: 5px 12px; border: 2px solid var(--fg-accent); border-radius: 12px; background: var(--fg-panel-bg1); color: var(--fg-ink); }
.fg-brief p { margin: 0; line-height: 1.35; }
.fg-target { font-size: 20px; }
.fg-scene { flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--fg-line); }
.fg-svg { display: block; width: 100%; height: auto; }
.fg-svg text { font-family: var(--tlg-font); }
.fg-banner-t { font-size: 18px; font-weight: 800; fill: #fff; letter-spacing: .08em; }
.fg-note { font-size: 16px; font-weight: 700; fill: var(--fg-label); opacity: .85; }
.fg-sign { font-size: 16px; font-weight: 800; fill: #fff; }
.fg-crate-t { font-size: 11px; font-weight: 800; fill: #5a3a14; }
.fg-log-t, .fg-log-k { font-size: 16px; font-weight: 700; fill: #9fe8c6; }
.fg-log-k { fill: #cdeee0; }
.fg-log-axis { fill: none; stroke: #cdeee0; stroke-width: 2; }
.fg-log-gl { fill: none; stroke: rgba(159, 232, 198, .18); stroke-width: 1.5; }
.fg-log-trace { fill: none; stroke: #5ff0a8; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.fg-log-target { fill: none; stroke: #ffd23f; stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; }
.fg-log-cmp { fill: none; stroke: #ff9fd1; stroke-width: 3; stroke-dasharray: 10 6; }
.fg-log-dot { fill: #eafff4; stroke: #5ff0a8; stroke-width: 2; }
.fg-arrow-s { fill: none; stroke-width: 8; stroke-linecap: round; }
.fg-arrow-h { stroke-width: 1; }
.fg-arrow--engine .fg-arrow-s { stroke: var(--fg-engine); }
.fg-arrow--engine .fg-arrow-h { fill: var(--fg-engine); stroke: var(--fg-engine); }
.fg-arrow--friction .fg-arrow-s { stroke: var(--fg-friction); stroke-dasharray: 12 6; stroke-linecap: butt; }
.fg-arrow--friction .fg-arrow-h { fill: var(--fg-friction); stroke: var(--fg-friction); }
.fg-arrow--net .fg-arrow-s { stroke: var(--fg-net); stroke-width: 7; stroke-dasharray: 3 5; }
.fg-arrow--net .fg-arrow-h { fill: var(--fg-net); stroke: var(--fg-net); }
.fg-flabel { font-size: 16px; font-weight: 800; fill: var(--fg-label); paint-order: stroke; stroke: var(--fg-halo); stroke-width: 4px; stroke-linejoin: round; }
.fg-vlabel { font-weight: 700; }
.fg-sparks, .fg-puff { opacity: 0; }
.fg.is-driving .fg-puff { opacity: 1; animation: fg-puff .35s ease-out infinite; transform-box: fill-box; transform-origin: right center; }
.fg.is-driving .fg-beacon { animation: fg-blink .5s steps(2) infinite; }
.fg.is-driving .fg-cart { animation: fg-bob .18s ease-in-out infinite alternate; }
@keyframes fg-puff { from { transform: scale(.4); opacity: .9; } to { transform: translateX(-14px) scale(1.2); opacity: 0; } }
@keyframes fg-blink { 50% { fill: #ff5a3d; } }
@keyframes fg-bob { to { transform: translateY(-1px); } }
.fg-readout { flex: none; display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 12px; border-radius: 10px; background: var(--fg-panel-bg2); color: var(--fg-ink); }
.fg-readout p { margin: 0; line-height: 1.3; }
.fg-legend { margin-top: 2px !important; }
.fg-run { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 3px solid var(--fg-line); background: var(--fg-accent); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
html[data-theme="dark"] .fg-run { color: #0d1a24; }
.fg-run:disabled { opacity: .45; cursor: default; }
.fg-about { flex: none; padding: 2px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.fg-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.fg-about p { margin: 4px 0; }
.fg-ex { display: grid; gap: 8px; }
.fg-ex-svg { border-radius: 10px; border: 2px solid var(--fg-line); width: 100% !important; max-width: 520px; height: auto !important; max-height: none; }
.fg-ex-t { border-collapse: collapse; font-size: 16px; }
.fg-ex-t th, .fg-ex-t td { padding: 3px 8px; border-bottom: 1px solid var(--tlg-border); text-align: left; }
@media (max-width: 900px) {
  .fg { position: static; grid-template-columns: 1fr; }
  .fg-controls, .fg-right { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .fg *, .fg *::before { animation: none !important; transition: none !important; } }
