:root {
    color-scheme: dark;

    --bg: #071018;
    --bg-secondary: #0b1621;

    --panel: #101d29;
    --panel-bright: #152637;
    --panel-hover: #1a3044;

    --line: #263b4d;
    --line-bright: #35546d;

    --text: #f4f8fb;
    --muted: #8fa6b8;
    --muted-dark: #637b8e;

    --blue: #2589ff;
    --blue-bright: #52a4ff;
    --blue-bg: rgba(37, 137, 255, 0.14);

    --yellow: #ffc83d;
    --yellow-bg: rgba(255, 200, 61, 0.14);

    --red: #ff4757;
    --red-bright: #ff6c78;
    --red-bg: rgba(255, 71, 87, 0.14);

    --gray: #687986;
    --gray-bright: #9aabb7;
    --gray-bg: rgba(104, 121, 134, 0.12);

    --green: #31d17c;

    --shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.32);
}


* {
    box-sizing: border-box;
}


html {
    min-height: 100%;

    background: var(--bg);
}


body {
    margin: 0;

    min-height: 100vh;

    color: var(--text);

    background:
        radial-gradient(
            circle at 15% -10%,
            rgba(37, 137, 255, 0.11),
            transparent 34%
        ),
        linear-gradient(
            180deg,
            #08121b 0%,
            var(--bg) 46%
        );

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing:
        antialiased;
}


button,
input {
    font: inherit;
}


button:focus-visible,
input:focus-visible {
    outline:
        2px solid
        var(--blue-bright);

    outline-offset: 3px;
}


.hidden {
    display: none !important;
}


/* ==========================================================
   APP
   ========================================================== */


.app-shell {
    width:
        min(
            1240px,
            calc(100% - 28px)
        );

    margin: 0 auto;

    padding:
        max(
            18px,
            env(safe-area-inset-top)
        )
        0
        max(
            42px,
            env(safe-area-inset-bottom)
        );
}


/* ==========================================================
   TOP BAR
   ========================================================== */


.topbar {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.brand-block {
    display: flex;

    align-items: center;

    gap: 12px;
}


.brand-mark {
    display: grid;

    place-items: center;

    width: 44px;
    height: 44px;

    border:
        1px solid
        rgba(82, 164, 255, 0.65);

    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            rgba(37, 137, 255, 0.30),
            rgba(37, 137, 255, 0.08)
        );

    box-shadow:
        0 10px 30px
        rgba(37, 137, 255, 0.12);

    color: white;

    font-weight: 850;
    font-size: 23px;
}


.brand-name {
    font-size: 21px;

    font-weight: 820;

    letter-spacing: -0.035em;
}


.brand-subtitle {
    margin-top: 1px;

    color: var(--muted);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 0.09em;
}


.topbar-status {
    display: flex;

    align-items: center;

    gap: 9px;
}


.connection-pill {
    display: inline-flex;

    align-items: center;

    min-height: 31px;

    padding: 0 12px;

    border:
        1px solid
        var(--line);

    border-radius: 999px;

    font-size: 11px;
    font-weight: 760;
}


.connection-live {
    border-color:
        rgba(49, 209, 124, 0.45);

    background:
        rgba(49, 209, 124, 0.10);

    color: var(--green);
}


.connection-waiting {
    color: var(--yellow);
}


.account-user {
    color: var(--muted);

    font-size: 11px;
}


.logout-form {
    margin: 0;
}


.logout-button {
    min-height: 31px;

    padding: 0 10px;

    border:
        1px solid
        var(--line);

    border-radius: 8px;

    background: transparent;

    color: var(--muted);

    cursor: pointer;

    font-size: 10px;
}


.logout-button:hover {
    border-color:
        var(--line-bright);

    color: var(--text);
}


.version-label {
    color: var(--muted-dark);

    font-size: 10px;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
}


/* ==========================================================
   VEHICLE HERO
   ========================================================== */


.vehicle-hero {
    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(360px, 0.9fr);

    gap: 20px;

    padding: 26px;

    border:
        1px solid
        var(--line-bright);

    border-radius: 20px;

    background:
        linear-gradient(
            140deg,
            rgba(21, 38, 55, 0.97),
            rgba(12, 24, 35, 0.98)
        );

    box-shadow: var(--shadow);
}


