body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f7f7f7;
}

body.taper-lengths-page {
    min-height: 100vh;
    box-sizing: border-box;
    background: #242424 url('../img/pexels-hngstrm-1203768.jpg') center / cover no-repeat fixed;
}

.taper-lengths-page footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
}

.container {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 10px;
}

.calculator, .references {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.isd-form {
    display: grid;
    gap: 18px;
}

.calculator input {
    width: calc(100% - 22px); /* Adjust for border and padding */
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #ddd;
    -moz-appearance: textfield;
}

.container input,
.container select,
.container textarea {
    width: calc(100% - 22px);
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
}

.case-picker-card {
    padding: 18px 20px 20px;
    border-radius: 16px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(145deg, #0b2a4a 0%, #163a64 58%, #245a8d 100%);
    color: #eff6ff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.case-picker-kicker,
.case-input-kicker {
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-picker-kicker {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: #dbeafe;
}

.case-picker-title,
.case-input-title {
    margin: 12px 0 6px;
    text-align: left;
    font-size: 24px;
}

.case-picker-copy,
.case-input-copy {
    margin: 0 0 16px;
    line-height: 1.5;
}

.case-picker-copy {
    color: #dbeafe;
}

.case-picker-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #f8fafc;
}

.case-picker-card select {
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 12px;
    background: rgba(248,250,252,0.98);
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(15,23,42,0.14);
}

.case-input-card {
    padding: 18px 20px 20px;
    border-radius: 16px;
    border: 1px solid #d7dee8;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.case-input-kicker {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
}

.case-input-copy {
    color: #475569;
}

.case-input-placeholder {
    display: block;
    margin-top: 4px;
    padding: 18px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-align: center;
}

.case-b-maneuver-group {
    margin: 6px 0 14px;
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: #f8fafc;
}

.case-b-maneuver-label {
    margin-bottom: 4px;
}

.case-b-maneuver-copy {
    margin: 0 0 12px;
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.case-b-maneuver-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.case-b-maneuver-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.case-b-maneuver-option input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.case-b-maneuver-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    flex: 0 0 auto;
}

.case-b-maneuver-arrow {
    width: 28px;
    height: 28px;
}

.case-b-maneuver-arrow path,
.case-b-maneuver-arrow circle {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

.case-b-maneuver-option-left .case-b-maneuver-visual {
    border-color: #93c5fd;
    background: #eff6ff;
}

.case-b-maneuver-option-left .case-b-maneuver-arrow path,
.case-b-maneuver-option-left .case-b-maneuver-arrow circle {
    stroke: #2563eb;
}

.case-b-maneuver-option-right .case-b-maneuver-visual {
    border-color: #86efac;
    background: #f0fdf4;
}

.case-b-maneuver-option-right .case-b-maneuver-arrow path,
.case-b-maneuver-option-right .case-b-maneuver-arrow circle {
    stroke: #16a34a;
}

.case-b-maneuver-option-crossing .case-b-maneuver-visual {
    border-color: #fcd34d;
    background: #fffbeb;
}

.case-b-maneuver-option-crossing .case-b-maneuver-arrow path,
.case-b-maneuver-option-crossing .case-b-maneuver-arrow circle {
    stroke: #d97706;
}

.case-b-maneuver-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.case-b-maneuver-title {
    display: block;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.case-b-maneuver-subtitle {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.35;
}

.case-b-maneuver-option:has(input[type="checkbox"]:checked) {
    border-color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.12);
}

.case-b-geometry-group {
    margin: 6px 0 14px;
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: #f8fafc;
}

.case-b-geometry-label {
    margin-bottom: 4px;
}

.case-b-geometry-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    background: #ffffff;
}

.case-b-width-help {
    margin: -2px 0 12px;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.case-b-inline-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 10px;
    font-weight: 600;
    color: #0f172a;
}

.case-b-inline-option input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
}

#dynamicInputs:not(.case-input-placeholder) {
    margin-top: 4px;
}

#dynamicInputs label {
    display: block;
    font-weight: 700;
    color: #0b2a4a;
}

