:root {
    --text: #222;
    --muted: #666;
    --accent: #2f3e4f;
    --accent-soft: #e9eef5;
}

html {
    scroll-behavior: smooth;
}

body {
    padding-top: 4px;
}

a,
a:visited {
    color: var(--text);
    text-decoration: none;
}

a.button,
a.button:visited {
    color: var(--text) !important;
}

button {
    color: var(--text);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--accent);
    z-index: 9999;
    transition: width .12s ease-out;
}

.share-action {
    width: 100%;
    border: none;
    cursor: pointer;
}

.vehicle a,
.vehicle a:visited {
    color: var(--text) !important;
}


/* =========================================
   DIAGNOSTIC REPORT CARD
   ========================================= */

.diagnostic-summary-card {
    border: 2px solid var(--accent);
}

.complete-label {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 14px;
}

.report-vehicle {
    font-size: 22px;
    font-weight: bold;
}

.report-engine {
    margin-top: 4px;
    font-size: 16px;
}

.report-meta {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

.report-result-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 16px;
}

.report-result {
    font-size: 24px;
    font-weight: bold;
    margin-top: 5px;
}

/* J5 mascot component */
.j5-mascot {
    width: 100%;
    max-width: 160px;
    margin: 16px auto;
    text-align: center;
}

.j5-mascot--medium {
    max-width: 240px;
}

.j5-mascot-image {
    display: block;
    width: 100%;
    height: auto;
}

.j5-mascot-caption {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* Calm, neutral driver questionnaires and reports. */
body.j5-driver-ui {
    --text: #25313c;
    --muted: #596573;
    --accent: #536078;
    --accent-soft: #edf0f5;
    background: #f3f5f7;
    color: var(--text);
    line-height: 1.55;
}

.j5-driver-ui .container {
    box-sizing: border-box;
    padding: 28px 16px 48px;
}

.j5-driver-ui h1 {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
    line-height: 1.25;
    margin: 8px 0 18px;
    text-align: center;
}

.j5-driver-ui .card {
    border: 1px solid #dde3e9;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 3px 12px rgba(37, 49, 60, .045);
}

.j5-driver-ui .question {
    font-size: 1.125rem;
    line-height: 1.45;
    margin-bottom: 12px;
}

.j5-driver-ui :is(.hint, .intro, .explanation, .reason, .note) {
    color: var(--muted);
    line-height: 1.55;
}

.j5-driver-ui .hint {
    font-size: .9rem;
}

.j5-driver-ui label:has(input:is([type="radio"], [type="checkbox"])) {
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    margin: 8px 0;
    min-height: 48px;
    border: 1px solid #cbd3dd;
    border-radius: 10px;
    background: #fafbfc;
    color: var(--text);
    font-weight: normal;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}

.j5-driver-ui label:has(input:checked) {
    border-color: #68758a;
    background: #edf0f5;
    box-shadow: inset 0 0 0 1px #68758a;
    font-weight: normal;
}

.j5-driver-ui input:is([type="radio"], [type="checkbox"]) {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.j5-driver-ui .yesno {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.j5-driver-ui .yesno label {
    flex: 1 1 100px;
}

.j5-driver-ui :is(button, a.button, input):focus-visible,
.j5-driver-ui label:has(input:focus-visible) {
    outline: 3px solid #675587;
    outline-offset: 3px;
}

.j5-driver-ui :is(button[type="submit"], .submit) {
    border: 1px solid #bbc9cc;
    border-radius: 12px;
    background: #e5efef;
    color: #25494c;
    line-height: 1.4;
}

.j5-driver-ui .diagnostic-summary-card {
    border-top: 3px solid #4d8588;
}

.j5-driver-ui .complete-label {
    color: #426c70;
}

.j5-driver-ui .report-result {
    color: #544365;
    font-size: clamp(1.3rem, 4.5vw, 1.5rem);
    line-height: 1.35;
}

.j5-driver-ui .report-result-label {
    color: #76566f;
}

.j5-driver-ui #saved-context h2 {
    font-size: 1.2rem;
    margin: 0 0 16px;
}

.j5-driver-ui #saved-context h3 {
    font-size: 1rem;
    margin: 20px 0 8px;
}

.j5-driver-ui .j5-mascot--medium {
    max-width: 200px;
    margin: 12px auto 20px;
}

@media (max-width: 420px) {
    .j5-driver-ui .container { padding: 20px 12px 36px; }
    .j5-driver-ui .card { padding: 18px; }
    .j5-driver-ui .yesno { flex-direction: column; gap: 0; }
    .j5-driver-ui .yesno label { flex: auto; }
    .j5-driver-ui .j5-mascot--medium { max-width: 176px; }
}

.j5-result-page .container {
    max-width: 680px;
    padding-top: 18px;
    padding-bottom: 32px;
}

.j5-result-page h1 {
    margin-bottom: 12px;
}

.j5-result-page .card {
    padding: 16px;
    margin-bottom: 12px;
}

.j5-result-page .diagnostic-summary-card {
    padding: 18px;
}

.j5-result-page .report-meta {
    padding-bottom: 10px;
}

.j5-result-page .report-result-label {
    margin-top: 10px;
}

.j5-result-page .result-direction ul {
    margin: 8px 0 0;
    padding-left: 22px;
}

.j5-result-page .result-direction li + li {
    margin-top: 8px;
}

.j5-result-page .result-direction p:last-child {
    margin-bottom: 0;
}

.j5-result-page .component-explainer {
    margin-top: 8px;
    font-size: .9rem;
}

.j5-result-page .component-explainer summary {
    color: #43516a;
    cursor: pointer;
    font-weight: 600;
    min-height: 28px;
    padding: 4px 0;
}

.j5-result-page .component-explainer p {
    margin: 6px 0 2px;
    color: var(--muted);
}

.j5-result-page .j5-reported-context {
    text-align: left;
}

.j5-result-page .reported-answer {
    margin-top: 10px;
}

.j5-result-page .result-explainers {
    margin: 0 0 12px;
}

.j5-result-page .result-explainers .component-explainer {
    margin: 0 0 8px;
}

.j5-result-page .result-guided-inspection p {
    margin: 6px 0 12px;
}

.j5-result-page .guided-inspection-button {
    width: auto;
    min-height: 42px;
    padding: 10px 16px;
    margin: 0;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.j5-result-page .result-utilities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 440px;
    margin: 20px auto 0;
}

.j5-result-page .result-utilities :is(a.button, button) {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 7px 10px;
    margin: 0;
    border: 1px solid var(--edge, #cbd3dd);
    border-radius: 9px;
    background: var(--inset, #f3f5f7);
    color: var(--text);
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 420px) {
    .j5-result-page .container {
        padding: 14px 10px 28px;
    }

    .j5-result-page .card,
    .j5-result-page .diagnostic-summary-card {
        padding: 15px;
        margin-bottom: 10px;
    }

    .j5-result-page .result-utilities {
        max-width: 360px;
        gap: 7px;
    }

    .j5-result-page .result-utilities :is(a.button, button) {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 13px;
    }
}