.vehicle-main {
    display: flex;

    flex-direction: column;

    justify-content: center;
}


.eyebrow {
    color: var(--blue-bright);

    font-size: 10px;

    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: 0.14em;
}


.vehicle-name {
    margin: 7px 0 0;

    font-size:
        clamp(
            27px,
            4vw,
            42px
        );

    line-height: 1.04;

    letter-spacing: -0.045em;
}


.vehicle-vin {
    margin-top: 11px;

    color: var(--muted);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 13px;
}


.vehicle-stat-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 9px;
}


.vehicle-stat {
    display: flex;

    flex-direction: column;

    justify-content: center;

    min-height: 105px;

    padding: 13px;

    border:
        1px solid
        var(--line);

    border-radius: 14px;

    background:
        rgba(5, 14, 22, 0.42);
}


.vehicle-stat-label {
    color: var(--muted);

    font-size: 9px;

    font-weight: 750;

    text-transform: uppercase;
}


.vehicle-stat-value {
    margin-top: 9px;

    font-size: 20px;

    font-weight: 770;
}


.vehicle-stat-small {
    font-size: 12px;

    line-height: 1.45;
}


/* ==========================================================
   ACTION PANEL
   ========================================================== */


.action-panel {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 18px;

    margin-top: 15px;

    padding: 15px;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    background:
        rgba(16, 29, 41, 0.90);
}


.action-left {
    display: flex;

    gap: 9px;
}


.primary-action,
.secondary-action,
.danger-action {
    min-height: 44px;

    padding: 0 17px;

    border-radius: 11px;

    cursor: pointer;

    font-weight: 780;
}


.primary-action {
    border:
        1px solid
        #3594ff;

    background:
        linear-gradient(
            180deg,
            #318fff,
            #1978e8
        );

    color: white;
}


.secondary-action {
    border:
        1px solid
        var(--line-bright);

    background:
        var(--panel-bright);

    color: var(--text);
}


.danger-action {
    border:
        1px solid
        rgba(255, 71, 87, 0.70);

    background:
        var(--red-bg);

    color:
        var(--red-bright);
}


button:disabled {
    cursor: not-allowed;

    opacity: 0.43;
}


.action-icon {
    margin-right: 7px;

    font-size: 18px;
}


.fault-summary {
    display: flex;

    align-items: center;

    gap: 14px;
}


.summary-item {
    display: flex;

    align-items: baseline;

    gap: 6px;
}


.summary-number {
    font-size: 21px;

    font-weight: 850;
}


.summary-red {
    color: var(--red);
}


.summary-yellow {
    color: var(--yellow);
}


.summary-blue {
    color: var(--blue-bright);
}


.summary-label {
    color: var(--muted);

    font-size: 11px;
}


.summary-divider {
    width: 1px;
    height: 28px;

    background: var(--line);
}


.command-note {
    margin-top: 8px;

    color: var(--muted-dark);

    font-size: 10px;

    text-align: right;
}


/* ==========================================================
   SECTIONS
   ========================================================== */


.section-block {
    margin-top: 31px;
}


.section-heading-row {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 13px;
}


.section-heading {
    margin: 4px 0 0;

    font-size: 20px;
}


.section-meta {
    color: var(--muted);

    font-size: 11px;
}


.legend {
    display: flex;

    flex-wrap: wrap;

    gap: 13px;
}


.legend-item {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color: var(--muted);

    font-size: 10px;
}


.legend-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;
}


.legend-dot.blue {
    background: var(--blue);
}


.legend-dot.yellow {
    background: var(--yellow);
}


.legend-dot.red {
    background: var(--red);
}


.legend-dot.gray {
    background: var(--gray);
}


/* ==========================================================
   MODULES
   ========================================================== */


.module-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 11px;
}


.module-tile {
    position: relative;

    overflow: hidden;

    min-height: 145px;

    padding: 15px;

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    background:
        var(--panel);

    color: var(--text);

    text-align: left;

    transition:
        transform 120ms ease,
        border-color 120ms ease,
        background 120ms ease;
}


