.counting-mode-panel { margin: 0 0 1.25rem; }
.counting-mode-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.counting-mode-option { display: flex; align-items: center; gap: .85rem; padding: 1rem; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:12px; text-align:left; cursor:pointer; }
.counting-mode-option[aria-pressed="true"] { background:var(--primary-soft); border-color:var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.counting-mode-option svg { width:42px; height:42px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.counting-mode-option strong,.counting-mode-option small { display:block; }
.counting-mode-option small { margin-top:.25rem; color:var(--text-soft); }
.counting-mode-select { display:none; }
.intersection-tools { margin: .75rem 0; }
.intersection-tools[hidden],#intersection-movements[hidden] { display:none; }
.intersection-tool-row { display:flex; gap:.6rem; align-items:flex-end; flex-wrap:wrap; margin-bottom:.65rem; }
.intersection-tool-row label { flex:1 1 190px; min-width:0; }
.gate-coordinate-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
.intersection-matrix { min-width:100%; }
.intersection-matrix th { min-width:100px; max-width:180px; overflow-wrap:anywhere; }
.intersection-matrix select { min-width:125px; }
.calibration-layout > .panel, #calibration-form, #intersection-movements { min-width:0; }
#intersection-matrix { width:100%; max-width:100%; overflow-x:auto; }
#intersection-movements > p { overflow-wrap:anywhere; }
.intersection-calibration .road-only-settings,
.intersection-calibration [data-select-line],
.intersection-calibration [data-select-end],
.intersection-calibration .calibration-nudge,
.intersection-calibration #line-editor-panel > .legend,
.intersection-calibration #calibration-details-title + .callout,
.intersection-calibration #calibration-instructions { display:none; }
.intersection-calibration #line-editor-step { display:none; }
.movement-results td { overflow-wrap:anywhere; }
@media(max-width:600px){.counting-mode-options { grid-template-columns:1fr; }.counting-mode-option{padding:.8rem;}.intersection-tool-row .btn{flex:1 1 120px;}}
