:root {
    --void: #050711;
    --deep: #070b16;
    --panel: rgba(12, 19, 36, 0.93);
    --panel-2: rgba(16, 27, 48, 0.92);
    --line: rgba(83, 220, 255, 0.25);
    --line-strong: rgba(83, 220, 255, 0.72);
    --cyan: #53dcff;
    --cyan-hot: #9ff1ff;
    --violet: #a56bff;
    --magenta: #ff4fb3;
    --amber: #f3c86c;
    --green: #74f7b4;
    --danger: #ff637f;
    --text: #edf7ff;
    --muted: #91a5ba;
    --muted-2: #61748c;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--void);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(165, 107, 255, 0.17), transparent 30rem),
        radial-gradient(circle at 82% 14%, rgba(83, 220, 255, 0.12), transparent 28rem),
        linear-gradient(160deg, #050711 0%, #080d1a 45%, #07101c 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.32;
    background-image:
        linear-gradient(rgba(83, 220, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(83, 220, 255, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.noise-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2,
strong,
.panel-kicker,
.eyebrow,
.slot-label,
button,
.primary-button,
.game-nav-item {
    letter-spacing: 0.045em;
}

.eyebrow,
.panel-kicker,
.slot-label {
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.flash {
    border: 1px solid var(--line);
    padding: 0.9rem 1rem;
    background: rgba(83, 220, 255, 0.08);
    color: var(--cyan-hot);
    font-size: 0.9rem;
}

.flash-error {
    border-color: rgba(255, 99, 127, 0.55);
    background: rgba(255, 99, 127, 0.1);
    color: #ffb3c0;
}

.flash-success {
    border-color: rgba(116, 247, 180, 0.48);
    background: rgba(116, 247, 180, 0.08);
    color: #b8ffd8;
}

.global-flash {
    position: relative;
    z-index: 5;
    max-width: 1180px;
    margin: 1rem auto 0;
}

.primary-button,
.ghost-button,
.danger-button,
.back-link,
.archive-return {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button {
    border: 1px solid var(--cyan);
    padding: 0.72rem 1.15rem;
    color: #03101a;
    background: linear-gradient(135deg, var(--cyan-hot), var(--cyan));
    box-shadow: 0 0 22px rgba(83, 220, 255, 0.14);
    font-weight: 900;
    text-transform: uppercase;
}

.primary-button:hover,
.primary-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(83, 220, 255, 0.3);
}

.ghost-button,
.danger-button {
    padding: 0.65rem 1rem;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ghost-button {
    color: var(--muted);
    border: 1px solid rgba(145, 165, 186, 0.35);
}

.ghost-button:hover {
    color: var(--text);
    border-color: var(--cyan);
}

.danger-button {
    color: #ff9caf;
    border: 1px solid rgba(255, 99, 127, 0.45);
}

.danger-button:hover {
    color: white;
    background: rgba(255, 99, 127, 0.15);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1160px, calc(100% - 2rem));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    align-items: center;
    gap: clamp(2rem, 8vw, 8rem);
    padding: 4rem 0;
}

.brand-panel {
    position: relative;
    padding: 2rem 0;
}

.brand-panel h1 {
    margin: 1.5rem 0 1.4rem;
    font-size: clamp(4.5rem, 11vw, 9rem);
    line-height: 0.78;
    letter-spacing: -0.075em;
    text-transform: uppercase;
    text-shadow: 0 0 38px rgba(83, 220, 255, 0.08);
}

.brand-copy {
    max-width: 34rem;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.75;
}

.brand-mark {
    position: absolute;
    right: 4%;
    top: 3rem;
    width: 170px;
    aspect-ratio: 1;
    border: 1px solid rgba(83, 220, 255, 0.23);
    border-radius: 50%;
    animation: orbit-spin 18s linear infinite;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
    content: "";
    position: absolute;
    border: 1px solid rgba(165, 107, 255, 0.55);
    border-radius: 50%;
}

.brand-mark::before {
    inset: 18%;
}

.brand-mark::after {
    inset: 38%;
    background: rgba(83, 220, 255, 0.13);
    box-shadow: 0 0 28px rgba(83, 220, 255, 0.4);
}

.brand-mark span:nth-child(1) {
    width: 12px;
    height: 12px;
    top: 2px;
    left: 50%;
    background: var(--magenta);
    box-shadow: 0 0 12px var(--magenta);
}

.brand-mark span:nth-child(2) {
    width: 7px;
    height: 7px;
    bottom: 28px;
    left: 6px;
    background: var(--cyan);
}

.brand-mark span:nth-child(3) {
    width: 5px;
    height: 5px;
    right: 14px;
    top: 58%;
    background: var(--amber);
}

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

.system-readout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    width: min(320px, 100%);
    margin-top: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--cyan);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.system-readout span {
    color: var(--muted-2);
}

.system-readout strong {
    color: var(--green);
}

.auth-panel {
    padding: clamp(1.3rem, 3vw, 2.3rem);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(83, 220, 255, 0.035), transparent 25%),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-panel h2 {
    margin: 0.55rem 0 1.5rem;
    font-size: 1.55rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 1rem 0 2rem;
    border-bottom: 1px solid var(--line);
}

.auth-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.9rem;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-tab.active {
    color: var(--cyan-hot);
    border-bottom-color: var(--cyan);
}

.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.wide-input {
    display: grid;
    gap: 0.45rem;
}

.stack-form label > span,
.wide-input > span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(145, 165, 186, 0.3);
    border-radius: 2px;
    outline: 0;
    padding: 0.8rem 0.9rem;
    color: var(--text);
    background: rgba(3, 7, 16, 0.78);
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(83, 220, 255, 0.08);
}

.check-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.65rem !important;
    color: var(--muted);
    font-size: 0.84rem;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--cyan);
}

.check-row span {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 500 !important;
}

.game-header {
    position: relative;
    z-index: 5;
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 2rem;
    padding: 0.8rem max(1rem, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(5, 8, 17, 0.88);
    backdrop-filter: blur(16px);
}

.mini-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.mini-brand-symbol {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--cyan);
    color: var(--cyan-hot);
    font-size: 0.82rem;
    font-weight: 900;
    transform: rotate(45deg);
}

.mini-brand-symbol::first-line {
    transform: rotate(-45deg);
}

.mini-brand > span:last-child {
    display: grid;
}

.mini-brand strong {
    font-size: 0.8rem;
}

.mini-brand small {
    color: var(--muted-2);
    font-size: 0.63rem;
    letter-spacing: 0.14em;
}

.header-status {
    display: grid;
    text-align: right;
}

.header-status span {
    color: var(--muted-2);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
}

.header-status strong {
    font-size: 0.82rem;
}

.archive-shell,
.creation-shell,
.ship-screen-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4.5rem) 0 5rem;
}

.page-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2rem;
    margin-bottom: 2.3rem;
}