button.module-tile {
    cursor: pointer;
}


button.module-tile:hover {
    transform:
        translateY(-2px);

    background:
        var(--panel-hover);
}


.module-tile::before {
    content: "";

    position: absolute;

    inset: 0 auto 0 0;

    width: 4px;
}


.state-blue::before {
    background: var(--blue);
}


.state-yellow::before {
    background: var(--yellow);
}


.state-red::before {
    background: var(--red);
}


.state-gray::before {
    background: var(--gray);
}


.state-blue {
    border-color:
        rgba(37, 137, 255, 0.45);
}


.state-yellow {
    border-color:
        rgba(255, 200, 61, 0.48);
}


.state-red {
    border-color:
        rgba(255, 71, 87, 0.55);
}


.state-gray {
    border-color:
        rgba(104, 121, 134, 0.46);
}


.unsupported-module {
    cursor: default;

    background:
        linear-gradient(
            145deg,
            rgba(104, 121, 134, 0.09),
            rgba(16, 29, 41, 0.72)
        );
}


.unsupported-module .module-display-name,
.unsupported-module .module-footer {
    color: var(--gray-bright);
}


.module-tile-top {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 8px;
}


.module-chip {
    display: grid;

    place-items: center;

    width: 40px;
    height: 40px;

    border-radius: 12px;

    font-size: 10px;

    font-weight: 900;
}


.state-blue .module-chip {
    background: var(--blue-bg);

    color: var(--blue-bright);
}


.state-yellow .module-chip {
    background: var(--yellow-bg);

    color: var(--yellow);
}


.state-red .module-chip {
    background: var(--red-bg);

    color: var(--red-bright);
}


.state-gray .module-chip {
    background: var(--gray-bg);

    color: var(--gray-bright);
}


.module-fault-count {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 28px;
    height: 25px;

    padding: 0 8px;

    border:
        1px solid
        var(--line);

    border-radius: 999px;

    font-size: 10px;
}


.unsupported-badge {
    padding: 5px 7px;

    border:
        1px solid
        rgba(154, 171, 183, 0.32);

    border-radius: 999px;

    color: var(--gray-bright);

    font-size: 8px;

    font-weight: 850;

    letter-spacing: 0.05em;
}


.module-short-name {
    margin-top: 17px;

    font-size: 18px;

    font-weight: 850;
}


.module-display-name {
    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;

    line-height: 1.4;
}


.module-footer {
    display: flex;

    justify-content: space-between;

    margin-top: 13px;

    color: var(--muted-dark);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 9px;
}


/* ==========================================================
   QUICK DTC
   ========================================================== */


.quick-dtc-list {
    display: grid;

    gap: 8px;
}


.quick-dtc-row {
    display: grid;

    grid-template-columns:
        72px
        100px
        minmax(0, 1fr)
        auto;

    gap: 13px;

    align-items: center;

    min-height: 62px;

    padding: 10px 14px;

    border:
        1px solid
        var(--line);

    border-radius: 13px;

    background: var(--panel);
}


.quick-dtc-module {
    color: var(--muted);

    font-size: 11px;

    font-weight: 800;
}


.quick-dtc-code {
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 16px;

    font-weight: 850;
}


.quick-dtc-definition {
    font-size: 12px;
}


.quick-dtc-definition.unverified {
    color: var(--muted);
}


.status-badge {
    display: inline-flex;

    align-items: center;

    min-height: 25px;

    padding: 0 9px;

    border-radius: 999px;

    font-size: 9px;

    font-weight: 850;

    text-transform: uppercase;
}


.status-active {
    border:
        1px solid
        rgba(255, 71, 87, 0.45);

    background: var(--red-bg);

    color: var(--red-bright);
}


.status-stored {
    border:
        1px solid
        rgba(255, 200, 61, 0.42);

    background: var(--yellow-bg);

    color: var(--yellow);
}


.empty-card {
    grid-column: 1 / -1;

    padding: 24px;

    border:
        1px dashed
        var(--line);

    border-radius: 14px;

    color: var(--muted);

    text-align: center;

    font-size: 12px;
}


