:root {
    --navy: #132c39;
    --navy-dark: #0c202b;
    --ink: #18323f;
    --muted: #71808a;
    --paper: #f5f6f4;
    --line: #dfe5e4;
    --accent: #e9bf82;
    --teal: #226b69;
    --danger: #b7413c;
    --radius: 12px;
    font-family: Inter,"Segoe UI",Arial,sans-serif;
    color: var(--ink);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    font-size: 14px;
    line-height: 1.55;
}

a {
    color: var(--teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,input,select,textarea {
    font: inherit;
}

button,.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #ccd6d7;
    border-radius: 7px;
    padding: 10px 16px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    transition: background .15s;
}

button:hover,.button:hover {
    background: #eaf0ef;
    text-decoration: none;
}

button:disabled {
    opacity: .45;
    cursor: wait;
}

.primary {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.primary:hover {
    background: #195554;
    border-color: #195554;
}

.small {
    padding: 7px 11px;
    font-size: 12px;
}

.full {
    width: 100%;
    margin-top: 10px;
}

.text-button {
    border: 0;
    background: transparent;
    padding: 5px;
    color: var(--teal);
}

.icon-button {
    border: 0;
    background: transparent;
    font-size: 24px;
    padding: 0 10px;
}

.danger {
    color: var(--danger);
}

.actions {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 222px;
    flex-shrink: 0;
    background: var(--navy-dark);
    color: #c4d4dc;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    font-weight: 750;
    letter-spacing: 1.2px;
    line-height: 1.2;
    font-size: 14px;
}

.brand:hover {
    text-decoration: none;
}

.brand small {
    display: block;
    color: #8ca3ad;
    font-size: 9px;
    letter-spacing: 3px;
    margin-top: 7px;
}

.brand-mark {
    border: 1px solid #687c80;
    color: var(--accent);
    width: 39px;
    height: 45px;
    display: grid;
    place-items: center;
    font-size: 19px;
    clip-path: polygon(0 0,80% 0,100% 20%,100% 100%,0 100%);
    background: #1a3542;
}

.nav-caption {
    font-size: 9px;
    letter-spacing: 1.7px;
    color: #78909c;
    margin: 39px 12px 13px;
    font-weight: 650;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b7cad3;
    padding: 12px;
    margin: 5px 0;
    border-radius: 7px;
    font-size: 13px;
}

.sidebar nav a span {
    font-size: 20px;
    width: 22px;
    line-height: 1;
}

.sidebar nav a:hover,.sidebar nav a.active {
    background: #223d49;
    color: #fff;
    text-decoration: none;
}

.sidebar nav a.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid #29414c;
    padding: 22px 12px 0;
    font-size: 11px;
    color: #829ca8;
}

.sidebar-bottom a {
    color: #becdd3;
}

.sidebar-bottom p {
    line-height: 1.8;
}

.edition {
    font-size: 10px;
    color: #c3d2d8;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7aac97;
    margin-right: 7px;
}

.main-shell {
    margin-left: 222px;
    min-width: 0;
    flex: 1;
}

.topbar {
    height: 73px;
    background: rgba(255,255,255,.85);
    border-bottom: 1px solid var(--line);
    padding: 0 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    font-weight: 650;
    color: #87949b;
}

.topbar-label span {
    margin: 0 13px;
    color: #b7c0c4;
}

.account-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
}

.account-nav a {
    color: var(--ink);
}

main#main-content {
    --main-gutter: 38px;
    max-width: 1600px;
    margin: auto;
    padding: 32px 38px 50px;
    min-height: calc(100vh - 130px);
}

.app-footer {
    padding: 18px 38px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    color: #94a0a5;
    font-size: 10px;
    letter-spacing: .5px;
}

h1 {
    font-size: 34px;
    letter-spacing: -1.3px;
    font-weight: 680;
    line-height: 1.15;
    margin: 10px 0 13px;
}

h2 {
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -.25px;
    margin: 0 0 18px;
    font-weight: 650;
}

h3 {
    font-size: 15px;
}

.eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #607e86;
}

.muted {
    color: var(--muted);
}

.hint {
    font-size: 11px;
    line-height: 1.7;
    color: var(--muted);
}

.accent {
    color: var(--accent);
}

.hero {
    border-radius: var(--radius);
    background: var(--navy);
    color: white;
    padding: 32px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 246px;
    margin-bottom: 28px;
    overflow: hidden;
}

.hero h1 {
    font-size: 43px;
    letter-spacing: -1.8px;
    margin: 13px 0;
}

.hero .eyebrow {
    color: #96b4bb;
    font-size: 9px;
}

.hero p {
    font-size: 13px;
    color: #b3c7ce;
    margin: 0 0 22px;
    line-height: 1.8;
}

