:root {
    --bg: #071225;
    --surface: #121d36;
    --surface-strong: #0a1326;
    --surface-hover: #172542;
    --primary: #3b82f6;
    --primary-rgb: 59,130,246;
    --success: #22c55e;
    --text: #ffffff;
    --text-muted: #9fb4d3;
    --border: rgba(255,255,255,.08);
    --soft: rgba(255,255,255,.05);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top left, rgba(var(--primary-rgb), .18), transparent 34%),
                linear-gradient(135deg, #061025, #071225 48%, #09162d);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

.portal-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.portal-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.portal-card {
    background: rgba(18, 29, 54, .92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.portal-login-card {
    width: min(460px, 100%);
    padding: 30px;
}

.portal-logo {
    display: grid;
    place-items: center;
    margin-bottom: 22px;
}

.portal-logo img {
    width: 220px;
    max-width: 72%;
    height: auto;
}

.portal-eyebrow {
    margin: 0 0 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.portal-workshop-label { color: var(--text-muted); font-weight: 500; }
.portal-workshop-name { color: var(--text); font-weight: 700; }

.portal-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

.portal-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.portal-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.portal-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.portal-input {
    width: 100%;
    height: 52px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 13px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 15px;
    font: inherit;
    font-weight: 750;
    outline: none;
}

.portal-input:focus {
    border-color: rgba(var(--primary-rgb), .86);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}

.portal-input.uppercase {
    text-transform: uppercase;
}

.portal-button {
    min-height: 48px;
    border: 1px solid rgba(var(--primary-rgb), .55);
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    padding: 0 18px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
}

.portal-button.secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.portal-back-button {
    min-height: 46px;
    padding: 0 16px 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(var(--primary-rgb), .35);
    background: rgba(var(--primary-rgb), .08);
    color: #dbeafe;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    text-decoration: none;
    font-weight: 900;
    transition: border-color .2s ease, background .2s ease;
}

.portal-back-button:hover {
    border-color: rgba(var(--primary-rgb), .85);
    background: rgba(var(--primary-rgb), .14);
}

.portal-back-button span {
    width: 14px;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px);
}

.portal-alert {
    padding: 13px 14px;
    border-radius: 13px;
    margin: 18px 0 0;
    background: rgba(239, 68, 68, .14);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, .28);
    font-weight: 750;
}

.portal-alert.success {
    background: rgba(34, 197, 94, .12);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, .28);
}

.portal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 40px;
}

.portal-brand {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    gap: 16px;
    text-decoration: none;
}

.portal-brand img {
    width: 168px;
    height: auto;
}

.portal-brand-logos { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-height: 168px; }
.portal-pitlogic-logo { position: relative; display: block; width: 106px; aspect-ratio: 2 / 1; overflow: hidden; flex-shrink: 0; }
.portal-brand .portal-pitlogic-logo img { position: absolute; width: 158.515%; max-width: none; height: auto; left: -29.722%; top: -100.62%; }
.portal-brand-cross { position: relative; display: block; width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-muted); font-size: 0; }
.portal-brand-cross::before,.portal-brand-cross::after { content: ''; position: absolute; top: 50%; left: 50%; width: 13px; height: 1.5px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.portal-brand-cross::after { transform: translate(-50%, -50%) rotate(-45deg); }
.portal-brand-logos .portal-workshop-logo { width: 123px; max-height: 74px; object-fit: contain; border-radius: 5px; }

.portal-brand-copy {
    display: grid;
    gap: 3px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.portal-brand-copy strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.1;
}

.portal-brand-copy span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.portal-brand-copyright { color: var(--text-muted); font-size: 11px; font-weight: 500; line-height: 1.4; }

.portal-token {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
}

.portal-hero {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 18px;
    margin-bottom: 18px;
}

.portal-hero-main,
.portal-stat {
    padding: 22px;
}


.portal-hero-main { display: flex; flex-direction: column; }
.portal-workshop-contact { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-top: auto; padding-top: 18px; }
.portal-contact-label { color: var(--text-muted); font-size: 12px; margin-right: auto; }
.portal-contact-link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: rgba(255,255,255,.035); font-size: 12px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; transition: border-color .2s ease, background .2s ease; }
.portal-contact-link svg { flex-shrink: 0; }
.portal-contact-link:hover { border-color: rgba(var(--primary-rgb), .65); background: rgba(var(--primary-rgb), .1); }
.portal-contact-link:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
@media(max-width: 600px) { .portal-contact-label { flex-basis: 100%; } }

