.tuning-lab-page {
    --lab-black: #050505;
    --lab-panel: #090909;
    --lab-panel-raised: #0d0d0d;
    --lab-white: #ffffff;
    --lab-text: #d7d7d7;
    --lab-muted: #858585;
    --lab-dim: #575757;
    --lab-line: rgba(255, 255, 255, 0.14);
    --lab-line-strong: rgba(255, 255, 255, 0.32);
    background: var(--lab-black);
    color: var(--lab-white);
}

.tuning-lab-page .site-header {
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.94) 0%,
            rgba(0, 0, 0, 0.58) 68%,
            transparent 100%
        );
}

.tuning-lab-page .site-header.scrolled {
    background: rgba(5, 5, 5, 0.95);
}

.tuning-lab-page button,
.tuning-lab-page input,
.tuning-lab-page select {
    font: inherit;
}

.tuning-lab-page button,
.tuning-lab-page select {
    cursor: pointer;
}

.tuning-lab-page .lab-main {
    overflow: hidden;
    background:
        linear-gradient(
            90deg,
            transparent calc(50% - 1px),
            rgba(255, 255, 255, 0.025) 50%,
            transparent calc(50% + 1px)
        ),
        var(--lab-black);
}

/* Cinematic intro */

.tuning-lab-page .lab-hero {
    position: relative;
    min-height: 780px;
    display: flex;
    align-items: center;
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px solid var(--lab-line);
    background: #020202;
}

.tuning-lab-page .lab-hero-photo {
    position: absolute;
    z-index: -3;
    inset: 0;
    background:
        url("../../../assets/images/gallery-touge.png")
        center 48% / cover no-repeat;
    filter: grayscale(100%) contrast(1.12);
    transform: scale(1.02);
}

.tuning-lab-page .lab-hero-overlay {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.98) 0%,
            rgba(0, 0, 0, 0.94) 35%,
            rgba(0, 0, 0, 0.54) 68%,
            rgba(0, 0, 0, 0.42) 100%
        ),
        linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.96) 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.48) 100%
        );
}

.tuning-lab-page .lab-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 auto 0 0;
    width: 62%;
    background:
        linear-gradient(
            115deg,
            rgba(5, 5, 5, 1) 0%,
            rgba(5, 5, 5, 0.97) 72%,
            rgba(5, 5, 5, 0.35) 100%
        );
    clip-path: polygon(0 0, 81% 0, 100% 100%, 0 100%);
}

.tuning-lab-page .lab-hero::after {
    content: "SAINTSPEC";
    position: absolute;
    z-index: -1;
    right: -2vw;
    bottom: 70px;
    color: rgba(255, 255, 255, 0.035);
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(170px, 19vw, 360px);
    line-height: 0.7;
    letter-spacing: -3px;
    pointer-events: none;
}

.tuning-lab-page .lab-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    gap: clamp(70px, 10vw, 180px);
    padding-top: calc(var(--header-height) + 35px);
    padding-bottom: 120px;
}

.tuning-lab-page .lab-hero-copy {
    max-width: 760px;
}

.tuning-lab-page .lab-eyebrow,
.tuning-lab-page .lab-kicker {
    color: #9e9e9e;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 4px;
    line-height: 1.5;
    text-transform: uppercase;
}

.tuning-lab-page .lab-hero h1 {
    margin-top: 28px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(105px, 10vw, 180px);
    font-weight: 400;
    line-height: 0.78;
    letter-spacing: -2px;
    text-transform: uppercase;
}

.tuning-lab-page .lab-hero h1 span {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.88);
}

.tuning-lab-page .lab-hero-description {
    max-width: 640px;
    margin-top: 40px;
    color: #b3b3b3;
    font-size: 14px;
    line-height: 2;
}

.tuning-lab-page .lab-hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
}

.tuning-lab-page .lab-primary-link,
.tuning-lab-page .lab-secondary-button {
    min-width: 190px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border: 1px solid var(--lab-white);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}

.tuning-lab-page .lab-primary-link {
    background: var(--lab-white);
    color: var(--lab-black);
}