.page-heading h1 {
    margin: 0.4rem 0 0.8rem;
    font-size: clamp(2.4rem, 6vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.page-heading p {
    max-width: 44rem;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.archive-meter {
    display: grid;
    min-width: 170px;
    padding: 1rem;
    border-left: 2px solid var(--magenta);
    background: rgba(255, 79, 179, 0.05);
}

.archive-meter strong {
    font-size: 1.8rem;
}

.archive-meter span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.save-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.save-card {
    position: relative;
    min-height: 460px;
    padding: 1.3rem;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(83, 220, 255, 0.04), transparent 30%), var(--panel);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.save-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 42%;
    height: 2px;
    background: var(--cyan);
    box-shadow: 0 0 14px var(--cyan);
}

.empty-save {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-save .slot-label {
    position: absolute;
    top: 1.3rem;
    left: 1.3rem;
}

.empty-save h2 {
    margin-bottom: 0.5rem;
}

.empty-save p {
    color: var(--muted);
}

.empty-orbit {
    position: relative;
    width: 110px;
    aspect-ratio: 1;
    margin-bottom: 2rem;
    border: 1px solid rgba(83, 220, 255, 0.25);
    border-radius: 50%;
}

.empty-orbit::before,
.empty-orbit::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.empty-orbit::before {
    inset: 23%;
    border: 1px solid rgba(165, 107, 255, 0.45);
}

.empty-orbit::after {
    width: 10px;
    height: 10px;
    top: 4px;
    left: calc(50% - 5px);
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
}

.occupied-save {
    display: flex;
    flex-direction: column;
}

.save-identity {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: end;
    gap: 1rem;
    margin: 2rem 0 1.4rem;
}

.save-identity img,
.unassigned-portrait {
    width: 92px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    background: #111a2a;
}

.unassigned-portrait {
    display: grid;
    place-items: center;
    color: var(--muted-2);
    font-size: 2rem;
}

.save-identity span {
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.save-identity h2 {
    margin: 0.4rem 0 0;
    font-size: 1.35rem;
}

.save-summary,
.captain-readout {
    margin: 0;
}

.save-summary div,
.captain-readout div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(145, 165, 186, 0.12);
}

.save-summary dt,
.captain-readout dt {
    color: var(--muted-2);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.save-summary dd,
.captain-readout dd {
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    text-align: right;
}

.save-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.creation-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--muted-2);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.back-link {
    color: var(--cyan);
    text-decoration: none;
}

.compact-heading {
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
}

.creation-form {
    display: grid;
    gap: 1rem;
}

.creation-section,
.creation-submit-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.creation-section {
    display: grid;
    grid-template-columns: 72px minmax(220px, 0.75fr) minmax(300px, 1.25fr);
    gap: 1.4rem;
    align-items: center;
    padding: clamp(1rem, 3vw, 1.8rem);
}

.vertical-section {
    display: block;
}

.section-heading-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 1.4rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.section-number {
    color: rgba(83, 220, 255, 0.25);
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
}

.section-copy h2 {
    margin: 0.35rem 0 0.5rem;
}

.section-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.wide-input small {
    color: var(--muted-2);
    text-transform: none;
    letter-spacing: normal;
}

.choice-grid {
    display: grid;
    gap: 0.8rem;
}

.portrait-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.choice-card {
    position: relative;
    cursor: pointer;
}

.choice-card > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-frame {
    position: relative;
    display: block;
    height: 100%;
    border: 1px solid rgba(145, 165, 186, 0.22);
    background: rgba(7, 12, 24, 0.82);
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
    overflow: hidden;
}

.choice-card:hover .choice-frame,
.choice-card:focus-within .choice-frame {
    border-color: rgba(83, 220, 255, 0.65);
    transform: translateY(-2px);
}

.choice-card.selected .choice-frame,
.choice-card input:checked + .choice-frame {
    border-color: var(--cyan);
    background: rgba(83, 220, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(83, 220, 255, 0.3), 0 0 24px rgba(83, 220, 255, 0.12);
}

.choice-card.selected .choice-frame::after,
.choice-card input:checked + .choice-frame::after {
    content: "SELECTED";
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    padding: 0.25rem 0.38rem;
    color: #06101b;
    background: var(--cyan);
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.09em;
}

.portrait-choice img {
    width: 100%;
    aspect-ratio: 4 / 5;
    display: block;
    object-fit: cover;
}

.choice-caption {
    display: block;
    padding: 0.6rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

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

.text-choice {
    display: flex;
    flex-direction: column;
    min-height: 220px;
    padding: 1.2rem;
}

.specialty-tag {
    align-self: flex-start;
    margin-bottom: 1rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(165, 107, 255, 0.5);
    color: #cfb3ff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.text-choice strong,
.ship-choice-copy strong {
    margin-bottom: 0.65rem;
    font-size: 1.15rem;
}

.text-choice > span:not(.specialty-tag),
.ship-choice-copy > span:not(.specialty-tag) {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.text-choice small {
    margin-top: auto;
    padding-top: 1rem;
    color: var(--cyan);
    font-size: 0.72rem;
    line-height: 1.5;
}

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

.ship-choice-frame {
    display: grid;
    grid-template-columns: 42% 1fr;
    min-height: 270px;
}

.ship-choice-frame > img {
    width: 100%;
    height: 100%;
    min-height: 270px;
    object-fit: cover;
    border-right: 1px solid rgba(145, 165, 186, 0.18);
}

.ship-choice-copy {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.mini-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid rgba(145, 165, 186, 0.18);
}

.mini-stats span {
    display: grid;
    gap: 0.15rem;
    padding: 0.6rem 0.3rem;
    border-right: 1px solid rgba(145, 165, 186, 0.12);
    color: var(--muted-2);
    font-size: 0.53rem;
    text-align: center;
}

.mini-stats b {
    color: var(--text);
    font-size: 0.8rem;
}

.ship-name-input {
    max-width: 500px;
    margin: 1.2rem 0 0 auto;
}

.creation-submit-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    border-color: rgba(83, 220, 255, 0.5);
}

.creation-submit-panel h2 {
    margin: 0.35rem 0 0.45rem;
}

.creation-submit-panel p {
    margin: 0;
    color: var(--muted);
}

.large-button {
    min-width: 210px;
    min-height: 54px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 4, 10, 0.88);
    backdrop-filter: blur(12px);
    transition: opacity 200ms ease;
}

.modal-backdrop.closing {
    opacity: 0;
}

.tutorial-modal {
    position: relative;
    width: min(620px, 100%);
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid var(--line-strong);
    background: linear-gradient(160deg, rgba(83, 220, 255, 0.07), transparent 40%), #0b1222;
    box-shadow: 0 0 70px rgba(83, 220, 255, 0.16), var(--shadow);
    text-align: center;
    overflow: hidden;
}

.tutorial-modal h2 {
    margin: 0.7rem 0 1rem;
    font-size: clamp(1.8rem, 5vw, 3rem);
}

.tutorial-modal p {
    color: var(--muted);
    line-height: 1.75;
}

.modal-signal {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--cyan);
    transform: rotate(45deg);
    box-shadow: inset 0 0 28px rgba(83, 220, 255, 0.15), 0 0 22px rgba(83, 220, 255, 0.17);
}

.modal-signal::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    margin: 26px;
    background: var(--cyan);
    box-shadow: 0 0 14px var(--cyan);
}

.tutorial-ok {
    min-width: 130px;
    margin-top: 0.7rem;
}

.ship-screen-shell {
    width: min(1260px, calc(100% - 2rem));
    padding-top: 1.5rem;
}

.game-nav {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
    overflow-x: auto;
}

.game-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 135px;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(145, 165, 186, 0.16);
    color: var(--muted-2);
    background: rgba(9, 14, 27, 0.74);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.game-nav-item span {
    color: rgba(83, 220, 255, 0.35);
}

.game-nav-item.active {
    border-color: var(--cyan);
    color: var(--text);
    background: rgba(83, 220, 255, 0.08);
}

.game-nav-item:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.ship-window {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    background: rgba(8, 13, 25, 0.9);
    box-shadow: var(--shadow);
}

.ship-visual-panel,
.captain-panel,
.systems-panel,
.utility-panel {
    padding: clamp(1rem, 2.6vw, 1.8rem);
}

.ship-visual-panel {
    position: relative;
    min-height: 520px;
    border-right: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, rgba(83, 220, 255, 0.11), transparent 32%),
        linear-gradient(180deg, rgba(165, 107, 255, 0.055), transparent 40%);
}

.ship-visual-panel::before {
    content: "";
    position: absolute;
    inset: 17% 8% 15%;
    border: 1px solid rgba(83, 220, 255, 0.1);
    border-radius: 50%;
    transform: rotate(-9deg);
}

.ship-title-row {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.ship-title-row h1 {
    margin: 0.5rem 0 0.3rem;
    font-size: clamp(2rem, 4.5vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.ship-title-row p {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-chip,
.systems-state {
    padding: 0.42rem 0.6rem;
    border: 1px solid rgba(116, 247, 180, 0.4);
    color: var(--green);
    background: rgba(116, 247, 180, 0.07);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.main-ship-image {
    position: relative;
    z-index: 1;
    display: block;
    width: min(94%, 820px);
    max-height: 345px;
    margin: 1.2rem auto 0;
    object-fit: contain;
    filter: drop-shadow(0 28px 35px rgba(0, 0, 0, 0.55));
}

.ship-location-strip {
    position: absolute;
    z-index: 2;
    inset: auto 1.8rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(83, 220, 255, 0.18);
    background: rgba(4, 8, 17, 0.8);
}

.ship-location-strip span {
    color: var(--muted-2);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.ship-location-strip strong {
    font-size: 0.76rem;
}

.captain-panel {
    background: rgba(13, 21, 39, 0.82);
}

.captain-profile {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 1rem;
    align-items: end;
    margin: 1.2rem 0;
}

.captain-profile img {
    width: 108px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--line-strong);
}

.captain-profile span {
    color: var(--muted-2);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
}

.captain-profile h2 {
    margin: 0.35rem 0 0.2rem;
    font-size: 1.45rem;
}

.captain-profile p {
    margin: 0;
    color: var(--cyan);
    font-size: 0.76rem;
}

.lvp-note {
    display: grid;
    gap: 0.45rem;
    margin-top: 1.3rem;
    padding: 1rem;
    border-left: 2px solid var(--amber);
    background: rgba(243, 200, 108, 0.055);
}

.lvp-note strong {
    color: var(--amber);
    font-size: 0.68rem;
}

.lvp-note span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.systems-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
}

.systems-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.systems-heading h2 {
    margin: 0.35rem 0 0;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.system-card {
    min-height: 145px;
    padding: 1rem;
    border: 1px solid rgba(145, 165, 186, 0.17);
    background: rgba(11, 18, 34, 0.82);
}

.major-system {
    grid-column: span 2;
}

.system-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.system-label span,
.rating-card > span,
.utility-panel article > span {
    color: var(--muted-2);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.system-label b,
.system-label .system-readout-value {
    color: var(--text);
}

.system-readout-value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}

.system-readout-value b {
    font: inherit;
}

.meter {
    height: 8px;
    margin-bottom: 0.8rem;
    background: rgba(145, 165, 186, 0.12);
    overflow: hidden;
}

.meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--magenta), #ff9a7b);
    box-shadow: 0 0 12px rgba(255, 79, 179, 0.5);
}

.shield-meter span {
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    box-shadow: 0 0 12px rgba(83, 220, 255, 0.5);
}

.system-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.rating-card {
    display: grid;
    align-content: start;
}

.rating-card strong {
    margin: 0.25rem 0 0.45rem;
    color: var(--cyan-hot);
    font-size: 2.5rem;
    line-height: 1;
}

.utility-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.7rem;
    border-top: 1px solid var(--line);
    background: rgba(4, 8, 16, 0.65);
}

.utility-panel article {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 1rem;
    border-left: 1px solid rgba(145, 165, 186, 0.14);
}

.utility-panel article strong {
    font-size: 1rem;
}

.utility-panel article small {
    color: var(--muted-2);
}

.archive-return {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(145, 165, 186, 0.24);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.archive-return:hover {
    color: var(--text);
    border-color: var(--cyan);
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2.5rem 0;
    }

    .brand-panel {
        padding-bottom: 0;
    }

    .brand-panel h1 {
        font-size: clamp(4.2rem, 17vw, 7rem);
    }

    .brand-mark {
        width: 130px;
        right: 2%;
    }

    .save-grid {
        grid-template-columns: 1fr;
    }

    .save-card {
        min-height: 360px;
    }

    .creation-section {
        grid-template-columns: 60px 1fr;
    }

    .creation-section > .wide-input {
        grid-column: 2;
    }

    .portrait-grid {
        grid-template-columns: repeat(5, minmax(100px, 1fr));
        overflow-x: auto;
        padding-bottom: 0.4rem;
    }

    .ship-window {
        grid-template-columns: 1fr;
    }

    .ship-visual-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

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

@media (max-width: 720px) {
    .game-header {
        grid-template-columns: 1fr auto;
        gap: 0.7rem;
    }

    .header-status {
        display: none;
    }

    .global-flash {
        margin-inline: 1rem;
    }

    .page-heading {
        grid-template-columns: 1fr;
    }

    .archive-meter {
        width: 100%;
    }

    .background-grid,
    .ship-choice-grid {
        grid-template-columns: 1fr;
    }

    .creation-section {
        display: block;
    }

    .section-number {
        margin-bottom: 0.8rem;
        font-size: 2rem;
    }

    .section-heading-row {
        display: block;
    }

    .creation-section > .wide-input {
        margin-top: 1rem;
    }

    .creation-submit-panel {
        display: grid;
    }

    .large-button {
        width: 100%;
    }

    .ship-title-row {
        display: block;
    }

    .status-chip {
        display: inline-block;
        margin-top: 0.5rem;
    }

    .ship-visual-panel {
        min-height: 490px;
    }

    .ship-location-strip {
        grid-template-columns: 1fr 1fr;
        inset-inline: 1rem;
    }

    .captain-profile {
        grid-template-columns: 86px 1fr;
    }

    .captain-profile img {
        width: 86px;
    }

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

    .utility-panel {
        grid-template-columns: 1fr;
    }

    .major-system {
        grid-column: 1 / -1;
    }

    .rating-card {
        min-height: 118px;
        padding: 0.85rem;
    }

    .rating-card strong {
        font-size: 2rem;
    }

    .rating-card p {
        font-size: 0.68rem;
    }

    .systems-heading {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .auth-shell,
    .archive-shell,
    .creation-shell,
    .ship-screen-shell {
        width: min(100% - 1rem, 1180px);
    }

    .brand-panel h1 {
        font-size: 3.9rem;
    }

    .brand-mark {
        opacity: 0.5;
    }

    .auth-panel {
        padding: 1rem;
    }

    .game-header {
        padding-inline: 0.7rem;
    }

    .mini-brand > span:last-child {
        display: none;
    }

    .save-identity {
        grid-template-columns: 74px 1fr;
    }

    .save-identity img,
    .unassigned-portrait {
        width: 74px;
    }

    .save-actions {
        grid-template-columns: 1fr;
    }

    .save-actions .primary-button,
    .save-actions form,
    .save-actions .danger-button {
        width: 100%;
    }

    .portrait-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .ship-choice-frame {
        grid-template-columns: 1fr;
    }

    .ship-choice-frame > img {
        min-height: 180px;
        max-height: 210px;
        border-right: 0;
        border-bottom: 1px solid rgba(145, 165, 186, 0.18);
    }

    .mini-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .ship-visual-panel {
        min-height: 440px;
        padding: 1rem;
    }

    .ship-title-row h1 {
        font-size: 2rem;
    }

    .main-ship-image {
        margin-top: 2rem;
    }

    .ship-location-strip {
        inset: auto 0.7rem 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* =========================================================
   LVP 1.1 — TRAVEL, LOCATIONS, AND NPC REPUTATION
   ========================================================= */

.travel-window {
    border: 1px solid var(--line);
    background: rgba(8, 13, 25, 0.92);
    box-shadow: var(--shadow);
}

.travel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
    gap: 2rem;
    align-items: end;
    padding: clamp(1.2rem, 3vw, 2rem);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(115deg, rgba(83, 220, 255, 0.07), transparent 42%),
        rgba(10, 17, 32, 0.88);
}

.travel-header h1 {
    margin: 0.45rem 0 0.7rem;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.travel-header p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

.travel-status-readout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    padding: 1rem;
    border-left: 2px solid var(--cyan);
    background: rgba(3, 8, 17, 0.62);
}

.travel-status-readout span {
    color: var(--muted-2);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.travel-status-readout strong {
    color: var(--cyan-hot);
    font-size: 0.76rem;
    text-align: right;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: clamp(1rem, 2.6vw, 1.8rem);
}

.location-card {
    position: relative;
    min-height: 490px;
    border: 1px solid rgba(145, 165, 186, 0.24);
    background-image: var(--location-image);
    background-position: center;
    background-size: cover;
    overflow: hidden;
    isolation: isolate;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.location-card:hover {
    transform: translateY(-2px);
    border-color: rgba(83, 220, 255, 0.65);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.35);
}

.location-card.current-location {
    border-color: rgba(116, 247, 180, 0.7);
}

.location-card-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(3, 6, 14, 0.18), rgba(3, 6, 14, 0.52) 45%, rgba(3, 6, 14, 0.96) 82%),
        linear-gradient(90deg, rgba(8, 12, 24, 0.45), transparent 65%);
}

.location-card-content {
    min-height: 490px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem;
}

.location-card-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.location-card-topline span,
.location-card-topline strong {
    padding: 0.35rem 0.5rem;
    background: rgba(2, 6, 15, 0.78);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.location-card-topline span {
    color: var(--muted);
    border-left: 2px solid var(--violet);
}

.location-card-topline strong {
    color: var(--cyan-hot);
    border: 1px solid rgba(83, 220, 255, 0.34);
}

.current-location .location-card-topline strong {
    color: var(--green);
    border-color: rgba(116, 247, 180, 0.42);
}

.location-card-copy {
    margin-top: auto;
    padding-top: 10rem;
}

.location-card-copy h2 {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 4.2vw, 3.5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.location-card-copy p {
    max-width: 600px;
    margin: 0;
    color: #c4d3df;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    line-height: 1.65;
}

.location-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.location-services span {
    padding: 0.3rem 0.45rem;
    border: 1px solid rgba(145, 165, 186, 0.26);
    color: var(--muted);
    background: rgba(3, 7, 16, 0.58);
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.location-card-action {
    margin-top: 1.15rem;
}

.location-card-action form,
.location-button {
    width: 100%;
}

.location-button {
    min-height: 48px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--cyan);
    color: #04101a;
    background: linear-gradient(135deg, var(--cyan-hot), var(--cyan));
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.location-button:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(83, 220, 255, 0.28);
}

.location-button:disabled {
    cursor: not-allowed;
    color: var(--muted-2);
    border-color: rgba(145, 165, 186, 0.24);
    background: rgba(7, 12, 23, 0.82);
}

.location-button.current:disabled {
    color: var(--green);
    border-color: rgba(116, 247, 180, 0.4);
    background: rgba(116, 247, 180, 0.08);
}

.location-button.danger:disabled {
    color: #ff9caf;
    border-color: rgba(255, 99, 127, 0.4);
    background: rgba(255, 99, 127, 0.08);
}

.npc-contact-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    gap: 0;
    margin: 0 clamp(1rem, 2.6vw, 1.8rem) clamp(1rem, 2.6vw, 1.8rem);
    border: 1px solid rgba(243, 200, 108, 0.42);
    background:
        linear-gradient(110deg, rgba(243, 200, 108, 0.045), transparent 38%),
        rgba(12, 17, 29, 0.96);
}

.npc-portrait-wrap {
    position: relative;
    min-height: 390px;
    border-right: 1px solid rgba(243, 200, 108, 0.28);
    overflow: hidden;
}

.npc-portrait-wrap img {
    width: 100%;
    height: 100%;
    min-height: 390px;
    display: block;
    object-fit: cover;
}

.npc-signal {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.55rem;
    background: rgba(4, 7, 14, 0.88);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-align: center;
}

.npc-signal.distress {
    color: #ff9caf;
    border: 1px solid rgba(255, 99, 127, 0.55);
    animation: signal-pulse 1.6s ease-in-out infinite;
}

.npc-signal.stable {
    color: var(--green);
    border: 1px solid rgba(116, 247, 180, 0.48);
}

@keyframes signal-pulse {
    50% { box-shadow: 0 0 22px rgba(255, 99, 127, 0.28); }
}

.npc-contact-copy {
    padding: clamp(1.2rem, 3vw, 2rem);
}

.npc-title-plate {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(145, 165, 186, 0.16);
}

.npc-title-plate > div:first-child > span {
    color: var(--amber);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.npc-title-plate h2 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1;
}

.npc-reputation {
    min-width: 118px;
    padding: 0.7rem;
    border: 1px solid rgba(83, 220, 255, 0.3);
    background: rgba(83, 220, 255, 0.05);
    text-align: center;
}

.npc-reputation span {
    display: block;
    color: var(--muted-2);
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.npc-reputation strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--cyan-hot);
    font-size: 1.8rem;
}

.npc-contact-copy > p {
    margin: 1.2rem 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

.npc-event-brief {
    display: grid;
    gap: 0.45rem;
    margin: 1rem 0 1.2rem;
    padding: 1rem;
    border-left: 2px solid var(--amber);
    background: rgba(243, 200, 108, 0.05);
}

.npc-event-brief strong {
    color: var(--amber);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.npc-event-brief span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.npc-event-brief.urgent {
    border-left-color: var(--danger);
    background: rgba(255, 99, 127, 0.055);
}

.npc-event-brief.urgent strong {
    color: #ff9caf;
}

.npc-event-brief.completed {
    border-left-color: var(--green);
    background: rgba(116, 247, 180, 0.05);
}

.npc-event-brief.completed strong {
    color: var(--green);
}

.encounter-modal {
    width: min(760px, 100%);
    max-height: min(90vh, 820px);
    overflow-y: auto;
    padding: clamp(1.4rem, 4vw, 3rem);
    border: 1px solid rgba(243, 200, 108, 0.62);
    background:
        linear-gradient(145deg, rgba(243, 200, 108, 0.07), transparent 38%),
        #0b101d;
    box-shadow: 0 0 70px rgba(243, 200, 108, 0.12), var(--shadow);
}

.encounter-modal h2 {
    margin: 0.55rem 0 1.2rem;
    font-size: clamp(2rem, 6vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.encounter-modal p {
    color: #b8c7d3;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.78;
}

.encounter-reward {
    display: grid;
    gap: 0.35rem;
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid rgba(116, 247, 180, 0.42);
    background: rgba(116, 247, 180, 0.06);
}

.encounter-reward span {
    color: var(--muted-2);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.encounter-reward strong {
    color: var(--green);
}

@media (max-width: 900px) {
    .travel-header,
    .npc-contact-panel {
        grid-template-columns: 1fr;
    }

    .npc-portrait-wrap {
        min-height: 320px;
        max-height: 480px;
        border-right: 0;
        border-bottom: 1px solid rgba(243, 200, 108, 0.28);
    }

    .npc-portrait-wrap img {
        min-height: 320px;
        object-position: center 28%;
    }
}

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

    .location-card,
    .location-card-content {
        min-height: 430px;
    }

    .location-card-copy {
        padding-top: 7rem;
    }

    .travel-status-readout {
        grid-template-columns: 1fr;
    }

    .travel-status-readout strong {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .location-card-topline {
        display: grid;
        justify-items: start;
    }

    .npc-title-plate {
        display: grid;
    }

    .npc-reputation {
        width: 100%;
    }
}

/* LVP 1.1 NPC plate refinement: reputation sits directly below the name/title plate. */
.npc-title-plate {
    display: block;
}

.npc-title-plate > span {
    color: var(--amber);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.npc-reputation {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.7rem;
    text-align: left;
}

.npc-reputation strong {
    margin-top: 0;
}

/* LVP 1.2 — fuel flash and cargo hold */
.fuel-display {
    display: inline-block;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.fuel-flash-run {
    animation: fuelFlashPulse 1.15s ease-in-out 1;
}

@keyframes fuelFlashPulse {
    0% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
    25% {
        color: #ff7d7d;
        text-shadow: 0 0 12px rgba(255, 98, 98, 0.75), 0 0 30px rgba(255, 44, 85, 0.35);
        transform: translateY(-1px);
    }
    60% {
        color: #ff3f64;
        text-shadow: 0 0 16px rgba(255, 63, 100, 0.8), 0 0 36px rgba(255, 63, 100, 0.35);
        transform: translateY(0);
    }
    100% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
}

.inline-action-form {
    display: inline-flex;
}

.cargo-panel {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.88), rgba(5, 12, 25, 0.94));
    border: 1px solid rgba(92, 128, 170, 0.25);
    border-radius: 24px;
    padding: 1.25rem;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cargo-panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.cargo-panel-heading h2 {
    margin: 0.2rem 0 0.4rem;
}

.cargo-panel-heading p {
    margin: 0;
    max-width: 60rem;
}

.cargo-summary-capsule {
    min-width: 180px;
    border: 1px solid rgba(112, 166, 255, 0.18);
    border-radius: 18px;
    padding: 0.8rem 1rem;
    background: rgba(9, 16, 32, 0.88);
    text-align: right;
}

.cargo-summary-capsule span,
.cargo-summary-capsule strong {
    display: block;
}

.cargo-summary-capsule span {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cargo-summary-capsule strong {
    margin-top: 0.35rem;
    color: #f0fbff;
    font-size: 1.15rem;
}

.cargo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 1rem;
}

.cargo-grid-shell,
.cargo-inspector {
    border: 1px solid rgba(120, 176, 255, 0.16);
    border-radius: 18px;
    background: rgba(5, 12, 25, 0.82);
    padding: 1rem;
}

.cargo-status {
    min-height: 1.4rem;
    margin-bottom: 0.9rem;
    color: #d6e9ff;
    font-size: 0.92rem;
}

.cargo-status[data-state="error"] {
    color: #ff8a96;
}

.cargo-status[data-state="success"] {
    color: #81ffc8;
}

.cargo-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cargo-cols), minmax(54px, 1fr));
    grid-template-rows: repeat(var(--cargo-rows), minmax(54px, 1fr));
    gap: 0.35rem;
    align-items: stretch;
    min-height: 0;
}

.cargo-cell {
    min-height: 54px;
    border-radius: 14px;
    border: 1px solid rgba(82, 124, 170, 0.28);
    background: linear-gradient(180deg, rgba(15, 26, 48, 0.85), rgba(9, 17, 32, 0.92));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.cargo-cell.highlight-valid {
    border-color: rgba(104, 255, 195, 0.88);
    box-shadow: 0 0 0 1px rgba(104, 255, 195, 0.22), inset 0 0 18px rgba(104, 255, 195, 0.14);
}

.cargo-cell.highlight-invalid {
    border-color: rgba(255, 103, 122, 0.88);
    box-shadow: 0 0 0 1px rgba(255, 103, 122, 0.2), inset 0 0 18px rgba(255, 103, 122, 0.14);
}

.cargo-item {
    appearance: none;
    border: 1px solid rgba(121, 206, 255, 0.34);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(28, 58, 90, 0.92), rgba(12, 27, 49, 0.94));
    color: #f0fbff;
    display: grid;
    place-items: center;
    gap: 0.25rem;
    padding: 0.4rem;
    text-align: center;
    cursor: grab;
    z-index: 3;
    transition: transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cargo-item:hover,
.cargo-item.selected {
    border-color: rgba(116, 255, 232, 0.9);
    box-shadow: 0 0 0 1px rgba(116, 255, 232, 0.2), 0 14px 28px rgba(0, 0, 0, 0.25);
}

.cargo-item:active,
.cargo-item.dragging {
    cursor: grabbing;
    transform: scale(0.97);
}

.cargo-item img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    pointer-events: none;
}

.cargo-item span {
    font-size: 0.68rem;
    line-height: 1.15;
    font-weight: 700;
    pointer-events: none;
}

.cargo-empty-note {
    margin-top: 0.85rem;
    color: rgba(202, 218, 238, 0.84);
    font-size: 0.92rem;
}

.cargo-empty-note[hidden] {
    display: none;
}

.cargo-inspector {
    display: flex;
    flex-direction: column;
}

.cargo-inspector h3 {
    margin: 0.3rem 0;
}

.cargo-inspector-empty,
.cargo-inspector-content {
    margin-top: 0.5rem;
}

.cargo-inspector-content.hidden,
.cargo-inspector-empty.hidden {
    display: none;
}

.cargo-inspector-content img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(14, 25, 46, 0.75);
    border: 1px solid rgba(120, 176, 255, 0.16);
    padding: 0.65rem;
    margin-bottom: 0.8rem;
}

.cargo-inspector-title {
    color: #f0fbff;
    font-size: 1.2rem;
    font-weight: 800;
}

.cargo-inspector-effect {
    margin-top: 0.3rem;
    color: var(--cyan);
    font-size: 0.83rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cargo-inspector-copy p {
    margin: 0.8rem 0;
}

.cargo-inspector-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    color: var(--muted);
    font-size: 0.86rem;
    margin-bottom: 1rem;
}

@media (max-width: 960px) {
    .cargo-layout {
        grid-template-columns: 1fr;
    }

    .cargo-panel-heading {
        flex-direction: column;
    }

    .cargo-summary-capsule {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .cargo-grid {
        grid-template-columns: repeat(var(--cargo-cols), minmax(42px, 1fr));
        grid-template-rows: repeat(var(--cargo-rows), minmax(42px, 1fr));
    }

    .cargo-cell {
        min-height: 42px;
    }

    .cargo-item img {
        width: 24px;
        height: 24px;
    }

    .cargo-item span {
        font-size: 0.58rem;
    }
}

/* LVP 1.3 — one-slot cargo stacks */
.cargo-item {
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.cargo-drag-preview {
    position: fixed !important;
    z-index: 10000 !important;
    pointer-events: none !important;
    margin: 0 !important;
    opacity: 0.92;
    transform: scale(1.04);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(116, 255, 232, 0.35) !important;
    will-change: left, top;
}

body.cargo-pointer-dragging,
body.cargo-pointer-dragging * {
    cursor: grabbing !important;
    user-select: none !important;
}

.cargo-item-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cargo-stack-count {
    position: absolute;
    top: 4px;
    right: 5px;
    min-width: 24px;
    padding: 0.12rem 0.28rem;
    border-radius: 999px;
    background: rgba(3, 8, 18, 0.92);
    border: 1px solid rgba(126, 246, 255, 0.48);
    color: #f4ffff;
    font-size: 0.64rem !important;
    line-height: 1 !important;
    text-align: center;
    box-shadow: 0 0 10px rgba(71, 218, 255, 0.18);
}

.cargo-cell {
    position: relative;
}

/* LVP 1.3 stack-merge feedback */
.cargo-item.merge-target {
    border-color: rgba(100, 255, 190, 0.95);
    box-shadow: 0 0 0 2px rgba(100, 255, 190, 0.25), 0 0 28px rgba(100, 255, 190, 0.32);
    background: linear-gradient(180deg, rgba(28, 88, 78, 0.96), rgba(10, 42, 42, 0.96));
}

.cargo-item.merge-invalid {
    border-color: rgba(255, 100, 125, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 100, 125, 0.22), 0 0 28px rgba(255, 100, 125, 0.25);
}

/* LVP 1.4 — persistent alerts, toasts, and mobile navigation */
.fuel-display.fuel-danger {
    color: #ff526f;
    animation: criticalAlertPulse 1.15s ease-in-out infinite;
}

.fuel-display.fuel-warning {
    color: #ffd86a;
    animation: warningAlertPulse 2.3s ease-in-out infinite;
}

@keyframes criticalAlertPulse {
    0%, 100% {
        color: #ff94a6;
        text-shadow: 0 0 4px rgba(255, 82, 111, 0.25);
        opacity: 0.82;
    }
    50% {
        color: #ff294f;
        text-shadow: 0 0 15px rgba(255, 41, 79, 0.9), 0 0 34px rgba(255, 41, 79, 0.45);
        opacity: 1;
    }
}

@keyframes warningAlertPulse {
    0%, 100% {
        color: #ffe49a;
        text-shadow: 0 0 3px rgba(255, 216, 106, 0.18);
        opacity: 0.78;
    }
    50% {
        color: #ffc928;
        text-shadow: 0 0 13px rgba(255, 201, 40, 0.78), 0 0 28px rgba(255, 201, 40, 0.34);
        opacity: 1;
    }
}

.npc-signal.distress {
    color: #ff9caf;
    border-color: rgba(255, 70, 102, 0.85);
    animation: criticalAlertPanelPulse 1.15s ease-in-out infinite;
}

@keyframes criticalAlertPanelPulse {
    0%, 100% {
        color: #ff9caf;
        border-color: rgba(255, 70, 102, 0.5);
        background: rgba(20, 4, 10, 0.82);
        box-shadow: 0 0 5px rgba(255, 41, 79, 0.18);
        opacity: 0.82;
    }
    50% {
        color: #ffffff;
        border-color: rgba(255, 41, 79, 1);
        background: rgba(106, 8, 29, 0.9);
        box-shadow: 0 0 18px rgba(255, 41, 79, 0.82), 0 0 38px rgba(255, 41, 79, 0.32);
        opacity: 1;
    }
}

.toast-region {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 120;
    width: min(390px, calc(100vw - 2rem));
    display: grid;
    gap: 0.65rem;
    pointer-events: none;
}

.toast {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    padding: 0.9rem 0.9rem 0.9rem 1rem;
    border: 1px solid rgba(120, 176, 255, 0.3);
    border-left-width: 4px;
    border-radius: 14px;
    background: rgba(6, 13, 27, 0.96);
    color: #eaf6ff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateX(22px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast-leaving {
    opacity: 0;
    transform: translateX(22px) scale(0.98);
}

.toast-success {
    border-left-color: #6ff0ae;
}

.toast-warning {
    border-left-color: #ffd052;
}

.toast-error {
    border-left-color: #ff526f;
}

.toast-info {
    border-left-color: #53dcff;
}

.toast-message {
    line-height: 1.45;
    font-size: 0.9rem;
}

.toast-close {
    appearance: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cfe7ff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
    .game-nav {
        position: sticky;
        top: env(safe-area-inset-top, 0px);
        z-index: 35;
        margin-inline: -0.5rem;
        padding: 0.55rem 0.5rem;
        background: rgba(5, 9, 18, 0.94);
        border-bottom: 1px solid rgba(83, 220, 255, 0.18);
        backdrop-filter: blur(16px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    }

    .game-nav-item {
        min-width: 118px;
        flex: 0 0 auto;
    }

    .toast-region {
        top: auto;
        right: max(0.65rem, env(safe-area-inset-right));
        bottom: max(0.65rem, env(safe-area-inset-bottom));
        left: max(0.65rem, env(safe-area-inset-left));
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fuel-display.fuel-danger,
    .fuel-display.fuel-warning,
    .npc-signal.distress {
        animation-duration: 3s;
    }

    .toast {
        transition: none;
    }
}

/* LVP 1.5 — Current Location, Aster Gate, docking transmissions, and commerce */
.current-location-window {
    display: grid;
    gap: 1.15rem;
}

.location-hero {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(122, 181, 255, 0.24);
    background-image: var(--location-hero-image);
    background-size: cover;
    background-position: center;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.32fr);
    align-items: end;
}

.location-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3, 8, 20, 0.96) 0%, rgba(3, 8, 20, 0.72) 48%, rgba(3, 8, 20, 0.28) 100%), linear-gradient(0deg, rgba(3, 8, 20, 0.92), transparent 70%);
}

.location-hero-content,
.location-hero-readout {
    position: relative;
    z-index: 2;
}

.location-hero-content {
    padding: clamp(1.4rem, 4vw, 3rem);
}

.location-hero-content h1 {
    margin: 0.25rem 0 0.7rem;
    font-size: clamp(2.2rem, 6vw, 4.7rem);
    letter-spacing: -0.04em;
}

.location-hero-content p {
    max-width: 760px;
    margin: 0;
    font-size: 1.02rem;
}

.location-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.2rem;
}

.location-hero-tags span {
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(104, 216, 255, 0.25);
    background: rgba(5, 18, 34, 0.78);
    color: #d9f8ff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.location-hero-readout {
    margin: 1.25rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(106, 225, 255, 0.18);
    background: rgba(4, 11, 24, 0.88);
    backdrop-filter: blur(12px);
    display: grid;
    gap: 0.25rem;
}

.location-hero-readout span {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.location-hero-readout span:first-child {
    margin-top: 0;
}

.location-hero-readout strong {
    color: #effcff;
    font-size: 1rem;
}

.location-access-locked {
    padding: 2rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 119, 132, 0.25);
    background: linear-gradient(180deg, rgba(49, 12, 25, 0.66), rgba(9, 12, 24, 0.92));
    text-align: center;
}

.location-access-locked h2 {
    margin: 0.35rem 0;
}

.local-spots-section {
    display: grid;
    gap: 0.75rem;
}

.local-spots-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    padding: 0.7rem 0.2rem;
}

.local-spots-heading h2 {
    margin: 0.25rem 0;
}

.local-spots-heading p {
    margin: 0;
}

.local-spots-heading > span {
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.local-spot {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(92, 145, 202, 0.22);
    background: rgba(6, 14, 28, 0.88);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.local-spot[open] {
    border-color: rgba(96, 229, 255, 0.38);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.03);
}

.local-spot > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.15rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    user-select: none;
    background: linear-gradient(90deg, rgba(13, 27, 49, 0.92), rgba(8, 16, 31, 0.84));
}

.local-spot > summary::-webkit-details-marker {
    display: none;
}

.local-spot > summary strong,
.local-spot > summary small {
    display: block;
}

.local-spot > summary strong {
    color: #effcff;
    font-size: 1.05rem;
}

.local-spot > summary small {
    margin-top: 0.15rem;
    color: var(--muted);
}

.local-spot-index {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--cyan);
    border: 1px solid rgba(103, 229, 255, 0.26);
    background: rgba(6, 21, 36, 0.86);
    font-weight: 900;
}

.local-spot-toggle {
    color: var(--amber);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.local-spot[open] .local-spot-toggle {
    color: var(--cyan);
}

.local-spot-content {
    padding: 1.1rem;
    animation: localSpotReveal 0.28s ease both;
}

@keyframes localSpotReveal {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: translateY(0); }
}

.local-npc-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(106, 171, 224, 0.18);
    background: rgba(8, 18, 34, 0.82);
}

.local-npc-card > img {
    width: 100%;
    height: 100%;
    min-height: 190px;
    object-fit: cover;
}

.local-npc-copy {
    padding: 1rem 1rem 1rem 0;
}

.local-npc-copy h3 {
    margin: 0.15rem 0;
    font-size: 1.35rem;
}

.compact-npc-card {
    grid-template-columns: 125px minmax(0, 1fr);
}

.compact-npc-card > img {
    min-height: 165px;
}

.help-topic-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.help-topic {
    border: 1px solid rgba(93, 154, 205, 0.18);
    border-radius: 14px;
    background: rgba(7, 16, 31, 0.75);
    padding: 0.75rem 0.9rem;
}

.help-topic summary {
    cursor: pointer;
    color: #eafaff;
    font-weight: 800;
}

.help-topic p {
    margin: 0.65rem 0 0;
}

.shop-concourse,
.station-merchant-section {
    display: grid;
    gap: 1rem;
}

.ship-dealer-section {
    padding-top: 1.1rem;
    border-top: 1px solid rgba(95, 145, 191, 0.18);
}

.store-credit-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 204, 99, 0.18);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    background: rgba(28, 22, 8, 0.5);
}

.store-credit-line span {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.13em;
}

.store-credit-line strong {
    color: var(--amber);
}

.store-inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.store-item-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem;
    border-radius: 17px;
    border: 1px solid rgba(85, 149, 202, 0.2);
    background: linear-gradient(180deg, rgba(15, 29, 50, 0.88), rgba(7, 15, 29, 0.94));
}

.store-item-card > img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    justify-self: center;
}

.store-item-copy h4 {
    margin: 0;
    color: #effcff;
}

.store-item-copy p {
    margin: 0.2rem 0;
    color: var(--cyan);
    font-size: 0.86rem;
}

.store-item-copy > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.store-price-row,
.store-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.store-price-row span {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.store-price-row strong {
    color: #f8e4a7;
}

.store-actions form,
.store-actions button {
    flex: 1;
    width: 100%;
}

.dealer-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.dealer-ship-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: 17px;
    border: 1px solid rgba(94, 151, 205, 0.18);
    background: rgba(8, 17, 32, 0.82);
}

.dealer-ship-card img {
    width: 100%;
    border-radius: 12px;
}

