.race-entry,
.race-dashboard-hero,
.customer-fresh-header.race-garage {
    --race-line: #39433d;
    --race-text: #f3f7f4;
    --race-muted: #bac6be;
    --race-lime: #d6fa6b;
    --race-red: #ef5368;
    color: var(--race-text);
}

.race-entry {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    overflow: hidden;
    max-width: 1050px;
    margin: clamp(0px, 4vw, 28px) auto;
    border: 1px solid var(--race-line);
    border-radius: 16px;
    background: #151c18;
}

.race-entry-intro,
.race-dashboard-hero,
.customer-fresh-header.race-garage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(137deg, #161e19 4%, #0a100c 74%);
    border-top: 3px solid var(--race-lime);
}

.race-entry-intro::before,
.race-dashboard-hero::before,
.customer-fresh-header.race-garage::before {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto auto;
    width: clamp(72px, 22%, 220px);
    height: 52px;
    background: repeating-linear-gradient(130deg, transparent 0 9px, #baea6d24 9px 13px),
                linear-gradient(100deg, transparent, #ef53683d);
    clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
    content: "";
}

.race-entry-intro {
    min-width: 0;
    padding: clamp(22px, 5vw, 60px);
    border-right: 1px solid var(--race-line);
}

.race-entry-sheet {
    min-width: 0;
    padding: clamp(18px, 4vw, 38px);
}

.race-entry-sheet h2 { margin-top: 0; color: var(--race-text); font-size: 19px; font-weight: 800; }
.race-entry-sheet p { color: var(--race-muted); }
.race-entry-sheet .input { min-height: 46px; min-width: 0; }
.race-entry-sheet :is(button, a):focus-visible { outline: 3px solid var(--race-lime); outline-offset: 2px; }

.race-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #e2f7bc;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.race-display {
    margin: 0;
    color: #fff;
    font-family: Rajdhani, "Arial Narrow", system-ui, sans-serif;
    font-size: clamp(31px, 5vw, 60px);
    font-weight: 900;
    line-height: .99;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.race-summary { margin: 12px 0 0; color: #bac6be; font-size: 14px; }
.race-icon { flex: 0 0 auto; width: 22px; height: 22px; }
.race-entry-lanes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.race-entry-lanes li {
    display: grid;
    justify-items: start;
    gap: 7px;
    min-width: 0;
    padding: 9px;
    color: #e5f2e9;
    background: #1e2922;
    border: 1px solid #3b5041;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 750;
}

.race-entry-lanes .race-icon { color: #d6fa6b; }
.race-dashboard-hero { border-radius: 13px; padding: clamp(15px, 3vw, 28px); }
.race-dashboard-hero::after,
.race-entry-intro::after {
    display: block;
    width: 100%;
    height: 5px;
    margin-top: clamp(18px, 3vw, 28px);
    background: repeating-linear-gradient(-48deg, #d6fa6b 0 7px, transparent 7px 12px) left / 66px 100% no-repeat,
                linear-gradient(90deg, transparent 72px, #45272b 72px, #ef5368 100%);
    content: "";
}
.race-job-code { display: inline-flex; margin-top: 9px; color: #d6fa6b; font-size: 12px; letter-spacing: .08em; font-weight: 850; }
.race-progress-panel { padding: clamp(11px, 2vw, 19px); border: 1px solid #39433d; border-radius: 12px; background: #121914; color: #f3f7f4; }
.race-progress-panel h2 { margin: 0 0 11px; color: #fff; font-size: 17px; font-weight: 800; }
.race-stage-grid { display: grid; grid-template-columns: repeat(var(--race-stage-count, 4), minmax(0, 1fr)); gap: 7px; padding: 0; margin: 0; list-style: none; }
.race-stage { display: grid; grid-template-rows: 32px auto 1fr; gap: 4px; min-width: 0; padding: 8px; border: 1px solid #3d4b40; border-radius: 7px; background: #191f1b; color: #ecf1ed; }
.race-stage-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; background: #28352c; color: #c5d5c8; }
.race-stage-name { font-size: 12px; line-height: 1.24; font-weight: 800; overflow-wrap: anywhere; }
.race-stage small { display: block; color: #bac6be; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.race-stage[data-race-state="done"] { border-color: #4a673f; }
.race-stage[data-race-state="done"] .race-stage-icon { color: #d5eea7; }
.race-stage[data-race-state="active"] { border-color: #d6fa6b; background: #253516; }
.race-stage[data-race-state="active"] .race-stage-icon { background: #d6fa6b; color: #12200a; }
.race-stage[data-race-state="active"] small { color: #e3f6bb; }
.race-stage[data-race-state="stopped"] { border-color: #ef5368; background: #392222; }
.customer-fresh-header.race-garage { grid-template-columns: minmax(0,1fr) minmax(0, 1fr); border-color: #39433d; border-top-color: #d6fa6b; border-radius: 12px; align-items: center; }
.customer-fresh-header.race-garage .customer-fresh-identity .race-display { color: #fff; font-size: clamp(25px, 4.2vw, 45px); }
.customer-fresh-header.race-garage .customer-fresh-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.customer-fresh-header.race-garage .race-progress-panel { grid-column: 1 / -1; }
.race-garage-job-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.race-garage-job-head h2 { margin: 0; }
.race-garage-job-head .btn-secondary { min-height: 42px; color: #f3f7f4; }

@media (max-width: 900px) {
    .customer-fresh-header.race-garage { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
    .race-entry { grid-template-columns: minmax(0, 1fr); }
    .race-entry-intro { border-right: 0; border-bottom: 1px solid var(--race-line); }
    .race-entry-lanes { margin-top: 15px; }
    .race-entry-sheet .input { font-size: 16px; }
    .race-stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .customer-fresh-header.race-garage .customer-fresh-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
