:root {
    --app-bar-height: 0px;
    --icon-panel-width: 0px;
    --mobile-icon-panel-height: 0px;
    --app-logo-offset: 0px;
    --app-logo-width: 96px;
    --mini-map-scale: 1;
    --galaxy-map-header-offset: 72px;
    --fleet-manager-border-color: rgba(79, 195, 247, 0.4);
    font-size: clamp(14px, 0.9vw + 8px, 18px);
}

/* Apply consistent transparency to UI labels for subtle de-emphasis */
label,
[class*=" label"],
[class^="label"],
[class$=" label"],
[class$="-label"],
[class$="__label"],
[class*="-label "],
[class*="__label "] {
    opacity: 0.9;
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.icon-panel-hidden {
    --icon-panel-width: 0px;
    --mobile-icon-panel-height: 0px;
}

body.icon-panel-hidden #iconPanel {
    display: none;
}


body.icon-toolbar-layout {
    --icon-panel-width: 0px;
    --mobile-icon-panel-height: 0px;
}

body.icon-toolbar-layout #container {
    width: 100vw;
    margin-left: 0;
}

body.icon-toolbar-layout #iconPanel {
    position: fixed;
    top: calc(var(--app-bar-height) + 16px);
    right: 24px;
    left: auto;
    width: auto;
    height: auto;
    max-width: calc(100vw - 48px);
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    overflow: visible;
    scrollbar-width: none;
}

body.icon-toolbar-layout #iconPanel::-webkit-scrollbar {
    display: none;
}

body.icon-toolbar-layout .icon-panel-sections,
body.icon-toolbar-layout .icon-panel-utilities {
    display: contents;
    gap: 0;
}

body.icon-toolbar-layout .icon-panel-group {
    display: contents;
    padding: 0;
    gap: 0;
}

body.icon-toolbar-layout .icon-panel-group + .icon-panel-group {
    border-top: none;
    padding-top: 0;
}

body.icon-toolbar-layout .icon-panel-group-title,
body.icon-toolbar-layout .icon-panel-footer {
    display: none;
}

body.icon-toolbar-layout .icon-panel-button {
    width: 46px;
    height: 46px;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    justify-content: center;
    gap: 0;
    font-size: 1.125rem;
    background: rgba(155, 216, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(155, 216, 255, 0.2);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body.icon-toolbar-layout .icon-panel-button:hover {
    color: #ffffff;
    background: rgba(155, 216, 255, 0.12);
    transform: translateY(-2px);
}

body.icon-toolbar-layout .icon-panel-button.active {
    color: #9bd8ff;
    background: rgba(79, 195, 247, 0.32);
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
}

body.icon-toolbar-layout .icon-panel-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.5);
}

body.icon-toolbar-layout .icon-panel-button.has-unread .icon-panel-button-icon::after {
    top: -4px;
    right: -4px;
}

body.icon-toolbar-layout .icon-panel-button-icon {
    width: 24px;
    height: 24px;
    font-size: 1rem;
    background: none;
    box-shadow: none;
    color: currentColor;
}

body.icon-toolbar-layout .icon-panel-button-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 720px) {
    #iconPanel {
        left: 16px;
        top: calc(16px + var(--app-logo-offset) + var(--galaxy-map-header-offset));
    }

    body.icon-toolbar-layout #iconPanel {
        top: calc(var(--app-bar-height) + 12px);
        right: 16px;
        gap: 10px;
    }

    body.icon-toolbar-layout .icon-panel-button {
        width: 42px;
        height: 42px;
    }

    body.icon-toolbar-layout .icon-panel-button-icon {
        width: 22px;
        height: 22px;
    }
}

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0a0a;
}

/* Scrollbar styling for theme consistency */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 195, 247, 0.35) rgba(8, 14, 28, 0.7);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.35);
    border-radius: 5px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.5);
}

*::-webkit-scrollbar-track {
    background: rgba(8, 14, 28, 0.7);
    border-radius: 5px;
}

.icon {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
}

.icon use {
    pointer-events: none;
}
#brandingContainer {
    position: fixed;
    top: calc(var(--app-bar-height) + 12px + var(--app-logo-offset));
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

#brandingContainer > * {
    pointer-events: auto;
}

.galaxy-map-header {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 26;
    pointer-events: none;
}

.galaxy-map-title {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 100;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    font-size: clamp(1.875rem, 1.5rem + 1.8vw, 3rem);
    letter-spacing: 0.35rem;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1;
    display: inline-flex;
}

/* Player Resources Display */
.player-resources-display {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    pointer-events: none;
}

.player-resources-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.94), rgba(10, 28, 54, 0.92));
    border: 1px solid rgba(79, 220, 255, 0.3);
    border-radius: 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(5, 12, 26, 0.6), 0 0 0 1px rgba(79, 195, 247, 0.1);
    pointer-events: auto;
}

.player-resources-items {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-resource-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: #e7f4ff;
}

.player-resource-icon {
    font-size: 14px;
    opacity: 0.8;
}

.player-resource-label {
    opacity: 0.7;
    font-weight: 500;
}

.player-resource-amount {
    font-weight: 600;
    color: #4fc3f7;
}

/* Hide on small screens */
@media (max-width: 768px) {
    .player-resources-display {
        top: 60px;
        transform: translateX(-50%) scale(0.85);
    }
}

/* Universe Search Bar */
.universe-search-wrapper {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 27;
    width: clamp(calc(140px * var(--mini-map-scale, 1)), calc(20vw * var(--mini-map-scale, 1)), calc(220px * var(--mini-map-scale, 1)));
    transform: translateX(0);
    transition: none;
}

body.ui-animations-ready .universe-search-wrapper {
    transition: transform 0.3s ease;
}

body.toggle-panel-open .universe-search-wrapper {
    transform: translateX(-250px);
}

.universe-search-container {
    position: relative;
    width: 100%;
}

.universe-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 0;
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: all 0.2s ease;
}

.universe-search-input-wrapper:focus-within {
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.98), rgba(10, 28, 54, 0.96));
    border-color: rgba(79, 195, 247, 0.6);
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.25), 0 18px 48px rgba(5, 12, 26, 0.75);
}

.universe-search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    pointer-events: none;
}

.universe-search-input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    background: transparent;
    border: none;
    color: #e7f4ff;
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    outline: none;
}

.universe-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.universe-search-clear {
    position: absolute;
    right: 8px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.universe-search-clear:hover {
    color: rgba(255, 255, 255, 0.9);
}

.universe-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 0;
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.universe-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(79, 195, 247, 0.1);
    transition: background 0.2s ease;
}

.universe-search-result-item:last-child {
    border-bottom: none;
}

.universe-search-result-item:hover,
.universe-search-result-item:focus {
    background: rgba(79, 195, 247, 0.15);
    outline: none;
}

.universe-search-result-item[aria-selected="true"] {
    background: rgba(79, 195, 247, 0.25);
}

.universe-search-result-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.universe-search-result-name {
    color: #ffffff;
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.universe-search-result-type {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(79, 195, 247, 0.2);
    border-radius: 4px;
    color: rgba(79, 195, 247, 1);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.universe-search-result-location {
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.universe-search-result-pin {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.universe-search-result-pin:hover {
    color: rgba(79, 195, 247, 1);
    background: rgba(79, 195, 247, 0.1);
}

.universe-search-result-pin.pinned {
    color: rgba(255, 193, 7, 1);
}

.universe-search-result-pin.pinned:hover {
    color: rgba(255, 193, 7, 0.8);
}

.universe-search-empty {
    padding: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    text-align: center;
}


#connectionWarningIndicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(247, 200, 67, 0.18);
    color: #f7c843;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
    z-index: 30;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#connectionWarningIndicator[hidden] {
    display: none;
}

.connection-indicator__icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.connection-indicator__icon .icon {
    width: 100%;
    height: 100%;
}

#connectionWarningIndicator[data-state="slow"] {
    background: rgba(247, 200, 67, 0.22);
    border-color: rgba(247, 200, 67, 0.6);
    color: #ffe07d;
}

#connectionWarningIndicator[data-state="offline"] {
    background: rgba(255, 95, 125, 0.26);
    border-color: rgba(255, 95, 125, 0.68);
    color: #ff9ab1;
}

#connectionWarningIndicator[data-state="connecting"] {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.55);
    color: #9bd8ff;
}

@media (max-width: 720px) {
    :root {
        --app-logo-offset: 0px;
        --app-logo-width: 84px;
    }


    #connectionWarningIndicator {
        bottom: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .connection-indicator__icon {
        width: 20px;
        height: 20px;
    }
}


@media (max-width: 720px) {
    /* logo removed — no bottom placement */

    body.icon-toolbar-layout #connectionWarningIndicator {
        bottom: 16px;
    }
}

body.icon-toolbar-layout #connectionWarningIndicator {
    bottom: 24px;
}

body.icon-panel-hidden #connectionWarningIndicator {
    display: none;
}

#iconPanel {
    position: fixed;
    top: calc(24px + var(--app-logo-offset) + var(--galaxy-map-header-offset));
    left: 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    padding: 0;
    width: auto;
    height: auto;
    max-height: calc(100% - 48px);
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 25;
}

.icon-panel-sections,
.icon-panel-utilities {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
}

.icon-panel-utilities {
    gap: 14px;
}

.icon-panel-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 100%;
}

.icon-panel-group + .icon-panel-group {
    padding-top: 6px;
}

.icon-panel-group-title,
.icon-panel-footer {
    display: none;
}

.icon-panel-button {
    width: 44px;
    height: 44px;
    border-radius: 0;
    border: none;
    background: rgba(79, 195, 247, 0.12);
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-panel-button:hover {
    color: #ffffff;
    background: rgba(79, 195, 247, 0.12);
    transform: translateX(2px);
}

.icon-panel-button:focus-visible {
    outline: none;
    transform: translateX(2px);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.5);
}

.icon-panel-button.active {
    color: #9bd8ff;
    background: rgba(79, 195, 247, 0.32);
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.icon-panel-button-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.icon-panel-button-icon .icon {
    width: 100%;
    height: 100%;
}

.display-options-close .icon {
    width: 20px;
    height: 20px;
}

.icon-panel-button.has-unread .icon-panel-button-icon::after {
    content: attr(data-unread);
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    padding: 2px 4px;
    border-radius: 0;
    background: #ff5f7d;
    color: #ffffff;
    font-size: 0.625rem;
    line-height: 1;
    letter-spacing: 0.4px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.icon-panel-button-text,
.icon-panel-button-label,
.icon-panel-button-description {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#starshipCommandButton .icon-panel-button-label {
    font-size: 0.9em;
}

@media (max-width: 1280px) {
    :root {
        --icon-panel-width: 0px;
    }
}

@media (max-width: 1024px) {
    :root {
        --icon-panel-width: 0px;
    }
}

#systemSearchWrapper {
    flex: 1 1 360px;
    display: flex;
    justify-content: center;
    min-width: 220px;
}

#systemSearch {
    position: relative;
    width: 100%;
    max-width: 420px;
}

#systemSearchIcon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

#systemSearchIcon svg {
    width: 100%;
    height: 100%;
}

#systemSearchInput {
    width: 100%;
    padding: 10px 46px 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(12, 12, 24, 0.65);
    color: white;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#systemSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1px;
}

#systemSearchInput:focus {
    border-color: rgba(79, 195, 247, 0.85);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.25);
    background: rgba(16, 24, 40, 0.85);
}

#systemSearchResults {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: rgba(6, 10, 24, 0.96);
    border: 1px solid rgba(79, 195, 247, 0.45);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 40;
}

.system-search-result {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.system-search-result:hover,
.system-search-result.active {
    background: rgba(79, 195, 247, 0.18);
}

.system-search-result-name {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 1.2px;
}

.system-search-result-meta {
    display: block;
    margin-top: 4px;
    font-size: 0.6875rem;
    opacity: 0.7;
    letter-spacing: 1px;
}

.system-search-empty {
    padding: 12px 16px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 900px) {
    :root {
        --galaxy-map-header-offset: 60px;
    }

    .galaxy-map-header {
        top: 16px;
        left: 16px;
    }

    .galaxy-map-title {
        font-size: clamp(1.75rem, 1.35rem + 2.4vw, 2.5rem);
        letter-spacing: 0.28rem;
    }

    #iconPanel {
        top: calc(16px + var(--app-logo-offset) + var(--galaxy-map-header-offset));
        left: 16px;
        gap: 12px;
    }
    .icon-panel-button {
        width: 40px;
        height: 40px;
    }
    .icon-panel-button-icon {
        width: 22px;
        height: 22px;
        font-size: 0.9375rem;
    }
    .icon-panel-button[data-tooltip]::before {
        left: calc(100% + 10px);
    }
    .icon-panel-button[data-tooltip]::after {
        left: calc(100% + 2px);
    }
}

#container {
    position: relative;
    width: calc(100vw - var(--icon-panel-width));
    height: calc(100vh - var(--mobile-icon-panel-height));
    margin-top: 0;
    margin-left: var(--icon-panel-width);
    overflow: hidden;
    cursor: default;
    touch-action: none;
}

#miniMapCanvas {
    position: absolute;
    top: 80px;
    right: 16px;
    left: auto;
    width: clamp(calc(140px * var(--mini-map-scale, 1)), calc(20vw * var(--mini-map-scale, 1)), calc(220px * var(--mini-map-scale, 1)));
    height: clamp(calc(140px * var(--mini-map-scale, 1)), calc(20vw * var(--mini-map-scale, 1)), calc(220px * var(--mini-map-scale, 1)));
    background: transparent;
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 0;
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    z-index: 18;
    backdrop-filter: none;
    transform: translateX(0);
    transition: none;
}

body.ui-animations-ready #miniMapCanvas {
    transition: transform 0.3s ease;
}

#miniMapCanvas[hidden] {
    display: none;
}

@media (max-width: 960px) {
    #miniMapCanvas {
        top: 72px;
        right: 12px;
        width: clamp(calc(120px * var(--mini-map-scale, 1)), calc(28vw * var(--mini-map-scale, 1)), calc(180px * var(--mini-map-scale, 1)));
        height: clamp(calc(120px * var(--mini-map-scale, 1)), calc(28vw * var(--mini-map-scale, 1)), calc(180px * var(--mini-map-scale, 1)));
        border-radius: 0;
    }
}

#miniMapCanvas.dragging {
    cursor: grabbing;
}

body.toggle-panel-open #miniMapCanvas {
    transform: translateX(-250px);
}

@media (max-width: 720px) {
    #miniMapCanvas {
        top: calc(72px + var(--app-logo-offset));
        right: 12px;
        width: calc(140px * var(--mini-map-scale, 1));
        height: calc(140px * var(--mini-map-scale, 1));
        border-radius: 0;
    }
}
#container.grabbing {
    cursor: grabbing;
}
#container.selecting-destination {
    cursor: none;
}
#destinationPrompt {
    position: fixed;
    bottom: calc(32px + var(--mobile-icon-panel-height));
    left: calc(var(--icon-panel-width) + (100vw - var(--icon-panel-width)) / 2);
    transform: translateX(-50%);
    width: min(420px, calc(100vw - var(--icon-panel-width) - 48px));
    padding: 14px 18px;
    background: rgba(17, 23, 29, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    color: #fff;
    z-index: 30;
    backdrop-filter: none;
}

#destinationPrompt[hidden] {
    display: none;
}

.destination-prompt__message {
    margin: 0 0 10px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.destination-prompt__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.destination-prompt__queue-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
}

.destination-prompt__queue-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.destination-prompt__hint {
    margin: 10px 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    opacity: 0.7;
}

.destination-prompt--queue {
    border-color: rgba(64, 196, 255, 0.6);
    box-shadow: 0 12px 36px rgba(32, 164, 255, 0.35);
}
#container.distance-tool-active,
#container.distance-tool-active canvas {
    cursor: crosshair;
}
#canvasWrapper {
    position: absolute;
    top: 0;
    left: 0;
}
#effectsCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 6;
}
#gridCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

/* overlayCanvas positions are provided by HTML/CSS defaults - don't override here */

/* (Grid debug overlay removed) */

/* Prewarm modal styles */
.grid-prewarm-modal {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 18, 40, 0.6);
    z-index: 99998;
}
.grid-prewarm-modal.open { display: flex; }
.grid-prewarm-content {
    background: rgba(0,0,0,0.9);
    color: #e7f4ff;
    padding: 18px 22px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.grid-prewarm-spinner { font-size: 22px; }
.grid-prewarm-text { display: flex; flex-direction: column; gap: 6px; }
.grid-prewarm-title { font-weight: 600; }
.grid-prewarm-progress { font-family: monospace; font-size: 13px; opacity: 0.95; }
canvas {
    position: absolute;
    top: 0;
    left: 0;
}
#togglePanel {
    position: fixed;
    top: var(--app-bar-height);
    right: -250px;
    width: 250px;
    height: calc(100% - var(--app-bar-height));
    /* Use the shared panel/template colour scheme */
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    color: #e7f4ff;
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 14px 16px 18px;
    box-sizing: border-box;
    transition: none;
    z-index: 20;
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 0;
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.ui-animations-ready #togglePanel {
    transition: right 0.3s ease;
}

#togglePanel.open {
    right: 0;
}

#togglePanel label {
    display: block;
    margin-bottom: 4px;
    font-family: 'Rajdhani', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#togglePanel label.toggle-switch {
    display: flex;
}

.panel-section:first-of-type {
    margin-top: 0;
}

.panel-section {
    margin-top: 16px;
}

.panel-section.collapsible {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-option-list {
    display: grid;
    gap: 6px;
}

#togglePanel .toggle-option-list label {
    margin: 0;
}