.dealer-ship-card span {
    color: var(--cyan);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dealer-ship-card h4 {
    margin: 0.15rem 0;
}

.dealer-ship-card p {
    margin: 0;
    font-size: 0.84rem;
}

.dealer-ship-card button {
    grid-column: 1 / -1;
}

.location-npc-panel {
    margin: 0;
}

.docking-backdrop {
    align-items: center;
    overflow-y: auto;
    background: rgba(1, 4, 12, 0.92);
}

.docking-transmission {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(780px, calc(100vw - 2rem));
    max-height: min(720px, calc(100dvh - 2rem));
    overflow: hidden;
    border-radius: 6px 26px 6px 26px;
    border: 1px solid rgba(93, 229, 255, 0.48);
    background: linear-gradient(145deg, rgba(5, 19, 37, 0.98), rgba(10, 10, 24, 0.98));
    box-shadow: 0 0 0 1px rgba(118, 229, 255, 0.08), 0 0 50px rgba(23, 168, 213, 0.22), 0 30px 80px rgba(0, 0, 0, 0.66);
}

.transmission-flicker-in {
    animation: transmissionFlickerIn 0.58s steps(1, end) both;
}

.docking-transmission.transmission-flicker-out {
    animation: transmissionFlickerOut 0.46s steps(1, end) both;
}

@keyframes transmissionFlickerIn {
    0% { opacity: 0; transform: scaleY(0.02) scaleX(0.82); filter: brightness(3) contrast(1.4); }
    12% { opacity: 0.9; transform: scaleY(0.06) scaleX(1.02); }
    23% { opacity: 0.18; transform: scaleY(0.38) skewX(-1deg); }
    34% { opacity: 1; transform: scaleY(0.72) skewX(1deg); filter: brightness(1.7); }
    44% { opacity: 0.35; transform: scaleY(0.98); }
    58% { opacity: 1; transform: scale(1); filter: brightness(1.18); }
    72% { opacity: 0.72; transform: translateX(2px); }
    100% { opacity: 1; transform: none; filter: none; }
}

@keyframes transmissionFlickerOut {
    0% { opacity: 1; transform: none; }
    24% { opacity: 0.25; transform: translateX(-3px) scaleY(0.95); filter: brightness(2); }
    42% { opacity: 0.9; transform: translateX(2px) scaleY(0.5); }
    68% { opacity: 0.15; transform: scaleY(0.08) scaleX(1.05); }
    100% { opacity: 0; transform: scaleY(0.01) scaleX(0.74); filter: brightness(4); }
}

.transmission-header {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding: 0.68rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(90deg, rgba(23, 201, 235, 0.2), rgba(255, 80, 130, 0.12));
    border-bottom: 1px solid rgba(94, 228, 255, 0.26);
}

.transmission-header span,
.transmission-header strong {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
}

.transmission-header span {
    color: #9ef3ff;
    animation: criticalAlertPulse 1.15s ease-in-out infinite;
}

.transmission-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.docking-dialogue {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: stretch;
}

.docking-speaker-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid rgba(83, 220, 255, 0.25);
    border-radius: 4px 18px 4px 18px;
    overflow: hidden;
    background: rgba(3, 13, 27, 0.82);
    box-shadow: inset 0 0 22px rgba(83, 220, 255, 0.06);
}

.docking-speaker-portrait {
    position: relative;
    flex: 1 1 auto;
    min-height: 154px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(83, 220, 255, 0.2), transparent 52%),
        rgba(4, 12, 24, 0.95);
}

.docking-speaker-portrait img {
    width: 100%;
    height: 100%;
    min-height: 154px;
    display: block;
    object-fit: cover;
    object-position: center 24%;
    filter: saturate(0.86) contrast(1.08);
}

.docking-speaker-portrait > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(158, 243, 255, 0.88);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.15em;
}

.docking-speaker-signal {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cyan-hot);
    box-shadow: 0 0 12px var(--cyan-hot), 0 0 24px rgba(83, 220, 255, 0.5);
    animation: criticalAlertPulse 1.15s ease-in-out infinite;
}

.docking-speaker-id {
    padding: 0.62rem 0.7rem 0.72rem;
    border-top: 1px solid rgba(83, 220, 255, 0.16);
}

.docking-speaker-id span,
.docking-speaker-id strong {
    display: block;
}

.docking-speaker-id span {
    color: var(--muted);
    font-size: 0.58rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.docking-speaker-id strong {
    margin-top: 0.2rem;
    color: #edfaff;
    font-size: 0.84rem;
    line-height: 1.25;
}

.docking-speech-panel {
    position: relative;
    min-width: 0;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(103, 188, 224, 0.22);
    border-radius: 18px 4px 18px 4px;
    background:
        linear-gradient(135deg, rgba(83, 220, 255, 0.08), transparent 52%),
        rgba(4, 13, 26, 0.76);
    box-shadow: inset 0 0 28px rgba(83, 220, 255, 0.04);
}

.docking-speech-panel::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 34px;
    width: 16px;
    height: 16px;
    border-left: 1px solid rgba(103, 188, 224, 0.22);
    border-bottom: 1px solid rgba(103, 188, 224, 0.22);
    background: rgba(5, 16, 31, 0.98);
    transform: rotate(45deg);
}

.docking-speech-panel h2 {
    margin: 0.22rem 0 0.55rem;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.docking-speech-panel p {
    margin: 0;
    color: #c8dce7;
    line-height: 1.6;
}

.docking-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0;
}

.docking-metric {
    min-width: 0;
    padding: 0.72rem 0.78rem;
    border-radius: 12px;
    border: 1px solid rgba(103, 188, 224, 0.18);
    background: rgba(4, 13, 26, 0.75);
}

.docking-metric span,
.docking-metric strong {
    display: block;
}

.docking-metric span {
    color: var(--muted);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.docking-metric strong {
    margin-top: 0.28rem;
    color: #ecfbff;
    font-size: 1rem;
}

.docking-metric-primary {
    border-color: rgba(83, 220, 255, 0.28);
    background: linear-gradient(145deg, rgba(19, 55, 75, 0.62), rgba(4, 13, 26, 0.82));
}

.docking-denial-note {
    margin: 0;
    padding: 0.65rem;
    border: 1px solid rgba(255, 88, 112, 0.35);
    border-radius: 10px;
    color: #ff8d9c;
    background: rgba(75, 10, 23, 0.42);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-align: center;
}

.transmission-body form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    gap: 0.65rem;
    margin: 0;
}

.transmission-body form :is(.primary-button, .ghost-button) {
    min-height: 46px;
    justify-content: center;
    text-align: center;
}

.transmission-scanline {
    position: absolute;
    inset: -20% 0 auto;
    height: 18%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(112, 239, 255, 0.08), transparent);
    animation: transmissionScan 3.2s linear infinite;
}

@keyframes transmissionScan {
    from { transform: translateY(-80%); }
    to { transform: translateY(760%); }
}

@media (max-width: 860px) {
    .location-hero {
        grid-template-columns: 1fr;
    }

    .location-hero-readout {
        margin-top: 0;
    }

    .store-inventory-grid,
    .dealer-preview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .location-hero {
        min-height: 440px;
    }

    .local-spots-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .local-spot > summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .local-spot-toggle {
        grid-column: 2;
    }

    .local-npc-card,
    .compact-npc-card {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .local-npc-card > img,
    .compact-npc-card > img {
        min-height: 150px;
    }

    .dealer-ship-card {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .docking-backdrop {
        align-items: start;
        padding:
            max(0.5rem, env(safe-area-inset-top, 0px))
            0.5rem
            max(0.5rem, env(safe-area-inset-bottom, 0px));
    }

    .docking-transmission {
        width: 100%;
        max-height: calc(100dvh - max(1rem, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
        border-radius: 4px 18px 4px 18px;
    }

    .transmission-header {
        align-items: flex-start;
        padding: 0.58rem 0.7rem;
    }

    .transmission-header span,
    .transmission-header strong {
        font-size: 0.54rem;
        letter-spacing: 0.09em;
    }

    .transmission-header strong {
        max-width: 52%;
        text-align: right;
    }

    .transmission-body {
        gap: 0.7rem;
        padding: 0.7rem;
    }

    .docking-dialogue {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 0.65rem;
    }

    .docking-speaker-portrait,
    .docking-speaker-portrait img {
        min-height: 100px;
    }

    .docking-speaker-id {
        padding: 0.45rem 0.48rem 0.52rem;
    }

    .docking-speaker-id span {
        font-size: 0.48rem;
        letter-spacing: 0.07em;
    }

    .docking-speaker-id strong {
        font-size: 0.68rem;
    }

    .docking-speech-panel {
        padding: 0.72rem 0.78rem;
    }

    .docking-speech-panel::before {
        left: -7px;
        top: 25px;
        width: 12px;
        height: 12px;
    }

    .docking-speech-panel .panel-kicker {
        font-size: 0.5rem;
    }

    .docking-speech-panel h2 {
        margin-bottom: 0.38rem;
        font-size: 1rem;
    }

    .docking-speech-panel p {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .docking-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .docking-metric {
        padding: 0.62rem;
    }

    .docking-metric span {
        font-size: 0.51rem;
        letter-spacing: 0.07em;
    }

    .docking-metric strong {
        font-size: 0.9rem;
    }

    .docking-metric-funds {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .docking-metric-funds strong {
        margin-top: 0;
        text-align: right;
    }

    .transmission-body form {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .transmission-body form :is(.primary-button, .ghost-button) {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 390px) {
    .docking-dialogue {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 0.5rem;
    }

    .docking-speaker-portrait,
    .docking-speaker-portrait img {
        min-height: 84px;
    }

    .docking-speaker-id span {
        display: none;
    }

    .docking-speech-panel {
        padding: 0.62rem 0.66rem;
    }

    .docking-speech-panel p {
        font-size: 0.72rem;
    }
}

/* LVP 1.6 — reusable animated collapsibles, interaction panels, and persistent footer */
.animated-details > summary {
    list-style: none;
}

.animated-details > summary::-webkit-details-marker {
    display: none;
}

.collapsible-content {
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
    will-change: height, opacity;
}

.local-spot-content {
    animation: none;
}

.interaction-panel {
    overflow: hidden;
    border: 1px solid rgba(92, 145, 202, 0.2);
    border-radius: 17px;
    background: rgba(7, 16, 31, 0.72);
    scroll-margin-top: 110px;
}

.interaction-panel + .interaction-panel {
    margin-top: 0.8rem;
}

.interaction-panel[open] {
    border-color: rgba(96, 229, 255, 0.32);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.interaction-summary {
    cursor: pointer;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.85rem;
    min-height: 72px;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(90deg, rgba(15, 31, 54, 0.92), rgba(8, 17, 32, 0.88));
    user-select: none;
}

.interaction-summary > img {
    width: 54px;
    height: 54px;
    border-radius: 13px;
    object-fit: cover;
    border: 1px solid rgba(112, 224, 255, 0.26);
}

.interaction-summary > span:nth-child(2) small,
.interaction-summary > span:nth-child(2) strong {
    display: block;
}

.interaction-summary > span:nth-child(2) small {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.interaction-summary > span:nth-child(2) strong {
    margin-top: 0.15rem;
    color: #effcff;
    font-size: 1rem;
}

.interaction-rep {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.interaction-rep b {
    color: var(--cyan);
    font-size: 0.9rem;
}

.interaction-toggle {
    color: var(--amber);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.interaction-panel[open] .interaction-toggle {
    color: var(--cyan);
}

.interaction-content {
    padding: 1rem;
}

.help-topic {
    padding: 0;
    overflow: hidden;
}

.help-topic summary {
    padding: 0.75rem 0.9rem;
}

.help-topic[open] summary {
    color: var(--cyan);
}

.help-topic-body {
    padding: 0 0.9rem 0.85rem;
}

.help-topic-body p {
    margin: 0.65rem 0 0;
}

.store-item-card,
.interaction-panel {
    scroll-margin-top: 120px;
}

.player-status-footer {
    position: fixed;
    z-index: 90;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 1.2rem));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.55rem max(0.65rem, env(safe-area-inset-left)) calc(0.55rem + env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-right));
    border: 1px solid rgba(95, 203, 255, 0.28);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, rgba(10, 23, 43, 0.97), rgba(5, 12, 25, 0.99));
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
}

.status-footer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.48rem 0.7rem;
    border-radius: 12px;
    background: rgba(11, 25, 45, 0.72);
}

.status-footer-item > span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    white-space: nowrap;
}

.status-footer-item > strong {
    color: #f0fbff;
    font-size: 0.88rem;
    white-space: nowrap;
}

.ship-screen-shell {
    padding-bottom: 96px;
}

@media (max-width: 760px) {
    .interaction-summary {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 0.65rem;
    }

    .interaction-summary > img {
        width: 44px;
        height: 44px;
    }

    .interaction-rep {
        display: none;
    }

    .interaction-toggle {
        font-size: 0.58rem;
    }

    .player-status-footer {
        width: 100%;
        gap: 0.25rem;
        border-radius: 14px 14px 0 0;
        padding-left: max(0.35rem, env(safe-area-inset-left));
        padding-right: max(0.35rem, env(safe-area-inset-right));
    }

    .status-footer-item {
        display: grid;
        justify-items: center;
        gap: 0.12rem;
        padding: 0.4rem 0.2rem;
        text-align: center;
    }

    .status-footer-item > span {
        font-size: 0.5rem;
        letter-spacing: 0.06em;
    }

    .status-footer-item > strong {
        font-size: 0.76rem;
    }

    .ship-screen-shell {
        padding-bottom: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collapsible-content {
        transition-duration: 0.01ms;
    }
}

/* LVP 1.6 Relay-7 and persistent panel-state hotfix */
[data-credit-display] {
    color: #9dffc0 !important;
    text-shadow: 0 0 12px rgba(104, 255, 166, 0.22);
}

.relay-dialogue-block {
    margin: 0.95rem 0 1rem;
    padding: 1rem;
    border: 1px solid rgba(105, 226, 255, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(12, 28, 48, 0.82), rgba(7, 17, 31, 0.88));
}

.relay-dialogue-block > p {
    margin: 0.55rem 0 0.85rem;
}

.relay-question-button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    color: #c8f8ff;
    border-color: rgba(105, 226, 255, 0.3);
}

.relay-question-button:hover {
    border-color: rgba(105, 226, 255, 0.72);
    box-shadow: 0 0 20px rgba(65, 221, 255, 0.12);
}

.relay-identity-response {
    margin-top: 0.55rem;
}

/* LVP 1.7 — Clan and ship crew */
.crew-bonus-badge {
    color: #9dffc0;
}

.crew-focus-line,
.crew-bonus-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 0.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(126, 255, 183, 0.16);
    background: rgba(82, 212, 145, 0.055);
}

.crew-focus-line span,
.crew-bonus-line span {
    color: var(--muted-2);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crew-focus-line strong,
.crew-bonus-line strong {
    color: #9dffc0;
    font-size: 0.78rem;
}

.crew-recruitment-dialogue {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(126, 255, 183, 0.16);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(13, 34, 44, 0.8), rgba(7, 18, 29, 0.9));
}

.crew-recruitment-dialogue p {
    margin: 0.55rem 0 0.9rem;
}

.crew-recruitment-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.clan-window {
    display: grid;
    gap: 1rem;
}

.clan-header,
.crew-class-directory,
.clan-roster-section {
    border: 1px solid var(--line);
    background: rgba(8, 13, 25, 0.91);
    box-shadow: var(--shadow);
}

.clan-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
    gap: 1.5rem;
    align-items: center;
    padding: clamp(1rem, 2.5vw, 1.8rem);
}

.clan-header h1 {
    margin: 0.4rem 0 0.55rem;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.clan-header p {
    margin: 0;
    max-width: 62rem;
}

.clan-header-readout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem 1rem;
    padding: 1rem;
    border: 1px solid rgba(83, 220, 255, 0.16);
    background: rgba(4, 10, 20, 0.78);
}

.clan-header-readout span {
    color: var(--muted-2);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}

.clan-header-readout strong {
    font-size: 0.75rem;
    text-align: right;
}

.crew-class-directory,
.clan-roster-section {
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

.section-heading-inline {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading-inline h2 {
    margin: 0.3rem 0 0;
}

.section-heading-inline > span,
.section-heading-inline > a:not(.primary-button) {
    color: var(--muted);
    font-size: 0.72rem;
}

.crew-class-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.crew-class-card {
    min-height: 190px;
    padding: 1rem;
    border: 1px solid rgba(96, 140, 190, 0.2);
    background: linear-gradient(180deg, rgba(17, 30, 53, 0.85), rgba(8, 17, 31, 0.9));
}

.crew-class-card > span {
    color: var(--cyan);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crew-class-card h3 {
    margin: 0.5rem 0 0.35rem;
}

.crew-class-card strong {
    color: #9dffc0;
    font-size: 0.76rem;
}

.crew-class-card p {
    margin: 0.8rem 0 0;
    font-size: 0.82rem;
}

.clan-roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.8rem;
}

.clan-member-card {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(96, 140, 190, 0.2);
    background: rgba(8, 17, 31, 0.9);
}

.clan-member-card.assigned {
    border-color: rgba(126, 255, 183, 0.28);
}

.clan-member-card > img {
    width: 105px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--line-strong);
}

.clan-member-copy > span {
    color: var(--cyan);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.clan-member-copy h3 {
    margin: 0.3rem 0;
}

.clan-member-copy p {
    margin: 0.5rem 0;
    font-size: 0.82rem;
}

.clan-member-status {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(96, 140, 190, 0.15);
}

.clan-member-status span {
    color: var(--muted-2);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
}

.clan-member-status strong {
    color: #9dffc0;
    font-size: 0.76rem;
}

.clan-empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 2rem;
    border: 1px dashed rgba(96, 140, 190, 0.25);
}

.clan-empty-state p {
    max-width: 48rem;
}

.ship-crew-panel {
    grid-column: 1 / -1;
    padding: clamp(1rem, 2.6vw, 1.8rem);
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(10, 22, 36, 0.9), rgba(7, 15, 27, 0.93));
}

.ship-crew-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ship-crew-heading h2 {
    margin: 0.35rem 0 0.4rem;
}

.ship-crew-heading p {
    margin: 0;
    max-width: 60rem;
}

.crew-capacity-readout {
    min-width: 175px;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(126, 255, 183, 0.18);
    background: rgba(6, 17, 24, 0.8);
    text-align: right;
}

.crew-capacity-readout span,
.crew-capacity-readout strong {
    display: block;
}

.crew-capacity-readout span {
    color: var(--muted-2);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}

.crew-capacity-readout strong {
    margin-top: 0.3rem;
    color: #9dffc0;
    font-size: 1.2rem;
}

.ship-crew-slots,
.available-crew-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.ship-crew-card,
.available-crew-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    min-height: 112px;
    padding: 0.8rem;
    border: 1px solid rgba(96, 140, 190, 0.2);
    background: rgba(7, 15, 29, 0.88);
}

.ship-crew-card.assigned {
    border-color: rgba(126, 255, 183, 0.3);
}

.ship-crew-card > img,
.available-crew-card > img {
    width: 72px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--line-strong);
}

.ship-crew-card span,
.available-crew-card span {
    color: var(--cyan);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ship-crew-card h3,
.available-crew-card h3 {
    margin: 0.25rem 0;
    font-size: 1rem;
}

.ship-crew-card strong,
.available-crew-card strong {
    color: #9dffc0;
    font-size: 0.72rem;
}

.ship-crew-card form,
.available-crew-card form {
    grid-column: 1 / -1;
}

.ship-crew-card form button,
.available-crew-card form button {
    width: 100%;
}

.ship-crew-card.empty {
    opacity: 0.7;
    border-style: dashed;
}

.crew-slot-number {
    display: grid;
    place-items: center;
    width: 58px;
    height: 72px;
    border: 1px solid rgba(83, 220, 255, 0.2);
    color: var(--cyan) !important;
    font-size: 1rem !important;
}

.available-crew-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(96, 140, 190, 0.16);
}

.available-crew-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.available-crew-heading div {
    display: grid;
}

.available-crew-heading span {
    color: var(--muted-2);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.available-crew-heading strong {
    margin-top: 0.25rem;
}

.available-crew-heading a {
    color: var(--cyan);
    font-size: 0.72rem;
}

.available-crew-empty {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px dashed rgba(96, 140, 190, 0.2);
}

.available-crew-empty p {
    margin: 0;
}

@media (max-width: 920px) {
    .clan-header,
    .crew-class-grid {
        grid-template-columns: 1fr 1fr;
    }

    .clan-header > div:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .clan-header,
    .crew-class-grid {
        grid-template-columns: 1fr;
    }

    .section-heading-inline,
    .ship-crew-heading,
    .available-crew-heading,
    .available-crew-empty {
        align-items: stretch;
        flex-direction: column;
    }

    .crew-capacity-readout {
        width: 100%;
        text-align: left;
    }

    .clan-member-card {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .clan-member-card > img {
        width: 82px;
    }
}

.credit-text {
    color: #a6ff97;
}

.mission-tag,
.mission-inline-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(116, 255, 220, 0.45);
    background: rgba(30, 109, 92, 0.28);
    color: #b8fff1;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mission-tag.live {
    border-color: rgba(244, 202, 98, 0.5);
    background: rgba(156, 110, 16, 0.22);
    color: #ffe7a3;
}

.mission-tag.report {
    border-color: rgba(116, 182, 255, 0.5);
    background: rgba(31, 69, 120, 0.24);
    color: #d7ebff;
}

.npc-mission-actions {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.mission-offer-card {
    border: 1px solid rgba(116, 255, 220, 0.16);
    background: rgba(11, 18, 32, 0.72);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.75rem;
}

.mission-offer-card strong {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.mission-offer-card p {
    margin: 0;
}

.mission-modal-card {
    max-width: 760px;
}

.mission-scene-image {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(116, 255, 220, 0.15);
    margin: 0.35rem 0 1rem;
}

.mission-choice-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.upgrade-panel {
    background: rgba(9, 14, 27, 0.92);
    border: 1px solid rgba(116, 255, 220, 0.1);
    border-radius: 28px;
    padding: 1.35rem;
    display: grid;
    gap: 1.1rem;
}

.upgrade-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.upgrade-slot-card {
    background: rgba(17, 25, 45, 0.82);
    border: 1px solid rgba(116, 255, 220, 0.1);
    border-radius: 18px;
    padding: 1rem;
    min-height: 140px;
}

.upgrade-slot-card.installed {
    border-color: rgba(166, 255, 151, 0.3);
    box-shadow: inset 0 0 0 1px rgba(166, 255, 151, 0.08);
}

.upgrade-slot-card span {
    color: #7fa4c7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.upgrade-slot-card h3 {
    margin: 0.55rem 0 0.35rem;
}

.upgrade-slot-card p,
.mission-card p {
    margin: 0;
}

/* LVP 1.8 mission and interface cleanup hotfix */
.player-status-footer {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.missions-window .crew-class-directory {
    display: block;
}

.missions-window .mission-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    gap: 1.35rem;
    padding: 1.3rem;
}

.missions-window .mission-card .clan-member-copy {
    grid-column: 1;
}

.missions-window .mission-card .clan-member-status {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 0 0 1.2rem;
    border-top: 0;
    border-left: 1px solid rgba(96, 140, 190, 0.18);
}

.mission-origin-line {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 0.7rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.mission-origin-line span {
    letter-spacing: 0.09em;
}

.mission-origin-line strong {
    color: #c9f8ff;
}

.mission-cost-notice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.8rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(95, 203, 255, 0.18);
    background: rgba(10, 28, 47, 0.62);
}

.mission-cost-notice.warning {
    border-color: rgba(255, 190, 73, 0.34);
    background: rgba(70, 43, 8, 0.42);
}

.mission-cost-notice span {
    color: var(--muted);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
}

.mission-cost-notice strong {
    color: #ffe2a0;
}

.mission-cost-notice.neutral strong {
    color: #b8fff1;
}

.mission-cost-notice small {
    grid-column: 1 / -1;
    color: var(--muted-2);
}

.mission-embark-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.mission-embark-button span {
    color: #ffe2a0;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
}

.mission-fuel-shortage {
    color: #ff9c9c;
    font-size: 0.8rem;
}

.installed-upgrade-content {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    margin-top: 0.65rem;
}

.installed-upgrade-content img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(166, 255, 151, 0.22);
    background: rgba(5, 12, 22, 0.72);
}

.installed-upgrade-content h3 {
    margin: 0 0 0.25rem;
}

@media (max-width: 720px) {
    .missions-window .mission-card {
        grid-template-columns: 1fr;
    }

    .missions-window .mission-card .clan-member-status {
        grid-column: 1;
        grid-row: auto;
        padding: 0.8rem 0 0;
        border-left: 0;
        border-top: 1px solid rgba(96, 140, 190, 0.18);
    }

    .player-status-footer {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* LVP 1.8 progression and mobile interface patch */
.header-primary-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 2rem;
}

.mobile-game-nav {
    display: none;
}

.upgrade-panel {
    grid-column: 1 / -1;
    width: 100%;
}

.upgrade-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.upgrade-slot-card {
    min-width: 0;
}

.crew-disciplines-details {
    overflow: hidden;
}

.crew-disciplines-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    cursor: pointer;
    border: 1px solid rgba(96, 140, 190, 0.18);
    background: rgba(10, 20, 37, 0.8);
}

.crew-disciplines-summary::-webkit-details-marker {
    display: none;
}

.crew-disciplines-summary > span:first-child {
    display: grid;
    gap: 0.22rem;
}

.crew-disciplines-summary strong {
    font-size: 1.15rem;
}

.crew-disciplines-summary small,
.crew-disciplines-heading > span {
    color: var(--muted);
}

.crew-disciplines-content {
    overflow: hidden;
}

.crew-disciplines-heading {
    padding: 0.9rem 1.1rem 0;
}

.crew-disciplines-content .crew-class-grid {
    padding: 1rem 1.1rem 1.15rem;
}

.player-status-footer {
    display: block;
    transition: transform 260ms ease;
}

.player-status-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.footer-collapse-toggle {
    display: none;
}

@media (max-width: 900px) and (min-width: 721px) {
    .upgrade-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .game-header {
        position: sticky;
        top: 0;
        z-index: 120;
        display: block;
        min-height: 0;
        padding: 0;
        border-bottom: 1px solid rgba(83, 220, 255, 0.2);
        background: rgba(5, 9, 18, 0.97);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    }

    .header-primary-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.7rem;
        min-height: 54px;
        padding: 0.45rem max(0.65rem, env(safe-area-inset-right)) 0.45rem max(0.65rem, env(safe-area-inset-left));
    }

    .header-status {
        display: none;
    }

    .header-signout-form .ghost-button {
        min-height: 34px;
        padding: 0.45rem 0.7rem;
        font-size: 0.66rem;
    }

    .mini-brand {
        gap: 0.65rem;
    }

    .mini-brand-symbol {
        width: 34px;
        height: 34px;
        font-size: 0.7rem;
    }

    .mini-brand > span:last-child {
        display: grid;
    }

    .mini-brand > span:last-child strong {
        font-size: 0.72rem;
    }

    .mini-brand > span:last-child small {
        font-size: 0.54rem;
    }

    .mobile-game-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        border-top: 1px solid rgba(83, 220, 255, 0.12);
    }

    .mobile-game-nav-item {
        min-width: 0;
        display: grid;
        justify-items: center;
        gap: 0.1rem;
        padding: 0.48rem 0.12rem 0.52rem;
        border-right: 1px solid rgba(145, 165, 186, 0.1);
        color: var(--muted-2);
        background: rgba(9, 14, 27, 0.68);
        text-decoration: none;
        text-transform: uppercase;
    }

    .mobile-game-nav-item:last-child {
        border-right: 0;
    }

    .mobile-game-nav-item span {
        color: rgba(83, 220, 255, 0.45);
        font-size: 0.48rem;
        letter-spacing: 0.08em;
    }

    .mobile-game-nav-item b {
        min-width: 0;
        font-size: clamp(0.52rem, 2.25vw, 0.66rem);
        letter-spacing: 0.025em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-game-nav-item.active {
        color: var(--text);
        background: rgba(83, 220, 255, 0.1);
        box-shadow: inset 0 -2px var(--cyan);
    }

    .game-nav {
        display: none;
    }

    .ship-screen-shell {
        padding-top: 0.7rem;
    }

    .upgrade-category-grid {
        grid-template-columns: 1fr;
    }

    .crew-disciplines-summary {
        padding: 0.9rem;
    }

    .crew-disciplines-summary strong {
        font-size: 1rem;
    }

    .player-status-footer {
        width: 100%;
        border-radius: 14px 14px 0 0;
        padding: 0.4rem max(0.35rem, env(safe-area-inset-right)) calc(0.4rem + env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
        will-change: transform;
    }

    .player-status-footer.is-collapsed {
        transform: translate(-50%, 100%);
    }

    .player-status-footer-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .footer-collapse-toggle {
        position: absolute;
        top: -30px;
        left: 50%;
        transform: translateX(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.42rem;
        height: 30px;
        min-width: 118px;
        padding: 0 0.8rem;
        border: 1px solid rgba(95, 203, 255, 0.3);
        border-bottom: 0;
        border-radius: 12px 12px 0 0;
        background: rgba(8, 21, 39, 0.98);
        color: #ccefff;
        font: inherit;
        font-size: 0.62rem;
        font-weight: 900;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.25);
    }

    .footer-collapse-toggle b {
        font-size: 0.9rem;
        transition: transform 220ms ease;
    }

    .player-status-footer.is-collapsed .footer-collapse-toggle b {
        transform: rotate(180deg);
    }

    body.footer-collapsed .ship-screen-shell {
        padding-bottom: 40px;
    }
}

.header-primary-row {
    grid-column: 1 / -1;
}

.crew-disciplines-details {
    padding: 0;
}

/* LVP 1.9 Hangar, Fleet, and Annex */
.game-nav-item.locked,
.mobile-game-nav-item.locked {
    opacity: 0.42;
    cursor: not-allowed;
}

.hangar-window {
    display: grid;
    gap: 1rem;
}

.hangar-fleet-section,
.annex-section {
    border: 1px solid var(--line);
    background: rgba(8, 13, 25, 0.91);
    box-shadow: var(--shadow);
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

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

.fleet-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid rgba(96, 140, 190, 0.2);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(17, 30, 53, 0.88), rgba(8, 17, 31, 0.94));
}

.fleet-card.active {
    border-color: rgba(126, 255, 183, 0.38);
    box-shadow: inset 0 0 0 1px rgba(126, 255, 183, 0.08);
}

.fleet-card > img {
    width: 100%;
    aspect-ratio: 10 / 7;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(83, 220, 255, 0.14);
}

.fleet-card-copy > span,
.hangar-item-card > div > span {
    color: var(--cyan);
    font-size: 0.64rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.fleet-card-copy h3,
.hangar-item-card h3 {
    margin: 0.35rem 0 0.25rem;
}

.fleet-card-copy p,
.hangar-item-card p {
    margin: 0;
}

.fleet-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.fleet-stat-row span {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(145, 165, 186, 0.12);
    background: rgba(4, 10, 20, 0.62);
    color: var(--muted);
    font-size: 0.68rem;
}

.fleet-stat-row b {
    color: var(--text);
}

.fleet-card-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.fleet-card-actions form {
    margin: 0;
}

.hangar-upgrade-workshop {
    width: 100%;
}

.hangar-transfer-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.hangar-storage-column {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(96, 140, 190, 0.16);
    border-radius: 20px;
    background: rgba(7, 14, 27, 0.78);
}

.hangar-item-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
    max-height: 620px;
    overflow: auto;
    padding-right: 0.2rem;
}

.hangar-item-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid rgba(145, 165, 186, 0.12);
    border-radius: 15px;
    background: rgba(13, 22, 39, 0.86);
}

.hangar-item-card img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 12px;
}

.hangar-item-card p {
    color: var(--muted);
    font-size: 0.72rem;
}

.dealer-price-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.65rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.dealer-price-line strong {
    color: #a6ff97;
}

.dealer-hangar-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.dealer-hangar-link span {
    color: var(--muted);
    font-size: 0.72rem;
}

@media (max-width: 1050px) {
    .fleet-grid,
    .hangar-transfer-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .mobile-game-nav {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .mobile-game-nav-item b {
        font-size: clamp(0.46rem, 2vw, 0.6rem);
    }

    .fleet-card {
        grid-template-columns: 100px minmax(0, 1fr);
        padding: 0.8rem;
    }

    .fleet-stat-row {
        grid-template-columns: 1fr;
    }

    .fleet-card-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .fleet-card-actions form,
    .fleet-card-actions button {
        width: 100%;
    }

    .hangar-item-card {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .hangar-item-card img {
        width: 52px;
        height: 52px;
    }

    .hangar-item-card form {
        grid-column: 1 / -1;
    }

    .hangar-item-card button {
        width: 100%;
    }
}

.location-settlement-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    color: #bcd1ff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.location-settlement-line span {
    width: 2.8rem;
    height: 0.22rem;
    border-radius: 999px;
    background: #0052ff;
    box-shadow: 0 0 12px rgba(0, 82, 255, 0.75);
    flex: 0 0 auto;
}

.game-nav-item.locked,
.mobile-game-nav-item.locked {
    position: relative;
    cursor: help;
    opacity: 0.58;
}

.game-nav-item.locked::after,
.mobile-game-nav-item.locked::after {
    content: attr(data-locked-message);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.7rem);
    width: max-content;
    max-width: min(280px, 80vw);
    transform: translate(-50%, 6px);
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(116, 182, 255, 0.32);
    border-radius: 10px;
    background: rgba(7, 12, 25, 0.98);
    color: #dceaff;
    font-size: 0.76rem;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
    z-index: 1200;
}

.game-nav-item.locked:hover::after,
.game-nav-item.locked:focus-visible::after,
.mobile-game-nav-item.locked:hover::after,
.mobile-game-nav-item.locked:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.themed-action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 5, 14, 0.78);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.themed-action-backdrop.is-visible {
    opacity: 1;
}