.engineering-note {
    margin-top: 30px;

    padding: 14px 16px;

    border:
        1px solid
        rgba(53, 84, 109, 0.55);

    border-radius: 13px;

    background:
        rgba(10, 22, 32, 0.70);

    color: var(--muted);

    font-size: 10px;

    line-height: 1.6;
}


/* ==========================================================
   MODALS
   ========================================================== */


.modal-backdrop {
    position: fixed;

    z-index: 1000;

    inset: 0;

    display: grid;

    place-items: center;

    padding: 18px;

    background:
        rgba(1, 6, 10, 0.82);

    backdrop-filter: blur(8px);
}


.module-modal {
    width:
        min(
            920px,
            100%
        );

    max-height:
        min(
            820px,
            calc(100vh - 34px)
        );

    overflow: auto;

    border:
        1px solid
        var(--line-bright);

    border-radius: 20px;

    background: #0d1924;

    box-shadow:
        0 30px 100px
        rgba(0, 0, 0, 0.55);
}


.modal-header {
    display: flex;

    justify-content: space-between;

    padding: 20px 22px 15px;

    border-bottom:
        1px solid
        var(--line);
}


.modal-module-short {
    color: var(--blue-bright);

    font-size: 10px;

    font-weight: 900;
}


.modal-title {
    margin: 4px 0 0;
}


.modal-subtitle {
    margin-top: 5px;

    color: var(--muted);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 10px;
}


.modal-close {
    width: 38px;
    height: 38px;

    border:
        1px solid
        var(--line);

    border-radius: 10px;

    background: var(--panel);

    color: var(--text);

    cursor: pointer;

    font-size: 24px;
}


.module-tabs {
    display: flex;

    gap: 5px;

    padding: 10px 13px;

    overflow-x: auto;

    border-bottom:
        1px solid
        var(--line);
}


.module-tab {
    flex: 0 0 auto;

    min-height: 36px;

    padding: 0 12px;

    border:
        1px solid
        transparent;

    border-radius: 9px;

    background: transparent;

    color: var(--muted);

    cursor: pointer;

    font-size: 10px;
}


.module-tab.active {
    border-color:
        rgba(37, 137, 255, 0.42);

    background: var(--blue-bg);

    color: var(--blue-bright);
}


.module-tab-content {
    min-height: 350px;

    padding: 20px;
}


.workspace-toolbar {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 14px;
}


.workspace-description {
    color: var(--muted);

    font-size: 11px;
}


.workspace-dtc-list {
    display: grid;

    gap: 10px;
}


.workspace-dtc {
    border:
        1px solid
        var(--line);

    border-radius: 13px;

    background: var(--panel);
}


.workspace-dtc.active-dtc {
    border-color:
        rgba(255, 71, 87, 0.48);
}


.workspace-dtc-main {
    display: grid;

    grid-template-columns:
        105px
        minmax(0, 1fr)
        auto;

    gap: 12px;

    align-items: center;

    padding: 14px;
}


.workspace-code {
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 18px;

    font-weight: 900;
}


.workspace-definition {
    font-size: 12px;
}


.workspace-definition-note {
    margin-top: 3px;

    color: var(--muted-dark);

    font-size: 9px;
}


.dtc-details {
    border-top:
        1px solid
        var(--line);
}


.dtc-details summary {
    padding: 11px 14px;

    color: var(--blue-bright);

    cursor: pointer;

    font-size: 10px;
}


.detail-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 9px;

    padding:
        0 14px 14px;
}


.detail-item {
    padding: 10px;

    border:
        1px solid
        var(--line);

    border-radius: 9px;

    background:
        rgba(4, 12, 18, 0.40);
}


.detail-label {
    color: var(--muted-dark);

    font-size: 8px;

    text-transform: uppercase;
}


.detail-value {
    margin-top: 5px;

    overflow-wrap: anywhere;

    font-size: 10px;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
}


.live-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 10px;
}


.live-value-card {
    min-height: 104px;

    padding: 13px;

    border:
        1px solid
        var(--line);

    border-radius: 12px;

    background: var(--panel);
}


