:root {
  color-scheme: dark;
  --bg: #07090f;
  --panel: rgba(18, 24, 32, 0.86);
  --panel-strong: rgba(26, 35, 45, 0.94);
  --line: rgba(156, 190, 196, 0.22);
  --text: #edf7f8;
  --muted: #9fb0b5;
  --accent: #55d0b6;
  --accent-strong: #f2c94c;
  --danger: #ff6978;
  --blue: #77a9ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #07090f;
  background-image:
    radial-gradient(circle, rgba(237, 247, 248, 0.72) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(85, 208, 182, 0.48) 0 1px, transparent 1.3px),
    linear-gradient(135deg, #07090f 0%, #101821 48%, #0b0f14 100%);
  background-position: 0 0, 48px 74px, 0 0;
  background-size: 170px 170px, 260px 260px, auto;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  min-height: 38px;
  border: 1px solid rgba(85, 208, 182, 0.4);
  border-radius: 7px;
  background: rgba(85, 208, 182, 0.13);
  color: var(--text);
  font: 700 0.86rem Inter, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(85, 208, 182, 0.85);
  background: rgba(85, 208, 182, 0.22);
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

button[aria-disabled="true"]:hover {
  border-color: rgba(85, 208, 182, 0.4);
  background: rgba(85, 208, 182, 0.13);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(156, 190, 196, 0.24);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  padding: 10px;
  font: 700 0.86rem/1.35 "IBM Plex Mono", monospace;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font: 800 0.72rem/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.is-hidden {
  display: none !important;
}

.danger-button {
  border-color: rgba(255, 105, 120, 0.42);
  background: rgba(255, 105, 120, 0.14);
}

.icon-button {
  width: 42px;
  font-size: 1rem;
}

.settings-button {
  min-width: 92px;
  padding: 0 12px;
}

.user-badge {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid rgba(156, 190, 196, 0.22);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--muted);
  font: 800 0.74rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(156, 190, 196, 0.28);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(18, 24, 32, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
  color: var(--text);
  animation: toast-in 180ms ease both;
  backdrop-filter: blur(16px);
}

.toast strong {
  font-size: 0.86rem;
}

.toast span {
  color: #cfdee0;
  font: 700 0.76rem/1.42 "IBM Plex Mono", monospace;
}

.toast--warning {
  border-left-color: var(--accent-strong);
}

.toast--success {
  border-left-color: var(--accent);
}

.toast--danger {
  border-left-color: var(--danger);
}

.toast.is-leaving {
  animation: toast-out 160ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar,
.panel,
.status-grid article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  padding: 22px;
  border-radius: 8px;
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.92;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-overlay,
.auth-overlay,
.comms-overlay,
.notes-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 9, 15, 0.74);
  backdrop-filter: blur(10px);
}

.auth-overlay,
.comms-overlay,
.notes-overlay {
  z-index: 30;
}

.settings-panel,
.auth-panel,
.comms-panel,
.notes-panel {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(480px, 100%);
}

.notes-panel {
  width: min(720px, calc(100vw - 32px));
}

.auth-form,
.provider-settings,
.notes-panel {
  display: grid;
  gap: 12px;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.provider-settings {
  margin-top: 18px;
  border-top: 1px solid rgba(156, 190, 196, 0.16);
  padding-top: 18px;
}

.compact-header {
  min-height: auto;
  padding: 0;
}

.compact-header h3 {
  margin: 0;
}

.comms-panel {
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.comms-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.comms-sidebar,
.comms-main {
  min-height: 0;
}

.comms-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.comms-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.comms-tabs button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.comms-tabs button.is-active,
.npc-card.is-active {
  border-color: rgba(242, 201, 76, 0.72);
  background: rgba(242, 201, 76, 0.13);
}

.npc-list,
.comms-social-tools,
.pending-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.comms-sidebar > .npc-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.npc-card,
.pending-action,
.comms-social-tools {
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.npc-card {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 0;
  text-align: left;
}

.npc-card--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
}

.npc-card strong,
.pending-action strong {
  color: var(--text);
}

.npc-card span,
.pending-action span {
  color: var(--muted);
  font: 800 0.68rem/1.35 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.comms-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.comms-selected-context {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.comms-selected-context.is-hidden {
  display: none;
}

.selected-contact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.selected-contact strong,
.selected-contact p {
  display: block;
}

.selected-contact p {
  margin: 4px 0 0;
  color: #cfdee0;
  font: 700 0.78rem/1.4 "IBM Plex Mono", monospace;
}

.selected-contact__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.selected-contact__facts span {
  display: inline-flex;
  border: 1px solid rgba(156, 190, 196, 0.2);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font: 800 0.68rem/1.35 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.character-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.character-vitals span {
  display: inline-flex;
  border: 1px solid rgba(85, 208, 182, 0.2);
  border-radius: 6px;
  padding: 3px 7px;
  color: #edf7f8;
  background: rgba(85, 208, 182, 0.06);
  font: 800 0.66rem/1.35 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.selected-contact .selected-contact__appearance {
  color: #edf7f8;
}

.selected-contact__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 8px;
  min-width: min(240px, 100%);
}

.selected-contact__actions button {
  min-width: 104px;
  padding: 0 8px;
}

.comms-message-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.comms-message {
  display: grid;
  gap: 4px;
  max-width: 78ch;
  border-left: 3px solid rgba(85, 208, 182, 0.48);
  padding-left: 10px;
  color: #dce9ea;
  font: 700 0.82rem/1.45 "IBM Plex Mono", monospace;
  white-space: pre-wrap;
}

.comms-message[data-kind="npc"],
.comms-message[data-kind="system"] {
  border-left-color: rgba(242, 201, 76, 0.66);
}

.comms-message strong {
  color: var(--text);
  font-family: Inter, sans-serif;
}

.comms-message__body {
  display: grid;
  gap: 5px;
}

.comms-line {
  margin: 0;
}

.comms-line--action {
  color: #a9bdc1;
  font-style: italic;
}

.comms-line--action::before {
  content: "[action] ";
  color: var(--accent-strong);
  font-style: normal;
  text-transform: uppercase;
}

.comms-line--speech::before {
  content: "[says] ";
  color: rgba(85, 208, 182, 0.92);
  text-transform: uppercase;
}

.comms-line--system {
  color: var(--accent-strong);
}

/* NPC typing indicator */
.comms-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0 2px;
}

.comms-typing-indicator__label {
  color: #a9bdc1;
  font: 0.75rem/1 "IBM Plex Mono", monospace;
  font-style: italic;
  margin-right: 4px;
}

.comms-typing-indicator__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(242, 201, 76, 0.75);
  animation: typing-dot 1.1s ease-in-out infinite;
}

.comms-typing-indicator__dot:nth-child(3) { animation-delay: 0.18s; }
.comms-typing-indicator__dot:nth-child(4) { animation-delay: 0.36s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

.comms-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: stretch;
  flex: 0 0 auto;
}

.note-target-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-target-tabs button {
  min-height: 34px;
  padding: 0 10px;
}

.note-target-tabs button.is-active {
  border-color: rgba(242, 201, 76, 0.72);
  background: rgba(242, 201, 76, 0.13);
}

.notes-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-note {
  margin: 0 0 12px;
  color: #cfdee0;
  font: 500 0.86rem/1.45 "IBM Plex Mono", monospace;
}

.cheat-list {
  display: grid;
  gap: 8px;
}

.cheat-toggle {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.cheat-toggle:has(input:checked) {
  border-color: rgba(242, 201, 76, 0.46);
  background: rgba(242, 201, 76, 0.1);
}

.cheat-toggle input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent-strong);
}

.cheat-toggle strong,
.cheat-toggle em {
  display: block;
}

.cheat-toggle strong {
  font-size: 0.95rem;
}

.cheat-toggle em {
  margin-top: 4px;
  color: var(--muted);
  font: 700 0.72rem/1.4 "IBM Plex Mono", monospace;
  font-style: normal;
}

.breadcrumb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(18, 24, 32, 0.74);
  color: #dbe9eb;
  font: 700 0.78rem "IBM Plex Mono", monospace;
}

.breadcrumb-bar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-bar span:not(:last-child)::after {
  content: ">";
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.status-grid article {
  min-height: 72px;
  padding: 14px;
  border-radius: 8px;
}

.status-grid span,
.system-facts dt,
.market-table small,
.inventory span,
.travel-card small,
.mission-card small,
.current-place small,
.place-card small,
.planet-card small {
  display: block;
  color: var(--muted);
  font: 600 0.72rem "IBM Plex Mono", monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.console-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.console-nav button {
  min-width: 0;
  border-color: rgba(156, 190, 196, 0.24);
  background: rgba(18, 24, 32, 0.86);
  color: #dbe9eb;
}

.console-nav button.is-active {
  border-color: rgba(242, 201, 76, 0.66);
  background: rgba(242, 201, 76, 0.15);
  color: var(--accent-strong);
}

.console-views {
  min-height: 560px;
  height: min(760px, calc(100vh - 292px));
}

.view {
  display: none;
  height: 100%;
}

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

.fill-panel {
  height: 100%;
  overflow: auto;
}

.ship-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1fr);
  gap: 12px;
  height: 100%;
}

.ship-status-panel {
  grid-row: span 2;
}

.ship-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ship-summary article,
.upgrade-card,
.ship-ai-card {
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.ship-summary article {
  display: grid;
  gap: 5px;
  padding: 10px;
}

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

.ship-summary small,
.upgrade-card small,
.upgrade-effect span,
.upgrade-effect em,
.upgrade-materials span,
.upgrade-actions span {
  color: var(--muted);
  font: 700 0.7rem/1.35 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.ship-summary strong {
  font-size: 1.35rem;
}

.ship-summary span,
.upgrade-card p {
  margin: 0;
  color: #cfdee0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.upgrade-list {
  display: grid;
  gap: 10px;
}

.ship-ai-panel {
  margin-bottom: 12px;
}

.ship-ai-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-color: rgba(85, 208, 182, 0.24);
}

.ship-ai-card.is-locked {
  border-color: rgba(242, 201, 76, 0.34);
  background: rgba(242, 201, 76, 0.07);
}

.ship-ai-card strong {
  display: block;
  margin: 4px 0 6px;
  font-size: 1.08rem;
}

.ship-ai-card small,
.ship-ai-meta span,
.ship-ai-actions span {
  color: var(--muted);
  font: 700 0.7rem/1.35 "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.ship-ai-card p {
  margin: 0;
  color: #cfdee0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.ship-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.ship-ai-description {
  grid-column: 1 / -1;
}

.ship-ai-form button {
  grid-column: 1 / -1;
}

.ship-ai-meta,
.ship-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ship-ai-actions {
  justify-content: space-between;
}

.upgrade-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.upgrade-card strong {
  display: block;
  margin: 4px 0 6px;
}

.upgrade-card.is-blocked {
  border-color: rgba(156, 190, 196, 0.11);
}

.upgrade-card.is-offered {
  border-color: rgba(85, 208, 182, 0.24);
}

.upgrade-card.is-unavailable {
  opacity: 0.82;
}

.upgrade-effect {
  display: grid;
  gap: 4px;
}

.upgrade-effect em {
  color: #8fd8ce;
  font-style: normal;
}

.upgrade-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.upgrade-materials small {
  flex-basis: 100%;
}

.upgrade-materials span {
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.14);
}

.upgrade-materials span.missing {
  border-color: rgba(242, 201, 76, 0.36);
  color: var(--accent-strong);
}

.upgrade-materials span.waived {
  border-color: rgba(85, 208, 182, 0.38);
  color: #8fd8ce;
}

.upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.upgrade-actions button {
  flex: 1 1 180px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
  gap: 12px;
}

.primary-column,
.side-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: none;
}

.chart-controls button {
  min-width: 38px;
  padding: 0 10px;
}

.chart-controls span {
  min-width: 54px;
  color: var(--accent-strong);
  font: 700 0.75rem "IBM Plex Mono", monospace;
  text-align: center;
}

.panel h2 {
  font-size: 1.2rem;
}

.system-description {
  margin: 0;
  color: #d7e5e7;
  line-height: 1.55;
}

.system-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 0;
}

.system-facts div {
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 7px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.system-facts dd {
  margin: 8px 0 0;
  font-weight: 700;
}

.current-place {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid rgba(242, 201, 76, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(242, 201, 76, 0.08);
}

.current-place strong {
  font-size: 1.12rem;
}

.current-place p,
.place-card p,
.planet-card p,
#localTargetSummary {
  margin: 0;
  color: #cfdee0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.zoom-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.zoom-tabs button {
  border-color: rgba(156, 190, 196, 0.24);
  background: rgba(0, 0, 0, 0.18);
}

.zoom-tabs button.is-active {
  border-color: rgba(242, 201, 76, 0.66);
  background: rgba(242, 201, 76, 0.14);
  color: var(--accent-strong);
}

.zoom-tabs button:disabled {
  opacity: 0.32;
}

.local-browser {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.local-places,
.local-detail {
  min-width: 0;
}

.local-detail.is-transitioning {
  animation: local-zoom-pop 220ms ease;
}

@keyframes local-zoom-pop {
  from {
    opacity: 0.62;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.local-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.local-detail h3 {
  margin: 0;
  font-size: 1rem;
}

.place-list,
.planet-list,
.target-list {
  display: grid;
  gap: 10px;
}

.target-list {
  align-content: start;
}

.target-button {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 86px;
  padding: 12px;
  text-align: left;
  border-color: rgba(156, 190, 196, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.target-button.is-active {
  border-color: rgba(242, 201, 76, 0.58);
  background: rgba(242, 201, 76, 0.12);
}

.target-button small,
.target-button span {
  color: var(--muted);
  font: 700 0.7rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.target-button strong {
  overflow-wrap: anywhere;
}

.local-target-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

.scroll-area {
  max-height: min(520px, calc(100vh - 460px));
  overflow: auto;
  padding-right: 4px;
}

.place-card,
.planet-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.place-card.compact {
  background: rgba(0, 0, 0, 0.12);
}

.place-card strong,
.planet-card strong {
  line-height: 1.25;
}

.system-orbit-map {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(156, 190, 196, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 10, 15, 0.62);
}

.system-orbit-map__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.system-orbit-map__header small,
.system-orbit-map__header span {
  color: var(--muted);
  font: 700 0.7rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.system-orbit-map__header strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.local-orbit-chart {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 201, 76, 0.13), transparent 10rem),
    radial-gradient(circle at 18% 78%, rgba(85, 208, 182, 0.09), transparent 15rem),
    linear-gradient(rgba(156, 190, 196, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(156, 190, 196, 0.06) 1px, transparent 1px),
    rgba(2, 7, 11, 0.84);
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
}

.local-orbit-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.local-orbit-ring {
  fill: none;
  stroke: rgba(156, 190, 196, 0.2);
  stroke-width: 0.22;
  stroke-dasharray: 0.8 1.6;
}

.local-orbit-ring.station-ring {
  stroke: rgba(85, 208, 182, 0.32);
  stroke-dasharray: 1.4 1.2;
}

.local-star-node {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 244, 194, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff8d6 0 10%, #f2c94c 24%, #c88831 52%, rgba(242, 201, 76, 0.2) 72%, transparent 73%);
  box-shadow: 0 0 42px rgba(242, 201, 76, 0.72);
  transform: translate(-50%, -50%);
}

.local-star-node span {
  position: absolute;
  top: 62px;
  left: 50%;
  width: max-content;
  max-width: 180px;
  color: var(--text);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  transform: translateX(-50%);
}

.local-body-node {
  position: absolute;
  display: block;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(237, 247, 248, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.local-body-node:hover {
  transform: translate(-50%, -50%) scale(1.07);
}

.local-body-node.is-active {
  border-color: rgba(242, 201, 76, 0.95);
  box-shadow: 0 0 28px rgba(242, 201, 76, 0.58);
}

.local-body-node--planet {
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 9%, #8fd8ce 18%, #3e8d94 48%, rgba(85, 208, 182, 0.16) 72%, transparent 73%);
  box-shadow: 0 0 22px rgba(85, 208, 182, 0.44);
}

.local-body-node--station {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(237, 247, 248, 0.95), rgba(119, 169, 255, 0.75) 24%, rgba(20, 35, 52, 0.96) 25% 64%, rgba(85, 208, 182, 0.68));
  box-shadow: 0 0 22px rgba(119, 169, 255, 0.5);
}

.local-body-node span,
.local-body-node small {
  position: absolute;
  left: 50%;
  width: max-content;
  max-width: 150px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  transform: translateX(-50%);
}

.local-body-node span {
  top: 34px;
  color: var(--text);
  font: 700 0.68rem "IBM Plex Mono", monospace;
}

.local-body-node small {
  top: 52px;
  color: var(--muted);
  font: 700 0.56rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.place-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.place-meta span {
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: #dbe9eb;
  font: 700 0.7rem "IBM Plex Mono", monospace;
}

.movement-panel,
.card-actions,
.flight-stats,
.travel-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.movement-panel {
  margin-top: 2px;
}

.movement-control {
  display: grid;
  gap: 5px;
  flex: 1 1 150px;
}

.movement-control span {
  color: var(--accent-strong);
  font: 700 0.68rem/1.35 "IBM Plex Mono", monospace;
}

.card-actions button {
  flex: 1 1 140px;
}

.flight-stats,
.travel-preview {
  border: 1px solid rgba(156, 190, 196, 0.15);
  border-radius: 7px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.flight-stats span,
.travel-preview span,
.travel-preview em,
.travel-note,
.travel-warning {
  color: #cfdee0;
  font: 700 0.7rem/1.35 "IBM Plex Mono", monospace;
}

.travel-preview em,
.travel-note,
.travel-warning {
  flex-basis: 100%;
  margin: 0;
  font-style: normal;
}

.travel-note {
  color: #8fd8ce;
}

.travel-warning {
  color: var(--accent-strong);
}

.planet-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.planet-jump {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
}

.planet-jump label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.planet-jump input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(156, 190, 196, 0.22);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 0 8px;
  font: 700 0.9rem "IBM Plex Mono", monospace;
}

.navigation-panel {
  overflow: auto;
}

.navigation-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.map-sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
}

.navigation-workspace {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.map {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 28%, rgba(85, 208, 182, 0.11), transparent 18rem),
    radial-gradient(circle at 76% 42%, rgba(242, 201, 76, 0.1), transparent 20rem),
    linear-gradient(rgba(156, 190, 196, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(156, 190, 196, 0.07) 1px, transparent 1px),
    rgba(5, 10, 15, 0.72);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  cursor: grab;
  touch-action: none;
}

.navigation-panel.map-expanded .navigation-layout {
  grid-template-columns: 1fr;
}

.navigation-panel.map-expanded .map-sidebar {
  position: static;
}

.navigation-panel.map-expanded .map {
  aspect-ratio: auto;
  height: min(560px, calc(100vh - 380px));
  min-height: 380px;
}

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

.galaxy-chart {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  transition: transform 140ms ease;
}

.map.is-dragging .galaxy-chart {
  transition: none;
}

.galaxy-routes {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.route-line {
  stroke: rgba(119, 169, 255, 0.4);
  stroke-width: 2;
  stroke-dasharray: 8 10;
  vector-effect: non-scaling-stroke;
}

.route-managed {
  stroke: rgba(85, 208, 182, 0.48);
}

.route-elevated {
  stroke: rgba(242, 201, 76, 0.52);
}

.route-severe {
  stroke: rgba(255, 105, 120, 0.56);
}

.route-unknown {
  stroke: rgba(156, 190, 196, 0.5);
}

.route-line.plotted {
  stroke: rgba(242, 201, 76, 0.95);
  stroke-width: 3;
  stroke-dasharray: 12 8;
}

.system-node {
  position: absolute;
  display: block;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(237, 247, 248, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0 9%, #a8c6ff 18%, #77a9ff 42%, rgba(119, 169, 255, 0.18) 72%, transparent 73%);
  box-shadow: 0 0 26px rgba(119, 169, 255, 0.78);
  transform: translate(-50%, -50%);
  overflow: visible;
}

.system-node:hover {
  transform: translate(-50%, -50%) scale(1.06);
  border-color: rgba(237, 247, 248, 0.88);
}

.system-node.current {
  width: 38px;
  height: 38px;
  border-color: rgba(255, 244, 194, 0.9);
  background:
    radial-gradient(circle at 34% 30%, #fff8d6 0 10%, #f2c94c 22%, #c88831 48%, rgba(242, 201, 76, 0.2) 72%, transparent 73%);
  box-shadow: 0 0 42px rgba(242, 201, 76, 0.92);
}

.system-node:disabled {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.system-node.plotted {
  border-color: rgba(242, 201, 76, 0.92);
  box-shadow: 0 0 34px rgba(242, 201, 76, 0.76);
}

.system-node.signal {
  border-color: rgba(156, 190, 196, 0.52);
  background:
    radial-gradient(circle at 50% 50%, rgba(237, 247, 248, 0.95) 0 10%, rgba(143, 216, 206, 0.38) 18%, rgba(143, 216, 206, 0.06) 46%, transparent 72%);
  box-shadow: 0 0 22px rgba(143, 216, 206, 0.38);
}

.system-node.signal::before {
  border-style: dashed;
  border-color: rgba(143, 216, 206, 0.3);
}

.system-node.current:hover,
.system-node:disabled:hover {
  transform: translate(-50%, -50%);
}

.system-node::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(237, 247, 248, 0.16);
  border-radius: 50%;
}

.system-node .star-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.system-node .star-label {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 150px;
  color: var(--text);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.navigation-panel:not(.map-expanded) .system-node .star-label {
  top: 28px;
  max-width: 92px;
  font-size: 0.58rem;
}

.system-node small {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  color: var(--muted);
  font: 700 0.62rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.navigation-panel:not(.map-expanded) .system-node small {
  top: 44px;
  font-size: 0.52rem;
}

.system-details {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 118px;
  border: 1px solid rgba(156, 190, 196, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.system-details small {
  display: block;
  color: var(--muted);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.system-details strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.system-details p {
  max-width: 760px;
  margin: 7px 0 10px;
  color: #cfdee0;
  line-height: 1.45;
}

.system-details button {
  flex: none;
}

.system-detail-actions,
.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

.travel-list,
.mission-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

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

.plotted-course {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  border: 1px solid rgba(242, 201, 76, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(242, 201, 76, 0.08);
}

.gate-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(85, 208, 182, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(85, 208, 182, 0.07);
}

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

.gate-header small,
.gate-card small {
  display: block;
  color: var(--muted);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.gate-header strong,
.gate-card strong {
  display: block;
  margin-top: 5px;
}

.gate-header span,
.gate-card p {
  margin: 5px 0 0;
  color: #cfdee0;
  font: 600 0.78rem/1.4 "IBM Plex Mono", monospace;
}

.galaxy-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.galaxy-chips span {
  border: 1px solid rgba(156, 190, 196, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: #dbe9eb;
  font: 700 0.68rem "IBM Plex Mono", monospace;
}

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

.gate-card {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.gate-card.ancient {
  border-color: rgba(242, 201, 76, 0.28);
  background: rgba(242, 201, 76, 0.07);
}

.gate-card.player,
.gate-card.player-build {
  border-color: rgba(119, 169, 255, 0.26);
  background: rgba(119, 169, 255, 0.07);
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.plotted-course strong,
.plotted-course span {
  display: block;
}

.plotted-course span {
  margin-top: 5px;
  color: var(--muted);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.travel-card,
.mission-card,
.active-mission,
.market-row,
.inventory-row {
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.travel-card,
.mission-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.catalog-detail {
  display: grid;
  gap: 12px;
}

.catalog-header,
.catalog-section,
.planet-detail-panel {
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-color: rgba(242, 201, 76, 0.28);
  background: rgba(242, 201, 76, 0.07);
}

.catalog-header.signal-header {
  border-color: rgba(143, 216, 206, 0.34);
  background: rgba(143, 216, 206, 0.07);
}

.catalog-header small,
.catalog-section__header small,
.resource-card small,
.catalog-planet-button small,
.planet-detail-panel small,
.planet-detail-columns small {
  display: block;
  color: var(--muted);
  font: 700 0.72rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.catalog-header h3 {
  margin: 6px 0 8px;
  font-size: 1.35rem;
}

.catalog-header p,
.catalog-section p,
.planet-detail-panel p,
.resource-card em,
.resource-card span,
.catalog-planet-button span {
  margin: 0;
  color: #cfdee0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.catalog-section {
  display: grid;
  gap: 10px;
}

.catalog-section__header {
  display: grid;
  gap: 5px;
}

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

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

.resource-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(156, 190, 196, 0.15);
  border-radius: 7px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.resource-card.primary {
  border-color: rgba(85, 208, 182, 0.4);
  background: rgba(85, 208, 182, 0.08);
}

.resource-card.secondary {
  border-color: rgba(242, 201, 76, 0.32);
}

.resource-card.signal-card {
  border-color: rgba(143, 216, 206, 0.24);
}

.resource-card strong,
.catalog-planet-button strong,
.planet-detail-panel strong {
  line-height: 1.25;
}

.resource-card em {
  font: 700 0.68rem/1.35 "IBM Plex Mono", monospace;
  font-style: normal;
}

.planet-catalog__grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
}

.planet-button-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.catalog-planet-button {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 82px;
  padding: 10px;
  text-align: left;
  border-color: rgba(156, 190, 196, 0.18);
  background: rgba(0, 0, 0, 0.14);
}

.catalog-planet-button.is-active {
  border-color: rgba(242, 201, 76, 0.58);
  background: rgba(242, 201, 76, 0.12);
}

.planet-detail-panel {
  display: grid;
  gap: 10px;
}

.planet-detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.travel-card.plotted {
  border-color: rgba(242, 201, 76, 0.5);
  background: rgba(242, 201, 76, 0.1);
}

.travel-card strong,
.mission-card strong {
  min-height: 38px;
  line-height: 1.25;
}

.mission-card p {
  margin: 0;
  color: #cfdee0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.active-mission {
  display: none;
  margin-bottom: 12px;
  padding: 12px;
  border-color: rgba(242, 201, 76, 0.38);
  background: rgba(242, 201, 76, 0.1);
}

.active-mission.is-visible {
  display: block;
}

.active-mission strong {
  display: block;
  margin-bottom: 6px;
}

.market-table,
.inventory {
  display: grid;
  gap: 8px;
}

.market-context {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  border: 1px solid rgba(242, 201, 76, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(242, 201, 76, 0.08);
}

.market-context span,
.market-row em {
  color: #cfdee0;
  font: 500 0.78rem/1.4 "IBM Plex Mono", monospace;
}

.market-row em {
  display: block;
  margin-top: 5px;
  font-style: normal;
}

.market-row,
.inventory-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 64px 72px 72px;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.market-row input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(156, 190, 196, 0.22);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 0 8px;
  font: 700 0.9rem "IBM Plex Mono", monospace;
}

.inventory-row {
  grid-template-columns: minmax(100px, 1fr) 80px 80px;
}

.service-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.service-help {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.service-help div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(156, 190, 196, 0.16);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.service-help div.is-blocked {
  border-color: rgba(242, 201, 76, 0.25);
  background: rgba(242, 201, 76, 0.07);
}

.service-help strong {
  color: var(--text);
  font-size: 0.9rem;
}

.service-help span {
  color: #cfdee0;
  font: 700 0.72rem/1.4 "IBM Plex Mono", monospace;
}

.log-panel {
  background: var(--panel-strong);
}

.day-badge {
  flex: none;
  border: 1px solid rgba(242, 201, 76, 0.35);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent-strong);
  font: 700 0.75rem "IBM Plex Mono", monospace;
}

.log {
  display: grid;
  gap: 8px;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  font: 500 0.84rem/1.5 "IBM Plex Mono", monospace;
}

.log li {
  border-left: 2px solid rgba(85, 208, 182, 0.54);
  padding-left: 10px;
  color: #dce9ea;
}

@media (max-width: 1100px) {
  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .console-views {
    height: auto;
  }

  .view {
    min-height: 560px;
  }

  .fill-panel {
    min-height: 560px;
  }

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

  .ship-grid,
  .local-browser,
  .navigation-layout,
  .comms-layout,
  .planet-catalog__grid {
    grid-template-columns: 1fr;
  }

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

  .comms-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .comms-sidebar {
    max-height: 260px;
  }

  .ship-status-panel {
    grid-row: auto;
  }

  .map-sidebar {
    position: static;
  }

  .map {
    max-width: 380px;
  }

  .navigation-panel.map-expanded .map {
    max-width: none;
  }

  .scroll-area {
    max-height: none;
    overflow: visible;
  }

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

  .log-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar,
  .panel__header {
    align-items: flex-start;
  }

  .local-detail__header {
    flex-direction: column;
  }

  .local-target-actions {
    justify-content: stretch;
    width: 100%;
  }

  .local-target-actions button {
    flex: 1 1 130px;
  }

  .topbar {
    flex-direction: column;
  }

  .selected-contact {
    flex-direction: column;
  }

  .selected-contact__actions {
    width: 100%;
  }

  .system-details,
  .plotted-course,
  .gate-header,
  .catalog-header {
    align-items: stretch;
    flex-direction: column;
  }

  .course-actions {
    justify-content: stretch;
  }

  .course-actions button {
    flex: 1;
  }

  .status-grid,
  .ship-summary,
  .system-facts,
  .local-browser,
  .gate-grid,
  .travel-list,
  .mission-list,
  .resource-grid,
  .resource-grid.compact,
  .planet-detail-columns,
  .side-column {
    grid-template-columns: 1fr;
  }

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

  .topbar__actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .topbar__actions button,
  .user-badge {
    flex: 1 1 110px;
  }

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

  .comms-form,
  .auth-actions {
    grid-template-columns: 1fr;
  }

  .comms-panel {
    width: min(100vw - 20px, 1180px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .local-orbit-chart {
    min-height: 280px;
  }

  .local-body-node span {
    max-width: 110px;
    font-size: 0.58rem;
  }

  .local-body-node small {
    display: none;
  }

  .market-row {
    grid-template-columns: 1fr 62px;
  }

  .toast-stack {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

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

  .market-row input,
  .market-row button {
    grid-column: auto;
  }

  .map {
    min-height: 260px;
  }
}