.themed-action-dialog {
    width: min(520px, 100%);
    border: 1px solid rgba(112, 223, 255, 0.34);
    border-radius: 22px;
    padding: 1.35rem;
    background:
        linear-gradient(145deg, rgba(20, 34, 58, 0.98), rgba(7, 12, 24, 0.99));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(136, 236, 255, 0.05);
    transform: translateY(12px) scale(0.985);
    transition: transform 180ms ease;
}

.themed-action-backdrop.is-visible .themed-action-dialog {
    transform: translateY(0) scale(1);
}

.themed-action-dialog.danger {
    border-color: rgba(255, 91, 91, 0.46);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 0 36px rgba(138, 24, 24, 0.12);
}

.themed-action-dialog h2 {
    margin: 0.35rem 0 0.75rem;
}

.themed-action-dialog p {
    margin: 0;
    color: #c5d2e5;
    line-height: 1.65;
}

.themed-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.themed-action-dialog.danger [data-themed-action-confirm],
.danger-button {
    border-color: rgba(255, 100, 100, 0.45);
    color: #ffd4d4;
}

.fleet-card.workshop-selected {
    border-color: rgba(79, 187, 255, 0.55);
    box-shadow: inset 0 0 0 1px rgba(79, 187, 255, 0.14), 0 0 24px rgba(0, 82, 255, 0.12);
}

.active-workshop-link {
    border-color: rgba(79, 187, 255, 0.46) !important;
    color: #b9ddff !important;
}

.workshop-ship-readout {
    min-width: 220px;
    display: grid;
    gap: 0.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(116, 182, 255, 0.2);
    border-radius: 14px;
    background: rgba(12, 24, 46, 0.72);
    text-align: right;
}

.workshop-ship-readout span,
.workshop-ship-readout small {
    color: #7896b8;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workshop-ship-readout strong {
    color: #d9efff;
}

@media (max-width: 720px) {
    .game-nav-item.locked::after,
    .mobile-game-nav-item.locked::after {
        display: none;
    }

    .themed-action-buttons {
        flex-direction: column-reverse;
    }

    .themed-action-buttons .primary-button,
    .themed-action-buttons .ghost-button {
        width: 100%;
    }

    .workshop-ship-readout {
        width: 100%;
        min-width: 0;
        text-align: left;
    }
}

/* LVP 1.9 click hotfix: inactive themed dialogs must never intercept the page. */
.themed-action-backdrop[hidden] {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.themed-action-backdrop:not(.is-visible) {
    visibility: hidden;
    pointer-events: none;
}

.themed-action-backdrop.is-visible {
    visibility: visible;
    pointer-events: auto;
}

/* LVP 1.10 location expansion cleanup */
.location-card-topline {
    align-items: flex-start;
}

.location-classification-stack {
    display: grid;
    gap: 0.35rem;
    justify-items: start;
}

.location-card-topline .location-classification {
    display: block;
    color: var(--muted);
    border-left: 2px solid var(--violet);
}

.location-card-topline .settlement-classification {
    color: #bcd1ff;
    border-left-color: #0052ff;
    box-shadow: inset 2px 0 0 rgba(0, 82, 255, 0.15);
}

.cargo-summary-capsule {
    min-width: 175px;
    padding: 0.55rem 0.85rem;
    border-radius: 0;
    border-color: rgba(126, 255, 183, 0.18);
    background: rgba(6, 17, 24, 0.8);
}

.cargo-summary-capsule span {
    color: var(--muted-2);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}

.cargo-summary-capsule strong {
    margin-top: 0.2rem;
    color: #9dffc0;
    font-size: 1.05rem;
}

.travel-emergency-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.7rem;
    align-items: stretch;
}

.travel-emergency-actions form,
.travel-emergency-actions .location-button {
    width: 100%;
    height: 100%;
}

.location-button.tow-button {
    border-color: rgba(255, 190, 92, 0.55);
    background: rgba(95, 56, 12, 0.7);
    color: #ffe1a3;
    font-size: 0.76rem;
    line-height: 1.25;
}

.location-button.tow-button:hover {
    background: rgba(132, 76, 14, 0.86);
    border-color: rgba(255, 210, 122, 0.8);
}

.npc-dialogue-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.dialogue-response-panel {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(80, 168, 255, 0.25);
    border-left: 4px solid #0052ff;
    border-radius: 14px;
    background: rgba(9, 19, 38, 0.78);
}

.dialogue-response-panel > strong {
    display: block;
    margin-bottom: 0.65rem;
    color: #9fc7ff;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
}

.dialogue-response-panel p {
    margin: 0.55rem 0 0;
}

.permit-requirement-grid,
.permit-access-card,
.mining-yield-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.9rem;
}

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

.permit-requirement-grid span,
.permit-access-card > div,
.mining-yield-grid > div {
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem;
    border: 1px solid rgba(126, 164, 205, 0.16);
    border-radius: 12px;
    background: rgba(7, 13, 25, 0.72);
    color: #7fa4c7;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.permit-requirement-grid strong,
.permit-access-card strong,
.mining-yield-grid strong {
    color: #e8f2ff;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.permit-access-card.qualified {
    border-color: rgba(160, 255, 148, 0.25);
}

.key-items-details {
    margin-top: 1rem;
    border: 1px solid rgba(111, 158, 205, 0.16);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(8, 14, 25, 0.74);
}

.key-items-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.key-items-details > summary::-webkit-details-marker {
    display: none;
}

.key-items-details > summary > span:first-child {
    display: grid;
    gap: 0.15rem;
}

.key-items-details > summary small {
    color: #6489ad;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
}

.key-items-details > summary strong {
    font-size: 0.9rem;
}

.key-items-content {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 260ms ease, opacity 220ms ease;
}

.key-items-content > p,
.key-items-content > ul {
    margin: 0;
    padding: 0.15rem 0.9rem 0.9rem;
}

.key-items-content ul {
    list-style: none;
    display: grid;
    gap: 0.65rem;
}

.key-items-content li {
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem;
    border-radius: 10px;
    background: rgba(15, 26, 45, 0.7);
}

.key-items-content li strong {
    color: #d7e9ff;
    font-size: 0.82rem;
}

.key-items-content li span {
    color: #86a0ba;
    font-size: 0.74rem;
    line-height: 1.45;
}

.mining-modal-card {
    max-width: 780px;
}

.mining-yield-grid {
    margin: 1rem 0;
}

.mining-yield-grid > div {
    text-align: center;
}

.mining-yield-grid strong {
    color: #ffe29a;
    font-size: 1.35rem;
}

@media (max-width: 720px) {
    .travel-emergency-actions,
    .permit-requirement-grid,
    .permit-access-card,
    .mining-yield-grid {
        grid-template-columns: 1fr;
    }

    .npc-dialogue-options {
        display: grid;
    }
}

.refueling-service-panel {
    display: grid;
    grid-template-columns: minmax(92px, 0.22fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: stretch;
    padding: 1rem;
    border: 1px solid rgba(80, 180, 255, 0.18);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(8, 18, 34, 0.96), rgba(12, 26, 46, 0.8));
}

.refueling-service-icon {
    position: relative;
    min-height: 180px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(83, 201, 255, 0.2);
    background:
        linear-gradient(160deg, transparent 45%, rgba(56, 173, 255, 0.18) 46%, transparent 49%),
        radial-gradient(circle at 50% 42%, rgba(117, 231, 255, 0.3), transparent 34%),
        linear-gradient(180deg, rgba(18, 52, 82, 0.95), rgba(6, 13, 25, 0.98));
}

.refueling-service-icon::before,
.refueling-service-icon::after,
.refueling-service-icon span {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid rgba(143, 235, 255, 0.78);
    box-shadow: 0 0 18px rgba(44, 191, 255, 0.24);
}

.refueling-service-icon::before {
    top: 27px;
    width: 58px;
    height: 82px;
    border-radius: 13px 13px 8px 8px;
}

.refueling-service-icon::after {
    top: 48px;
    width: 31px;
    height: 31px;
    border-radius: 50%;
}

.refueling-service-icon span {
    top: 119px;
    width: 82px;
    height: 12px;
    border-radius: 999px;
    background: rgba(111, 228, 255, 0.13);
}

.refueling-service-copy {
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.refueling-service-copy h3,
.refueling-service-copy p {
    margin: 0;
}

.refueling-service-copy p strong {
    color: #a8efff;
}

.refueling-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.refueling-metrics > div {
    display: grid;
    gap: 0.24rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(118, 196, 255, 0.12);
    border-radius: 12px;
    background: rgba(6, 13, 25, 0.62);
}

.refueling-metrics span {
    color: #7798b8;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.refueling-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.refueling-actions form {
    margin: 0;
}

@media (max-width: 720px) {
    .refueling-service-panel {
        grid-template-columns: 1fr;
    }

    .refueling-service-icon {
        min-height: 125px;
    }

    .refueling-service-icon::before {
        top: 18px;
        height: 58px;
    }

    .refueling-service-icon::after {
        top: 33px;
    }

    .refueling-service-icon span {
        top: 86px;
    }

    .refueling-metrics {
        grid-template-columns: 1fr;
    }

    .refueling-actions,
    .refueling-actions form,
    .refueling-actions button {
        width: 100%;
    }
}

/* LVP 1.15 repair, audio, and combat presentation */
.sound-toggle-button {
    min-width: 110px;
    white-space: nowrap;
}
.sound-toggle-button.is-muted {
    opacity: 0.78;
}

.repair-service-panel,
.refueling-service-panel {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 1.2rem;
    align-items: stretch;
}
.repair-service-image,
.refueling-service-image {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(120, 175, 255, 0.22);
    background: rgba(5, 12, 26, 0.72);
}
.repair-service-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.repair-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.repair-actions {
    flex-wrap: wrap;
}

.combat-modal-card {
    border: 1px solid rgba(103, 149, 255, 0.34);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(152, 200, 255, 0.08);
    background: linear-gradient(180deg, rgba(8, 14, 31, 0.97), rgba(5, 10, 24, 0.98));
    overflow: hidden;
}
.combat-modal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(133, 187, 255, 0.08);
    border-radius: inherit;
}
.combat-stage-backdrop {
    background-image: linear-gradient(180deg, rgba(4, 8, 20, 0.42), rgba(4, 8, 20, 0.78)), var(--combat-backdrop-image);
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    border: 1px solid rgba(110, 160, 255, 0.2);
    padding: 1rem;
    margin-bottom: 1rem;
}
.cinematic-combat-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.cinematic-panel {
    background: rgba(7, 14, 29, 0.82);
    border: 1px solid rgba(110, 160, 255, 0.22);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.combat-ship-visual {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0.35rem auto 0.75rem;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}
.enemy-ship-visual {
    transform: scaleX(-1);
}
.combat-action-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.combat-action-form {
    margin: 0;
}
.combat-action-button {
    width: 100%;
    min-height: 86px;
    border-radius: 16px;
    border: 1px solid rgba(100, 169, 255, 0.24);
    background: linear-gradient(180deg, rgba(11, 25, 55, 0.98), rgba(8, 16, 36, 0.98));
    color: #edf6ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(163, 212, 255, 0.05), 0 12px 24px rgba(2, 7, 20, 0.42);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.combat-action-button small {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: rgba(226, 239, 255, 0.86);
}
.combat-action-button:hover,
.combat-action-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(136, 196, 255, 0.52);
    box-shadow: 0 0 0 1px rgba(136, 196, 255, 0.1), 0 18px 30px rgba(1, 7, 22, 0.48), inset 0 0 16px rgba(71, 148, 255, 0.16);
}
.combat-action-button:active,
.combat-action-button.combat-action-fired {
    transform: translateY(2px) scale(0.992);
    background: linear-gradient(180deg, rgba(20, 54, 110, 0.98), rgba(12, 24, 52, 0.98));
    box-shadow: inset 0 0 18px rgba(86, 175, 255, 0.22);
}
.combat-primary-action {
    border-color: rgba(255, 113, 113, 0.32);
    background: linear-gradient(180deg, rgba(65, 16, 25, 0.98), rgba(22, 10, 18, 0.98));
}
.combat-primary-action:hover,
.combat-primary-action:focus-visible {
    border-color: rgba(255, 145, 145, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 158, 158, 0.08), 0 18px 30px rgba(1, 7, 22, 0.48), inset 0 0 16px rgba(255, 90, 90, 0.18);
}
.enhanced-combat-log {
    border-radius: 18px;
    border: 1px solid rgba(118, 172, 255, 0.22);
    background: linear-gradient(180deg, rgba(6, 13, 27, 0.96), rgba(4, 9, 21, 0.98));
    padding: 0.9rem 1rem;
    box-shadow: inset 0 0 0 1px rgba(146, 198, 255, 0.04);
}
.combat-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.55rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid rgba(93, 144, 218, 0.18);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    color: rgba(183, 210, 255, 0.8);
}
.combat-log p {
    margin: 0.45rem 0;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.combat-log-success { border-left: 3px solid rgba(108, 236, 157, 0.95); }
.combat-log-warning { border-left: 3px solid rgba(250, 214, 93, 0.95); }
.combat-log-danger { border-left: 3px solid rgba(255, 111, 111, 0.95); }
.combat-log-info { border-left: 3px solid rgba(109, 176, 255, 0.95); }

@media (max-width: 840px) {
    .repair-service-panel,
    .refueling-service-panel,
    .cinematic-combat-board,
    .combat-action-grid-enhanced,
    .repair-metrics {
        grid-template-columns: 1fr;
    }
    .combat-ship-visual {
        max-width: 100%;
        height: 120px;
    }
}

/* LVP 1.16 combat encounter accessibility cleanup */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sound-toggle-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    position: relative;
}
.sound-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sound-icon path:first-child {
    fill: currentColor;
    stroke: currentColor;
}
.sound-icon-off {
    display: none;
}
.sound-toggle-button.is-muted .sound-icon-on {
    display: none;
}
.sound-toggle-button.is-muted .sound-icon-off {
    display: block;
}

.location-card-topline .repair-classification {
    color: #ffb4d9;
    border-left-color: #ff4fa3;
    box-shadow: inset 2px 0 0 rgba(255, 79, 163, 0.14);
}
.location-card-topline .refueling-classification {
    color: #ffe58a;
    border-left-color: #f0c93b;
    box-shadow: inset 2px 0 0 rgba(240, 201, 59, 0.14);
}

#outlaw-hunt-modal,
#combat-mission-modal {
    overflow-y: auto;
    align-items: start;
    justify-items: center;
}
.encounter-modal,
.combat-modal-card {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#outlaw-hunt-modal .outlaw-hunt-scene-image {
    height: clamp(130px, 21vh, 205px);
    object-fit: cover;
    object-position: center;
}

@media (min-width: 900px) {
    #outlaw-hunt-modal .combat-modal-card {
        max-height: calc(100vh - 2rem);
    }
}

/* LVP 1.16 combat telemetry cleanup */
[data-combat-stat] {
    display: inline-block;
    min-width: 1.4ch;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.combat-stat-flash-down {
    animation: combatStatFlashDown 1.15s ease-in-out 1;
}

.combat-stat-flash-up {
    animation: combatStatFlashUp 1.15s ease-in-out 1;
}

@keyframes combatStatFlashDown {
    0% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
    25% {
        color: #ff8a8a;
        text-shadow: 0 0 12px rgba(255, 98, 98, 0.78), 0 0 30px rgba(255, 44, 85, 0.38);
        transform: translateY(-1px);
    }
    60% {
        color: #ff3f64;
        text-shadow: 0 0 16px rgba(255, 63, 100, 0.82), 0 0 36px rgba(255, 63, 100, 0.38);
        transform: translateY(0);
    }
    100% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
}

@keyframes combatStatFlashUp {
    0% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
    25% {
        color: #91ffb5;
        text-shadow: 0 0 12px rgba(74, 255, 142, 0.78), 0 0 30px rgba(33, 220, 111, 0.35);
        transform: translateY(-1px);
    }
    60% {
        color: #42ef83;
        text-shadow: 0 0 16px rgba(66, 239, 131, 0.82), 0 0 36px rgba(66, 239, 131, 0.36);
        transform: translateY(0);
    }
    100% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
}

.combat-log-latest:empty::before {
    content: 'No telemetry has been recorded for this turn.';
    display: block;
    padding: 0.6rem 0.7rem;
    color: rgba(196, 214, 240, 0.7);
    font-size: 0.82rem;
}

.combat-log-history {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(93, 144, 218, 0.18);
    padding-top: 0.65rem;
}

.combat-log-history > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid rgba(112, 172, 255, 0.22);
    border-radius: 11px;
    background: rgba(14, 29, 55, 0.7);
    color: #bcdcff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.combat-log-history > summary::-webkit-details-marker {
    display: none;
}

