/* Crawler Tyre Rig — drawing-sheet layout: title block band, full-width drawing, spec-sheet control grid */
:root {
  --paper: #f5f7f6; --paper-2: #ffffff; --ink: #1c2329; --ink-2: #5d6a74; --ink-3: #8d99a2;
  --grid: #e3e8e9; --grid-major: #cfd7da; --rule: #c4cdd1; --red: #c4392f; --red-soft: #f6dedb;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #10161a; --paper-2: #161d22; --ink: #e2e7e9; --ink-2: #93a1ab; --ink-3: #66737c;
  --grid: #1a2228; --grid-major: #243039; --rule: #2e3a43; --red: #ff6b5e; --red-soft: #3a1d1b; color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #10161a; --paper-2: #161d22; --ink: #e2e7e9; --ink-2: #93a1ab; --ink-3: #66737c;
  --grid: #1a2228; --grid-major: #243039; --rule: #2e3a43; --red: #ff6b5e; --red-soft: #3a1d1b; color-scheme: dark }
* { box-sizing: border-box }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 16px 32px }
.sheet { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px }
.tb { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; border: 1.5px solid var(--ink); background: var(--paper-2) }
.tb > div { padding: 8px 12px; border-left: 1px solid var(--rule); min-width: 0 }
.tb > div:first-child { border-left: 0 }
.lbl { font-family: var(--font-label); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2) }
.tb h1 { margin: 0; font-family: var(--font-label); font-weight: 600; font-size: 20px; letter-spacing: .02em; text-wrap: balance }
.tb .v { font-family: var(--font-data); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums }
#perf { min-width: 15ch }
.stage { position: relative; border: 1.5px solid var(--ink); background: var(--paper); outline: none }
.stage:focus-visible { box-shadow: 0 0 0 3px var(--red-soft) }
canvas { display: block; width: 100% }
.drivebar { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; justify-content: space-between }
.keys { color: var(--ink-2); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap }
kbd { font-family: var(--font-data); font-size: 12px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; background: var(--paper-2); color: var(--ink) }
.panels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1.5px solid var(--ink); background: var(--paper-2) }
.panel { padding: 12px 14px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.panel h2 { margin: 0; font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline }
.panel h2 span { font-family: var(--font-data); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); font-size: 11px }
.field { display: flex; flex-direction: column; gap: 4px }
.field .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px }
.field label { font-size: 13px; color: var(--ink-2) }
.field output { font-family: var(--font-data); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right }
.hint { font-size: 12px; color: var(--ink-3) }
input[type=range] { width: 100%; accent-color: var(--red); height: 20px; margin: 0 }
select { font: inherit; font-size: 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 5px 6px; width: 100% }
.seg { display: flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden }
.seg button { flex: 1; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: var(--paper); padding: 5px 4px; font-size: 12px }
.seg button:first-child { border-left: 0 }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
button { font-family: var(--font-label); font-weight: 500; font-size: 13px; letter-spacing: .04em; color: var(--ink); background: var(--paper-2); border: 1px solid var(--ink-2); border-radius: 3px; padding: 6px 12px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none }
button:hover { border-color: var(--ink) }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px }
button.hold.on, button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink) }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2) }
.check input { accent-color: var(--red) }
.notes { font-size: 13px; color: var(--ink-2); max-width: 75ch; display: flex; flex-direction: column; gap: 4px }
.notes p { margin: 0 }
@media (max-width: 1000px) { .panels { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 560px) { .panels { grid-template-columns: minmax(0, 1fr) } }
.viewseg button { padding: 6px 16px; font-size: 13px }
.keys kbd + kbd { margin-left: 2px }
@media (max-width: 640px) {
  .tb { grid-template-columns: minmax(0, 1fr) auto }
  .tb > div:nth-child(2), .tb > div:nth-child(3), .tb > div:nth-child(5) { display: none }
  .tb h1 { font-size: 17px }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto } }

@media (max-width: 900px) { .tb > div:nth-child(2) { display: none } }