.display-options-panel {
    position: fixed;
    top: calc(var(--app-bar-height) + 24px);
    left: calc(var(--icon-panel-width) + 36px);
    transform: translate3d(0, -16px, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 40;
    overscroll-behavior: contain;
}

.display-options-panel.open {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

.display-options-title,
.display-options-subtitle {
    margin: 0;
}

.display-options-body {
    padding: 12px;
    gap: 12px;
    background: radial-gradient(circle at top, rgba(10, 26, 48, 0.95), rgba(2, 8, 18, 0.92));
}

.display-options-tabs {
    padding-bottom: 4px;
}

.display-options-panel-section {
    gap: 12px;
}

.display-options-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(79, 195, 247, 0.24);
    background: linear-gradient(155deg, rgba(12, 34, 64, 0.68), rgba(8, 22, 44, 0.78));
    box-shadow: 0 12px 28px rgba(5, 18, 36, 0.5);
}

.display-options-card-title {
    margin: 0;
    font-size: 0.6875rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(199, 235, 255, 0.92);
}

.display-options-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.display-options-card-body .toggle-option-list {
    margin: 0;
    gap: 6px;
}

.sound-settings-list {
    gap: 12px;
}

.sound-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sound-setting-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sound-setting-label {
    font-weight: 600;
    color: rgba(225, 245, 255, 0.92);
}

.sound-setting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sound-setting-button {
    appearance: none;
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.18);
    color: #ecf8ff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sound-setting-button:hover {
    background: rgba(79, 195, 247, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(5, 18, 36, 0.45);
}

.sound-setting-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.35);
}

.sound-setting-button--ghost {
    background: rgba(79, 195, 247, 0.08);
    border-color: rgba(79, 195, 247, 0.25);
    color: rgba(227, 244, 255, 0.85);
}

.sound-setting-button--play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sound-setting-status {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(199, 235, 255, 0.78);
}

.display-options-card-note {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: rgba(199, 235, 255, 0.72);
}

.display-options-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.display-options-reset-button {
    appearance: none;
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.22);
    color: #e7f4ff;
    padding: 8px 18px;
    font-size: 0.6875rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.display-options-reset-button:hover {
    background: rgba(79, 195, 247, 0.32);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(5, 18, 36, 0.45);
}

.display-options-reset-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.35);
}

.display-options-action-button {
    appearance: none;
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.2);
    color: #ecf8ff;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.display-options-action-button:hover {
    background: rgba(79, 195, 247, 0.32);
    border-color: rgba(79, 195, 247, 0.65);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(5, 18, 36, 0.45);
}

.display-options-action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.35);
}

.display-options-action-button:disabled,
.display-options-action-button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.display-options-action-button--busy {
    pointer-events: none;
}

.display-options-status {
    min-height: 1.25em;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.slider-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 10px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.slider-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

.slider-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.9);
}

.slider-option-text {
    flex: 1;
}

.slider-option-value {
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
}

.slider-option-input {
    width: 100%;
    accent-color: #00ff8d;
    cursor: pointer;
}

.slider-option-input:focus-visible {
    outline: 2px solid rgba(0, 255, 141, 0.65);
    outline-offset: 2px;
}

.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 4px;
    border-radius: 10px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.toggle-switch:hover {
    background: rgba(255, 255, 255, 0.04);
}

.toggle-switch-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.3;
    letter-spacing: 0;
    display: flex;
    align-items: center;
}

.toggle-switch-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.toggle-switch-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    min-width: 68px;
    height: 28px;
    border-radius: 6px;
    background: #bdbdbd;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f1f1f;
    letter-spacing: 0.3px;
    text-transform: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.toggle-switch-control::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.toggle-switch-control::after {
    content: 'Off';
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    height: 100%;
    line-height: 1;
}

.toggle-switch-input:checked + .toggle-switch-control {
    background: #4fc3f7;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
    color: #06131c;
}

.toggle-switch-input:checked + .toggle-switch-control::after {
    content: 'On';
}

.toggle-switch-input:checked + .toggle-switch-control::before {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.toggle-switch:focus-within .toggle-switch-control {
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.toggle-switch-input:disabled + .toggle-switch-control {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-switch-input:disabled + .toggle-switch-control::after {
    opacity: 0.7;
}

.collapsible-header {
    width: 100%;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-align: left;
    transition: color 0.2s ease;
}

.collapsible-header:hover {
    color: #9bd8ff;
}

.collapsible-header:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.8);
    outline-offset: 2px;
}

.collapsible-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

#togglePanel .collapsible-header {
    padding: 6px 10px;
    font-family: 'TheGoodMonolith', 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(10, 24, 48, 0.92), rgba(18, 42, 74, 0.9));
    border-bottom: 1px solid rgba(79, 195, 247, 0.32);
    box-shadow: inset 0 -1px 0 rgba(79, 195, 247, 0.18);
    color: #f7fbff;
}

#togglePanel .collapsible-header span:first-child {
    font-weight: 600;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.35);
}

#togglePanel .collapsible-header .collapsible-icon {
    color: rgba(239, 248, 255, 0.9);
}

#togglePanel .collapsible-header:hover {
    color: #ffffff;
}

.panel-section.collapsible:not(.open) .collapsible-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    margin-top: 10px;
}

.panel-section.collapsible:not(.open) .collapsible-content {
    display: none;
}
.distance-tool-description {
    margin: 0 0 10px;
    font-size: 0.6875rem;
    line-height: 1.5;
    opacity: 0.75;
}

.distance-tool-status {
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgba(233, 246, 255, 0.85);
    min-height: 1.6em;
}

.distance-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.distance-tool-button {
    flex: 1 1 110px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(79, 195, 247, 0.18);
    color: #e9f6ff;
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.distance-tool-button:hover {
    background: rgba(79, 195, 247, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.distance-tool-button:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.7);
    outline-offset: 2px;
}

.distance-tool-button.secondary {
    background: rgba(148, 170, 189, 0.2);
    color: #dce8f5;
}

.distance-tool-button.secondary:hover {
    background: rgba(148, 170, 189, 0.32);
    color: #ffffff;
}

.distance-tool-button:disabled,
.distance-tool-button:disabled:hover {
    background: rgba(132, 162, 184, 0.18);
    color: rgba(233, 246, 255, 0.55);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.test-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-admin-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(12, 28, 43, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.test-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.test-admin-actions .test-control-button {
    flex: 1 1 180px;
    width: auto;
}

.test-control-heading {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.75;
}

.test-state-group,
.test-actions-group,
.test-visual-group,
.test-minimap-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(12, 28, 43, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.test-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#togglePanel .test-toggle-list label {
    margin: 0;
}

.test-toggle-description {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.5;
    letter-spacing: 0.4px;
    opacity: 0.7;
}

.test-state-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-state-file-row {
    display: grid;
    gap: 8px;
    align-items: center;
}

@media (min-width: 520px) {
    .test-state-file-row {
        grid-template-columns: auto 1fr;
    }
}

.test-state-file-input {
    display: none;
}

.test-state-file-name {
    font-size: 0.6875rem;
    letter-spacing: 0.4px;
    opacity: 0.75;
    min-height: 14px;
}

.test-state-action-row {
    display: grid;
    gap: 8px;
}

@media (min-width: 520px) {
    .test-state-action-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.test-control-button {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.test-control-button:hover {
    background: rgba(79, 195, 247, 0.3);
    color: #e9f6ff;
    transform: translateY(-1px);
}

.test-control-button--warning {
    background: rgba(255, 95, 125, 0.24);
    color: #ffd0da;
    box-shadow: inset 0 0 0 1px rgba(255, 95, 125, 0.32);
}

.test-control-button--warning:hover {
    background: rgba(255, 95, 125, 0.36);
    color: #ffffff;
}

.test-control-button--ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.18);
}

.test-control-button--ghost:hover {
    background: rgba(79, 195, 247, 0.18);
}

.test-state-status {
    min-height: 18px;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
}

.test-state-status[data-state-level="success"] {
    color: #6fe3aa;
}

.test-state-status[data-state-level="error"] {
    color: #ff8b7a;
}

.test-state-status[data-state-level="info"] {
    color: #8cc6ff;
}

.test-state-summary {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
}

.test-state-summary:first-of-type {
    border-top: none;
    padding-top: 0;
}

.test-state-subheading {
    margin: 0 0 6px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.7;
}

.test-state-detail-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 0.75rem;
}

.test-state-detail-list > dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.65;
}

.test-state-detail-list > dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.test-actions-group {
    gap: 8px;
}

.test-minimap-controls {
    display: grid;
    gap: 10px;
}

@media (min-width: 520px) {
    .test-minimap-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
    }
}

.test-minimap-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.test-minimap-label {
    font-size: 0.6875rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
}

.test-minimap-input {
    padding: 6px 8px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    font-size: 0.6875rem;
    font-family: inherit;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.test-minimap-input:focus-visible {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.test-minimap-input::-webkit-outer-spin-button,
.test-minimap-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.test-minimap-input[type="number"] {
    -moz-appearance: textfield;
}

.test-control-button:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.7);
    outline-offset: 2px;
}

.test-control-button--warning:focus-visible {
    outline: 2px solid rgba(255, 95, 125, 0.6);
    outline-offset: 2px;
}

.universe-details-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    display: grid;
    gap: 6px;
}

.universe-details-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.universe-detail-label {
    opacity: 0.92;
    letter-spacing: 0.5px;
}

.universe-detail-value {
    font-weight: 600;
}

.universe-details-breakdown {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.universe-details-subheading {
    margin: 0 0 6px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.7;
}

.universe-details-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 0.6875rem;
}

.universe-details-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.universe-details-breakdown-item--player .universe-detail-label,
.universe-details-breakdown-item--player .universe-detail-value {
    color: #4af2c3;
    opacity: 1;
}

.player-holdings-counts {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.player-holdings-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.player-holdings-separator {
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    color: rgba(255, 255, 255, 0.35);
}

.bandwidth-metrics-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.bandwidth-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 10px;
}

.bandwidth-metric-label {
    opacity: 0.92;
    letter-spacing: 0.5px;
    font-size: 0.6875rem;
}

.bandwidth-metric-value {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.bandwidth-metric-item--toggle {
    align-items: center;
}

.bandwidth-metrics-note {
    margin-top: 8px;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
}

#statsDisplay {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#statsDisplay:empty {
    display: none;
}

#notificationHistoryEmpty {
    font-size: 0.75rem;
    opacity: 0.7;
}

#notificationHistoryList {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: none;
}

.notification-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.notification-mute-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notification-mute-toggle input {
    margin: 0;
}

.notification-action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notification-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-action-button:hover {
    background: rgba(79, 195, 247, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.notification-action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.65);
}

.notification-action-button:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

.notification-action-button:disabled:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
}

.notification-history-item {
    font-size: 0.75rem;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px 8px;
}

.notification-history-header {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.notification-history-item + .notification-history-item {
    margin-top: 6px;
}

.notification-history-message {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.notification-history-timestamp {
    display: block;
    font-size: 0.6875rem;
    opacity: 0.6;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.notification-history-locate-button {
    flex: 0 0 auto;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.notification-history-locate-button:hover,
.notification-history-locate-button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

.notification-history-locate-button:active {
    transform: scale(0.96);
}

#togglePanelButton {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 21;
    width: 32px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    color: #e7f4ff;
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-right: none;
    border-radius: 12px 0 0 12px;
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    cursor: pointer;
    font-size: 0.6875rem;
    line-height: 1;
    transition: none;
}

body.ui-animations-ready #togglePanelButton {
    transition: right 0.3s ease, background 0.2s ease, color 0.2s ease;
}

body.toggle-panel-open #togglePanelButton {
    right: 250px;
    transform: translateY(-50%);
}

.back-to-galaxy-button {
    position: fixed;
    top: calc(var(--icon-panel-width) + 20px);
    left: calc(var(--icon-panel-width) + 20px);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    color: #e7f4ff;
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(5, 12, 26, 0.6), 0 0 0 1px rgba(79, 195, 247, 0.12);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-to-galaxy-button:hover {
    background: linear-gradient(155deg, rgba(10, 28, 54, 0.98), rgba(14, 36, 66, 0.96));
    border-color: rgba(79, 220, 255, 0.5);
    box-shadow: 0 6px 20px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.2);
    transform: translateY(-1px);
}

.back-to-galaxy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 12, 26, 0.6);
}

.back-to-galaxy-button[hidden] {
    display: none;
}

#metricsContainer {
    position: absolute;
    bottom: calc(10px + var(--mobile-icon-panel-height));
    left: calc(var(--icon-panel-width) + 10px);
    right: 10px;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
    gap: 10px;
}

#metricsContainer > * {
    pointer-events: auto;
}

.metrics-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.85rem;
    min-width: 160px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.metrics-display--right {
    display: none;
    margin-left: auto;
    text-align: right;
}

#bandwidthDisplay {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bandwidth-display-chart {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.bandwidth-display-chart svg {
    width: 60px;
    height: 24px;
}

.bandwidth-display-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.bandwidth-display-line {
    display: block;
}

.bandwidth-sparkline-path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

.bandwidth-sparkline-path--down {
    stroke: #4af2c3;
}

.bandwidth-sparkline-path--up {
    stroke: #f2b84a;
}

#serverTimeContainer {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px + var(--mobile-icon-panel-height));
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 0 16px;
    max-width: calc(100vw - 32px);
}

@media (max-width: 720px) {
    #serverTimeContainer {
        padding: 0 12px;
    }
}

#serverTimeContainer > * {
    pointer-events: auto;
}

#serverTimeDisplay {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.85rem;
    min-width: 160px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-align: center;
}
#planetImage {
    height: calc((var(--app-bar-height) - 16px) / 2);
    width: auto;
    padding: 0;
    transform: none;
    flex-shrink: 0;
    filter: drop-shadow(0 0 12px rgba(0, 128, 255, 0.35));
}

#systemPanel {
    background: transparent;
    backdrop-filter: none;
    z-index: 65;
    padding: 16px;
    padding-top: calc(var(--app-bar-height) + 16px);
    pointer-events: none;
}

#systemPanel.open {
    pointer-events: none;
}

#systemPanel.system-panel-overlay--minimized {
    background: transparent;
    backdrop-filter: none;
}

#systemPanel .system-panel-window {
    pointer-events: auto;
}

.system-panel-window {
    width: min(760px, 94vw);
    min-width: 520px;
    max-width: min(94vw, 1100px);
    min-height: 320px;
    max-height: min(90vh, 860px);
    box-sizing: border-box;
}

.system-panel-window.starship-command-window--compact {
    font-family: 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    color: #e7f4ff;
}

.system-panel-window .starship-command-header {
    padding: 8px 18px;
}

.system-panel-window .starship-command-header-text {
    gap: 2px;
}

.system-panel-window .starship-command-title {
    font-size: 0.875rem;
    letter-spacing: 1.4px;
}

.system-panel-window .starship-command-subtitle {
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.system-panel-window .starship-command-frame-button,
.system-panel-window .starship-command-close {
    width: 22px;
    height: 22px;
    font-size: 1rem;
}

.planet-detail-window--comet.system-panel-window {
    width: min(880px, 96vw);
}

.system-panel-body {
    padding: 0;
    background: rgba(6, 18, 38, 0.92);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.system-panel-body .planet-detail-content {
    padding: 18px 22px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(170deg, rgba(4, 14, 32, 0.9), rgba(2, 8, 20, 0.88));
    color: rgba(231, 244, 255, 0.95);
}

.system-panel-tabs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-panel-tabs.starship-command-tabs {
    padding: 6px 0 0;
}

.system-panel-tabs .starship-command-tab {
    flex: 1 1 auto;
}

.system-panel-tab-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 4px;
}

.system-panel-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.system-panel-section--intel .system-panel-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.system-panel-intel-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.system-panel-intel-home .system-home-base-alert {
    margin: 0;
}

.system-panel-visual {
    margin: 0;
    border-radius: 12px;
    border: none;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 18, 40, 0.9), rgba(4, 12, 28, 0.92));
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

.system-panel-visual canvas {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
}

.system-panel-overview {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.system-panel-overview-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-panel-overview-header h3 {
    margin: 0;
}

.system-panel-overview-subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(200, 237, 255, 0.7);
}

.system-panel-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-panel-overview-content {
    display: grid;
    gap: 18px;
}