.live-label {
    color: var(--muted);

    font-size: 9px;
}


.live-value {
    margin-top: 8px;

    font-size: 23px;

    font-weight: 850;
}


.live-raw {
    margin-top: 6px;

    color: var(--muted-dark);

    font-size: 8px;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
}


.capability-empty {
    display: grid;

    place-items: center;

    min-height: 300px;

    border:
        1px dashed
        var(--line);

    border-radius: 14px;

    text-align: center;
}


.capability-empty-title {
    font-size: 17px;

    font-weight: 800;
}


.capability-empty-text {
    max-width: 540px;

    margin-top: 8px;

    color: var(--muted);

    font-size: 11px;
}


.raw-block {
    margin: 0;

    padding: 15px;

    overflow: auto;

    border:
        1px solid
        var(--line);

    border-radius: 12px;

    background: #061019;

    color: #b9d6ea;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 9px;
}


.confirm-dialog {
    width:
        min(
            500px,
            100%
        );

    padding: 25px;

    border:
        1px solid
        rgba(255, 71, 87, 0.50);

    border-radius: 18px;

    background: #111a23;
}


.confirm-icon {
    display: grid;

    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: var(--red-bg);

    color: var(--red);

    font-size: 24px;

    font-weight: 900;
}


.confirm-actions {
    display: flex;

    justify-content: flex-end;

    gap: 9px;

    margin-top: 20px;
}


.confirm-warning {
    padding: 13px;

    border:
        1px solid
        var(--line);

    border-radius: 11px;

    color: var(--muted);

    font-size: 10px;
}


/* ==========================================================
   LOGIN
   ========================================================== */


.login-body {
    overflow: hidden;

    background:
        #03090f;
}


.login-tech-background {
    position: fixed;

    inset: 0;

    overflow: hidden;

    pointer-events: none;
}


.tech-grid {
    position: absolute;

    inset: -30%;

    background-image:
        linear-gradient(
            rgba(37, 137, 255, 0.09) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(37, 137, 255, 0.09) 1px,
            transparent 1px
        );

    background-size:
        48px 48px;

    transform:
        perspective(500px)
        rotateX(62deg)
        translateY(22%);

    animation:
        gridMove 9s linear infinite;
}


@keyframes gridMove {
    from {
        background-position:
            0 0,
            0 0;
    }

    to {
        background-position:
            0 48px,
            48px 0;
    }
}


.scan-beam {
    position: absolute;

    left: -20%;
    right: -20%;

    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(82, 164, 255, 0.95),
            transparent
        );

    box-shadow:
        0 0 28px
        rgba(37, 137, 255, 0.65);

    animation:
        scanBeam 5.5s
        ease-in-out
        infinite;
}


@keyframes scanBeam {
    0% {
        top: -5%;

        opacity: 0;
    }

    15% {
        opacity: 0.9;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        top: 105%;

        opacity: 0;
    }
}


.tech-orb {
    position: absolute;

    border-radius: 50%;

    filter: blur(1px);

    animation:
        orbPulse 7s
        ease-in-out
        infinite alternate;
}


.orb-one {
    top: 14%;
    left: 10%;

    width: 260px;
    height: 260px;

    background:
        radial-gradient(
            circle,
            rgba(37, 137, 255, 0.14),
            transparent 70%
        );
}


.orb-two {
    right: 5%;
    bottom: 8%;

    width: 420px;
    height: 420px;

    background:
        radial-gradient(
            circle,
            rgba(38, 188, 255, 0.09),
            transparent 70%
        );

    animation-delay: -3s;
}


.orb-three {
    top: 55%;
    left: 38%;

    width: 180px;
    height: 180px;

    background:
        radial-gradient(
            circle,
            rgba(37, 137, 255, 0.10),
            transparent 70%
        );

    animation-delay: -5s;
}


@keyframes orbPulse {
    from {
        transform: scale(0.85);

        opacity: 0.45;
    }

    to {
        transform: scale(1.18);

        opacity: 1;
    }
}