.tuning-lab-page .lab-secondary-button {
    background: transparent;
    color: var(--lab-white);
}

.tuning-lab-page .lab-primary-link:hover {
    background: transparent;
    color: var(--lab-white);
}

.tuning-lab-page .lab-secondary-button:hover {
    background: var(--lab-white);
    color: var(--lab-black);
}

.tuning-lab-page .lab-engine-card {
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.56);
    text-align: center;
    backdrop-filter: blur(14px);
}

.tuning-lab-page .lab-engine-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.tuning-lab-page .lab-engine-card img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.16));
}

.tuning-lab-page .lab-engine-card p {
    margin-top: 28px;
    color: var(--lab-dim);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.tuning-lab-page .lab-engine-card strong {
    margin-top: 10px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 27px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tuning-lab-page .lab-engine-card small {
    max-width: 190px;
    margin-top: 9px;
    color: var(--lab-muted);
    font-size: 9px;
    line-height: 1.6;
}

.tuning-lab-page .lab-hero-rail {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    border-top: 1px solid var(--lab-line);
    background: rgba(3, 3, 3, 0.86);
    backdrop-filter: blur(12px);
}

.tuning-lab-page .lab-rail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.tuning-lab-page .lab-rail-grid > div {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 32px;
    border-right: 1px solid var(--lab-line);
}

.tuning-lab-page .lab-rail-grid > div:last-child {
    border-right: 0;
}

.tuning-lab-page .lab-rail-grid span {
    color: var(--lab-muted);
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 21px;
}

.tuning-lab-page .lab-rail-grid p {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Methodology */

.tuning-lab-page .lab-introduction {
    position: relative;
    padding: 115px 0;
    border-bottom: 1px solid var(--lab-line);
    background:
        radial-gradient(
            circle at 82% 30%,
            rgba(255, 255, 255, 0.045),
            transparent 34%
        ),
        #070707;
}

.tuning-lab-page .lab-introduction::after {
    content: "01";
    position: absolute;
    top: 50%;
    right: 2vw;
    color: rgba(255, 255, 255, 0.025);
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 300px;
    line-height: 0.7;
    transform: translateY(-50%);
    pointer-events: none;
}

.tuning-lab-page .lab-introduction-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.75fr);
    align-items: end;
    gap: clamp(60px, 9vw, 160px);
}

.tuning-lab-page .lab-introduction h2,
.tuning-lab-page .lab-section-heading h2 {
    margin-top: 28px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(68px, 6vw, 112px);
    font-weight: 400;
    line-height: 0.86;
    text-transform: uppercase;
}

.tuning-lab-page .lab-introduction-copy {
    padding-left: 35px;
    border-left: 1px solid var(--lab-line);
}

.tuning-lab-page .lab-introduction-copy p {
    color: #a2a2a2;
    font-size: 13px;
    line-height: 2;
}

.tuning-lab-page .lab-introduction-copy p + p {
    margin-top: 20px;
    color: #747474;
}

/* Calculator shell */

.tuning-lab-page .lab-calculator {
    position: relative;
    padding: 120px 0 140px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.018) 0%,
            transparent 34%
        ),
        var(--lab-black);
}

.tuning-lab-page .lab-calculator::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px
        );
    background-size: 80px 80px;
    mask-image: linear-gradient(180deg, black, transparent 38%);
    pointer-events: none;
}

.tuning-lab-page .lab-section-heading {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.55fr);
    align-items: end;
    gap: 70px;
    margin-bottom: 65px;
}

.tuning-lab-page .lab-section-heading > p {
    padding-bottom: 8px;
    color: var(--lab-muted);
    font-size: 12px;
    line-height: 2;
}

.tuning-lab-page .workspace {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(390px, 470px) minmax(0, 1fr);
    align-items: start;
    border: 1px solid var(--lab-line);
    background: #070707;
}

.tuning-lab-page .input-panel {
    position: sticky;
    top: calc(var(--header-height) + 18px);
    max-height: calc(100vh - var(--header-height) - 36px);
    overflow-y: auto;
    border-right: 1px solid var(--lab-line);
    background:
        linear-gradient(
            145deg,
            #0c0c0c 0%,
            #070707 72%
        );
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    scrollbar-width: thin;
}