.system-panel-overview-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.system-panel-overview-summary {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(6, 16, 36, 0.82);
    border: 1px solid rgba(79, 220, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(79, 220, 255, 0.08);
}

.system-panel-overview-summary .system-panel-summary-grid {
    gap: 16px;
}

.system-panel-overview-highlights {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(32, 74, 110, 0.35);
    border: 1px solid rgba(79, 220, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(79, 220, 255, 0.08);
}

.system-panel-overview-highlights h4 {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(161, 235, 255, 0.85);
}

.system-panel-overview-highlights-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-panel-overview-highlight-item {
    position: relative;
    padding-left: 18px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: rgba(221, 247, 255, 0.92);
}

.system-panel-overview-highlight-item::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.75rem;
    color: #4fdcff;
    opacity: 0.85;
}

.system-panel-overview-aside {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-panel-overview-aside h3 {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(79, 220, 255, 0.85);
}

.system-panel-overview-aside .planet-detail-grid {
    gap: 10px 16px;
}

.system-panel-overview-visual {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.system-panel-overview-visual .system-panel-visual {
    flex: 0 1 420px;
    width: min(100%, 420px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.system-panel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-panel-section-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-panel-section-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-panel-section-heading h3 {
    margin: 0;
}

.system-panel-section-subtitle {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(200, 237, 255, 0.7);
}

.system-panel-section-header .system-panel-chip-row {
    margin-top: 0;
    align-items: center;
}

.system-panel-snapshot {
    display: grid;
    gap: 16px;
}

.system-panel-snapshot-primary {
    display: grid;
    gap: 14px;
    align-content: start;
}

.system-panel-snapshot-secondary {
    display: grid;
    gap: 14px;
    align-content: start;
}

.system-panel-visual-card {
    display: flex;
    justify-content: center;
    padding: 14px;
    border-radius: 12px;
    background: rgba(6, 16, 36, 0.82);
    border: 1px solid rgba(79, 220, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(79, 220, 255, 0.08);
}

.system-panel-star {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(6, 16, 36, 0.82);
    border: 1px solid rgba(79, 220, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(79, 220, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-panel-star h3 {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(161, 235, 255, 0.85);
}

.system-panel-star .system-panel-summary-grid {
    gap: 14px;
}

.system-planets-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

@media (min-width: 560px) {
    .system-panel-section-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .system-panel-section-heading {
        max-width: 70%;
    }

    .system-panel-section-header .system-panel-chip-row {
        align-self: flex-start;
    }
}

@media (min-width: 680px) {
    .system-panel-snapshot {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: start;
    }
}

@media (min-width: 720px) {
    .system-planets-scroll {
        max-height: 360px;
    }
}

@media (min-width: 640px) {
    .system-panel-overview-content {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: flex-start;
    }
}

.system-panel-summary-grid {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.system-panel-summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 0;
    background: rgba(6, 16, 36, 0.85);
    border: 1px solid rgba(79, 220, 255, 0.2);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.system-panel-summary-card dt {
    font-size: 0.6875rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin: 0;
}

.system-panel-summary-card dd {
    margin: 0;
    font-size: 0.875rem;
    color: #f3fbff;
}

.system-panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.system-panel-message {
    margin: 0 0 18px;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(210, 234, 255, 0.78);
}

.system-panel-tab-panels {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.system-panel-tab-panel[hidden] {
    display: none !important;
}

.system-planets-layout {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
    gap: 18px;
    align-items: stretch;
}

@media (max-width: 900px) {
    .system-planets-layout {
        grid-template-columns: 1fr;
    }
}

.system-planets-list {
    border: 1px solid rgba(79, 220, 255, 0.2);
    background: rgba(6, 16, 36, 0.88);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-planets-list-title {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(227, 244, 255, 0.9);
}

.system-planets-list-subtitle {
    margin: 0;
    font-size: 0.6875rem;
    color: rgba(205, 230, 255, 0.75);
}

.system-planet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-planet-list-item {
    margin: 0;
}

.system-planet-list-empty {
    margin: 0;
    padding: 8px 0;
    font-size: 0.7rem;
    color: rgba(195, 223, 255, 0.7);
    list-style: none;
}

.system-planet-list-button {
    width: 100%;
    border: 1px solid rgba(79, 220, 255, 0.16);
    background: rgba(8, 22, 44, 0.78);
    color: inherit;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.system-planet-list-button:hover,
.system-planet-list-button:focus-visible {
    border-color: rgba(79, 220, 255, 0.45);
    outline: none;
}

.system-planet-list-button--active {
    background: linear-gradient(135deg, rgba(79, 220, 255, 0.28), rgba(20, 150, 200, 0.28));
    border-color: rgba(79, 220, 255, 0.6);
}

.system-planet-list-name {
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(235, 247, 255, 0.95);
}

.system-planet-list-meta {
    font-size: 0.6875rem;
    color: rgba(195, 223, 255, 0.75);
}

.system-planets-detail {
    border: 1px solid rgba(79, 220, 255, 0.2);
    background: rgba(4, 12, 26, 0.9);
    padding: 18px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.system-planet-detail {
    flex: 1 1 auto;
    display: flex;
}

.system-planet-detail-empty {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.7px;
    color: rgba(200, 230, 255, 0.72);
}

.system-planet-detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.system-planet-detail-card-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-planet-detail-name {
    margin: 0;
    font-size: 1rem;
    font-family: 'TheGoodMonolith', sans-serif;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #f0f8ff;
}

.system-planet-detail-status {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(158, 216, 255, 0.8);
}

.system-planet-detail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.system-planet-detail-grid dt {
    margin: 0;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(205, 228, 255, 0.75);
}

.system-planet-detail-grid dd {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(245, 250, 255, 0.95);
}

.system-planet-detail-description {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(225, 240, 255, 0.9);
    line-height: 1.5;
}

.system-planet-resource-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.75rem;
    color: rgba(222, 240, 255, 0.88);
}

.system-planet-resource-list li {
    margin-bottom: 4px;
}

.system-panel-chip--owned {
    background: linear-gradient(135deg, rgba(79, 220, 255, 0.35), rgba(123, 239, 255, 0.35));
    color: #c7f4ff;
}

.system-panel-chip--unowned {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
}

.system-panel-chip--star {
    background: linear-gradient(135deg, rgba(255, 210, 140, 0.38), rgba(255, 167, 92, 0.35));
    color: #ffe3b6;
}

.system-panel-chip--comet {
    background: linear-gradient(135deg, rgba(110, 185, 255, 0.35), rgba(70, 140, 255, 0.35));
    color: #d8e9ff;
}

.system-home-base-alert {
    margin: 4px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(74, 242, 195, 0.12);
    border: 1px solid rgba(74, 242, 195, 0.35);
    box-shadow: inset 0 0 0 1px rgba(74, 242, 195, 0.12);
    font-size: 0.8125rem;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.system-home-base-alert strong {
    color: #d1fff0;
}

.system-planets-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.system-planet-item {
    background: rgba(6, 16, 36, 0.85);
    border-radius: 12px;
    padding: 10px 12px;
    line-height: 1.5;
    letter-spacing: 0.45px;
    border: 1px solid rgba(79, 220, 255, 0.18);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.system-planet-item[role="button"] {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.system-planet-item[role="button"]:hover {
    transform: translateY(-2px);
    background: rgba(10, 26, 54, 0.95);
    box-shadow: 0 18px 32px rgba(63, 214, 255, 0.2);
    border-color: rgba(79, 220, 255, 0.45);
}

.system-planet-item[role="button"]:active {
    transform: translateY(0);
}

.system-planet-item[role="button"]:focus-visible {
    outline: 2px solid rgba(79, 220, 255, 0.85);
    outline-offset: 3px;
}

.system-planet-item--home {
    border-color: rgba(74, 242, 195, 0.85);
    box-shadow: 0 0 18px rgba(74, 242, 195, 0.32);
    background: rgba(14, 36, 30, 0.85);
}

.system-planet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.system-planet-name {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.system-planet-meta {
    font-size: 0.75rem;
    color: rgba(201, 229, 255, 0.82);
    margin-top: 4px;
}

.system-planet-habitability {
    margin-top: 6px;
}

.system-planet-habitability-track {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.system-planet-habitability-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: calc(var(--habitability, 0) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #3fd6ff, #4af2c3);
    box-shadow: 0 0 12px rgba(63, 214, 255, 0.35);
}

.system-planet-attributes {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.system-planet-attributes li {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(79, 220, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.system-planet-attributes-label {
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.system-planet-attributes-value {
    font-size: 0.8125rem;
    color: #f3fbff;
}

.system-planet-base {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #9ff3ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.system-planet-base-icon {
    font-size: 0.875rem;
    line-height: 1;
}

.system-planet-badge {
    background: linear-gradient(135deg, #3fd6ff, #4af2c3);
    color: #061826;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.ship-detail-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 12px;
}

.ship-detail-actions h3 {
    margin: 0 0 8px;
    font-size: 0.875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ship-detail-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Ship detail tabs */
.ship-detail-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 14px 0;
    border-bottom: 1px solid rgba(79, 195, 247, 0.25);
}
.ship-detail-tab {
    appearance: none;
    border: none;
    background: rgba(79, 195, 247, 0.12);
    color: rgba(240, 248, 255, 0.85);
    padding: 4px 10px;
    border-radius: 0;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.18);
}
.ship-detail-tab[aria-selected="true"] {
    background: rgba(79, 195, 247, 0.32);
    color: #9bd8ff;
    box-shadow: 0 6px 16px rgba(5, 18, 36, 0.55);
}
.ship-detail-tab:not([aria-selected="true"]):hover {
    background: rgba(79, 195, 247, 0.2);
    color: #f4fbff;
}
.ship-detail-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.32);
}
.ship-detail-panel {
    display: none;
}
.ship-detail-panel[aria-hidden="false"] {
    display: block;
}

.ship-detail-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.35);
}


.ship-action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(79, 220, 255, 0.35);
    background: rgba(79, 220, 255, 0.12);
    color: #e6f7ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ship-action-button:hover {
    background: rgba(79, 220, 255, 0.18);
    border-color: rgba(79, 220, 255, 0.6);
    transform: translateY(-1px);
}

.ship-action-button:focus-visible {
    outline: 2px solid rgba(114, 252, 255, 0.8);
    outline-offset: 2px;
}

.ship-action-button--secondary {
    border-color: rgba(160, 206, 255, 0.4);
    background: rgba(160, 206, 255, 0.1);
}

.ship-action-button--secondary:hover {
    background: rgba(160, 206, 255, 0.18);
    border-color: rgba(160, 206, 255, 0.6);
}

.ship-action-button--danger {
    border-color: rgba(255, 128, 128, 0.4);
    background: rgba(255, 128, 128, 0.12);
    color: #ffe6e6;
}

.ship-action-button--danger:hover {
    background: rgba(255, 128, 128, 0.2);
    border-color: rgba(255, 128, 128, 0.6);
}

.ship-action-button-icon {
    font-size: 0.875rem;
    line-height: 1;
}

.ship-action-button-label {
    white-space: nowrap;
}

.ship-detail-defenses {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 10px;
}

.ship-modules {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ship-modules h3 {
    margin: 0 0 6px;
    font-size: 0.875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ship-module-summary {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.72);
}

.ship-modules-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ship-module-item {
    font-size: 0.75rem;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px 8px;
}

.ship-module-item + .ship-module-item {
    margin-top: 6px;
}

.ship-module-item.offline {
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.7;
}

.ship-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ship-module-name {
    font-weight: 600;
    font-size: 0.8125rem;
}

.ship-module-toggle {
    font-size: 0.6875rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ship-module-toggle:hover,
.ship-module-toggle:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.ship-module-toggle:disabled {
    opacity: 0.45;
    cursor: default;
    background: rgba(255, 255, 255, 0.08);
}

.ship-module-meta {
    display: block;
    font-size: 0.6875rem;
    opacity: 0.75;
    margin-top: 2px;
}

.ship-modules-empty {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 0;
}

.planet-detail-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: transparent;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.planet-detail-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#planetDetailOverlay.planet-detail-overlay.open {
    pointer-events: none;
}

#planetDetailOverlay .planet-detail-window {
    pointer-events: auto;
}

.planet-detail-overlay[hidden] {
    display: none;
}

.planet-detail-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 90vw);
    min-width: 360px;
    max-width: min(90vw, 960px);
    min-height: 280px;
    max-height: min(85vh, 820px);
    overflow-y: auto;
    /* Use the shared panel/template colour scheme */
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    border: 1px solid rgba(79, 220, 255, 0.35);
    border-radius: 0;
    padding: 14px 16px 18px;
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    color: #e7f4ff;
    box-sizing: border-box;
    font-family: 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Ship Designer and Planet Command panels - match Empire Overview size */
.planet-detail-window.starship-command-window:not(.starship-command-window--compact):not(.player-profile-window):not(.leaderboard-window) {
    width: min(900px, 95vw);
    min-width: 520px;
    max-width: min(95vw, 1200px);
    max-height: min(90vh, 820px);
}

@media (max-width: 720px) {
    .planet-detail-window.starship-command-window:not(.starship-command-window--compact):not(.player-profile-window):not(.leaderboard-window) {
        min-width: 0;
        width: min(520px, 95vw);
    }
}

.draggable-panel {
    position: fixed;
    margin: 0;
    right: auto;
    bottom: auto;
}

.draggable-panel--dragging {
    cursor: grabbing;
}

.draggable-panel-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.draggable-panel-handle.is-dragging,
.draggable-panel--dragging .draggable-panel-handle {
    cursor: grabbing;
}



.wiki-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.wiki-nav {
    width: 240px;
    background: rgba(12, 28, 58, 0.85);
    border-right: 1px solid rgba(79, 195, 247, 0.18);
    padding: 20px 16px;
    box-sizing: border-box;
}

.wiki-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wiki-nav-button {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-size: 0.8125rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wiki-nav-button:hover,
.wiki-nav-button:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.4);
}

.wiki-nav-button.active {
    background: rgba(79, 195, 247, 0.28);
    border-color: rgba(79, 195, 247, 0.55);
    color: #ffffff;
}

.wiki-content {
    flex: 1;
    padding: 24px 32px 32px;
    overflow-y: auto;
    background: rgba(6, 14, 30, 0.75);
    box-sizing: border-box;
    line-height: 1.6;
}

.wiki-content:focus {
    outline: none;
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4 {
    letter-spacing: 1.0px;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 10px;
}

.wiki-content h1 {
    font-size: 1.125rem;
    margin-top: 0;
}

.wiki-content h2 {
    font-size: 1rem;
}

.wiki-content h3 {
    font-size: 0.9375rem;
}

.wiki-content p {
    margin: 12px 0;
}

.wiki-content ul,
.wiki-content ol {
    padding-left: 20px;
    margin: 12px 0 12px 20px;
}

.wiki-content li {
    margin-bottom: 6px;
}

.wiki-content code {
    font-family: Menlo, Consolas, "Droid Sans Mono", monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8125rem;
}

.wiki-content pre {
    background: rgba(2, 8, 20, 0.9);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}

.wiki-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.8125rem;
}

.wiki-content th,
.wiki-content td {
    border: 1px solid rgba(79, 195, 247, 0.25);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.wiki-content th {
    background: rgba(79, 195, 247, 0.12);
    color: #ffffff;
}

.wiki-content a {
    color: #80d8ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wiki-content a:hover {
    color: #c7f4ff;
}

.wiki-content a:focus-visible {
    color: #c7f4ff;
    outline: 2px solid rgba(199, 244, 255, 0.6);
    outline-offset: 3px;
}

.wiki-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid rgba(79, 195, 247, 0.4);
    background: rgba(255, 255, 255, 0.04);
}

.wiki-empty,
.wiki-loading,
.wiki-error {
    margin: 0;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.wiki-loading {
    opacity: 0.75;
}

.wiki-error {
    color: #ff8a80;
}

@media (max-width: 900px) {
    .wiki-body {
        flex-direction: column;
    }

    .wiki-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(79, 195, 247, 0.2);
    }

    .wiki-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .wiki-nav-button {
        flex: 1 1 calc(50% - 8px);
    }
}

.planet-detail-window--planet {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.planet-detail-window--planet .planet-detail-content {
    padding: 18px 24px 26px;
    overflow-y: auto;
    flex: 1;
}

.planet-detail-window--planet[data-window-state="minimized"],
.planet-detail-window--planet[data-window-state="maximized"] {
    max-height: none;
}

.planet-detail-window--planet[data-window-state="minimized"] .planet-detail-content {
    display: none;
}

.system-panel-window,
.ship-detail-window {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.ship-detail-window {
    min-width: 420px;
    max-width: min(95vw, 1100px);
    min-height: 320px;
    max-height: min(90vh, 900px);
}

.ship-detail-window.starship-command-window {
    background: rgba(4, 12, 28, 0.95);
    border: 1px solid rgba(79, 195, 247, 0.35);
    box-shadow: 0 28px 60px rgba(2, 10, 28, 0.45);
    backdrop-filter: none;
}

.ship-detail-window.starship-command-window .starship-command-header {
    border-bottom: 1px solid rgba(79, 195, 247, 0.18);
}

.system-panel-window[data-window-state="maximized"],
.ship-detail-window[data-window-state="maximized"] {
    max-height: none;
}

.system-panel-window[data-window-state="minimized"] .planet-detail-content,
.ship-detail-window[data-window-state="minimized"] .planet-detail-content {
    display: none;
}

.planet-detail-window[data-window-state="minimized"],
.system-panel-window[data-window-state="minimized"],
.ship-detail-window[data-window-state="minimized"] {
    min-height: 0;
}

.ship-detail-window .planet-detail-content {
    padding: 18px 24px 26px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ship-detail-window.starship-command-window .ship-detail-content {
    padding: 18px 20px 24px;
    gap: 18px;
    background: transparent;
}

.ship-detail-window.starship-command-window .planet-detail-meta {
    margin: 0;
    gap: 10px;
}

.ship-detail-window.starship-command-window .planet-detail-section {
    margin: 0;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.22);
    background: rgba(8, 24, 48, 0.82);
    box-shadow: 0 16px 32px rgba(2, 10, 24, 0.38);
}

.ship-detail-window.starship-command-window .planet-detail-section + .planet-detail-section {
    margin-top: 0;
    border-top: none;
}

.ship-detail-window.starship-command-window .planet-detail-section h3 {
    color: rgba(173, 236, 255, 0.92);
}

.ship-detail-window.starship-command-window .ship-detail-camera-window {
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    background: linear-gradient(145deg, rgba(6, 18, 38, 0.95), rgba(2, 10, 24, 0.85));
    box-shadow: 0 18px 36px rgba(2, 10, 24, 0.42);
}

.ship-detail-window.starship-command-window .starship-command-camera-info {
    background: rgba(4, 14, 32, 0.9);
    border-color: rgba(79, 195, 247, 0.28);
}

.ship-detail-window.starship-command-window .starship-command-camera-waypoints {
    background: rgba(6, 18, 38, 0.72);
    border-color: rgba(79, 195, 247, 0.22);
}

.ship-detail-window.starship-command-window .ship-detail-actions .ship-action-button {
    min-width: 150px;
}

.ship-detail-window.starship-command-window .planet-detail-section.ship-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ship-detail-window.starship-command-window .ship-detail-actions-grid {
    gap: 12px;
}

/* OpenTTD-style ship window layout */
.ship-detail-window--openttd .ship-detail-top-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    margin-bottom: 16px;
}

.ship-detail-window--openttd .ship-detail-camera-window {
    min-width: 0;
}

.ship-detail-window--openttd .ship-detail-actions-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 120px;
    max-width: 140px;
}

.ship-detail-window--openttd .ship-detail-actions-grid--square {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ship-detail-window--openttd .ship-detail-actions-grid--square .ship-action-button {
    min-width: unset;
    width: 100%;
    aspect-ratio: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    border-radius: 8px;
}

.ship-detail-window--openttd .ship-detail-actions-grid--square .ship-action-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ship-detail-window--openttd .ship-detail-actions-grid--square .ship-action-button-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.ship-detail-window--openttd .ship-detail-actions-grid--square .ship-action-button-label {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
}

.ship-detail-window--openttd .starship-command-camera-actions {
    margin-top: auto;
}

/* Responsive adjustments for OpenTTD layout */
@media (max-width: 768px) {
    .ship-detail-window--openttd .ship-detail-top-grid {
        grid-template-columns: 1fr;
    }

    .ship-detail-window--openttd .ship-detail-actions-sidebar {
        max-width: none;
    }

    .ship-detail-window--openttd .ship-detail-actions-grid--square {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ship-detail-window--openttd .ship-detail-actions-grid--square .ship-action-button {
        flex: 1 1 calc(50% - 4px);
        min-width: 100px;
    }
}

.window-resize-handle {
    position: absolute;
    z-index: 12;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.window-resize-handle::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 6px;
    background: rgba(79, 220, 255, 0.18);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.window-resize-handle:hover::after,
.window-resize-handle:active::after {
    opacity: 1;
}

.window-resize-handle--n,
.window-resize-handle--s {
    left: 18px;
    right: 18px;
    height: 12px;
}

.window-resize-handle--n {
    top: -6px;
    cursor: ns-resize;
}

.window-resize-handle--s {
    bottom: -6px;
    cursor: ns-resize;
}

.window-resize-handle--e,
.window-resize-handle--w {
    top: 18px;
    bottom: 18px;
    width: 12px;
}

.window-resize-handle--e {
    right: -6px;
    cursor: ew-resize;
}

.window-resize-handle--w {
    left: -6px;
    cursor: ew-resize;
}

.window-resize-handle--ne,
.window-resize-handle--se,
.window-resize-handle--sw,
.window-resize-handle--nw {
    width: 16px;
    height: 16px;
}

.window-resize-handle--ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.window-resize-handle--se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.window-resize-handle--sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.window-resize-handle--nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.planet-detail-window.resizing,
.ship-detail-window.resizing,
.system-panel-window.resizing {
    user-select: none;
}

.planet-detail-window[data-window-state="maximized"] .window-resize-handle,
.planet-detail-window[data-window-state="minimized"] .window-resize-handle,
.system-panel-window[data-window-state="maximized"] .window-resize-handle,
.system-panel-window[data-window-state="minimized"] .window-resize-handle,
.ship-detail-window[data-window-state="maximized"] .window-resize-handle,
.ship-detail-window[data-window-state="minimized"] .window-resize-handle {
    display: none;
}

.system-panel-content {
    gap: 16px;
}

.planet-detail-drag-handle {
    height: 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
}

.planet-detail-drag-handle::before {
    content: '';
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: rgba(79, 220, 255, 0.45);
}

.planet-detail-window.dragging .planet-detail-drag-handle::before {
    background: rgba(79, 220, 255, 0.65);
}

.planet-detail-drag-handle:active,
.planet-detail-window.dragging .planet-detail-drag-handle {
    cursor: grabbing;
}

.planet-detail-window.dragging {
    user-select: none;
    cursor: grabbing;
}

.planet-detail-title-bar {
    height: auto;
    margin: 0;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(6, 14, 30, 0.92);
    border-bottom: 1px solid rgba(79, 220, 255, 0.28);
    user-select: none;
}

.planet-detail-title-bar::before {
    content: none;
}

.planet-detail-window.dragging .planet-detail-title-bar {
    background: rgba(6, 14, 30, 0.98);
}

.planet-detail-window h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.planet-detail-title {
    margin: 0;
    font-size: 1.125rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ship-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

.ship-detail-title-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ship-detail-title-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.ship-detail-title-status[hidden] {
    display: none;
}

.ship-detail-subtitle {
    margin: 2px 0 0;
    font-size: 0.75rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(173, 236, 255, 0.75);
}

.planet-detail-title-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.planet-detail-title-button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(79, 220, 255, 0.35);
    background: rgba(79, 220, 255, 0.12);
    color: #e8f5ff;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.planet-detail-title-button span {
    pointer-events: none;
}

.planet-detail-title-button:hover {
    background: rgba(79, 220, 255, 0.22);
    border-color: rgba(79, 220, 255, 0.55);
}

.planet-detail-title-button:focus-visible {
    outline: none;
    background: rgba(79, 220, 255, 0.22);
    border-color: rgba(79, 220, 255, 0.65);
    box-shadow: 0 0 0 2px rgba(79, 220, 255, 0.35);
}

.planet-detail-title-button--close {
    background: rgba(255, 120, 120, 0.18);
    border-color: rgba(255, 120, 120, 0.5);
    color: #ffecec;
}

.planet-detail-title-button--close:hover {
    background: rgba(255, 120, 120, 0.3);
    border-color: rgba(255, 120, 120, 0.65);
}

.planet-detail-title-button--close:focus-visible {
    background: rgba(255, 120, 120, 0.3);
    border-color: rgba(255, 120, 120, 0.75);
    box-shadow: 0 0 0 2px rgba(255, 120, 120, 0.45);
}

.planet-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.planet-detail-meta:empty {
    display: none;
}

.planet-detail-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #3fd6ff, #4af2c3);
    color: #031524;
}

.planet-detail-chip--home {
    background: linear-gradient(135deg, #4af2c3, #5dffdd);
    color: #02211d;
}

.planet-detail-chip--status-positive {
    background: linear-gradient(135deg, rgba(74, 242, 195, 0.35), rgba(63, 214, 255, 0.4));
    color: #c7f4ff;
}

.planet-detail-chip--status-warning {
    background: linear-gradient(135deg, rgba(255, 196, 120, 0.4), rgba(255, 140, 92, 0.4));
    color: #ffe3c7;
}

.ship-detail-chip--friendly {
    background: linear-gradient(135deg, rgba(74, 242, 195, 0.35), rgba(63, 214, 255, 0.35));
    color: #4af2c3;
}

.ship-detail-chip--enemy {
    background: linear-gradient(135deg, rgba(255, 120, 120, 0.35), rgba(255, 70, 70, 0.35));
    color: #ff6e6e;
}

.ship-detail-chip--pinned {
    background: linear-gradient(135deg, rgba(255, 214, 102, 0.4), rgba(255, 179, 71, 0.4));
    color: #ffe7b3;
}

.planet-detail-section {
    margin-top: 4px;
}

.planet-detail-section + .planet-detail-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.planet-detail-section h3 {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(79, 220, 255, 0.85);
}

.ship-cargo-summary {
    margin: 0 0 8px;
    font-size: 0.8125rem;
    color: rgba(226, 246, 255, 0.75);
}

.ship-cargo-empty,
.ship-cargo-inventory-empty,
.ship-transfer-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(226, 246, 255, 0.6);
}

.ship-cargo-list,
.ship-transfer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ship-transfer-list {
    gap: 10px;
}

.ship-cargo-item,
.ship-transfer-item {
    border: 1px solid rgba(79, 220, 255, 0.18);
    border-radius: 6px;
    padding: 10px 12px;
    background: rgba(6, 20, 40, 0.35);
}

.ship-cargo-header,
.ship-transfer-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.ship-cargo-name,
.ship-transfer-resource {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(226, 246, 255, 0.92);
    letter-spacing: 0.6px;
}

.ship-transfer-resource {
    text-transform: uppercase;
}

.ship-cargo-usage,
.ship-transfer-amount {
    font-size: 0.75rem;
    color: rgba(79, 220, 255, 0.85);
    font-weight: 600;
}

.ship-cargo-free {
    font-size: 0.75rem;
    color: rgba(226, 246, 255, 0.72);
    margin-top: 4px;
}

.ship-transfer-meta {
    font-size: 0.75rem;
    color: rgba(226, 246, 255, 0.72);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ship-transfer-meta-text {
    font-size: inherit;
    color: inherit;
}

.ship-cargo-inventory {
    margin: 8px 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: rgba(226, 246, 255, 0.78);
}

.ship-cargo-inventory li {
    list-style: disc;
}

.comet-detail-intel {
    margin: 0;
    font-size: 0.5625rem;
    line-height: 1.5;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.82);
}

.comet-detail-intel--warning {
    color: #ffd7c4;
}

.planet-detail-grid {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 16px;
}

.planet-detail-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.planet-detail-grid dt {
    font-size: 0.6875rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin: 0;
}

.planet-detail-grid dd {
    margin: 0;
    font-size: 0.875rem;
    color: #f3fbff;
}

.planet-resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planet-resource-item {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(79, 220, 255, 0.08);
    border: 1px solid rgba(79, 220, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.planet-resource-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.planet-resource-name {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #f3fbff;
}

.planet-resource-amount {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
}

.planet-resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.planet-resource-percent {
    font-weight: 500;
    color: rgba(79, 220, 255, 0.9);
}

.planet-resource-regeneration {
    color: rgba(255, 255, 255, 0.72);
}

.planet-resource-progress {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.planet-resource-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(79, 220, 255, 0.95), rgba(40, 160, 255, 0.95));
}

.planet-detail-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.planet-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(79, 220, 255, 0.12);
    border: 1px solid rgba(79, 220, 255, 0.35);
    color: #e8f5ff;
    border-radius: 0;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ship-builder-window {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
    width: min(960px, 94vw);
    max-height: min(90vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(10, 22, 44, 0.94), rgba(6, 14, 30, 0.9));
    border-radius: 18px;
    border: 1px solid rgba(79, 195, 247, 0.4);
}

.ship-builder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ship-builder-title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ship-builder-subtitle {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.8px;
}

.ship-builder-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ship-builder-body {
    display: flex;
    gap: 18px;
    flex: 1;
    min-height: 0;
}

.ship-builder-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ship-builder-form-scroller {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ship-builder-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: rgba(6, 16, 34, 0.85);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 16px;
    min-width: 240px;
    max-height: 100%;
}

.ship-builder-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ship-builder-section h3 {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(79, 220, 255, 0.85);
}

.ship-builder-label {
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.ship-builder-input,
.ship-builder-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(6, 18, 38, 0.85);
    color: #e6f6ff;
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ship-builder-input:focus,
.ship-builder-select:focus {
    outline: none;
    border-color: rgba(79, 220, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(79, 220, 255, 0.25);
}

.ship-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.ship-builder-hull-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.ship-builder-hull-stats span {
    display: block;
    letter-spacing: 0.6px;
}

.ship-builder-module-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ship-builder-module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
}

.ship-builder-module-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(11, 26, 54, 0.72);
    color: rgba(189, 233, 255, 0.9);
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ship-builder-module-tab:hover {
    border-color: rgba(79, 220, 255, 0.6);
    color: #ffffff;
}

.ship-builder-module-tab.active {
    background: rgba(79, 195, 247, 0.35);
    border-color: rgba(79, 220, 255, 0.85);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(79, 195, 247, 0.25);
}

.ship-builder-module-tab:focus-visible {
    outline: 2px solid rgba(79, 220, 255, 0.85);
    outline-offset: 2px;
}

.ship-builder-module-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ship-builder-module-group-title {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(79, 220, 255, 0.75);
}

.ship-builder-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.ship-builder-module-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(8, 20, 42, 0.78);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.05);
}

.ship-builder-module-card strong {
    font-size: 0.875rem;
    letter-spacing: 0.7px;
}

.ship-builder-module-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.68);
}

.ship-builder-module-description {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.62);
}

.ship-builder-module-add {
    align-self: flex-start;
}

.ship-builder-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(79, 195, 247, 0.18);
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #bde9ff;
}

.ship-builder-selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.ship-builder-selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.22);
    background: rgba(6, 18, 34, 0.78);
}

.ship-builder-selected-item strong {
    font-size: 0.8125rem;
    letter-spacing: 0.6px;
}

.ship-builder-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.ship-builder-warning {
    margin: 0;
    font-size: 0.75rem;
    color: #ffb9b9;
    background: rgba(255, 120, 120, 0.12);
    border: 1px solid rgba(255, 120, 120, 0.28);
    border-radius: 12px;
    padding: 8px 10px;
}

.ship-builder-empty {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 28px 12px;
}

.ship-builder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ship-builder-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ship-builder-button {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(79, 195, 247, 0.18);
    color: #e6f7ff;
    font-size: 0.8125rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ship-builder-button:hover {
    background: rgba(79, 220, 255, 0.32);
    color: #041826;
}

.ship-builder-button.primary {
    background: linear-gradient(135deg, rgba(79, 220, 255, 0.75), rgba(74, 242, 195, 0.75));
    border-color: rgba(79, 220, 255, 0.85);
    color: #01111f;
}

.ship-builder-button.secondary {
    background: rgba(12, 24, 48, 0.65);
}

.ship-builder-button.danger {
    background: rgba(255, 120, 120, 0.18);
    border-color: rgba(255, 120, 120, 0.4);
    color: #ffbaba;
}

.ship-builder-remove {
    background: rgba(255, 120, 120, 0.18);
    border: 1px solid rgba(255, 120, 120, 0.45);
    color: #ffb3b3;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    cursor: pointer;
}

.ship-builder-remove:hover {
    background: rgba(255, 120, 120, 0.3);
}

.ship-builder-search input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(10, 22, 44, 0.7);
    color: #f1fbff;
}

.ship-builder-search input:focus {
    outline: none;
    border-color: rgba(79, 220, 255, 0.75);
    box-shadow: 0 0 0 2px rgba(79, 220, 255, 0.25);
}

.ship-builder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(79, 195, 247, 0.18);
    border-radius: 14px;
    background: rgba(4, 12, 28, 0.72);
}

.ship-builder-ship-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ship-builder-ship-item:hover {
    background: rgba(79, 195, 247, 0.15);
}

.ship-builder-ship-item.active {
    background: rgba(79, 220, 255, 0.2);
    border-color: rgba(79, 220, 255, 0.45);
}

.ship-builder-ship-name {
    font-family: Menlo, Consolas, "Droid Sans Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #bde9ff;
}

.ship-builder-ship-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.62);
}

.ship-builder-module-notice {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.68);
}

.ship-builder-allowed-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ship-builder-divider {
    height: 1px;
    background: rgba(79, 195, 247, 0.15);
    border: none;
    margin: 6px 0;
}

@media (max-width: 900px) {
    .ship-builder-body {
        flex-direction: column;
    }

    .ship-builder-sidebar {
        min-width: 0;
    }
}


.ground-base-window {
    width: min(900px, 92vw);
    max-width: min(900px, 92vw);
    max-height: min(88vh, 760px);
    min-height: 320px;
    overflow: hidden;
}

.ground-base-status {
    margin: 12px 16px 0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(79, 220, 255, 0.35);
    background: rgba(79, 220, 255, 0.12);
    color: #a6e9ff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ground-base-status--success {
    background: rgba(74, 242, 195, 0.15);
    border-color: rgba(74, 242, 195, 0.5);
    color: #89f8d6;
}

.ground-base-status--error {
    background: rgba(255, 120, 120, 0.2);
    border-color: rgba(255, 120, 120, 0.45);
    color: #ffc7c7;
}

.ground-base-status--info {
    background: rgba(79, 220, 255, 0.16);
    border-color: rgba(79, 220, 255, 0.45);
    color: #a6e9ff;
}

.ground-base-body {
    display: flex;
    gap: 16px;
    padding: 16px 18px 18px;
    flex: 1;
    min-height: 0;
}

.ground-base-sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.ground-base-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    min-height: 0;
}

.ground-base-panel {
    background: rgba(6, 18, 38, 0.88);
    border: 1px solid rgba(79, 220, 255, 0.18);
    border-radius: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
    min-height: 0;
}

.ground-base-main > .ground-base-panel {
    flex: 1;
}

.ground-base-panel-title {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(79, 220, 255, 0.85);
}

.ground-base-summary {
    display: flex;
    flex-direction: column;
}

.ground-base-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ground-base-summary-item {
    background: rgba(10, 26, 54, 0.78);
    border: 1px solid rgba(79, 220, 255, 0.18);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ground-base-summary-label {
    font-size: 0.6875rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.9);
}

.ground-base-summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #e9fbff;
}

.ground-base-resource-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ground-base-resource-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(10, 26, 54, 0.65);
    border: 1px solid rgba(79, 220, 255, 0.16);
    border-radius: 12px;
}

.ground-base-resource-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.ground-base-resource-text {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-size: 0.8125rem;
}

.ground-base-resource-name {
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.82);
}

.ground-base-resource-value {
    font-weight: 600;
    color: #e6f5ff;
}

.ground-base-resource-value--depleted {
    color: rgba(255, 140, 140, 0.85);
}

.ground-base-resource-rate {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #7dffb3;
    background: rgba(125, 255, 179, 0.12);
    border-radius: 3px;
    vertical-align: middle;
}

.ground-base-module-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding-right: 6px;
}

.ground-base-module-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(79, 220, 255, 0.18);
    background: rgba(10, 26, 54, 0.78);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ground-base-module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 220, 255, 0.32);
    box-shadow: 0 24px 36px rgba(0, 0, 0, 0.4);
}