#dynamicInputs note,
#dynamicInputs normal {
    display: block;
}

.calculator input[type=number]::-webkit-outer-spin-button,
.calculator input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.speed-buttons, .work-speed-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.calculator-lede {
    text-align: center;
    color: #475569;
    margin-bottom: 5px;
}

.isd-lede,
.isd-lede-detail {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
}

.isd-lede {
    margin-top: 8px;
}

.isd-equation {
    width: fit-content;
    max-width: 760px;
    margin: 10px auto 12px;
    padding: 10px 14px;
    border: 1px solid #c7ddf7;
    border-radius: 999px;
    background: #e7f3fe;
    color: #0b2a4a;
    line-height: 1.45;
}

.isd-lede-detail {
    margin-bottom: 18px;
}

.tool-category-label {
    width: fit-content;
    margin: 0 auto 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e7f3fe;
    border: 1px solid #c7ddf7;
    color: #0b2a4a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mode-toggle {
    display: inline-flex;
    justify-content: center;
    gap: 10px;
    border: 1px solid #d4d7dd;
    border-radius: 999px;
    padding: 6px;
    background: #f1f5f9;
    margin: 16px auto 18px;
}

.mode-button {
    border: none;
    background: transparent;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

.mode-button.active {
    background: #0b2a4a;
    color: #fff;
}

.calculator-panel + .calculator-panel {
    margin-top: 24px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 8px 0 6px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #0b2a4a;
    margin-bottom: 4px;
}

.sight-distance-form .sight-type-group {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: #f8fbff;
}

.sight-distance-form .sight-type-group legend {
    padding: 0 8px;
    font-weight: 700;
    color: #0b2a4a;
}

.sight-distance-form .sight-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sight-distance-form .sight-type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 16px;
    margin-bottom: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.sight-distance-form .sight-type-option input[type="radio"] {
    width: auto;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.sight-distance-form .sight-type-option span {
    display: block;
    line-height: 1.35;
}

.sight-distance-form .sight-type-option-wide {
    grid-column: 1 / -1;
}

.sight-distance-form .sight-type-option:has(input[type="radio"]:checked) {
    border-color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.12);
}

.curve-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 16px;
}