.combat-log-history > summary:hover,
.combat-log-history > summary:focus-visible {
    border-color: rgba(126, 192, 255, 0.5);
    background: rgba(20, 43, 79, 0.86);
    color: #e7f4ff;
}

.combat-log-history[open] > summary {
    margin-bottom: 0.65rem;
}

.combat-log-history-list {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.combat-reward-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.combat-reward-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(111, 165, 241, 0.18);
    border-radius: 13px;
    background: rgba(9, 20, 42, 0.72);
}

.combat-reward-grid > div > span {
    color: rgba(190, 209, 235, 0.76);
    font-size: 0.7rem;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.combat-reward-grid > div > strong {
    display: block;
    color: #72c5ff;
    font-size: 1rem;
    line-height: 1.3;
    text-shadow: 0 0 12px rgba(74, 169, 255, 0.2);
}

.combat-reward-grid > div > strong.item-rarity-uncommon {
    color: #62e899;
    text-shadow: 0 0 12px rgba(60, 218, 121, 0.2);
}

/* LVP 1.16 ship information and rarity cleanup */
.item-rarity-uncommon,
[data-item-rarity="uncommon"] .cargo-item-name,
[data-item-rarity="uncommon"] .item-name,
[data-rarity="uncommon"] .item-name {
    color: #62e899 !important;
    text-shadow: 0 0 12px rgba(60, 218, 121, 0.22);
}

.dealer-ship-copy {
    min-width: 0;
}

.dealer-ship-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
    margin: 0.8rem 0;
}

.dealer-ship-stat-grid span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.42rem 0.5rem;
    border: 1px solid rgba(110, 168, 224, 0.16);
    border-radius: 9px;
    background: rgba(3, 10, 22, 0.58);
    color: var(--muted);
    font-size: 0.64rem;
    letter-spacing: 0.025em;
}

.dealer-ship-stat-grid b {
    color: var(--text);
    font-size: 0.74rem;
}

.fleet-stat-row-complete {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .dealer-ship-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* LVP 1.17 merged Settlement Hangar and Clan interface */
.settlement-hub-window {
    display: grid;
    gap: 1rem;
}

.settlement-module-details {
    overflow: hidden;
    border: 1px solid rgba(96, 140, 190, 0.2);
    background: rgba(8, 13, 25, 0.91);
    box-shadow: var(--shadow);
}

.settlement-module-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 86px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    background: linear-gradient(90deg, rgba(13, 28, 49, 0.96), rgba(8, 15, 28, 0.94));
    transition: background 180ms ease, border-color 180ms ease;
}

.settlement-module-summary::-webkit-details-marker {
    display: none;
}

.settlement-module-summary > span:first-child {
    display: grid;
    gap: 0.22rem;
}

.settlement-module-summary strong {
    color: var(--text);
    font-size: 1.12rem;
}

.settlement-module-summary small {
    color: var(--muted);
}

.settlement-module-details[open] > .settlement-module-summary,
.settlement-module-summary:hover,
.settlement-module-summary:focus-visible {
    background: linear-gradient(90deg, rgba(19, 41, 70, 0.98), rgba(9, 19, 35, 0.96));
}

.settlement-module-content {
    overflow: hidden;
}

.settlement-module-content > section {
    margin: 0;
    border: 0;
    box-shadow: none;
}

.settlement-clan-header {
    margin-top: 0.35rem;
}

.settlement-personnel-details {
    margin-bottom: 0.25rem;
}

@media (max-width: 720px) {
    .settlement-module-summary {
        min-height: 76px;
        padding: 0.9rem 0.95rem;
    }

    .settlement-module-summary strong {
        font-size: 1rem;
    }

    .settlement-module-summary small {
        font-size: 0.72rem;
    }
}

/* LVP 1.18 Dossier, compact Clan disciplines, and universal shop sales */
.dossier-window {
    display: grid;
    gap: 1.15rem;
}

.dossier-summary-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
    gap: 1rem;
    align-items: stretch;
}

.dossier-command-panel,
.level-progression-panel {
    min-width: 0;
    border: 1px solid var(--line);
    background: rgba(8, 13, 25, 0.93);
    box-shadow: var(--shadow);
}

.dossier-command-panel {
    padding: clamp(1rem, 2.4vw, 1.6rem);
}

.level-progression-panel {
    padding: clamp(1rem, 2.4vw, 1.6rem);
    background:
        radial-gradient(circle at 85% 12%, rgba(83, 220, 255, 0.1), transparent 30%),
        rgba(8, 13, 25, 0.93);
}

.progression-heading-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.9rem 0 1rem;
}

.progression-heading-row span,
.level-xp-readout span,
.milestone-entry > span {
    color: var(--muted-2);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.progression-heading-row h2 {
    margin: 0.25rem 0 0;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.progression-heading-row > strong {
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(83, 220, 255, 0.32);
    color: var(--cyan);
    background: rgba(83, 220, 255, 0.07);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.level-xp-readout {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(83, 220, 255, 0.14);
    background: rgba(3, 8, 18, 0.58);
}

.level-xp-readout > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.level-xp-readout strong {
    color: var(--cyan);
}

.level-xp-meter {
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(83, 220, 255, 0.18);
    background: rgba(255, 255, 255, 0.035);
}

.level-xp-meter i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(58, 153, 255, 0.88), rgba(83, 220, 255, 0.96));
    box-shadow: 0 0 14px rgba(83, 220, 255, 0.34);
}

.milestone-list {
    display: grid;
    gap: 0.65rem;
}

.milestone-entry {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border: 1px solid rgba(96, 140, 190, 0.18);
    background: rgba(5, 10, 21, 0.7);
}

.milestone-entry h3 {
    margin: 0 0 0.22rem;
    font-size: 0.94rem;
}

.milestone-entry p {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.milestone-entry > strong {
    color: var(--muted-2);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-align: right;
}

.milestone-entry.reached {
    border-color: rgba(116, 247, 180, 0.28);
    background: rgba(35, 92, 70, 0.09);
}

.milestone-entry.reached > strong {
    color: var(--green);
}

.dossier-contract-header {
    margin-top: 0.1rem;
}

.dossier-contract-list {
    margin-top: 0;
}

.crew-discipline-compact {
    display: grid;
    gap: 0.7rem;
    margin: 0.15rem 0 1rem;
    padding: 0.8rem;
    border: 1px solid rgba(83, 220, 255, 0.13);
    background: rgba(3, 8, 18, 0.5);
}

.crew-discipline-compact-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.crew-discipline-compact-heading span {
    color: var(--cyan);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.crew-discipline-compact-heading strong {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.crew-discipline-compact-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.crew-discipline-compact-list > div {
    display: grid;
    gap: 0.18rem;
    padding: 0.55rem 0.65rem;
    border-left: 2px solid rgba(83, 220, 255, 0.46);
    background: rgba(255, 255, 255, 0.025);
}

.crew-discipline-compact-list span {
    color: var(--muted-2);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.crew-discipline-compact-list strong {
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1.3;
}

.merchant-buy-only-item {
    border-color: rgba(126, 145, 169, 0.18);
}

.merchant-buy-only-item .store-price-row span:first-child strong {
    color: var(--muted-2);
    font-size: 0.62rem;
}

.merchant-buy-only-item .primary-button:disabled {
    opacity: 0.45;
}

@media (max-width: 980px) {
    .dossier-summary-grid {
        grid-template-columns: 1fr;
    }

    .crew-discipline-compact-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .milestone-entry {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .milestone-entry > strong {
        text-align: left;
    }

    .crew-discipline-compact-heading {
        align-items: start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .crew-discipline-compact-list {
        grid-template-columns: 1fr;
    }
}

/* LVP 1.18 Hangar and Dossier cleanup */
.dossier-contracts-details {
    margin-top: 0.1rem;
}

.dossier-contracts-details > summary {
    cursor: pointer;
    list-style: none;
}

.dossier-contracts-details > summary::-webkit-details-marker {
    display: none;
}

.dossier-contracts-details > summary .interaction-toggle {
    align-self: center;
    flex: 0 0 auto;
}

.dossier-contracts-details[open] > summary .interaction-toggle {
    color: var(--cyan);
}

.dossier-contract-content {
    padding-top: 1rem;
}

/* LVP 1.19 seamless tab navigation */
.ship-screen-shell {
    position: relative;
}

.game-view-region {
    min-width: 0;
    transition: opacity 150ms ease, transform 150ms ease, filter 150ms ease;
}

.ship-screen-shell.is-view-loading [data-game-view-region] {
    opacity: 0.38;
    transform: translateY(4px);
    filter: saturate(0.72);
    pointer-events: none;
}

.ship-screen-shell.is-view-loading [data-game-nav-region] {
    pointer-events: none;
}

.ship-screen-shell.is-view-loading::after {
    content: "LOADING DATA";
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 180;
    border: 1px solid rgba(83, 220, 255, 0.45);
    padding: 0.55rem 0.75rem;
    color: var(--cyan-hot);
    background: rgba(5, 8, 17, 0.94);
    box-shadow: 0 0 22px rgba(83, 220, 255, 0.16);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.game-view-region.is-view-entering {
    animation: seamless-view-enter 180ms ease both;
}

@keyframes seamless-view-enter {
    from {
        opacity: 0.35;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-view-region,
    .game-view-region.is-view-entering {
        transition: none;
        animation: none;
    }
}


/* LVP 1.19 seamless station actions */
form.is-seamless-submitting {
    position: relative;
}

form.is-seamless-submitting button[type="submit"],
form.is-seamless-submitting input[type="submit"] {
    cursor: progress;
    opacity: 0.68;
    filter: saturate(0.72);
}

form.is-seamless-submitting button[type="submit"]::after {
    content: "";
    width: 0.72rem;
    height: 0.72rem;
    margin-left: 0.55rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: seamless-action-spin 650ms linear infinite;
}

.ship-screen-shell.is-action-refreshing [data-game-view-region] {
    opacity: 0.78;
    filter: saturate(0.86);
    pointer-events: none;
}

.ship-screen-shell.is-action-refreshing [data-game-nav-region] {
    pointer-events: none;
}

@keyframes seamless-action-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    form.is-seamless-submitting button[type="submit"]::after {
        animation: none;
    }
}

/* LVP 1.19 seamless encounters, missions, and mining */
.modal-backdrop.is-encounter-refreshing .encounter-modal,
.modal-backdrop.is-encounter-refreshing .mission-modal-card,
[data-game-view-region].is-encounter-refreshing {
    cursor: progress;
    filter: saturate(0.82);
}

.modal-backdrop.is-encounter-refreshing .encounter-modal,
.modal-backdrop.is-encounter-refreshing .mission-modal-card {
    pointer-events: none;
}

.modal-backdrop.is-encounter-refreshing .combat-action-button,
.modal-backdrop.is-encounter-refreshing button[type="submit"],
[data-game-view-region].is-encounter-refreshing button[type="submit"] {
    opacity: 0.66;
}

.modal-backdrop.is-encounter-refreshing .combat-action-button.combat-action-fired {
    opacity: 1;
}

/* LVP 1.19 seamless travel, orbit, docking, and towing */
.ship-screen-shell.is-travel-transitioning {
    position: relative;
}

.ship-screen-shell.is-travel-transitioning [data-game-nav-region],
.ship-screen-shell.is-travel-transitioning [data-game-view-region] {
    pointer-events: none;
}

.ship-screen-shell.is-travel-transitioning [data-game-view-region] {
    opacity: 0.42;
    transform: scale(0.995);
    filter: blur(1px) saturate(0.72);
}

.ship-screen-shell.is-travel-transitioning::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 174;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, transparent 0 9vw, rgba(83, 220, 255, 0.07) 9.1vw 9.25vw, transparent 9.35vw 18vw),
        radial-gradient(circle at center, rgba(83, 220, 255, 0.12), transparent 34rem),
        rgba(3, 6, 14, 0.72);
    backdrop-filter: blur(3px);
    animation: seamless-transit-field 900ms linear infinite;
}

.ship-screen-shell.is-travel-transitioning::after {
    content: attr(data-travel-status);
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 175;
    min-width: min(320px, calc(100vw - 2rem));
    transform: translate(-50%, -50%);
    border: 1px solid rgba(83, 220, 255, 0.62);
    padding: 1rem 1.25rem;
    color: var(--cyan-hot);
    background: rgba(5, 10, 22, 0.95);
    box-shadow: 0 0 0 1px rgba(165, 107, 255, 0.18), 0 0 45px rgba(83, 220, 255, 0.22);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

form[data-seamless-travel-action].is-seamless-submitting .location-button {
    cursor: progress;
}

@keyframes seamless-transit-field {
    from { background-position: 0 0, center, center; }
    to { background-position: 18vw 0, center, center; }
}

@media (prefers-reduced-motion: reduce) {
    .ship-screen-shell.is-travel-transitioning::before {
        animation: none;
    }
}


/* LVP 1.19 seamless audit and header-control alignment */
.header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    white-space: nowrap;
}

.header-signout-form {
    margin: 0;
}

@media (max-width: 720px) {
    .header-primary-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .header-actions {
        gap: 0.45rem;
    }
}

/* LVP 1.20 cinematic battle presentation */
.combat-cinematic-layer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow: hidden;
    pointer-events: auto;
    background:
        radial-gradient(circle at center, rgba(21, 48, 88, 0.32), transparent 42%),
        rgba(2, 5, 14, 0.78);
    backdrop-filter: blur(5px) saturate(0.82);
    opacity: 0;
    transition: opacity 180ms ease;
}

.combat-cinematic-layer.is-visible {
    opacity: 1;
}

.combat-cinematic-layer.is-leaving {
    opacity: 0;
}

.combat-cinematic-arena {
    position: relative;
    width: min(920px, 96vw);
    height: min(480px, 74vh);
    min-height: 330px;
    border: 1px solid rgba(108, 181, 255, 0.22);
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(52, 119, 194, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(7, 15, 33, 0.86), rgba(2, 7, 18, 0.94));
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.66),
        inset 0 0 0 1px rgba(153, 211, 255, 0.04),
        inset 0 0 80px rgba(53, 132, 220, 0.08);
    isolation: isolate;
}

.combat-cinematic-arena::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.34;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.5px),
        radial-gradient(circle at 74% 26%, rgba(137, 203, 255, 0.68) 0 1px, transparent 1.5px),
        radial-gradient(circle at 38% 72%, rgba(255, 255, 255, 0.56) 0 1px, transparent 1.5px),
        radial-gradient(circle at 88% 78%, rgba(179, 126, 255, 0.58) 0 1px, transparent 1.5px);
    background-size: 170px 130px, 210px 180px, 150px 160px, 240px 190px;
}

.combat-cinematic-arena.combat-critical-impact::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: combatCinematicCriticalFlash 620ms ease-out both;
}

.combat-cinematic-ship {
    position: absolute;
    top: 50%;
    width: min(32%, 270px);
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    transform: translateY(-50%);
    will-change: transform, filter;
}

.combat-cinematic-player {
    left: 3.5%;
}

.combat-cinematic-enemy {
    right: 3.5%;
}

.combat-cinematic-ship img {
    width: 100%;
    height: clamp(105px, 23vh, 190px);
    object-fit: contain;
    filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.62));
}

.combat-cinematic-ship strong {
    max-width: 100%;
    padding: 0.42rem 0.72rem;
    border: 1px solid rgba(124, 187, 255, 0.24);
    border-radius: 999px;
    overflow: hidden;
    color: #dceeff;
    background: rgba(5, 14, 31, 0.82);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.combat-cinematic-enemy strong {
    border-color: rgba(255, 112, 128, 0.28);
    color: #ffd6dc;
}

.combat-cinematic-callout-stack {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: min(440px, 54%);
    max-height: 78%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.combat-cinematic-callout {
    position: relative;
    width: 100%;
    min-height: 82px;
    max-height: 180px;
    display: grid;
    align-content: center;
    gap: 0.38rem;
    padding: 0.85rem 1.05rem;
    border: 1px solid rgba(116, 192, 255, 0.38);
    border-radius: 16px;
    color: #f1f8ff;
    background:
        linear-gradient(135deg, rgba(15, 37, 70, 0.98), rgba(5, 14, 31, 0.98));
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.52),
        inset 0 0 24px rgba(83, 171, 255, 0.08);
    text-align: center;
    transform: translateY(-18px) scale(0.97);
    opacity: 0;
    transition:
        opacity 260ms ease,
        transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1),
        max-height 620ms ease,
        min-height 620ms ease,
        margin 620ms ease,
        padding 620ms ease,
        border-width 620ms ease;
}

.combat-cinematic-callout > span {
    color: rgba(177, 211, 244, 0.78);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.combat-cinematic-callout > strong {
    font-size: clamp(0.88rem, 1.8vw, 1.16rem);
    line-height: 1.35;
    letter-spacing: 0.035em;
}

.combat-cinematic-callout.is-showing {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.combat-cinematic-callout.is-expiring {
    max-height: 0;
    min-height: 0;
    margin: -0.3rem 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow: hidden;
    transform: translateY(18px) scale(0.96);
    opacity: 0;
}

.combat-cinematic-callout.tone-success {
    border-color: rgba(91, 241, 158, 0.56);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55), inset 0 0 28px rgba(67, 226, 135, 0.12);
}

.combat-cinematic-callout.tone-danger {
    border-color: rgba(255, 91, 118, 0.62);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55), inset 0 0 28px rgba(255, 63, 100, 0.14);
}

.combat-cinematic-callout.tone-warning,
.combat-cinematic-callout.tone-shield {
    border-color: rgba(246, 207, 86, 0.62);
}

.combat-cinematic-callout.tone-critical {
    border-color: rgba(255, 79, 179, 0.72);
    color: #fff1fa;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.58), inset 0 0 34px rgba(255, 79, 179, 0.18), 0 0 36px rgba(255, 79, 179, 0.16);
}

.combat-cinematic-callout.tone-evasion {
    border-color: rgba(173, 118, 255, 0.66);
}

.combat-cinematic-callout.tone-hack {
    border-color: rgba(80, 255, 192, 0.58);
    color: #d9fff1;
}

.combat-cinematic-beam {
    position: absolute;
    left: 24%;
    top: 47%;
    z-index: 2;
    width: 52%;
    height: 5px;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, transparent, #9fe8ff 18%, #ffffff 55%, #ff6d8a);
    box-shadow: 0 0 12px rgba(121, 216, 255, 0.95), 0 0 32px rgba(83, 166, 255, 0.58);
}

.combat-cinematic-beam.beam-from-player {
    animation: combatCinematicBeamPlayer 520ms ease-out both;
}

.combat-cinematic-beam.beam-from-enemy {
    transform-origin: right center;
    background: linear-gradient(90deg, #ff6d8a, #ffffff 45%, #ff9d63 82%, transparent);
    animation: combatCinematicBeamEnemy 520ms ease-out both;
}

.combat-cinematic-player.is-attacking {
    animation: combatCinematicPlayerAttack 580ms ease-out both;
}

.combat-cinematic-enemy.is-attacking {
    animation: combatCinematicEnemyAttack 580ms ease-out both;
}

.combat-cinematic-ship.is-hit {
    animation: combatCinematicHit 560ms ease-out both;
}

.combat-cinematic-player.is-evading {
    animation: combatCinematicPlayerEvade 560ms ease-out both;
}

.combat-cinematic-enemy.is-evading {
    animation: combatCinematicEnemyEvade 560ms ease-out both;
}

.combat-cinematic-ship.is-hacking img {
    animation: combatCinematicHack 620ms ease-out both;
}

@keyframes combatCinematicPlayerAttack {
    0% { transform: translateY(-50%) translateX(0) rotate(0deg); }
    34% { transform: translateY(-50%) translateX(44px) rotate(2deg) scale(1.04); }
    100% { transform: translateY(-50%) translateX(0) rotate(0deg); }
}

@keyframes combatCinematicEnemyAttack {
    0% { transform: translateY(-50%) translateX(0) rotate(0deg); }
    34% { transform: translateY(-50%) translateX(-44px) rotate(-2deg) scale(1.04); }
    100% { transform: translateY(-50%) translateX(0) rotate(0deg); }
}

@keyframes combatCinematicHit {
    0% { transform: translateY(-50%) translateX(0); filter: brightness(1); }
    18% { transform: translateY(-50%) translateX(-11px); filter: brightness(2.2) saturate(1.6); }
    36% { transform: translateY(-50%) translateX(10px); filter: brightness(0.72) sepia(0.45) hue-rotate(320deg); }
    54% { transform: translateY(-50%) translateX(-7px); }
    72% { transform: translateY(-50%) translateX(4px); }
    100% { transform: translateY(-50%) translateX(0); filter: brightness(1); }
}

@keyframes combatCinematicPlayerEvade {
    0% { transform: translateY(-50%) translateX(0); opacity: 1; }
    40% { transform: translateY(-72%) translateX(-42px) scale(0.94); opacity: 0.52; }
    100% { transform: translateY(-50%) translateX(0); opacity: 1; }
}

@keyframes combatCinematicEnemyEvade {
    0% { transform: translateY(-50%) translateX(0); opacity: 1; }
    40% { transform: translateY(-28%) translateX(42px) scale(0.94); opacity: 0.52; }
    100% { transform: translateY(-50%) translateX(0); opacity: 1; }
}

@keyframes combatCinematicHack {
    0% { filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.62)); }
    28% { filter: brightness(1.7) hue-rotate(70deg) drop-shadow(0 0 22px rgba(69, 255, 190, 0.86)); }
    55% { filter: brightness(0.8) hue-rotate(145deg) drop-shadow(0 0 34px rgba(83, 220, 255, 0.72)); }
    100% { filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.62)); }
}