.ground-base-module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ground-base-module-name {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.7px;
}

.ground-base-module-type {
    display: inline-block;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(79, 220, 255, 0.18);
    border: 1px solid rgba(79, 220, 255, 0.28);
    color: rgba(189, 233, 255, 0.88);
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.ground-base-module-description {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(215, 238, 255, 0.78);
    line-height: 1.45;
}

.ground-base-module-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(189, 233, 255, 0.75);
}

.ground-base-module-cost {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.ground-base-module-cost-label {
    font-size: 0.6875rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.9);
}

.ground-base-module-cost-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ground-base-module-cost-list li {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(215, 238, 255, 0.86);
}

.ground-base-module-cost-empty {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(215, 238, 255, 0.72);
}

.ground-base-installed-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.ground-base-installed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(79, 220, 255, 0.18);
    background: rgba(10, 24, 48, 0.72);
}

.ground-base-installed-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ground-base-installed-main strong {
    font-size: 0.875rem;
    letter-spacing: 0.7px;
}

.ground-base-installed-type {
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.7);
}

.ground-base-installed-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(189, 233, 255, 0.78);
}

.ground-base-installed-stats span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(79, 220, 255, 0.15);
    border: 1px solid rgba(79, 220, 255, 0.25);
}

.ground-base-construction {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ground-base-construction-active {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(79, 220, 255, 0.22);
    background: rgba(10, 24, 48, 0.78);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ground-base-construction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ground-base-construction-header strong {
    font-size: 0.9375rem;
    letter-spacing: 0.7px;
}

.ground-base-construction-meta {
    display: block;
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.7);
}

.ground-base-construction-remaining {
    font-size: 0.75rem;
    color: rgba(189, 233, 255, 0.85);
}

.ground-base-progress {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(79, 220, 255, 0.12);
    border: 1px solid rgba(79, 220, 255, 0.22);
    overflow: hidden;
}

.ground-base-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 220, 255, 0.9), rgba(74, 242, 195, 0.9));
    border-radius: inherit;
    transition: width 0.3s ease;
}