.portal-stats {
    display: grid;
    gap: 12px;
}

.portal-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 86px;
}

.portal-stat-link {
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}

.portal-stat-link:hover {
    border-color: rgba(var(--primary-rgb), .75);
    background: var(--surface-hover);
}

.portal-stat strong {
    display: block;
    font-size: 28px;
}

.portal-stat span {
    color: var(--text-muted);
    font-weight: 750;
}

.portal-section {
    padding: 20px;
    margin-top: 18px;
}

.portal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.portal-section h2 {
    margin: 0;
    font-size: 21px;
}

.portal-storage-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(var(--primary-rgb), .18);
    border-radius: 16px;
    background: rgba(7,18,37,.48);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}

.portal-storage-summary:hover {
    border-color: rgba(var(--primary-rgb), .68);
    background: rgba(23,37,66,.52);
}

.portal-storage-overview-head,
.portal-storage-overview-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-storage-overview-link {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), .35);
    background: rgba(var(--primary-rgb), .08);
    color: #bfdbfe;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.portal-storage-overview-link span {
    font-size: 18px;
    line-height: 1;
}

.portal-storage-overview-list {
    display: grid;
    gap: 8px;
}

.portal-storage-overview-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 13px;
    background: rgba(2,8,23,.38);
}

.portal-storage-overview-main > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.portal-storage-overview-main strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-storage-overview-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 850;
}

.portal-storage-overview-card .portal-storage-status {
    flex: 0 0 auto;
    justify-self: end;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

.portal-storage-overview-charge {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(64px, 1fr) auto;
    align-items: center;
    gap: 9px;
}

.portal-storage-overview-charge > span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.portal-storage-overview-charge .portal-storage-voltage {
    height: 8px;
}

.portal-storage-overview-charge .portal-storage-charge-graph {
    display: none;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 14px;
}

.portal-vehicle-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}

.portal-vehicle-card:hover {
    border-color: rgba(var(--primary-rgb), .85);
    background: var(--surface-hover);
}

.portal-vehicle-head {
    min-width: 0;
    padding-right: 80px;
}

.portal-vehicle-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
}

.portal-vehicle-logo {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #e5e7eb;
    border: 1px solid #b8bec7;
    overflow: hidden;
}

.portal-vehicle-logo img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--emblem-width, 76%);
    height: var(--emblem-height, 76%);
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform: translate(var(--emblem-x, -50%), var(--emblem-y, -50%));
}

.portal-plate {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,.18);
    width: fit-content;
    font-weight: 900;
    letter-spacing: .04em;
}

.portal-plate span:first-child {
    background: var(--primary);
    color: #fff;
    padding: 0 7px;
    font-size: 11px;
    display: grid;
    place-items: center;
}

.portal-plate span:last-child {
    background: #fff;
    color: #111827;
    padding: 4px 10px;
    display: grid;
    place-items: center;
}

.portal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.portal-vehicle-facts {
    margin-top: 16px;
    align-items: center;
}

.portal-fact {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border-radius: 9px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
    color: var(--text-muted);
}

.portal-fact strong {
    color: var(--text);
}

.vehicle-detail-hero {
    display: block;
    padding: 22px;
    margin-bottom: 18px;
}

.vehicle-detail-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.vehicle-detail-title-row .portal-vehicle-logo {
    position: relative;
    top: auto;
    right: auto;
    width: 82px;
    height: 82px;
    flex: 0 0 auto;
}

.portal-history {
    display: grid;
    gap: 12px;
}

.portal-history-item {
    position: relative;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 15px;
}

