:root {
    --garage-shell-bg: #e4e3df;
    --garage-surface: #f5f3ef;
    --garage-surface-alt: #ece8e2;
    --garage-border: rgba(74, 91, 110, 0.2);
    --garage-border-strong: rgba(20, 46, 79, 0.18);
    --garage-text-main: #1f2d3d;
    --garage-text-muted: #6a7787;
    --garage-text-subtle: #8792a0;
    --garage-accent: #12365d;
    --garage-accent-soft: #dbe7f3;
    --garage-accent-line: rgba(18, 54, 93, 0.12);
    --garage-warning: #8f5f26;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--garage-text-main);
    background: var(--garage-shell-bg);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

:focus-visible {
    outline: 2px solid rgb(18 54 93 / 0.35);
    outline-offset: 2px;
}

#app {
    width: 100%;
    height: 100%;
}

.garage-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--garage-shell-bg);
}

.garage-layout {
    flex: 1;
    min-height: 0;
    width: min(100%, 1613px);
    margin: 0 auto;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 308px minmax(0, 1fr);
    gap: 1.25rem;
}

.garage-sidebar,
.garage-main {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.garage-main {
    overflow: hidden;
}

.garage-module,
.garage-panel,
.garage-card {
    background: linear-gradient(
        180deg,
        var(--garage-surface) 0%,
        var(--garage-surface-alt) 100%
    );
    border: 1px solid var(--garage-border);
    border-radius: 1.35rem;
}

.garage-module,
.garage-card {
    padding: 1rem;
}

.garage-module {
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.garage-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.garage-panel-header,
.garage-module-header,
.garage-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.garage-panel-header {
    padding: 1rem 1rem 0;
}

.garage-module-header {
    align-items: flex-start;
}

.garage-panel-intro {
    padding: 0 1rem 1rem;
    border-bottom: 1px solid var(--garage-accent-line);
}

.garage-dashboard {
    flex: 1;
    min-height: 0;
    padding: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.garage-list-card,
.garage-detail-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.garage-detail-card {
    grid-column: 1 / -1;
}

.garage-scroll-body {
    flex: 1;
    min-height: 20rem;
    max-height: 24rem;
    overflow: auto;
    display: grid;
    gap: 0.8rem;
    padding-right: 0.2rem;
}

.garage-detail-body {
    padding-top: 0.95rem;
}

.garage-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
    gap: 1rem;
}

.garage-detail-meta,
.garage-summary-grid,
.garage-search-actions,
.garage-category-grid,
.garage-action-row,
.garage-inline-meters,
.garage-hitpoint-grid,
.garage-footer {
    display: grid;
    gap: 0.75rem;
}

.garage-detail-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

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

.garage-summary-grid > :last-child {
    grid-column: 1 / -1;
}

.garage-search-actions,
.garage-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.garage-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.garage-footer-bar {
    width: 100%;
    border-top: 1px solid rgb(18 54 93 / 0.1);
}

.garage-footer {
    width: min(100%, 1613px);
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.95rem 1.25rem 1.15rem;
}

.garage-meter-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.garage-eyebrow,
.garage-footer-title,
.garage-stat-label,
.garage-meter-label,
.garage-hitpoint-selection {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--garage-text-subtle);
}

.garage-title,
.garage-section-title {
    margin: 0.16rem 0 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--garage-text-main);
}

.garage-title {
    font-size: 1.1rem;
}

.garage-section-title {
    font-size: 1.05rem;
}

.garage-copy,
.garage-detail-note,
.garage-empty-copy,
.garage-footer-copy,
.garage-vehicle-meta,
.garage-detail-caption {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.48;
    color: var(--garage-text-muted);
}

.garage-pill,
.garage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--garage-accent-soft);
    color: var(--garage-accent);
}

.garage-badge.is-warning {
    background: rgb(246 226 193 / 0.88);
    color: var(--garage-warning);
}

.garage-search-form {
    display: grid;
    gap: 0.75rem;
}

.garage-search-input {
    width: 100%;
    height: 2.9rem;
    padding: 0 0.95rem;
    border-radius: 0.8rem;
    border: 1px solid var(--garage-border);
    background: rgb(255 255 255 / 0.75);
    color: var(--garage-text-main);
}