.ground-base-construction-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ground-base-construction-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ground-base-construction-queue h4 {
    margin: 0;
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(189, 233, 255, 0.75);
}

.ground-base-construction-queue ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ground-base-construction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(79, 220, 255, 0.16);
    background: rgba(10, 24, 48, 0.65);
}

.ground-base-construction-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ground-base-construction-item-main strong {
    font-size: 0.875rem;
}

.ground-base-empty {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    color: rgba(189, 233, 255, 0.7);
}

.ground-base-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(79, 220, 255, 0.4);
    background: rgba(79, 220, 255, 0.18);
    color: #e6f5ff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ground-base-button:hover:not([disabled]),
.ground-base-button:focus-visible:not([disabled]) {
    background: rgba(79, 220, 255, 0.3);
    border-color: rgba(79, 220, 255, 0.6);
    box-shadow: 0 0 18px rgba(79, 220, 255, 0.25);
    outline: none;
}

.ground-base-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.ground-base-button.primary {
    background: linear-gradient(135deg, rgba(79, 220, 255, 0.75), rgba(74, 242, 195, 0.75));
    border-color: rgba(79, 220, 255, 0.85);
    color: #0b172f;
}

.ground-base-button.primary:disabled {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(230, 245, 255, 0.7);
}

.ground-base-button.secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: #e6f5ff;
}

.ground-base-button.secondary:hover:not([disabled]),
.ground-base-button.secondary:focus-visible:not([disabled]) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

.ground-base-button.danger {
    background: rgba(255, 120, 120, 0.22);
    border-color: rgba(255, 120, 120, 0.45);
    color: #ffe5e5;
}

.ground-base-button.danger:hover:not([disabled]),
.ground-base-button.danger:focus-visible:not([disabled]) {
    background: rgba(255, 120, 120, 0.36);
    border-color: rgba(255, 120, 120, 0.6);
}

@media (max-width: 1100px) {
    .ground-base-body {
        flex-direction: column;
    }

    .ground-base-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
    }

    .ground-base-sidebar .ground-base-panel {
        flex: 1 1 260px;
    }
}

@media (max-width: 720px) {
    .ground-base-summary-grid {
        grid-template-columns: 1fr;
    }

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

.planet-detail-close:hover,
.planet-detail-close:focus-visible {
    background: rgba(79, 220, 255, 0.22);
    border-color: rgba(79, 220, 255, 0.5);
    outline: none;
}

.planet-detail-close span {
    display: block;
    transform: translateY(-1px);
}

#toastContainer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 48px));
    min-width: min(320px, calc(100vw - 48px));
    min-height: 18px;
    padding: 2px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    border-radius: 0;
    background: rgba(17, 23, 29, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: none;
    z-index: 1000;
    pointer-events: none;
    outline: 1px solid rgba(79, 195, 247, 0.7);
}

@media (max-width: 720px) {
    #toastContainer {
        bottom: 16px;
        width: min(92vw, calc(100vw - 32px));
        min-width: min(260px, calc(100vw - 32px));
        gap: 18px;
        padding: 2px 16px;
    }
}

.distance-tool-hud {
    position: fixed;
    left: calc(var(--icon-panel-width) + 16px);
    bottom: 24px;
    width: min(380px, calc(100vw - var(--icon-panel-width) - 40px));
    padding: 16px 18px 18px;
    background: rgba(10, 16, 28, 0.92);
    border: 1px solid rgba(79, 195, 247, 0.28);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    color: #e9f6ff;
    z-index: 950;
    backdrop-filter: none;
}

.distance-tool-hud[hidden] {
    display: none;
}

.distance-tool-hud-title {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #9bd8ff;
}

.distance-tool-hud .distance-tool-description {
    font-size: 0.75rem;
    margin-bottom: 10px;
    opacity: 0.85;
}

.distance-tool-hud .distance-tool-status {
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgba(233, 246, 255, 0.9);
}

.distance-tool-hud .distance-tool-actions {
    justify-content: flex-end;
}

.distance-tool-hud .distance-tool-button {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.6875rem;
}

.toast {
    flex: 0 0 auto;
    background: transparent;
    color: #f5fbff;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 0;
    margin: 0;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
    transform: translateX(100%);
    animation: toastTicker var(--toast-duration, 16000ms) linear forwards;
    pointer-events: auto;
}

.toast.interactive {
    cursor: pointer;
    user-select: none;
    text-decoration: underline;
}

.toast.interactive:hover,
.toast.interactive:focus,
.toast.interactive:focus-visible {
    animation-play-state: paused;
}

.toast.interactive:focus-visible {
    outline: 2px solid #4af2c3;
    outline-offset: 4px;
}

.planet-command-window {
    width: min(900px, 95vw);
    min-width: 520px;
    max-width: min(95vw, 1200px);
    min-height: 280px;
    max-height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid var(--fleet-manager-border-color);
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    font-family: 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 0.6875rem;
    line-height: 1.45;
    letter-spacing: 0.4px;
    color: #e7f4ff;
}

.planet-command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(10, 24, 48, 0.92), rgba(18, 42, 74, 0.9));
    border-bottom: 1px solid rgba(79, 195, 247, 0.32);
    box-shadow: inset 0 -1px 0 rgba(79, 195, 247, 0.18);
}

.planet-command-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.planet-command-title {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-family: 'TheGoodMonolith', 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 600;
    color: #f7fbff;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.35);
}

.planet-command-subtitle {
    margin: 0;
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(159, 219, 255, 0.75);
}

.planet-command-close {
    border: none;
    background: rgba(79, 195, 247, 0.14);
    color: rgba(239, 248, 255, 0.9);
    width: 24px;
    height: 24px;
    border-radius: 0;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.22);
}

.planet-command-close:hover,
.planet-command-close:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.32);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 195, 247, 0.35), 0 0 0 3px rgba(79, 195, 247, 0.3);
}

.planet-command-body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    overflow: auto;
    background: rgba(6, 18, 38, 0.9);
}

.planet-command-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 0;
    border: 1px dashed rgba(79, 195, 247, 0.45);
    background: rgba(12, 32, 58, 0.78);
    color: rgba(210, 234, 255, 0.9);
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
}

.planet-command-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planet-command-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.planet-command-summary-item {
    background: rgba(8, 22, 44, 0.88);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.planet-command-summary-label {
    font-size: 0.5625rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(173, 223, 255, 0.9);
}

.planet-command-summary-value {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #9bd8ff;
    text-shadow: 0 0 8px rgba(79, 195, 247, 0.25);
}

.planet-command-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.planet-command-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: min(100%, 220px);
    font-size: 0.625rem;
    color: rgba(192, 226, 255, 0.92);
}

.planet-command-filter-label {
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.planet-command-filter-input,
.planet-command-filter-select {
    border-radius: 0;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    padding: 6px 8px;
    font-size: 0.6875rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.planet-command-filter-input::placeholder {
    color: rgba(200, 232, 255, 0.55);
}

.planet-command-filter-input:focus,
.planet-command-filter-select:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.planet-command-table-wrapper {
    border: 1px solid rgba(79, 195, 247, 0.28);
    border-radius: 0;
    overflow: hidden;
    background: rgba(8, 20, 42, 0.92);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.planet-command-table {
    width: 100%;
    border-collapse: collapse;
    color: #e7f4ff;
    font-size: 0.6875rem;
    letter-spacing: 0.4px;
}

.planet-command-table thead {
    background: rgba(10, 28, 54, 0.96);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.planet-command-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(79, 195, 247, 0.35);
    color: rgba(173, 223, 255, 0.85);
}

.planet-command-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.16);
    vertical-align: top;
}

.planet-command-table tbody tr:last-child td {
    border-bottom: none;
}

.planet-command-table tbody tr:hover {
    background: rgba(20, 44, 78, 0.35);
}

.planet-command-name {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.planet-command-name-text {
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.8125rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    font-weight: 600;
}

.planet-command-name-meta {
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    color: rgba(200, 230, 255, 0.72);
}

.planet-command-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.planet-command-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.55rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: rgba(79, 195, 247, 0.2);
    color: rgba(200, 230, 255, 0.95);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.planet-command-badge--colony {
    background: rgba(129, 199, 132, 0.28);
    border-color: rgba(129, 199, 132, 0.5);
    color: #e8ffe8;
}

.planet-command-badge--outpost {
    background: rgba(255, 213, 79, 0.22);
    border-color: rgba(255, 213, 79, 0.45);
    color: #fff6c2;
}

.planet-command-badge--base {
    background: rgba(255, 138, 101, 0.24);
    border-color: rgba(255, 138, 101, 0.45);
    color: #ffe0d6;
}

.planet-command-badge--comet {
    background: rgba(30, 144, 255, 0.24);
    border-color: rgba(30, 144, 255, 0.5);
    color: #d6ecff;
}

.planet-command-badge--traveling {
    background: rgba(65, 105, 225, 0.22);
    border-color: rgba(65, 105, 225, 0.45);
    color: #d6e4ff;
}

.planet-command-badge--ready {
    background: rgba(76, 175, 80, 0.24);
    border-color: rgba(76, 175, 80, 0.48);
    color: #e5ffe7;
}

.planet-command-badge--docked {
    background: rgba(72, 133, 237, 0.18);
    border-color: rgba(72, 133, 237, 0.4);
    color: #d9e7ff;
}

.planet-command-badge--repairing {
    background: rgba(255, 167, 38, 0.2);
    border-color: rgba(255, 167, 38, 0.45);
    color: #fff1d6;
}

.planet-command-system {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.planet-command-system-name {
    font-size: 0.8125rem;
    letter-spacing: 0.8px;
}

.planet-command-system-meta {
    font-size: 0.6875rem;
    color: rgba(200, 230, 255, 0.65);
    letter-spacing: 0.6px;
}

.planet-command-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.planet-command-stat-value {
    font-size: 0.8125rem;
    letter-spacing: 0.6px;
    color: rgba(232, 245, 255, 0.95);
}

.planet-command-stat-meta {
    font-size: 0.6875rem;
    color: rgba(200, 230, 255, 0.82);
    letter-spacing: 0.6px;
}

.planet-command-waypoints {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.planet-command-waypoint-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.planet-command-waypoint-label {
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(155, 216, 255, 0.9);
    flex-shrink: 0;
}

.planet-command-waypoint-value {
    font-size: 0.8125rem;
    letter-spacing: 0.6px;
    color: rgba(232, 245, 255, 0.95);
}

.planet-command-waypoint-row--active .planet-command-waypoint-label {
    color: rgba(129, 212, 250, 0.9);
}

.planet-command-waypoint-row--active .planet-command-waypoint-value {
    color: #e8f5ff;
}

.planet-command-waypoint-row--loop .planet-command-waypoint-value {
    font-size: 0.6875rem;
    letter-spacing: 0.8px;
    color: rgba(129, 212, 250, 0.75);
}

.planet-command-waypoint-empty {
    font-size: 0.75rem;
    color: rgba(200, 230, 255, 0.6);
    letter-spacing: 0.6px;
}

.planet-command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.planet-command-button {
    border: 1px solid rgba(79, 195, 247, 0.45);
    background: rgba(12, 32, 58, 0.85);
    color: rgba(220, 236, 255, 0.9);
    border-radius: 0;
    padding: 6px 12px;
    font-size: 0.625rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.planet-command-button:hover,
.planet-command-button:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.32);
    color: #ffffff;
    border-color: rgba(79, 195, 247, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 195, 247, 0.35);
}

.planet-command-button.secondary {
    background: rgba(8, 20, 42, 0.9);
    color: rgba(210, 224, 255, 0.8);
}

.planet-command-button.secondary:hover,
.planet-command-button.secondary:focus-visible {
    background: rgba(79, 195, 247, 0.24);
    color: #ffffff;
}

.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 24, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 260;
    backdrop-filter: none;
}

.welcome-overlay[hidden] {
    display: none;
}

.welcome-window.starship-command-window--compact {
    width: min(560px, 92vw);
    min-width: min(420px, 92vw);
    max-height: min(80vh, 640px);
}

.welcome-body {
    padding: 22px 28px 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.welcome-message {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    letter-spacing: 0.7px;
    color: rgba(207, 226, 255, 0.82);
}

.welcome-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-label {
    font-size: 0.6875rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(189, 218, 255, 0.9);
}

.welcome-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

#welcomePlayerName {
    flex: 1;
    min-width: 220px;
    padding: 6px 8px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    font-family: inherit;
    font-size: 0.6875rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#welcomePlayerName::placeholder {
    color: rgba(200, 232, 255, 0.55);
}

#welcomePlayerName:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

#welcomeSubmitButton {
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.welcome-status {
    min-height: 1em;
}

@media (max-width: 640px) {
    .welcome-overlay {
        padding: 16px;
    }

    .welcome-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #welcomeSubmitButton {
        width: 100%;
    }
}

.planet-command-table-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(210, 234, 255, 0.78);
    background: rgba(12, 32, 58, 0.78);
    border: 1px dashed rgba(79, 195, 247, 0.4);
}

.planet-command-main {
    display: grid;
    gap: 24px;
    margin-top: 16px;
}

.planet-command-detail-panel {
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(8, 20, 42, 0.92);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
}

.planet-command-detail-empty {
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    color: rgba(200, 230, 255, 0.7);
    text-align: center;
    padding: 16px 12px;
}

.planet-command-detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.planet-command-detail-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.planet-command-detail-name {
    margin: 0;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #e7f4ff;
    outline: none;
}

.planet-command-detail-name:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.35);
}

.planet-command-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.planet-command-detail-section {
    padding: 0;
}

.planet-command-detail-section + .planet-command-detail-section {
    border-top: 1px solid rgba(79, 195, 247, 0.18);
    padding-top: 16px;
}

.planet-command-detail-close {
    margin-left: auto;
}

.planet-command-row--selected,
.planet-command-row--selected:hover {
    background: rgba(20, 60, 104, 0.4);
}

.planet-command-button--active {
    background: rgba(79, 195, 247, 0.24);
    color: #ffffff;
    border-color: rgba(79, 195, 247, 0.65);
}

.planet-command-button--active:hover,
.planet-command-button--active:focus-visible {
    background: rgba(79, 195, 247, 0.35);
}

@media (min-width: 960px) {
    .planet-command-main {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
        align-items: stretch;
    }

    .planet-command-detail-panel {
        min-height: 100%;
    }
}

#shipDetailOverlay {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0;
    align-items: flex-start;
    justify-content: flex-start;
}

#shipDetailOverlay.open {
    pointer-events: none;
}

#shipDetailOverlay.open .planet-detail-window {
    pointer-events: auto;
}

#starshipCommandOverlay {
    display: block;
    width: 0;
    height: 0;
    padding: 0;
    overflow: visible;
}

/* Ensure hidden starship overlay does not block pointer events or layout.
   A specific ID rule above can override the generic .planet-detail-overlay[hidden] rule,
   so explicitly hide when the `hidden` attribute is present. */
#starshipCommandOverlay[hidden] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

#starshipCommandOverlay .planet-detail-window {
    position: fixed;
    top: var(--starship-command-default-top, 96px);
    right: 32px;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 80;
    pointer-events: auto;
}

.starship-command-window {
    pointer-events: auto;
}

.starship-command-window--compact {
    width: min(900px, 95vw);
    min-width: 520px;
    max-width: min(95vw, 1200px);
    max-height: min(90vh, 820px);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 0;
    border: 1px solid var(--fleet-manager-border-color);
    background: linear-gradient(155deg, rgba(6, 18, 40, 0.96), rgba(10, 28, 54, 0.94));
    box-shadow: 0 18px 48px rgba(5, 12, 26, 0.75), 0 0 0 1px rgba(79, 195, 247, 0.12);
    font-family: 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 0.6875rem;
    line-height: 1.45;
    letter-spacing: 0.4px;
    color: #e7f4ff;
}

.starship-command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(10, 24, 48, 0.92), rgba(18, 42, 74, 0.9));
    border-bottom: 1px solid rgba(79, 195, 247, 0.32);
    box-shadow: inset 0 -1px 0 rgba(79, 195, 247, 0.18);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.starship-command-window-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.starship-command-frame-button {
    border: none;
    background: rgba(79, 195, 247, 0.14);
    color: rgba(239, 248, 255, 0.9);
    width: 18px;
    height: 18px;
    border-radius: 0;
    font-size: 0.875rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.22);
}

.starship-command-frame-button span {
    pointer-events: none;
}

.starship-command-frame-button:hover,
.starship-command-frame-button:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.32);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(79, 195, 247, 0.35), 0 0 0 3px rgba(79, 195, 247, 0.3);
    transform: translateY(-1px);
}

.starship-command-frame-button:active {
    transform: translateY(0);
}

.starship-command-header-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.starship-command-title {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-family: 'TheGoodMonolith', 'Rajdhani', 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 600;
    color: #f7fbff;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.35);
}

.starship-command-subtitle {
    margin: 0;
    font-size: 0.625rem;
    color: rgba(159, 219, 255, 0.75);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.starship-command-close {
    border: none;
    background: rgba(79, 195, 247, 0.14);
    color: rgba(239, 248, 255, 0.9);
    width: 18px;
    height: 18px;
    border-radius: 0;
    font-size: 0.875rem;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.22);
    padding: 0;
}

