:root {
    --bg: #0a0c12;
    --bg-space: #060810;
    --surface: #1a1d27;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --accent: #6c9eff;
    --accent-hover: #8ab4ff;
    --danger: #ff6b6b;
    --color-sun: #f5c842;
    --radius: 8px;
    --font: system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    font-family: var(--font);
    background: var(--bg-space);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
}

#galaxy-map {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#galaxy-map.is-dragging {
    cursor: grabbing;
}

.overlay-ui {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.app-shell {
    position: fixed;
    inset: 0;
}

.app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    background: linear-gradient(to bottom, rgba(6, 8, 16, 0.85) 0%, rgba(6, 8, 16, 0.4) 70%, transparent 100%);
    pointer-events: none;
}

.app-header__left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
}

.app-header__title,
.btn-generate,
.btn-menu,
.credits-display {
    pointer-events: auto;
}

.app-header__actions {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.app-header__action {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(108, 158, 255, 0.35);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.72);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.app-header__action:hover,
.app-header__action:focus-visible,
.app-header__action[aria-expanded="true"] {
    border-color: rgba(108, 158, 255, 0.65);
    background: rgba(108, 158, 255, 0.18);
}

.btn-menu {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.55);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-menu:hover {
    border-color: rgba(108, 158, 255, 0.5);
}

.btn-menu__bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 1px;
    background: var(--text);
}

.app-header h1 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.status-line {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 0;
    font-size: 0.875rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.status {
    margin: 0;
    color: var(--muted);
}

.player-counts {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.status.is-connected {
    color: #6dd58c;
}

.status.is-error {
    color: var(--danger);
}

.credits-display {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    margin: 0;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 196, 87, 0.35);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.72);
    color: #ffd47a;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.credits-display__icon {
    font-size: 0.9rem;
    opacity: 0.9;
}

.credits-display__unit {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 212, 122, 0.75);
}

.btn-generate {
    display: none;
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #0f1117;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.btn-generate:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.map-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0 1.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.toast {
    position: fixed;
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid #2d3140;
    border-radius: var(--radius);
    font-size: 0.875rem;
    z-index: 100;
}

.detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 6, 12, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.detail-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: 50%;
    min-width: min(100%, 22rem);
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) 1rem;
    background:
        linear-gradient(165deg, rgba(32, 38, 54, 0.97) 0%, rgba(14, 17, 28, 0.98) 55%, rgba(8, 10, 18, 0.99) 100%);
    border-left: 1px solid rgba(108, 158, 255, 0.18);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.detail-panel.is-open {
    transform: translateX(0);
}

.detail-panel__overview {
    position: relative;
    padding: 1.25rem 2.75rem 1.25rem 1.25rem;
    border: 1px solid rgba(154, 160, 166, 0.2);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at top right, rgba(108, 158, 255, 0.12), transparent 55%),
        rgba(26, 29, 39, 0.9);
}

.detail-panel__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.detail-panel__close:hover {
    border-color: rgba(108, 158, 255, 0.5);
    color: var(--accent-hover);
}

.detail-panel__back {
    min-height: 2.5rem;
    margin: 0 0 1rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(108, 158, 255, 0.35);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.45);
    color: var(--accent-hover);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.detail-panel__back:hover,
.detail-panel__back:focus-visible {
    border-color: rgba(108, 158, 255, 0.65);
    color: var(--text);
}