@keyframes combatCinematicBeamPlayer {
    0% { opacity: 0; transform: scaleX(0); }
    20%, 62% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

@keyframes combatCinematicBeamEnemy {
    0% { opacity: 0; transform: scaleX(0); }
    20%, 62% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

@keyframes combatCinematicCriticalFlash {
    0% { background: rgba(255, 255, 255, 0); }
    18% { background: rgba(255, 255, 255, 0.74); }
    36% { background: rgba(255, 55, 137, 0.26); }
    100% { background: rgba(255, 255, 255, 0); }
}

@media (max-width: 720px) {
    .combat-cinematic-arena {
        height: min(520px, 78vh);
    }

    .combat-cinematic-ship {
        top: 33%;
        width: 38%;
    }

    .combat-cinematic-player {
        left: 3%;
    }

    .combat-cinematic-enemy {
        right: 3%;
    }

    .combat-cinematic-ship img {
        height: clamp(90px, 18vh, 145px);
    }

    .combat-cinematic-callout-stack {
        top: 67%;
        width: min(88%, 460px);
        max-height: 58%;
        gap: 0.45rem;
    }

    .combat-cinematic-callout {
        min-height: 72px;
        padding: 0.72rem 0.88rem;
    }

    .combat-cinematic-beam {
        left: 28%;
        top: 31%;
        width: 44%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .combat-cinematic-layer,
    .combat-cinematic-callout-stack,
    .combat-cinematic-callout,
    .combat-cinematic-ship,
    .combat-cinematic-ship img,
    .combat-cinematic-beam,
    .combat-cinematic-arena::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}

.combat-cinematic-layer.combat-cinematic-no-ships .combat-cinematic-ship,
.combat-cinematic-layer.combat-cinematic-no-ships .combat-cinematic-beam {
    display: none;
}

.combat-cinematic-layer.combat-cinematic-no-ships .combat-cinematic-callout-stack {
    width: min(520px, 86%);
}

/* LVP 1.17 Patch 1 — combat clarity, retreat, and contextual actions */
.toast-victory {
    border-color: rgba(255, 208, 88, 0.95);
    background:
        linear-gradient(135deg, rgba(75, 50, 6, 0.98), rgba(24, 17, 4, 0.98)),
        rgba(22, 16, 5, 0.98);
    box-shadow:
        0 0 0 1px rgba(255, 221, 128, 0.28) inset,
        0 0 22px rgba(255, 197, 47, 0.82),
        0 0 54px rgba(255, 166, 0, 0.42),
        0 18px 46px rgba(0, 0, 0, 0.58);
    animation: combat-victory-toast-pulse 1.15s ease-in-out infinite alternate;
}

.toast-victory .toast-message {
    color: #ffe39a;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 198, 55, 0.95);
}

@keyframes combat-victory-toast-pulse {
    from {
        box-shadow:
            0 0 0 1px rgba(255, 221, 128, 0.24) inset,
            0 0 18px rgba(255, 197, 47, 0.66),
            0 0 38px rgba(255, 166, 0, 0.3),
            0 18px 46px rgba(0, 0, 0, 0.58);
    }
    to {
        box-shadow:
            0 0 0 1px rgba(255, 235, 170, 0.42) inset,
            0 0 30px rgba(255, 211, 87, 0.95),
            0 0 68px rgba(255, 166, 0, 0.52),
            0 18px 46px rgba(0, 0, 0, 0.58);
    }
}

.combat-victory-heading {
    margin: 0.35rem 0 0.7rem;
    color: #ffd45f;
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 950;
    letter-spacing: 0.12em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(255, 218, 105, 0.95),
        0 0 28px rgba(255, 172, 0, 0.62);
}

.combat-enemy-title,
.combat-log-enemy-name,
.combat-log-damage-value,
.combat-log-failure {
    color: #ff6b72;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(255, 50, 66, 0.42);
}

.combat-retreat-action {
    border-color: rgba(255, 102, 111, 0.62);
    background: linear-gradient(180deg, rgba(82, 18, 27, 0.84), rgba(38, 10, 16, 0.92));
    color: #ffb0b5;
}

.combat-retreat-action:hover,
.combat-retreat-action:focus-visible {
    border-color: rgba(255, 132, 139, 0.96);
    box-shadow: 0 0 22px rgba(255, 64, 82, 0.28);
}

.junkyard-search-spent button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

@media (prefers-reduced-motion: reduce) {
    .toast-victory {
        animation: none;
    }
}

.combat-action-grid-enhanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 840px) {
    .combat-action-grid-enhanced {
        grid-template-columns: 1fr;
    }
}

.combat-cinematic-callout.combat-cinematic-victory {
    border-color: rgba(255, 214, 92, 0.96);
    background: linear-gradient(135deg, rgba(82, 56, 8, 0.98), rgba(34, 22, 4, 0.98));
    box-shadow:
        0 0 0 1px rgba(255, 232, 153, 0.28) inset,
        0 0 26px rgba(255, 201, 62, 0.8),
        0 0 58px rgba(255, 158, 0, 0.38);
}

.combat-cinematic-callout.combat-cinematic-victory > span,
.combat-cinematic-callout.combat-cinematic-victory > strong {
    color: #ffe49a;
    text-shadow: 0 0 12px rgba(255, 200, 55, 0.94);
}

/* Patch 2 — Meridian Spire, stellar map, and voidlane encounters */
.stellar-map-shell {
    margin: clamp(1rem, 2.6vw, 1.8rem) clamp(1rem, 2.6vw, 1.8rem) 0;
    border: 1px solid rgba(88, 221, 255, 0.34);
    background: rgba(4, 12, 25, 0.9);
    box-shadow: inset 0 0 0 1px rgba(116, 238, 255, 0.04), 0 16px 38px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.stellar-map-shell > summary {
    list-style: none;
}

.stellar-map-shell > summary::-webkit-details-marker {
    display: none;
}

.stellar-map-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    min-height: 68px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    background:
        linear-gradient(90deg, rgba(29, 162, 212, 0.14), transparent 48%),
        linear-gradient(180deg, rgba(13, 31, 55, 0.96), rgba(6, 17, 34, 0.98));
    text-transform: uppercase;
}

.stellar-map-toggle:hover,
.stellar-map-toggle:focus-visible {
    background:
        linear-gradient(90deg, rgba(37, 196, 247, 0.22), transparent 58%),
        linear-gradient(180deg, rgba(16, 39, 67, 0.98), rgba(7, 20, 39, 0.98));
}

.stellar-map-toggle-icon {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(87, 226, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(38, 210, 255, 0.24), inset 0 0 12px rgba(38, 210, 255, 0.18);
    position: relative;
}

.stellar-map-toggle-icon::before,
.stellar-map-toggle-icon::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(105, 239, 255, 0.58);
    border-radius: 50%;
}

.stellar-map-toggle-icon::after {
    inset: 15px 4px;
    border-width: 1px 0 0;
    border-radius: 0;
    transform: rotate(-26deg);
}

.stellar-map-toggle strong,
.stellar-map-toggle small {
    display: block;
}

.stellar-map-toggle strong {
    color: #dffaff;
    font-size: 0.92rem;
    letter-spacing: 0.12em;
}

.stellar-map-toggle small,
.stellar-map-toggle-status {
    color: rgba(147, 215, 232, 0.72);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.stellar-map-content {
    border-top: 1px solid rgba(83, 220, 255, 0.2);
}

.stellar-map-display {
    position: relative;
    min-height: 420px;
    padding: 0.7rem;
    overflow: hidden;
    background:
        linear-gradient(rgba(66, 196, 222, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(66, 196, 222, 0.055) 1px, transparent 1px),
        radial-gradient(circle at 43% 44%, rgba(32, 186, 231, 0.14), transparent 42%),
        linear-gradient(180deg, #061525, #030b16);
    background-size: 32px 32px, 32px 32px, auto, auto;
}

.stellar-map-display::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 42%, rgba(1, 8, 18, 0.74) 100%);
}

.stellar-map-scanline {
    position: absolute;
    z-index: 3;
    inset: -18% 0 auto;
    height: 18%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(76, 229, 255, 0.16), transparent);
    animation: stellar-map-scan 5.2s linear infinite;
}

.stellar-map-svg {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    min-height: 360px;
}

.stellar-map-routes line {
    stroke: rgba(98, 221, 244, 0.34);
    stroke-width: 2;
    stroke-dasharray: 7 8;
}

.stellar-map-route-costs text {
    fill: #e2faff;
    font-size: 13px;
    font-weight: 900;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #04111f;
    stroke-width: 5px;
}

.stellar-map-node circle {
    fill: #0d263d;
    stroke: #75edff;
    stroke-width: 2;
}

.stellar-map-node .node-ring {
    fill: none;
    stroke: rgba(91, 224, 248, 0.4);
    stroke-dasharray: 5 5;
}

.stellar-map-node text {
    fill: #dffcff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-anchor: middle;
}

.stellar-map-node .node-subtitle {
    fill: #f5cf72;
    font-size: 9px;
}

.stellar-map-node.is-current circle:first-child {
    fill: #7af1b2;
    stroke: #dbffe9;
}

.stellar-map-node.is-current .node-ring {
    stroke: rgba(122, 241, 178, 0.84);
    animation: stellar-node-pulse 1.8s ease-in-out infinite;
}

.stellar-map-node.meridian-node circle:first-child {
    fill: #342752;
    stroke: #ceb0ff;
}

.stellar-map-node:hover text,
.stellar-map-node:focus text {
    fill: #ffffff;
}

.stellar-map-legend {
    position: relative;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(84, 207, 231, 0.16);
    background: rgba(3, 12, 23, 0.82);
    color: rgba(184, 224, 235, 0.78);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stellar-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.stellar-map-legend i {
    width: 9px;
    height: 9px;
    border: 1px solid #75edff;
    border-radius: 50%;
    background: #0d263d;
}

.stellar-map-legend .legend-current {
    border-color: #d8ffea;
    background: #7af1b2;
}

.stellar-map-legend strong {
    margin-left: auto;
    color: #ffcf78;
}

.stellar-map-shell.is-holo-deploying .stellar-map-display {
    animation: stellar-holo-deploy 0.92s cubic-bezier(0.18, 0.72, 0.2, 1);
}

.stellar-map-shell.is-holo-deploying .stellar-map-svg {
    animation: stellar-holo-flicker 0.92s steps(2, end);
}

@keyframes stellar-map-scan {
    from { transform: translateY(-10%); }
    to { transform: translateY(700%); }
}

@keyframes stellar-node-pulse {
    0%, 100% { opacity: 0.42; transform: scale(0.94); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes stellar-holo-deploy {
    0% { opacity: 0; filter: brightness(2.5) blur(5px); clip-path: inset(48% 0 48% 0); }
    42% { opacity: 0.78; filter: brightness(1.8) blur(1px); clip-path: inset(8% 0 12% 0); }
    58% { opacity: 0.32; filter: brightness(2.2); }
    100% { opacity: 1; filter: none; clip-path: inset(0); }
}

@keyframes stellar-holo-flicker {
    0%, 18%, 42% { opacity: 0.25; }
    9%, 31%, 55%, 100% { opacity: 1; }
}

.meridian-market-section {
    display: grid;
    gap: 1rem;
}

.meridian-market-card {
    position: relative;
    overflow: hidden;
}

.meridian-market-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #7aa9c8;
}

.meridian-market-card.market-low::before {
    background: #6ceaa4;
    box-shadow: 0 0 14px rgba(108, 234, 164, 0.56);
}

.meridian-market-card.market-high::before {
    background: #ff8e78;
    box-shadow: 0 0 14px rgba(255, 106, 83, 0.52);
}

.market-pulse-label {
    justify-self: start;
    padding: 0.28rem 0.45rem;
    border: 1px solid rgba(139, 190, 215, 0.24);
    color: #a9c6d5;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.market-low .market-pulse-label {
    color: #83f2b4;
    border-color: rgba(108, 234, 164, 0.35);
}

.market-high .market-pulse-label {
    color: #ffad9e;
    border-color: rgba(255, 117, 92, 0.35);
}

.merchant-buy-only-item {
    border-style: dashed;
}

.travel-route-chip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px auto 34px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    margin: 0.8rem 0 1rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(97, 199, 255, 0.25);
    background: rgba(4, 15, 31, 0.82);
    color: #dceeff;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.travel-route-chip i {
    height: 1px;
    background: linear-gradient(90deg, transparent, #64d8ff, transparent);
}

.travel-route-chip strong {
    color: #ff7d83;
    text-shadow: 0 0 12px rgba(255, 69, 82, 0.42);
}

.travel-space-combat {
    background-color: #020711;
}

.travel-ambush-modal-card {
    border-color: rgba(85, 191, 255, 0.46);
}

.travel-victory-image {
    border-color: rgba(255, 211, 91, 0.34);
    box-shadow: 0 0 30px rgba(255, 184, 51, 0.14);
}

#travel-ambush-modal {
    overflow-y: auto;
    align-items: start;
    justify-items: center;
}

@media (max-width: 840px) {
    .stellar-map-display {
        min-height: 330px;
        padding: 0.25rem;
    }

    .stellar-map-svg {
        min-height: 290px;
    }

    .stellar-map-legend strong {
        width: 100%;
        margin-left: 0;
    }

    .travel-route-chip {
        grid-template-columns: 1fr;
    }

    .travel-route-chip i {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stellar-map-scanline,
    .stellar-map-node.is-current .node-ring,
    .stellar-map-shell.is-holo-deploying .stellar-map-display,
    .stellar-map-shell.is-holo-deploying .stellar-map-svg {
        animation: none !important;
    }
}

/* Patch 2 cleanup: long-passage interception warning */
.travel-intercept-alert-screen {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 1.5rem;
    background:
        radial-gradient(circle at center, rgba(255, 55, 69, 0.22), transparent 42%),
        linear-gradient(180deg, rgba(8, 3, 9, 0.97), rgba(17, 2, 8, 0.99));
    color: #fff2f3;
    animation: travel-intercept-screen 1.5s ease forwards;
}

.travel-intercept-alert-grid {
    position: absolute;
    inset: -12%;
    background-image:
        linear-gradient(rgba(255, 71, 82, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 71, 82, 0.12) 1px, transparent 1px);
    background-size: 44px 44px;
    transform: perspective(520px) rotateX(62deg) translateY(18%);
    transform-origin: center bottom;
    animation: travel-intercept-grid 620ms linear infinite;
}

.travel-intercept-alert-copy {
    position: relative;
    z-index: 2;
    width: min(720px, 100%);
    padding: clamp(1.4rem, 5vw, 3rem);
    border: 2px solid rgba(255, 77, 88, 0.88);
    background: rgba(22, 3, 9, 0.9);
    box-shadow:
        0 0 0 1px rgba(255, 213, 216, 0.18) inset,
        0 0 42px rgba(255, 42, 58, 0.5),
        0 0 120px rgba(255, 42, 58, 0.22);
    text-align: center;
    text-transform: uppercase;
    animation: travel-intercept-pulse 340ms steps(2, end) infinite;
}

.travel-intercept-alert-copy span,
.travel-intercept-alert-copy p {
    display: block;
    margin: 0;
    color: #ff9ba2;
    font-size: clamp(0.68rem, 2vw, 0.9rem);
    font-weight: 900;
    letter-spacing: 0.22em;
}

.travel-intercept-alert-copy strong {
    display: block;
    margin: 0.55rem 0 0.7rem;
    color: #fff;
    font-size: clamp(2rem, 8vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 8px #ff3545,
        0 0 24px rgba(255, 31, 49, 0.9),
        0 0 48px rgba(255, 31, 49, 0.65);
}

.travel-intercept-alert-scan {
    position: absolute;
    inset: -20% 0 auto;
    height: 28%;
    z-index: 3;
    background: linear-gradient(180deg, transparent, rgba(255, 92, 102, 0.26), transparent);
    mix-blend-mode: screen;
    animation: travel-intercept-scan 720ms linear infinite;
}

.travel-intercept-alert-screen.is-clearing {
    opacity: 0;
    transition: opacity 375ms ease;
}

.travel-ambush-awaiting-alert {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    animation: travel-ambush-auto-reveal 0s linear 1.5s forwards;
}

.travel-ambush-alert-cleared {
    animation: travel-ambush-reveal 240ms ease-out both;
}

@keyframes travel-intercept-screen {
    0% { opacity: 0; filter: brightness(2.1); }
    8% { opacity: 1; }
    82% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes travel-intercept-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.012); filter: brightness(1.45); }
}

@keyframes travel-intercept-grid {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 44px, 44px 0; }
}

@keyframes travel-intercept-scan {
    from { transform: translateY(-30vh); }
    to { transform: translateY(135vh); }
}

@keyframes travel-ambush-auto-reveal {
    to { opacity: 1; visibility: visible; pointer-events: auto; }
}

@keyframes travel-ambush-reveal {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .travel-intercept-alert-screen,
    .travel-intercept-alert-copy,
    .travel-intercept-alert-grid,
    .travel-intercept-alert-scan {
        animation: none !important;
    }

    .travel-intercept-alert-screen {
        animation: travel-intercept-screen 1.5s linear forwards !important;
    }
}

/* Header tab and career archive cleanup */
.archive-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.game-nav {
    position: sticky;
    top: 0;
    z-index: 110;
    padding: 0.45rem 0;
    background: linear-gradient(180deg, rgba(5, 9, 18, 0.98), rgba(5, 9, 18, 0.9));
    backdrop-filter: blur(14px);
}

@media (max-width: 720px) {
    .game-header {
        position: relative;
        top: auto;
        z-index: 5;
        box-shadow: none;
    }

    .mobile-game-nav {
        position: sticky;
        top: 0;
        z-index: 120;
        width: 100%;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        margin: 0;
        padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
        border-top: 1px solid rgba(83, 220, 255, 0.12);
        border-bottom: 1px solid rgba(83, 220, 255, 0.2);
        background: rgba(5, 9, 18, 0.98);
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
        backdrop-filter: blur(14px);
    }

    .mobile-game-nav-item {
        width: 100%;
        min-height: 52px;
        padding: 0.52rem 0.08rem 0.56rem;
    }

    .mobile-game-nav-item span {
        font-size: 0.54rem;
    }

    .mobile-game-nav-item b {
        font-size: clamp(0.66rem, 2.75vw, 0.82rem);
        letter-spacing: 0.015em;
    }
}


/* Desktop header continuity fix */
@media (min-width: 721px) {
    .game-header {
        border-bottom: 0;
    }

    .ship-screen-shell {
        padding-top: 0;
    }

    .game-nav {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-bottom: 0.8rem;
        padding: 0.45rem max(1rem, calc((100vw - 1180px) / 2));
        border-bottom: 1px solid var(--line);
        background: rgba(5, 8, 17, 0.88);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
        backdrop-filter: blur(16px);
    }
}

/* Sticky mobile navigation content offset */
@media (max-width: 720px) {
    .game-view-region,
    .game-view-region :where([id]) {
        scroll-margin-top: calc(52px + env(safe-area-inset-top, 0px) + 0.75rem);
    }
}


/* Ship readout and persistent-credit feedback */
.footer-credit-value {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.22rem;
    transform-origin: center;
    isolation: isolate;
}

.footer-credit-unit {
    font-size: 0.82em;
}

.footer-credit-value.is-credit-debt {
    color: #ff7b87;
    text-shadow: 0 0 8px rgba(255, 76, 92, 0.72);
}

.footer-credit-value.credit-change-up,
.footer-credit-value.credit-change-down {
    animation: footer-credit-pulse 780ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.footer-credit-value.credit-change-up {
    color: #9dffc0 !important;
    text-shadow: 0 0 8px rgba(104, 255, 166, 0.92), 0 0 22px rgba(104, 255, 166, 0.55) !important;
}

.footer-credit-value.credit-change-down {
    color: #ff8f9f !important;
    text-shadow: 0 0 8px rgba(255, 77, 104, 0.92), 0 0 22px rgba(255, 77, 104, 0.55) !important;
}

.footer-credit-value.credit-change-up::after,
.footer-credit-value.credit-change-down::after {
    content: attr(data-credit-delta);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.42rem);
    z-index: 3;
    min-width: max-content;
    padding: 0.2rem 0.42rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: rgba(4, 10, 20, 0.96);
    font-size: 0.67rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    transform: translate(-50%, 4px);
    animation: footer-credit-delta 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes footer-credit-pulse {
    0% { transform: scale(1); }
    28% { transform: scale(1.22); }
    62% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

@keyframes footer-credit-delta {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.88); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    72% { opacity: 1; transform: translate(-50%, -5px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -12px) scale(0.94); }
}

@media (max-width: 480px) {
    .rating-card {
        min-height: 108px;
        padding: 0.72rem;
    }

    .rating-card > span {
        font-size: 0.58rem;
        letter-spacing: 0.08em;
    }

    .rating-card strong {
        font-size: 1.75rem;
    }

    .rating-card p {
        font-size: 0.62rem;
        line-height: 1.3;
    }

    .footer-credit-value.credit-change-up::after,
    .footer-credit-value.credit-change-down::after {
        font-size: 0.6rem;
        bottom: calc(100% + 0.3rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-credit-value.credit-change-up,
    .footer-credit-value.credit-change-down,
    .footer-credit-value.credit-change-up::after,
    .footer-credit-value.credit-change-down::after {
        animation-duration: 0.01ms;
    }
}

/* Mobile docking lock: keep the mandatory docking transmission above sticky game navigation. */
@media (max-width: 720px) {
    .modal-backdrop.docking-backdrop,
    .docking-backdrop {
        position: fixed;
        inset: 0;
        z-index: 20000 !important;
        pointer-events: auto;
        isolation: isolate;
        overscroll-behavior: contain;
    }
}

/* Docking dialogue typewriter and mobile status-bar visibility. */
.docking-speaker-card {
    display: block;
}

.docking-speaker-portrait,
.docking-speaker-portrait img {
    height: 100%;
}

.docking-speech-panel p[data-docking-dialogue-text] {
    position: relative;
    min-height: 3.2em;
    cursor: pointer;
    outline: none;
    user-select: none;
}

.docking-speech-panel p[data-docking-dialogue-text]:focus-visible {
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(83, 220, 255, 0.32);
}

.docking-speech-panel p[data-docking-dialogue-text].is-typing::after {
    content: "";
    display: inline-block;
    width: 0.48em;
    height: 1em;
    margin-left: 0.16em;
    vertical-align: -0.12em;
    background: var(--cyan-hot);
    box-shadow: 0 0 9px rgba(83, 220, 255, 0.72);
    animation: dockingDialogueCaret 0.72s steps(1, end) infinite;
}

@keyframes dockingDialogueCaret {
    50% { opacity: 0; }
}

@media (max-width: 720px) {
    body.docking-modal-active {
        overflow: hidden;
    }

    body.docking-modal-active .player-status-footer {
        z-index: 20010 !important;
    }

    body.docking-modal-active .player-status-footer.is-collapsed {
        transform: translateX(-50%);
    }

    body.docking-modal-active .footer-collapse-toggle {
        display: none;
    }

    body.docking-modal-active .modal-backdrop.docking-backdrop,
    body.docking-modal-active .docking-backdrop {
        padding-bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px));
    }

    body.docking-modal-active .docking-transmission {
        max-height: calc(100dvh - 5.8rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .docking-speech-panel p[data-docking-dialogue-text].is-typing::after {
        animation: none;
    }
}

/* Fixed docking portrait frame: dialogue height and portrait height stay independent. */
.docking-dialogue {
    align-items: start;
}

.docking-speaker-card {
    height: 190px;
    align-self: start;
}

.docking-speaker-portrait,
.docking-speaker-portrait img {
    width: 100%;
    height: 190px;
    min-height: 0;
}

@media (max-width: 620px) {
    .docking-speaker-card,
    .docking-speaker-portrait,
    .docking-speaker-portrait img {
        height: 112px;
        min-height: 0;
    }
}

/* Alpha 1.2 battle presentation cleanup */
.combat-ship-visual-wrap {
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

.combat-ship-visual-wrap > .combat-ship-visual {
    max-width: none;
}

.combat-evasive-tag {
    position: absolute;
    top: 0.65rem;
    right: 0.4rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    max-width: calc(100% - 0.8rem);
    padding: 0.32rem 0.58rem;
    border: 1px solid rgba(171, 123, 255, 0.88);
    border-radius: 999px;
    color: #f1e8ff;
    background: rgba(29, 12, 58, 0.92);
    box-shadow:
        0 0 0 1px rgba(225, 205, 255, 0.12) inset,
        0 0 18px rgba(154, 91, 255, 0.42),
        0 8px 22px rgba(0, 0, 0, 0.48);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    animation: combat-evasive-tag-pulse 1.25s ease-in-out infinite alternate;
}

.combat-evasive-tag-enemy {
    border-color: rgba(255, 105, 138, 0.88);
    color: #ffe5eb;
    background: rgba(67, 10, 29, 0.94);
    box-shadow:
        0 0 0 1px rgba(255, 210, 221, 0.12) inset,
        0 0 18px rgba(255, 68, 112, 0.4),
        0 8px 22px rgba(0, 0, 0, 0.48);
}

.combat-evasive-tag[hidden] {
    display: none !important;
}

.combat-cinematic-ship .combat-ship-visual-wrap {
    max-width: 100%;
}

.combat-cinematic-ship .combat-evasive-tag {
    top: 0.2rem;
    right: 0.1rem;
}

.combat-cinematic-layer {
    cursor: pointer;
    outline: none;
}

.combat-cinematic-layer.is-dismissed {
    pointer-events: none;
}

.combat-cinematic-dismiss-hint {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 10002;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(136, 198, 255, 0.24);
    border-radius: 999px;
    color: rgba(221, 239, 255, 0.78);
    background: rgba(4, 12, 28, 0.82);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
    transform: translateX(-50%);
    pointer-events: none;
}

.travel-intercept-alert-copy {
    max-width: calc(100vw - 2rem);
    overflow: hidden;
}

.travel-intercept-alert-copy span,
.travel-intercept-alert-copy p,
.travel-intercept-alert-copy strong {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
}

.travel-intercept-alert-copy strong {
    font-size: clamp(1.65rem, 7.2vw, 5.1rem);
    letter-spacing: clamp(0.025em, 0.8vw, 0.08em);
}

@keyframes combat-evasive-tag-pulse {
    from {
        transform: translateY(0);
        filter: brightness(0.96);
    }
    to {
        transform: translateY(-1px);
        filter: brightness(1.2);
    }
}

@media (max-width: 520px) {
    .travel-intercept-alert-screen {
        padding: 0.75rem;
    }

    .travel-intercept-alert-copy {
        max-width: calc(100vw - 1.5rem);
        padding: 1.15rem 0.75rem;
    }

    .travel-intercept-alert-copy strong {
        font-size: clamp(1.45rem, 10vw, 2.8rem);
        line-height: 1.02;
        letter-spacing: 0.025em;
    }

    .travel-intercept-alert-copy span,
    .travel-intercept-alert-copy p {
        font-size: 0.64rem;
        letter-spacing: 0.12em;
    }

    .combat-evasive-tag {
        top: 0.45rem;
        right: 0.25rem;
        min-height: 25px;
        padding: 0.28rem 0.48rem;
        font-size: 0.6rem;
    }

    .combat-cinematic-dismiss-hint {
        width: calc(100vw - 2rem);
        border-radius: 10px;
        font-size: 0.58rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .combat-evasive-tag {
        animation: none;
    }
}


/* Alpha 1.3 — new captain orientation and first-arrival tutorial */
.docking-dialogue-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.docking-next-button {
    min-width: 112px;
}

.transmission-body form.docking-form-revealed {
    animation: dockingFormReveal 220ms ease both;
}

@keyframes dockingFormReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.game-tutorial-active {
    overflow: hidden;
}

.game-tutorial-layer {
    position: fixed;
    inset: 0;
    z-index: 180;
    transition: opacity 200ms ease;
}

.game-tutorial-layer.closing {
    opacity: 0;
}

.game-tutorial-shade {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: transparent;
}

.game-tutorial-layer.is-centered-step .game-tutorial-shade {
    background: rgba(2, 4, 10, 0.88);
    backdrop-filter: blur(9px);
}

.game-tutorial-spotlight {
    position: fixed;
    z-index: 181;
    border: 2px solid var(--cyan);
    border-radius: 4px;
    background: rgba(83, 220, 255, 0.06);
    box-shadow: 0 0 0 9999px rgba(2, 4, 10, 0.82), 0 0 24px rgba(83, 220, 255, 0.72), inset 0 0 18px rgba(83, 220, 255, 0.16);
    pointer-events: none;
    transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.game-tutorial-callout {
    --tutorial-arrow-x: 50%;
    position: fixed;
    z-index: 182;
    width: min(390px, calc(100vw - 24px));
    padding: 1.35rem;
    border: 1px solid var(--line-strong);
    background: linear-gradient(155deg, rgba(83, 220, 255, 0.09), transparent 42%), #0b1222;
    box-shadow: 0 0 40px rgba(83, 220, 255, 0.18), var(--shadow);
    text-align: left;
}

.game-tutorial-callout::before {
    content: "";
    position: absolute;
    left: var(--tutorial-arrow-x);
    width: 16px;
    height: 16px;
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
    background: #0b1222;
}

.game-tutorial-callout.is-below-target::before {
    top: -9px;
    transform: translateX(-50%) rotate(45deg);
}

.game-tutorial-callout.is-above-target::before {
    bottom: -9px;
    transform: translateX(-50%) rotate(225deg);
}

.game-tutorial-callout.is-centered {
    left: 50%;
    top: 50%;
    width: min(560px, calc(100vw - 24px));
    transform: translate(-50%, -50%);
    text-align: center;
}

.game-tutorial-callout.is-centered::before {
    display: none;
}

.game-tutorial-callout h2 {
    margin: 0.45rem 0 0.7rem;
    font-size: clamp(1.45rem, 4vw, 2rem);
}

.game-tutorial-callout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.game-tutorial-callout form {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.1rem;
}

.game-tutorial-callout.is-centered form {
    justify-content: center;
}

.tutorial-step-ok {
    min-width: 112px;
}

@media (max-width: 720px) {
    .game-tutorial-callout {
        width: calc(100vw - 20px);
        padding: 1.05rem;
    }

    .game-tutorial-callout h2 {
        margin-top: 0.35rem;
    }

    .game-tutorial-callout p {
        font-size: 0.9rem;
        line-height: 1.55;
    }
}

/* Alpha 1.4 tutorial and Marrik Voss cleanup patch */
.mission-embark-button span {
    color: #6dff9a;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(72, 255, 132, 0.42);
}

.docking-next-required {
    min-width: 150px;
    font-weight: 950;
    letter-spacing: 0.14em;
}

.docking-next-required.is-required {
    animation: dockingNextRequiredPulse 1.05s ease-in-out infinite alternate;
    box-shadow:
        0 0 0 1px rgba(147, 224, 255, 0.58) inset,
        0 0 22px rgba(53, 190, 255, 0.62),
        0 0 48px rgba(37, 136, 255, 0.32);
}

@keyframes dockingNextRequiredPulse {
    from {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    to {
        transform: translateY(-1px) scale(1.035);
        filter: brightness(1.18);
    }
}

.narrative-typewriter-text,
.mission-typewriter-text {
    position: relative;
    min-height: 4.8em;
    white-space: pre-wrap;
}

.narrative-typewriter-text.is-typing::after,
.mission-typewriter-text.is-typing::after {
    content: '';
    display: inline-block;
    width: 0.55ch;
    height: 1em;
    margin-left: 0.2rem;
    vertical-align: -0.12em;
    background: currentColor;
    box-shadow: 0 0 10px rgba(94, 219, 255, 0.7);
    animation: narrativeCursorBlink 0.72s steps(1, end) infinite;
}

@keyframes narrativeCursorBlink {
    0%, 48% { opacity: 1; }
    49%, 100% { opacity: 0; }
}

.narrative-slide-enter {
    animation: narrativeTextSlideIn 300ms ease both;
}

@keyframes narrativeTextSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.narrative-sequence-card {
    overflow: hidden;
}

.narrative-sequence-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.narrative-sequence-actions > * {
    min-width: 138px;
    text-align: center;
}

[data-narrative-final].is-revealed,
[data-mission-controls].mission-controls-revealed {
    animation: missionControlsReveal 280ms ease both;
}

@keyframes missionControlsReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mission-scene-image {
    transform-origin: center;
    will-change: opacity, transform, filter;
}

.mission-scene-image.mission-scene-warp-in {
    animation: missionSceneWarpIn 780ms cubic-bezier(0.16, 0.78, 0.2, 1) both;
}

.mission-scene-image.mission-scene-warp-out {
    animation: missionSceneWarpOut 240ms ease both;
}

@keyframes missionSceneWarpIn {
    0% {
        opacity: 0;
        transform: perspective(900px) scale(0.88) rotateX(7deg);
        filter: blur(12px) brightness(1.75) saturate(0.55);
    }
    45% {
        opacity: 0.82;
        transform: perspective(900px) scale(1.035) rotateX(-1deg);
        filter: blur(3px) brightness(1.25) saturate(1.15);
    }
    100% {
        opacity: 1;
        transform: perspective(900px) scale(1) rotateX(0);
        filter: blur(0) brightness(1) saturate(1);
    }
}

@keyframes missionSceneWarpOut {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0) brightness(1);
    }
    to {
        opacity: 0.38;
        transform: scale(1.035);
        filter: blur(5px) brightness(1.35);
    }
}

.center-notice-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 7, 15, 0.34);
    opacity: 0;
    pointer-events: auto;
    transition: opacity 180ms ease;
}

.center-notice-backdrop.is-visible {
    opacity: 1;
}

.center-notice-backdrop.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.center-notice-card {
    position: relative;
    width: min(460px, calc(100vw - 2rem));
    display: grid;
    gap: 0.42rem;
    padding: 1.05rem 3rem 1.05rem 1.15rem;
    overflow: hidden;
    border: 1px solid rgba(94, 210, 255, 0.54);
    border-radius: 16px;
    color: #eaf8ff;
    background:
        linear-gradient(125deg, rgba(22, 65, 94, 0.96), rgba(5, 17, 34, 0.98));
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.64),
        0 0 34px rgba(50, 186, 255, 0.28),
        inset 0 0 26px rgba(91, 213, 255, 0.07);
    cursor: pointer;
    transform: translateY(18px) scale(0.94);
    transition: transform 220ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.center-notice-backdrop.is-visible .center-notice-card {
    transform: translateY(0) scale(1);
}

.center-notice-success .center-notice-card {
    border-color: rgba(76, 255, 150, 0.58);
    background:
        linear-gradient(125deg, rgba(15, 72, 58, 0.97), rgba(5, 24, 29, 0.98));
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.64),
        0 0 34px rgba(51, 255, 144, 0.25),
        inset 0 0 26px rgba(76, 255, 150, 0.08);
}

.center-notice-warning .center-notice-card {
    border-color: rgba(255, 196, 79, 0.62);
}

.center-notice-error .center-notice-card {
    border-color: rgba(255, 103, 116, 0.68);
}

.center-notice-kicker {
    color: rgba(182, 226, 244, 0.72);
    font-size: 0.63rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.center-notice-title {
    color: #effcff;
    font-size: 1.02rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.center-notice-card p {
    margin: 0;
    color: rgba(226, 244, 250, 0.88);
    line-height: 1.48;
}

.center-notice-close {
    position: absolute;
    top: 0.65rem;
    right: 0.7rem;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(190, 229, 242, 0.3);
    border-radius: 50%;
    color: #eaf8ff;
    background: rgba(1, 9, 18, 0.42);
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 620px) {
    .narrative-sequence-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .narrative-sequence-actions > * {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .docking-next-required.is-required,
    .narrative-slide-enter,
    [data-narrative-final].is-revealed,
    [data-mission-controls].mission-controls-revealed,
    .mission-scene-image.mission-scene-warp-in,
    .mission-scene-image.mission-scene-warp-out {
        animation: none;
    }
}

[data-docking-dialogue-actions][hidden],
[data-narrative-next][hidden],
[data-narrative-continue][hidden],
[data-narrative-final][hidden],
[data-mission-controls][hidden] {
    display: none !important;
}

/* Alpha 1.4 NPC conversation pass — Local Spot contacts mirror docking dialogue. */
.local-npc-card,
.compact-npc-card {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.local-npc-card > img,
.compact-npc-card > img {
    width: 150px;
    height: 180px;
    min-height: 180px;
    display: block;
    object-fit: cover;
    object-position: center 24%;
    border: 1px solid rgba(83, 220, 255, 0.25);
    border-radius: 4px 18px 4px 18px;
    background: rgba(3, 13, 27, 0.82);
    box-shadow: inset 0 0 22px rgba(83, 220, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.2);
    filter: saturate(0.9) contrast(1.06);
}

.local-npc-copy,
.location-npc-panel .npc-contact-copy {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.8rem;
    row-gap: 0.65rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(103, 188, 224, 0.22);
    border-radius: 18px 4px 18px 4px;
    background:
        linear-gradient(135deg, rgba(83, 220, 255, 0.07), transparent 52%),
        rgba(4, 13, 26, 0.78);
    box-shadow: inset 0 0 28px rgba(83, 220, 255, 0.04);
}

.local-npc-copy::before,
.location-npc-panel .npc-contact-copy::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 34px;
    width: 16px;
    height: 16px;
    border-left: 1px solid rgba(103, 188, 224, 0.22);
    border-bottom: 1px solid rgba(103, 188, 224, 0.22);
    background: rgba(5, 16, 31, 0.98);
    transform: rotate(45deg);
}

.local-npc-copy > .npc-title-plate,
.location-npc-panel .npc-contact-copy > .npc-title-plate {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding: 0;
    border: 0;
}

.local-npc-copy .npc-title-plate > span,
.location-npc-panel .npc-title-plate > span {
    display: block;
    color: var(--amber);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.25;
    text-transform: uppercase;
}

.local-npc-copy .npc-title-plate h3,
.location-npc-panel .npc-title-plate h3 {
    margin: 0.22rem 0 0;
    color: #effcff;
    font-size: clamp(1.12rem, 2.5vw, 1.45rem);
    line-height: 1.05;
}

.local-npc-copy > .npc-reputation,
.location-npc-panel .npc-contact-copy > .npc-reputation {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 82px;
    margin: 0;
    padding: 0.48rem 0.58rem;
    align-self: start;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.42rem;
    border: 1px solid rgba(83, 220, 255, 0.28);
    border-radius: 10px;
    background: rgba(83, 220, 255, 0.055);
    text-align: center;
}

.local-npc-copy > .npc-reputation span,
.location-npc-panel .npc-contact-copy > .npc-reputation span {
    display: inline;
    color: var(--muted-2);
    font-size: 0.54rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.local-npc-copy > .npc-reputation strong,
.location-npc-panel .npc-contact-copy > .npc-reputation strong {
    display: inline;
    margin: 0;
    color: var(--cyan-hot);
    font-size: 1rem;
    line-height: 1;
}

.local-npc-copy > .npc-reputation-untracked strong {
    color: var(--muted);
}

.local-npc-copy > .crew-focus-line {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 112px;
    margin: 0;
    padding: 0.45rem 0.55rem;
    align-self: start;
    display: grid;
    gap: 0.15rem;
    justify-items: end;
    border-radius: 10px;
}

.local-npc-copy > .crew-focus-line span,
.local-npc-copy > .crew-focus-line strong {
    white-space: nowrap;
}

.local-npc-copy > :not(.npc-title-plate):not(.npc-reputation):not(.crew-focus-line):not(.npc-conversation-bubble),
.location-npc-panel .npc-contact-copy > :not(.npc-title-plate):not(.npc-reputation):not(.npc-conversation-bubble) {
    grid-column: 1 / -1;
}

.npc-opening-line {
    position: relative;
    margin: 0.15rem 0 0 !important;
    padding: 0.78rem 0.9rem;
    border-left: 2px solid rgba(83, 220, 255, 0.5);
    background: rgba(2, 10, 21, 0.44);
    color: #cfe4ee !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.92rem;
    line-height: 1.62;
}

.location-npc-panel {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    margin: 0;
    border: 0;
    background: transparent;
}

.location-npc-panel .npc-portrait-wrap {
    width: 150px;
    height: 180px;
    min-height: 180px;
    border: 1px solid rgba(83, 220, 255, 0.25);
    border-radius: 4px 18px 4px 18px;
    overflow: hidden;
    background: rgba(3, 13, 27, 0.82);
    box-shadow: inset 0 0 22px rgba(83, 220, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.2);
}

.location-npc-panel .npc-portrait-wrap img {
    width: 150px;
    height: 180px;
    min-height: 180px;
    object-fit: cover;
    object-position: center 24%;
    filter: saturate(0.9) contrast(1.06);
}

.location-npc-panel .npc-signal {
    left: 0.45rem;
    right: 0.45rem;
    bottom: 0.45rem;
    padding: 0.38rem 0.35rem;
    font-size: 0.5rem;
    letter-spacing: 0.08em;
}

@media (max-width: 620px) {
    .local-npc-card,
    .compact-npc-card,
    .location-npc-panel {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 0.65rem;
    }

    .local-npc-card > img,
    .compact-npc-card > img,
    .location-npc-panel .npc-portrait-wrap,
    .location-npc-panel .npc-portrait-wrap img {
        width: 92px;
        height: 122px;
        min-height: 122px;
    }

    .local-npc-copy,
    .location-npc-panel .npc-contact-copy {
        column-gap: 0.45rem;
        row-gap: 0.5rem;
        padding: 0.72rem 0.75rem;
    }

    .local-npc-copy::before,
    .location-npc-panel .npc-contact-copy::before {
        left: -7px;
        top: 25px;
        width: 12px;
        height: 12px;
    }

    .local-npc-copy .npc-title-plate > span,
    .location-npc-panel .npc-title-plate > span {
        font-size: 0.48rem;
        letter-spacing: 0.08em;
    }

    .local-npc-copy .npc-title-plate h3,
    .location-npc-panel .npc-title-plate h3 {
        font-size: 1rem;
    }

    .local-npc-copy > .npc-reputation,
    .location-npc-panel .npc-contact-copy > .npc-reputation {
        min-width: 67px;
        gap: 0.25rem;
        padding: 0.4rem 0.42rem;
    }

    .local-npc-copy > .npc-reputation span,
    .location-npc-panel .npc-contact-copy > .npc-reputation span {
        font-size: 0.46rem;
    }

    .local-npc-copy > .npc-reputation strong,
    .location-npc-panel .npc-contact-copy > .npc-reputation strong {
        font-size: 0.85rem;
    }

    .local-npc-copy > .crew-focus-line {
        min-width: 78px;
        padding: 0.38rem 0.4rem;
    }

    .local-npc-copy > .crew-focus-line span {
        font-size: 0.48rem;
    }

    .local-npc-copy > .crew-focus-line strong {
        font-size: 0.65rem;
    }

    .npc-opening-line {
        padding: 0.64rem 0.7rem;
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .location-npc-panel .npc-signal {
        font-size: 0.43rem;
    }
}

/* Alpha 1.4 NPC conversation cleanup — spoken dialogue stays in the bubble; controls and info span below. */
.local-npc-card,
.compact-npc-card,
.location-npc-panel {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.local-npc-card > img,
.compact-npc-card > img {
    grid-column: 1;
    grid-row: 1;
    width: 210px;
    height: 250px;
    min-height: 250px;
}

.location-npc-panel .npc-portrait-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 210px;
    height: 250px;
    min-height: 250px;
}

.location-npc-panel .npc-portrait-wrap img {
    width: 210px;
    height: 250px;
    min-height: 250px;
}

/* Let non-dialogue children participate in the parent card grid. */
.local-npc-copy,
.location-npc-panel .npc-contact-copy {
    display: contents;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.local-npc-copy::before,
.location-npc-panel .npc-contact-copy::before {
    content: none;
    display: none;
}

.npc-conversation-bubble {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.8rem;
    row-gap: 0.65rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(103, 188, 224, 0.22);
    border-radius: 18px 4px 18px 4px;
    background:
        linear-gradient(135deg, rgba(83, 220, 255, 0.07), transparent 52%),
        rgba(4, 13, 26, 0.78);
    box-shadow: inset 0 0 28px rgba(83, 220, 255, 0.04);
}

.npc-conversation-bubble::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 38px;
    width: 16px;
    height: 16px;
    border-left: 1px solid rgba(103, 188, 224, 0.22);
    border-bottom: 1px solid rgba(103, 188, 224, 0.22);
    background: rgba(5, 16, 31, 0.98);
    transform: rotate(45deg);
}

.npc-conversation-bubble > .npc-title-plate {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding: 0;
    border: 0;
}

.npc-conversation-bubble .npc-title-plate > span {
    display: block;
    color: var(--amber);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.25;
    text-transform: uppercase;
}

.npc-conversation-bubble .npc-title-plate h3 {
    margin: 0.22rem 0 0;
    color: #effcff;
    font-size: clamp(1.18rem, 2.5vw, 1.52rem);
    line-height: 1.05;
}

.npc-conversation-bubble > .npc-reputation {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 82px;
    margin: 0;
    padding: 0.48rem 0.58rem;
    align-self: start;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.42rem;
    border: 1px solid rgba(83, 220, 255, 0.28);
    border-radius: 10px;
    background: rgba(83, 220, 255, 0.055);
    text-align: center;
}

.npc-conversation-bubble > .npc-reputation span {
    display: inline;
    color: var(--muted-2);
    font-size: 0.54rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.npc-conversation-bubble > .npc-reputation strong {
    display: inline;
    margin: 0;
    color: var(--cyan-hot);
    font-size: 1rem;
    line-height: 1;
}

.npc-conversation-bubble > .npc-reputation-untracked strong {
    color: var(--muted);
}

.npc-conversation-bubble > .crew-focus-line {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 112px;
    margin: 0;
    padding: 0.45rem 0.55rem;
    align-self: start;
    display: grid;
    gap: 0.15rem;
    justify-items: end;
    border-radius: 10px;
}

.npc-conversation-bubble > .npc-opening-line {
    grid-column: 1 / -1;
}

/* Status boxes, mission panels, forms, inventory notes, etc. now sit below both portrait and speech bubble. */
.local-npc-copy > :not(.npc-conversation-bubble),
.location-npc-panel .npc-contact-copy > :not(.npc-conversation-bubble) {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
}

.local-npc-copy > .npc-conversation-bubble + *,
.location-npc-panel .npc-contact-copy > .npc-conversation-bubble + * {
    margin-top: 0.15rem;
}

@media (max-width: 620px) {
    .local-npc-card,
    .compact-npc-card,
    .location-npc-panel {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 0.65rem;
    }

    .local-npc-card > img,
    .compact-npc-card > img,
    .location-npc-panel .npc-portrait-wrap,
    .location-npc-panel .npc-portrait-wrap img {
        width: 92px;
        height: 122px;
        min-height: 122px;
    }

    .npc-conversation-bubble {
        column-gap: 0.45rem;
        row-gap: 0.5rem;
        padding: 0.72rem 0.75rem;
    }

    .npc-conversation-bubble::before {
        left: -7px;
        top: 25px;
        width: 12px;
        height: 12px;
    }

    .npc-conversation-bubble .npc-title-plate > span {
        font-size: 0.48rem;
        letter-spacing: 0.08em;
    }

    .npc-conversation-bubble .npc-title-plate h3 {
        font-size: 1rem;
    }

    .npc-conversation-bubble > .npc-reputation {
        min-width: 67px;
        gap: 0.25rem;
        padding: 0.4rem 0.42rem;
    }

    .npc-conversation-bubble > .npc-reputation span {
        font-size: 0.46rem;
    }

    .npc-conversation-bubble > .npc-reputation strong {
        font-size: 0.85rem;
    }

    .npc-conversation-bubble > .crew-focus-line {
        min-width: 78px;
        padding: 0.38rem 0.4rem;
    }

    .npc-conversation-bubble > .crew-focus-line span {
        font-size: 0.48rem;
    }

    .npc-conversation-bubble > .crew-focus-line strong {
        font-size: 0.65rem;
    }
}

/* Alpha 1.4 NPC live-dialogue refinement — the bubble is the single speaking surface. */
.npc-conversation-bubble > .npc-dialogue-text {
    grid-column: 1 / -1;
    position: relative;
    min-width: 0;
    min-height: 3.25em;
    margin: 0.12rem 0 0;
    padding: 0;
    color: #cfe4ee;
    font-family: inherit;
    font-size: 0.94rem;
    line-height: 1.58;
    white-space: pre-wrap;
    cursor: default;
}

.npc-conversation-bubble > .npc-dialogue-text.is-typing {
    cursor: pointer;
}

.npc-conversation-bubble > .npc-dialogue-text.is-typing::after {
    content: '';
    display: inline-block;
    width: 0.55ch;
    height: 1em;
    margin-left: 0.2rem;
    vertical-align: -0.12em;
    background: currentColor;
    box-shadow: 0 0 10px rgba(94, 219, 255, 0.7);
    animation: narrativeCursorBlink 0.72s steps(1, end) infinite;
}

.npc-conversation-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.08rem;
    padding-top: 0.72rem;
    border-top: 1px solid rgba(103, 188, 224, 0.13);
}

.npc-conversation-actions form {
    margin: 0;
}

.npc-conversation-actions .primary-button,
.npc-conversation-actions .ghost-button {
    margin: 0;
}

.npc-conversation-actions [data-npc-dialogue-reply].is-active {
    border-color: rgba(83, 220, 255, 0.68);
    box-shadow: 0 0 0 1px rgba(83, 220, 255, 0.12), 0 0 18px rgba(83, 220, 255, 0.08);
}

@media (max-width: 620px) {
    .npc-conversation-bubble > .npc-dialogue-text {
        min-height: 3em;
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .npc-conversation-actions {
        gap: 0.42rem;
        padding-top: 0.58rem;
    }

    .npc-conversation-actions form,
    .npc-conversation-actions .primary-button,
    .npc-conversation-actions .ghost-button {
        width: 100%;
    }
}


/* Alpha 1.4 NPC status hierarchy refinement.
   State notifications sit above the portrait/dialogue row; physical actions remain in the speech surface. */
.npc-conversation-bubble > .npc-dialogue-action {
    grid-column: 1 / -1;
    margin: -0.05rem 0 0;
    padding-top: 0.62rem;
    border-top: 1px solid rgba(103, 188, 224, 0.11);
    color: rgba(207, 228, 238, 0.72);
    font-size: 0.88rem;
    line-height: 1.55;
}

.npc-conversation-bubble > .npc-dialogue-action em {
    font-style: italic;
}

/* A status banner inside an NPC card becomes the first full-width row. */
.local-npc-card:has(> .local-npc-copy > .npc-event-brief) > .local-npc-copy > .npc-event-brief,
.location-npc-panel:has(.npc-contact-copy > .npc-event-brief) .npc-contact-copy > .npc-event-brief {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 0 0.15rem;
}

.local-npc-card:has(> .local-npc-copy > .npc-event-brief) > img,
.location-npc-panel:has(.npc-contact-copy > .npc-event-brief) .npc-portrait-wrap {
    grid-row: 2;
}

.local-npc-card:has(> .local-npc-copy > .npc-event-brief) > .local-npc-copy > .npc-conversation-bubble,
.location-npc-panel:has(.npc-contact-copy > .npc-event-brief) .npc-contact-copy > .npc-conversation-bubble {
    grid-row: 2;
}

@media (max-width: 620px) {
    .npc-conversation-bubble > .npc-dialogue-action {
        padding-top: 0.5rem;
        font-size: 0.76rem;
        line-height: 1.48;
    }
}

/* Alpha 1.5 — orientation transition, destructive confirmation, and Meridian interaction polish */
.orientation-packet-backdrop {
    animation: orientationPacketBackdropIn 420ms ease-out both;
}

.orientation-packet-backdrop .orientation-packet-modal {
    isolation: isolate;
    animation: orientationPacketBootIn 560ms cubic-bezier(0.16, 0.84, 0.2, 1) both;
}

.orientation-packet-backdrop .orientation-packet-modal::after {
    content: "";
    position: absolute;
    z-index: 4;
    inset: -35% 0 auto;
    height: 42%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(83, 220, 255, 0.18), rgba(255, 255, 255, 0.22), transparent);
    mix-blend-mode: screen;
    opacity: 0;
    animation: orientationPacketScan 720ms 90ms ease-out both;
}

.orientation-packet-backdrop.closing {
    animation: orientationPacketBackdropOut 420ms ease-in both;
}

.orientation-packet-backdrop.closing .orientation-packet-modal {
    animation: orientationPacketShutdown 360ms cubic-bezier(0.7, 0, 0.84, 0) both;
}

@keyframes orientationPacketBackdropIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(12px); }
}

@keyframes orientationPacketBootIn {
    0% {
        opacity: 0;
        transform: scaleX(0.72) scaleY(0.035);
        filter: brightness(2.3) blur(6px);
        box-shadow: 0 0 120px rgba(83, 220, 255, 0.52), var(--shadow);
    }
    42% {
        opacity: 1;
        transform: scaleX(1.025) scaleY(0.08);
        filter: brightness(1.8) blur(1px);
    }
    68% {
        transform: scaleX(0.995) scaleY(1.025);
        filter: brightness(1.18) blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes orientationPacketScan {
    0% { transform: translateY(0); opacity: 0; }
    18% { opacity: 0.9; }
    100% { transform: translateY(360%); opacity: 0; }
}

@keyframes orientationPacketBackdropOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes orientationPacketShutdown {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
    58% {
        opacity: 1;
        transform: scaleX(1.02) scaleY(0.06);
        filter: brightness(2.2) blur(1px);
    }
    100% {
        opacity: 0;
        transform: scaleX(0.56) scaleY(0.015);
        filter: brightness(3) blur(5px);
    }
}

.themed-action-dialog.delete-danger {
    border-color: rgba(255, 72, 72, 0.74);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58), inset 0 0 42px rgba(188, 16, 29, 0.2), 0 0 28px rgba(255, 47, 57, 0.14);
}

.themed-action-dialog.delete-danger [data-themed-action-confirm] {
    border-color: rgba(255, 164, 157, 0.92);
    background: linear-gradient(180deg, #ff756b, #d92f3d);
    font-weight: 950;
    letter-spacing: 0.08em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 22px rgba(255, 50, 64, 0.28);
    animation: deleteSaveWarningPulse 900ms steps(1, end) infinite;
}

.themed-action-dialog.delete-danger [data-themed-action-confirm]:hover,
.themed-action-dialog.delete-danger [data-themed-action-confirm]:focus-visible {
    background: linear-gradient(180deg, #ff877e, #e93645);
    border-color: rgba(255, 211, 207, 0.98);
}

@keyframes deleteSaveWarningPulse {
    0%, 48% {
        color: #08080a;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.16);
    }
    49%, 100% {
        color: #8d000b;
        text-shadow: 0 0 7px rgba(255, 230, 230, 0.62);
    }
}

@media (prefers-reduced-motion: reduce) {
    .orientation-packet-backdrop,
    .orientation-packet-backdrop .orientation-packet-modal,
    .orientation-packet-backdrop .orientation-packet-modal::after,
    .orientation-packet-backdrop.closing,
    .orientation-packet-backdrop.closing .orientation-packet-modal,
    .themed-action-dialog.delete-danger [data-themed-action-confirm] {
        animation: none;
    }
}


/* Alpha 1.6 — Vespera Nebula */
.item-rarity-rare,
[data-item-rarity="rare"] .cargo-item-name,
[data-item-rarity="rare"] .item-name,
[data-rarity="rare"] .item-name,
.combat-reward-grid > div > strong.item-rarity-rare {
    color: #fa8f83 !important;
    text-shadow: 0 0 13px rgba(250, 143, 131, 0.28);
}

.location-system-name {
    display: inline-block;
    margin-bottom: 0.32rem;
    color: rgba(153, 190, 232, 0.72);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.stellar-map-svg-expanded {
    min-width: 820px;
}

.stellar-system-label {
    fill: rgba(130, 198, 255, 0.82);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 4px;
    text-anchor: middle;
}

.stellar-system-label.nebula-label {
    fill: rgba(211, 159, 255, 0.88);
}

.stellar-map-routes .interstellar-route {
    stroke: rgba(128, 192, 255, 0.76);
    stroke-width: 2.3;
    stroke-dasharray: 10 8;
}

.stellar-map-routes .nebula-route {
    stroke: rgba(198, 139, 255, 0.48);
}

.stellar-map-route-costs .interstellar-cost {
    fill: #9cd2ff;
    font-weight: 900;
}

.stellar-map-node.nebula-node circle:first-child {
    fill: #9f74e9;
}

.stellar-map-node.nhexari-node path {
    fill: #f06982;
    stroke: rgba(255, 202, 210, 0.88);
    stroke-width: 1.4;
}

.stellar-map-node.black-spire-node circle:first-child {
    fill: #8096ae;
}

.stellar-black-hole {
    fill: #010207;
    stroke: rgba(188, 117, 255, 0.58);
    stroke-width: 3;
}

.stellar-black-hole-ring {
    fill: none;
    stroke: rgba(180, 121, 255, 0.22);
    stroke-width: 8;
    stroke-dasharray: 12 9;
}

.nhexari-combat-zone {
    border-color: rgba(227, 84, 111, 0.3);
}

.nebula-operation-modal {
    max-width: 760px;
}

.nebula-operation-modal .mission-scene-image {
    max-height: none;
    object-fit: cover;
}

.nebula-combat-backdrop {
    box-shadow: inset 0 0 85px rgba(117, 62, 184, 0.22);
}

.combat-item-picker {
    margin: 0.85rem 0;
    border: 1px solid rgba(110, 181, 255, 0.24);
    border-radius: 12px;
    background: rgba(4, 13, 29, 0.72);
    overflow: hidden;
}

.combat-item-picker > summary {
    list-style: none;
    cursor: pointer;
    width: 100%;
}

.combat-item-picker > summary::-webkit-details-marker {
    display: none;
}

.combat-item-action {
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(39, 103, 156, 0.44), rgba(14, 42, 74, 0.5));
}

.combat-item-picker-menu {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(110, 181, 255, 0.16);
}

.combat-item-picker-menu p {
    margin: 0;
    color: var(--muted);
}

.combat-item-form button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    text-align: left;
}

.combat-item-form button small {
    color: var(--muted);
    text-align: right;
}

.combat-retreat-inline {
    margin-top: 0.55rem;
}

@media (max-width: 760px) {
    .stellar-map-display {
        overflow-x: auto;
    }

    .stellar-map-svg-expanded {
        width: 820px;
        max-width: none;
    }

    .nebula-operation-modal {
        max-width: min(760px, calc(100vw - 1rem));
    }
}


/* Alpha 1.8: intersystem jump-gate cutscene */
.system-jump-backdrop {
    position: fixed;
    inset: 0;
    z-index: 18000;
    display: grid;
    place-items: center;
    padding: clamp(12px, 3vw, 36px);
    background: rgba(1, 5, 14, .94);
    backdrop-filter: blur(10px);
    animation: system-jump-backdrop-in .38s ease both;
}
.system-jump-shell {
    position: relative;
    width: min(760px, 96vw);
    aspect-ratio: 1 / 1;
    max-height: 88vh;
    overflow: hidden;
    border: 1px solid rgba(103, 203, 255, .7);
    border-radius: 18px;
    background: #030914;
    box-shadow: 0 0 0 1px rgba(40, 112, 173, .26), 0 24px 90px rgba(0, 0, 0, .72), 0 0 58px rgba(56, 163, 255, .16);
}
.system-jump-video,
.system-jump-overlay,
.system-jump-scanlines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.system-jump-video { object-fit: cover; }
.system-jump-overlay {
    background: linear-gradient(180deg, rgba(2, 8, 18, .08) 25%, rgba(2, 8, 18, .72) 70%, rgba(2, 8, 18, .96) 100%);
    pointer-events: none;
}
.system-jump-scanlines {
    z-index: 2;
    pointer-events: none;
    opacity: .28;
    background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(95, 218, 255, .16) 4px, transparent 5px);
    animation: system-jump-scan 1.6s linear infinite;
}
.system-jump-hud {
    position: absolute;
    z-index: 3;
    left: clamp(18px, 4vw, 42px);
    right: clamp(18px, 4vw, 42px);
    bottom: clamp(18px, 4vw, 38px);
    color: #ecf8ff;
    text-shadow: 0 2px 12px rgba(0,0,0,.85);
}
.system-jump-hud h2 {
    margin: 4px 0 10px;
    font-size: clamp(1.15rem, 3vw, 2rem);
    letter-spacing: .08em;
}
.system-jump-hud p { max-width: 650px; margin: 10px 0 12px; color: rgba(230, 246, 255, .88); }
.system-jump-route {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.system-jump-route i { flex: 1 1 36px; min-width: 28px; height: 1px; background: linear-gradient(90deg, transparent, #73d9ff, transparent); }
.system-jump-route strong { color: #7ce4ff; }
.system-jump-fee {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin: 0 12px 0 0;
    padding: 7px 10px;
    border: 1px solid rgba(112, 210, 255, .45);
    background: rgba(2, 17, 31, .74);
    font-size: .76rem;
    letter-spacing: .08em;
}
.system-jump-fee strong { color: #9feaff; }
.system-jump-skip { position: relative; z-index: 4; }
.system-jump-backdrop.is-system-jump-ending { animation: system-jump-backdrop-out .42s ease both; pointer-events: none; }
.docking-backdrop.is-held-for-system-jump { visibility: hidden; pointer-events: none; }
@keyframes system-jump-backdrop-in { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }
@keyframes system-jump-backdrop-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.985); } }
@keyframes system-jump-scan { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
@media (max-width: 720px) {
    .system-jump-backdrop { padding: 8px; }
    .system-jump-shell { width: 100%; max-height: 82vh; border-radius: 12px; }
    .system-jump-hud { left: 16px; right: 16px; bottom: 16px; }
    .system-jump-hud p { font-size: .88rem; }
    .system-jump-route { gap: 5px; font-size: .68rem; }
}


/* Alpha 1.9 — progressive tutorial and interface cleanup */
.progressive-tip-backdrop {
    position: fixed;
    inset: 0;
    z-index: 17500;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 5, 12, 0.78);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.progressive-tip-backdrop[hidden] {
    display: none !important;
}

.progressive-tip-backdrop.is-visible {
    opacity: 1;
}

.progressive-tip-backdrop.closing {
    opacity: 0;
}

.progressive-tip-card {
    width: min(460px, 100%);
    padding: 1.35rem;
    border: 1px solid rgba(83, 220, 255, 0.42);
    border-radius: 16px;
    background: linear-gradient(155deg, rgba(83, 220, 255, 0.09), transparent 42%), #0b1222;
    box-shadow: 0 0 42px rgba(83, 220, 255, 0.18), var(--shadow);
    text-align: left;
}

.progressive-tip-card h2 {
    margin: 0.35rem 0 0.65rem;
}

.progressive-tip-card p {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.6;
}

.tutorial-selene-message {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-top: 0.8rem;
    text-align: left;
}

.tutorial-selene-message[hidden] {
    display: none !important;
}

.tutorial-selene-message > img {
    width: 112px;
    height: 148px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid rgba(83, 220, 255, 0.34);
    border-radius: 12px;
    background: #07101e;
}

.tutorial-selene-bubble {
    position: relative;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(106, 225, 255, 0.24);
    border-radius: 14px;
    background: rgba(5, 14, 29, 0.92);
}

.tutorial-selene-bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 32px;
    width: 14px;
    height: 14px;
    border-left: 1px solid rgba(106, 225, 255, 0.24);
    border-bottom: 1px solid rgba(106, 225, 255, 0.24);
    background: rgba(5, 14, 29, 0.98);
    transform: rotate(45deg);
}

.tutorial-selene-bubble > strong {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--cyan-hot);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tutorial-selene-bubble p {
    margin: 0;
    color: #dcecff;
    line-height: 1.58;
    text-align: left;
}

.tutorial-selene-bubble b {
    color: #ffffff;
    font-weight: 900;
}

.game-tutorial-callout.is-npc-step {
    width: min(650px, calc(100vw - 24px));
    text-align: left;
}

.game-tutorial-callout.is-npc-step > h2 {
    margin-bottom: 0.2rem;
}

.travel-status-readout .fuel-display b {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

.mission-embark-button span {
    color: #07131f !important;
    text-shadow: none !important;
}

.permit-access-card strong.is-positive,
.permit-requirement-grid strong.is-positive {
    color: #6dff9a;
    text-shadow: 0 0 12px rgba(72, 255, 132, 0.22);
}

.interaction-summary-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
}

.mission-turnin-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(255, 205, 92, 0.54);
    border-radius: 999px;
    background: rgba(108, 66, 8, 0.62);
    color: #ffe395;
    font-size: 0.58rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: 0 0 14px rgba(255, 184, 55, 0.14);
}

.store-actions button:disabled,
.store-actions button[aria-disabled="true"] {
    cursor: not-allowed !important;
    opacity: 0.34 !important;
    filter: saturate(0.35);
    box-shadow: none !important;
    pointer-events: none;
}

.contract-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.65rem;
    padding: 0.55rem 0.75rem;
    border-left: 3px solid var(--cyan);
    background: rgba(83, 220, 255, 0.055);
}

.contract-section-label span,
.contract-section-label strong {
    color: var(--cyan-hot);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.completed-contract-label {
    margin-top: 1rem;
    border-left-color: #6dff9a;
    background: rgba(72, 255, 132, 0.045);
}

.completed-contract-label span,
.completed-contract-label strong {
    color: #83f5a8;
}

.mission-card {
    position: relative;
    overflow: hidden;
}

.mission-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: rgba(145, 165, 186, 0.35);
}

.mission-card.mission-status-active {
    border-color: rgba(83, 220, 255, 0.34);
    background: linear-gradient(90deg, rgba(22, 105, 143, 0.08), rgba(8, 13, 25, 0.92) 34%);
}

.mission-card.mission-status-active::before {
    background: var(--cyan);
    box-shadow: 0 0 16px rgba(83, 220, 255, 0.45);
}

.mission-card.mission-status-active .mission-status-line strong {
    color: var(--cyan-hot);
}

.mission-card.mission-status-not-started {
    border-color: rgba(243, 200, 108, 0.25);
}

.mission-card.mission-status-not-started::before {
    background: var(--amber);
}

.mission-card.mission-status-not-started .mission-status-line strong {
    color: #f3c86c;
}

.mission-card.mission-status-completed {
    border-color: rgba(109, 255, 154, 0.22);
    background: linear-gradient(90deg, rgba(72, 255, 132, 0.055), rgba(8, 13, 25, 0.92) 34%);
}

.mission-card.mission-status-completed::before {
    background: #6dff9a;
}

.mission-card.mission-status-completed .mission-status-line strong {
    color: #6dff9a;
}

.mission-card.mission-status-failed {
    border-color: rgba(255, 92, 104, 0.3);
}

.mission-card.mission-status-failed::before {
    background: #ff6670;
}

.mission-card.mission-status-failed .mission-status-line strong {
    color: #ff9ca4;
}

.combat-retreat-action,
.combat-retreat-action:hover,
.combat-retreat-action:focus-visible {
    border-color: rgba(255, 119, 127, 0.9) !important;
    background: linear-gradient(180deg, #9b2632, #641823) !important;
    color: #fff7f7 !important;
}

.combat-retreat-action small {
    color: #ffe4e6 !important;
}

@media (max-width: 720px) {
    .tutorial-selene-message {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 0.7rem;
    }

    .tutorial-selene-message > img {
        width: 78px;
        height: 104px;
    }

    .tutorial-selene-bubble {
        padding: 0.8rem;
    }

    .interaction-summary {
        position: relative;
    }

    .interaction-summary-status {
        position: absolute;
        right: 4.35rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .interaction-summary-status .interaction-rep {
        display: none;
    }

    .mission-turnin-indicator {
        font-size: 0.52rem;
        padding-inline: 0.36rem;
    }
}


/* Alpha 1.10 pre-Beta polish */
.location-hero-tags .jump-gate-service-tag {
    border-color: rgba(93, 255, 157, 0.52);
    color: #78ffad;
    background: rgba(24, 104, 62, 0.24);
    box-shadow: 0 0 14px rgba(74, 255, 142, 0.10);
}

.travel-intercept-alert-copy strong {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
}

.crew-ready-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(109, 255, 154, 0.5);
    border-radius: 999px;
    background: rgba(18, 92, 50, 0.52);
    color: #8dffb4;
    font-size: 0.56rem;
    font-weight: 950;
    letter-spacing: 0.07em;
    white-space: nowrap;
    text-transform: uppercase;
}

.crew-referral-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-top: 0.85rem;
    padding: 0.85rem;
    border: 1px solid rgba(92, 211, 255, 0.24);
    border-radius: 12px;
    background: rgba(5, 18, 34, 0.72);
}

.crew-referral-card > img {
    width: 118px;
    height: 148px;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid rgba(124, 202, 255, 0.28);
}

.crew-referral-card > div > span {
    color: var(--cyan-hot);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.crew-referral-card h3 {
    margin: 0.2rem 0 0.35rem;
}

.crew-referral-card p {
    margin: 0 0 0.45rem;
}

.crew-referral-card > div > strong {
    color: #8dffb4;
}

.mission-turnin-button {
    animation: mission-turnin-button-blink 1s steps(2, end) infinite;
    border-color: rgba(255, 212, 97, 0.78) !important;
}

@keyframes mission-turnin-button-blink {
    0%, 49% {
        filter: brightness(1.3);
        box-shadow: 0 0 0 1px rgba(255, 229, 143, 0.42) inset, 0 0 22px rgba(255, 190, 58, 0.48);
    }
    50%, 100% {
        filter: brightness(0.88);
        box-shadow: 0 0 0 1px rgba(255, 211, 104, 0.16) inset, 0 0 7px rgba(255, 190, 58, 0.13);
    }
}

.captured-ship-offer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(124, 177, 255, 0.18);
}

.nhexari-ship-card {
    border-color: rgba(240, 105, 130, 0.28);
    box-shadow: inset 0 0 38px rgba(154, 35, 60, 0.08);
}

@media (max-width: 720px) {
    .crew-referral-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .crew-referral-card > img {
        width: 92px;
        height: 122px;
    }
    .crew-referral-card > form {
        grid-column: 1 / -1;
    }
    .crew-referral-card > form button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mission-turnin-button {
        animation: none !important;
        box-shadow: 0 0 0 1px rgba(255, 229, 143, 0.36) inset, 0 0 18px rgba(255, 190, 58, 0.35);
    }
}

/* Beta 1.0 launch systems */
.location-services .jump-gate-service-tag {
    border-color: rgba(93, 255, 157, 0.52);
    color: #78ffad;
    background: rgba(24, 104, 62, 0.24);
    box-shadow: 0 0 14px rgba(74, 255, 142, 0.10);
}

.notification-log-button {
    min-width: 112px;
}

.notification-log-backdrop {
    position: fixed;
    inset: 0;
    z-index: 16000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 5, 14, 0.82);
    backdrop-filter: blur(7px);
}

.notification-log-backdrop[hidden] { display: none; }

.notification-log-modal {
    width: min(680px, 96vw);
    max-height: min(78vh, 760px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    padding: 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(165deg, rgba(10, 18, 34, 0.99), rgba(7, 12, 25, 0.99));
    box-shadow: var(--shadow), 0 0 38px rgba(83, 220, 255, 0.12);
}

.notification-log-modal > header,
.notification-log-modal > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.notification-log-modal > header span {
    color: var(--cyan);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.notification-log-modal h2 { margin: 0.15rem 0 0; }
.notification-log-help { margin: 0; color: var(--muted); line-height: 1.5; }
.notification-log-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,0.035);
    color: var(--text);
    font-size: 1.35rem;
    cursor: pointer;
}

.notification-log-list {
    min-height: 150px;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 0.55rem;
    padding-right: 0.25rem;
}

.notification-log-entry {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.68rem 0.75rem;
    border: 1px solid var(--line);
    border-left-width: 4px;
    background: rgba(255,255,255,0.025);
}
.notification-log-entry time { color: var(--muted); font-size: 0.72rem; }
.notification-log-entry p { margin: 0; line-height: 1.4; }
.notification-log-success { border-left-color: var(--green); }
.notification-log-warning { border-left-color: var(--amber); }
.notification-log-error { border-left-color: var(--danger); }
.notification-log-info { border-left-color: var(--cyan); }
.notification-log-empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }

.power-routing-panel {
    grid-column: 1 / -1;
    padding: 1.15rem;
    border: 1px solid rgba(165, 107, 255, 0.38);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(21, 21, 48, 0.88), rgba(9, 17, 33, 0.92));
    box-shadow: 0 18px 40px rgba(0,0,0,0.2);
}

.power-routing-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.power-routing-heading h2 { margin: 0.2rem 0; }
.power-routing-heading p { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.5; }
.routing-budget {
    min-width: 145px;
    padding: 0.75rem;
    border: 1px solid rgba(165, 107, 255, 0.34);
    background: rgba(165, 107, 255, 0.08);
    text-align: right;
}
.routing-budget span, .routing-budget small { display: block; color: var(--muted); font-size: 0.62rem; letter-spacing: 0.08em; }
.routing-budget strong { display: block; margin: 0.2rem 0; font-size: 1.35rem; color: var(--cyan-hot); }

.power-routing-readout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}
.power-routing-readout article {
    padding: 0.8rem;
    border: 1px solid var(--line);
    background: rgba(5, 12, 25, 0.6);
}
.power-routing-readout span, .power-routing-readout small { display: block; color: var(--muted); font-size: 0.68rem; }
.power-routing-readout strong { display: block; margin: 0.25rem 0; color: var(--cyan-hot); font-size: 1.55rem; }
.power-routing-readout small b { color: var(--violet); }

.power-routing-controls {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
    align-items: end;
    gap: 0.65rem;
    margin-top: 0.8rem;
}
.power-routing-controls label span { display: block; margin-bottom: 0.3rem; color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; }
.power-routing-controls select {
    width: 100%;
    min-height: 42px;
    padding: 0 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0a1323;
    color: var(--text);
}
.power-routing-status { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.78rem; }
.power-routing-reset { margin-top: 0.55rem; }

@media (max-width: 760px) {
    .notification-log-button { min-width: 0; padding-inline: 0.65rem; }
    .notification-log-entry { grid-template-columns: 1fr; gap: 0.25rem; }
    .power-routing-heading { display: grid; }
    .routing-budget { width: 100%; text-align: left; }
    .power-routing-readout { grid-template-columns: 1fr; }
    .power-routing-controls { grid-template-columns: 1fr 1fr; }
    .power-routing-controls .primary-button,
    .power-routing-controls .ghost-button { width: 100%; }
}
