/* Horizontal and vertical road curves — on top of calc.css (light only) */
main.rc .tabs { grid-template-columns: repeat(3, 1fr); }
main.rc .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.rc .stage-bar .hist { margin-left: auto; }
#view, #pro { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view:empty { aspect-ratio: 1000 / 520; }
#pro:empty { aspect-ratio: 1000 / 300; }
@media (max-width: 640px) { #view:empty { aspect-ratio: 375 / 470; } #pro:empty { aspect-ratio: 375 / 300; } }
.hit { fill: transparent; stroke: none; }
.handle { cursor: grab; }
.handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
.handle:hover .knob, .handle:focus .knob { fill: var(--sel); }

/* plan */
.rc-road { fill: var(--steel-200); stroke: none; }
.rc-edge { fill: none; stroke: var(--steel-700); stroke-width: 1.2; }
.rc-cl { fill: none; stroke: var(--warn); stroke-width: 1; stroke-dasharray: 10 6; }
.rc-tan { fill: none; stroke: var(--steel-550); stroke-width: .9; stroke-dasharray: 6 4; }
.rc-kp { fill: var(--surface); stroke: var(--text); stroke-width: 1.3; }
.rc-pi { fill: var(--text); stroke: none; }
.rc-lane { fill: none; stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 2 3; }
.rc-sight { fill: none; stroke-width: 1.6; stroke-dasharray: 5 3; }
.rc-sight.ok { stroke: var(--good); } .rc-sight.short { stroke: var(--bad); }
.rc-eye { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.2; }
.rc-obs { fill: var(--soil-dot); stroke: var(--x-6d5a3a, #6d5a3a); stroke-width: 1; }
.rc-hso { fill: none; stroke: var(--sel); stroke-width: 1.1; }
.rc-inset { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.rc-lane2 { fill: none; stroke: var(--steel-550); stroke-width: 1.2; stroke-dasharray: 6 3; }
.rc-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.rc-role { font-size: 11px; fill: var(--text-3); }
.rc-nm { cursor: text; }
.rc-nm:hover .rc-name, .rc-nm:focus .rc-name { fill: var(--sel); }
.rc-nm:focus { outline: none; }

/* profile */
.rc-earth { fill: var(--soil-2); stroke: none; }
.rc-vc { fill: none; stroke: var(--text); stroke-width: 2; }
.rc-req { fill: none; stroke-width: 1.4; stroke-dasharray: 6 4; }
.rc-req.ok { stroke: var(--good); } .rc-req.short { stroke: var(--bad); }
.rc-tp { fill: var(--blue); stroke: var(--surface); stroke-width: 1.2; }
.rc-tick { stroke: var(--steel-400); stroke-width: 1; }
.rc-t { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }

/* pills */
svg .pill rect { fill: var(--surface); stroke: var(--steel-300); }
svg .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
svg .pill.kp text, svg .pill.pi text { fill: var(--text); font-weight: 600; }
svg .pill.ok rect, svg .pill.rad.ok rect, svg .pill.hso.ok rect, svg .pill.vk.ok rect { stroke: color-mix(in srgb, var(--good) 50%, transparent); }
svg .pill.ok text { fill: var(--good-ink); font-weight: 600; }
svg .pill.short rect { stroke: color-mix(in srgb, var(--bad) 50%, transparent); } svg .pill.short text { fill: var(--bad-ink); font-weight: 600; }
svg .pill.rq text { fill: var(--text-3); }
svg .pill.tp text { fill: var(--blue-3); }
svg .pill.editable { cursor: text; }
svg .pill.editable:hover rect, svg .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
svg .pill.editable:focus { outline: none; }

/* editors in the drawings */
.stage { position: relative; }
.rc-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.rc-edit input { width: 90px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; background: transparent; color: var(--text); }
.rc-edit-name input { width: 200px; text-align: center; }
.rc-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* live strip and flags */
.rc-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 38px; align-items: center; }
.rc-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.rc-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
.rc-key i { display: inline-block; width: 18px; height: 0; margin-left: 6px; }
.rc-key i:first-child { margin-left: 0; }
.rc-key i.ok { border-top: 2px dashed var(--good); } .rc-key i.rq { border-top: 2px dashed var(--steel-550); }
.rc-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rc-flags span { display: inline-flex; align-items: center; line-height: 1; font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.rc-flags span.rc-err { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.rc-seg { margin-bottom: 6px; }
.rc-lab { font-size: 12px; color: var(--text-3); margin: 6px 0 4px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.rc-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.rc-chip:hover { border-color: var(--line-2); }
.rc-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.rc-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 4px 0; cursor: pointer; }
.rc-check input { margin: 0; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }

/* summary, charts, table */
.rc-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 42ch; }
.rc-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; line-height: 1.5; }
.rc-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#rChart, #lChart { touch-action: none; user-select: none; }
#rChart .cdrag, #lChart .cdrag { cursor: ns-resize; }
svg.fb-chart .ch-g { fill: var(--fill-1); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@media (max-width: 1100px) { .rc-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  #checks thead { display: none; }
  #checks, #checks tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "required "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
}
@media print { .rc-edit { display: none !important; } }

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-2d4a8c: #84a1dd; --x-6d5a3a: #a69579; --x-6e7177: #85827f; --x-7a4518: #c3926f; --x-7a4fa0: #b895dc;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-2d4a8c: #84a1dd; --x-6d5a3a: #a69579; --x-6e7177: #85827f; --x-7a4518: #c3926f; --x-7a4fa0: #b895dc;
  }
}
/* theme-auto:end */
