@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Condensed&display=swap');
.main-nav {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 40px;
}
.nav-link {
    padding: 12px 15px;
    color: #148e72;
    text-decoration: none;
    border-radius: 9px;
    font-size: 14px;
}
.nav-link-active {
    background: #e7f7f2;
    font-weight: 700;
}
.finance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.finance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: #fff;
    border: 1px solid #dce6ed;
    border-radius: 13px;
    color: #74889c;
    font-size: 13px;
}
.finance-card strong {
    color: #173750;
    font-size: 15px;
}
.system-card {
    cursor: pointer;
    transition:
        border-color 0.15s,
        transform 0.15s;
}
.system-card:hover {
    transform: translateY(-1px);
    border-color: #72cfc3;
}
.system-card-selected {
    border-color: #20b9bd;
}
.system-card-warning,
.control-card-warning {
    border-color: #e08b70;
}
.status-dot.connection-offline,
.system-card-warning .status-dot {
    background: #e15555;
}
.warning-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin: 14px 0;
    padding: 12px 16px;
    background: #fff4e3;
    border: 1px solid #f5dfb7;
    border-radius: 12px;
    color: #a66a00;
}
.warning-row[hidden] {
    display: none;
}
.warning-row strong {
    color: #c45139;
}
.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.control-card {
    padding: 22px;
    background: #fff;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    box-shadow: 0 3px 12px #122c4507;
}
.control-heading,
.range-heading,
.metric-bar-label,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.control-heading {
    margin-bottom: 24px;
}
.control-heading h2,
.section-heading h2 {
    margin: 0;
    font-size: 20px;
}
.status-pill {
    padding: 7px 12px;
    border-radius: 7px;
    background: #e6f7f2;
    color: #11876c;
    font-size: 12px;
    font-weight: 700;
}
.status-pill-danger {
    background: #ffeded;
    color: #cf4e4e;
}
.range-heading {
    margin-bottom: 13px;
    font-size: 16px;
}
.range-heading strong {
    white-space: nowrap;
}
.power-range {
    --value: 72%;
    width: 100%;
    height: 10px;
    margin: 0;
    appearance: none;
    border-radius: 99px;
    background: linear-gradient(90deg, #20b893 0%, #07876d var(--value), #e8ecef var(--value), #e8ecef 100%);
    cursor: pointer;
}
.power-range::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    appearance: none;
    border: 3px solid white;
    border-radius: 50%;
    background: #07876d;
    box-shadow: 0 2px 8px #07876d55;
}
.power-range::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid white;
    border-radius: 50%;
    background: #07876d;
    box-shadow: 0 2px 8px #07876d55;
}
.range-scale {
    display: flex;
    justify-content: space-between;
    margin: 8px 0 18px;
    color: #8296a9;
    font-size: 12px;
}
.reading-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #edf1f4;
    color: #74889c;
    font-size: 14px;
}
.reading-row strong {
    color: #173750;
    text-align: right;
}
.metric-bar-label {
    margin: 16px 0 9px;
    font-size: 14px;
}
.meter-track {
    height: 12px;
    overflow: hidden;
    border-radius: 99px;
    background: #e9edf0;
}
.meter-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #20b893, #07876d);
    transition: width 0.25s;
}
.meter-danger {
    background: linear-gradient(90deg, #eac643, #e27a39, #d84d4d);
}
.grid-limit {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 17px 0 24px;
}
.grid-limit strong {
    font-size: 32px;
}
.grid-limit small {
    font-size: 15px;
}
.grid-limit span {
    color: #74889c;
    font-size: 13px;
}
.button-start {
    margin-top: 12px;
    background: #10af8b;
    color: #fff;
}
.game-alert {
    margin: 0 0 14px;
}
.game-alert[hidden] {
    display: none;
}
.event-card {
    min-width: 0;
}
.section-heading {
    margin-bottom: 12px;
}
.event-count {
    color: #8798a8;
    font-size: 12px;
}
.event-list {
    display: grid;
    gap: 0;
    min-height: 72px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.event-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e7edf2;
}
.event-marker {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: #1fb883;
    box-shadow: 0 0 0 4px #e7f7f2;
}
.event-warning {
    background: #e59b21;
    box-shadow: 0 0 0 4px #fff3dd;
}
.event-message {
    font-size: 14px;
    line-height: 1.4;
}
.event-item time {
    color: #8798a8;
    font-size: 12px;
    white-space: nowrap;
}
.empty-events {
    padding: 20px 0;
    color: #8798a8;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    color: #74889c;
    font-size: 13px;
}
.pagination button {
    padding: 7px 10px;
}
.pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}
@media (max-width: 1000px) {
    .finance-strip {
        grid-template-columns: 1fr;
    }
    .system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .control-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .main-nav {
        margin-left: 10px;
    }
    .topbar {
        gap: 10px;
    }
    .operator > span {
        display: none;
    }
    .system-grid {
        grid-template-columns: 1fr;
    }
    .finance-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-heading {
        align-items: flex-start;
        gap: 14px;
        flex-direction: column;
    }
}
.system-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.finance-card strong {
    display: flex;
    align-items: center;
    gap: 7px;
}
.finance-card img {
    width: 29px;
    height: 29px;
    object-fit: contain;
}
.resource-heading {
    display: flex;
    justify-content: space-between;
    margin: 18px 0 8px;
    color: #536a7e;
    font-size: 14px;
}
.resource-heading strong {
    color: #173750;
}
.resource-meter {
    height: 11px;
    overflow: hidden;
    border-radius: 4px;
    background: repeating-linear-gradient(90deg, #e3eaf0 0 15px, transparent 15px 19px);
}
.resource-meter-fill {
    height: 100%;
    width: 100%;
    background: repeating-linear-gradient(90deg, #19b88a 0 15px, transparent 15px 19px);
    transition: width 0.3s;
}
.formula-title {
    margin: 19px 0 8px;
    color: #526a80;
    font-size: 14px;
}
.formula-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    margin-bottom: 11px;
}
.formula-card {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 5px;
    border: 1px solid #dce6ed;
    border-radius: 10px;
    background: #f6f9fc;
    text-align: center;
    flex-direction: column;
}
.formula-card img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}
.formula-card strong {
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}
.formula-op {
    display: grid;
    flex: 0 0 12px;
    place-items: center;
    color: #8296a9;
    font-size: 16px;
    font-weight: 700;
}
.game-alert {
    margin-bottom: 12px;
}
.control-card .reading-row:last-of-type {
    margin-bottom: 0;
}
@media (max-width: 1100px) {
    .formula-row {
        gap: 4px;
    }
    .formula-card strong {
        font-size: 12px;
    }
    .formula-card img {
        width: 31px;
        height: 31px;
    }
}
@media (max-width: 540px) {
    .formula-row {
        flex-wrap: wrap;
    }
    .formula-card {
        flex-basis: 38%;
    }
    .formula-op {
        flex-basis: 10px;
    }
}
:root {
    font-family: 'Ubuntu Condensed', Arial, sans-serif;
}
.top-balance {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-right: 8px;
    padding: 8px 12px;
    border: 1px solid #e0e9ee;
    border-radius: 10px;
    background: #fff;
    color: #60778b;
    font-size: 13px;
    white-space: nowrap;
}
.top-balance img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.top-balance strong {
    color: #173750;
    font-size: 15px;
}
.shop-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.shop-categories,
.shop-products,
.warehouse-panel,
.maintenance-card {
    background: #fff;
    border: 1px solid #dce6ed;
    border-radius: 14px;
}
.shop-categories {
    padding: 16px;
}
.shop-categories > .eyebrow {
    margin: 3px 8px 12px;
}
.category-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 4px 0;
    padding: 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #16896f;
    text-align: left;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}