.circuit-node {
    position: absolute;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--blue-bright);

    box-shadow:
        0 0 18px
        rgba(82, 164, 255, 0.9);

    animation:
        nodePulse 2.6s
        ease-in-out
        infinite;
}


.node-1 {
    top: 17%;
    left: 22%;
}


.node-2 {
    top: 33%;
    right: 17%;

    animation-delay: -0.7s;
}


.node-3 {
    bottom: 21%;
    left: 15%;

    animation-delay: -1.2s;
}


.node-4 {
    bottom: 12%;
    right: 29%;

    animation-delay: -1.8s;
}


.node-5 {
    top: 11%;
    right: 39%;

    animation-delay: -2.1s;
}


.node-6 {
    top: 68%;
    left: 62%;

    animation-delay: -2.4s;
}


@keyframes nodePulse {
    0%,
    100% {
        transform: scale(0.75);

        opacity: 0.35;
    }

    50% {
        transform: scale(1.5);

        opacity: 1;
    }
}


.login-shell {
    position: relative;

    z-index: 10;

    display: grid;

    place-items: center;

    min-height: 100vh;

    padding: 20px;
}


.login-card {
    width:
        min(
            410px,
            100%
        );

    padding: 32px;

    border:
        1px solid
        rgba(82, 164, 255, 0.34);

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(16, 29, 41, 0.94),
            rgba(7, 16, 24, 0.94)
        );

    box-shadow:
        0 30px 90px
        rgba(0, 0, 0, 0.62),
        0 0 70px
        rgba(37, 137, 255, 0.08);

    backdrop-filter: blur(18px);
}


.login-logo {
    display: grid;

    place-items: center;

    width: 58px;
    height: 58px;

    margin-bottom: 23px;

    border:
        1px solid
        rgba(82, 164, 255, 0.65);

    border-radius: 16px;

    background: var(--blue-bg);

    color: white;

    font-size: 30px;

    font-weight: 900;

    box-shadow:
        0 0 30px
        rgba(37, 137, 255, 0.18);
}


.login-eyebrow {
    color: var(--blue-bright);

    font-size: 9px;

    font-weight: 850;

    letter-spacing: 0.16em;
}


.login-title {
    margin: 5px 0 0;

    font-size: 34px;

    letter-spacing: -0.045em;
}


.login-subtitle {
    margin: 7px 0 24px;

    color: var(--muted);

    font-size: 12px;
}


.login-error {
    margin-bottom: 16px;

    padding: 11px 12px;

    border:
        1px solid
        rgba(255, 71, 87, 0.42);

    border-radius: 10px;

    background: var(--red-bg);

    color: var(--red-bright);

    font-size: 11px;
}


.login-form {
    display: grid;

    gap: 14px;
}


.login-field {
    display: grid;

    gap: 6px;
}


.login-field span {
    color: var(--muted);

    font-size: 10px;

    font-weight: 700;
}


.login-field input {
    width: 100%;

    min-height: 46px;

    padding: 0 13px;

    border:
        1px solid
        var(--line);

    border-radius: 10px;

    outline: none;

    background:
        rgba(4, 12, 18, 0.78);

    color: var(--text);

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}


.login-field input:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 3px
        rgba(37, 137, 255, 0.10);
}


.remember-row {
    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 10px;
}


.remember-row input {
    accent-color:
        var(--blue);
}


.login-button {
    min-height: 48px;

    margin-top: 4px;

    border:
        1px solid
        #3594ff;

    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #318fff,
            #1978e8
        );

    color: white;

    cursor: pointer;

    font-weight: 800;

    box-shadow:
        0 10px 28px
        rgba(37, 137, 255, 0.20);
}


.login-button:hover {
    filter: brightness(1.08);
}


.login-footer {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    margin-top: 24px;

    color: var(--muted-dark);

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


.login-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 10px
        rgba(49, 209, 124, 0.55);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */


@media (
    max-width: 980px
) {
    .vehicle-hero {
        grid-template-columns: 1fr;
    }


    .module-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }
}