.tuning-lab-page .input-panel form {
    padding: 34px;
}

.tuning-lab-page .result-panel {
    min-width: 0;
    padding: 34px;
    background:
        linear-gradient(
            150deg,
            rgba(255, 255, 255, 0.025),
            transparent 28%
        ),
        #050505;
}

.tuning-lab-page .panel-heading,
.tuning-lab-page .result-toolbar,
.tuning-lab-page .dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.tuning-lab-page .panel-heading h2,
.tuning-lab-page .result-toolbar h2,
.tuning-lab-page .lab-dialog h2 {
    margin-top: 8px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .text-button {
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--lab-line-strong);
    background: transparent;
    color: var(--lab-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.tuning-lab-page .text-button:hover {
    border-color: var(--lab-white);
    color: var(--lab-white);
}

/* Inputs */

.tuning-lab-page .input-panel fieldset {
    position: relative;
    margin: 0;
    padding: 28px 0;
    border: 0;
    border-top: 1px solid var(--lab-line);
}

.tuning-lab-page .input-panel fieldset:first-of-type {
    margin-top: 26px;
}

.tuning-lab-page .input-panel legend {
    margin-bottom: 16px;
    padding: 0;
    color: #e4e4e4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tuning-lab-page .field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tuning-lab-page .field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tuning-lab-page .field,
.tuning-lab-page .range-row {
    min-width: 0;
}

.tuning-lab-page .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tuning-lab-page .field > span,
.tuning-lab-page .range-row > span {
    color: #a0a0a0;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.tuning-lab-page .field em,
.tuning-lab-page .range-row em {
    color: #606060;
    font-style: normal;
    font-weight: 500;
}

.tuning-lab-page .input-panel input,
.tuning-lab-page .input-panel select {
    width: 100%;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid var(--lab-line);
    border-radius: 0;
    outline: 0;
    background: #050505;
    color: var(--lab-white);
    font-size: 11px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.tuning-lab-page .input-panel input:hover,
.tuning-lab-page .input-panel select:hover {
    border-color: var(--lab-line-strong);
    background: #090909;
}

.tuning-lab-page .input-panel input:focus,
.tuning-lab-page .input-panel select:focus {
    border-color: rgba(255, 255, 255, 0.62);
    box-shadow: inset 3px 0 0 var(--lab-white);
}

.tuning-lab-page .input-panel input:disabled {
    background: #0b0b0b;
    color: #484848;
    cursor: not-allowed;
}

.tuning-lab-page .preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tuning-lab-page .preset-chip {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--lab-line);
    border-radius: 0;
    background: #050505;
    color: var(--lab-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.tuning-lab-page .preset-chip:hover {
    border-color: var(--lab-line-strong);
    color: var(--lab-white);
}

.tuning-lab-page .preset-chip.active {
    border-color: var(--lab-white);
    background: var(--lab-white);
    color: var(--lab-black);
}

.tuning-lab-page .sr-only-field {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tuning-lab-page .field-help {
    margin: -3px 0 15px;
    color: #707070;
    font-size: 10px;
    line-height: 1.7;
}

.tuning-lab-page .full-field {
    grid-column: 1 / -1;
}

.tuning-lab-page .input-hint {
    color: #666666;
    font-size: 9px;
    line-height: 1.6;
}

.tuning-lab-page .engineer-fieldset::before {
    content: "";
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: -34px;
    width: 2px;
    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(255, 255, 255, 0.62),
            transparent
        );
}

.tuning-lab-page .range-table {
    display: grid;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.tuning-lab-page .range-header,
.tuning-lab-page .range-row {
    display: grid;
    grid-template-columns: minmax(125px, 1.35fr) repeat(2, minmax(72px, 0.8fr));
    align-items: center;
    gap: 8px;
}

.tuning-lab-page .range-header {
    color: #616161;
    font-size: 8px;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
}

.tuning-lab-page .disabled-panel {
    opacity: 0.32;
}

.tuning-lab-page .switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tuning-lab-page .switch-row > span {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tuning-lab-page .switch-row strong {
    font-size: 11px;
}

.tuning-lab-page .switch-row small {
    color: #6e6e6e;
    font-size: 9px;
}

.tuning-lab-page .input-panel .switch-row input {
    width: 46px;
    min-width: 46px;
    min-height: 24px;
    accent-color: #ffffff;
}

.tuning-lab-page .primary-button {
    width: 100%;
    min-height: 55px;
    border: 1px solid var(--lab-white);
    border-radius: 0;
    background: var(--lab-white);
    color: var(--lab-black);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.tuning-lab-page .primary-button:hover {
    background: transparent;
    color: var(--lab-white);
}

.tuning-lab-page .validation-errors,
.tuning-lab-page .fatal-error {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 116, 116, 0.45);
    background: rgba(128, 23, 23, 0.16);
    color: #ffb1b1;
    font-size: 11px;
    line-height: 1.7;
}

.tuning-lab-page .fatal-error {
    margin-top: 35px;
}

/* Results */

.tuning-lab-page .result-toolbar {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--lab-line);
}

.tuning-lab-page .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.tuning-lab-page .toolbar-actions button,
.tuning-lab-page .dialog-head button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--lab-line);
    border-radius: 0;
    background: transparent;
    color: var(--lab-muted);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
}

.tuning-lab-page .toolbar-actions button:hover,
.tuning-lab-page .dialog-head button:hover {
    border-color: var(--lab-white);
    background: var(--lab-white);
    color: var(--lab-black);
}

.tuning-lab-page .tune-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    border-top: 1px solid var(--lab-line);
    border-left: 1px solid var(--lab-line);
}

.tuning-lab-page .tune-summary > div {
    min-width: 0;
    min-height: 82px;
    padding: 16px;
    border-right: 1px solid var(--lab-line);
    border-bottom: 1px solid var(--lab-line);
    background: #080808;
}

.tuning-lab-page .tune-summary span {
    display: block;
    margin-bottom: 8px;
    color: #676767;
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tuning-lab-page .tune-summary strong {
    display: block;
    overflow: hidden;
    color: #ededed;
    font-size: 11px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tuning-lab-page .confidence-track {
    height: 2px;
    margin-top: 9px;
    overflow: hidden;
    background: #292929;
}

.tuning-lab-page .confidence-track i {
    width: 0;
    height: 100%;
    display: block;
    background: var(--lab-white);
    transition: width 0.35s ease;
}

.tuning-lab-page .goal-description {
    margin: 14px 2px 22px;
    color: #777777;
    font-size: 10px;
    line-height: 1.7;
}

.tuning-lab-page .diagnosis-card {
    position: relative;
    margin-bottom: 14px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--lab-line-strong);
    background:
        linear-gradient(
            115deg,
            rgba(255, 255, 255, 0.06),
            transparent 48%
        ),
        #080808;
}

.tuning-lab-page .diagnosis-card::after {
    content: "DIAGNOSIS";
    position: absolute;
    right: -10px;
    bottom: -22px;
    color: rgba(255, 255, 255, 0.025);
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 82px;
    letter-spacing: 2px;
    pointer-events: none;
}

.tuning-lab-page .diagnosis-heading {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.tuning-lab-page .diagnosis-card h3,
.tuning-lab-page .notes-card h3 {
    margin-top: 8px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .diagnosis-card > p {
    position: relative;
    z-index: 2;
    max-width: 870px;
    margin-top: 14px;
    color: #a0a0a0;
    font-size: 10px;
    line-height: 1.8;
}

.tuning-lab-page .diagnosis-phase {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid var(--lab-line);
    color: #bcbcbc;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .mechanical-status {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px dashed var(--lab-line);
}

.tuning-lab-page .mechanical-status > span {
    color: #6e6e6e;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .mechanical-status strong {
    font-size: 11px;
}

.tuning-lab-page .mechanical-status small {
    color: #858585;
    font-size: 9px;
}

.tuning-lab-page .results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--lab-line);
    border-left: 1px solid var(--lab-line);
    transition: opacity 0.2s ease;
}

.tuning-lab-page .muted-results {
    opacity: 0.32;
    pointer-events: none;
}

.tuning-lab-page .result-card {
    min-width: 0;
    border-right: 1px solid var(--lab-line);
    border-bottom: 1px solid var(--lab-line);
    background: #070707;
    transition: background 0.25s ease;
}

.tuning-lab-page .result-card:hover {
    background: #0a0a0a;
}

.tuning-lab-page .result-card > header {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 72px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--lab-line);
}

.tuning-lab-page .result-card > header > span {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lab-line);
    color: #9a9a9a;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 16px;
}

.tuning-lab-page .result-card h3 {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .result-card header p {
    margin-top: 3px;
    color: #5f5f5f;
    font-size: 8px;
    line-height: 1.4;
}

.tuning-lab-page .result-body {
    padding: 8px 16px 14px;
}

.tuning-lab-page .result-row {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.tuning-lab-page .result-row:last-of-type {
    border-bottom: 0;
}

.tuning-lab-page .result-row > div {
    min-width: 0;
}

.tuning-lab-page .result-label {
    color: #aaaaaa;
    font-size: 10px;
}

.tuning-lab-page .result-row small {
    display: block;
    margin-top: 2px;
    color: #5d5d5d;
    font-size: 8px;
}

.tuning-lab-page .result-row strong {
    color: var(--lab-white);
    font-size: 11px;
    white-space: nowrap;
}

.tuning-lab-page .section-footnote {
    margin-top: 10px;
    color: #606060;
    font-size: 8px;
    line-height: 1.6;
}

.tuning-lab-page .locked-output {
    min-height: 86px;
    display: grid;
    place-items: center;
    padding: 12px;
    text-align: center;
}

.tuning-lab-page .locked-output span {
    color: #858585;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 2px;
}

.tuning-lab-page .locked-output p {
    max-width: 260px;
    color: #595959;
    font-size: 9px;
    line-height: 1.6;
}

.tuning-lab-page .notes-card {
    margin-top: 14px;
    padding: 22px;
    border: 1px solid var(--lab-line);
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.045),
            transparent 55%
        ),
        #070707;
}

.tuning-lab-page .notes-card ul {
    margin-top: 14px;
    padding-left: 18px;
    color: #8a8a8a;
    font-size: 10px;
    line-height: 1.7;
}

.tuning-lab-page .notes-card li + li {
    margin-top: 6px;
}

/* Test protocol */

.tuning-lab-page .lab-protocol {
    padding: 100px 0 120px;
    border-top: 1px solid var(--lab-line);
    background: #080808;
}

.tuning-lab-page .lab-protocol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 40px;
    border-top: 1px solid var(--lab-line);
    border-left: 1px solid var(--lab-line);
}

.tuning-lab-page .lab-protocol-grid article {
    min-height: 220px;
    padding: 32px;
    border-right: 1px solid var(--lab-line);
    border-bottom: 1px solid var(--lab-line);
}

.tuning-lab-page .lab-protocol-grid span {
    color: #777777;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 21px;
}

.tuning-lab-page .lab-protocol-grid h2 {
    margin-top: 36px;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 29px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tuning-lab-page .lab-protocol-grid p {
    margin-top: 12px;
    color: #777777;
    font-size: 10px;
    line-height: 1.8;
}

/* Dialog and notifications */

.tuning-lab-page .lab-dialog {
    width: min(650px, calc(100% - 30px));
    max-height: calc(100vh - 40px);
    padding: 28px;
    overflow-y: auto;
    border: 1px solid var(--lab-line-strong);
    border-radius: 0;
    background: #0a0a0a;
    color: var(--lab-white);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.tuning-lab-page .lab-dialog::backdrop {
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(8px);
}

.tuning-lab-page .lab-dialog p {
    margin-top: 20px;
    color: #999999;
    font-size: 12px;
    line-height: 1.9;
}

.tuning-lab-page .lab-dialog code {
    color: var(--lab-white);
}

.tuning-lab-page .dialog-warning {
    margin-top: 22px;
    padding: 15px;
    border-left: 2px solid var(--lab-white);
    background: rgba(255, 255, 255, 0.045);
    color: #a5a5a5;
    font-size: 11px;
    line-height: 1.7;
}

.tuning-lab-page .toast {
    position: fixed;
    z-index: 1500;
    right: 22px;
    bottom: 22px;
    max-width: min(380px, calc(100% - 44px));
    padding: 13px 16px;
    border: 1px solid rgba(164, 225, 177, 0.38);
    background: #0d160f;
    color: #b8e4c1;
    font-size: 10px;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.tuning-lab-page .toast.show {
    opacity: 1;
    transform: translateY(0);
}

.tuning-lab-page .toast.error {
    border-color: rgba(255, 116, 116, 0.4);
    background: #1a0d0d;
    color: #ffb1b1;
}

/* Responsive */

@media (max-width: 1280px) {
    .tuning-lab-page .lab-hero-inner {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 70px;
    }

    .tuning-lab-page .workspace {
        grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    }

    .tuning-lab-page .result-panel,
    .tuning-lab-page .input-panel form {
        padding: 27px;
    }

    .tuning-lab-page .engineer-fieldset::before {
        left: -27px;
    }
}

@media (max-width: 1100px) {
    .tuning-lab-page .lab-hero {
        min-height: 720px;
    }

    .tuning-lab-page .lab-hero-inner {
        grid-template-columns: minmax(0, 1fr) 230px;
        gap: 45px;
    }

    .tuning-lab-page .lab-engine-card {
        min-height: 300px;
    }

    .tuning-lab-page .lab-introduction-grid,
    .tuning-lab-page .lab-section-heading {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .tuning-lab-page .lab-introduction-copy {
        max-width: 760px;
    }

    .tuning-lab-page .workspace {
        grid-template-columns: 1fr;
    }

    .tuning-lab-page .input-panel {
        position: static;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--lab-line);
    }
}

@media (max-width: 760px) {
    .tuning-lab-page .lab-hero {
        min-height: 740px;
        align-items: flex-end;
    }

    .tuning-lab-page .lab-hero-photo {
        background-position: 58% center;
    }

    .tuning-lab-page .lab-hero-overlay {
        background:
            linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.99) 0%,
                rgba(0, 0, 0, 0.84) 63%,
                rgba(0, 0, 0, 0.52) 100%
            );
    }

    .tuning-lab-page .lab-hero::before {
        display: none;
    }

    .tuning-lab-page .lab-hero::after {
        bottom: 92px;
        font-size: 150px;
    }

    .tuning-lab-page .lab-hero-inner {
        display: block;
        padding-top: 145px;
        padding-bottom: 145px;
    }

    .tuning-lab-page .lab-hero h1 {
        margin-top: 22px;
        font-size: clamp(84px, 25vw, 125px);
    }

    .tuning-lab-page .lab-hero-description {
        margin-top: 28px;
        font-size: 12px;
    }

    .tuning-lab-page .lab-engine-card {
        display: none;
    }

    .tuning-lab-page .lab-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tuning-lab-page .lab-primary-link,
    .tuning-lab-page .lab-secondary-button {
        width: 100%;
    }

    .tuning-lab-page .lab-rail-grid > div {
        min-height: 76px;
        gap: 10px;
        padding: 14px 10px;
    }

    .tuning-lab-page .lab-rail-grid span {
        font-size: 17px;
    }

    .tuning-lab-page .lab-rail-grid p {
        font-size: 7px;
        letter-spacing: 1px;
    }

    .tuning-lab-page .lab-introduction,
    .tuning-lab-page .lab-calculator {
        padding: 90px 0;
    }

    .tuning-lab-page .lab-introduction h2,
    .tuning-lab-page .lab-section-heading h2 {
        font-size: clamp(62px, 18vw, 86px);
    }

    .tuning-lab-page .lab-introduction-copy {
        padding-left: 20px;
    }

    .tuning-lab-page .lab-section-heading {
        margin-bottom: 45px;
    }

    .tuning-lab-page .input-panel form,
    .tuning-lab-page .result-panel {
        padding: 20px;
    }

    .tuning-lab-page .field-grid.three,
    .tuning-lab-page .field-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tuning-lab-page .engineer-fieldset::before {
        display: none;
    }

    .tuning-lab-page .result-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .tuning-lab-page .toolbar-actions {
        justify-content: flex-start;
    }

    .tuning-lab-page .tune-summary {
        grid-template-columns: 1fr 1fr;
    }

    .tuning-lab-page .results-grid {
        grid-template-columns: 1fr;
    }

    .tuning-lab-page .mechanical-status {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tuning-lab-page .lab-protocol {
        padding: 80px 0 90px;
    }

    .tuning-lab-page .lab-protocol-grid {
        grid-template-columns: 1fr;
    }

    .tuning-lab-page .lab-protocol-grid article {
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .tuning-lab-page .lab-hero h1 {
        font-size: clamp(78px, 22vw, 96px);
        letter-spacing: -1px;
    }

    .tuning-lab-page .lab-hero h1 span {
        display: block;
        font-size: 0.82em;
    }

    .tuning-lab-page .lab-rail-grid p {
        max-width: 75px;
    }

    .tuning-lab-page .field-grid.three,
    .tuning-lab-page .field-grid {
        grid-template-columns: 1fr;
    }

    .tuning-lab-page .range-header,
    .tuning-lab-page .range-row {
        grid-template-columns: 1fr 72px 72px;
    }

    .tuning-lab-page .tune-summary {
        grid-template-columns: 1fr;
    }

    .tuning-lab-page .diagnosis-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .tuning-lab-page .toolbar-actions button {
        flex: 1 1 calc(50% - 7px);
    }
}

/* Printable tune sheet */

@media print {
    .tuning-lab-page {
        background: #ffffff;
        color: #000000;
    }

    .tuning-lab-page .site-header,
    .tuning-lab-page .lab-hero,
    .tuning-lab-page .lab-introduction,
    .tuning-lab-page .lab-section-heading,
    .tuning-lab-page .input-panel,
    .tuning-lab-page .toolbar-actions,
    .tuning-lab-page .goal-description,
    .tuning-lab-page .notes-card,
    .tuning-lab-page .lab-protocol,
    .tuning-lab-page .site-footer {
        display: none !important;
    }

    .tuning-lab-page .lab-main,
    .tuning-lab-page .lab-calculator,
    .tuning-lab-page .result-panel,
    .tuning-lab-page .result-card,
    .tuning-lab-page .tune-summary > div,
    .tuning-lab-page .diagnosis-card {
        background: #ffffff;
        color: #000000;
    }

    .tuning-lab-page .lab-calculator {
        padding: 0;
    }

    .tuning-lab-page .container {
        width: 100%;
    }

    .tuning-lab-page .workspace {
        display: block;
        border: 0;
        background: #ffffff;
    }

    .tuning-lab-page .result-panel {
        padding: 0;
    }

    .tuning-lab-page .result-toolbar {
        margin-bottom: 14px;
        border-color: #aaaaaa;
    }

    .tuning-lab-page .result-toolbar h2,
    .tuning-lab-page .diagnosis-card h3,
    .tuning-lab-page .result-card h3,
    .tuning-lab-page .result-row strong,
    .tuning-lab-page .mechanical-status strong {
        color: #000000;
    }

    .tuning-lab-page .lab-kicker,
    .tuning-lab-page .result-label,
    .tuning-lab-page .result-card header p,
    .tuning-lab-page .tune-summary span,
    .tuning-lab-page .diagnosis-card > p,
    .tuning-lab-page .mechanical-status small,
    .tuning-lab-page .diagnosis-phase {
        color: #555555;
    }

    .tuning-lab-page .tune-summary,
    .tuning-lab-page .results-grid,
    .tuning-lab-page .result-card,
    .tuning-lab-page .result-card > header,
    .tuning-lab-page .result-row,
    .tuning-lab-page .diagnosis-card {
        border-color: #bbbbbb;
    }

    .tuning-lab-page .diagnosis-card,
    .tuning-lab-page .result-card {
        break-inside: avoid;
    }

    .tuning-lab-page .results-grid {
        grid-template-columns: 1fr 1fr;
    }
}