.category-button img {
    width: 29px;
    height: 29px;
    object-fit: contain;
}
.category-button:hover,
.category-active {
    background: #e7f7f2;
}
.shop-products {
    padding: 18px 20px;
}
.shop-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 4px 0 17px;
    border-bottom: 1px solid #e5edf2;
}
.shop-heading h2 {
    margin: 0 0 4px;
    font-size: 25px;
}
.shop-heading .eyebrow {
    margin: 0 0 4px;
}
.shop-heading .muted {
    margin: 0;
}
.shop-heading-icon,
.product-icon,
.stock-icon,
.part-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: #eef7f8;
}
.shop-heading-icon img,
.product-icon img,
.stock-icon img,
.part-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.product-row {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 76px;
    padding: 10px 2px;
    border-bottom: 1px solid #e5edf2;
}
.product-info {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 4px;
}
.product-info strong {
    font-size: 16px;
    font-weight: 400;
}
.product-info span {
    color: #8296a9;
    font-size: 13px;
}
.button-purchase {
    position: relative;
    flex: 0 0 165px;
    min-height: 40px;
    background: #11b68f;
    color: #fff;
}
.button-purchase:hover:not(:disabled) {
    background: #079877;
}
.button-disabled,
.button-purchase:disabled {
    background: #e8ecef;
    color: #a6b2bc;
    cursor: not-allowed;
}
.button-loading {
    pointer-events: none;
    color: transparent !important;
    position: relative;
}
.button-loading::after {
    content: '';
    position: absolute;
    left: calc(50% - 8px);
    top: calc(50% - 8px);
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff66;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.purchase-dialog {
    width: min(440px, calc(100% - 30px));
    padding: 24px;
    border: 1px solid #dce6ed;
    border-radius: 16px;
    box-shadow: 0 20px 60px #132d4430;
    color: #173750;
}
.purchase-dialog::backdrop {
    background: #10243c66;
}
.purchase-dialog h2 {
    margin: 5px 0 8px;
}
.purchase-dialog form > p.muted {
    line-height: 1.55;
}
.purchase-total {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid #e5edf2;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}
.success-message {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #e7f7f2;
    color: #128466;
}
.success-message[hidden] {
    display: none;
}
.warehouse-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 15px;
    border-bottom: 1px solid #dce6ed;
}
.warehouse-tab {
    padding: 11px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: #627a90;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}
.warehouse-tab-active {
    border-bottom-color: #12b88f;
    color: #078b70;
}
.warehouse-panel {
    padding: 18px;
}
.warehouse-panel[hidden],
[data-product-section][hidden] {
    display: none;
}
.stock-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    min-width: 275px;
    padding: 10px;
    border: 1px solid #e0e9ef;
    border-radius: 12px;
    background: #f8fafc;
}
.stock-card-small {
    min-width: 220px;
}
.stock-icon {
    background: #e8f7f2;
}
.stock-label {
    display: block;
    color: #687f94;
    font-size: 14px;
}
.stock-card strong {
    display: block;
    margin-top: 3px;
    color: #173750;
    font-size: 21px;
    font-weight: 400;
}
.subsection-title {
    margin: 22px 0 12px;
    font-size: 18px;
    font-weight: 400;
}
.stock-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.staff-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.staff-stock-card {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px;
    border: 1px solid #dfe8ef;
    border-radius: 12px;
    background: #fbfcfd;
    flex-direction: column;
    text-align: center;
}
.staff-stock-card[hidden] {
    display: none;
}
.staff-stock-portrait {
    width: 94px;
    height: 94px;
    object-fit: contain;
}
.staff-stock-card > strong {
    font-size: 16px;
    font-weight: 400;
}
.staff-stock-card > span {
    color: #71859a;
    font-size: 13px;
}
.staff-stock-card .staff-salary {
    color: #173750;
}
.button-dismiss {
    width: 100%;
    margin-top: 7px;
    background: #fff0ef;
    color: #ce5050;
}
.button-dismiss:hover {
    background: #ffe4e1;
}
.empty-staff {
    padding: 22px;
    color: #8194a7;
}
.maintenance-note {
    margin-bottom: 14px;
    padding: 14px 17px;
    border: 1px solid #d9ece6;
    border-radius: 11px;
    background: #f0faf6;
    color: #547569;
    line-height: 1.5;
}
.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.maintenance-card {
    padding: 20px;
}
.maintenance-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.maintenance-card-heading h2 {
    margin: 0;
    font-size: 20px;
}
.maintenance-card-heading img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}
.engineer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid #e8eef2;
    border-bottom: 1px solid #e8eef2;
}
.engineer-status {
    display: grid;
    gap: 3px;
}
.engineer-status strong {
    font-size: 14px;
    font-weight: 400;
}
.engineer-status small {
    color: #8193a3;
}
.switch-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #17866e;
    font-size: 13px;
}
.switch-label input {
    accent-color: #0baf88;
}
.maintenance-part {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}
.maintenance-part > div {
    display: grid;
    gap: 4px;
    font-size: 13px;
}
.maintenance-part > div strong {
    font-size: 15px;
    font-weight: 400;
}
.maintenance-part > div span {
    color: #788da0;
}
.maintenance-install {
    width: 100%;
}
.maintenance-install:disabled {
    background: #e8ecef;
    color: #9aabb9;
    cursor: not-allowed;
}
@media (max-width: 850px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    .shop-categories {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .shop-categories > .eyebrow {
        flex-basis: 100%;
    }
    .category-button {
        width: auto;
    }
    .top-balance {
        margin-left: auto;
    }
}
@media (max-width: 620px) {
    .topbar {
        height: auto;
        min-height: 68px;
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .main-nav {
        order: 3;
        flex-basis: 100%;
        overflow: auto;
        margin: 0;
    }
    .nav-link {
        white-space: nowrap;
        padding: 8px 10px;
    }
    .operator {
        margin-left: auto;
    }
    .top-balance {
        margin: 0;
    }
    .shop-products {
        padding: 13px;
    }
    .product-row {
        flex-wrap: wrap;
    }
    .product-info {
        flex-basis: calc(100% - 70px);
    }
    .button-purchase {
        flex: 1 0 100%;
        margin-left: 61px;
    }
    .maintenance-grid {
        grid-template-columns: 1fr;
    }
    .stock-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
    .stock-card,
    .stock-card-small {
        width: 100%;
        min-width: 0;
    }
    .finance-strip {
        grid-template-columns: 1fr;
    }
}
/* Persisted dark theme, carried over from the browser game. */
:root[data-theme='dark'] {
    color-scheme: dark;
}
:root[data-theme='dark'] body {
    background: #07111b;
    color: #e5eef5;
}
:root[data-theme='dark'] .topbar,
:root[data-theme='dark'] .work-card,
:root[data-theme='dark'] .system-card,
:root[data-theme='dark'] .metric-card,
:root[data-theme='dark'] .shop-categories,
:root[data-theme='dark'] .shop-products,
:root[data-theme='dark'] .product-row,
:root[data-theme='dark'] .inventory-card,
:root[data-theme='dark'] .staff-card,
:root[data-theme='dark'] .maintenance-card,
:root[data-theme='dark'] .purchase-dialog {
    background-color: #10202b;
    border-color: #263e4c;
    color: #e5eef5;
}
:root[data-theme='dark'] .brand,
:root[data-theme='dark'] .nav-link,
:root[data-theme='dark'] .section-heading h2,
:root[data-theme='dark'] .system-card h2,
:root[data-theme='dark'] .system-card strong,
:root[data-theme='dark'] .product-info strong,
:root[data-theme='dark'] .inventory-card strong,
:root[data-theme='dark'] .staff-card strong,
:root[data-theme='dark'] .reading-row strong {
    color: #e5eef5;
}
:root[data-theme='dark'] .muted,
:root[data-theme='dark'] .eyebrow,
:root[data-theme='dark'] .reading-row,
:root[data-theme='dark'] .save-meta,
:root[data-theme='dark'] .page-footer,
:root[data-theme='dark'] .operator {
    color: #a9bac7;
}
:root[data-theme='dark'] .top-balance,
:root[data-theme='dark'] .event-item,
:root[data-theme='dark'] .product-row,
:root[data-theme='dark'] .inventory-card,
:root[data-theme='dark'] .staff-card,
:root[data-theme='dark'] .save-meta {
    border-color: #263e4c;
}
:root[data-theme='dark'] .category-button,
:root[data-theme='dark'] .button-quiet,
:root[data-theme='dark'] .theme-toggle {
    background: #172b38;
    border-color: #304858;
    color: #d7e3eb;
}
:root[data-theme='dark'] .category-active {
    background: #123d37;
    color: #5be0b2;
}
:root[data-theme='dark'] .reading-card,
:root[data-theme='dark'] .product-icon,
:root[data-theme='dark'] .warehouse-icon {
    background: #162b37;
}
:root[data-theme='dark'] input,
:root[data-theme='dark'] select {
    background: #0b1821;
    border-color: #304858;
    color: #e5eef5;
}
:root[data-theme='dark'] .resource-meter,
:root[data-theme='dark'] .segment-meter {
    background-color: #263640;
}
:root[data-theme='dark'] .purchase-dialog::backdrop {
    background: rgb(1 8 13 / 72%);
}
:root[data-theme='dark'] .event-item time {
    color: #a9bac7;
}
:root[data-theme='dark'] .alert {
    background-color: #352a1b;
    border-color: #66502b;
    color: #f4d596;
}
.theme-toggle {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #d8e2e8;
    border-radius: 9px;
    background: #fff;
    color: #167c69;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
}
.theme-toggle:hover {
    background: #edf7f4;
}
:root[data-theme='dark'] .theme-toggle:hover {
    background: #203746;
}
:root[data-theme='dark'] .control-card,
:root[data-theme='dark'] .finance-card,
:root[data-theme='dark'] .formula-card,
:root[data-theme='dark'] .stock-card,
:root[data-theme='dark'] .stock-card-small,
:root[data-theme='dark'] .staff-stock-card,
:root[data-theme='dark'] .warehouse-panel,
:root[data-theme='dark'] .maintenance-note,
:root[data-theme='dark'] .maintenance-part,
:root[data-theme='dark'] .shop-heading {
    background-color: #10202b;
    border-color: #263e4c;
    color: #e5eef5;
}
:root[data-theme='dark'] .control-heading,
:root[data-theme='dark'] .range-heading,
:root[data-theme='dark'] .metric-bar-label,
:root[data-theme='dark'] .resource-heading,
:root[data-theme='dark'] .stock-label,
:root[data-theme='dark'] .engineer-row,
:root[data-theme='dark'] .product-info span,
:root[data-theme='dark'] .formula-title {
    color: #c6d3dc;
}
:root[data-theme='dark'] .subvalue,
:root[data-theme='dark'] .stock-card span,
:root[data-theme='dark'] .stock-card-small span,
:root[data-theme='dark'] .staff-salary {
    color: #a9bac7;
}
:root[data-theme='dark'] .warehouse-tab {
    background: #132632;
    border-color: #263e4c;
    color: #c6d3dc;
}
:root[data-theme='dark'] .warehouse-tab-active {
    background: #123d37;
    border-color: #276453;
    color: #68e0b8;
}
:root[data-theme='dark'] .product-row + .product-row,
:root[data-theme='dark'] .event-item + .event-item {
    border-top-color: #263e4c;
}
:root[data-theme='dark'] .button:disabled {
    background-color: #26333c;
    color: #83919a;
}
/* Core page layout and the four-system power-flow schematic. */
:root {
    color-scheme: light;
    font-family: 'Ubuntu Condensed', Arial, sans-serif;
    color: #173750;
    background: #f3f7fa;
}
* {
    box-sizing: border-box;
}
html {
    min-width: 320px;
    min-height: 100%;
}
body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: #f3f7fa;
    color: #173750;
    font-family: 'Ubuntu Condensed', Arial, sans-serif;
    font-size: 16px;
}
button,
input,
select {
    font: inherit;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: not-allowed;
}
[hidden] {
    display: none !important;
}
a {
    color: #078b70;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    border-bottom: 1px solid #dce6ed;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 2px 12px #163a4d0a;
}
.brand {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 9px;
    color: #173750;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.brand small {
    display: block;
    margin-top: 2px;
    color: #8395a5;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
}
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #27c4c9, #098979);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}
.main-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    margin-left: 16px;
}
.nav-link {
    padding: 10px 12px;
    border-radius: 9px;
    color: #16896f;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}
.nav-link:hover,
.nav-link-active {
    background: #e7f7f2;
}
.top-balance {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid #e0e9ee;
    border-radius: 10px;
    background: #fff;
    color: #60778b;
    font-size: 13px;
    white-space: nowrap;
}
.top-balance img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.top-balance strong {
    color: #173750;
    font-size: 15px;
}
.theme-toggle {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #d8e2e8;
    border-radius: 9px;
    background: #fff;
    color: #167c69;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
}
.operator {
    display: flex;
    flex: none;
    align-items: center;
    gap: 10px;
    color: #71869a;
    font-size: 14px;
}
.operator form {
    margin: 0;
}
.page-shell {
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: 22px 24px 16px;
}
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 17px;
}
.page-heading h1 {
    margin: 0;
    color: #14384a;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 500;
    line-height: 1.15;
}
.page-heading .muted {
    margin: 5px 0 0;
    color: #7c91a4;
    font-size: 16px;
}
.eyebrow {
    margin: 0 0 6px;
    color: #8a9cae;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.025em;
}
.muted {
    color: #7c91a4;
}
.connection {
    display: flex;
    flex: none;
    align-items: center;
    gap: 9px;
    color: #13836a;
    font-size: 14px;
}
.connection i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22b77e;
    box-shadow: 0 0 0 4px #e7f7f2;
}
.connection i.connection-offline {
    background: #e15555;
    box-shadow: 0 0 0 4px #ffeded;
}
.finance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.finance-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #fff;
    color: #74889c;
    font-size: 14px;
}
.finance-card strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #173750;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}
.finance-card img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.system-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    margin: 14px 0;
}
.system-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 108px;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    overflow: visible;
    border: 1px solid #dce6ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 12px #122c4507;
    cursor: pointer;
    transition:
        border-color 0.15s,
        transform 0.15s;
}
.system-card:not(:last-child)::after {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: -24px;
    width: 24px;
    height: 3px;
    border-radius: 4px;
    background: linear-gradient(90deg, #b9d5dc 0%, #4cc2c8 45%, #b9d5dc 100%);
    background-size: 32px 100%;
    opacity: var(--flow-opacity, 0.8);
    animation: energy-flow 1.1s linear infinite;
    content: '';
}
.system-card:nth-child(3)::after {
    background-image: linear-gradient(90deg, #bfddd2 0%, #35b891 48%, #bfddd2 100%);
}
@keyframes energy-flow {
    to {
        background-position: 32px 0;
    }
}
.system-card:hover {
    z-index: 1;
    transform: translateY(-1px);
    border-color: #72cfc3;
}
.system-card-selected {
    border-color: #20b9bd;
    box-shadow: 0 0 0 1px #20b9bd33;
}
.system-icon {
    display: grid;
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    place-items: center;
    border-radius: 0;
    background: transparent;
}
.system-icon img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: transparent;
}
.system-card > div {
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 1250px) {
    .system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .system-card::after {
        display: none;
    }
}
.system-card .eyebrow {
    margin: 0 0 5px;
    overflow: hidden;
    color: #71879b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.system-card strong {
    display: block;
    color: #173750;
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
}
.system-card .subvalue {
    display: block;
    margin-top: 3px;
    color: #8194a7;
    font-size: 13px;
    white-space: nowrap;
}
.system-card .status-dot {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #31ad7b;
    box-shadow: 0 0 0 4px #e7f7f2;
}
.system-card-warning {
    border-color: #e08b70;
}
.system-card-warning .status-dot {
    background: #e15555;
    box-shadow: 0 0 0 4px #ffeded;
}
.system-card .system-label-countdown {
    overflow: visible;
    color: #d44949;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-overflow: clip;
    text-transform: none;
    white-space: nowrap;
}
.warning-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 14px 0;
    padding: 11px 15px;
    border: 1px solid #f2dfbd;
    border-radius: 11px;
    background: #fff7e6;
    color: #986400;
    font-size: 15px;
}
.warning-row strong {
    color: #c54d3d;
}
.control-card-warning {
    border-color: #e08b70;
}
.control-card[hidden],
.control-pane[hidden] {
    display: none !important;
}
.operation-work-area {
    align-items: start;
}
.selected-control-grid {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
}
.control-pane {
    min-width: 0;
}
.system-card[role='button']:focus-visible,
.control-tab:focus-visible {
    outline: 2px solid #159bce;
    outline-offset: 3px;
}
.equipment-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.metric-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    column-gap: 9px;
    padding: 10px;
    border: 1px solid #dce6ed;
    border-radius: 10px;
    background: #f6f9fc;
}
.metric-card img {
    grid-row: span 2;
    width: 36px;
    height: 36px;
    object-fit: contain;
}
.metric-card span {
    color: #74889c;
    font-size: 13px;
}
.metric-card strong {
    color: #173750;
    font-size: 15px;
    font-weight: 400;
}
.reactor-readings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 20px;
    margin: 20px 0 18px;
}
.reactor-reading {
    --reading-tint: #e4f7ee;
    display: flex;
    min-width: 0;
    min-height: 84px;
    align-items: center;
    gap: 18px;
    padding: 4px 12px;
    border-radius: 3px;
}
.reactor-reading-temperature {
    --reading-tint: #e4f5fd;
}
.reactor-reading-fuel {
    --reading-tint: #fff4dd;
}
.reactor-reading-consumption {
    --reading-tint: #f0edfc;
}
.network-reading-surplus {
    --reading-tint: #e7f7f2;
}
.network-reading-loss {
    --reading-tint: #fff4dd;
}
.network-reading-capacity {
    --reading-tint: #e4f5fd;
}
.reactor-reading-icon {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    place-items: center;
    border-radius: 22px;
    background: var(--reading-tint);
}
.reactor-reading-icon img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.reactor-reading-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.reactor-reading-label {
    color: #173750;
    font-size: 16px;
    line-height: 1.3;
}
.reactor-reading-copy strong {
    color: #173750;
    font-size: 25px;
    font-weight: 400;
    line-height: 1.15;
    white-space: nowrap;
}
.system-reading-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 14px;
}
.system-reading-grid-network {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.system-reading-card {
    display: grid;
    min-width: 0;
    min-height: 100px;
    align-content: center;
    justify-items: center;
    gap: 7px;
    padding: 10px 8px;
    border: 1px solid #dce6ed;
    border-radius: 10px;
    background: #f6f9fc;
    text-align: center;
}
.system-reading-card img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.system-reading-card > span {
    color: #74889c;
    font-size: 14px;
}
.system-reading-card strong {
    color: #173750;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
}
.system-reading-card strong b {
    font-weight: 400;
}
.grid-surplus-formula {
    margin-top: 6px;
}
.equalizer-bar {
    display: flex;
    width: 100%;
    height: 16px;
    align-items: stretch;
    gap: 3px;
}
.equalizer-bar__segment {
    display: block;
    min-width: 0;
    flex: 1 1 0;
    border-radius: 3px;
    background: #dce6ed;
    transition: background 0.25s ease;
}
:root[data-theme='dark'] .equalizer-bar__segment {
    background: #263640;
}
.control-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 32px;
    margin: 0 0 12px;
}
.overheat-inline-warning {
    margin-left: auto;
    color: #c45139;
    font-size: 14px;
    font-weight: 400;
    text-align: right;
}
.overheat-inline-warning[hidden] {
    display: none;
}
.control-status-row .button-start {
    margin-top: 0;
}
@media (max-width: 520px) {
    .control-status-row {
        flex-wrap: wrap;
    }
    .overheat-inline-warning {
        text-align: right;
    }
}
:root[data-theme='dark'] .system-reading-card {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .system-reading-card > span {
    color: #a9bac7;
}
:root[data-theme='dark'] .system-reading-card strong {
    color: #e5eef5;
}
:root[data-theme='dark'] .grid-surplus-formula .formula-card {
    border-color: #263e4c;
    background: #10202b;
    color: #e5eef5;
}
.warehouse-stock {
    display: flex;
    width: fit-content;
    max-width: 100%;
    min-height: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #fff;
}
.warehouse-stock[hidden],
.warehouse-staff-row[hidden],
.warehouse-personnel[hidden] {
    display: none !important;
}
.warehouse-stock__icon {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    place-items: center;
    border-radius: 18px;
    background: #eef4f7;
}
.warehouse-stock__icon--fuel {
    background: #fff4dd;
}
.warehouse-stock__icon--crystal {
    background: #e5f7fb;
}
.warehouse-stock__icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}
.warehouse-stock__details {
    min-width: 0;
}
.warehouse-stock__label {
    color: #173750;
    font-size: 16px;
}
.warehouse-stock__value {
    color: #173750;
    font-size: 25px;
    line-height: 1.2;
    white-space: nowrap;
}
.warehouse-stock-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.warehouse-stock-list .warehouse-stock {
    min-width: 240px;
}
.warehouse-stock-list .warehouse-stock__icon img {
    width: 52px;
    height: 52px;
}
.warehouse-personnel {
    width: fit-content;
    max-width: 100%;
    padding: 4px 12px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #fff;
}
.warehouse-staff-row {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #dce6ed;
}
.warehouse-staff-row:last-child {
    border-bottom: 0;
}
.warehouse-staff-row__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.warehouse-staff-row__person {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}
.warehouse-staff-row__portrait {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #eef3f6;
}
.warehouse-staff-row__portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}
.warehouse-staff-row__details {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.warehouse-staff-row__details strong {
    color: #173750;
    font-size: 16px;
    font-weight: 400;
}
.warehouse-staff-row__details > span {
    color: #74889c;
    font-size: 14px;
}
.warehouse-staff-row__details > .staff-salary {
    color: #173750;
}
.warehouse-personnel-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 20px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #fff;
    color: #74889c;
    text-align: center;
}
.warehouse-personnel-empty p {
    margin: 0;
}
.formula-tooltip {
    position: relative;
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 8px;
    cursor: help;
    outline: none;
}
.formula-tooltip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.formula-tooltip::after {
    position: absolute;
    z-index: 50;
    bottom: calc(100% + 10px);
    left: 50%;
    width: max-content;
    max-width: min(300px, 75vw);
    padding: 11px 14px;
    transform: translate(-50%, 5px);
    border: 1px solid #31536b;
    border-radius: 10px;
    background: #173750;
    box-shadow: 0 8px 24px #10283d30;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0.16s ease;
}
.formula-tooltip::before {
    position: absolute;
    z-index: 51;
    bottom: calc(100% + 4px);
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, 5px) rotate(45deg);
    border-right: 1px solid #31536b;
    border-bottom: 1px solid #31536b;
    background: #173750;
    content: '';
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0.16s ease;
}
.formula-tooltip:hover,
.formula-tooltip:focus-visible {
    z-index: 52;
}
.formula-tooltip:hover::after,
.formula-tooltip:focus-visible::after,
.formula-tooltip:hover::before,
.formula-tooltip:focus-visible::before {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}
.formula-tooltip:focus-visible {
    outline: 2px solid #16a983;
    outline-offset: 2px;
}
:root[data-theme='dark'] .formula-tooltip::after,
:root[data-theme='dark'] .formula-tooltip::before {
    border-color: #526c7e;
    background: #e7f0f6;
    color: #173750;
}
:root[data-theme='dark'] .warehouse-stock,
:root[data-theme='dark'] .warehouse-personnel,
:root[data-theme='dark'] .warehouse-personnel-empty {
    border-color: #263e4c;
    background: #10202b;
    color: #e5eef5;
}
:root[data-theme='dark'] .warehouse-stock__label,
:root[data-theme='dark'] .warehouse-stock__value,
:root[data-theme='dark'] .warehouse-staff-row__details strong,
:root[data-theme='dark'] .warehouse-staff-row__details > .staff-salary {
    color: #e5eef5;
}
:root[data-theme='dark'] .warehouse-staff-row__details > span {
    color: #a9bac7;
}
:root[data-theme='dark'] .warehouse-staff-row {
    border-color: #263e4c;
}
@media (max-width: 620px) {
    .warehouse-stock {
        padding: 10px 12px;
    }
    .warehouse-stock__icon {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }
    .warehouse-stock__icon img {
        width: 46px;
        height: 46px;
    }
    .warehouse-stock__value {
        font-size: 22px;
    }
    .warehouse-stock-list .warehouse-stock {
        min-width: min(100%, 230px);
    }
}
@media (max-width: 620px) {
    .system-reading-grid,
    .system-reading-grid-network {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .system-reading-card {
        min-height: 86px;
    }
    .system-reading-card strong {
        font-size: 16px;
    }
}

/* Cooling balance keeps its equation layout, with the same icon tiles used by reactor readings. */
.control-card[data-control='cooling'] .formula-card {
    min-height: 124px;
    gap: 9px;
    padding: 10px 6px;
    border-color: transparent;
    background: transparent;
}
.control-card[data-control='cooling'] .formula-tooltip {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 17px;
    background: #e4f7ee;
}
.control-card[data-control='cooling'] .formula-tooltip img {
    width: 44px;
    height: 44px;
}
.control-card[data-control='cooling'] .formula-card:nth-of-type(1) .formula-tooltip {
    background: #fff0ee;
}
.control-card[data-control='cooling'] .formula-card:nth-of-type(3) .formula-tooltip {
    background: #fff4df;
}
.control-card[data-control='cooling'] .formula-card:nth-of-type(4) .formula-tooltip {
    background: #e7f7f2;
}
.control-card[data-control='cooling'] .formula-card strong {
    font-size: 16px;
}
@media (max-width: 1100px) {
    .control-card[data-control='cooling'] .formula-tooltip {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    .control-card[data-control='cooling'] .formula-tooltip img {
        width: 38px;
        height: 38px;
    }
    .control-card[data-control='cooling'] .formula-card {
        min-height: 112px;
    }
    .control-card[data-control='cooling'] .formula-card strong {
        font-size: 14px;
    }
}

.control-card[data-control='generator'] .reactor-reading-icon.formula-tooltip {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 22px;
}
.control-card[data-control='generator'] .reactor-reading-icon.formula-tooltip img {
    width: 52px;
    height: 52px;
}

.control-card[data-control='grid'] .grid-surplus-formula .formula-card {
    min-height: 124px;
    gap: 9px;
    padding: 10px 6px;
    border-color: transparent;
    background: transparent;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-tooltip {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 17px;
    background: #e7f7f2;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-tooltip img {
    width: 44px;
    height: 44px;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-card:nth-of-type(2) .formula-tooltip {
    background: #fff4df;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-card:nth-of-type(3) .formula-tooltip {
    background: #e4f5fd;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-card:nth-of-type(4) .formula-tooltip {
    background: #f0edfc;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-card:nth-of-type(5) .formula-tooltip {
    background: #fff0ee;
}
.control-card[data-control='grid'] .grid-surplus-formula .formula-card strong {
    font-size: 16px;
}
@media (max-width: 1100px) {
    .control-card[data-control='grid'] .grid-surplus-formula .formula-tooltip {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    .control-card[data-control='grid'] .grid-surplus-formula .formula-tooltip img {
        width: 38px;
        height: 38px;
    }
    .control-card[data-control='grid'] .grid-surplus-formula .formula-card {
        min-height: 112px;
    }
    .control-card[data-control='grid'] .grid-surplus-formula .formula-card strong {
        font-size: 14px;
    }
}
.grid-load-details {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 14px;
    color: #74889c;
    font-size: 13px;
}
.grid-load-details strong {
    color: #173750;
    font-weight: 400;
}
@media (max-width: 520px) {
    .grid-load-details {
        flex-wrap: wrap;
        gap: 4px 12px;
    }
}

.system-level-badge {
    position: absolute;
    right: 10px;
    bottom: 9px;
    padding: 4px 7px;
    border: 1px solid #d8eee7;
    border-radius: 6px;
    background: #edf8f4;
    color: #07876d;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1;
    white-space: nowrap;
}
:root[data-theme='dark'] .system-level-badge {
    border-color: #285245;
    background: #16372e;
    color: #75d7b7;
}

@media (max-width: 620px) {
    .reactor-readings {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin: 14px 0;
    }
    .reactor-reading {
        min-height: 70px;
        gap: 13px;
    }
    .reactor-reading-icon {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 18px;
    }
    .reactor-reading-icon img {
        width: 44px;
        height: 44px;
    }
    .reactor-reading-copy strong {
        font-size: 21px;
    }
}
.reactor-start-message {
    margin: 10px 0 0;
    color: #b84d4d;
}
.reactor-start-message[hidden] {
    display: none;
}

/* Station overview and research. */
.station-page {
    width: calc(100% - var(--sidebar-width));
    max-width: none;
}
.station-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.station-heading h1,
.research-heading h1 {
    margin: 0;
    color: #173750;
    font-size: 30px;
    font-weight: 400;
}
.station-heading .eyebrow,
.research-heading .eyebrow {
    margin: 0 0 5px;
}
.station-variants {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #688096;
}
.station-variants button {
    width: 34px;
    height: 34px;
    border: 1px solid #d5e4ed;
    border-radius: 8px;
    background: #fff;
    color: #173750;
    font: inherit;
    cursor: pointer;
}
.station-variants button[aria-pressed='true'] {
    border-color: #0caa89;
    background: #e2f7ef;
    color: #087c64;
}
.station-map {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid #d5e4ed;
    border-radius: 16px;
    background: #102c43;
}
.station-map__image {
    display: block;
    width: 100%;
    height: auto;
}
.station-node {
    position: absolute;
    left: var(--node-x);
    top: var(--node-y);
    display: grid;
    min-width: 130px;
    gap: 2px;
    padding: 10px 14px;
    transform: translate(-50%, -50%);
    border: 1px solid #a9fff0;
    border-radius: 11px;
    background: rgb(11 38 52 / 88%);
    box-shadow: 0 4px 18px #00132180;
    color: #fff;
    text-decoration: none;
    transition:
        transform 0.15s,
        background 0.15s;
}
.station-node:hover,
.station-node:focus-visible {
    transform: translate(-50%, -50%) scale(1.05);
    background: #075e5d;
    outline: 2px solid #8ffff0;
    outline-offset: 2px;
}
.station-node span {
    font-size: 17px;
}
.station-node small {
    color: #bce9e3;
    font-size: 12px;
}
.station-map[data-variant='1'] .station-node--reactor {
    --node-x: 25%;
    --node-y: 23%;
}
.station-map[data-variant='1'] .station-node--warehouse {
    --node-x: 75%;
    --node-y: 23%;
}
.station-map[data-variant='1'] .station-node--shop {
    --node-x: 22%;
    --node-y: 62%;
}
.station-map[data-variant='1'] .station-node--research {
    --node-x: 77%;
    --node-y: 61%;
}
.station-map[data-variant='2'] .station-node--reactor {
    --node-x: 23%;
    --node-y: 24%;
}
.station-map[data-variant='2'] .station-node--warehouse {
    --node-x: 25%;
    --node-y: 60%;
}
.station-map[data-variant='2'] .station-node--shop {
    --node-x: 75%;
    --node-y: 65%;
}
.station-map[data-variant='2'] .station-node--research {
    --node-x: 80%;
    --node-y: 24%;
}
.station-map[data-variant='3'] .station-node--reactor {
    --node-x: 20%;
    --node-y: 24%;
}
.station-map[data-variant='3'] .station-node--warehouse {
    --node-x: 78%;
    --node-y: 23%;
}
.station-map[data-variant='3'] .station-node--shop {
    --node-x: 22%;
    --node-y: 69%;
}
.station-map[data-variant='3'] .station-node--research {
    --node-x: 78%;
    --node-y: 68%;
}
.research-heading {
    margin-bottom: 20px;
}
.research-heading p:last-child {
    margin: 8px 0 0;
    color: #74889c;
    font-size: 16px;
}
.research-card {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 900px;
    padding: 22px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
}
.research-card__icon {
    display: grid;
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    place-items: center;
    border-radius: 20px;
    background: #e4f7ee;
}
.research-card__icon img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}
.research-card__body {
    flex: 1;
    min-width: 0;
}
.research-card__body h2 {
    margin: 4px 0;
    font-size: 22px;
    font-weight: 400;
}
.research-card__body p {
    margin: 0;
    color: #688096;
    font-size: 16px;
}
.research-card__category {
    color: #008e76;
    font-size: 12px;
}
.research-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    color: #688096;
    font-size: 14px;
}
.research-card__action {
    display: grid;
    gap: 8px;
    min-width: 150px;
    text-align: center;
}
.research-status {
    color: #008e76;
    font-size: 14px;
}
:root[data-theme='dark'] .research-card {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .research-heading h1,
:root[data-theme='dark'] .station-heading h1 {
    color: #e5eef5;
}
@media (max-width: 700px) {
    .station-page {
        width: 100%;
    }
    .station-heading {
        align-items: start;
        flex-direction: column;
    }
    .station-node {
        min-width: 0;
        padding: 6px 8px;
    }
    .station-node span {
        font-size: 13px;
    }
    .station-node small {
        display: none;
    }
    .research-card {
        align-items: start;
        flex-wrap: wrap;
    }
    .research-card__action {
        width: 100%;
    }
}
.maintenance-hint {
    margin: 12px 0;
    color: #74889c;
    font-size: 14px;
    line-height: 1.45;
}
.maintenance-card {
    padding: 16px;
}
.maintenance-card-heading {
    margin-bottom: 10px;
}
.maintenance-card-heading h2 {
    font-size: 18px;
}
.maintenance-card-heading img {
    width: 52px;
    height: 52px;
}
.maintenance-install {
    width: auto;
    min-width: 190px;
}
.station-save-card {
    grid-column: 1 / -1;
}
.status-pill-warning {
    background: #fff4d9;
    color: #ad7100;
}
.work-area {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
    gap: 14px;
    margin-top: 16px;
}
.work-card {
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px #122c4507;
}
.work-card h2 {
    margin: 0 0 13px;
    color: #173750;
    font-size: 20px;
    font-weight: 500;
}
.save-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #edf1f4;
    color: #74889c;
    font-size: 14px;
}
.save-meta strong {
    color: #173750;
    text-align: right;
}
.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #dce6ed;
    color: #8395a5;
    font-size: 12px;
}
.button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 0;
    border-radius: 9px;
    font-weight: 600;
}
.button-primary {
    background: #10b58d;
    color: #fff;
}
.button-primary:hover:not(:disabled) {
    background: #079877;
}
.button-quiet {
    border: 1px solid #dce6ed;
    background: #f7fafc;
    color: #637d91;
}
.button:disabled {
    opacity: 0.52;
}
.alert {
    padding: 12px 15px;
    border: 1px solid #f0c9c9;
    border-radius: 10px;
    background: #fff0f0;
    color: #a63b3b;
}
.game-alert {
    margin: 0 0 12px;
}
.game-alert[hidden],
.success-message[hidden] {
    display: none;
}
.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: radial-gradient(ellipse at 20% 10%, #e4f6f3 0, transparent 40%), #f2f6f9;
}
.auth-card {
    width: min(100%, 440px);
    padding: 34px;
    border: 1px solid #dce6ed;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 60px #17375012;
}
.auth-card h1 {
    margin: 24px 0 7px;
    color: #173750;
    font-size: 30px;
    font-weight: 500;
}
.auth-card > .muted {
    margin: 0 0 20px;
    line-height: 1.5;
}
.form-stack {
    display: grid;
    gap: 14px;
}
.form-stack label {
    display: grid;
    gap: 6px;
    color: #526a7e;
    font-size: 14px;
}
.form-stack input:not([type='checkbox']) {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d3e0e8;
    border-radius: 8px;
    background: #fff;
    color: #173750;
}
.form-stack input:focus {
    outline: 2px solid #36b9a2;
    outline-offset: 1px;
}
.form-stack .check-line {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-foot {
    margin: 18px 0 0;
    color: #7b8fa0;
    font-size: 14px;
}
.form-foot a {
    font-weight: 600;
}
@media (max-width: 1100px) {
    .system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .system-card::after {
        display: none;
    }
    .work-area {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .main-nav {
        order: 5;
        flex-basis: 100%;
        overflow-x: auto;
        margin: 0;
    }
    .top-balance {
        margin-left: auto;
    }
}
@media (max-width: 700px) {
    .page-shell {
        padding: 16px 12px 12px;
    }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .system-grid,
    .finance-strip,
    .control-grid,
    .maintenance-grid {
        grid-template-columns: 1fr;
    }
    .system-card::after {
        display: none;
    }
    .finance-card {
        align-items: center;
        flex-direction: row;
    }
    .page-footer {
        flex-wrap: wrap;
    }
    .operator > span {
        display: none;
    }
    .auth-card {
        padding: 25px 21px;
    }
}

/* Shared live telemetry strip, matching the active station header. */
.topbar {
    gap: 10px;
}
.top-telemetry {
    grid-template-columns: minmax(142px, 220px) minmax(220px, 1fr);
}
.top-telemetry {
    display: grid;
    flex: 1 1 640px;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    gap: 5px;
    align-items: stretch;
}
.top-metric {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 1px solid #dce6ed;
    border-radius: 10px;
    background: #fff;
}
.top-metric-icon {
    display: block;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.top-metric-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}
.top-metric-label {
    overflow: hidden;
    color: #71879b;
    font-size: 10px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-metric-copy strong {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 3px;
    color: #173750;
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
}
.top-metric-copy strong b {
    overflow: hidden;
    font-weight: 400;
    text-overflow: ellipsis;
}
.top-metric-copy strong small {
    color: #74889c;
    font-size: 11px;
}
.top-metric-level {
    position: absolute;
    top: 50%;
    right: 8px;
    color: #173750;
    font-size: 12px;
    transform: translateY(-50%);
}
.top-metric-status {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #31ad7b;
    box-shadow: 0 0 0 3px #e7f7f2;
}
.top-metric-warning {
    border-color: #e08b70;
}
.top-metric-warning .top-metric-status {
    background: #e15555;
    box-shadow: 0 0 0 3px #ffeded;
}
.top-metric-currency {
    flex: 0 0 142px;
}
.top-metric-currency .top-metric-label {
    color: #078b70;
    font-weight: 600;
}
.top-metric-currency .top-metric-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}
.top-metric-currency .top-metric-copy strong {
    font-size: 14px;
}
.top-metric-currency .top-metric-copy strong small {
    font-size: 10px;
}
:root[data-theme='dark'] .top-metric {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .top-metric-copy strong,
:root[data-theme='dark'] .top-metric-level {
    color: #e5eef5;
}
:root[data-theme='dark'] .top-metric-label,
:root[data-theme='dark'] .top-metric-copy strong small {
    color: #a9bac7;
}
@media (max-width: 1450px) {
    .main-nav {
        margin-left: 6px;
    }
    .nav-link {
        padding-right: 8px;
        padding-left: 8px;
    }
    .top-telemetry {
        flex-basis: 100%;
        order: 6;
    }
    .theme-toggle {
        margin-left: auto;
    }
}
@media (max-width: 700px) {
    .top-telemetry {
        flex: 1 0 100%;
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        overflow-x: auto;
        order: 6;
    }
    .top-metric {
        min-height: 44px;
    }
    .top-metric-currency {
        flex-basis: auto;
    }
}

/* Persistent desktop sidebar for app navigation and account controls. */
:root {
    --sidebar-width: 248px;
}
.world-page {
    min-height: calc(100vh - 76px);
}
.world-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 2px 0 22px;
    color: #8597a7;
    font-size: 13px;
}
.world-breadcrumbs a {
    color: #148e72;
    text-decoration: none;
}
.world-breadcrumbs a:hover {
    text-decoration: underline;
}
.world-heading {
    margin-bottom: 22px;
}
.world-heading .eyebrow {
    margin: 0 0 5px;
    color: #8194a5;
    font-size: 12px;
    font-weight: 700;
}
.world-heading h1 {
    margin: 0;
    color: #173750;
    font-size: 34px;
    font-weight: 500;
}
.world-heading > p:last-child {
    margin: 8px 0 0;
    color: #74889c;
    font-size: 16px;
}
.world-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 20px;
    color: #74889c;
    font-size: 13px;
}
.world-summary strong {
    margin-left: 15px;
    color: #078b70;
    font-size: 26px;
    font-weight: 500;
}
.world-summary strong:first-child {
    margin-left: 0;
}
.world-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.world-card {
    position: relative;
    display: flex;
    min-height: 185px;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #f5fafc);
    color: #173750;
    text-decoration: none;
    transition:
        transform 0.16s,
        border-color 0.16s,
        box-shadow 0.16s;
}
.world-card:hover,
.world-card:focus-visible {
    transform: translateY(-2px);
    border-color: #36bda3;
    box-shadow: 0 9px 24px #17375012;
    outline: none;
}
.world-card-kicker {
    color: #778da0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.world-card h2 {
    margin: 12px 0 7px;
    font-size: 22px;
    font-weight: 500;
}
.world-card p {
    margin: 0 0 20px;
    color: #71869a;
    font-size: 14px;
    line-height: 1.45;
}
.world-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e4edf2;
    color: #73889b;
    font-size: 12px;
}
.world-card-footer b {
    color: #078b70;
    font-weight: 600;
}
.world-system-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.world-system-card {
    min-height: 175px;
    padding-top: 24px;
}
.world-system-card h2 {
    margin-top: 19px;
}
.world-star-mark {
    position: absolute;
    top: 15px;
    right: 18px;
    color: #12ae8a;
    font-size: 21px;
}
.world-card-current {
    border-color: #18b994;
    background: linear-gradient(145deg, #f4fffb, #e8f8f2);
}
.station-orbit-map {
    position: relative;
    display: grid;
    min-height: 490px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 22px;
    padding: 30px;
    overflow: hidden;
    border: 1px solid #1e4b66;
    border-radius: 18px;
    background: radial-gradient(ellipse at 50% 52%, #123d59 0%, #0b263c 55%, #061725 100%);
}
.station-orbit-map::before,
.station-orbit-map::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(480px, 55vw);
    height: min(260px, 31vw);
    border: 1px solid #75cdd355;
    border-radius: 50%;
    content: '';
    transform: translate(-50%, -50%) rotate(-18deg);
    pointer-events: none;
}
.station-orbit-map::after {
    width: min(700px, 80vw);
    height: min(370px, 42vw);
    transform: translate(-50%, -50%) rotate(14deg);
}
.orbit-star,
.orbit-object {
    position: relative;
    z-index: 1;
    display: grid;
    justify-self: center;
    gap: 4px;
    width: min(100%, 270px);
    padding: 16px 18px;
    border: 1px solid #7ad6cf66;
    border-radius: 13px;
    background: #102c40e8;
    box-shadow: 0 8px 28px #0003;
    color: #eaf7ff;
}
.orbit-star {
    grid-column: 1 / -1;
    width: 180px;
    justify-items: center;
    border-color: #f1c87899;
    border-radius: 50%;
    background: radial-gradient(circle, #ffdf91 0, #c77a3a 55%, #643b35 100%);
    color: #281a1a;
    aspect-ratio: 1;
    align-content: center;
}
.orbit-star span,
.orbit-object span {
    color: #a7c3d2;
    font-size: 12px;
}
.orbit-star strong,
.orbit-object strong {
    font-size: 17px;
    font-weight: 500;
}
.orbit-star span {
    color: #67462e;
}
.orbit-object small {
    color: #9ab4c5;
    font-size: 12px;
}
.orbit-object--planet {
    grid-column: 1;
    grid-row: 2;
}
.orbit-object--asteroids {
    grid-column: 2;
    grid-row: 2;
}
.orbit-object--station {
    grid-column: 1;
    grid-row: 3;
}
.orbit-object--research {
    grid-column: 2;
    grid-row: 3;
}
.world-enter-button {
    display: inline-flex;
    width: fit-content;
    margin-top: 18px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #10af8b;
    color: #fff;
    text-decoration: none;
}
.world-visit-note {
    margin-top: 18px;
    color: #74889c;
}
:root[data-theme='dark'] .world-heading h1 {
    color: #e5eef5;
}
:root[data-theme='dark'] .world-card {
    border-color: #263e4c;
    background: linear-gradient(145deg, #132631, #10202b);
    color: #e5eef5;
}
:root[data-theme='dark'] .world-card-current {
    border-color: #138d71;
    background: linear-gradient(145deg, #102c29, #112a2a);
}
:root[data-theme='dark'] .world-card-footer {
    border-color: #263e4c;
}
@media (max-width: 640px) {
    .world-grid,
    .world-system-grid {
        grid-template-columns: 1fr;
    }
    .world-heading h1 {
        font-size: 28px;
    }
    .station-orbit-map {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 22px 16px;
    }
    .station-orbit-map::before,
    .station-orbit-map::after {
        width: 92vw;
        height: 55vw;
    }
    .orbit-star,
    .orbit-object--planet,
    .orbit-object--asteroids,
    .orbit-object--station,
    .orbit-object--research {
        grid-column: 1;
        grid-row: auto;
    }
}
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 22px 16px 16px;
    border-right: 1px solid #dce6ed;
    background: #fff;
    box-shadow: 2px 0 14px #163a4d08;
}
.sidebar-brand {
    margin: 0 0 30px;
    padding: 0 6px;
}
.main-nav {
    display: grid;
    order: 0;
    flex: none;
    flex-basis: auto;
    gap: 5px;
    margin: 0;
}
.nav-link {
    width: 100%;
    padding: 12px 13px;
}
.sidebar-spacer {
    flex: 1;
}
.sidebar-account {
    display: grid;
    gap: 12px;
    padding: 16px 4px 0;
    border-top: 1px solid #e7edf2;
}
.sidebar-user {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: #8296a9;
    font-size: 12px;
}
.sidebar-user strong {
    overflow: hidden;
    color: #173750;
    font-size: 15px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sidebar-actions form {
    margin: 0;
}
.sidebar-actions .button {
    width: 100%;
    min-height: 38px;
}
.sidebar-actions .theme-toggle {
    display: flex;
    width: 100%;
    height: 38px;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 16px;
}
.theme-toggle-label {
    font-size: 14px;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    margin-left: var(--sidebar-width);
    padding: 10px 16px;
}
.top-telemetry {
    width: 100%;
    flex: 1 1 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.page-shell {
    width: min(calc(100% - var(--sidebar-width)), 1600px);
    margin: 0 0 0 var(--sidebar-width);
    padding: 22px 24px 16px;
}
:root[data-theme='dark'] .app-sidebar {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .sidebar-account {
    border-color: #263e4c;
}
:root[data-theme='dark'] .sidebar-user strong {
    color: #e5eef5;
}
@media (max-width: 1250px) {
    :root {
        --sidebar-width: 220px;
    }
    .topbar {
        padding-right: 10px;
        padding-left: 10px;
    }
    .top-telemetry {
        gap: 4px;
    }
    .top-metric {
        gap: 5px;
        padding-right: 5px;
        padding-left: 5px;
    }
    .top-metric-icon {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }
    .top-metric-copy strong {
        font-size: 13px;
    }
}
@media (max-width: 640px) {
    .app-sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 10px 14px;
        border-right: 0;
        border-bottom: 1px solid #dce6ed;
    }
    .sidebar-brand {
        margin: 0;
        padding: 0;
    }
    .sidebar-brand small {
        display: none;
    }
    .main-nav {
        display: flex;
        min-width: 0;
        flex: 1 1 auto;
        overflow-x: auto;
        gap: 4px;
    }
    .nav-link {
        width: auto;
        padding: 10px 11px;
    }
    .sidebar-spacer {
        display: none;
    }
    .sidebar-account {
        display: flex;
        flex: none;
        align-items: center;
        gap: 8px;
        padding: 0;
        border: 0;
    }
    .sidebar-user {
        display: none;
    }
    .sidebar-actions {
        display: flex;
        gap: 7px;
    }
    .sidebar-actions .theme-toggle {
        width: 40px;
    }
    .theme-toggle-label {
        display: none;
    }
    .topbar {
        margin-left: 0;
    }
    .page-shell {
        width: 100%;
        margin-left: 0;
    }
}
@media (max-width: 640px) {
    .app-sidebar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .sidebar-brand {
        margin-right: auto;
    }
    .main-nav {
        order: 3;
        flex-basis: 100%;
    }
    .topbar {
        position: relative;
        overflow-x: auto;
    }
    .top-telemetry {
        min-width: 740px;
    }
    .page-shell {
        padding: 16px 12px 12px;
    }
}
:root[data-theme='dark'] .nav-link-active {
    background: #123d37;
    color: #5be0b2;
}

/* Keep station navigation, theme, and account controls in the left rail. */
.app-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 40 !important;
    display: flex !important;
    width: var(--sidebar-width, 248px) !important;
    height: 100vh !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 22px 16px 16px !important;
    overflow-y: auto;
}
.app-sidebar .main-nav {
    display: grid !important;
    order: 0 !important;
    flex: none !important;
    flex-basis: auto !important;
    overflow: visible !important;
    margin: 0 !important;
}
.app-sidebar .nav-link {
    width: 100% !important;
}
.app-sidebar .sidebar-account {
    display: grid !important;
    flex: none !important;
    padding: 16px 4px 0 !important;
    border-top: 1px solid #e7edf2 !important;
}
.app-sidebar .sidebar-user {
    display: grid !important;
}
.app-sidebar .sidebar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
}
.app-sidebar .theme-toggle-label {
    display: inline !important;
}
.topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    display: flex !important;
    min-height: 76px !important;
    margin-left: var(--sidebar-width, 248px) !important;
    padding: 10px 16px !important;
}
.topbar .top-telemetry {
    width: 100%;
    flex: 1 1 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.page-shell {
    width: min(calc(100% - var(--sidebar-width, 248px)), 1600px) !important;
    margin: 0 0 0 var(--sidebar-width, 248px) !important;
}
@media (max-width: 640px) {
    .app-sidebar {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100px;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px;
        padding: 10px 14px !important;
        overflow: visible;
    }
    .app-sidebar .sidebar-brand {
        margin: 0;
    }
    .app-sidebar .main-nav {
        display: flex !important;
        min-width: 0;
        flex: 1 1 auto !important;
        overflow-x: auto !important;
    }
    .app-sidebar .sidebar-spacer {
        display: none;
    }
    .app-sidebar .sidebar-account {
        display: grid !important;
        padding: 0 !important;
        border: 0 !important;
    }
    .app-sidebar .sidebar-user {
        display: none !important;
    }
    .app-sidebar .sidebar-actions {
        display: flex !important;
        gap: 6px;
    }
    .app-sidebar .theme-toggle {
        width: 40px !important;
    }
    .app-sidebar .theme-toggle-label {
        display: none !important;
    }
    .topbar {
        margin-left: 0 !important;
    }
    .page-shell {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* Match the Mantine Tabs list and active indicator used by the original controls. */
.control-tabs {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    margin: 0 0 16px;
    border: 0;
}
.control-tabs::before {
    position: absolute;
    inset: auto 0 0;
    border-bottom: 1px solid #dce6ed;
    content: '';
    pointer-events: none;
}
.control-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: 0 0 -1px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    background: transparent;
    color: #74889c;
    font: inherit;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background-color 0.15s ease;
}
.control-tab:hover {
    background: #f5f6f7;
    color: #16896f;
}
.control-tab-active,
.control-tab[aria-selected='true'] {
    border-bottom-color: #10af8b;
    background: transparent;
    color: #07876d;
}

/* Resource meters use the same continuous track as the power control. */
.resource-meter {
    height: 10px;
    border-radius: 999px;
    background: #e9edf0;
}
.resource-meter-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #20b893, #07876d);
    transition: width 0.25s ease;
}
:root[data-theme='dark'] .resource-meter {
    background-image: none;
    background-color: #263640;
}

/* Compact warehouse staff row with the dismissal action below the portrait row. */
.staff-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 12px;
}
.staff-stock-card {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    text-align: left;
}
.staff-stock-card[hidden] {
    display: none;
}
.staff-stock-person {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}
.staff-stock-portrait {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: hidden;
    border-radius: 12px;
    background: #eef3f6;
    object-fit: cover;
    object-position: center 25%;
}
.staff-stock-details {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.staff-stock-details > strong {
    font-size: 16px;
    font-weight: 400;
}
.staff-stock-details > span {
    color: #71859a;
    font-size: 13px;
}
.staff-stock-details > .staff-salary {
    color: #173750;
}
.staff-stock-card .button-dismiss {
    width: fit-content;
    margin-top: 0;
}
:root[data-theme='dark'] .staff-stock-portrait {
    background: #162b37;
}
:root[data-theme='dark'] .staff-stock-details > .staff-salary {
    color: #e5eef5;
}

:root[data-theme='dark'] .control-tabs::before {
    border-bottom-color: #263e4c;
}
:root[data-theme='dark'] .control-tab {
    color: #c6d3dc;
}
:root[data-theme='dark'] .control-tab:hover {
    background: #1b252b;
    color: #68e0b8;
}
:root[data-theme='dark'] .control-tab-active,
:root[data-theme='dark'] .control-tab[aria-selected='true'] {
    border-bottom-color: #68e0b8;
    color: #68e0b8;
}
/* Maintenance tab parity with the former Mantine workflow. */
.maintenance-tab {
    display: grid;
    gap: 12px;
}
.maintenance-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 2px;
}
.maintenance-panel-heading h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 500;
}
.maintenance-panel-heading .eyebrow {
    margin: 0 0 3px;
}
.maintenance-panel-heading .muted {
    margin: 0;
    color: #74889c;
    font-size: 14px;
}
.maintenance-state {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 7px;
    background: #e7f7f2;
    color: #11876c;
    font-size: 12px;
}
.maintenance-state-warning {
    background: #fff6df;
    color: #a66a00;
}
.maintenance-state-danger {
    background: #ffeded;
    color: #cf4e4e;
}
.maintenance-person {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}
.maintenance-card__portrait {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 12px;
    background: #eef7f8;
}
.maintenance-card__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}
.engineer-status {
    display: grid;
    gap: 3px;
}
.engineer-status strong {
    color: #173750;
    font-size: 15px;
    font-weight: 500;
}
.engineer-status small {
    color: #74889c;
    font-size: 14px;
}
.engineer-row {
    justify-content: space-between;
    border: 0;
    padding: 0;
}
.engineer-row .button {
    flex: 0 0 auto;
}
.maintenance-hire-link[hidden] {
    display: none !important;
}
.maintenance-part-card {
    display: grid;
    gap: 10px;
}
.maintenance-part-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.maintenance-part-heading > strong {
    font-size: 16px;
    font-weight: 500;
}
.maintenance-part-heading > span {
    color: #74889c;
    font-size: 14px;
    white-space: nowrap;
}
.maintenance-part-heading b {
    color: #173750;
    font-weight: 500;
}
.maintenance-part {
    margin: 0;
}
.maintenance-select-label {
    margin-top: 2px;
    color: #536a7e;
    font-size: 14px;
}
.maintenance-tab select {
    width: 100%;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid #dce6ed;
    border-radius: 8px;
    background: #fff;
    color: #173750;
    font: inherit;
}
.maintenance-tab select:disabled {
    background: #f3f6f8;
    color: #9aabb9;
}
.maintenance-message {
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.45;
}
.maintenance-message[hidden] {
    display: none;
}
.maintenance-message-active,
.maintenance-message-info {
    background: #eef8f5;
    color: #52776d;
}
.maintenance-message-warning {
    background: #fff7e6;
    color: #946814;
}
.maintenance-actions {
    display: flex;
    justify-content: flex-end;
}
.maintenance-install {
    min-width: 0;
    width: auto;
}
:root[data-theme='dark'] .maintenance-panel-heading .muted,
:root[data-theme='dark'] .maintenance-part-heading > span,
:root[data-theme='dark'] .maintenance-select-label,
:root[data-theme='dark'] .engineer-status small {
    color: #a9bac7;
}
:root[data-theme='dark'] .maintenance-state {
    background: #123d37;
    color: #68e0b8;
}
:root[data-theme='dark'] .maintenance-state-warning {
    background: #3b3018;
    color: #f0c56b;
}
:root[data-theme='dark'] .maintenance-state-danger {
    background: #482425;
    color: #ff9993;
}
:root[data-theme='dark'] .engineer-status strong,
:root[data-theme='dark'] .maintenance-part-heading b {
    color: #e5eef5;
}
:root[data-theme='dark'] .maintenance-tab select {
    border-color: #263e4c;
    background: #10202b;
    color: #e5eef5;
}
:root[data-theme='dark'] .maintenance-tab select:disabled {
    background: #162b37;
    color: #8295a4;
}
:root[data-theme='dark'] .maintenance-message-active,
:root[data-theme='dark'] .maintenance-message-info {
    background: #12302c;
    color: #a8d6c5;
}
:root[data-theme='dark'] .maintenance-message-warning {
    background: #3b3018;
    color: #f0c56b;
}
@media (max-width: 620px) {
    .maintenance-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .engineer-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .maintenance-part-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .maintenance-actions {
        justify-content: stretch;
    }
    .maintenance-install {
        width: 100%;
    }
}

/* Keep products in a real multi-row catalog grid at every desktop width. */
.shop-product-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    padding: 14px 2px 8px;
}
.shop-product-card {
    display: flex;
    min-width: 0;
    min-height: 184px;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #f8fafc;
}
.shop-product-card__main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.shop-product-card__icon {
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #eef7f8;
}
.shop-product-card__icon--fuel {
    background: #e7f7f2;
}
.shop-product-card__icon--spare {
    background: #fff5e2;
}
.shop-product-card__icon img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}
.shop-product-card__info {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 4px;
    justify-items: center;
}
.shop-product-card__title {
    color: #173750;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
}
.shop-product-card__meta {
    color: #74889c;
    font-size: 13px;
    line-height: 1.3;
}
.shop-product-card__buy {
    width: 100%;
    min-height: 38px;
    flex: none;
}
[data-product-section][hidden] {
    display: none !important;
}
:root[data-theme='dark'] .shop-product-card {
    border-color: #263e4c;
    background: #0f1c27;
}
:root[data-theme='dark'] .shop-product-card__meta {
    color: #a9bac7;
}
:root[data-theme='dark'] .shop-product-card__title {
    color: #e5eef5;
}
:root[data-theme='dark'] .shop-product-card__icon {
    background: #162b37;
}
@media (max-width: 900px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .shop-product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }
    .shop-product-card {
        min-height: 168px;
    }
}
.connection.connection-offline {
    color: #c34343;
}
.sidebar-connection {
    margin: 0 12px 14px;
    padding: 10px 12px;
    border: 1px solid #dcebe6;
    border-radius: 10px;
    background: #f3faf7;
    font-size: 13px;
}
.sidebar-connection.connection-offline {
    border-color: #f3d5d5;
    background: #fff5f5;
}
.sidebar-connection.connection-offline i {
    background: #e15555;
    box-shadow: 0 0 0 4px #ffeded;
}
@media (max-width: 640px) {
    .sidebar-connection {
        margin: 0;
        padding: 8px;
        border: 0;
        background: transparent;
    }
    .sidebar-connection [data-connection-label] {
        display: none;
    }
}