.detail-panel__kind {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-panel__name {
    margin: 0 0 0.85rem;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 650;
    line-height: 1.2;
    text-wrap: balance;
}

.detail-panel__meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.detail-panel__meta dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.detail-panel__meta dd {
    margin: 0;
    font-size: 0.875rem;
}

.detail-panel__lager,
.detail-panel__bedarf,
.detail-panel__route,
.detail-panel__map-focus {
    margin-top: 1rem;
}

.detail-panel__map-focus-btn {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid rgba(86, 207, 225, 0.4);
    border-radius: var(--radius);
    background: rgba(86, 207, 225, 0.1);
    color: var(--accent-hover);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.detail-panel__map-focus-btn:hover {
    background: rgba(86, 207, 225, 0.2);
    color: var(--text);
}

.detail-panel__lager-title,
.detail-panel__bedarf-title {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted, #9aa0a6);
}

.detail-panel__lager-fill {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.detail-panel__lager-fill.is-full {
    color: var(--warning, #e6a23c);
}

.detail-panel__lager-list,
.detail-panel__bedarf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.detail-panel__lager-list li,
.detail-panel__bedarf-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.detail-panel__lager-empty,
.detail-panel__bedarf-empty {
    color: var(--muted, #9aa0a6);
    font-size: 0.85rem;
}

.detail-panel__lager-menge,
.detail-panel__bedarf-menge {
    color: var(--muted, #9aa0a6);
    white-space: nowrap;
}

.detail-panel__lager-meta,
.detail-panel__bedarf-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.detail-panel__lager-distanz,
.detail-panel__bedarf-distanz {
    color: var(--muted, #9aa0a6);
    font-size: 0.8125rem;
    white-space: nowrap;
}


.detail-panel__ressourcen {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(154, 160, 166, 0.18);
}

.detail-panel__ressourcen-title {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.detail-panel__ressourcen-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-panel__ressourcen-list li {
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(108, 158, 255, 0.22);
    border-radius: 4px;
    background: rgba(10, 12, 18, 0.45);
    color: var(--text);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.detail-panel__ressourcen-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.detail-panel__produkte {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(154, 160, 166, 0.18);
}

.detail-panel__produkte-title {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.detail-panel__produkte-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-panel__produkt {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detail-panel__produkt-toggle {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(109, 213, 140, 0.22);
    border-radius: 4px;
    background: rgba(10, 12, 18, 0.45);
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.detail-panel__produkt-toggle:hover {
    border-color: rgba(109, 213, 140, 0.45);
}

.detail-panel__produkt.is-open .detail-panel__produkt-toggle {
    border-color: rgba(109, 213, 140, 0.55);
    background: rgba(109, 213, 140, 0.08);
}

.detail-panel__produkte-list li.detail-panel__produkte-empty {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

.detail-panel__produkte-name {
    min-width: 0;
}

.detail-panel__produkte-bedarf {
    flex-shrink: 0;
    color: var(--muted);
    white-space: nowrap;
}

.detail-panel__produkte-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.detail-panel__zutaten {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    padding: 0.15rem 0 0.15rem 0.55rem;
    list-style: none;
    border-left: 2px solid rgba(109, 213, 140, 0.28);
}

.detail-panel__zutaten-head {
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.detail-panel__zutat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-panel__zutat-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.1rem 0.2rem;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.detail-panel__zutat-row:hover {
    background: rgba(109, 213, 140, 0.08);
}

.detail-panel__zutat.is-open .detail-panel__zutat-row {
    background: rgba(109, 213, 140, 0.12);
}

.detail-panel__zutaten-anteil {
    flex-shrink: 0;
    color: var(--muted);
    white-space: nowrap;
}

.detail-panel__zutat-planeten {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0;
    padding: 0 0 0 0.7rem;
    list-style: none;
}

.detail-panel__zutat-planeten li {
    color: var(--muted);
    font-size: 0.6875rem;
    line-height: 1.35;
}

.detail-panel__zutat-planeten-empty,
.detail-panel__zutat-planeten-more {
    font-style: italic;
}

.detail-panel__zutaten-empty {
    color: var(--muted);
    font-size: 0.75rem;
}

.detail-panel__body {
    flex: 1;
    min-height: 0;
    margin-top: 1rem;
}

.ships-panel {
    position: relative;
    padding: 1.25rem 2.75rem 1.25rem 1.25rem;
    border: 1px solid rgba(154, 160, 166, 0.2);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at top right, rgba(108, 158, 255, 0.12), transparent 55%),
        rgba(26, 29, 39, 0.9);
}

.ships-panel__status {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.ships-panel__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.ships-panel__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.ships-panel__title {
    margin-bottom: 0.5rem;
}

.ships-panel__buy-row {
    margin: 0 0 0.75rem;
}

.ships-panel__buy-btn {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

.ships-panel__list {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.ships-panel__item {
    padding: 0.8rem;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.45);
}

.ships-panel__item.is-selected {
    border-color: rgba(86, 207, 225, 0.55);
    background: rgba(86, 207, 225, 0.08);
}

.ships-panel__name {
    display: block;
    margin: 0 0 0.35rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.ships-panel__name:hover,
.ships-panel__name:focus-visible {
    color: var(--accent-hover);
}

.ships-panel__map-focus {
    margin: 0.55rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.ships-panel__map-focus:hover,
.ships-panel__map-focus:focus-visible {
    color: var(--text);
}

.ships-panel__meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.ships-panel__location {
    margin: 0.55rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-hover);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.ships-panel__location:hover,
.ships-panel__location:focus-visible {
    color: var(--text);
}

.ships-panel__frachtraum {
    margin: 0.55rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.ships-panel__wear {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

.ships-panel__wear.is-high {
    color: #e6b35a;
}

.ships-panel__wear.is-critical {
    color: var(--danger);
}

.ships-panel__stats {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.detail-panel__raumhafen {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(154, 160, 166, 0.2);
}

.detail-panel__raumhafen-title,
.raumhafen__subtitle {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.raumhafen__subtitle {
    margin-top: 0.85rem;
}

.detail-panel__raumhafen-ship {
    margin-bottom: 0.5rem;
}

.raumhafen__wear,
.raumhafen__stats,
.raumhafen__sell {
    margin: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.raumhafen__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.raumhafen__upgrade,
.raumhafen__catalog {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.raumhafen__btn {
    flex-shrink: 0;
    border: 1px solid rgba(108, 158, 255, 0.45);
    background: rgba(108, 158, 255, 0.12);
    color: var(--text);
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.raumhafen__btn:hover:not(:disabled) {
    background: rgba(108, 158, 255, 0.22);
}

.raumhafen__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.raumhafen__btn--danger {
    border-color: rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.12);
}

.raumhafen__muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.ships-panel__ladung {
    display: grid;
    gap: 0.35rem;
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
}

.ships-panel__los {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
}

.ships-panel__los-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.15rem 0.2rem;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.ships-panel__los-row:hover,
.ships-panel__los-row:focus-visible {
    background: rgba(108, 158, 255, 0.1);
}

.ships-panel__los.is-open .ships-panel__los-row {
    background: rgba(108, 158, 255, 0.16);
}

.ships-panel__bedarf-planeten {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
    padding: 0.15rem 0 0.2rem 0.7rem;
    list-style: none;
}

.ships-panel__bedarf-planeten li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.6875rem;
    line-height: 1.35;
}

.ships-panel__bedarf-ziel {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding: 0.2rem 0.35rem;
    border: 1px solid rgba(154, 160, 166, 0.16);
    border-radius: 3px;
    background: rgba(108, 158, 255, 0.05);
    color: inherit;
    font: inherit;
    font-size: inherit;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.ships-panel__bedarf-ziel:hover,
.ships-panel__bedarf-ziel:focus-visible {
    background: rgba(108, 158, 255, 0.12);
    border-color: rgba(108, 158, 255, 0.35);
}

.ships-panel__bedarf-ziel-label {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text);
}

.ships-panel__bedarf-ziel-metrics {
    flex: 0 0 auto;
    color: var(--accent-hover);
    white-space: nowrap;
}

.ships-panel__bedarf-empty {
    font-style: italic;
}

.ships-panel__menge,
.ships-panel__bedarf-distanz {
    color: var(--muted);
    white-space: nowrap;
}

.ships-panel__ladung-empty {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.ship-detail__body {
    margin-top: 0.75rem;
}

.ship-detail__body .ships-panel__map-focus {
    margin: 0.5rem 0;
}

@media (max-width: 720px) {
    .detail-panel {
        width: 100%;
        min-width: 0;
        border-left: none;
    }
}

@media (max-width: 480px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
    }

    .app-header__actions {
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 0.2rem;
    }

    .btn-generate {
        flex: 0 0 auto;
    }
}

/* Auth */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    background:
        radial-gradient(ellipse at 20% 10%, rgba(108, 158, 255, 0.14), transparent 45%),
        radial-gradient(ellipse at 80% 90%, rgba(245, 200, 66, 0.08), transparent 40%),
        linear-gradient(165deg, #0a0c14 0%, #060810 55%, #0b101c 100%);
}

.auth-screen[hidden] {
    display: none;
}

.auth-card {
    width: min(100%, 24rem);
    padding: 1.75rem 1.5rem;
    border: 1px solid rgba(108, 158, 255, 0.18);
    border-radius: calc(var(--radius) + 4px);
    background: rgba(18, 22, 34, 0.92);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth-card__brand {
    margin: 0 0 0.35rem;
    font-size: clamp(1.75rem, 5vw, 2.15rem);
    letter-spacing: 0.02em;
}

.auth-card__lead {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    border-radius: var(--radius);
    background: rgba(6, 8, 16, 0.65);
}

.auth-tabs__btn {
    min-height: 2.5rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.auth-tabs__btn.is-active {
    background: rgba(108, 158, 255, 0.2);
    color: var(--text);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-form[hidden] {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.auth-field input,
.auth-field textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(6, 8, 16, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.auth-field textarea {
    min-height: 6rem;
    resize: vertical;
}

.auth-field input:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: rgba(108, 158, 255, 0.55);
}

.auth-form__error {
    margin: 0;
    color: var(--danger);
    font-size: 0.875rem;
}

.auth-submit {
    min-height: 2.75rem;
    margin-top: 0.25rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #0f1117;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.auth-submit:hover:not(:disabled) {
    background: var(--accent-hover);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Nav drawer */
.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(4, 6, 12, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(100%, 18rem);
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background:
        linear-gradient(165deg, rgba(32, 38, 54, 0.97) 0%, rgba(14, 17, 28, 0.98) 55%, rgba(8, 10, 18, 0.99) 100%);
    border-right: 1px solid rgba(108, 158, 255, 0.18);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-drawer.is-open {
    transform: translateX(0);
}

.nav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.nav-drawer__label {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-drawer__close {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.nav-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-drawer__item {
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.4);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.nav-drawer__item:hover {
    border-color: rgba(108, 158, 255, 0.45);
}

.nav-drawer__item--danger {
    color: var(--danger);
}

/* Profile panel */
.profile-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(100%, 24rem);
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background:
        linear-gradient(165deg, rgba(32, 38, 54, 0.97) 0%, rgba(14, 17, 28, 0.98) 55%, rgba(8, 10, 18, 0.99) 100%);
    border-right: 1px solid rgba(108, 158, 255, 0.18);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: auto;
    overscroll-behavior: contain;
}

.profile-panel.is-open {
    transform: translateX(0);
}

.profile-panel__inner {
    position: relative;
    padding: 1.25rem 2.75rem 1.25rem 1.25rem;
    border: 1px solid rgba(154, 160, 166, 0.2);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at top left, rgba(108, 158, 255, 0.12), transparent 55%),
        rgba(26, 29, 39, 0.9);
}

.profile-panel__title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.profile-avatar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
}

.profile-avatar__img {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid rgba(154, 160, 166, 0.25);
}

.profile-avatar__placeholder {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    border: 1px dashed rgba(154, 160, 166, 0.35);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.75rem;
}

.profile-avatar__pick {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(108, 158, 255, 0.35);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.profile-heimat {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text);
}

.profile-heimat__label {
    color: var(--muted);
    margin-right: 0.35rem;
}

.profile-heimat__link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.profile-heimat__link:hover,
.profile-heimat__link:focus-visible {
    color: var(--text);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-dock {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    pointer-events: none;
}

.chat-dock > * {
    pointer-events: auto;
}

.chat-dock__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-scope {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.72);
    overflow: hidden;
}

.chat-scope__btn {
    margin: 0;
    padding: 0.45rem 0.55rem;
    border: 0;
    border-right: 1px solid rgba(154, 160, 166, 0.18);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.chat-scope__btn:last-child {
    border-right: 0;
}

.chat-scope__btn.is-active {
    background: rgba(108, 158, 255, 0.22);
    color: var(--text);
}

.chat-scope__btn:hover:not(.is-active),
.chat-scope__btn:focus-visible:not(.is-active) {
    color: var(--text);
}

.chat-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.72);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.chat-toggle:hover,
.chat-toggle:focus-visible,
.chat-toggle[aria-expanded="true"] {
    border-color: rgba(108, 158, 255, 0.45);
    color: var(--accent);
}

.chat-toggle__icon {
    width: 1.25rem;
    height: 1.25rem;
}

.chat-preview {
    display: block;
    max-width: 100%;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(154, 160, 166, 0.28);
    border-radius: var(--radius);
    background: rgba(26, 29, 39, 0.96);
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    animation: chat-preview-in 0.22s ease;
}

.chat-preview__name {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
}

.chat-preview__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    word-break: break-word;
}

@keyframes chat-preview-in {
    from {
        opacity: 0;
        transform: translateY(0.4rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-panel {
    display: flex;
    flex-direction: column;
    width: min(22rem, calc(100vw - 1.5rem));
    height: min(26rem, calc(100vh - 6.5rem));
    border: 1px solid rgba(108, 158, 255, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(165deg, rgba(32, 38, 54, 0.97) 0%, rgba(14, 17, 28, 0.98) 55%, rgba(8, 10, 18, 0.99) 100%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transform-origin: bottom left;
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.65rem 0.65rem 0.9rem;
    border-bottom: 1px solid rgba(154, 160, 166, 0.18);
}

.chat-panel__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.chat-panel__close {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.chat-panel__close:hover,
.chat-panel__close:focus-visible {
    color: var(--text);
    background: rgba(154, 160, 166, 0.12);
}

.chat-panel__messages {
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chat-msg {
    max-width: 100%;
}

.chat-msg__meta {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 0.15rem;
}

.chat-msg__name {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-msg__time {
    color: var(--muted);
    font-size: 0.6875rem;
}

.chat-msg__text {
    margin: 0;
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
}

.chat-link:hover,
.chat-link:focus-visible {
    color: #c9e6ff;
}

.chat-msg__name.chat-link,
.chat-preview__name.chat-link {
    font-size: inherit;
    font-weight: 700;
}

.chat-msg--own .chat-msg__name {
    color: #9ad0a5;
}

.chat-msg--log {
    border-left: 2px solid rgba(154, 160, 166, 0.25);
    padding-left: 0.55rem;
}

.chat-msg--log-ship .chat-msg__name {
    color: #c9b87a;
}

.chat-msg--log-app .chat-msg__name {
    color: #8eb4e8;
}

.chat-panel__empty {
    margin: auto 0;
    color: var(--muted);
    font-size: 0.8125rem;
    text-align: center;
}

.chat-panel__form {
    display: flex;
    gap: 0.45rem;
    padding: 0.65rem;
    border-top: 1px solid rgba(154, 160, 166, 0.18);
}

.chat-panel__input {
    flex: 1;
    min-width: 0;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(154, 160, 166, 0.28);
    border-radius: var(--radius);
    background: rgba(6, 8, 16, 0.65);
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
}

.chat-panel__input:focus {
    outline: none;
    border-color: rgba(108, 158, 255, 0.55);
}

.chat-panel__send {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #0a0c12;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-panel__send:hover:not(:disabled),
.chat-panel__send:focus-visible:not(:disabled) {
    background: var(--accent-hover);
}

.chat-panel__send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 420px) {
    .chat-scope__btn {
        padding: 0.4rem 0.4rem;
        font-size: 0.6875rem;
    }
}

/* Handel */
.detail-panel__ladung {
    margin-top: 1rem;
}

.detail-panel__kauf {
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(108, 158, 255, 0.45);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent-hover);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    min-width: 3.5rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.detail-panel__kauf:hover {
    background: rgba(108, 158, 255, 0.15);
    border-color: var(--accent-hover);
    color: var(--text);
}

.trade-backdrop {
    z-index: 85;
}

.route-backdrop {
    z-index: 92;
}

.trade-backdrop[hidden],
.route-backdrop[hidden],
.planet-picker-backdrop[hidden],
.trade-dialog[hidden],
.route-dialog[hidden],
.planet-picker-dialog[hidden] {
    display: none;
}

.trade-dialog {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.trade-dialog.is-open {
    opacity: 1;
}

.trade-dialog__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(100%, 22rem);
    max-height: 90vh;
    padding: 1.35rem 2.75rem 1.25rem 1.25rem;
    overflow-y: auto;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.trade-dialog.is-open .trade-dialog__inner {
    pointer-events: auto;
    transform: translateY(0);
}

.trade-dialog__location {
    margin: 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.trade-dialog__select,
.trade-dialog__input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.6);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.trade-dialog__select:focus,
.trade-dialog__input:focus {
    outline: none;
    border-color: rgba(108, 158, 255, 0.55);
}

.trade-dialog__hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.trade-dialog__bedarf-title {
    margin: 0.35rem 0 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.trade-dialog__bedarf-planeten {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trade-dialog__bedarf-planeten li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.trade-dialog__bedarf-empty {
    font-style: italic;
}

.trade-dialog__bedarf-nearest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.trade-dialog__bedarf-distanz {
    color: var(--muted);
    white-space: nowrap;
}

.ships-panel__bedarf-distanz,
.trade-dialog__bedarf-distanz.route-distanz-btn,
.distance-target-btn {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-hover);
    font: inherit;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
    white-space: nowrap;
}

.ships-panel__bedarf-distanz:hover,
.trade-dialog__bedarf-distanz.route-distanz-btn:hover,
.distance-target-btn:hover {
    color: var(--text);
}

.detail-panel__col-distanz .distance-target-btn {
    font-size: 0.8125rem;
}

.ships-panel__verkauf {
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(108, 158, 255, 0.45);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent-hover);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.ships-panel__verkauf:hover {
    background: rgba(108, 158, 255, 0.12);
    color: var(--text);
}

.detail-panel__route-btn {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid rgba(108, 158, 255, 0.45);
    border-radius: var(--radius);
    background: rgba(108, 158, 255, 0.12);
    color: var(--accent-hover);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.detail-panel__route-btn:hover {
    background: rgba(108, 158, 255, 0.22);
    color: var(--text);
}

.route-dialog {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.route-dialog.is-open {
    opacity: 1;
}

.route-dialog__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(100%, 22rem);
    max-height: 90vh;
    margin: 0;
    padding: 1.35rem 2.75rem 1.25rem 1.25rem;
    overflow-y: auto;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at top left, rgba(86, 207, 225, 0.1), transparent 50%),
        var(--surface);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 1;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.route-dialog.is-open .route-dialog__inner {
    pointer-events: auto;
    transform: translateY(0);
}

.route-dialog__destination {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.route-dialog__map {
    display: block;
    width: 100%;
    height: auto;
    margin: 0.85rem 0 0.5rem;
    border: 1px solid rgba(154, 160, 166, 0.2);
    border-radius: var(--radius);
    background: #0a0c12;
}

.planet-picker-backdrop {
    z-index: 94;
}

.planet-picker-dialog {
    position: fixed;
    inset: 0;
    z-index: 96;
    display: grid;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.planet-picker-dialog.is-open {
    opacity: 1;
}

.planet-picker-dialog__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(100%, 22rem);
    max-height: 90vh;
    margin: 0;
    padding: 1.35rem 2.75rem 1.25rem 1.25rem;
    overflow-y: auto;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at top left, rgba(86, 207, 225, 0.1), transparent 50%),
        var(--surface);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 1;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.planet-picker-dialog.is-open .planet-picker-dialog__inner {
    pointer-events: auto;
    transform: translateY(0);
}

.planet-picker-dialog__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.planet-picker-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.planet-picker-list li {
    margin: 0;
}

.planet-picker-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(154, 160, 166, 0.18);
    border-radius: var(--radius);
    background: rgba(108, 158, 255, 0.06);
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.planet-picker-item:hover {
    background: rgba(108, 158, 255, 0.14);
    border-color: rgba(108, 158, 255, 0.4);
}

.planet-picker-item__label {
    flex: 1 1 auto;
    min-width: 0;
}

.planet-picker-item__metrics {
    flex: 0 0 auto;
    color: var(--accent-hover);
    white-space: nowrap;
    font-size: 0.8125rem;
}

.planet-picker-empty {
    color: var(--muted);
    font-size: 0.875rem;
    font-style: italic;
}

.trade-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.trade-dialog__btn {
    flex: 1 1 8rem;
    min-height: 2.75rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #0f1117;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.trade-dialog__btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.trade-dialog__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.trade-dialog__btn--ghost {
    border: 1px solid rgba(108, 158, 255, 0.5);
    background: transparent;
    color: var(--accent-hover);
}

.trade-dialog__btn--ghost:hover:not(:disabled) {
    background: rgba(108, 158, 255, 0.12);
    color: var(--text);
}

.ships-dock {
    position: fixed;
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: none;
}

.ships-dock > * {
    pointer-events: auto;
}

.ships-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(154, 160, 166, 0.25);
    border-radius: var(--radius);
    background: rgba(10, 12, 18, 0.72);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.ships-toggle:hover,
.ships-toggle:focus-visible,
.ships-toggle[aria-expanded="true"] {
    border-color: rgba(108, 158, 255, 0.45);
    color: var(--accent);
}

.ships-toggle__icon {
    width: 1.25rem;
    height: 1.25rem;
}