.portal-history-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.portal-history-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.portal-history-top>div:first-child { min-width: 0; width: 100%; }
.portal-history-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; }
.portal-history-heading .portal-history-title { overflow-wrap: anywhere; }
.portal-history-invoice { color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.45); transition: color .2s ease, text-decoration-color .2s ease; }
.portal-history-invoice:hover { color: #93c5fd; text-decoration-color: currentColor; }
.portal-history-invoice:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: 3px; }
.portal-history-invoice svg { display: none; flex-shrink: 0; }
.portal-history-total > span { color: var(--text-muted); font-size: 13px; }
.portal-history-total .portal-price { color: var(--text); font-size: 18px; line-height: 1.2; text-align: right; }
.portal-vehicle-history .portal-section-head { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }

.portal-job-images-button {
    min-height: 36px;
    border: 1px solid rgba(var(--primary-rgb), .34);
    background: rgba(var(--primary-rgb), .08);
    color: #bfdbfe;
    border-radius: 11px;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.portal-history-has-media .portal-history-top { padding-right: 194px; }
.portal-history-total .portal-job-images-button { position: absolute; top: 15px; right: 15px; }

@media(min-width: 601px) {
    .portal-history-invoice { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; background: rgba(255,255,255,.06); font-size: 12px; text-decoration: none; transition: background .2s ease, border-color .2s ease; }
    .portal-history-invoice svg { display: block; }
    .portal-history-invoice:hover { color: var(--text); border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.11); }
    .portal-history-invoice:focus-visible { border-radius: 11px; }
    .portal-history-has-media:has(.portal-history-invoice):not(:has(.portal-note)) .portal-history-top { min-height: 80px; }
    .portal-history-has-media .portal-note { padding-right: 194px; min-height: 32px; }
    .portal-history-has-media .portal-history-invoice { position: absolute; top: 15px; right: 15px; }
    .portal-history-has-media .portal-history-invoice,.portal-history-has-media .portal-job-images-button { width: 178px; box-sizing: border-box; justify-content: center; }
    .portal-history-has-media .portal-job-images-button { min-height: 36px; padding: 0 9px; gap: 6px; font-size: 12px; border-radius: 9px; }
    .portal-history-invoice svg,.portal-history-has-media .portal-job-images-button svg { width: 16px; height: 16px; }
    .portal-history-has-media .portal-job-images-count { min-width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
    .portal-history-has-media:has(.portal-history-invoice) .portal-job-images-button { top: 59px; }
}

.portal-job-images-button:hover {
    border-color: rgba(var(--primary-rgb), .82);
    background: rgba(var(--primary-rgb), .15);
}

.portal-job-images-count {
    min-width: 22px;
    height: 22px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(var(--primary-rgb), .18);
    color: var(--text);
    font-size: 12px;
}

.portal-download-button.portal-request-button {
    width: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
    white-space: nowrap;
}

.portal-job-images-button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.portal-download-button svg,.portal-job-images-button svg { flex-shrink: 0; }

.portal-history-title {
    margin: 0;
    font-size: 16px;
}

.portal-price {
    font-weight: 900;
    color: #60a5fa;
    white-space: nowrap;
}

.portal-note {
    color: var(--text-muted);
    line-height: 1.45;
    margin: 8px 0 0;
}

.portal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.portal-image-card {
    border: 0;
    border-radius: 15px;
    background: var(--surface-strong);
    padding: 0;
    overflow: hidden;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.07);
    transition: border-color .2s ease, background .2s ease;
}

.portal-image-card:hover {
    border-color: rgba(var(--primary-rgb), .75);
    background: var(--surface-hover);
}

.portal-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.portal-video-thumb {
    display:grid;
    place-content:center;
    justify-items:center;
    gap:10px;
    width:100%;
    aspect-ratio:4 / 3;
    background:var(--surface);
    color:var(--text);
}
.portal-video-thumb > span{font-size:36px;color:var(--primary)}
.portal-video-thumb strong{font-size:14px}