/* Zoomable spiral galaxy and 15-system sector map */
.world-heading--galaxy,
.world-heading--sector {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}
.world-heading--galaxy > div:first-child,
.world-heading--sector > div:first-child {
    min-width: 0;
}
.world-heading--galaxy h1,
.world-heading--sector h1 {
    font-size: clamp(28px, 3vw, 40px);
}
.galaxy-total {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0 3px 20px;
    border-left: 1px solid #d5e2eb;
    color: #7d91a2;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
}
.galaxy-total strong {
    color: #078b70;
    font-size: 36px;
    font-weight: 500;
    line-height: 1;
}
.galaxy-map-panel {
    overflow: hidden;
    border: 1px solid #d6e3ec;
    border-radius: 18px;
    background: radial-gradient(ellipse at 50% 48%, #132c45 0%, #0b1d32 65%, #081627 100%);
    box-shadow: 0 18px 48px #122b4010;
}
.map-overlay-breadcrumbs {
    position: absolute;
    z-index: 5;
    top: 14px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #b9cedb40;
    border-radius: 9px;
    background: #071525d9;
    box-shadow: 0 4px 16px #0004;
    color: #e5f0f5;
    font-size: 12px;
}
.map-overlay-breadcrumbs a {
    color: #78e0c0;
    text-decoration: none;
}
.map-overlay-breadcrumbs a:hover,
.map-overlay-breadcrumbs a:focus-visible {
    color: #c5ffe9;
    text-decoration: underline;
    outline: none;
}
.map-overlay-breadcrumbs > span[aria-hidden='true'] {
    color: #7890a3;
}
.galaxy-map-panel {
    position: relative;
}
.sector-map-breadcrumbs {
    position: relative;
    top: auto;
    left: auto;
    width: fit-content;
    margin: 0 0 12px;
}
.galaxy-map-toolbar {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    border-bottom: 1px solid #ffffff17;
    color: #c4d5e1;
}
.galaxy-map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 19px;
    font-size: 12px;
}
.galaxy-map-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.galaxy-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}
.galaxy-legend-dot--inhabited {
    background: #51e0b3;
    color: #51e0b3;
}
.galaxy-legend-dot--free {
    background: #8094a9;
    color: #8094a9;
}
.galaxy-map-legend .galaxy-visible-count {
    margin-left: 4px;
    color: #879caf;
}
.galaxy-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.galaxy-zoom-controls button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #8da9bb45;
    border-radius: 9px;
    background: #10283b;
    color: #d9e8ef;
    font: inherit;
    font-size: 19px;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.galaxy-zoom-controls button:hover,