.starship-command-close:hover,
.starship-command-close:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.32);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(79, 195, 247, 0.35), 0 0 0 3px rgba(79, 195, 247, 0.3);
    transform: translateY(-1px);
}

.starship-command-header-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.starship-command-pin {
    border: none;
    background: rgba(79, 195, 247, 0.14);
    color: rgba(239, 248, 255, 0.9);
    width: 18px;
    height: 18px;
    border-radius: 0;
    font-size: 0.75rem;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.22);
    padding: 0;
}

.starship-command-pin:hover,
.starship-command-pin:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.32);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(79, 195, 247, 0.35), 0 0 0 3px rgba(79, 195, 247, 0.3);
    transform: translateY(-1px);
}

.starship-command-pin.is-pinned {
    background: rgba(255, 193, 7, 0.24);
    color: #ffc107;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.35);
}

.starship-command-pin.is-pinned:hover,
.starship-command-pin.is-pinned:focus-visible {
    background: rgba(255, 193, 7, 0.38);
    color: #ffd54f;
    box-shadow: 0 6px 18px rgba(255, 193, 7, 0.4), 0 0 0 3px rgba(255, 193, 7, 0.35);
}

.panel-pinned .draggable-panel-handle {
    cursor: default;
}

.starship-command-header button {
    cursor: pointer;
}

.starship-command-header--dragging {
    cursor: grabbing;
}

.starship-command-window--dragging {
    user-select: none;
}

.starship-command-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 14px 0;
    border-bottom: 1px solid rgba(79, 195, 247, 0.25);
}

.starship-command-tab {
    appearance: none;
    border: none;
    background: rgba(79, 195, 247, 0.12);
    color: rgba(240, 248, 255, 0.85);
    padding: 4px 10px;
    border-radius: 0;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.18);
}

.starship-command-tab.active {
    background: rgba(79, 195, 247, 0.32);
    color: #9bd8ff;
    box-shadow: 0 6px 16px rgba(5, 18, 36, 0.55);
}

.starship-command-tab:not(.active):hover {
    background: rgba(79, 195, 247, 0.2);
    color: #f4fbff;
}

.starship-command-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.35);
}

.starship-command-body {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(6, 18, 38, 0.9);
}

.starship-command-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 0;
    border: 1px dashed rgba(79, 195, 247, 0.45);
    background: rgba(12, 32, 58, 0.78);
    color: rgba(210, 234, 255, 0.9);
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
}

.starship-command-panels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

.starship-command-panels[hidden],
.starship-command-panel[hidden] {
    display: none !important;
}

.starship-command-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.starship-command-panel--fleet {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#starshipCommandOverlay .planet-command-body {
    overflow: hidden;
}

.starship-command-layout {
    display: grid;
    grid-template-columns: minmax(360px, 1.05fr) minmax(260px, 0.95fr);
    gap: 12px;
    align-items: stretch;
    min-height: 360px;
}

@media (max-width: 960px) {
    .starship-command-layout {
        grid-template-columns: 1fr;
    }
}

.starship-command-column {
    min-height: 0;
}

.starship-command-layout > .starship-command-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.starship-command-column--primary {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.24);
    background: linear-gradient(155deg, rgba(8, 22, 44, 0.9), rgba(6, 18, 38, 0.92));
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-column--sidebar {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: linear-gradient(160deg, rgba(10, 28, 56, 0.95), rgba(5, 14, 30, 0.94));
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.starship-command-list-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.starship-command-section-title {
    margin: 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #f2fbff;
}

.starship-command-section-subtitle {
    margin: 0;
    font-size: 0.625rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(173, 223, 255, 0.7);
}

.starship-command-list-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.starship-command-control-button {
    appearance: none;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(79, 195, 247, 0.14);
    color: rgba(236, 249, 255, 0.9);
    font: inherit;
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.starship-command-control-button:hover,
.starship-command-control-button:focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.28);
    color: #ffffff;
    transform: translateY(-1px);
}

.starship-command-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.24);
    background: linear-gradient(170deg, rgba(6, 18, 38, 0.88), rgba(4, 12, 26, 0.92));
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

#starshipCommandOverlay .starship-command-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
}

.starship-command-status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.starship-command-status-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.24);
    background: rgba(8, 22, 44, 0.75);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-status-label {
    font-size: 0.5625rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: rgba(159, 219, 255, 0.8);
}

.starship-command-status-value {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #d2f3ff;
}

.starship-command-camera-window {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.starship-command-camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.starship-command-camera-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.starship-command-camera {
    position: relative;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(2, 8, 18, 0.9);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.18);
}

.starship-command-camera-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 11;
    background: transparent;
}

.starship-command-camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(224, 243, 255, 0.82);
    background: linear-gradient(145deg, rgba(6, 18, 36, 0.88), rgba(6, 18, 36, 0.72));
    pointer-events: none;
}

.starship-command-camera-overlay[hidden] {
    display: none;
}

.starship-command-camera-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: rgba(4, 14, 28, 0.85);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-camera-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.starship-command-camera-name {
    margin: 0;
    font-size: 0.875rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #f2fbff;
}

.starship-command-camera-status {
    white-space: nowrap;
    font-size: 0.6rem;
}

.starship-command-camera-meta {
    margin: 0;
    display: grid;
    gap: 6px;
}

.starship-command-camera-meta-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px;
    align-items: baseline;
}

.starship-command-camera-meta-row dt {
    margin: 0;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(159, 219, 255, 0.75);
}

.starship-command-camera-meta-row dd {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(226, 243, 255, 0.92);
    letter-spacing: 0.4px;
}

.starship-command-camera-waypoints {
    max-height: 120px;
    overflow: auto;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.18);
    background: rgba(8, 22, 44, 0.65);
}

.starship-command-camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.starship-command-action-button--wide {
    flex: 1 1 140px;
    justify-content: center;
    font-size: 0.625rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(79, 195, 247, 0.14);
}

.starship-command-action-button--wide:hover,
.starship-command-action-button--wide:focus-visible {
    background: rgba(79, 195, 247, 0.28);
    border-color: rgba(79, 195, 247, 0.45);
}

.starship-command-action-button--wide .starship-command-action-icon {
    font-size: 0.75rem;
}

.starship-command-action-label {
    margin-left: 6px;
}

@media (max-width: 960px) {
    .starship-command-column--primary,
    .starship-command-column--sidebar {
        padding: 10px;
    }

    .starship-command-camera-meta-row {
        grid-template-columns: 1fr;
    }

    .starship-command-camera-meta-row dt {
        font-size: 0.55rem;
    }

    #starshipCommandOverlay .planet-command-body {
        overflow: auto;
    }
}

.starship-command-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-radius: 0;
    border: 1px solid rgba(79, 195, 247, 0.32);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.18);
    background: rgba(8, 22, 48, 0.55);
}

.starship-command-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    table-layout: fixed;
}

.starship-command-table-head th {
    position: sticky;
    top: 0;
    background: rgba(6, 18, 38, 0.95);
    padding: 10px 16px 10px 12px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.625rem;
    color: rgba(210, 234, 255, 0.75);
    border-bottom: 1px solid rgba(79, 195, 247, 0.32);
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-table-head th[data-starship-command-sorted="true"] {
    color: rgba(242, 253, 255, 0.95);
    background: rgba(10, 30, 60, 0.98);
}

.starship-command-sort-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.starship-command-sort-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-sort-button:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: 2px;
    border-radius: 2px;
}

.starship-command-sort-button:hover .starship-command-sort-label {
    color: rgba(244, 255, 255, 0.9);
}

.starship-command-sort-button[data-sort-active="true"] .starship-command-sort-label {
    color: rgba(244, 255, 255, 0.9);
    font-weight: 600;
}

.starship-command-sort-indicator {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 9px;
}

.starship-command-sort-indicator::before,
.starship-command-sort-indicator::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transition: border-color 0.18s ease;
}

.starship-command-sort-indicator::before {
    border-bottom: 6px solid rgba(210, 234, 255, 0.35);
}

.starship-command-sort-indicator::after {
    border-top: 6px solid rgba(210, 234, 255, 0.35);
}

.starship-command-sort-button:hover .starship-command-sort-indicator::before {
    border-bottom-color: rgba(210, 234, 255, 0.6);
}

.starship-command-sort-button:hover .starship-command-sort-indicator::after {
    border-top-color: rgba(210, 234, 255, 0.6);
}

.starship-command-sort-button[data-sort-active="true"][data-sort-direction="asc"] .starship-command-sort-indicator::before {
    border-bottom-color: rgba(129, 222, 255, 0.9);
}

.starship-command-sort-button[data-sort-active="true"][data-sort-direction="desc"] .starship-command-sort-indicator::after {
    border-top-color: rgba(129, 222, 255, 0.9);
}

.starship-command-column--actions {
    text-align: right;
    white-space: nowrap;
}

.starship-command-table-body .starship-command-row:last-child .starship-command-cell {
    border-bottom: none;
}

.starship-command-table[data-starship-command-table] th[data-starship-command-column],
.starship-command-table[data-starship-command-table] td[data-starship-command-column] {
    position: relative;
}