.hero-button {
    background: var(--accent);
    border-color: var(--accent);
    color: #263a3f;
    font-size: 12px;
}

.hero-button span {
    margin-left: 22px;
}

.hero-art {
    color: #91b7bc;
    position: relative;
    width: 320px;
    flex-shrink: 0;
    text-align: center;
}

.hero-art svg {
    width: 285px;
    height: 205px;
    position: relative;
}

.hero-art>span {
    font-size: 8px;
    letter-spacing: 2px;
    color: #76939e;
}

.orbit {
    position: absolute;
    border: 1px solid #34505b;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 265px;
    height: 265px;
}

.orbit-two {
    width: 360px;
    height: 360px;
    opacity: .35;
}

.active-fleet-bar {
    position: sticky;
    top: 0;
    z-index: 18;
    overflow-anchor: none;
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .9fr) minmax(300px, 1.5fr) minmax(100px, .6fr) auto;
    align-items: center;
    gap: 22px;
    min-height: 94px;
    margin-bottom: 28px;
    padding: 18px 24px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--navy);
    color: #fff;
}
.active-fleet-sticky-sentinel {
    height: 0;
    pointer-events: none;
}
.active-fleet-bar.is-stuck {
    min-height: 64px;
    margin-left: calc(-1 * var(--main-gutter));
    margin-right: calc(-1 * var(--main-gutter));
    margin-bottom: 18px;
    padding-top: 9px;
    padding-bottom: 9px;
    border-radius: 0;
    box-shadow: 0 7px 18px rgba(12, 32, 43, .18);
}
    .active-fleet-bar.is-stuck .active-fleet-name > strong {
        font-size: 16px;
    }

    .active-fleet-bar.is-stuck .active-fleet-name .eyebrow,
    .active-fleet-bar.is-stuck .active-fleet-stat > small {
        margin-bottom: 1px;
        font-size: 7px;
    }

    .active-fleet-bar.is-stuck .active-fleet-stat > strong {
        font-size: 15px;
    }

    .active-fleet-bar.is-stuck .active-fleet-classes > strong {
        font-size: 11px;
    }

    .active-fleet-bar.is-stuck .active-fleet-button {
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 11px;
    }

    .active-fleet-bar::before,
    .active-fleet-bar::after {
        content: "";
        position: absolute;
        top: 50%;
        border: 1px solid #34505b;
        border-radius: 50%;
        pointer-events: none;
    }

    .active-fleet-bar::before {
        right: -70px;
        width: 190px;
        height: 190px;
        transform: translateY(-50%);
    }

    .active-fleet-bar::after {
        right: -28px;
        width: 115px;
        height: 115px;
        transform: translateY(-50%);
        opacity: .65;
    }

    .active-fleet-bar > * {
        position: relative;
        z-index: 1;
    }

.active-fleet-name {
    min-width: 0;
}

    .active-fleet-name .eyebrow {
        color: #96b4bb;
        margin-bottom: 4px;
    }

    .active-fleet-name > strong {
        display: block;
        overflow: hidden;
        font-size: 20px;
        font-weight: 650;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.active-fleet-stat {
    min-width: 0;
    padding-left: 20px;
    border-left: 1px solid #34505b;
}

    .active-fleet-stat > small {
        display: block;
        margin-bottom: 3px;
        color: #8fa9b3;
        font-size: 8px;
        font-weight: 650;
        letter-spacing: 1px;
    }

    .active-fleet-stat > strong {
        display: block;
        font-size: 18px;
        font-weight: 620;
        line-height: 1.3;
        white-space: nowrap;
    }

    .active-fleet-stat em {
        color: #98afb8;
        font-size: 10px;
        font-style: normal;
        font-weight: 400;
    }

.active-fleet-secondary {
    display: block;
    margin-top: 2px;
    color: #91a8b1;
    font-size: 9px;
}

.active-fleet-budget.is-over {
    padding-top: 7px;
    padding-right: 10px;
    padding-bottom: 7px;
    border-left-color: #c56e69;
    border-radius: 7px;
    background: rgba(183, 65, 60, .15);
}

    .active-fleet-budget.is-over > strong {
        color: #ffaaa4;
    }

.active-fleet-classes > strong {
    display: flex;
    gap: 12px;
    font-size: 12px;
    white-space: nowrap;
}

    .active-fleet-classes > strong span {
        white-space: nowrap;
    }

.active-fleet-pyramid-warning {
    display: inline-block;
    margin-top: 3px;
    color: #efc27b;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
}

.active-fleet-button {
    justify-self: end;
    white-space: nowrap;
}

.active-fleet-load-error {
    color: #efc27b;
    font-size: 11px;
}

.active-fleet-bar-error {
    grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr) auto;
}