@media (
    max-width: 720px
) {
    .app-shell {
        width:
            min(
                100% - 18px,
                1240px
            );
    }


    .topbar {
        align-items: flex-start;
    }


    .account-user,
    .version-label {
        display: none;
    }


    .vehicle-hero {
        padding: 18px;
    }


    .action-panel {
        align-items: stretch;

        flex-direction: column;
    }


    .action-left {
        display: grid;

        grid-template-columns:
            1fr 1fr;
    }


    .fault-summary {
        justify-content:
            space-between;
    }


    .section-heading-row {
        align-items: flex-start;

        flex-direction: column;
    }


    .module-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .quick-dtc-row {
        grid-template-columns:
            60px
            83px
            1fr;
    }


    .quick-dtc-row
    .status-badge {
        grid-column: 1 / -1;

        justify-self: start;
    }


    .detail-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .live-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}


@media (
    max-width: 470px
) {
    .vehicle-stat-grid {
        grid-template-columns:
            1fr 1fr;
    }


    .vehicle-stat:last-child {
        grid-column: 1 / -1;
    }


    .module-grid {
        grid-template-columns:
            1fr 1fr;
    }


    .login-card {
        padding: 25px 20px;
    }


    .workspace-dtc-main {
        grid-template-columns:
            86px 1fr;
    }


    .workspace-dtc-main
    .status-badge {
        grid-column: 1 / -1;

        justify-self: start;
    }


    .detail-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   v0.60 additions
   ============================================================ */

.scanner-status {
    margin-top: 16px;
    max-width: 560px;
}

.scanner-status-text {
    color: var(--muted);
    font-size: 13px;
}

.scanner-status.online .scanner-status-text {
    color: var(--text);
}

.scanner-status.offline .scanner-status-text {
    color: var(--muted-dark);
}

.scan-progress {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: var(--panel-bright);
    overflow: hidden;
}

.scan-progress-bar {
    height: 100%;
    width: 0;
    background: var(--blue);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.scanner-status.scanning .scan-progress-bar {
    background: linear-gradient(90deg, var(--blue), var(--blue-bright));
}

.evidence-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid var(--line-bright);
    border-radius: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    vertical-align: middle;
    cursor: help;
}

.source-badge {
    display: inline-block;
    margin-left: 8px;
    color: var(--muted-dark);
    font-size: 11px;
    white-space: nowrap;
}

.status-pending {
    color: var(--yellow);
    background: var(--yellow-bg);
    border-color: rgba(255, 200, 61, 0.35);
}

.identity-summary {
    margin-bottom: 18px;
}

.identity-table {
    display: grid;
    gap: 6px;
}

.identity-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.identity-label {
    color: var(--muted);
    font-size: 13px;
}

.identity-id {
    margin-left: 8px;
    color: var(--muted-dark);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
}

.identity-value {
    font-family: ui-monospace, Consolas, monospace;
    word-break: break-all;
}

.identity-value.muted {
    color: var(--muted-dark);
    font-family: inherit;
}

@media (max-width: 640px) {
    .identity-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* ============================================================
   LIVE DATA (v0.61)
   ============================================================ */

.live-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ghost-action {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 14px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ghost-action:hover {
    border-color: var(--line-bright);
    color: var(--text);
}

.live-status {
    margin: -4px 0 12px;
    font-size: 12px;
}

.live-pick-wrap {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}

.live-pick-wrap summary {
    cursor: pointer;
}

.live-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.live-pick label {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
}

.live-pick input {
    margin-right: 5px;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
}

.live-tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}

.live-tile.unsupported {
    opacity: 0.45;
}

.live-tile .live-name {
    color: var(--muted);
    font-size: 12px;
    min-height: 32px;
}

.live-tile .live-value {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 28px;
    font-weight: 800;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.live-tile .live-unit {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
}

.live-tile .live-ecu {
    color: var(--muted-dark);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 10px;
    margin-top: 4px;
}

@media (max-width: 980px) {
    .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .live-controls { width: 100%; }
    .live-controls button { flex: 1; }
}

.module-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.module-live-snapshot-title {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    margin: 22px 0 10px;
}

#module-tab-content .live-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
    #module-tab-content .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .module-live-head { flex-direction: column; align-items: stretch; }
}