.curve-mode-button {
    flex: 1 1 240px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #0b2a4a;
    font-weight: 700;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.curve-mode-button.active {
    background: #0b2a4a;
    border-color: #0b2a4a;
    color: #fff;
}

.curve-panel.hidden {
    display: none;
}

.curve-helper-note {
    margin-top: 8px;
    margin-bottom: 16px;
}

.curve-helper-note p {
    margin: 0;
}

.inverse-steps {
    margin-top: 20px;
}

.inverse-steps h3 {
    margin: 0 0 12px;
    text-align: left;
    color: #0b2a4a;
}

.inverse-step-viewer {
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.inverse-step-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.inverse-step-nav {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0b2a4a;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.inverse-step-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.inverse-step-counter {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.inverse-step-stage {
    margin: 0;
}

.inverse-step-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #d7dee8;
    background: #fff;
    margin-bottom: 12px;
}

.inverse-step-caption {
    font-size: 15px;
    line-height: 1.55;
    color: #334155;
}

.equation-card {
    min-width: 260px;
    flex: 1 1 280px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #d7dee8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.equation-card h3 {
    margin: 0 0 8px;
    text-align: left;
}

.equation-condition {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
}

.equation-math {
    margin: 0;
    font-family: "Times New Roman", Times, serif;
    font-size: 1.2rem;
    line-height: 1.5;
    color: #0f172a;
}

.equation-math math {
    display: block;
    width: 100%;
}

.equation-math math[display="block"] {
    margin: 0;
}

.speed-button {
    width: calc(50% - 10px);
    padding: 10px;
    margin: 5px 0;
    background: #007bff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

.speed-button:hover, .speed-button.selected {
    background: #0056b3;
}

.work-speed {
    background: #ffecd1;
    color: #000;
}

.work-speed:hover, .work-speed.selected {
    background: #e6c48f; /* Darker shade of peach for hover and selected state */
    color: #000; /* Keep text color black for visibility */
}

.calculate-button {
    width: 100%;
    padding: 10px;
    background: #28a745;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.calculate-button:hover {
    background: #218838;
}

.result, .formula, .formula-details, .note {
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}

.case-results,
.case-b-results {
    display: grid;
    gap: 14px;
    font-size: 16px;
    font-weight: 400;
    color: #0f172a;
}

.result-summary-title {
    font-size: 20px;
    font-weight: 800;
    color: #0b2a4a;
}

.result-section {
    border: 1px solid #d7dee8;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fafc;
}

.result-section-primary {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
}

.result-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #0b2a4a;
}

.result-metric-grid {
    display: grid;
    gap: 10px;
}

.result-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.result-metric:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.result-metric-label {
    font-weight: 600;
    color: #334155;
}

.result-metric-value {
    font-weight: 800;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.result-metric-value-stacked {
    white-space: normal;
}

.result-metric-value-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.result-metric-value-line {
    display: block;
}

.result-metric-value-design {
    color: #1d4ed8;
    font-size: 0.94em;
}

.result-metric-value-primary {
    color: #1d4ed8;
}

.result-section-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.formula, .formula-details {
    background-color: #e7f3fe;
    border-left: 6px solid #2196f3;
    border-radius: 4px;
    padding: 10px;
}

.note {
    font-size: 14px;
    text-align: center;
}

.content {
    padding: 16px 0;
}

#output {
    margin-top: 16px;
    padding: 16px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.highlight {
    background-color: #fffd8a;
    font-weight: 700;
    font-size: 1.2rem;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
}

#chart-container {
    width: 50%;
    min-width: 260px;
}

h1, h2 {
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

.table-container {
    margin-bottom: 20px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th, .table-container td {
    border: 1px solid #ddd;
    padding: 8px;
}

.table-container th {
    background-color: #f2f2f2;
}

.drawing-container {
    text-align: center;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

#sight-triangle,
#roundabout-image {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
}

.work-zone-speed {
    background: #ffecd1; /* Light peach background for normal state */
    color: #000; /* Black text for contrast */
}

.hidden {
    display: none;
}

.label-with-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    outline: none;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #475569;
    border-radius: 999px;
    background: #fff;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.tooltip-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    width: min(440px, 85vw);
    padding: 12px 14px;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}

.tooltip-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.info-tooltip:hover .tooltip-bubble,
.info-tooltip:focus-within .tooltip-bubble,
.info-tooltip:focus .tooltip-bubble {
    opacity: 1;
    visibility: visible;
}

.site-header {
    width: min(100%, 1100px);
    box-sizing: border-box;
    margin: 0 auto 26px;
    padding: 32px 32px 28px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.85));
    border-radius: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f8fafc;
}

.site-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.8);
    margin: 0;
}

.site-identity h1 {
    margin: 0;
    font-size: 30px;
    color: #fff;
}

.site-tagline {
    margin: 0;
    color: rgba(226, 232, 240, 0.9);
    font-size: 15px;
}

.site-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.site-nav a {
    text-decoration: none;
    color: #f8fafc;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
    background: rgba(248, 250, 252, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.slider {
    width: 100%;
}

footer {
    max-width: 920px;
    margin: 40px auto 0;
    padding: 20px 10px;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    background: transparent;
}

.external-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.external-links h2 {
    margin: 0 0 4px;
}

/* Driveway layout checker */
.driveway-tool {
    max-width: 1060px;
}

.driveway-tool,
.driveway-tool * {
    box-sizing: border-box;
}

.driveway-lede {
    max-width: 780px;
    margin: 8px auto 0;
    color: #475569;
    font-size: 17px;
    line-height: 1.55;
    text-align: center;
}

.driveway-source-note {
    max-width: 850px;
    margin: 20px auto 24px;
    padding: 12px 16px;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a5f;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
}

.driveway-source-note p,
.driveway-disclaimer p {
    margin: 0;
}

.driveway-form {
    display: grid;
    gap: 18px;
}

.driveway-form fieldset {
    margin: 0;
    padding: 20px;
    border: 1px solid #d7dee8;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.driveway-form legend {
    padding: 0 8px;
    color: #0b2a4a;
    font-size: 18px;
    font-weight: 800;
}

.driveway-form .input-grid {
    margin: 0;
}

.driveway-form input,
.driveway-form select {
    width: 100%;
    margin: 6px 0 0;
}

.driveway-section-heading,
.driveway-result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.driveway-section-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.driveway-row-heading {
    margin-top: 20px;
}

.driveway-row-heading h2,
.driveway-result-heading h2,
.driveway-metrics-card h2,
#residential-sight-fields h2 {
    margin: 0 0 4px;
    color: #0b2a4a;
    font-size: 17px;
    text-align: left;
}

#residential-sight-fields h2 {
    margin-bottom: 10px;
}