.fleet-hero-placeholder {
    opacity: .95;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 235px minmax(0,1fr);
    gap: 25px;
    align-items: start;
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 23px;
    margin-bottom: 22px;
}

.filters {
    padding: 19px;
    position: sticky;
    top: 15px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 19px;
}

.panel-heading h2 {
    margin: 0;
}

.filters h2 {
    font-size: 14px;
}

.filters .text-button {
    font-size: 10px;
}

.filters label {
    font-size: 11px;
}

.filters input,.filters select {
    font-size: 11px;
    padding: 9px 10px;
}

.filters details {
    font-size: 11px;
}

label,.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #536875;
    margin: 0 0 14px;
}

input,select,textarea {
    width: 100%;
    border: 1px solid #d5dfdf;
    border-radius: 6px;
    padding: 10px 12px;
    background: white;
    color: var(--ink);
    outline: none;
    font-weight: 400;
    margin-top: 6px;
    min-width: 0;
}

input:focus,select:focus,textarea:focus {
    border-color: #458a89;
    box-shadow: 0 0 0 3px #28757412;
}

input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--teal);
    margin: 0;
    flex-shrink: 0;
}

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 400;
    line-height: 1.6;
}

.check input {
    margin: 0;
}

.weapon-options {
    max-height: 230px;
    overflow: auto;
    margin-top: 13px;
}

.weapon-options label {
    font-size: 11px;
    margin: 10px 0;
}

details {
    border-top: 1px solid var(--line);
    margin-top: 15px;
    padding-top: 14px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    margin-bottom: 13px;
}

summary:before {
    content: "+";
    display: inline-block;
    margin-right: 8px;
    font-weight: 400;
}

details[open]>summary:before {
    content: "−";
}

summary span {
    float: right;
    color: var(--muted);
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 17px;
    height: 30px;
    font-size: 12px;
    gap: 12px;
}

.badge {
    display: inline-block;
    font-size: 8px;
    letter-spacing: .8px;
    background: #eaf0f0;
    color: #647c85;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge.category {
    color: #4c7479;
    background: #eaf1f0;
    font-size: 9px;
    letter-spacing: .3px;
}

.ship-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 18px;
}

.ship-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    overflow: hidden;
    transition: box-shadow .2s,transform .2s;
}

.ship-card:hover {
    box-shadow: 0 5px 20px #20333c0c;
    transform: translateY(-2px);
}

.ship-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px 8px;
}

.revision {
    font-size: 8px;
    color: #a0acb1;
    letter-spacing: 1.2px;
}