.portal-image-caption {
    display: grid;
    gap: 3px;
    min-height: 54px;
    padding: 9px 10px 10px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.25;
}

.portal-image-caption strong,
.portal-image-caption small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-image-caption strong {
    color: var(--text);
    font-size: 13px;
}

.portal-image-caption small {
    color: var(--text-muted);
}

.portal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(12px);
}

.portal-lightbox.open {
    display: grid;
}

.portal-lightbox img {
    max-width: min(100%, 1100px);
    max-height: 82vh;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.portal-lightbox [hidden]{display:none!important}
.portal-lightbox-media{display:grid;justify-items:center;gap:12px;max-width:100%;min-width:0}
.portal-lightbox video{display:block;width:min(100%,1100px);max-height:calc(100dvh - 220px);border-radius:14px;background:#000}
.portal-lightbox-media p{max-width:520px;padding:12px;color:#fff;background:#17233a;border-radius:10px;text-align:center}
.portal-media-download{color:#fff;background:#17233a;border:1px solid var(--border);padding:10px 16px;border-radius:10px;text-decoration:none}

.portal-lightbox-close {
    position: fixed;
    top: 22px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 26px;
    cursor: pointer;
}

.portal-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 72px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(18, 29, 54, .78);
    color: var(--text);
    font-size: 50px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding-bottom: 7px;
}

.portal-lightbox-nav:hover {
    border-color: rgba(var(--primary-rgb), .8);
    background: rgba(18, 29, 54, .96);
}

.portal-lightbox-nav.prev {
    left: 24px;
}

.portal-lightbox-nav.next {
    right: 24px;
}

.portal-lightbox-caption {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    max-width: min(760px, calc(100% - 32px));
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(18, 29, 54, .88);
    border: 1px solid var(--border);
    color: var(--text);
    white-space: pre-line;
    text-align: center;
    font-weight: 750;
}

.portal-empty {
    margin: 0;
    padding: 18px;
    border-radius: 15px;
    background: var(--surface-strong);
    color: var(--text-muted);
}

.portal-storage-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.portal-storage-list {
    display: grid;
    gap: 14px;
}

.portal-storage-card {
    display: grid;
    gap: 16px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-strong);
}

.portal-storage-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.portal-storage-main h3 {
    margin: 0 0 8px;
    font-size: 19px;
}

.portal-storage-status {
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), .3);
    background: rgba(var(--primary-rgb), .12);
    color: #93c5fd;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
}

.portal-storage-status.is-green { color: #86efac; border-color: rgba(34,197,94,.34); background: rgba(34,197,94,.11); }
.portal-storage-status.is-cyan { color: #67e8f9; border-color: rgba(6,182,212,.34); background: rgba(6,182,212,.11); }
.portal-storage-status.is-purple { color: #d8b4fe; border-color: rgba(168,85,247,.34); background: rgba(168,85,247,.11); }
.portal-storage-status.is-red { color: #fecaca; border-color: rgba(239,68,68,.34); background: rgba(239,68,68,.11); }
.portal-storage-status.is-muted { color: var(--text-muted); border-color: var(--border); background: rgba(255,255,255,.04); }

.portal-storage-battery {
    display: grid;
    gap: 8px;
}

.portal-storage-battery-head,
.portal-storage-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.portal-storage-battery-head strong {
    color: var(--text);
    font-size: 14px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
}

.portal-storage-battery-head span,
.portal-storage-scale small {
    color: var(--text-muted);
    font-weight: 900;
}

.portal-storage-battery-head span {
    font-size: 13px;
    flex-shrink: 0;
}

.portal-storage-battery-head strong em {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 750;
}

.portal-storage-scale small {
    font-size: 11px;
}

.portal-storage-voltage {
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), .2);
    background: linear-gradient(180deg, rgba(15,23,42,.88), rgba(2,8,23,.82));
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.42);
}

.portal-storage-voltage span {
    display: block;
    width: var(--voltage, 0%);
    height: 100%;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #2563eb 0%, var(--primary) 48%, #22c55e 100%);
    box-shadow: 0 0 18px rgba(var(--primary-rgb), .26);
}

.portal-storage-voltage.is-charging span::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -42px;
    width: 38px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent);
    filter: blur(.2px);
    animation: portalStorageChargeSweep 1.65s ease-in-out infinite;
}