.driveway-secondary-button {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    cursor: pointer;
}

.driveway-secondary-button:hover {
    background: #dbeafe;
}

.driveway-rows {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.driveway-row {
    display: grid;
    grid-template-columns: 42px minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
}

.driveway-row-number {
    align-self: center;
    display: grid;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    place-items: center;
    background: #0b2a4a;
    color: #fff;
    font-weight: 800;
}

.driveway-check-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px;
    padding: 13px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0b2a4a;
    font-weight: 700;
    cursor: pointer;
}

.driveway-check-option input {
    width: auto;
    margin: 0;
}

.driveway-helper {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

.is-hidden {
    display: none !important;
}

.driveway-results-card {
    overflow: visible;
}

.driveway-status {
    margin: -20px -20px 20px;
    padding: 22px 24px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid transparent;
}

.driveway-status-pass {
    border-color: #86efac;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    color: #14532d;
}

.driveway-status-review {
    border-color: #fcd34d;
    background: linear-gradient(135deg, #fffbeb, #fff7ed);
    color: #78350f;
}

.driveway-status-fail {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #fff1f2, #fef2f2);
    color: #7f1d1d;
}

.driveway-status-kicker,
.driveway-result-kicker {
    margin: 0 0 5px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.driveway-status h2 {
    margin: 0 0 5px;
    color: inherit;
    font-size: 25px;
    text-align: left;
}

.driveway-status p:last-child {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.driveway-result-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
    gap: 16px;
}

.driveway-plan-card,
.driveway-metrics-card,
.driveway-checks-card {
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 14px;
    background: #fff;
}

.driveway-plan-scale {
    margin: 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.driveway-plan {
    width: 100%;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #f8fafc;
}

.driveway-plan svg {
    display: block;
    width: 100%;
    height: auto;
}

.driveway-plan-parcel {
    fill: #ecfccb;
    stroke: #84a759;
    stroke-width: 1.5;
}

.driveway-plan-property-line {
    stroke: #334155;
    stroke-width: 2;
}

.driveway-plan-property-label,
.driveway-plan-station {
    fill: #475569;
    font-size: 11px;
    font-weight: 700;
}

.driveway-plan-opening {
    fill: #cbd5e1;
    stroke: #475569;
    stroke-width: 1.5;
}

.driveway-plan-opening-fail {
    fill: #fecaca;
    stroke: #dc2626;
}

.driveway-plan-centerline {
    stroke: #2563eb;
    stroke-width: 1.25;
    stroke-dasharray: 4 4;
}

.driveway-plan-label {
    fill: #0b2a4a;
    font-size: 13px;
    font-weight: 800;
}

.driveway-plan-road {
    fill: #475569;
}

.driveway-plan-road-center {
    stroke: #f8fafc;
    stroke-width: 2;
    stroke-dasharray: 18 12;
}

.driveway-plan-road-label {
    fill: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.driveway-plan-dimension {
    stroke: #15803d;
    stroke-width: 2;
}

.driveway-plan-dimension-end {
    fill: #15803d;
}

.driveway-plan-dimension-fail {
    stroke: #dc2626;
}

.driveway-plan-dimension-end-fail {
    fill: #dc2626;
}

.driveway-plan-gap {
    fill: #166534;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 4px;
    font-size: 11px;
    font-weight: 800;
}

.driveway-plan-gap-fail {
    fill: #b91c1c;
}

.driveway-metrics {
    margin: 10px 0 0;
}

.driveway-metrics > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.driveway-metrics > div:last-child {
    border-bottom: 0;
}

.driveway-metrics dt {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.driveway-metrics dd {
    margin: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

.driveway-checks-card {
    margin-top: 16px;
}

.driveway-check-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.driveway-check-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.driveway-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.driveway-dot-pass { background: #16a34a; }
.driveway-dot-review { background: #d97706; }
.driveway-dot-fail { background: #dc2626; }

.driveway-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.driveway-check {
    display: flex;
    gap: 11px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-left-width: 4px;
    border-radius: 10px;
    background: #f8fafc;
}

.driveway-check-pass { border-left-color: #16a34a; }
.driveway-check-review { border-left-color: #d97706; background: #fffbeb; }
.driveway-check-fail { border-left-color: #dc2626; background: #fff1f2; }

.driveway-check-icon {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    place-items: center;
    background: #e2e8f0;
    color: #334155;
    font-size: 15px;
    font-weight: 900;
}

.driveway-check-pass .driveway-check-icon { background: #dcfce7; color: #166534; }
.driveway-check-review .driveway-check-icon { background: #fef3c7; color: #92400e; }
.driveway-check-fail .driveway-check-icon { background: #fee2e2; color: #991b1b; }

.driveway-check h3 {
    margin: 1px 0 4px;
    color: #0f172a;
    font-size: 14px;
}

.driveway-check p {
    margin: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.driveway-disclaimer {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
}

@media (max-width: 800px) {
    .driveway-result-grid,
    .driveway-checks {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 18px 20px;
        margin: 12px auto 18px;
    }
    .site-identity h1 {
        font-size: 22px;
    }
    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }
    .site-nav a {
        padding: 8px 14px;
    }
    .speed-button, .work-speed {
        width: 100%;
        margin: 5px 0;
    }
    .calculate-button {
        font-size: 14px;
    }
    .result, .formula, .formula-details, .note {
        font-size: 14px;
    }
    .case-picker-card,
    .case-input-card {
        padding: 16px;
    }
    .case-picker-title,
    .case-input-title {
        font-size: 20px;
    }
    .case-results,
    .case-b-results {
        font-size: 14px;
    }
    .result-summary-title {
        font-size: 18px;
    }
    .result-metric {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .result-metric-value {
        text-align: left;
        white-space: normal;
    }
    .result-metric-value-stack {
        align-items: flex-start;
    }
    th, td {
        font-size: 14px;
    }
    h1, h2 {
        font-size: 20px;
    }
    #output {
        flex-direction: column;
    }
    #chart-container {
        width: 100%;
    }
    .sight-distance-form .sight-type-options {
        grid-template-columns: 1fr;
    }
    .sight-distance-form .sight-type-option-wide {
        grid-column: auto;
    }
    .curve-mode-toggle {
        flex-direction: column;
    }
    .curve-mode-button {
        width: 100%;
    }
    .inverse-step-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .inverse-step-counter {
        text-align: center;
    }
    .equation-card {
        width: 100%;
    }
}

#speedDialog {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

#speedDialogContent {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 300px;
    text-align: center;
    border-radius: 10px;
}

#speedDialogContent button {
    width: 100px;
    padding: 10px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

#speedDialogContent button#keep40 {
    background: #007bff;
    color: #fff;
}

#speedDialogContent button#use45 {
    background: #28a745;
    color: #fff;
}

.mode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 6px;
}

.mode-label {
    font-weight: 600;
    color: #0b2a4a;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dbeafe;
    transition: 0.3s;
    border-radius: 34px;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
}

.switch-toggle input:checked + .toggle-slider {
    background-color: #0b2a4a;
    box-shadow: inset 0 0 0 1px #0b2a4a;
}

.switch-toggle input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.mode-panel {
    margin-top: 14px;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

#sign-placement-table {
    width: 100%;
    border-collapse: collapse;
}

#sign-placement-table th,
#sign-placement-table td {
    text-align: center;
    padding: 8px;
    border: 1px solid #e2e8f0;
}

#sign-placement-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.condition-a-cell {
    background: #fffbea;
    font-weight: 700;
}

.table-highlight-row {
    background: #f8fafc;
}

.table-highlight-col {
    background: #eef2ff;
}

.table-highlight-cell {
    background: #fffd8a;
    font-weight: 800;
}

.table-highlight-row .condition-a-cell {
    background: #fffbea;
}

#table-context {
    text-align: left;
    font-weight: 400;
}

@media (max-width: 600px) {
    .driveway-form fieldset {
        padding: 16px;
    }

    .driveway-row {
        grid-template-columns: 34px 1fr;
    }

    .driveway-row .form-group:last-child {
        grid-column: 2;
    }

    .driveway-section-heading,
    .driveway-result-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .driveway-secondary-button {
        width: 100%;
    }
}

/* Bridge underclearance calculator */
.underclearance-tool {
    max-width: 980px;
}

.underclearance-tool,
.underclearance-tool * {
    box-sizing: border-box;
}

.underclearance-tool [hidden] {
    display: none !important;
}

.underclearance-lede {
    margin: -4px 0 18px;
    color: #475569;
    font-size: 17px;
    line-height: 1.55;
}

.underclearance-change-notice {
    margin: 24px 0;
    padding: clamp(18px, 3vw, 28px);
    border: 2px solid #2563eb;
    border-left-width: 8px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a5f;
}

.underclearance-change-notice h2 {
    margin: 0 0 12px;
    color: #0b2a4a;
    font-size: clamp(24px, 4vw, 30px);
}

.underclearance-change-notice p {
    margin: 16px 0 0;
    line-height: 1.6;
}

.underclearance-change-notice .underclearance-change-lead {
    margin-top: 0;
    font-size: 18px;
}

.underclearance-change-table-wrap {
    margin-top: 20px;
    overflow-x: auto;
}

.underclearance-change-table-wrap:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.underclearance-change-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
}

.underclearance-change-table caption {
    padding: 0 0 10px;
    color: #1e3a5f;
    font-weight: 700;
    text-align: left;
}

.underclearance-change-table th,
.underclearance-change-table td {
    padding: 12px;
    border: 1px solid #bfdbfe;
    text-align: left;
    vertical-align: top;
}

.underclearance-change-table thead th {
    background: #dbeafe;
    color: #0b2a4a;
}

.underclearance-change-table tbody th {
    width: 18%;
    background: #f8fafc;
}

.underclearance-change-notice .underclearance-change-sources {
    font-size: 13px;
}

.underclearance-logic-notice {
    margin: 24px 0;
    padding: clamp(18px, 3vw, 28px);
    border: 2px solid #d97706;
    border-left-width: 8px;
    border-radius: 12px;
    background: #fffbeb;
    color: #451a03;
}

.underclearance-logic-notice h2 {
    margin: 0 0 12px;
    color: #78350f;
    font-size: clamp(24px, 4vw, 30px);
}

.underclearance-logic-key {
    margin: 0;
    font-size: clamp(20px, 3vw, 24px);
    line-height: 1.4;
}

.underclearance-logic-selector {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fff;
}

.underclearance-logic-selector label {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.underclearance-logic-selector select {
    width: 100%;
    margin: 10px 0;
}

.underclearance-logic-selector select:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.underclearance-logic-selector p {
    margin: 0;
    line-height: 1.5;
}

.underclearance-logic-example + .underclearance-logic-example {
    margin-top: 12px;
}

.underclearance-logic-notice ol {
    margin: 20px 0;
    padding-left: 24px;
}

.underclearance-logic-notice li {
    margin: 12px 0;
    padding-left: 4px;
    font-size: 16px;
    line-height: 1.6;
}

.underclearance-logic-example {
    margin: 0;
    padding: 16px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fff;
    font-size: 17px;
    line-height: 1.6;
}

.underclearance-source-note,
.underclearance-disclaimer {
    margin: 18px 0;
    padding: 14px 16px;
    border-left: 5px solid #2563eb;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a5f;
}

.underclearance-source-note p,
.underclearance-disclaimer p {
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.underclearance-standard-summary {
    margin: 18px 0 26px;
    padding: 18px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.underclearance-standard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.underclearance-standard-kicker {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.underclearance-standard-heading h2 {
    margin: 3px 0 0;
    color: #0b2a4a;
    font-size: 21px;
}

.underclearance-standard-heading > a {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.underclearance-standard-heading > a:hover {
    border-color: #2563eb;
    text-decoration: underline;
}

.underclearance-standard-summary ul {
    margin: 15px 0;
    padding-left: 21px;
    color: #334155;
}

.underclearance-standard-summary li {
    padding: 4px 0;
    line-height: 1.45;
}

.underclearance-compliance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.underclearance-compliance-grid > div {
    padding: 14px;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
}

.underclearance-compliance-grid time {
    display: block;
    margin-bottom: 5px;
    color: #0c4a6e;
    font-size: 18px;
    font-weight: 900;
}

.underclearance-compliance-grid p {
    margin: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.underclearance-standard-sources {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 12px;
}

.underclearance-standard-sources a {
    color: #1d4ed8;
}

.underclearance-references {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #dbe3ec;
}

.underclearance-references h2 {
    margin: 0 0 8px;
    color: #0b2a4a;
    font-size: 22px;
}

.underclearance-references > p {
    margin: 0 0 16px;
    color: #475569;
    line-height: 1.5;
}

.underclearance-reference {
    margin-top: 10px;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
}

.underclearance-reference summary {
    color: #0b2a4a;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.underclearance-reference summary:hover {
    color: #1d4ed8;
}

.underclearance-reference summary:focus-visible,
.underclearance-reference a:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

.underclearance-reference figure {
    margin: 16px 0 0;
}

.underclearance-reference a {
    display: block;
    width: fit-content;
    max-width: 100%;
}

.underclearance-reference img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.underclearance-reference figcaption {
    margin-top: 10px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.underclearance-form-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 28px 0 14px;
}

.underclearance-form-heading h2 {
    margin: 0 0 5px;
    color: #0b2a4a;
    font-size: 22px;
}

.underclearance-form-heading p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.underclearance-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.underclearance-secondary-button {
    padding: 10px 14px;
    border: 1px solid #94a3b8;
    border-radius: 7px;
    background: #fff;
    color: #0f3b66;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.underclearance-secondary-button:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.underclearance-secondary-button:focus-visible,
.clearance-input:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.underclearance-measurements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.underclearance-direction-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.underclearance-direction-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.underclearance-direction-heading h3 {
    margin: 2px 0 0;
    color: #0b2a4a;
    font-size: 20px;
}

.underclearance-direction-heading > span {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 800;
}

.underclearance-direction-kicker {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.underclearance-measurements fieldset {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
}

.underclearance-measurements legend {
    padding: 0 8px;
    color: #0b2a4a;
    font-size: 17px;
    font-weight: 800;
}

.underclearance-input-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.underclearance-input-grid label {
    display: block;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.underclearance-input-grid input {
    width: 100%;
    margin: 7px 0 4px;
    padding: 11px 10px;
    border: 1px solid #94a3b8;
    border-radius: 7px;
    background: #fff;
    font-size: 17px;
}

.underclearance-input-grid input:focus {
    border-color: #2563eb;
}

.underclearance-input-grid .underclearance-input-invalid {
    border-color: #dc2626;
    background: #fff1f2;
}

.clearance-conversion {
    display: block;
    min-height: 18px;
    color: #64748b;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.underclearance-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.underclearance-results {
    margin-top: 24px;
}

.underclearance-results-heading {
    margin-bottom: 14px;
}

.underclearance-results-heading h2 {
    margin: 0 0 5px;
    color: #0b2a4a;
}

.underclearance-results-heading p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.underclearance-direction-result + .underclearance-direction-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #dbe3ec;
}

.underclearance-empty {
    padding: 24px;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}

.underclearance-result-hero {
    padding: 24px;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    text-align: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.underclearance-result-kicker {
    margin: 0;
    color: #0b2a4a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.underclearance-result-label {
    margin: 12px 0 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.underclearance-w12-sign {
    width: min(100%, 760px);
    aspect-ratio: 3.5 / 1;
    margin: 14px auto 0;
    padding: clamp(5px, 1vw, 9px);
    border: clamp(2px, 0.35vw, 3px) solid #050505;
    border-radius: clamp(14px, 2.4vw, 25px);
    background: #ffcc00;
}

.underclearance-w12-sign-face {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: baseline;
    justify-content: center;
    padding: 0 clamp(12px, 5vw, 64px);
    border: clamp(6px, 1.15vw, 11px) solid #050505;
    border-radius: clamp(10px, 1.7vw, 18px);
    background: #ffcc00;
    color: #050505;
    font-family: "Arial Black", Arial, Helvetica, sans-serif;
    line-height: 1;
}

.underclearance-w12-number {
    align-self: center;
    font-size: clamp(40px, 9vw, 96px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.06em;
}

.underclearance-w12-unit {
    align-self: center;
    margin-left: clamp(5px, 1.2vw, 13px);
    font-size: clamp(19px, 4.3vw, 47px);
    font-weight: 900;
    letter-spacing: 0.02em;
}

.underclearance-w12-unit + .underclearance-w12-number {
    margin-left: clamp(28px, 8vw, 100px);
}

.underclearance-result-hero h2 {
    margin: 6px 0;
    color: #fff;
    font-size: clamp(40px, 9vw, 66px);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.underclearance-sign-status {
    display: inline-block;
    margin: 8px 0 0;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 800;
}

.underclearance-sign-required {
    background: #fef3c7;
    color: #78350f;
}

.underclearance-sign-not-required {
    background: #dcfce7;
    color: #14532d;
}

.underclearance-threshold-status {
    display: inline-block;
    max-width: 720px;
    margin: 6px 0 0;
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.underclearance-threshold-required {
    background: #fef3c7;
    color: #78350f;
}

.underclearance-threshold-above {
    border: 1px solid #bae6fd;
    background: #e0f2fe;
    color: #0c4a6e;
}

.underclearance-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.underclearance-metric {
    padding: 16px;
    border: 1px solid #dbe3ec;
    border-radius: 9px;
    background: #fff;
}

.underclearance-metric span,
.underclearance-metric small {
    display: block;
    color: #64748b;
}

.underclearance-metric span {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.underclearance-metric strong {
    display: block;
    margin: 7px 0 4px;
    color: #0b2a4a;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.underclearance-math-card {
    padding: 18px 20px;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #f8fafc;
}

.underclearance-math-card summary {
    margin: 0;
    color: #0b2a4a;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    list-style-position: outside;
}

.underclearance-math-card summary:hover {
    color: #1d4ed8;
}

.underclearance-math-card summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 4px;
}

.underclearance-math-card[open] summary {
    margin-bottom: 12px;
}

.underclearance-math-card ol {
    margin: 0;
    padding-left: 25px;
}

.underclearance-math-card li {
    padding: 9px 0 9px 5px;
    color: #334155;
    line-height: 1.4;
}

.underclearance-math-card li + li {
    border-top: 1px solid #e2e8f0;
}

.underclearance-math-card li span,
.underclearance-math-card li strong {
    display: block;
}

.underclearance-math-card li strong {
    margin-top: 3px;
    color: #0f172a;
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
    .underclearance-form-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .underclearance-actions {
        flex-wrap: wrap;
    }

    .underclearance-standard-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .underclearance-compliance-grid {
        grid-template-columns: 1fr;
    }

    .underclearance-measurements,
    .underclearance-result-grid {
        grid-template-columns: 1fr;
    }

    .underclearance-direction-card {
        padding: 14px;
    }

    .underclearance-result-hero {
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    .underclearance-input-grid {
        grid-template-columns: 1fr;
    }

    .underclearance-actions button {
        flex: 1 1 100%;
    }
}