.results-toolbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
    margin-left: auto;
}
.sort-control {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

    .sort-control > span {
        font-size: 8px;
        letter-spacing: 0.9px;
        color: #87949b;
        font-weight: 600;
    }

    .sort-control select {
        width: auto;
        min-width: 100px;
        height: 31px;
        min-height: 31px;
        margin: 0;
        padding: 0 28px 0 10px;
        border-radius: 6px;
        font-size: 11px;
        line-height: 1;
        background-color: #fff;
    }
.view-switch {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.view-switch button {
    flex: 0 0 32px;
    width: 32px;
    height: 29px;
    min-width: 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #809198;
    font-size: 15px;
}

.view-switch button + button {
    border-left: 1px solid var(--line);
}

.view-switch button:hover {
    background: #eef3f2;
}

.view-switch button.active {
    background: var(--navy);
    color: #fff;
}

.ship-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ship-list-card {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(170px, auto) minmax(130px, auto) minmax(170px, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    transition: box-shadow .15s, transform .15s;
}
.catalog-results {
    min-width: 0;
}

.ship-list-main,
.ship-list-stats,
.ship-list-substats,
.ship-list-systems,
.ship-list-actions {
    min-width: 0;
}
.ship-list-card:hover {
    box-shadow: 0 4px 16px #20333c0c;
    transform: translateY(-1px);
}

.ship-list-main {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.ship-list-info {
    min-width: 0;
}

.ship-list-info .ship-faction {
    margin-bottom: 2px;
}

.ship-list-info h2 {
    margin: 2px 0;
    min-height: 0;
    font-size: 18px;
}

.ship-list-info h2 a {
    color: var(--ink);
}

.ship-list-variant {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
}

.ship-list-stats {
    display: grid;
    grid-template-columns: repeat(2,54px);
    align-items: center;
}

.ship-list-stats > div {
    text-align: center;
    padding: 0 5px;
    border-left: 1px solid #edf0ed;
}

.ship-list-stats small {
    display: block;
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1px;
}

.ship-list-stats strong {
    display: block;
    font-size: 19px;
    font-weight: 600;
}

.ship-list-substats {
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ship-list-substats > div {
        min-width: 42px;
        padding: 0 6px;
        text-align: center;
    }

        .ship-list-substats > div + div {
            border-left: 1px solid #edf0ed;
        }

    .ship-list-substats small {
        display: block;
        font-size: 7px;
        color: #8a9ba4;
        letter-spacing: 0.8px;
    }

    .ship-list-substats strong {
        display: block;
        margin-top: 2px;
        font-size: 14px;
        line-height: 1.3;
        font-weight: 600;
    }

.ship-list-systems {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 3px;
    min-width: 0;
    font-size: 9px;
    line-height: 1.35;
    color: #71808a;
}

    .ship-list-systems span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.ship-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

    .ship-list-actions .primary {
        padding: 8px 11px;
        font-size: 11px;
    }

.ssd-thumb {
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    background: linear-gradient(#f9fbfa,#f3f6f5);
    border-bottom: 1px solid #edf1ef;
    position: relative;
}

.ssd-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.ssd-image-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssd-image-link:hover {
    text-decoration: none;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 34px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(19,44,57,.6);
    color: #fff;
    font-size: 23px;
    line-height: 1;
    opacity: 0;
    z-index: 2;
}

.ssd-thumb:hover .gallery-arrow {
    opacity: 1;
}

.gallery-prev {
    left: 7px;
}

.gallery-next {
    right: 7px;
}

.gallery-dots {
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.gallery-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #aebabb;
}

.gallery-dot:hover {
    background: #839596;
}

.gallery-dot.active {
    background: var(--teal);
}

.missing-ssd {
    font-size: 11px;
    color: #8b9ba2;
}

.ship-card-body {
    padding: 18px 16px 15px;
}

.ship-faction {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    color: #4c787b;
    margin-bottom: 6px;
}

.ship-faction span {
    font-weight: 400;
    color: #8b999f;
    letter-spacing: 0;
}

.ship-card h2 {
    font-size: 15px;
    margin: 0 0 17px;
    min-height: 39px;
}

.ship-card h2 a {
    color: var(--ink);
}

.ship-stats {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    padding: 12px 0;
    border-top: 1px solid #edf0ed;
    border-bottom: 1px solid #edf0ed;
}
.ship-substats {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #edf0ed;
}

    .ship-substats > div {
        flex: 1;
        padding: 7px 10px;
        text-align: center;
    }

        .ship-substats > div + div {
            border-left: 1px solid #edf0ed;
        }

    .ship-substats small {
        display: block;
        font-size: 7px;
        color: #8a9ba4;
        letter-spacing: 0.8px;
    }

    .ship-substats strong {
        display: block;
        margin-top: 1px;
        font-size: 14px;
        line-height: 1.35;
        font-weight: 600;
    }

.ship-stats > div {
    text-align: center;
    padding: 0 10px;
}



.ship-stats div + div {
    border-left: 1px solid #edf0ed;
}

.ship-stats small {
    display: block;
    font-size: 8px;
    color: #8a9ba4;
    letter-spacing: 1px;
}

.ship-stats strong {
    font-size: 19px;
    line-height: 1.5;
    font-weight: 600;
}

.system-summary {
    font-size: 10px;
    color: #7c8b92;
    line-height: 1.7;
    min-height: 34px;
    margin: 12px 0 16px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.card-actions button {
    font-size: 10px;
    padding: 8px 11px;
}

.origin-dot {
    font-size: 9px;
    color: #8e989d;
    white-space: nowrap;
}

.origin-dot:before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #b4b9bd;
    display: inline-block;
    margin-right: 5px;
}

.origin-dot.official:before {
    background: #4d9185;
}

.catalog-note {
    font-size: 10px;
    color: #98a3a8;
    margin-top: 23px;
}

.notice {
    padding: 14px 18px;
    border: 1px solid #c8dedd;
    border-radius: 8px;
    margin-bottom: 22px;
    background: #edf6f4;
    font-size: 13px;
}

.notice.success {
    background: #edf7f0;
    border-color: #c7e1d1;
    color: #346854;
}

.notice.error,.validation-summary-errors,.validation-message {
    background: #fff0ee;
    color: #a33835;
    border-color: #f0c9c3;
}

.notice.warning {
    background: #fcf5e9;
    border-color: #e8d8b6;
    color: #8f6f38;
}

.notice a {
    margin-left: 8px;
    font-weight: 600;
}

.validation-summary-errors {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.validation-summary-valid {
    display: none;
}

.validation-message {
    font-size: 12px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-bottom: 28px;
}

.page-heading p {
    margin-bottom: 0;
}

.back-link {
    display: inline-block;
    font-size: 12px;
    margin-bottom: 20px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
}

.stat-strip>div {
    padding: 0 20px;
    border-right: 1px solid var(--line);
}

.stat-strip>div:first-child {
    padding-left: 0;
}

.stat-strip>div:last-child {
    border: 0;
}

.stat-strip small {
    display: block;
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 1px;
}

.stat-strip strong {
    font-size: 28px;
    display: block;
    font-weight: 650;
    margin-top: 6px;
}

.stat-strip em {
    font-size: 11px;
    font-weight: 400;
    font-style: normal;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

.detail-full-width {
    grid-column: 1 / -1;
}

.detail-ssd {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #fafbf9;
    display: block;
    margin: 18px 0;
}

.preserve-lines {
    white-space: pre-line;
}

.table-scroll {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
    text-align: left;
}

th {
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: .9px;
    color: #8c9ba2;
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    font-weight: 600;
}

td {
    padding: 15px 10px;
    border-bottom: 1px solid #eef1ef;
    vertical-align: middle;
}

td small,.lookup-row small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

td select {
    min-width: 120px;
    margin: 0;
}

.json-preview {
    display: block;
    max-width: 270px;
    overflow-wrap: anywhere;
    font-size: 10px;
    color: var(--muted);
}

.arc-label {
    font-family: Consolas,monospace;
    font-size: 11px;
    white-space: nowrap;
}

dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    font-size: 12px;
    gap: 12px;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 65px 25px;
    color: var(--muted);
}

.empty-state h2,.empty-state h1 {
    color: var(--ink);
}

.empty-icon {
    font-size: 48px;
    color: #93aeaf;
}

.loading {
    color: var(--muted);
    padding: 35px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 25px;
    font-size: 12px;
}

.form-grid {
    display: grid;
    gap: 0 17px;
}

.form-grid.two {
    grid-template-columns: repeat(2,minmax(0,1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3,minmax(0,1fr));
}

.form-grid.four {
    grid-template-columns: repeat(4,minmax(0,1fr));
}

.fleet-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 305px;
    gap: 24px;
}

.summary-panel .total-cost {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin: 15px 0;
}

.total-cost strong {
    font-size: 45px;
    letter-spacing: -1.5px;
    font-weight: 650;
}

.total-cost span {
    font-size: 11px;
    color: var(--muted);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #edf0ef;
    font-size: 12px;
}

.summary-line span {
    color: var(--muted);
}

.fleet-warning {
    display: flex;
    gap: 10px;
    margin: 13px 0;
    padding-top: 12px;
    border-top: 1px solid #edf0ef;
    font-size: 11px;
    color: #8a714c;
}

.fleet-warning>span {
    background: #f6ead4;
    border-radius: 50%;
    height: 19px;
    width: 19px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 700;
}

.fleet-warning p {
    margin: 0;
}

.success-text {
    font-size: 12px;
    color: var(--teal);
}

.fleet-row {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.fleet-entry-top {
    display: grid;
    grid-template-columns: 26px 112px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.fleet-index {
    padding-top: 5px;
    min-width: 24px;
    color: #99a9af;
    font-family: Consolas, monospace;
    font-size: 11px;
}

.fleet-entry-ssd {
    width: 112px;
    height: 78px;
}

.fleet-ssd-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 78px;
    padding: 5px;
    overflow: hidden;
    border: 1px solid #e0e7e5;
    border-radius: 7px;
    background: linear-gradient(#f9fbfa, #f3f6f5);
    cursor: pointer;
}

    .fleet-ssd-button:hover {
        background: #eef3f2;
        border-color: #cbd9d7;
    }

    .fleet-ssd-button img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        mix-blend-mode: multiply;
    }

.fleet-ssd-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 78px;
    padding: 8px;
    border: 1px dashed #ccd8d7;
    border-radius: 7px;
    color: var(--muted);
    background: #f8faf9;
    font-size: 9px;
    line-height: 1.4;
    text-align: center;
}

.fleet-entry-content {
    min-width: 0;
    overflow: hidden;
}

.fleet-entry-summary {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) auto auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-width: 0;
}

.fleet-entry-identity {
    min-width: 0;
}

.fleet-entry-name {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .fleet-entry-name:hover {
        color: var(--teal);
    }

.fleet-entry-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.fleet-entry-costs {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    align-items: stretch;
}

    .fleet-entry-costs > div {
        padding: 0 7px;
        text-align: center;
    }

        .fleet-entry-costs > div + div {
            border-left: 1px solid #edf0ed;
        }

    .fleet-entry-costs small,
    .fleet-entry-tech small {
        display: block;
        color: #8a9ba4;
        font-size: 7px;
        letter-spacing: .8px;
    }

    .fleet-entry-costs strong {
        display: block;
        margin-top: 2px;
        font-size: 16px;
        font-weight: 600;
    }

.fleet-entry-tech {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

    .fleet-entry-tech > div {
        min-width: 48px;
        padding: 0 7px;
        text-align: center;
    }

        .fleet-entry-tech > div + div {
            border-left: 1px solid #edf0ed;
        }

    .fleet-entry-tech strong {
        display: block;
        margin-top: 2px;
        font-size: 14px;
        font-weight: 600;
    }

    .fleet-entry-tech span {
        display: block;
        margin-top: 1px;
        color: var(--muted);
        font-size: 8px;
        white-space: nowrap;
    }

.fleet-entry-systems {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 3px;
    min-width: 0;
    overflow: hidden;
    color: #71808a;
    font-size: 9px;
    line-height: 1.35;
}

    .fleet-entry-systems span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 82px;
}

.fleet-row-fields {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
}

    .fleet-row-fields input,
    .fleet-row-fields select {
        margin: 0;
        font-size: 11px;
    }

    .fleet-row-fields input {
        flex: 1;
    }

    .fleet-row-fields select {
        flex: 1;
    }

    .fleet-row-fields button {
        flex-shrink: 0;
    }

.fleet-row-fields input,.fleet-row-fields select {
    font-size: 11px;
    margin: 0;
}

.fleet-row-fields button {
    flex-shrink: 0;
}

.fleet-cards {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 22px;
}

.saved-fleet h2 {
    font-size: 21px;
    margin-top: 10px;
}

.saved-fleet-meta {
    margin-top: -5px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
}

    .saved-fleet-meta strong {
        color: var(--ink);
        font-weight: 600;
    }

.saved-fleet-note {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-line;
}

.saved-fleet p {
    overflow-wrap: anywhere;
}

.editor-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.system-editor {
    padding: 20px;
    background: #f7f9f8;
    border: 1px solid #e2e8e5;
    border-radius: 8px;
    margin-bottom: 15px;
}

.system-main {
    grid-template-columns: 2fr .65fr 1.2fr auto;
}

.system-buttons {
    align-self: center;
}

.system-editor input,.system-editor select {
    font-size: 12px;
}

.system-editor details {
    font-size: 11px;
}

.arc-picker {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.arc-picker label {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.arc-picker input {
    position: absolute;
    opacity: 0;
}

.arc-picker span {
    display: block;
    background: #fff;
    border: 1px solid #d3dfe0;
    padding: 9px 10px;
    border-radius: 5px;
    font: 12px Consolas,monospace;
}

.arc-picker input:checked+span {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
}

.arc-picker input:focus-visible+span {
    outline: 2px solid #2c9390;
    outline-offset: 2px;
}

.mono {
    font-family: Consolas,monospace;
    font-size: 12px;
}

.upload-area {
    border: 1px dashed #9bb6bb;
    border-radius: 8px;
    padding: 22px;
    background: #f4f9f7;
}

.upload-area input {
    border: 0;
    background: transparent;
    padding: 5px 0;
    font-size: 12px;
}

.editor-savebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 23px;
    background: #e6eeeb;
    border: 1px solid #d6e0dc;
    border-radius: 10px;
}

.editor-savebar p {
    font-size: 12px;
    margin: 0;
    color: #647b7b;
}

.lookup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.tabs .active {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.prose {
    max-width: 820px;
    font-size: 14px;
    line-height: 1.8;
}

.prose h2:not(:first-child) {
    margin-top: 32px;
}

.auth-body {
    background: var(--navy-dark);
    min-height: 100vh;
    padding: 50px 20px;
}

.auth-brand {
    justify-content: center;
    margin-bottom: 35px;
}

.auth-card {
    max-width: 440px;
    margin: auto;
    border-radius: 14px;
    background: #fff;
    padding: 35px;
}

.auth-card h1 {
    font-size: 30px;
}

.auth-card p {
    font-size: 12px;
}

.auth-card label {
    margin-top: 17px;
}

.auth-back {
    text-align: center;
    font-size: 12px;
}

.auth-back a {
    color: #9ebbc7;
}

.auth-card .validation-summary ul {
    padding-left: 15px;
    font-size: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

#blazor-error-ui {
    display: none;
    background: #ffe8c9;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px;
    text-align: center;
    color: #5d3f19;
}

.dismiss {
    margin-left: 20px;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid #4c9291;
    outline-offset: 3px;
}

@media (min-width:1650px) {
    .hero {
        min-height: 280px;
    }

    .hero h1 {
        font-size: 50px;
    }

    .ssd-thumb {
        height: 155px;
    }
}

@media (max-width:1250px) {
    .ship-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .fleet-entry-summary {
        grid-template-columns: minmax(170px, 1fr) auto auto;
    }

    .fleet-entry-systems {
        grid-column: 1 / -1;
        margin-top: 5px;
        padding-top: 7px;
        border-top: 1px solid #edf0ed;
    }
    .sidebar {
        width: 198px;
        padding: 26px 13px;
    }

    .main-shell {
        margin-left: 198px;
    }

    main#main-content {
        --main-gutter: 25px;
        padding: 25px;
    }

    .topbar {
        padding: 0 25px;
    }

    .catalog-layout {
        grid-template-columns: 210px minmax(0,1fr);
        gap: 20px;
    }

    .fleet-layout {
        grid-template-columns: minmax(0,1fr) 275px;
        gap: 18px;
    }

    .system-main {
        grid-template-columns: 2fr 1fr;
    }

    .fleet-cards {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .form-grid.four {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width:950px) {
    .fleet-entry-top {
        grid-template-columns: 24px 96px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .fleet-entry-ssd,
    .fleet-ssd-button,
    .fleet-ssd-missing {
        width: 96px;
    }

    .fleet-entry-ssd,
    .fleet-ssd-button,
    .fleet-ssd-missing {
        height: 68px;
    }

    .fleet-entry-summary {
        grid-template-columns: 1fr 1fr;
    }

    .fleet-entry-identity {
        grid-column: 1 / -1;
    }

    .fleet-entry-systems {
        grid-column: 1 / -1;
    }
    .active-fleet-bar {
        grid-template-columns: 1fr 1fr 1fr auto;
        gap: 14px;
    }

    .active-fleet-name {
        grid-column: 1 / -1;
    }

    .active-fleet-stat {
        padding-left: 0;
        border-left: 0;
    }
    
    .ship-list-card {
        grid-template-columns: 1fr auto;
    }

    .ship-list-main {
        grid-column: 1 / -1;
    }

    .ship-list-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .sidebar {
        width: 174px;
    }

    .main-shell {
        margin-left: 174px;
    }

    .brand {
        font-size: 11px;
        gap: 8px;
    }

    .brand small {
        font-size: 7px;
    }

    .brand-mark {
        width: 32px;
        height: 38px;
        font-size: 16px;
    }

    .sidebar nav a {
        font-size: 11px;
        padding: 10px;
        gap: 7px;
    }

    .sidebar nav a span {
        font-size: 17px;
    }

    .nav-caption {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .topbar-label {
        display: none;
    }

    .topbar {
        justify-content: flex-end;
        height: 60px;
    }

    .hero-art {
        width: 190px;
    }

    .hero-art svg {
        width: 185px;
    }

    .hero {
        padding: 26px;
    }

    .hero h1 {
        font-size: 35px;
    }

    .catalog-layout {
        grid-template-columns: 180px minmax(0,1fr);
        gap: 15px;
    }

    .ship-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        padding: 14px;
    }

    .results-toolbar .badge {
        display: none;
    }

    .fleet-layout,.detail-grid {
        grid-template-columns: 1fr;
    }

    .fleet-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
        align-items: start;
    }

    .stat-strip {
        padding: 16px;
        grid-template-columns: repeat(3,1fr);
        row-gap: 20px;
    }

    .stat-strip strong {
        font-size: 23px;
    }

    .form-grid.three {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .page-heading {
        flex-wrap: wrap;
    }

    .fleet-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width:700px) {
    .active-fleet-bar {
        grid-template-columns: 1fr 1fr;
        padding: 18px;
    }

    .active-fleet-name,
    .active-fleet-classes,
    .active-fleet-button {
        grid-column: 1 / -1;
    }

    .active-fleet-button {
        width: 100%;
        justify-self: stretch;
    }
    
    .results-toolbar-right .badge {
        display: none;
    }
    .sort-control > span {
        display: none;
    }

    .sort-control select {
        min-width: 85px;
    }
    .ship-list-card {
        display: block;
    }

    .ship-list-stats {
        margin: 14px 0;
        grid-template-columns: repeat(3,1fr);
    }

    .ship-list-stats > div:first-child {
        border-left: 0;
    }

    .ship-list-actions {
        margin-top: 12px;
        flex-wrap: wrap;
    }

    .ship-list-main {
        align-items: flex-start;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        padding: 15px 18px;
        display: block;
    }

    .brand {
        font-size: 13px;
    }

    .brand-mark {
        width: 32px;
        height: 34px;
    }

    .brand small {
        font-size: 7px;
        margin-top: 4px;
    }

    .sidebar>.nav-caption,.sidebar-bottom,.sidebar nav .nav-caption {
        display: none;
    }

    .sidebar nav {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        margin-top: 14px;
    }

    .sidebar nav a {
        margin: 0;
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 11px;
    }

    .sidebar nav a span {
        display: none;
    }

    .sidebar nav a.active {
        box-shadow: none;
        background: #2b4955;
    }

    .main-shell {
        margin-left: 0;
    }

    .topbar {
        height: 51px;
        padding: 0 18px;
    }

    .account-nav {
        font-size: 11px;
        gap: 15px;
    }

    .account-nav .button {
        font-size: 10px;
    }

    main#main-content {
        --main-gutter: 16px;
        padding: 20px 16px 35px;
    }

    .hero {
        min-height: 210px;
        margin-bottom: 20px;
        padding: 25px;
    }

    .hero-art {
        display: none;
    }

    .hero h1 {
        font-size: 37px;
    }

    .hero p {
        font-size: 12px;
    }

    .catalog-layout {
        display: block;
    }

    .filters {
        position: static;
        margin-bottom: 22px;
    }

    .filters .weapon-options {
        max-height: 120px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filters>label {
        display: inline-block;
        width: calc(50% - 7px);
        vertical-align: top;
        margin-right: 10px;
    }

    .filters>label:nth-of-type(even) {
        margin-right: 0;
    }

    .ship-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 12px;
    }

    .ship-card-body {
        padding: 13px 12px;
    }

    .ship-card h2 {
        font-size: 13px;
        min-height: 34px;
    }

    .ship-card-top {
        padding: 10px;
    }

    .ssd-thumb {
        height: 95px;
    }

    .card-actions {
        flex-wrap: wrap;
    }

    .ship-stats strong {
        font-size: 16px;
    }

    .ship-stats div+div {
        padding-left: 10px;
    }

    .revision {
        font-size: 7px;
    }

    .badge.category {
        font-size: 8px;
    }

    .ship-faction {
        font-size: 8px;
    }

    .ship-faction span {
        display: block;
    }

    .system-summary {
        font-size: 9px;
        min-height: 45px;
    }

    .app-footer {
        padding: 18px;
        display: block;
        font-size: 8px;
    }

    .app-footer span+span {
        display: block;
        margin-top: 8px;
    }

    h1 {
        font-size: 29px;
    }

    .page-heading {
        margin-bottom: 20px;
        gap: 15px;
    }

    .page-heading p {
        font-size: 12px;
    }

    .panel {
        padding: 18px;
    }

    .fleet-summary {
        display: block;
    }

    .fleet-row-fields {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .fleet-entry-top {
        grid-template-columns: 22px 82px minmax(0, 1fr);
    }

    .fleet-entry-ssd,
    .fleet-ssd-button,
    .fleet-ssd-missing {
        width: 82px;
        height: 62px;
    }

    .fleet-entry-summary {
        display: block;
    }

    .fleet-entry-costs {
        margin-top: 12px;
        grid-template-columns: repeat(3, 1fr);
    }

    .fleet-entry-tech {
        margin-top: 10px;
        padding-top: 9px;
        border-top: 1px solid #edf0ed;
    }

    .fleet-entry-systems {
        margin-top: 10px;
        grid-template-columns: 1fr 1fr;
    }

    .row-actions {
        grid-column: 2 / -1;
        justify-content: flex-end;
    }

    .fleet-row-fields {
        flex-direction: column;
        align-items: stretch;
    }

        .fleet-row-fields input,
        .fleet-row-fields select {
            width: 100%;
        }

    .fleet-row-main strong {
        font-size: 12px;
    }

    .fleet-row-main .muted {
        font-size: 9px;
    }

    .fleet-index {
        min-width: 18px;
        font-size: 10px;
    }

    .row-actions button {
        font-size: 11px;
        padding: 6px;
    }

    .stat-strip {
        grid-template-columns: repeat(3,1fr);
    }

    .stat-strip>div {
        padding: 0 10px;
    }

    .stat-strip small {
        font-size: 8px;
    }

    .stat-strip em {
        display: block;
        font-size: 10px;
    }

    .form-grid.three {
        grid-template-columns: 1fr;
    }

    .system-editor {
        padding: 14px;
    }

    .system-main {
        grid-template-columns: 1fr 1fr;
    }

    .system-main>label:first-child {
        grid-column: 1/-1;
    }

    .system-buttons {
        grid-column: 1/-1;
        margin-bottom: 12px;
    }

    .system-editor .form-grid.two {
        grid-template-columns: 1fr;
    }

    .editor-savebar {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-savebar .actions {
        justify-content: space-between;
    }

    .tabs button {
        font-size: 11px;
    }

    .auth-body {
        padding: 30px 16px;
    }

    .auth-card {
        padding: 25px;
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