.starship-command-table[data-starship-command-table] th.starship-command-column--name,
.starship-command-table[data-starship-command-table] td.starship-command-column--name {
    min-width: var(--starship-column-name-width, 220px);
    width: var(--starship-column-name-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--status,
.starship-command-table[data-starship-command-table] td.starship-command-column--status {
    min-width: var(--starship-column-status-width, 140px);
    width: var(--starship-column-status-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--location,
.starship-command-table[data-starship-command-table] td.starship-command-column--location {
    min-width: var(--starship-column-location-width, 180px);
    width: var(--starship-column-location-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--destination,
.starship-command-table[data-starship-command-table] td.starship-command-column--destination {
    min-width: var(--starship-column-destination-width, 200px);
    width: var(--starship-column-destination-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--hull,
.starship-command-table[data-starship-command-table] td.starship-command-column--hull {
    min-width: var(--starship-column-hull-width, 130px);
    width: var(--starship-column-hull-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--shield,
.starship-command-table[data-starship-command-table] td.starship-command-column--shield {
    min-width: var(--starship-column-shield-width, 130px);
    width: var(--starship-column-shield-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--signature,
.starship-command-table[data-starship-command-table] td.starship-command-column--signature {
    min-width: var(--starship-column-signature-width, 140px);
    width: var(--starship-column-signature-width, auto);
}

.starship-command-table[data-starship-command-table] th.starship-command-column--actions,
.starship-command-table[data-starship-command-table] td.starship-command-column--actions {
    min-width: var(--starship-column-actions-width, 120px);
    width: var(--starship-column-actions-width, auto);
}

.starship-command-column-resizer {
    position: absolute;
    top: 0;
    right: 2px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    z-index: 2;
}

.starship-command-column-resizer::after {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    border-radius: 0;
    background: rgba(79, 195, 247, 0.25);
    transition: background 0.2s ease;
}

.starship-command-column-resizer:hover::after,
.starship-command-column-resizer.is-active::after {
    background: rgba(79, 195, 247, 0.65);
}

.starship-command-row {
    background: rgba(8, 22, 48, 0.78);
    transition: background 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.starship-command-row:hover {
    background: rgba(14, 36, 66, 0.82);
}

.starship-command-row:focus-within {
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.3);
}

.starship-command-row--selected {
    background: rgba(18, 52, 88, 0.9);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.35);
}

.starship-command-table-body .starship-command-row:nth-child(odd):not(.starship-command-row--selected) {
    background: rgba(8, 22, 48, 0.78);
}

.starship-command-table-body .starship-command-row:nth-child(even):not(.starship-command-row--selected) {
    background: rgba(10, 28, 54, 0.82);
}

.starship-command-table-body [data-starship-command-sorted] {
    background: rgba(79, 195, 247, 0.08);
    transition: background 0.2s ease;
}

.starship-command-table-body .starship-command-row:hover [data-starship-command-sorted] {
    background: rgba(79, 195, 247, 0.12);
}

.starship-command-table-body .starship-command-row--selected [data-starship-command-sorted] {
    background: rgba(79, 195, 247, 0.18);
}

.starship-command-cell {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.18);
    vertical-align: middle;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.8125rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #e6f7ff;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.starship-command-cell--primary {
    min-width: 200px;
}

.starship-command-cell--status {
    text-align: center;
}

.starship-command-cell--status > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell--actions {
    text-align: right;
    overflow: visible;
    padding-right: 10px;
}

.starship-command-value {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-value--name {
    font-size: inherit;
    font-weight: 400;
    letter-spacing: inherit;
    text-transform: inherit;
    color: #f6fbff;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.24);
}

.starship-command-cell-primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.starship-command-cell-title {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #f6fbff;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.24);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell-sub {
    font-size: 0.5rem;
    color: rgba(167, 222, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.starship-command-cell-primary > span,
.starship-command-cell-text > span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell-route {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.starship-command-cell-route .planet-command-waypoint-row {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    min-width: 0;
}

.starship-command-cell-stat-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(173, 225, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-cell-stat-value {
    font-size: 0.625rem;
    font-weight: 600;
    color: #9bd8ff;
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.25);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starship-command-row-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.starship-command-action-button {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(215, 236, 255, 0.95);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.18s ease, transform 0.18s ease, text-shadow 0.18s ease;
}

.starship-command-action-button:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.starship-command-action-button:focus-visible {
    outline: none;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(79, 195, 247, 0.65);
    transform: translateY(-1px);
}

.starship-command-action-button:active {
    transform: translateY(0);
    text-shadow: 0 0 6px rgba(79, 195, 247, 0.4);
}

.starship-command-action-icon {
    font-size: 0.8125rem;
    line-height: 1;
}

.starship-command-table-empty {
    margin: 0;
    padding: 12px;
    border-radius: 0;
    border: 1px dashed rgba(79, 195, 247, 0.45);
    background: rgba(12, 32, 58, 0.78);
    color: rgba(210, 234, 255, 0.9);
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.starship-command-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.starship-command-summary-item {
    background: rgba(8, 22, 44, 0.88);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-summary-item dt {
    margin: 0;
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(173, 223, 255, 0.78);
}

.starship-command-summary-item dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #9bd8ff;
    text-shadow: 0 0 8px rgba(79, 195, 247, 0.25);
}

.starship-command-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.625rem;
    color: rgba(192, 226, 255, 0.92);
}

.starship-command-filter-label {
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.starship-command-filter-input,
.starship-command-filter-select {
    border-radius: 0;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    padding: 6px 8px;
    font-size: 0.6875rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.starship-command-filter-input::placeholder {
    color: rgba(200, 232, 255, 0.55);
}

.starship-command-filter-input:focus,
.starship-command-filter-select:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}


.starship-command-window--compact .planet-command-button {
    padding: 4px 8px;
    font-size: 0.625rem;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.starship-command-window--compact .planet-command-button.secondary {
    background: rgba(10, 22, 48, 0.85);
    border-color: rgba(100, 164, 255, 0.4);
    color: rgba(210, 224, 255, 0.85);
}

.starship-command-window--compact .planet-command-button.secondary:hover,
.starship-command-window--compact .planet-command-button.secondary:focus-visible {
    background: rgba(24, 46, 88, 0.9);
    color: #f0f6ff;
}

.starship-command-window--compact .planet-command-badge {
    font-size: 0.5625rem;
    padding: 2px 6px;
    border-radius: 0;
}

.starship-command-window--compact .planet-command-waypoint-row {
    font-size: 0.5625rem;
    padding: 0;
}

.starship-command-window--compact .planet-command-waypoint-label,
.starship-command-window--compact .planet-command-waypoint-value {
    font-size: 0.5625rem;
}

@media (max-width: 900px) {
    .planet-command-window {
        width: min(860px, 94vw);
    }

    .planet-command-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .planet-command-filters {
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .planet-command-window {
        width: min(720px, 94vw);
    }

    .planet-command-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .planet-command-close {
        align-self: flex-end;
    }

    .planet-command-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .planet-command-filter-group {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .planet-command-body {
        padding: 18px;
    }

    .planet-command-summary-grid {
        grid-template-columns: 1fr;
    }

    .planet-command-table th,
    .planet-command-table td {
        padding: 12px;
    }
}

@keyframes fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeout {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes toastTicker {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateX(-110%);
        opacity: 1;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.messages-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 240;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.messages-overlay.open {
    pointer-events: auto;
}

.messages-overlay[hidden] {
    display: none;
}

.messages-window {
    width: min(480px, 90vw);
    min-width: min(360px, 90vw);
    max-height: min(80vh, 640px);
    overflow: hidden;
    pointer-events: auto;
}

.messages-header {
    cursor: default;
    user-select: auto;
    touch-action: auto;
}

.messages-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow: hidden;
    /* Clean Outlook-style background - minimal, light appearance */
    background: transparent;
}

.messages-tabs {
    padding: 10px 18px 0;
    gap: 10px;
}

.messages-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 18px 18px;
}

.messages-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages-panel[hidden] {
    display: none;
}

.messages-inbox {
    display: grid;
    grid-template-columns: 0.46fr 0.54fr;
    gap: 16px;
    min-height: 360px;
}

.messages-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 10px;
    overflow-y: auto;
    max-height: 420px;
}

.messages-inbox-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(79, 195, 247, 0.12);
    border-radius: 8px;
    background: transparent;
    padding: 10px 12px;
    text-align: left;
    color: #f0f6ff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.messages-inbox-row:hover,
.messages-inbox-row:focus-visible {
    outline: none;
    border-color: rgba(123, 215, 255, 0.5);
    background: rgba(79, 195, 247, 0.08);
}

.messages-inbox-row.active {
    border-color: rgba(79, 195, 247, 0.6);
    background: rgba(79, 195, 247, 0.12);
}

.messages-inbox-row--unread {
    border-color: rgba(255, 204, 102, 0.65);
    box-shadow: 0 0 12px rgba(255, 204, 102, 0.18);
}

.messages-inbox-row-subject {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.messages-inbox-row-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: rgba(185, 218, 255, 0.78);
    font-size: 0.6875rem;
}

.messages-inbox-row-preview {
    margin: 0;
    color: rgba(220, 236, 255, 0.78);
    font-size: 0.75rem;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.messages-inbox-detail {
    border: 1px solid rgba(79, 195, 247, 0.15);
    border-radius: 10px;
    padding: 16px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 360px;
}

.messages-inbox-empty {
    margin: 0;
    color: rgba(193, 220, 255, 0.68);
    font-style: italic;
    text-align: center;
}

.messages-inbox-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messages-inbox-card-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.messages-inbox-subject {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f0f6ff;
    letter-spacing: 0.4px;
}

.messages-inbox-timestamp {
    font-size: 0.75rem;
    color: rgba(185, 218, 255, 0.7);
}

.messages-inbox-from {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.4px;
    color: rgba(193, 230, 255, 0.82);
}

.messages-inbox-body {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    background: rgba(79, 195, 247, 0.05);
    color: #f4fbff;
    line-height: 1.5;
    white-space: pre-line;
}

.messages-inbox-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

#messagesInboxReplyButton {
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 6px;
    background: rgba(79, 195, 247, 0.1);
    color: #f4fbff;
    padding: 8px 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

#messagesInboxReplyButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#messagesInboxReplyButton:not(:disabled):hover,
#messagesInboxReplyButton:not(:disabled):focus-visible {
    outline: none;
    background: rgba(79, 195, 247, 0.2);
}

@media (max-width: 820px) {
    .messages-inbox {
        grid-template-columns: 1fr;
    }

    .messages-inbox-list {
        max-height: none;
    }
}

.player-profile-overlay {
    background: rgba(4, 10, 24, 0.65);
    backdrop-filter: none;
}

.player-profile-window {
    width: min(900px, 95vw);
    min-width: 520px;
    max-width: min(95vw, 1200px);
    max-height: min(90vh, 820px);
    min-height: 280px;
}

@media (max-width: 720px) {
    .player-profile-window {
        min-width: 0;
        width: min(520px, 95vw);
    }
}

.player-profile-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px 16px 18px;
    background: rgba(6, 18, 38, 0.9);
}

.player-profile-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 18px;
    background: rgba(10, 28, 54, 0.78);
    border: 1px solid rgba(79, 195, 247, 0.28);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.player-profile-section-title {
    margin: 0;
    font-size: 0.625rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(159, 219, 255, 0.75);
}

.player-profile-summary {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed rgba(79, 195, 247, 0.38);
    background: rgba(12, 32, 58, 0.78);
    color: rgba(231, 244, 255, 0.95);
    font-size: 0.75rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.player-profile-summary strong {
    color: #9bd8ff;
    font-weight: 600;
}

.player-profile-metadata {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 16px;
}

.player-profile-metadata-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-profile-metadata-label {
    margin: 0;
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(198, 218, 255, 0.9);
}

.player-profile-metadata-value {
    margin: 0;
    font-family: "Fira Mono", "Menlo", "Consolas", "Droid Sans Mono", monospace;
    letter-spacing: 0.6px;
    color: rgba(226, 247, 255, 0.95);
}

.player-profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(8, 22, 44, 0.8);
    border: 1px solid rgba(79, 195, 247, 0.24);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.1);
}

.player-profile-label {
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(198, 218, 255, 0.9);
}

.player-profile-controls {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

#playerDisplayName {
    flex: 1 1 auto;
    padding: 6px 8px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    font-family: inherit;
    font-size: 0.6875rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#playerDisplayName::placeholder {
    color: rgba(200, 232, 255, 0.55);
}

#playerDisplayName:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.player-profile-submit {
    appearance: none;
    border: 1px solid rgba(79, 195, 247, 0.45);
    border-radius: 2px;
    background: linear-gradient(135deg, rgba(16, 48, 84, 0.85), rgba(32, 96, 148, 0.85));
    color: #f0f8ff;
    padding: 8px 18px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.player-profile-submit:hover,
.player-profile-submit:focus-visible {
    outline: none;
    background: linear-gradient(135deg, rgba(24, 72, 122, 0.9), rgba(56, 132, 198, 0.9));
    box-shadow: 0 10px 24px rgba(12, 38, 72, 0.55), 0 0 0 3px rgba(79, 195, 247, 0.3);
    transform: translateY(-1px);
}

.player-profile-submit:disabled,
.player-profile-submit:disabled:hover,
.player-profile-submit:disabled:focus-visible {
    background: linear-gradient(135deg, rgba(16, 48, 84, 0.55), rgba(32, 96, 148, 0.55));
    border-color: rgba(79, 195, 247, 0.22);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.player-profile-status {
    margin: 0;
    min-height: 16px;
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(203, 235, 255, 0.75);
}

.player-profile-status.messages-status--error {
    color: #ff94b0;
}

.player-profile-status.messages-status--success {
    color: #8ef0b4;
}

.player-profile-hint {
    margin: 0;
    padding: 0 4px 4px;
    font-size: 0.625rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(155, 216, 255, 0.66);
}

.leaderboard-overlay {
    background: rgba(4, 10, 24, 0.65);
    backdrop-filter: none;
}

.leaderboard-window {
    width: min(900px, 95vw);
    min-width: 520px;
    max-width: min(95vw, 1200px);
    max-height: min(90vh, 820px);
    min-height: 280px;
    overflow: auto;
}

@media (max-width: 720px) {
    .leaderboard-window {
        min-width: 0;
        width: min(520px, 95vw);
    }
}

.leaderboard-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px 22px;
    background: rgba(6, 18, 38, 0.92);
}

.leaderboard-description {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    letter-spacing: 0.6px;
    color: rgba(203, 235, 255, 0.82);
}

.leaderboard-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.leaderboard-updated {
    margin: 0;
    font-size: 0.6875rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(155, 216, 255, 0.78);
}

.leaderboard-status {
    margin: 0;
    min-height: 16px;
    font-size: 0.6875rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(203, 235, 255, 0.75);
}

.leaderboard-table-wrapper {
    position: relative;
    border: 1px solid rgba(79, 195, 247, 0.28);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    background: rgba(10, 28, 54, 0.78);
}

.leaderboard-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.8125rem;
    letter-spacing: 0.4px;
    color: rgba(231, 244, 255, 0.94);
}

.leaderboard-table thead th {
    position: sticky;
    top: 0;
    background: rgba(14, 32, 60, 0.95);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.6875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(159, 219, 255, 0.8);
    border-bottom: 1px solid rgba(79, 195, 247, 0.28);
    z-index: 1;
}

.leaderboard-table tbody th,
.leaderboard-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.12);
    font-variant-numeric: tabular-nums;
}

.leaderboard-table tbody th {
    font-weight: 600;
    color: #9bd8ff;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.9px;
    text-align: left;
}

.leaderboard-table tbody td {
    color: rgba(231, 244, 255, 0.92);
}

.leaderboard-table tbody td.numeric {
    text-align: right;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: rgba(8, 22, 42, 0.55);
}

.leaderboard-table tbody tr:hover {
    background: rgba(32, 82, 132, 0.32);
}

.leaderboard-empty {
    margin: 0;
    padding: 18px 14px;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    color: rgba(185, 226, 255, 0.8);
}

.messages-recipient-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
}

.messages-recipient-row label {
    font-size: 0.8125rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(198, 218, 255, 0.9);
}

.messages-recipient-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

#messagesRecipient {
    flex: 1;
    background: rgba(79, 195, 247, 0.05);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 10px;
    padding: 6px 12px;
    color: #e8f4ff;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

#messagesRecipient:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.25);
}

#messagesRefreshButton {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: rgba(79, 195, 247, 0.08);
    color: rgba(236, 248, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

#messagesRefreshButton:hover {
    background: rgba(79, 195, 247, 0.15);
    color: #ffffff;
}

.messages-history {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    background: transparent;
}

.messages-history::-webkit-scrollbar {
    width: 10px;
}

.messages-history::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.25);
    border-radius: 999px;
}

.messages-history::-webkit-scrollbar-track {
    background: transparent;
}

.messages-empty {
    text-align: center;
    color: rgba(200, 220, 255, 0.72);
    font-style: italic;
    padding: 24px 0;
}

.messages-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.messages-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.75rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(198, 218, 255, 0.75);
}

.messages-author {
    font-weight: 600;
    color: rgba(224, 238, 255, 0.92);
}

.messages-timestamp {
    font-size: 0.6875rem;
    color: rgba(174, 201, 243, 0.68);
}

.messages-content {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(79, 195, 247, 0.08);
    color: #f4fbff;
    line-height: 1.45;
    font-size: 0.875rem;
    word-break: break-word;
    white-space: pre-wrap;
}

.messages-item--incoming .messages-content {
    background: rgba(79, 195, 247, 0.12);
    border-color: rgba(79, 195, 247, 0.3);
    align-self: flex-start;
}

.messages-item--outgoing .messages-content {
    background: rgba(88, 214, 141, 0.12);
    border-color: rgba(129, 199, 132, 0.35);
    align-self: flex-end;
}

.messages-item--other .messages-content {
    background: rgba(153, 102, 255, 0.1);
    border-color: rgba(186, 134, 255, 0.32);
    align-self: center;
}

.messages-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(79, 195, 247, 0.15);
    background: transparent;
}

#messagesInput {
    min-height: 68px;
    max-height: 200px;
    resize: vertical;
    padding: 6px 8px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    background: rgba(8, 20, 42, 0.92);
    color: #eef9ff;
    font-family: inherit;
    font-size: 0.6875rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#messagesInput::placeholder {
    color: rgba(200, 232, 255, 0.55);
}

#messagesInput:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.messages-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.messages-status {
    font-size: 0.75rem;
    letter-spacing: 0.9px;
    color: rgba(200, 220, 255, 0.72);
    min-height: 1em;
}

.messages-status--error {
    color: #ff8a80;
}

.messages-status--success {
    color: #8ae6a2;
}

#messagesSendButton {
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.52);
    background: rgba(79, 195, 247, 0.28);
    color: #ffffff;
    padding: 8px 20px;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#messagesSendButton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#messagesSendButton:not(:disabled):hover {
    background: rgba(79, 195, 247, 0.45);
    transform: translateY(-1px);
}

.command-context-menu[hidden] {
    display: none;
}

.command-context-menu {
    position: fixed;
    z-index: 1200;
    min-width: 180px;
    max-width: 240px;
    padding: 6px 0;
    background: rgba(12, 24, 36, 0.94);
    border: 1px solid rgba(64, 196, 255, 0.4);
    border-radius: 0;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-inline: 0;
    color: #e6f7ff;
    transform-origin: top left;
}

.command-context-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: inherit;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.8125rem;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: left;
}

.command-context-menu__item:hover,
.command-context-menu__item:focus {
    background: rgba(64, 196, 255, 0.2);
    color: #ffffff;
    outline: none;
}

.command-context-menu__item-icon {
    margin-right: 12px;
    font-size: 0.875rem;
}

.command-context-menu__item--has-submenu {
    position: relative;
}

.command-context-menu__item-arrow {
    margin-left: auto;
    padding-left: 12px;
    font-size: 0.625rem;
    opacity: 0.7;
}

.command-context-menu__item--submenu-open {
    background: rgba(64, 196, 255, 0.25);
    color: #ffffff;
}

.command-context-menu--submenu {
    position: fixed;
    z-index: 1201;
    min-width: 180px;
    max-width: 240px;
    padding: 6px 0;
    background: rgba(12, 24, 36, 0.94);
    border: 1px solid rgba(64, 196, 255, 0.4);
    border-radius: 0;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-inline: 0;
    color: #e6f7ff;
    transform-origin: top left;
}

@media (max-width: 768px) {
    :root {
        --icon-panel-width: 0px;
        --mobile-icon-panel-height: 0px;
        --galaxy-map-header-offset: 52px;
    }

    .galaxy-map-header {
        top: 12px;
        left: 12px;
    }

    .galaxy-map-title {
        font-size: clamp(1.5rem, 1.2rem + 3vw, 2.125rem);
        letter-spacing: 0.22rem;
    }

    .universe-search-wrapper {
        top: 12px;
        right: 12px;
        width: clamp(calc(120px * var(--mini-map-scale, 1)), calc(28vw * var(--mini-map-scale, 1)), calc(180px * var(--mini-map-scale, 1)));
    }

    .universe-search-input {
        font-size: 13px;
        padding: 8px 32px 8px 32px;
    }

    .universe-search-results {
        max-height: 300px;
    }

    #iconPanel {
        top: calc(12px + var(--app-logo-offset) + var(--galaxy-map-header-offset));
        bottom: auto;
        left: 12px;
        width: auto;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0;
        box-shadow: none;
        overflow: visible;
    }

    .icon-panel-group,
    .icon-panel-group + .icon-panel-group {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 10px;
        padding: 0;
        border: none;
    }

    .icon-panel-group-title,
    .icon-panel-button-text,
    .icon-panel-footer {
        display: none;
    }

    .icon-panel-button {
        width: 36px;
        height: 36px;
        border-radius: 0;
    }

    .icon-panel-button-icon {
        width: 20px;
        height: 20px;
        font-size: 0.875rem;
    }

    .icon-panel-button[data-tooltip]::before {
        left: calc(100% + 8px);
        font-size: 0.6875rem;
        padding: 5px 8px;
    }

    .icon-panel-button[data-tooltip]::after {
        left: calc(100% + 1px);
    }

    #container {
        margin-left: 0;
        width: 100vw;
    }

    #destinationPrompt {
        width: calc(100vw - 32px);
        left: 50%;
    }

    .display-options-panel {
        top: var(--app-bar-height);
        left: 0;
        width: 100%;
        height: calc(100% - var(--app-bar-height));
        border-radius: 0;
        transform: translateY(100%);
    }

    .display-options-panel.open {
        transform: translateY(0);
    }

    #togglePanel {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: min(60vh, calc(100vh - var(--app-bar-height) - 24px));
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
        transition: none;
        transform: translateY(calc(100% + 24px));
        pointer-events: none;
        opacity: 0;
    }

    body.ui-animations-ready #togglePanel {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    #togglePanel.open {
        right: 12px;
        left: 12px;
        transform: translateY(0);
        pointer-events: auto;
        opacity: 1;
    }

    #togglePanelButton {
        top: auto;
        bottom: 16px;
        right: 16px;
    }

    body.toggle-panel-open #togglePanelButton {
        right: 16px;
    }

    #metricsContainer {
        left: 10px;
        right: 10px;
    }
}


.starship-command-panel-description {
    margin: 0;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(8, 22, 44, 0.85), rgba(4, 12, 28, 0.92));
    border: 1px solid rgba(79, 195, 247, 0.22);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.08), 0 10px 26px rgba(5, 18, 36, 0.5);
    font-size: 0.625rem;
    letter-spacing: 0.85px;
    text-transform: uppercase;
    color: rgba(163, 222, 255, 0.8);
}

.starship-command-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

@media (max-width: 960px) {
    .starship-command-panel-grid {
        grid-template-columns: 1fr;
    }
}

.starship-command-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: linear-gradient(145deg, rgba(8, 22, 44, 0.9), rgba(3, 12, 24, 0.94));
    box-shadow: 0 18px 42px rgba(5, 18, 36, 0.55), inset 0 0 0 1px rgba(79, 195, 247, 0.1);
}

.starship-command-card-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.starship-command-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.starship-command-toggle-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.starship-command-slider-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#displayOptionsPanelShips .toggle-switch {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: linear-gradient(135deg, rgba(6, 18, 38, 0.82), rgba(3, 10, 22, 0.9));
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.08);
}

#displayOptionsPanelShips .toggle-switch:hover {
    background: linear-gradient(135deg, rgba(12, 36, 66, 0.9), rgba(5, 14, 30, 0.95));
    box-shadow: 0 12px 24px rgba(5, 18, 36, 0.5);
}

#displayOptionsPanelShips .toggle-switch-text {
    font-size: 0.8125rem;
    letter-spacing: 0.45px;
    color: rgba(219, 241, 255, 0.9);
}

#displayOptionsPanelShips .toggle-switch-control {
    background: rgba(79, 195, 247, 0.25);
    color: rgba(236, 248, 255, 0.95);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.35);
}

#displayOptionsPanelShips .toggle-switch-control::before {
    background: rgba(6, 18, 36, 0.95);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.4);
}

#displayOptionsPanelShips .toggle-switch-input:checked + .toggle-switch-control {
    background: rgba(79, 195, 247, 0.58);
    color: #04121f;
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.4), inset 0 0 0 1px rgba(79, 195, 247, 0.45);
}

#displayOptionsPanelShips .toggle-switch-input:checked + .toggle-switch-control::before {
    box-shadow: inset 0 0 0 1px rgba(4, 18, 38, 0.85), 0 0 0 3px rgba(79, 195, 247, 0.35);
}

#displayOptionsPanelShips .toggle-switch-input:checked + .toggle-switch-control::after {
    color: rgba(4, 18, 36, 0.95);
}

#displayOptionsPanelShips .slider-option {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.16);
    background: linear-gradient(145deg, rgba(6, 18, 36, 0.85), rgba(3, 10, 22, 0.9));
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.08);
}

#displayOptionsPanelShips .slider-option:hover {
    background: linear-gradient(145deg, rgba(12, 32, 58, 0.92), rgba(5, 14, 28, 0.96));
    box-shadow: 0 10px 26px rgba(5, 18, 36, 0.5), inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

#displayOptionsPanelShips .slider-option-label {
    font-size: 0.75rem;
    letter-spacing: 0.95px;
    text-transform: uppercase;
    color: rgba(208, 236, 255, 0.92);
}

#displayOptionsPanelShips .slider-option-text {
    color: rgba(219, 241, 255, 0.92);
}

#displayOptionsPanelShips .slider-option-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 6px;
    background: rgba(79, 195, 247, 0.18);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.32);
    color: rgba(141, 215, 255, 0.95);
    font-weight: 600;
}

#displayOptionsPanelShips .slider-option-input {
    accent-color: #4fc3f7;
}

#displayOptionsPanelShips .slider-option-input:focus-visible {
    outline-color: rgba(79, 195, 247, 0.6);
}