@keyframes portalStorageChargeSweep {
    from { left: -42px; opacity: 0; }
    18% { opacity: 1; }
    82% { opacity: 1; }
    to { left: 100%; opacity: 0; }
}

.portal-storage-charge-graph {
    height: 48px;
    padding: 7px;
    border: 1px solid rgba(var(--primary-rgb), .14);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(var(--primary-rgb), .065), transparent),
        rgba(2,8,23,.28);
    overflow: hidden;
}

.portal-storage-charge-graph svg {
    width: 100%;
    height: 100%;
    display: block;
}

.portal-storage-charge-graph polyline {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 6px rgba(34,197,94,.4));
}

.portal-storage-charge-graph polygon {
    fill: rgba(34,197,94,.11);
}

.portal-storage-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.portal-storage-dates span {
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
    background: rgba(255,255,255,.035);
    display: grid;
    align-content: center;
    gap: 3px;
}

.portal-storage-dates small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-storage-dates strong {
    color: var(--text);
    font-size: 14px;
}

@media (max-width: 760px) {
    .portal-shell {
        width: min(100% - 20px, 1160px);
        padding: 18px 0 34px;
    }

    .portal-top,
    .portal-hero {
        grid-template-columns: 1fr;
        display: grid;
    }

    .portal-top {
        align-items: start;
    }

    .portal-brand img {
        width: 142px;
    }

    .portal-brand { width: 100%; flex-wrap: wrap; justify-content: center; gap: 12px; min-width: 0; text-align: center; }
    .portal-brand-logos { gap: 10px; justify-content: center; min-height: 142px; }
    .portal-pitlogic-logo { width: 90px; }
    .portal-brand-logos .portal-workshop-logo { width: 105px; max-height: 64px; }

    .portal-brand-copy {
        width: 100%;
        justify-items: center;
        text-align: center;
        padding-left: 0;
        border-left: 0;
    }

    .portal-brand-copy span {
        display: block;
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .portal-token {
        width: fit-content;
    }

    .portal-section-head {
        align-items: start;
        flex-direction: column;
    }

    .portal-storage-hero,
    .portal-storage-main {
        flex-direction: column;
    }

    .portal-storage-overview-head,
    .portal-storage-overview-main {
        align-items: flex-start;
    }

    .portal-storage-overview-head {
        flex-direction: column;
    }

    .portal-storage-overview-link {
        width: 100%;
        justify-content: space-between;
    }

    .portal-storage-overview-card {
        grid-template-columns: 1fr;
    }

    .portal-storage-overview-card .portal-storage-status {
        justify-self: start;
    }

    .portal-storage-dates {
        grid-template-columns: 1fr;
    }

    .portal-lightbox-nav {
        width: 44px;
        height: 58px;
        font-size: 38px;
    }

    .portal-lightbox-nav.prev {
        left: 10px;
    }

    .portal-lightbox-nav.next {
        right: 10px;
    }

    .portal-lightbox-caption {
        bottom: 12px;
        font-size: 13px;
    }
}

.portal-preview-banner{padding:12px 16px;text-align:center;background:#fff3cd;color:#533f03;font:600 14px/1.5 system-ui;border-bottom:1px solid #e5ca73;}
.portal-maintenance{margin-top:20px}
.portal-maintenance-badge{font-size:12px;color:#a9d4ff;background:rgba(var(--primary-rgb),.12);border:1px solid rgba(var(--primary-rgb),.2);padding:7px 11px;border-radius:999px;white-space:nowrap}
.portal-maintenance-list{display:grid}
.portal-maintenance-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.8fr);gap:10px 24px;padding:18px 0;border-top:1px solid var(--border)}
.portal-maintenance-name{display:flex;align-items:center;gap:12px;min-width:0}
.portal-maintenance-name>span{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:10px;background:rgba(34,197,94,.1);color:#68d999}
.portal-maintenance-name h3{font-size:14px;margin:0 0 5px;overflow-wrap:anywhere}
.portal-maintenance-name p{font-size:12px;margin:0;color:var(--text-muted)}
.portal-maintenance-next{display:grid;gap:3px;align-content:center;padding:9px 12px;background:rgba(var(--primary-rgb),.12);border:1px solid rgba(var(--primary-rgb),.3);border-radius:10px}
.portal-maintenance-next small{font-size:12px;font-weight:700;color:#a9ceff}
.portal-maintenance-next strong{font-size:15px;line-height:1.4;font-weight:750;color:var(--text);overflow-wrap:anywhere}
.portal-maintenance-row details{grid-column:1/-1;padding-left:44px;font-size:12px;color:var(--text-muted)}
.portal-maintenance-row summary{cursor:pointer;width:fit-content;padding:4px 0}
.portal-maintenance-row ol{list-style:none;display:grid;gap:8px;padding:4px 0 0;margin:8px 0 0;max-width:480px}
.portal-maintenance-row li{display:flex;justify-content:space-between;gap:12px}
.portal-maintenance-footnote{font-size:12px;line-height:1.6;color:var(--text-muted);margin:12px 0 0}
.portal-maintenance-preview{display:flex;justify-content:space-between;gap:10px;align-items:center;border-top:1px solid var(--border);padding-top:14px;margin-top:8px;font-size:13px;color:#b6d7ff}
.portal-maintenance-preview>span:first-child{overflow-wrap:anywhere}
@media(max-width:650px){.portal-maintenance .portal-section-head{align-items:flex-start;flex-direction:column;gap:10px}.portal-maintenance-row{grid-template-columns:minmax(0,1fr);gap:12px}.portal-maintenance-row details{grid-column:1}}
.portal-vehicle-card { grid-template-rows: auto auto auto 1fr; }
.portal-vehicle-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.portal-maintenance-preview { align-self: end; min-height: 38px; line-height: 1.5; }
.portal-maintenance-preview svg { flex: 0 0 20px; color: var(--text-muted); }
.portal-maintenance-preview.has-next-service { padding: 9px 12px; background: rgba(var(--primary-rgb),.12); border: 1px solid rgba(var(--primary-rgb),.3); border-radius: 10px; }
.portal-maintenance-preview.has-next-service > span { display: grid; gap: 3px; }
.portal-maintenance-preview.has-next-service small { font-size: 12px; font-weight: 700; color: #a9ceff; }
.portal-maintenance-preview.has-next-service strong { font-size: 16px; line-height: 1.4; font-weight: 750; color: var(--text); }
.portal-maintenance-preview.has-next-service svg { color: #a9ceff; }
.portal-vehicle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "history maintenance" "gallery maintenance"; grid-template-rows: min-content 1fr; align-items: start; gap: 20px; margin-top: 20px; }
.portal-vehicle-layout > .portal-section { margin-top: 0; min-width: 0; }
.portal-vehicle-history { grid-area: history; }
.portal-vehicle-gallery { grid-area: gallery; }
.portal-vehicle-sidebar { grid-area: maintenance; min-width: 0; }
.portal-vehicle-sidebar .portal-maintenance { margin-top: 0; padding: 20px; }
.portal-maintenance-heading { margin-bottom: 16px; }
.portal-maintenance-heading h2 { margin: 0; font-size: 18px; }
.portal-maintenance-heading p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.portal-vehicle-sidebar .portal-maintenance-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 0; }
.portal-vehicle-sidebar .portal-maintenance-footnote { font-size: 11px; margin-top: 4px; }
@media(max-width: 1000px) {
    .portal-vehicle-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "history" "maintenance" "gallery"; grid-template-rows: auto auto auto; }
}
@media(max-width: 600px) {
    .portal-vehicle-sidebar .portal-maintenance { padding: 16px; }
    .portal-vehicle-history { padding: 16px; }
    .portal-history-item { padding: 14px; }
    .portal-history-top { flex-direction: column; gap: 12px; }
    .portal-history-title { line-height: 1.4; overflow-wrap: anywhere; }
    .portal-history-top .portal-meta { margin-top: 6px; gap: 4px 12px; font-size: 12px; font-weight: 600; }
    .portal-history-top .portal-meta > span { white-space: nowrap; }
    .portal-history-has-media .portal-history-top { padding-right: 0; min-height: 0; }
    .portal-history-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
    .portal-history-total > span { grid-column: 1; grid-row: 1; }
    .portal-history-total .portal-price { grid-column: 2; grid-row: 1; }
    .portal-history-total .portal-job-images-button { position: static; grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: center; min-height: 42px; padding: 0 12px; gap: 8px; font-size: 12px; }
    .portal-history-item .portal-note { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
}
/* Keep the welcome cards from casting a shadow over the next section. */
.portal-hero .portal-card { box-shadow: none; }

.portal-service-highlights {
    padding: 24px;
    background: linear-gradient(120deg, #142a4a, #101e36 75%);
    border-color: rgba(99, 161, 255, .32);
    box-shadow: inset 0 1px 0 rgba(167, 203, 255, .08);
}
.portal-service-highlights .portal-section-head { margin-bottom: 20px; }
.portal-service-highlights .portal-subtitle { color: #b6cbea; }
.portal-highlight-list { display: grid; gap: 14px; }
.portal-service-highlight {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border: 1px solid #34547e;
    border-left: 3px solid #68a7ff;
    border-radius: 14px;
    background: #0b172b;
    color: var(--text);
    text-decoration: none;
    transition: background .25s ease, border-color .25s ease;
}
.portal-service-highlight:hover { background: #10213a; border-color: #68a7ff; }
.portal-highlight-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border: 1px solid #34547e;
    border-radius: 14px;
    background: #193354;
    color: #acd0ff;
}
.portal-highlight-icon svg { width: 24px; height: 24px; }
.portal-highlight-copy { flex: 1; min-width: 0; }
.portal-highlight-vehicle { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.portal-highlight-vehicle .portal-plate { margin: 0; font-size: 12px; }
.portal-highlight-vehicle small { color: #b6cbea; font-size: 13px; overflow-wrap: anywhere; }
.portal-highlight-copy strong { display: block; font-size: 18px; line-height: 1.4; }
.portal-highlight-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.portal-highlight-labels span { padding: 5px 10px; border-radius: 7px; background: #1a304e; color: #c8deff; font-size: 12px; }
.portal-highlight-copy p { margin: 8px 0 0; font-size: 14px; color: #b6cbea; }
.portal-highlight-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex: none;
    padding: 13px 18px;
    border: 1px solid #5899fc;
    border-radius: 10px;
    background: #2864c7;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.portal-service-highlight:hover .portal-highlight-link { background: #3377df; transform: translateY(-2px); box-shadow: 0 5px 18px #2674ec30; }
.portal-service-highlight.is-received { background: #0c2429; border-color: #286355; border-left-color: #51c99a; }
.portal-service-highlight.is-received:hover { background: #10312f; border-color: #51c99a; }
.portal-service-highlight.is-received .portal-highlight-icon { color: #88ebbd; background: #163d35; border-color: #286355; }
.portal-service-highlight.is-received strong { color: #a0edcb; }
.portal-service-highlight.is-received .portal-highlight-link { background: #174d3d; border-color: #34785e; }
.portal-service-highlight:focus-visible { outline: 2px solid #acd0ff; outline-offset: 4px; }
@media (max-width: 800px) {
    .portal-service-highlights { padding: 18px; }
    .portal-service-highlight { flex-wrap: wrap; gap: 14px; padding: 18px; }
    .portal-highlight-icon { width: 40px; height: 40px; border-radius: 11px; align-self: flex-start; }
    .portal-highlight-copy { flex-basis: calc(100% - 54px); }
    .portal-highlight-copy strong { font-size: 16px; }
    .portal-highlight-link { width: 100%; }
}