.galaxy-zoom-controls button:focus-visible {
    border-color: #4dd0ac;
    background: #1b4b59;
    outline: 0;
}
.galaxy-zoom-controls output {
    width: 44px;
    color: #c8dae5;
    text-align: center;
}
.galaxy-map-viewport {
    display: block;
    height: min(68vh, 760px);
    min-height: 530px;
    padding: 0;
    overflow: auto;
    cursor: grab;
    overscroll-behavior: contain;
    scrollbar-color: #58788d #0a1a2c;
    scrollbar-width: thin;
    user-select: none;
}
.galaxy-map-viewport.is-dragging {
    cursor: grabbing;
}
.galaxy-map-viewport::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
.galaxy-map-viewport::-webkit-scrollbar-track {
    background: #0a1a2c;
}
.galaxy-map-viewport::-webkit-scrollbar-thumb {
    border: 3px solid #0a1a2c;
    border-radius: 8px;
    background: #58788d;
}
.galaxy-map-canvas {
    display: block;
    width: 2700px;
    height: 2700px;
    max-width: none;
    max-height: none;
    overflow: visible;
    background: #02050b;
    transform-origin: top left;
}
.galaxy-map-background {
    pointer-events: none;
}
.galaxy-route-network line {
    stroke: #c8e0ed;
    stroke-width: 2.1;
    stroke-dasharray: 7 8;
    opacity: 0.42;
    vector-effect: non-scaling-stroke;
}
.galaxy-sector-node {
    cursor: pointer;
    text-decoration: none;
}
.sector-node-halo {
    fill: #101c31;
    stroke: #9ab5c6;
    stroke-width: 1.5;
    opacity: 0.86;
    transition:
        r 0.16s,
        stroke 0.16s,
        fill 0.16s;
}
.sector-node-body {
    fill: #354a60;
    stroke: #c6d8e5;
    stroke-width: 2;
    transition:
        r 0.16s,
        stroke 0.16s,
        fill 0.16s;
}
.galaxy-sector-node.is-inhabited .sector-node-body {
    fill: #087e72;
    stroke: #8affd5;
}
.galaxy-sector-node.is-home .sector-node-halo {
    fill: #e6c276;
    stroke: #fff0c7;
    stroke-width: 2;
}
.galaxy-sector-node.is-home .sector-node-body {
    fill: #078b70;
    stroke: #c6ffe9;
    stroke-width: 2;
}
.galaxy-sector-node:hover .sector-node-halo,
.galaxy-sector-node:focus-visible .sector-node-halo {
    r: 38px;
    fill: #1b796f;
    stroke: #d2fff0;
    stroke-width: 2.5;
}
.galaxy-sector-node:focus-visible {
    outline: none;
}
.sector-node-number {
    fill: #f1f7fb;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-anchor: middle;
}
.sector-node-status {
    fill: #a5b3c2;
    stroke: #112237;
    stroke-width: 3;
}
.is-inhabited .sector-node-status {
    fill: #66f0ba;
    filter: url(#sector-glow);
}
.sector-node-label {
    fill: #e8f2f7;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.035em;
    paint-order: stroke;
    stroke: #08111d;
    stroke-width: 4px;
    text-anchor: middle;
}
.galaxy-map-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 22px;
    padding: 14px 20px 16px;
    border-top: 1px solid #ffffff17;
    color: #93aabd;
    font-size: 12px;
}
.galaxy-map-footer strong {
    color: #e2f2f6;
    font-weight: 600;
}
body:has(main.world-page--galaxy) {
    height: 100dvh;
    overflow: hidden;
}
main.page-shell.world-page--galaxy {
    width: calc(100% - var(--sidebar-width, 248px)) !important;
    max-width: none !important;
    height: calc(100dvh - 76px);
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}
.world-page--galaxy .galaxy-map-panel {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    border-radius: 0;
}
.world-page--galaxy .galaxy-map-viewport {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
}
.sector-occupancy {
    display: grid;
    min-width: 160px;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 10px;
    color: #778da0;
    font-size: 12px;
}
.sector-occupancy > strong {
    grid-row: span 2;
    color: #078b70;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
}
.sector-occupancy > strong small {
    color: #8296a7;
    font-size: 15px;
}
.sector-occupancy > i {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 5px;
    background: #e3eaf0;
}
.sector-occupancy > i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #26c996, #078b70);
}
.sector-system-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
}
.sector-system-card {
    position: relative;
    display: flex;
    min-height: 152px;
    flex-direction: column;
    padding: 15px 15px 13px;
    overflow: hidden;
    border: 1px solid #d9e5ec;
    border-radius: 13px;
    background: linear-gradient(145deg, #fff, #f5f9fb);
    color: #173750;
    text-decoration: none;
    transition:
        transform 0.15s,
        border-color 0.15s,
        box-shadow 0.15s;
}
.sector-system-card:hover,
.sector-system-card:focus-visible {
    transform: translateY(-2px);
    border-color: #48c5a6;
    box-shadow: 0 9px 22px #17375012;
    outline: 0;
}
.sector-system-card.is-inhabited {
    border-color: #9bd9c6;
    background: linear-gradient(145deg, #f6fffb, #e9f8f2);
}
.sector-system-card.is-home {
    border: 2px solid #11b68d;
}
.sector-map-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid #d6e3ec;
    border-radius: 16px;
    background: #06101d;
}
.sector-map-legend {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 20px;
    padding: 8px 16px;
    border-bottom: 1px solid #ffffff18;
    color: #b8cbd8;
    font-size: 12px;
}
.sector-map-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.sector-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8999aa;
}
.sector-legend-dot--inhabited {
    background: #55e2b3;
    box-shadow: 0 0 10px #55e2b3;
}
.sector-map-viewport {
    height: min(68vh, 760px);
    min-height: 520px;
    overflow: auto;
    background: #030813;
    scrollbar-color: #58788d #0a1a2c;
    scrollbar-width: thin;
}
.sector-map-canvas {
    display: block;
    width: 1500px;
    height: 900px;
    max-width: none;
    max-height: none;
    background: #030813;
}
.sector-route-network line {
    stroke: #c8dcea;
    stroke-width: 1.5;
    stroke-dasharray: 5 8;
    opacity: 0.5;
    vector-effect: non-scaling-stroke;
}
.sector-station-node {
    cursor: pointer;
    text-decoration: none;
}
.station-node-halo {
    fill: #081727;
    stroke: #95adc2;
    stroke-width: 1.4;
    opacity: 0.9;
    transition:
        r 0.16s,
        stroke 0.16s,
        fill 0.16s;
}
.station-node-body {
    fill: #34495e;
    stroke: #d4e0e9;
    stroke-width: 1.7;
    transition:
        r 0.16s,
        stroke 0.16s,
        fill 0.16s;
}
.station-node-core {
    fill: #aebbc9;
}
.sector-station-node.is-inhabited .station-node-body,
.sector-station-node.is-home .station-node-body {
    fill: #078b70;
    stroke: #9bffda;
}
.sector-station-node.is-inhabited .station-node-core {
    fill: #8dffd7;
    filter: url(#station-node-glow);
}
.sector-station-node:hover .station-node-halo,
.sector-station-node:focus-visible .station-node-halo {
    r: 31px;
    stroke: #fff;
    stroke-width: 2.4;
}
.sector-station-node:focus-visible {
    outline: none;
}
.station-node-name,
.station-node-status {
    fill: #f0f5f8;
    font-family: inherit;
    paint-order: stroke;
    stroke: #07111d;
    stroke-linejoin: round;
    text-anchor: middle;
}
.station-node-name {
    font-size: 13px;
    font-weight: 700;
    stroke-width: 4px;
}
.station-node-status {
    fill: #b6c5d1;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    stroke-width: 3px;
}
.sector-station-node.is-inhabited .station-node-status {
    fill: #82f0c5;
}
.sector-station-node.is-home .station-node-name {
    fill: #b5ffdf;
}
.sector-map-info {
    position: absolute;
    z-index: 4;
    top: 60px;
    left: 16px;
    display: grid;
    gap: 3px;
    padding: 9px 12px;
    border: 1px solid #b9cedb40;
    border-radius: 9px;
    background: #071525d9;
    box-shadow: 0 4px 16px #0004;
    color: #d9e7ed;
}
.sector-map-info strong {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.sector-map-info span {
    color: #a7bbca;
    font-size: 11px;
}
.sector-map-panel .sector-map-legend {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 16px;
    min-height: 0;
    padding: 8px 12px;
    border: 1px solid #b9cedb40;
    border-radius: 9px;
    background: #071525d9;
}
body:has(main.world-page--sector) {
    height: 100dvh;
    overflow: hidden;
}
main.page-shell.world-page--sector {
    display: block;
    width: calc(100% - var(--sidebar-width, 248px)) !important;
    max-width: none !important;
    height: calc(100dvh - 76px);
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}
.world-page--sector .sector-map-panel {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}
.world-page--sector .sector-map-viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.world-page--sector .sector-map-canvas {
    width: 100%;
    height: 100%;
}
.colonization-panel {
    display: grid;
    max-width: 820px;
    gap: 14px;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #d8e5ec;
    border-radius: 15px;
    background: #fff;
}
.colonization-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.colonization-panel__heading h2 {
    margin: 2px 0 0;
    color: #173750;
    font-size: 23px;
    font-weight: 500;
}
.colonization-status {
    padding: 7px 11px;
    border-radius: 8px;
    background: #e7f7f2;
    color: #078b70;
    font-size: 13px;
}
.colonization-panel__route,
.colonization-panel__message {
    margin: 0;
    color: #70869a;
}
.colonization-panel__route {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.colonization-panel__route strong {
    color: #173750;
    font-weight: 600;
}
.colonization-panel .button {
    justify-self: start;
    min-width: 250px;
}
:root[data-theme='dark'] .colonization-panel {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .colonization-panel__heading h2,
:root[data-theme='dark'] .colonization-panel__route strong {
    color: #e5eef5;
}
@media (max-width: 640px) {
    .colonization-panel {
        padding: 15px;
    }
    .colonization-panel__heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .colonization-panel .button {
        width: 100%;
        min-width: 0;
    }
}
.system-card-star {
    margin-bottom: 13px;
    color: #dfa954;
    font-size: 21px;
    line-height: 1;
}
.system-card-status {
    position: absolute;
    top: 14px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8b9cac;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.system-card-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9aa9b8;
}
.is-inhabited .system-card-status {
    color: #14886e;
}
.is-inhabited .system-card-status i {
    background: #16b487;
    box-shadow: 0 0 0 3px #16b48720;
}
.sector-system-card > strong {
    overflow: hidden;
    color: #173750;
    font-size: 16px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.system-card-class,
.system-card-owner {
    margin-top: 6px;
    color: #7c91a3;
    font-size: 11px;
    line-height: 1.35;
}
.system-card-owner {
    margin-top: auto;
    padding-top: 10px;
    color: #13876e;
}
:root[data-theme='dark'] .galaxy-total {
    border-color: #2a4657;
    color: #9fb3c1;
}
:root[data-theme='dark'] .sector-occupancy > i {
    background: #253c4b;
}
:root[data-theme='dark'] .sector-system-card {
    border-color: #263e4c;
    background: linear-gradient(145deg, #132631, #10202b);
    color: #e5eef5;
}
:root[data-theme='dark'] .sector-system-card.is-inhabited {
    border-color: #286454;
    background: linear-gradient(145deg, #122e29, #102522);
}
:root[data-theme='dark'] .sector-system-card > strong {
    color: #e5eef5;
}
:root[data-theme='dark'] .system-card-class,
:root[data-theme='dark'] .system-card-owner {
    color: #a9bac7;
}
@media (max-width: 1000px) {
    .sector-system-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .galaxy-map-viewport {
        min-height: 480px;
    }
}
@media (max-width: 640px) {
    .world-heading--galaxy,
    .world-heading--sector {
        align-items: flex-start;
    }
    .galaxy-total {
        padding-left: 12px;
    }
    .galaxy-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .galaxy-map-legend {
        gap: 9px 14px;
    }
    .galaxy-map-legend .galaxy-visible-count {
        width: 100%;
        margin-left: 0;
    }
    .galaxy-map-viewport {
        height: 470px;
        min-height: 410px;
    }
    .galaxy-map-footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .sector-system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .sector-system-card {
        min-height: 142px;
        padding: 13px 11px;
    }
    .system-card-status {
        top: 12px;
        right: 9px;
        font-size: 8px;
    }
}
@media (max-width: 640px) {
    main.page-shell.world-page--sector {
        width: 100vw !important;
        height: calc(100dvh - 176px);
    }
    .sector-map-legend {
        flex-wrap: wrap;
        gap: 8px 14px;
    }
    .sector-map-info {
        top: 58px;
        left: 10px;
    }
    .sector-map-panel .sector-map-legend {
        top: 10px;
        right: 10px;
    }
}
@media (max-width: 390px) {
    .sector-system-grid {
        grid-template-columns: 1fr;
    }
    .world-heading--galaxy,
    .world-heading--sector {
        flex-direction: column;
    }
}
@media (max-width: 640px) {
    main.page-shell.world-page--galaxy {
        width: 100vw !important;
        height: calc(100dvh - 176px);
    }
    .world-page--galaxy .galaxy-map-viewport {
        height: auto;
        min-height: 0;
    }
}
main.page-shell.station-page {
    width: calc(100% - var(--sidebar-width, 248px)) !important;
    max-width: none;
}

main.page-shell.station-page {
    padding: 0 !important;
}

/* Full viewport animated station scene. */
body:has(main.station-page) {
    height: 100dvh;
    overflow: hidden;
}
main.page-shell.station-page {
    --station-scene-height: calc(100dvh - 76px);
    position: relative;
    height: var(--station-scene-height);
    min-height: 0;
    overflow: hidden;
}
.station-map {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #061625;
}
.station-environment {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    background: #030a18;
}
.station-environment::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-color: #030817;
    background-image:
        radial-gradient(1px 1px at 7% 18%, #e8f8ff 99%, transparent),
        radial-gradient(1px 1px at 18% 8%, #b5d7ff 99%, transparent),
        radial-gradient(1px 1px at 27% 24%, #fff 99%, transparent),
        radial-gradient(1px 1px at 39% 10%, #c8e3ff 99%, transparent),
        radial-gradient(1px 1px at 52% 22%, #fff 99%, transparent),
        radial-gradient(1px 1px at 64% 7%, #b5d7ff 99%, transparent),
        radial-gradient(1px 1px at 76% 18%, #fff 99%, transparent),
        radial-gradient(1px 1px at 88% 11%, #d7edff 99%, transparent),
        radial-gradient(1px 1px at 95% 27%, #fff 99%, transparent),
        radial-gradient(1px 1px at 45% 31%, #a8caff 99%, transparent);
    content: '';
}
.station-nebula {
    position: absolute;
    z-index: 1;
    inset: -14%;
    background:
        radial-gradient(ellipse at 23% 32%, rgb(51 86 177 / 27%), transparent 32%),
        radial-gradient(ellipse at 75% 66%, rgb(108 49 151 / 23%), transparent 34%),
        radial-gradient(ellipse at 55% 41%, rgb(20 128 163 / 17%), transparent 37%),
        radial-gradient(ellipse at 9% 83%, rgb(48 73 138 / 14%), transparent 29%);
    filter: blur(30px);
    animation: nebula-breathe 34s ease-in-out infinite alternate;
}
.station-starfield {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}
.station-starfield--fine {
    opacity: 0.7;
    background-image:
        radial-gradient(1px 1px at 5% 42%, #d5e9ff 99%, transparent),
        radial-gradient(1px 1px at 13% 89%, #fff 99%, transparent),
        radial-gradient(1px 1px at 21% 57%, #c9e4ff 99%, transparent),
        radial-gradient(1px 1px at 31% 7%, #fff 99%, transparent),
        radial-gradient(1px 1px at 37% 68%, #d8e9ff 99%, transparent),
        radial-gradient(1px 1px at 47% 92%, #fff 99%, transparent),
        radial-gradient(1px 1px at 56% 48%, #c9e4ff 99%, transparent),
        radial-gradient(1px 1px at 69% 13%, #fff 99%, transparent),
        radial-gradient(1px 1px at 73% 78%, #d8e9ff 99%, transparent),
        radial-gradient(1px 1px at 82% 46%, #fff 99%, transparent),
        radial-gradient(1px 1px at 94% 72%, #c9e4ff 99%, transparent);
    animation: starfield-glow 11s ease-in-out infinite alternate;
}
.station-starfield--dust {
    opacity: 0.5;
    background-image:
        radial-gradient(1px 1px at 11% 25%, #91b5e8 99%, transparent),
        radial-gradient(1px 1px at 19% 14%, #e7f3ff 99%, transparent),
        radial-gradient(1px 1px at 28% 77%, #91b5e8 99%, transparent),
        radial-gradient(1px 1px at 42% 37%, #e7f3ff 99%, transparent),
        radial-gradient(1px 1px at 59% 81%, #91b5e8 99%, transparent),
        radial-gradient(1px 1px at 67% 59%, #e7f3ff 99%, transparent),
        radial-gradient(1px 1px at 79% 29%, #91b5e8 99%, transparent),
        radial-gradient(1px 1px at 91% 9%, #e7f3ff 99%, transparent);
    animation: starfield-glow 15s ease-in-out -6s infinite alternate-reverse;
}
.station-twinkle {
    position: absolute;
    z-index: 3;
    top: var(--y);
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--color);
    box-shadow: 0 0 6px 1px var(--color);
    animation: star-twinkle var(--duration) ease-in-out var(--delay) infinite;
}
.station-art {
    position: relative;
    z-index: 1;
    width: min(100%, calc((100dvh - 76px) * 1.7768));
    max-height: 100%;
    aspect-ratio: 1672 / 941;
    flex: 0 1 auto;
}
.station-map__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}
.station-node {
    z-index: 2;
}
.shipyard-control-panel {
    position: absolute;
    z-index: 5;
    right: 24px;
    bottom: 24px;
    display: grid;
    width: min(390px, calc(100% - 32px));
    gap: 11px;
    padding: 17px;
    border: 1px solid #a9fff080;
    border-radius: 13px;
    background: rgb(7 23 38 / 91%);
    box-shadow: 0 8px 28px #0007;
    color: #d8e8ef;
    backdrop-filter: blur(12px);
}
.shipyard-control-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.shipyard-control-panel__heading .eyebrow {
    margin: 0 0 3px;
    color: #83b6c5;
    font-size: 10px;
    letter-spacing: 0.06em;
}
.shipyard-control-panel__heading h2 {
    margin: 0;
    color: #fff;
    font-size: 21px;
    font-weight: 500;
}
.shipyard-control-panel__heading > span {
    color: #80dfc3;
    font-size: 12px;
    text-align: right;
}
.shipyard-control-panel > p {
    margin: 0;
    color: #b5c9d3;
    font-size: 13px;
    line-height: 1.4;
}
.shipyard-control-panel .button {
    justify-self: start;
    min-width: 240px;
}
@media (max-width: 640px) {
    .shipyard-control-panel {
        right: 10px;
        bottom: 10px;
        width: min(350px, calc(100% - 20px));
        gap: 7px;
        padding: 12px;
    }
    .shipyard-control-panel .button {
        width: 100%;
        min-width: 0;
    }
}
@keyframes nebula-breathe {
    from {
        transform: translate(-1%, 0) scale(1);
        opacity: 0.72;
    }
    to {
        transform: translate(1%, 1%) scale(1.06);
        opacity: 1;
    }
}
@keyframes starfield-glow {
    from {
        opacity: 0.38;
    }
    to {
        opacity: 0.86;
    }
}
@keyframes star-twinkle {
    0%,
    100% {
        opacity: 0.22;
        transform: scale(0.65);
    }
    50% {
        opacity: 1;
        transform: scale(1.55);
        box-shadow: 0 0 11px 2px var(--color);
    }
}
@media (max-width: 640px) {
    main.page-shell.station-page {
        --station-scene-height: calc(100dvh - 176px);
        width: 100vw !important;
    }
    .station-art {
        width: min(100%, calc((100dvh - 176px) * 1.7768));
    }
    .station-node {
        min-width: 0;
        padding: 6px 8px;
    }
    .station-node span {
        font-size: 13px;
    }
    .station-node small {
        display: none;
    }
    .shipyard-control-panel {
        right: 10px;
        bottom: 10px;
        width: min(350px, calc(100% - 20px));
        gap: 7px;
        padding: 12px;
    }
    .shipyard-control-panel .button {
        width: 100%;
        min-width: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .station-nebula,
    .station-starfield,
    .station-twinkle {
        animation: none !important;
    }
}

/* Planetary horizon backdrop, with the twinkling star layers kept above it. */
.station-world {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Building plots sit directly over the full-screen station artwork. */
.station-building-overlay {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: min(100%, calc((100dvh - 76px) * 1.7768));
    aspect-ratio: 1672 / 941;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.station-reactor-node {
    position: absolute;
    z-index: 6;
    top: 50%;
    left: 50%;
    width: min(100%, calc((100dvh - 76px) * 1.7768));
    aspect-ratio: 1672 / 941;
    display: block;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: #fff;
    font-size: 0;
    text-decoration: none;
}
.station-reactor-node::before {
    content: 'Реактор';
    position: absolute;
    top: 37%;
    left: 56%;
    display: block;
    padding: 8px 13px;
    border: 1px solid #8cebd5;
    border-radius: 9px;
    background: rgb(5 27 42 / 88%);
    box-shadow:
        0 5px 18px #00101d88,
        0 0 13px #00d5a933;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 5px #00101dcc;
    backdrop-filter: blur(7px);
    pointer-events: auto;
}
.station-reactor-node:hover::before,
.station-reactor-node:focus-visible::before {
    background: rgb(8 58 67 / 94%);
    outline: 2px solid #bdffeb;
    outline-offset: 3px;
}
.station-reactor-node:focus-visible {
    outline: 0;
}
.station-building-grid {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
}
.building-slot {
    position: absolute;
    top: var(--plot-y);
    left: var(--plot-x);
    display: grid;
    width: clamp(46px, 4vw, 66px);
    height: clamp(46px, 5vh, 66px);
    place-items: center;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #a5f5df;
    cursor: pointer;
    pointer-events: auto;
    transition:
        transform 0.16s,
        color 0.16s;
}
.building-slot:nth-child(1) {
    --plot-x: 17%;
    --plot-y: 33%;
}
.building-slot:nth-child(2) {
    --plot-x: 28%;
    --plot-y: 28%;
}
.building-slot:nth-child(3) {
    --plot-x: 42%;
    --plot-y: 24%;
}
.building-slot:nth-child(4) {
    --plot-x: 58%;
    --plot-y: 27%;
}
.building-slot:nth-child(5) {
    --plot-x: 78%;
    --plot-y: 39%;
}
.building-slot:nth-child(6) {
    --plot-x: 85%;
    --plot-y: 56%;
}
.building-slot:nth-child(7) {
    --plot-x: 65%;
    --plot-y: 62%;
}
.building-slot:nth-child(8) {
    --plot-x: 54%;
    --plot-y: 66%;
}
.building-slot:nth-child(9) {
    --plot-x: 24%;
    --plot-y: 56%;
}
.building-slot:nth-child(10) {
    --plot-x: 35%;
    --plot-y: 40%;
}
.building-slot:nth-child(11) {
    --plot-x: 49%;
    --plot-y: 47%;
}
.building-slot:nth-child(12) {
    --plot-x: 72%;
    --plot-y: 53%;
}
.building-slot:nth-child(13) {
    --plot-x: 57%;
    --plot-y: 37%;
}
.building-slot:nth-child(14) {
    --plot-x: 28%;
    --plot-y: 47%;
}
.building-slot:nth-child(15) {
    --plot-x: 75%;
    --plot-y: 30%;
}
.building-slot:hover,
.building-slot:focus-visible {
    transform: translate(-50%, -50%) scale(1.18);
    color: #c5ffeb;
    outline: 0;
}
.building-slot:focus-visible .building-slot__plus {
    outline: 2px solid #bdffeb;
    outline-offset: 4px;
}
.building-slot__plus {
    display: grid;
    width: clamp(34px, 3.2vw, 46px);
    height: clamp(34px, 3.2vw, 46px);
    place-items: center;
    border: 1px solid #9affdf;
    border-radius: 50%;
    background: rgb(4 28 39 / 78%);
    color: inherit;
    font-size: clamp(26px, 2.5vw, 36px);
    font-weight: 400;
    line-height: 1;
    text-shadow:
        0 0 7px #00d5a9,
        0 0 18px #00d5a9aa;
    box-shadow:
        0 0 0 3px rgb(35 211 164 / 18%),
        0 0 17px rgb(0 213 169 / 42%);
    backdrop-filter: blur(3px);
}
.building-slot--built {
    display: grid;
    width: max-content;
    min-width: 0;
    height: auto;
    justify-items: start;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
}
.building-slot--built:hover,
.building-slot--built:focus-visible {
    transform: translate(-50%, -50%) scale(1.05);
    outline: 0;
}
.building-slot__building-name {
    display: block;
    padding: 9px 14px;
    border: 1px solid #8cebd5;
    border-radius: 9px;
    background: rgb(5 27 42 / 88%);
    box-shadow:
        0 5px 18px #00101d88,
        0 0 13px #00d5a933;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 5px #00101dcc;
    backdrop-filter: blur(7px);
}
.building-slot--built:focus-visible .building-slot__building-name {
    outline: 2px solid #bdffeb;
    outline-offset: 4px;
}
.building-slot__detail {
    color: #d8e9ef;
    font-size: 11px;
    text-shadow: 0 1px 5px #00101dcc;
}
.building-slot__action,
.building-slot__link {
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 7px 8px;
    border: 1px solid #3cb99a80;
    border-radius: 7px;
    background: #0d9d7f;
    color: #fff;
    font: inherit;
    font-size: 11px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.building-slot__action:disabled {
    border-color: #728b9870;
    background: #3a5365;
    color: #aab9c1;
    cursor: not-allowed;
}
.building-slot__link {
    background: #0c3546;
    color: #87dec4;
}
.station-building-message {
    position: absolute;
    right: 18px;
    bottom: 14px;
    max-width: 360px;
    margin: 0;
    color: #ffd0b3;
    font-size: 12px;
    text-shadow: 0 1px 5px #000;
}
.station-progress {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 6;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #9ae7d5;
    border-radius: 9px;
    background: rgb(5 27 42 / 86%);
    color: #d8fff4;
    font-size: 13px;
    box-shadow: 0 4px 16px #00101d88;
}
.station-building-dialog {
    width: min(980px, calc(100vw - 32px));
    max-width: none;
    max-height: min(80dvh, 640px);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #a9fff080;
    border-radius: 17px;
    background: #0b1c2c;
    box-shadow: 0 24px 90px #0009;
    color: #e6f0f5;
}
.station-building-dialog::backdrop {
    background: transparent;
    backdrop-filter: none;
}
.station-building-dialog__content {
    display: grid;
    min-width: 0;
    gap: 14px;
    padding: 22px;
}
.station-building-dialog__content > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.station-building-dialog__content .eyebrow {
    margin: 0 0 4px;
    color: #80b5c5;
    font-size: 10px;
    letter-spacing: 0.08em;
}
.station-building-dialog__content h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 500;
}
.station-building-dialog__close {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #7291a24f;
    border-radius: 9px;
    background: #142c3e;
    color: #d4e3ea;
    font-size: 23px;
    cursor: pointer;
}
.station-building-dialog__slot {
    margin: 0;
    color: #8adbc3;
    font-size: 13px;
}
.station-building-options {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.building-options-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 20px;
    border: 1px dashed #5370827a;
    border-radius: 12px;
    color: #b0c3cd;
    text-align: center;
}
.building-option {
    display: grid;
    min-width: 0;
    gap: 10px;
    align-content: start;
    padding: 16px;
    border: 1px solid #5370827a;
    border-radius: 12px;
    background: linear-gradient(145deg, #102b3b, #102233);
}
.building-option__icon {
    display: block;
    width: 76px;
    height: 70px;
    object-fit: contain;
    margin: 0 auto 2px;
    filter: drop-shadow(0 5px 9px rgb(0 0 0 / 28%));
}
.building-option h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}
.building-option p {
    margin: 0;
    color: #b0c3cd;
    font-size: 13px;
    line-height: 1.45;
}
.building-option__details {
    color: #82ddc0;
    font-size: 12px;
}
.building-option__notice {
    color: #efc18d !important;
}
.building-option .button {
    width: 100%;
    min-width: 0;
}
@media (max-width: 900px) {
    .station-building-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.station-building-dialog__message {
    margin: 0;
    color: #ffb797;
    font-size: 13px;
}
.station-page-dialog {
    width: min(1120px, calc(100vw - 32px));
    height: min(900px, calc(100dvh - 32px));
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid #a9fff080;
    border-radius: 17px;
    background: #f2f7fa;
    box-shadow: 0 24px 90px #0009;
    color: #173750;
}
.station-page-dialog::backdrop {
    background: transparent;
    backdrop-filter: none;
}
.station-page-dialog__header {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.station-page-dialog__header h2 {
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgb(5 27 42 / 88%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}
.station-page-dialog__header h2 {
    display: none;
}
.station-page-dialog__close {
    border-color: #7291a280;
    background: #10283b;
    color: #fff;
}
.station-page-dialog__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #f2f7fa;
}
.reactor-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
    margin: 14px 0 20px;
}
.reactor-dashboard__metrics {
    display: grid;
    align-self: start;
    align-content: start;
    height: fit-content;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.reactor-dashboard__metric {
    display: flex;
    min-width: 0;
    min-height: 126px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px #122c4507;
    text-align: center;
    cursor: help;
}
.reactor-dashboard__metric:focus-visible {
    outline: 2px solid #20b994;
    outline-offset: 2px;
}
.reactor-dashboard__metric-icon {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    place-items: center;
    border-radius: 21px;
    background: #e4f7ef;
}
.reactor-dashboard__metric-icon img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}
.reactor-dashboard__metric-icon--consumption {
    background: #f0edfc;
}
.reactor-dashboard__metric-icon--stock {
    background: #fff3df;
}
.reactor-dashboard__metric-icon--profit {
    background: #fff6dc;
}
.reactor-dashboard__metric-label {
    display: block;
    margin-bottom: 0;
    color: #74889c;
    font-size: 13px;
}
.reactor-dashboard__metric strong {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    color: #173750;
    font-size: clamp(14px, 1.45vw, 21px);
    font-weight: 500;
    line-height: 1.2;
}
.reactor-dashboard__upgrade {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 435px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 38px 22px 20px;
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f5f9fb);
}
.reactor-dashboard__level {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 10px;
    border-radius: 99px;
    background: #e5f7f1;
    color: #0b8b70;
    font-size: 12px;
    font-weight: 700;
}
.reactor-dashboard__image {
    display: block;
    width: min(78%, 420px);
    min-height: 0;
    flex: 1 1 auto;
    object-fit: contain;
}
.reactor-dashboard__upgrade-info {
    z-index: 1;
    display: grid;
    width: min(100%, 360px);
    justify-items: center;
    gap: 8px;
    text-align: center;
}
.reactor-dashboard__upgrade-info > strong {
    color: #173750;
    font-size: 18px;
    font-weight: 600;
}
.reactor-dashboard__upgrade-info > span {
    min-height: 19px;
    color: #74889c;
    font-size: 13px;
}
.reactor-dashboard__upgrade-info .button {
    width: 100%;
    min-height: 46px;
}
.reactor-dashboard__upgrade-info .button:disabled {
    border-color: #e4ebef;
    background: #edf1f4;
    color: #a5b3bd;
    cursor: not-allowed;
}
.reactor-dashboard__upgrade-status {
    margin: 0;
    color: #74889c;
    font-size: 12px;
    text-align: center;
}
@media (max-width: 800px) {
    .reactor-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }
    .reactor-dashboard__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .reactor-dashboard__upgrade {
        min-height: 360px;
    }
    .reactor-dashboard__image {
        max-height: 280px;
    }
}
@media (max-width: 540px) {
    .reactor-dashboard__metric {
        min-height: 104px;
        flex-direction: column;
        gap: 6px;
        padding: 10px 4px;
    }
    .reactor-dashboard__metric-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 15px;
    }
    .reactor-dashboard__metric-icon img {
        width: 38px;
        height: 38px;
    }
    .reactor-dashboard__metric strong {
        font-size: clamp(12px, 3vw, 16px);
    }
}
@media (max-width: 1000px) {
    .station-building-overlay {
        width: min(100%, calc((100dvh - 76px) * 1.7768));
    }
    .building-slot {
        width: 48px;
        height: 48px;
    }
}
@media (max-width: 700px) {
    .station-building-options {
        grid-template-columns: 1fr;
    }
    .station-building-overlay {
        width: min(100%, calc((100dvh - 176px) * 1.7768));
    }
    .building-slot {
        width: 42px;
        height: 42px;
    }
    .building-slot__plus {
        width: 34px;
        height: 34px;
        font-size: 27px;
    }
    .building-slot__building-name {
        padding: 7px 10px;
        font-size: 13px;
    }
    .building-slot__detail,
    .building-slot__action,
    .building-slot__link {
        font-size: 9px;
    }
    .building-slot__action,
    .building-slot__link {
        padding: 5px 3px;
    }
    .station-building-message {
        right: 8px;
        bottom: 8px;
        font-size: 10px;
    }
    .station-building-dialog__content {
        gap: 11px;
        padding: 16px;
    }
    .building-option .button {
        width: 100%;
        min-width: 0;
    }
}

.shipyard-page {
    display: grid;
    align-content: start;
    gap: 18px;
}
.shipyard-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    border-bottom: 1px solid #dce6ed;
}
.shipyard-tab {
    padding: 12px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #71869a;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}
.shipyard-tab:hover,
.shipyard-tab:focus-visible {
    color: #078b70;
    outline: none;
}
.shipyard-tab--active {
    border-bottom-color: #12b88f;
    color: #078b70;
}
.shipyard-panel[hidden] {
    display: none;
}
.shipyard-panel {
    min-width: 0;
}
.shipyard-back {
    width: fit-content;
    color: #138d72;
    font-size: 15px;
    text-decoration: none;
}
.shipyard-back:hover {
    text-decoration: underline;
}
.shipyard-page-heading {
    margin-bottom: 0;
}
.shipyard-page-heading h1 {
    margin: 0 0 5px;
    font-size: 30px;
    font-weight: 500;
}
.shipyard-page-heading .muted {
    margin: 0;
}
.shipyard-workshop {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    max-width: 1050px;
    padding: 25px;
    border: 1px solid #dce6ed;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 22px #122c4508;
}
.shipyard-workshop__icon {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border-radius: 18px;
    background: #e6f7f2;
    color: #0aa981;
    font-size: 48px;
}
.shipyard-workshop__copy .eyebrow {
    margin: 0 0 5px;
}
.shipyard-workshop__copy h2 {
    margin: 0 0 6px;
    font-size: 23px;
    font-weight: 500;
}
.shipyard-workshop__copy .muted {
    max-width: 540px;
    margin: 0;
    line-height: 1.45;
}
.shipyard-stock {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-top: 17px;
    color: #71859a;
}
.shipyard-stock strong {
    color: #143751;
    font-size: 32px;
    font-weight: 500;
}
.shipyard-workshop__actions {
    display: grid;
    justify-items: stretch;
    gap: 7px;
    min-width: 240px;
}
.shipyard-build-button {
    min-height: 44px;
    background: #10af8b;
    color: #fff;
    text-align: center;
    text-decoration: none;
}
.shipyard-build-button:disabled {
    background: #dfe7eb;
    color: #8798a5;
    cursor: not-allowed;
}
.shipyard-fleet {
    display: grid;
    gap: 18px;
}
.shipyard-fleet__heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
}
.shipyard-fleet__heading h2 {
    margin: 3px 0 0;
    font-size: 24px;
    font-weight: 500;
}
.shipyard-fleet__heading p {
    margin: 0;
    color: #71859a;
}
.shipyard-fleet__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.shipyard-ship-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #dce6ed;
    border-radius: 16px;
    background: #fff;
}
.shipyard-ship-card__heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #71859a;
    font-size: 13px;
}
.shipyard-ship-card__icon {
    display: block;
    width: 88px;
    height: 72px;
    align-self: center;
    object-fit: contain;
    margin: -2px auto 0;
    filter: drop-shadow(0 5px 8px rgb(17 48 69 / 16%));
}
.shipyard-ship-card h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 500;
    color: #143751;
}
.shipyard-ship-card .muted {
    margin: 0;
    min-height: 42px;
    font-size: 13px;
}
.shipyard-ship-stats {
    display: grid;
    gap: 7px;
    margin: 0;
}
.shipyard-ship-stats div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.shipyard-ship-stats dt {
    color: #71859a;
}
.shipyard-ship-stats dd {
    margin: 0;
    font-weight: 600;
    color: #143751;
}
.shipyard-ship-card__cost {
    margin: auto 0 0;
    color: #71859a;
}
.shipyard-quantity {
    display: grid;
    grid-template-columns: auto minmax(78px, 104px);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #71859a;
    font-size: 14px;
}
.shipyard-quantity input {
    width: 100%;
    min-height: 38px;
    padding: 6px 9px;
    border: 1px solid #dce6ed;
    border-radius: 9px;
    background: #fff;
    color: #143751;
    font: inherit;
    text-align: center;
}
.shipyard-quantity input:focus-visible {
    outline: 2px solid #20b994;
    outline-offset: 2px;
}
.shipyard-ship-card .button {
    width: 100%;
}
.shipyard-ship-card--colonization .muted {
    min-height: 42px;
}
.shipyard-hangar-card .shipyard-ship-stats {
    margin-top: 4px;
}
.shipyard-hangar__empty {
    margin: 0;
    padding: 28px;
    border: 1px dashed #cad9e2;
    border-radius: 14px;
    color: #71859a;
    text-align: center;
}
.shipyard-hangar__empty[hidden] {
    display: none;
}
:root[data-theme='dark'] .shipyard-tabs {
    border-color: #263e4c;
}
:root[data-theme='dark'] .shipyard-tab {
    color: #a9bac7;
}
:root[data-theme='dark'] .shipyard-tab--active,
:root[data-theme='dark'] .shipyard-tab:hover {
    color: #5ed0ad;
}
@media (max-width: 900px) {
    .shipyard-fleet__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .shipyard-fleet__grid {
        grid-template-columns: 1fr;
    }
}
.shipyard-hint,
.shipyard-message {
    margin: 0;
    color: #7b8fa1;
    font-size: 13px;
    line-height: 1.4;
}
.shipyard-message {
    color: #128466;
}
@media (max-width: 760px) {
    .shipyard-workshop {
        grid-template-columns: auto 1fr;
        gap: 16px;
        padding: 18px;
    }
    .shipyard-workshop__icon {
        width: 62px;
        height: 62px;
        font-size: 36px;
    }
    .shipyard-workshop__actions {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

/* The sector map uses the full canvas below the compact global header. */
body:has(main.world-page--sector) {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}
main.page-shell.world-page--sector {
    position: fixed !important;
    top: 70px;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}
.world-page--sector .sector-map-panel,
.world-page--sector .sector-map-viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
}
.world-page--sector .sector-map-canvas {
    width: 100%;
    height: 100%;
}
@media (max-width: 640px) {
    main.page-shell.world-page--sector {
        top: 196px;
    }
}
.corporate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.corporate-panel {
    padding: 22px;
}
.corporate-panel h2 {
    margin-top: 0;
}
.corporate-form {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}
.corporate-form label {
    display: grid;
    gap: 5px;
    color: #60788d;
    font-size: 14px;
}
.corporate-form input {
    padding: 9px 10px;
    border: 1px solid #d7e3ea;
    border-radius: 8px;
    font: inherit;
}
.corporate-list {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}
.corporate-list article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0eaf0;
    border-radius: 10px;
}
.corporate-list span {
    color: #70869a;
    font-size: 13px;
}
.corporate-list form {
    grid-column: 2;
    grid-row: 1 / span 2;
}
.alliance-current {
    padding: 14px;
    border: 1px solid #9de8d3;
    border-radius: 10px;
    background: #eaf9f4;
    color: #087c63;
    font-size: 18px;
}
@media (max-width: 850px) {
    .corporate-grid {
        grid-template-columns: 1fr;
    }
    .corporate-list article {
        grid-template-columns: 1fr;
    }
    .corporate-list form {
        grid-column: 1;
        grid-row: auto;
    }
}
.component-upgrades {
    display: grid;
    gap: 12px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
}
.component-upgrades h2 {
    margin: 0;
    font-size: 21px;
}
.component-upgrades__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.component-upgrades__grid article {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e1eaf0;
    border-radius: 10px;
}
.component-upgrades__grid span {
    min-height: 34px;
    color: #71869a;
    font-size: 13px;
}
.component-upgrades__grid .button {
    width: 100%;
}
@media (max-width: 850px) {
    .component-upgrades__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 500px) {
    .component-upgrades__grid {
        grid-template-columns: 1fr;
    }
}
.station-environment::before {
    z-index: 1;
    background-color: transparent;
}
.station-nebula {
    z-index: 2;
}
.station-starfield {
    z-index: 3;
}
.station-twinkle {
    z-index: 4;
}

/* Portrait inventory cards with item counts anchored at the bottom. */
.warehouse-stock--compact {
    display: flex;
    width: min(100%, 210px);
    max-width: 100%;
    min-height: 248px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
    text-align: center;
}
.warehouse-stock--compact .warehouse-stock__icon {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border-radius: 18px;
}
.warehouse-stock--compact .warehouse-stock__icon img {
    width: 66px;
    height: 66px;
}
.warehouse-stock--compact .warehouse-stock__details {
    display: flex;
    width: 100%;
    min-height: 105px;
    flex: 1;
    flex-direction: column;
    align-items: center;
}
.warehouse-stock--compact .warehouse-stock__label {
    line-height: 1.3;
}
.warehouse-stock--compact .warehouse-stock__value {
    margin-top: auto;
    padding-top: 12px;
    font-size: 18px;
    white-space: normal;
}
.warehouse-stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 210px));
    align-items: stretch;
    gap: 12px;
}
.colony-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 0 0 16px;
    border-bottom: 1px solid #e2ebf0;
    color: #71869a;
}
.colony-summary strong {
    color: #078b70;
    font-size: 26px;
    font-weight: 400;
}
.colony-stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.colony-stock {
    display: grid;
    gap: 7px;
    min-height: 150px;
    padding: 16px;
    border: 1px solid #dce6ed;
    border-radius: 12px;
    background: #f8fbfc;
}
.colony-stock strong {
    font-size: 19px;
}
.colony-stock span {
    color: #71869a;
    font-size: 14px;
    line-height: 1.4;
}
.colony-stock b {
    margin-top: auto;
    color: #078b70;
    font-weight: 400;
}
.colony-stock .button {
    width: 100%;
    margin-top: 6px;
}
.warehouse-stock-list .warehouse-stock--compact {
    width: 100%;
    min-width: 0;
    max-width: 210px;
}
@media (max-width: 620px) {
    .warehouse-stock--compact {
        min-height: 228px;
    }
    .warehouse-stock-list {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    }
    .warehouse-stock-list .warehouse-stock--compact {
        max-width: none;
    }
}

/* Category buttons already identify the selected shop section. */
.shop-heading {
    display: none !important;
}

/* Independent level-two research tracks for all station power systems. */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.research-grid .research-card {
    min-width: 0;
    max-width: none;
    gap: 14px;
    padding: 18px;
}
.research-grid .research-card__icon {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
}
.research-grid .research-card__icon img {
    width: 54px;
    height: 54px;
}
.research-grid .research-card__body h2 {
    font-size: 20px;
}
.research-grid .research-card__body p {
    font-size: 14px;
    line-height: 1.45;
}
.research-grid .research-card__action {
    min-width: 120px;
    align-self: stretch;
    align-content: center;
}
.research-grid .research-card-complete {
    border-color: #85d6bd;
    background: #f5fbf8;
}
:root[data-theme='dark'] .research-grid .research-card-complete {
    border-color: #276453;
    background: #102522;
}
@media (max-width: 760px) {
    .research-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Technology tree */
.research-heading {
    margin-bottom: 24px;
}
.technology-tree {
    display: grid;
    gap: 20px;
}
.technology-stage {
    position: relative;
    padding: 20px;
    border: 1px solid #dce6ed;
    border-radius: 15px;
    background: #fff;
}
.technology-stage:not(:first-child)::before {
    position: absolute;
    top: -21px;
    left: 39px;
    width: 2px;
    height: 20px;
    background: #9bdacb;
    content: '';
}
.technology-stage__heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
}
.technology-stage__heading > span {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: #e5f7f1;
    color: #078b70;
    font-size: 15px;
    font-weight: 700;
}
.technology-stage__heading h2 {
    margin: 0;
    color: #173750;
    font-size: 19px;
    font-weight: 400;
}
.technology-stage__heading p {
    margin: 3px 0 0;
    color: #788da0;
    font-size: 13px;
}
.technology-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.technology-card {
    display: flex;
    min-width: 0;
    min-height: 230px;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #dce6ed;
    border-radius: 13px;
    background: #f8fafc;
    transition:
        border-color 0.16s,
        background 0.16s,
        opacity 0.16s;
}
.technology-card--locked {
    background: #f4f7f9;
}
.technology-card--complete {
    border-color: #85d6bd;
    background: #f1faf6;
}
.technology-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.technology-card__mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #e8f4f4;
    color: #1a8d7a;
    font-size: 13px;
    font-weight: 700;
}
.technology-card__status {
    color: #118b70;
    font-size: 12px;
    white-space: nowrap;
}
.technology-card--locked .technology-card__status {
    color: #8797a6;
}
.technology-card h3 {
    margin: 0 0 5px;
    color: #173750;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.25;
}
.technology-card__description {
    min-height: 38px;
    margin: 0;
    color: #71869a;
    font-size: 13px;
    line-height: 1.4;
}
.technology-card__requirements {
    margin-top: 11px;
}
.technology-card__requirements-label {
    display: block;
    margin-bottom: 6px;
    color: #8294a4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}
.technology-card__requirements ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.technology-card__requirements li,
.technology-card__no-requirements {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 6px;
    background: #edf1f4;
    color: #6c7f90;
    font-size: 11px;
    line-height: 1.2;
}
.technology-card__requirements li.technology-prerequisite--complete {
    background: #e2f5ee;
    color: #128268;
}
.technology-card__action {
    width: 100%;
    min-height: 36px;
    margin-top: auto;
    padding: 8px 10px;
    font-size: 13px;
}
.technology-card__action:disabled {
    background: #e8ecef;
    color: #8493a0;
    cursor: not-allowed;
}
.technology-card--complete .technology-card__action:disabled {
    background: #def3eb;
    color: #128268;
}
:root[data-theme='dark'] .technology-stage {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .technology-stage__heading h2,
:root[data-theme='dark'] .technology-card h3 {
    color: #e5eef5;
}
:root[data-theme='dark'] .technology-card {
    border-color: #263e4c;
    background: #132631;
}
:root[data-theme='dark'] .technology-card--locked {
    background: #101f29;
}
:root[data-theme='dark'] .technology-card--complete {
    border-color: #276453;
    background: #102522;
}
:root[data-theme='dark'] .technology-card__requirements li,
:root[data-theme='dark'] .technology-card__no-requirements {
    background: #203541;
    color: #b1c0cb;
}
:root[data-theme='dark'] .technology-card__requirements li.technology-prerequisite--complete {
    background: #173b33;
    color: #82d6bb;
}
@media (max-width: 1100px) {
    .technology-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 800px) {
    .technology-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .technology-stage {
        padding: 14px;
    }
    .technology-stage__heading {
        align-items: flex-start;
    }
    .technology-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .technology-card {
        min-height: 210px;
    }
}

/* Connected research map with hover details */
.technology-tree {
    position: relative;
    display: grid;
    gap: 35px;
    overflow: visible;
}
.technology-tree__connections {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}
.technology-edge {
    fill: none;
    stroke: #aab6bf;
    stroke-width: 1.2;
    transition:
        stroke 0.2s,
        stroke-width 0.2s;
}
.technology-edge--active {
    stroke: #16a982;
    stroke-width: 1.7;
}
.technology-stage {
    z-index: 1;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.technology-stage:not(:first-child)::before {
    display: none;
}
.technology-stage:hover,
.technology-stage:focus-within {
    z-index: 10;
}
.technology-stage__heading {
    gap: 10px;
    margin: 0 0 14px;
}
.technology-stage__heading > span {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    border-radius: 50%;
    font-size: 11px;
}
.technology-stage__heading h2 {
    color: #74899b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}
.technology-grid {
    position: relative;
    z-index: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 46px 24px;
}
.technology-card {
    position: relative;
    z-index: 1;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
}
.technology-card--locked,
.technology-card--complete {
    background: transparent;
}
.technology-card:hover,
.technology-card:focus-within,
.technology-card[data-details-open='true'] {
    z-index: 8;
}
.technology-node {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 15px;
    border: 1px solid #d5e4ef;
    border-radius: 15px;
    background: #e7f3fc;
    color: #1767a8;
    font: inherit;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.16s,
        background 0.16s,
        box-shadow 0.16s,
        transform 0.16s;
}
.technology-node:hover,
.technology-node:focus-visible {
    border-color: #8bc3e9;
    background: #dceefa;
    box-shadow: 0 5px 16px #17375012;
    outline: none;
    transform: translateY(-1px);
}
.technology-card--complete .technology-node {
    border-color: #93d6c2;
    background: #e4f7ef;
    color: #12846b;
}
.technology-card--locked .technology-node {
    border-color: #e0e7ec;
    background: #f3f6f8;
    color: #8091a0;
}
.technology-node__status {
    display: none;
}
.technology-node__title {
    display: block;
}
.technology-details {
    position: absolute;
    z-index: 20;
    top: calc(100% + 9px);
    left: 50%;
    display: none;
    width: min(310px, calc(100vw - 38px));
    padding: 17px;
    border: 1px solid #d5e3ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 12px 32px #16344a25;
    color: #173750;
    text-align: left;
    transform: translateX(-50%);
}
.technology-card:hover .technology-details,
.technology-card:focus-within .technology-details,
.technology-card[data-details-open='true'] .technology-details {
    display: block;
}
.technology-card:nth-child(4n + 1) .technology-details {
    left: 0;
    transform: none;
}
.technology-card:nth-child(4n) .technology-details {
    right: 0;
    left: auto;
    transform: none;
}
.technology-details__eyebrow {
    color: #0b9578;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.technology-details h3 {
    margin: 6px 0;
    color: #173750;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.25;
}
.technology-details > p {
    margin: 0;
    color: #657d91;
    font-size: 14px;
    line-height: 1.5;
}
.technology-details__requirements {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}
.technology-details__requirements > strong {
    color: #4e677c;
    font-size: 12px;
    font-weight: 600;
}
.technology-details__requirements ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.technology-details__requirements li,
.technology-details__requirements > span {
    padding: 5px 8px;
    border-radius: 6px;
    background: #f0f4f7;
    color: #74889a;
    font-size: 12px;
    line-height: 1.25;
}
.technology-details__requirements li.technology-prerequisite--complete {
    background: #e3f6ee;
    color: #13866c;
}
.technology-details__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 12px;
    color: #8092a1;
    font-size: 12px;
}
.technology-details__action {
    width: 100%;
    margin-top: 13px;
    padding: 9px 12px;
    font-size: 13px;
}
.technology-details__action:disabled {
    background: #e8ecef;
    color: #8493a0;
    cursor: not-allowed;
}
.technology-card--complete .technology-details__action:disabled {
    background: #def3eb;
    color: #128268;
}
:root[data-theme='dark'] .technology-node {
    border-color: #29485b;
    background: #173449;
    color: #a9d6f2;
}
:root[data-theme='dark'] .technology-card--locked .technology-node {
    border-color: #2a3b48;
    background: #172630;
    color: #8295a4;
}
:root[data-theme='dark'] .technology-card--complete .technology-node {
    border-color: #276453;
    background: #173b33;
    color: #82d6bb;
}
:root[data-theme='dark'] .technology-details {
    border-color: #2b4556;
    background: #10202b;
    color: #e5eef5;
}
:root[data-theme='dark'] .technology-details h3 {
    color: #e5eef5;
}
:root[data-theme='dark'] .technology-details > p,
:root[data-theme='dark'] .technology-details__meta {
    color: #a9bac7;
}
:root[data-theme='dark'] .technology-details__requirements > strong {
    color: #c3d0d9;
}
:root[data-theme='dark'] .technology-details__requirements li,
:root[data-theme='dark'] .technology-details__requirements > span {
    background: #203541;
    color: #b1c0cb;
}
:root[data-theme='dark'] .technology-stage,
:root[data-theme='dark'] .technology-card,
:root[data-theme='dark'] .technology-card--complete,
:root[data-theme='dark'] .technology-card--locked {
    border: 0;
    background: transparent;
}
@media (max-width: 900px) {
    .technology-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 40px 16px;
    }
    .technology-card:nth-child(4n + 1) .technology-details,
    .technology-card:nth-child(4n) .technology-details {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .technology-card:nth-child(3n + 1) .technology-details {
        left: 0;
        transform: none;
    }
    .technology-card:nth-child(3n) .technology-details {
        right: 0;
        left: auto;
        transform: none;
    }
}
@media (max-width: 620px) {
    .technology-tree {
        gap: 27px;
    }
    .technology-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 12px;
    }
    .technology-card:nth-child(3n + 1) .technology-details,
    .technology-card:nth-child(3n) .technology-details {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .technology-card:nth-child(2n + 1) .technology-details {
        left: 0;
        transform: none;
    }
    .technology-card:nth-child(2n) .technology-details {
        right: 0;
        left: auto;
        transform: none;
    }
    .technology-node {
        min-height: 62px;
        padding: 10px 8px;
        font-size: 13px;
    }
}
@media (max-width: 420px) {
    .technology-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }
    .technology-card .technology-details {
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}
:root[data-theme='dark'] .technology-stage__heading h2 {
    color: #a5b8c7;
}
@media (min-width: 1200px) {
    .technology-stage:first-of-type .technology-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 14px 10px;
    }
    .technology-stage:first-of-type .technology-node {
        min-height: 76px;
        padding: 10px 7px;
        font-size: 12px;
    }
}
@media (max-width: 1199px) and (min-width: 621px) {
    .technology-stage:first-of-type .technology-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    .technology-stage:first-of-type .technology-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Research page tabs and independent technology cards */
.research-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 22px 0 0;
    border-bottom: 1px solid #dce6ed;
}
.research-tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #71869a;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
}
.research-tab:hover,
.research-tab:focus-visible {
    color: #078b70;
    outline: none;
}
.research-tab--active {
    border-bottom-color: #12b88f;
    color: #078b70;
}
.research-tab > span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 5px;
    border-radius: 11px;
    background: #eef3f6;
    color: #74889a;
    font-size: 11px;
}
.research-tab--active > span {
    background: #e3f6ef;
    color: #078b70;
}
.research-panels {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
}
.research-panel[hidden] {
    display: none;
}
.research-panel__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.research-panel__heading h2 {
    margin: 0;
    color: #173750;
    font-size: 19px;
    font-weight: 400;
}
.research-panel__heading p {
    margin: 0;
    color: #8092a1;
    font-size: 13px;
}
.research-panel .technology-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.research-panel .technology-card {
    min-height: 180px;
    padding: 15px;
    border: 1px solid #dce6ed;
    border-radius: 13px;
    background: #f8fafc;
    transition:
        border-color 0.16s,
        background 0.16s,
        box-shadow 0.16s;
}
.research-panel .technology-card--locked {
    background: #f4f7f9;
}
.research-panel .technology-card--complete {
    border-color: #85d6bd;
    background: #f1faf6;
}
.research-tech-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 13px;
}
.research-tech-card__top > span:first-child {
    color: #8294a4;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.045em;
}
.research-tech-card .technology-card__status {
    color: #118b70;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.research-tech-card.technology-card--locked .technology-card__status {
    color: #8797a6;
}
.research-panel .research-tech-card__title {
    width: 100%;
    min-height: 58px;
    justify-content: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #173750;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
}
.research-panel .research-tech-card__title:hover,
.research-panel .research-tech-card__title:focus-visible {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #078b70;
    outline: none;
    transform: none;
}
.research-panel .technology-card--complete .research-tech-card__title {
    color: #12846b;
}
.research-panel .technology-card--locked .research-tech-card__title {
    color: #708396;
}
.research-panel .technology-details {
    top: calc(100% + 8px);
}
.research-panel .technology-card:nth-child(4n + 1) .technology-details {
    left: 0;
    right: auto;
    transform: none;
}
.research-panel .technology-card:nth-child(4n) .technology-details {
    right: 0;
    left: auto;
    transform: none;
}
:root[data-theme='dark'] .research-tabs {
    border-color: #263e4c;
}
:root[data-theme='dark'] .research-tab {
    color: #a9bac7;
}
:root[data-theme='dark'] .research-tab--active,
:root[data-theme='dark'] .research-tab:hover {
    color: #5ed0ad;
}
:root[data-theme='dark'] .research-tab > span {
    background: #203541;
    color: #b1c0cb;
}
:root[data-theme='dark'] .research-panels {
    border-color: #263e4c;
    background: #10202b;
}
:root[data-theme='dark'] .research-panel__heading h2,
:root[data-theme='dark'] .research-panel .research-tech-card__title {
    color: #e5eef5;
}
:root[data-theme='dark'] .research-panel .technology-card {
    border-color: #263e4c;
    background: #132631;
}
:root[data-theme='dark'] .research-panel .technology-card--locked {
    background: #101f29;
}
:root[data-theme='dark'] .research-panel .technology-card--complete {
    border-color: #276453;
    background: #102522;
}
:root[data-theme='dark'] .research-panel .technology-card--complete .research-tech-card__title {
    color: #82d6bb;
}
:root[data-theme='dark'] .research-panel .technology-card--locked .research-tech-card__title {
    color: #8295a4;
}
@media (max-width: 700px) {
    .research-tabs {
        overflow-x: auto;
    }
    .research-tab {
        padding: 11px 10px;
        font-size: 14px;
    }
    .research-panels {
        padding: 14px;
    }
    .research-panel__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
    .research-panel .technology-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}
@media (max-width: 450px) {
    .research-panel .technology-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
.research-panel .research-tech-card {
    display: flex;
    min-height: 285px;
    flex-direction: column;
}
.research-panel .research-tech-card__title {
    display: block;
    min-height: 0;
    margin: 0 0 8px;
    padding: 0;
    font-size: 17px;
    line-height: 1.3;
}
.research-panel .research-tech-card__description {
    margin: 0;
    color: #71869a;
    font-size: 13px;
    line-height: 1.45;
}
.research-tech-card__requirements {
    margin-top: 13px;
}
.research-tech-card__requirements > strong {
    display: block;
    margin-bottom: 7px;
    color: #75899a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}
.research-tech-card__requirements ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.research-tech-card__requirements li,
.research-tech-card__requirements > span {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 6px;
    background: #edf1f4;
    color: #728497;
    font-size: 11px;
    line-height: 1.25;
}
.research-tech-card__requirements li.technology-prerequisite--complete {
    background: #e3f6ee;
    color: #13866c;
}
.research-tech-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: auto;
    padding-top: 12px;
    color: #8092a1;
    font-size: 11px;
}
.research-tech-card__action {
    width: 100%;
    margin-top: 12px;
    padding: 9px 12px;
    font-size: 13px;
}
.research-tech-card__action:disabled {
    background: #e8ecef;
    color: #8493a0;
    cursor: not-allowed;
}
.research-tech-card.technology-card--complete .research-tech-card__action:disabled {
    background: #def3eb;
    color: #128268;
}
:root[data-theme='dark'] .research-panel .research-tech-card__description,
:root[data-theme='dark'] .research-tech-card__meta {
    color: #a9bac7;
}
:root[data-theme='dark'] .research-tech-card__requirements > strong {
    color: #a9bac7;
}
:root[data-theme='dark'] .research-tech-card__requirements li,
:root[data-theme='dark'] .research-tech-card__requirements > span {
    background: #203541;
    color: #b1c0cb;
}
:root[data-theme='dark'] .research-tech-card__requirements li.technology-prerequisite--complete {
    background: #173b33;
    color: #82d6bb;
}
@media (max-width: 450px) {
    .research-panel .research-tech-card {
        min-height: 250px;
    }
}
.research-panel .research-tech-card {
    position: relative;
    min-height: 255px;
}
.research-tech-card__top {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    justify-content: flex-end;
    margin: 0;
}
.research-panel .research-tech-card__title {
    margin-top: 4px;
    padding-right: 25px;
}
.research-tech-card__status-trigger {
    position: relative;
    display: inline-flex;
    min-height: 18px;
    align-items: center;
    justify-content: center;
    outline: none;
}
.research-tech-card__status-trigger:focus-visible {
    border-radius: 3px;
    outline: 2px solid #75c6ae;
    outline-offset: 3px;
}
.research-lock-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: #8394a2;
}
.research-lock-icon[hidden] {
    display: none !important;
}
.research-lock-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}
.research-lock-hint {
    position: absolute;
    z-index: 50;
    top: 43px;
    right: 12px;
    display: none;
    width: min(270px, calc(100vw - 44px));
    padding: 13px 15px;
    border: 1px solid #d5e3ed;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 10px 28px #16344a26;
    color: #173750;
    text-align: left;
}
.research-lock-hint[hidden] {
    display: none !important;
}
.research-panel .research-tech-card:hover,
.research-panel .research-tech-card:focus-within {
    z-index: 30;
}
.research-panel .research-tech-card.technology-card--locked:hover > .research-lock-hint:not([hidden]),
.research-panel .research-tech-card.technology-card--locked:focus-within > .research-lock-hint:not([hidden]) {
    display: block;
}
.research-lock-hint strong {
    display: block;
    margin-bottom: 7px;
    color: #506b80;
    font-size: 12px;
    font-weight: 600;
}
.research-lock-hint ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 17px;
    color: #72879a;
    font-size: 12px;
    line-height: 1.35;
}
:root[data-theme='dark'] .research-lock-hint {
    border-color: #2b4556;
    background: #10202b;
    color: #e5eef5;
}
:root[data-theme='dark'] .research-lock-hint strong {
    color: #c3d0d9;
}
:root[data-theme='dark'] .research-lock-hint ul {
    color: #a9bac7;
}

/* Research card icons */
.research-tech-card__icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    margin: 0 0 9px;
    overflow: hidden;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 44%, #e8f8f5 0, #f6fafb 74%);
}
.research-tech-card__icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.research-panel .research-tech-card__title {
    min-height: 43px;
}
:root[data-theme='dark'] .research-tech-card__icon {
    background: radial-gradient(circle at 50% 44%, #193a43 0, #132631 74%);
}
.research-tech-card__icon {
    position: relative;
    display: block;
    overflow: hidden;
}
.research-tech-card__icon img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    max-width: none;
    object-fit: fill;
}
.research-center-required {
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid #f5dfb7;
    border-radius: 12px;
    background: #fff4e3;
    color: #a66a00;
}
.research-center-required[hidden] {
    display: none;
}

/* Add the shared location trail above the economy metrics. */
.topbar {
    min-height: 68px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px;
}
.top-breadcrumbs {
    display: flex;
    min-height: 25px;
    align-items: center;
    gap: 9px;
    overflow-x: auto;
    color: #8296a9;
    font-size: 13px;
    white-space: nowrap;
    scrollbar-width: none;
}
.top-breadcrumbs::-webkit-scrollbar {
    display: none;
}
.top-breadcrumbs a {
    flex-direction: column;
    gap: 2px;
    color: #71869a;
    text-decoration: none;
    line-height: 1;
}
.top-breadcrumbs a:hover {
    color: #078b70;
    text-decoration: underline;
}
.top-breadcrumbs span[aria-hidden='true'] {
    color: #b4c1ca;
}
:root[data-theme='dark'] .top-breadcrumbs a {
    color: #a9bac7;
}
:root[data-theme='dark'] .top-breadcrumbs a:hover {
    color: #5ed0ad;
}
main.page-shell.world-page--galaxy,
main.page-shell.world-page--sector {
    height: calc(100dvh - 68px);
}
main.page-shell.station-page {
    --station-scene-height: calc(100dvh - 68px);
    height: var(--station-scene-height);
}
.station-art,
.station-building-overlay,
.station-reactor-node {
    width: min(100%, calc((100dvh - 68px) * 1.7768));
}
@media (max-width: 1000px) {
    .station-building-overlay {
        width: min(100%, calc((100dvh - 68px) * 1.7768));
    }
}
@media (max-width: 640px) {
    main.page-shell.world-page--galaxy,
    main.page-shell.world-page--sector {
        height: calc(100dvh - 196px);
    }
    main.page-shell.station-page {
        --station-scene-height: calc(100dvh - 196px);
    }
    .station-art,
    .station-building-overlay,
    .station-reactor-node {
        width: min(100%, calc((100dvh - 196px) * 1.7768));
    }
}
body:has(main.world-page--station) {
    height: 100dvh;
    overflow: hidden;
}
main.page-shell.world-page--station {
    position: relative;
    display: block;
    width: calc(100% - var(--sidebar-width, 248px)) !important;
    max-width: none !important;
    height: calc(100dvh - 68px);
    min-height: 0;
    margin: 0 0 0 var(--sidebar-width, 248px) !important;
    padding: 0 !important;
    overflow: hidden;
}
.world-page--station .station-orbit-map {
    width: 100%;
    height: 100%;
    min-height: 0;
    gap: 22px;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(#04111b55, #04111b55),
        url('/images/galaxy-sector-field.png') center / cover no-repeat;
}
.world-page--station > .world-enter-button,
.world-page--station > .world-visit-note,
.world-page--station > .colonization-panel {
    position: absolute;
    z-index: 4;
    top: 18px;
    left: 18px;
    max-width: min(460px, calc(100% - 36px));
    margin: 0;
}
.world-page--station > .world-visit-note {
    padding: 12px 15px;
    border: 1px solid #b9cedb40;
    border-radius: 10px;
    background: #071525df;
    color: #d8e7ef;
}
.world-page--station > .colonization-panel {
    width: min(460px, calc(100% - 36px));
    max-height: calc(100% - 36px);
    overflow: auto;
    border-color: #b9cedb55;
    background: #071525e8;
    color: #e5eef5;
}
.world-page--station .colonization-panel__heading h2,
.world-page--station .colonization-panel__route strong {
    color: #e5eef5;
}
.world-page--station .colonization-panel__route,
.world-page--station .colonization-panel__message {
    color: #b6c8d4;
}
@media (max-width: 640px) {
    main.page-shell.world-page--station {
        width: 100vw !important;
        height: calc(100dvh - 196px);
        margin: 0 !important;
    }
    .world-page--station .station-orbit-map {
        grid-template-columns: 1fr 1fr;
        padding: 10px;
    }
    .world-page--station .station-orbit-map::before {
        width: 68vw;
        height: 38vw;
    }
    .world-page--station .station-orbit-map::after {
        width: 94vw;
        height: 55vw;
    }
    .world-page--station .orbit-star {
        width: 110px;
    }
    .world-page--station .orbit-object {
        width: min(100%, 190px);
        padding: 10px;
    }
    .world-page--station > .world-enter-button,
    .world-page--station > .world-visit-note,
    .world-page--station > .colonization-panel {
        top: 10px;
        left: 10px;
    }
}
.sector-map-object {
    pointer-events: none;
    text-anchor: middle;
}
.sector-map-object--asteroids {
    pointer-events: auto;
    cursor: pointer;
}
.sector-map-object--asteroids:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 12px #8df4df);
}
.sector-map-object__glow {
    fill: #f4ae50;
    opacity: 0.14;
    filter: url(#station-node-glow);
}
.asteroid-rock {
    fill: #b7c6d0;
    stroke: #f1c98b;
    stroke-width: 1.5;
    filter: url(#station-node-glow);
}
.asteroid-rock--small {
    fill: #73899b;
    stroke: #b3c4cf;
    stroke-width: 1.2;
}
.asteroid-rock--tiny {
    fill: #dfb775;
    stroke: #f3d8a6;
    stroke-width: 1;
}
.sector-map-object--asteroids .sector-map-object__glow {
    fill: #efa83e;
}
.sector-map-object--anomaly .sector-map-object__glow {
    fill: #65d8f0;
}
.anomaly-wave {
    fill: none;
    stroke: #8ae8ff;
    stroke-width: 2;
    opacity: 0.8;
    filter: url(#station-node-glow);
}
.anomaly-wave--outer {
    stroke-dasharray: 3 5;
    opacity: 0.55;
}
.anomaly-wave--horizontal {
    transform: rotate(-22deg);
}
.anomaly-wave--vertical {
    transform: rotate(22deg);
    stroke: #c2a5ff;
}
.anomaly-core {
    fill: #e8f9ff;
    stroke: #70dff4;
    stroke-width: 3;
    filter: url(#station-node-glow);
}
.sector-map-object__title,
.sector-map-object__detail {
    fill: #f0f7fa;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    paint-order: stroke;
    stroke: #07111d;
    stroke-linejoin: round;
    stroke-width: 4px;
    text-anchor: middle;
}
.sector-map-object__detail {
    fill: #ffd99a;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    stroke-width: 3px;
}
.mining-dialog {
    width: min(480px, calc(100vw - 28px));
    max-width: none;
    padding: 0;
    border: 1px solid #77dcc4;
    border-radius: 18px;
    background: #0b1c2c;
    box-shadow: 0 24px 90px #0009;
    color: #e6f0f5;
}
.mining-dialog::backdrop {
    background: transparent;
}
.mining-dialog__shell {
    display: grid;
    gap: 14px;
    padding: 22px;
}
.mining-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.mining-dialog__header .eyebrow {
    margin: 0 0 4px;
    color: #80b5c5;
    font-size: 10px;
}
.mining-dialog__header h2 {
    margin: 0;
    color: #fff;
    font-size: 23px;
}
.mining-dialog__resource,
.mining-dialog__label,
.mining-dialog__availability,
.mining-dialog__message {
    margin: 0;
}
.mining-dialog__resource strong,
.mining-dialog__label output {
    color: #7ce3c5;
}
.mining-dialog__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mining-dialog__range {
    width: 100%;
    accent-color: #13b890;
}
.mining-dialog__range:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.mining-dialog .muted {
    margin: 0;
    line-height: 1.5;
}
.mining-dialog__availability {
    color: #9bb3c4;
    font-size: 13px;
}
.mining-dialog__message {
    color: #84e3c5;
    font-size: 13px;
}
.mining-dialog [data-mining-send] {
    width: 100%;
}

/* Keep the location shortcuts alongside the live balance cards. */
.topbar {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}
.top-breadcrumbs {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
    gap: 5px;
    overflow: visible;
}
.top-breadcrumbs a {
    display: inline-flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 3px 1px;
}
.top-breadcrumb-icon {
    display: block;
    width: 30px;
    height: 30px;
    flex: none;
    object-fit: contain;
}
@media (max-width: 1250px) {
    .top-breadcrumb-icon {
        width: 25px;
        height: 25px;
    }
}
.top-telemetry {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 0;
    width: auto;
    grid-template-columns: none;
}
.topbar > .top-telemetry {
    width: max-content !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}
.top-metric-currency {
    min-height: 0;
    flex: 0 0 auto;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.top-metric-currency .top-metric-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}
.top-metric-currency .top-metric-copy strong {
    font-size: 16px;
}
.top-metric-resource {
    margin-left: 14px;
}
.top-metric-resource .top-metric-copy {
    min-width: 8ch;
}
.top-metric-resource .top-metric-icon {
    object-fit: contain;
}
@media (max-width: 900px) {
    .topbar {
        flex-wrap: nowrap;
    }
    .top-breadcrumbs {
        gap: 4px;
    }
    .top-breadcrumb-icon {
        width: 25px;
        height: 25px;
    }
    .top-telemetry {
        flex: 0 0 auto;
    }
}
@media (max-width: 640px) {
    .topbar {
        overflow: visible;
        flex-wrap: wrap;
    }
    .top-breadcrumbs {
        flex: 1 1 100%;
    }
    .top-telemetry {
        min-width: 0;
    }
}

/* Compact global header replaces the persistent navigation sidebar. */
.app-sidebar {
    display: none !important;
}
.topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 40 !important;
    display: flex !important;
    width: 100% !important;
    min-height: 70px !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center !important;
    gap: 18px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
}
.topbar-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #17364d;
    text-decoration: none;
}
.topbar-brand-group {
    display: flex;
    grid-column: 1;
    align-items: center;
    gap: 18px;
}
.topbar-brand .brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    background: #12a996;
    color: #fff;
    font-size: 23px;
    font-weight: 700;
}
.topbar-brand > span:last-child {
    display: grid;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.05;
}
.topbar-brand small {
    margin-top: 4px;
    color: #8194a5;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .05em;
}
.topbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}
.topbar-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #d8e4ea;
    border-radius: 11px;
    background: #f7fafb;
    color: #527084;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.topbar-icon-button:hover {
    border-color: #9bdccb;
    color: #079b7a;
}
.topbar-icon-button svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}
.account-menu {
    position: relative;
}
.account-menu > summary {
    list-style: none;
}
.account-menu > summary::-webkit-details-marker {
    display: none;
}
.account-menu__dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 60;
    width: 168px;
    padding: 6px;
    border: 1px solid #d8e4ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgb(18 42 59 / 16%);
}
.account-menu__dropdown form,
.account-menu__dropdown button {
    width: 100%;
}
.account-menu__dropdown button {
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #234359;
    text-align: left;
    cursor: pointer;
}
.account-menu__dropdown button:hover {
    background: #edf7f5;
    color: #078b70;
}
.topbar .top-breadcrumbs {
    position: static;
    grid-column: 2;
    justify-self: center;
    margin-left: 0;
    transform: none;
}
.topbar > .top-telemetry {
    grid-column: 3;
    width: auto !important;
    flex: 0 0 auto !important;
    justify-self: end;
    margin-left: 0 !important;
}
.page-shell,
.station-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}
main.page-shell.station-page {
    width: 100vw !important;
    max-width: 100vw !important;
}
:root[data-theme='dark'] .topbar-brand {
    color: #e1edf3;
}
:root[data-theme='dark'] .topbar-icon-button {
    border-color: #2a4555;
    background: #102531;
    color: #b8cbd5;
}
:root[data-theme='dark'] .account-menu__dropdown {
    border-color: #2a4555;
    background: #102531;
}
:root[data-theme='dark'] .account-menu__dropdown button {
    color: #d5e4eb;
}
:root[data-theme='dark'] .account-menu__dropdown button:hover {
    background: #183b43;
    color: #5ed0ad;
}
@media (max-width: 760px) {
    .topbar {
        flex-wrap: wrap;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px !important;
        padding: 9px 12px !important;
    }
    .topbar-brand-group {
        grid-column: 1;
    }
    .topbar .top-breadcrumbs {
        order: 3;
        grid-column: 1 / -1;
        justify-self: center;
        flex: none;
        margin-left: 0;
        transform: none;
        justify-content: center;
    }
    .topbar > .top-telemetry {
        order: 2;
        grid-column: 2;
        grid-row: 1;
    }
}