/* Outliner panel */
.outliner-window {
    position: absolute;
    top: calc(80px + clamp(calc(80px * var(--mini-map-scale, 1)), calc(20vw * var(--mini-map-scale, 1)), calc(220px * var(--mini-map-scale, 1))) + 16px);
    right: 16px;
    width: clamp(calc(80px * var(--mini-map-scale, 1)), calc(20vw * var(--mini-map-scale, 1)), calc(220px * var(--mini-map-scale, 1)));
    left: auto;
}

@media (max-width: 960px) {
    .outliner-window {
        top: calc(72px + clamp(calc(80px * var(--mini-map-scale, 1)), calc(28vw * var(--mini-map-scale, 1)), calc(180px * var(--mini-map-scale, 1))) + 12px);
        right: 12px;
        width: clamp(calc(80px * var(--mini-map-scale, 1)), calc(28vw * var(--mini-map-scale, 1)), calc(180px * var(--mini-map-scale, 1)));
    }
}

@media (max-width: 720px) {
    .outliner-window {
        top: calc(72px + var(--app-logo-offset) + calc(80px * var(--mini-map-scale, 1)) + 12px);
        right: 12px;
        width: calc(80px * var(--mini-map-scale, 1));
    }
}

.outliner-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    background: radial-gradient(circle at top, rgba(10, 26, 48, 0.95), rgba(2, 8, 18, 0.92));
}

.outliner-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.outliner-search {
    flex: 1 1 auto;
    min-width: 0;
}

.outliner-search input {
    width: 100%;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(3, 10, 20, 0.85);
    color: #e6f6ff;
    font-size: 0.7rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.08);
}

.outliner-search input:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: 2px;
}

.outliner-sort {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(207, 236, 255, 0.88);
}

.outliner-sort select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.28);
    background: rgba(4, 12, 26, 0.9);
    color: #e6f6ff;
    font-size: 0.65rem;
}

.outliner-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.outliner-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(9, 20, 40, 0.8);
    cursor: pointer;
    user-select: none;
    font-size: 0.625rem;
    letter-spacing: 0.2px;
    color: rgba(214, 238, 255, 0.92);
}

.outliner-filter-chip input {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(79, 195, 247, 0.5);
    background: rgba(8, 18, 38, 0.9);
    position: relative;
}

.outliner-filter-chip input:checked {
    background: rgba(79, 195, 247, 0.9);
}

.outliner-filter-chip input:checked::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #04121f;
}

.outliner-filter-icon {
    font-size: 0.65rem;
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(79, 195, 247, 0.18);
    color: #9bd8ff;
}

.outliner-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.outliner-pin-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(79, 195, 247, 0.32);
    background: rgba(8, 20, 40, 0.85);
    color: rgba(214, 238, 255, 0.92);
    font-size: 0.6rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
}

.outliner-pin-filter.is-active,
.outliner-pin-filter[aria-pressed="true"] {
    background: rgba(79, 195, 247, 0.25);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.5);
}

.outliner-hint {
    margin: 0;
    font-size: 0.6rem;
    line-height: 1.3;
    color: rgba(191, 220, 240, 0.85);
}

.outliner-status {
    min-height: 18px;
    font-size: 0.65rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(155, 216, 255, 0.95);
}

.outliner-status.is-visible {
    color: #ffffff;
}

.outliner-empty {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px dashed rgba(79, 195, 247, 0.4);
    color: rgba(199, 225, 243, 0.9);
    background: rgba(6, 12, 24, 0.85);
}

.outliner-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Outliner Table Styles */
.outliner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: rgba(4, 10, 22, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.outliner-table thead {
    background: linear-gradient(140deg, rgba(79, 195, 247, 0.15), rgba(79, 195, 247, 0.08));
    border-bottom: 2px solid rgba(79, 195, 247, 0.3);
}

.outliner-table th {
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: #9bd8ff;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.outliner-table-header-pin {
    padding: 8px 6px !important;
    text-align: center;
}

.outliner-table-row {
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.outliner-table-row:hover {
    background: rgba(79, 195, 247, 0.08);
}

.outliner-table-row:focus {
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: -2px;
}

.outliner-table-row--pinned {
    background: rgba(79, 195, 247, 0.12);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.4);
}

.outliner-table td {
    padding: 4px 8px;
    vertical-align: top;
    color: rgba(214, 238, 255, 0.92);
    line-height: 1.3;
    font-size: 0.65rem;
}

.outliner-table-cell-pin {
    padding: 4px 4px !important;
    text-align: center;
    color: #4fc3f7;
}

.outliner-table-cell-category {
    font-weight: 500;
    color: rgba(191, 220, 240, 0.9);
}

.outliner-table-cell-category i {
    margin-right: 6px;
    color: #9bd8ff;
    width: 16px;
    text-align: center;
}

.outliner-table-cell-category--grouped {
    vertical-align: middle;
    border-right: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(79, 195, 247, 0.06);
}

.outliner-table-category-row {
    background: linear-gradient(140deg, rgba(79, 195, 247, 0.15), rgba(79, 195, 247, 0.08));
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.outliner-table-category-row:hover {
    background: linear-gradient(140deg, rgba(79, 195, 247, 0.22), rgba(79, 195, 247, 0.12));
}

.outliner-table-category-cell {
    padding: 6px 8px !important;
}

.outliner-table-category-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #9bd8ff;
    font-family: 'TheGoodMonolith', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-align: left;
}

.outliner-table-category-toggle:hover {
    color: #4fc3f7;
}

.outliner-table-category-toggle i:first-child {
    width: 10px;
    text-align: center;
    font-size: 0.6rem;
}

.outliner-table-category-toggle i:nth-child(2) {
    width: 14px;
    text-align: center;
}

.outliner-table-cell-name {
    font-weight: 400;
    color: #ffffff;
}

.outliner-table-cell-name > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.outliner-table-cell-name i {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    background: rgba(79, 195, 247, 0.18);
    color: #9bd8ff;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.outliner-table-cell-location {
    color: rgba(191, 220, 240, 0.85);
    font-size: 0.6rem;
}

.outliner-table-cell-details {
    font-size: 0.6875rem;
    max-width: 280px;
}

.outliner-table-alert {
    color: #ffb347;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.outliner-table-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.outliner-table-tag {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    font-size: 0.625rem;
    color: rgba(199, 225, 243, 0.9);
    white-space: nowrap;
}

.outliner-table-progress {
    margin-top: 6px;
    height: 4px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.15);
    overflow: hidden;
    position: relative;
}

.outliner-table-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #7dfdd3);
    transition: width 0.3s ease;
}

.outliner-table-cell-status {
    text-align: center;
}

.outliner-table-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.outliner-table-status--positive {
    background: rgba(125, 253, 211, 0.2);
    color: #7dfdd3;
    border: 1px solid rgba(125, 253, 211, 0.4);
}

.outliner-table-status--info {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    border: 1px solid rgba(79, 195, 247, 0.4);
}

.outliner-table-status--warning {
    background: rgba(255, 179, 71, 0.2);
    color: #ffb347;
    border: 1px solid rgba(255, 179, 71, 0.4);
}

.outliner-table-status--danger {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.4);
}

.outliner-table-status--neutral {
    background: rgba(191, 220, 240, 0.15);
    color: rgba(191, 220, 240, 0.9);
    border: 1px solid rgba(191, 220, 240, 0.3);
}

.outliner-table-eta {
    margin-top: 4px;
    font-size: 0.625rem;
    color: rgba(170, 214, 236, 0.75);
}

.outliner-section {
    border-radius: 8px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: linear-gradient(140deg, rgba(6, 18, 36, 0.95), rgba(2, 6, 16, 0.92));
    box-shadow: 0 12px 28px rgba(5, 18, 36, 0.55);
    padding: 8px;
}

.outliner-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.outliner-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #f0fbff;
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: 600;
    cursor: pointer;
}

.outliner-section-toggle:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: 2px;
}

.outliner-section-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(79, 195, 247, 0.2);
    color: #9bd8ff;
    font-size: 0.7rem;
}

.outliner-section-count {
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(170, 214, 236, 0.85);
}

.outliner-section-body {
    margin-top: 6px;
}

.outliner-section-description {
    margin: 0 0 6px;
    color: rgba(191, 220, 240, 0.9);
    font-size: 0.6875rem;
    line-height: 1.3;
}

.outliner-section-empty {
    margin: 0;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px dashed rgba(79, 195, 247, 0.35);
    color: rgba(191, 220, 240, 0.85);
    background: rgba(4, 12, 26, 0.8);
    font-size: 0.6875rem;
    line-height: 1.3;
}

.outliner-entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.outliner-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(4, 10, 22, 0.9);
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
}

.outliner-entry--pinned {
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.5), 0 10px 26px rgba(4, 12, 24, 0.65);
}

.outliner-entry-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.outliner-entry-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 195, 247, 0.18);
    color: #9bd8ff;
    font-size: 0.75rem;
}

.outliner-entry-name {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: #ffffff;
}

.outliner-entry-location {
    margin: 2px 0 0;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(191, 220, 240, 0.85);
}

.outliner-entry-detail {
    margin: 2px 0 0;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(214, 238, 255, 0.92);
}

.outliner-entry-alert {
    margin: 2px 0 0;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: #ffb347;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.outliner-tag-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.outliner-tag-list li {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(199, 225, 243, 0.9);
}

.outliner-progress {
    margin-top: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.15);
    overflow: hidden;
    position: relative;
}

.outliner-progress[role="progressbar"]::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.05);
}

.outliner-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #7dfdd3);
    width: var(--outliner-progress, 0%);
}

.outliner-entry-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.outliner-entry-status {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.outliner-status-chip {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6875rem;
    line-height: 1.2;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid rgba(79, 195, 247, 0.35);
    color: rgba(214, 238, 255, 0.95);
    background: rgba(6, 18, 36, 0.9);
}

.outliner-status-chip--positive {
    border-color: rgba(123, 237, 159, 0.4);
    color: #7dfdd3;
}

.outliner-status-chip--warning {
    border-color: rgba(255, 196, 112, 0.55);
    color: #ffcc80;
}

.outliner-status-chip--danger {
    border-color: rgba(255, 132, 132, 0.6);
    color: #ff9f9f;
}

.outliner-entry-eta {
    font-size: 0.6875rem;
    line-height: 1.2;
    color: rgba(191, 220, 240, 0.85);
}

.outliner-entry-priority {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6875rem;
    line-height: 1.2;
    background: rgba(79, 195, 247, 0.2);
    color: rgba(214, 238, 255, 0.95);
}

.outliner-entry-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.outliner-entry-action {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(4, 12, 26, 0.9);
    color: rgba(214, 238, 255, 0.95);
    font-size: 0.6875rem;
    line-height: 1.2;
    cursor: pointer;
}

.outliner-entry-action--primary {
    background: linear-gradient(90deg, rgba(79, 195, 247, 0.85), rgba(125, 253, 211, 0.85));
    color: #031021;
    border-color: rgba(79, 195, 247, 0.65);
}

.outliner-entry-action:focus-visible,
.outliner-pin-button:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: 2px;
}

.outliner-pin-button {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    background: rgba(4, 10, 22, 0.95);
    color: rgba(214, 238, 255, 0.95);
    font-size: 0.75rem;
    cursor: pointer;
}

.outliner-pin-button[aria-pressed="true"] {
    background: rgba(79, 195, 247, 0.25);
    color: #ffffff;
    border-color: rgba(79, 195, 247, 0.6);
}

@media (max-width: 720px) {
    .outliner-body {
        padding: 16px;
    }

    .outliner-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .outliner-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .outliner-entry-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Trading Panel Styles */
.trading-panel {
    width: min(620px, 90vw);
    max-width: 720px;
    max-height: 80vh;
    overflow: hidden;
    pointer-events: auto;
}

.trading-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trading-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.trading-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trading-tab:hover {
    background: rgba(79, 195, 247, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.trading-tab.active {
    color: rgb(79, 195, 247);
    border-bottom: 2px solid rgb(79, 195, 247);
}

.trading-panels {
    padding: 12px;
}

.trading-panel-section {
    display: block;
}

.trade-resource-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trade-resource-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-resource-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.trade-resource-input {
    width: 120px;
    padding: 6px 8px;
    background: rgba(8, 20, 42, 0.92);
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    color: #eef9ff;
    font-family: inherit;
    font-size: 0.6875rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.trade-resource-input:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.market-trade-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.market-trade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.market-trade-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 80px;
}

.market-trade-select,
.market-trade-input {
    flex: 1;
    padding: 6px 8px;
    background: rgba(8, 20, 42, 0.92);
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 0;
    color: #eef9ff;
    font-family: inherit;
    font-size: 0.6875rem;
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-trade-select:focus,
.market-trade-input:focus {
    outline: none;
    border-color: rgba(79, 195, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.market-trade-result {
    padding: 12px;
    background: rgba(79, 195, 247, 0.1);
    border-left: 3px solid rgb(79, 195, 247);
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.market-trade-result span {
    color: rgb(79, 195, 247);
    font-size: 16px;
}

.trade-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    text-align: center;
}

.trade-status--success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: rgb(129, 199, 132);
}

.trade-status--error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: rgb(239, 154, 154);
}

.trade-offers-list {
    display: block;
    width: 100%;
}

.trade-offers-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Rajdhani', sans-serif;
    font-style: italic;
}

/* Trade Offers Table */
.trade-offers-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Rajdhani', sans-serif;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.trade-offers-table thead {
    background: rgba(79, 195, 247, 0.15);
    border-bottom: 2px solid rgba(79, 195, 247, 0.3);
}

.trade-offers-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgb(79, 195, 247);
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.trade-offers-table tbody tr {
    border-bottom: 1px solid rgba(79, 195, 247, 0.15);
    transition: background-color 0.2s;
}

.trade-offers-table tbody tr:last-child {
    border-bottom: none;
}

.trade-offers-table tbody tr:hover {
    background: rgba(79, 195, 247, 0.08);
}

.trade-offers-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
}

.trade-offer-row--own {
    background: rgba(255, 152, 0, 0.08);
}

.trade-offer-row--own:hover {
    background: rgba(255, 152, 0, 0.15);
}

.trade-offer-player-cell {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    color: rgb(79, 195, 247);
}

.trade-offer-you-badge {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: rgba(255, 152, 0, 0.9);
    background: rgba(255, 152, 0, 0.2);
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
}

.trade-offer-resources-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-offer-resource-item {
    display: block;
    padding: 2px 0;
    color: rgba(255, 255, 255, 0.85);
}

.trade-offer-resource-item strong {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

.trade-offer-resource-none {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.trade-offer-time-cell {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.trade-offer-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.trade-offer-button {
    padding: 6px 16px;
    border: 1px solid;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: transparent;
    margin-left: 4px;
}

.trade-offer-button:first-child {
    margin-left: 0;
}

.trade-offer-button--accept {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    color: rgb(129, 199, 132);
}

.trade-offer-button--accept:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgb(129, 199, 132);
}

.trade-offer-button--decline {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
    color: rgb(239, 154, 154);
}

.trade-offer-button--decline:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgb(239, 154, 154);
}

.trade-offer-button--cancel {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.5);
    color: rgb(255, 183, 77);
}

.trade-offer-button--cancel:hover {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgb(255, 183, 77);
}

.starship-command-button {
    width: 100%;
    padding: 12px 24px;
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.5);
    border-radius: 4px;
    color: rgb(79, 195, 247);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.starship-command-button:hover {
    background: rgba(79, 195, 247, 0.3);
    border-color: rgb(79, 195, 247);
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.3);
}

.starship-command-button:active {
    transform: translateY(1px);
}

.starship-command-card-description {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    font-style: italic;
}

/* Debug metrics styles */
.debug-performance-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.debug-performance-toggle-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.debug-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.debug-metrics-grid .debug-metric-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.debug-metrics-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.debug-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 10px;
}

.debug-metric-label {
    opacity: 0.92;
    letter-spacing: 0.5px;
    font-size: 0.6875rem;
}

.debug-metric-value {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #4af2c3;
}

.debug-metric-value--slow {
    color: #f2b84a;
}

.debug-metric-value--critical {
    color: #ff8b7a;
}

.debug-stage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.debug-stage-item {
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 12, 24, 0.6);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.debug-stage-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.debug-stage-description {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.debug-stage-metrics {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.debug-stage-metric {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debug-stage-metric-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.4px;
}

.debug-stage-metric-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4af2c3;
}

.debug-stage-breakdown {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.debug-stage-breakdown-header {
    font-size: 0.8rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.debug-stage-breakdown-table {
    display: grid;
    gap: 6px;
}

.debug-stage-breakdown-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.2fr) repeat(4, minmax(70px, 0.8fr));
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    align-items: center;
}

.debug-stage-breakdown-row--head {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-bottom: 6px;
}

.debug-stage-breakdown-row--head span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.debug-stage-breakdown-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.debug-stage-breakdown-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #7be9ff;
}


/* Resource Balance UI Enhancements */
.resource-depletion-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.resource-depletion-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5252 0%, #ffeb3b 50%, #4caf50 100%);
    transition: width 0.3s ease;
}

.resource-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
    text-transform: uppercase;
}

.resource-badge--power-shortage {
    background: rgba(255, 82, 82, 0.2);
    border: 1px solid rgba(255, 82, 82, 0.5);
    color: #ff5252;
}

.resource-badge--storage-full {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #ffc107;
}

.resource-badge--motherlode {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.6);
    color: #ffd700;
}

.resource-deposit-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 0.85em;
    opacity: 0.7;
}

.resource-deposit-remaining {
    color: #81c784;
}

.resource-deposit-total {
    color: #90caf9;
}

.resource-generation-meta {
    font-size: 0.75em;
    opacity: 0.6;
    margin-top: 2px;
}

.resource-debug-toggle {
    margin-top: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #90caf9;
    cursor: pointer;
    font-size: 0.85em;
}

.resource-debug-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.resource-debug-panel {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

.resource-debug-panel pre {
    margin: 0;
    color: #81c784;
}