.garage-stat-card {
    min-width: 0;
    padding: 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid var(--garage-border);
    background: rgb(255 255 255 / 0.48);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.garage-stat-card.is-accent {
    background: linear-gradient(
        180deg,
        rgb(237 243 249 / 0.92) 0%,
        rgb(223 232 242 / 0.72) 100%
    );
}

.garage-stat-card.is-danger {
    background: linear-gradient(
        180deg,
        rgb(254 242 242 / 0.95) 0%,
        rgb(252 225 225 / 0.82) 100%
    );
    border-color: rgb(220 151 151 / 0.38);
}

.garage-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--garage-text-main);
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.garage-chip {
    min-height: 2.6rem;
    padding: 0.68rem 0.9rem;
    border-radius: 0.85rem;
    border: 1px solid var(--garage-border);
    background: rgb(255 255 255 / 0.52);
    color: var(--garage-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.garage-chip.is-active {
    background: var(--garage-accent-soft);
    color: var(--garage-accent);
    border-color: rgb(18 54 93 / 0.2);
}

.garage-vehicle-item {
    width: 100%;
    padding: 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid var(--garage-border);
    background: rgb(255 255 255 / 0.48);
    color: inherit;
    text-align: left;
}

.garage-vehicle-item.is-selected {
    border-color: rgb(18 54 93 / 0.24);
    background: linear-gradient(
        180deg,
        rgb(237 243 249 / 0.96) 0%,
        rgb(223 232 242 / 0.74) 100%
    );
    box-shadow: 0 16px 26px rgb(18 54 93 / 0.08);
}

.garage-vehicle-item-head,
.garage-meter-label-row,
.garage-subsystem-header,
.garage-hitpoint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.garage-vehicle-copy,
.garage-hitpoint-copy,
.garage-footer-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.garage-vehicle-title,
.garage-hitpoint-name,
.garage-hitpoint-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--garage-text-main);
}

.garage-meter {
    display: grid;
    gap: 0.32rem;
}

.garage-meter-track {
    width: 100%;
    height: 0.45rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(18 54 93 / 0.08);
}

.garage-meter-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--garage-text-main);
}

.garage-meter-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.garage-meter-fill.is-health {
    background: linear-gradient(90deg, #2f7d5b 0%, #4eaa82 100%);
}

.garage-meter-fill.is-fuel {
    background: linear-gradient(90deg, #12365d 0%, #3c6792 100%);
}

.garage-btn {
    min-height: 2.75rem;
    padding: 0.72rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid var(--garage-border-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.garage-btn-primary {
    background: rgb(255 255 255 / 0.68);
    color: var(--garage-accent);
}

.garage-btn-primary:hover {
    background: rgb(219 231 243 / 0.88);
}

.garage-btn-secondary {
    background: rgb(255 255 255 / 0.42);
    color: var(--garage-text-muted);
}

.garage-btn-secondary:hover {
    background: rgb(255 255 255 / 0.6);
    color: var(--garage-text-main);
}

.garage-hitpoint-row {
    padding: 0.72rem 0.78rem;
    border-radius: 0.85rem;
    border: 1px solid var(--garage-border);
    background: rgb(255 255 255 / 0.52);
}

.garage-detail-empty,
.garage-empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 100%;
}

.garage-empty-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--garage-text-main);
}

.garage-empty-inline {
    padding: 0.9rem;
    border-radius: 0.85rem;
    border: 1px dashed var(--garage-border);
    color: var(--garage-text-muted);
    background: rgb(255 255 255 / 0.36);
}

.garage-toast-stack {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.garage-toast {
    max-width: 24rem;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid var(--garage-border);
    background: #fff;
    box-shadow: 0 14px 28px rgb(16 34 56 / 0.14);
    font-size: 0.92rem;
}

.garage-toast.is-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.garage-toast.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

@media (max-width: 1440px) {
    .garage-layout {
        grid-template-columns: 288px minmax(0, 1fr);
    }

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

@media (max-width: 1120px) {
    .garage-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .garage-main,
    .garage-sidebar {
        min-height: auto;
    }

    .garage-dashboard {
        grid-template-columns: 1fr;
    }

    .garage-detail-card {
        grid-column: auto;
    }

    .garage-scroll-body {
        max-height: none;
        min-height: 16rem;
    }

    .garage-footer {
        grid-template-columns: 1fr;
    }
}
