:root {
  color-scheme: dark;
  --void: #03070b;
  --space: #07131d;
  --space-2: #0d2430;
  --glass: rgba(10, 31, 40, 0.82);
  --glass-strong: rgba(12, 38, 48, 0.94);
  --cream: #fff0bd;
  --paper: #f7e6b1;
  --text: #f8fbef;
  --muted: #b7c8c4;
  --muted-2: #829893;
  --teal: #60f2e4;
  --teal-deep: #1a8e97;
  --gold: #f6c35a;
  --coral: #ff7a61;
  --green: #9ad887;
  --border: rgba(183, 232, 218, 0.26);
  --border-hot: rgba(246, 195, 90, 0.68);
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  --inner: inset 0 1px 0 rgba(255, 240, 189, 0.13);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --paint-nudge: 0px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--void);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 240, 189, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(96, 242, 228, 0.035), transparent 30%, rgba(255, 122, 97, 0.03)),
    radial-gradient(circle at 72% 18%, rgba(246, 195, 90, 0.08), transparent 28%),
    linear-gradient(180deg, #07131d, #03070b 72%);
  background-position: center var(--paint-nudge);
  background-size: cover;
  background-attachment: scroll;
}

html[data-paint-phase="ready"] {
  --paint-nudge: 1px;
}

body::before {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255, 240, 189, 0.2);
  background:
    linear-gradient(90deg, rgba(5, 14, 21, 0.94), rgba(9, 33, 42, 0.88)),
    linear-gradient(180deg, rgba(255, 240, 189, 0.08), transparent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 1.03rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small,
.topbar-status,
.muted,
.field span,
.switch-row small,
.run-stats small,
.data-grid dt,
.section-label,
.ingredient-meta,
.recipe-option-meta {
  color: var(--muted);
}

.brand small {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
}

.topbar-status {
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid rgba(96, 242, 228, 0.28);
  border-radius: 999px;
  background: rgba(12, 38, 48, 0.72);
  color: var(--cream);
  font-size: 0.82rem;
  box-shadow: var(--inner);
}

.app-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(136px, 1fr));
  gap: 3px;
  min-width: 310px;
  padding: 4px;
  border: 1px solid rgba(183, 232, 218, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.07), transparent),
    rgba(1, 8, 12, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.42);
}

.app-nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
}

.app-nav-tab:hover {
  color: var(--cream);
  background: rgba(96, 242, 228, 0.07);
}

.app-nav-tab.active {
  border-color: rgba(246, 195, 90, 0.48);
  color: #17130b;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 48%),
    linear-gradient(135deg, #f5df9d, #d7aa50);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 210, 0.34);
}

.app-nav-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.app-nav-forge {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.app-nav-forge::before,
.app-nav-forge::after {
  position: absolute;
  inset: 5px -4px;
  border-top: 2px solid currentColor;
  content: "";
}

.app-nav-forge::after {
  transform: rotate(90deg);
}

.app-nav-recon {
  border: 1px solid currentColor;
  border-radius: 50%;
}

.app-nav-recon::before {
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.app-nav-recon::after {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 7px;
  border-top: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transform-origin: right;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(286px, 326px) minmax(0, 1fr) minmax(266px, 326px);
  gap: 16px;
  width: min(1740px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.control-rail,
.insight-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.control-rail {
  position: static;
  max-height: none;
  overflow: visible;
}

.panel,
.hero-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.06), transparent 34%),
    linear-gradient(145deg, rgba(12, 39, 49, 0.94), rgba(5, 15, 23, 0.94));
  box-shadow: var(--shadow), var(--inner);
}

.panel::before,
.hero-panel::before {
  position: absolute;
  inset: 7px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 240, 189, 0.07);
  border-radius: 6px;
}

.panel {
  padding: 15px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px auto;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  overflow: hidden;
  padding: 16px 18px;
}

.hero-panel::after {
  position: absolute;
  right: 19%;
  bottom: -72px;
  width: 280px;
  height: 130px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(246, 195, 90, 0.18);
  border-radius: 50% 50% 0 0;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.hero-asset {
  display: block;
  position: static;
  z-index: 1;
  width: 82px;
  max-width: 82px;
  min-width: 0;
  height: auto;
  opacity: 0.96;
}

.hero-asset.is-item-image {
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(246, 195, 90, 0.38);
  border-radius: 8px;
  background: rgba(4, 17, 23, 0.8);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hero-panel h1 {
  margin: 4px 0 5px;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 720px;
  margin: 0;
  color: #d2ddd5;
  font-size: 0.84rem;
  line-height: 1.4;
}

.hero-library-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.hero-library-link:hover {
  color: var(--cream);
}

.section-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--cream);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.field span,
.switch-row strong {
  font-size: 0.82rem;
}

.switch-row strong {
  color: var(--cream);
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(183, 232, 218, 0.28);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.04), transparent),
    rgba(2, 9, 14, 0.86);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

select {
  color: var(--cream);
}

select option {
  color: var(--cream);
  background: var(--space);
}

select:disabled,
input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input::placeholder {
  color: rgba(183, 200, 196, 0.62);
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(246, 195, 90, 0.18), var(--inner);
}

.switch-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(183, 232, 218, 0.14);
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 50px;
  width: 50px;
  height: 28px;
  overflow: hidden;
}

.switch input {
  position: absolute;
  width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.switch span {
  width: 50px;
  border: 1px solid rgba(183, 232, 218, 0.24);
  border-radius: 999px;
  background: rgba(255, 240, 189, 0.13);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.38);
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--paper), #8aa4a0);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + span {
  background: rgba(96, 242, 228, 0.2);
  border-color: rgba(96, 242, 228, 0.62);
}

.switch input:checked + span::after {
  transform: translateX(22px);
  background: linear-gradient(135deg, var(--teal), var(--green));
}

.primary-action,
.icon-button,
.tab,
.combo-toggle {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(7, 19, 29, 0.82);
}

.primary-action {
  position: relative;
  width: 100%;
  min-height: 43px;
  margin-top: 11px;
  overflow: hidden;
  border-color: rgba(255, 240, 189, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(135deg, var(--gold), #ee9f42 54%, var(--coral));
  color: #1d1208;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(255, 122, 97, 0.16), var(--inner);
  transform-origin: center;
}

.primary-action:hover {
  filter: brightness(1.06);
}

.primary-action.is-dirty {
  box-shadow:
    0 0 0 3px rgba(246, 195, 90, 0.12),
    0 12px 28px rgba(255, 122, 97, 0.24),
    var(--inner);
}

.primary-action.attention-pulse {
  animation: analyze-focus 760ms ease-in-out 3;
}

@keyframes analyze-focus {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--cream);
}

.mini-badge {
  padding: 5px 9px;
  border: 1px solid rgba(246, 195, 90, 0.45);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(246, 195, 90, 0.1);
  font-size: 0.74rem;
}

.weight-controls {
  display: grid;
  gap: 13px;
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
}

.weight-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.weight-row input[type="range"] {
  min-height: 0;
  padding: 0;
  accent-color: var(--teal);
}

.weight-row input[type="number"] {
  text-align: center;
  color: var(--cream);
  font-weight: 800;
}

.custom-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.custom-tree {
  display: grid;
  min-width: 0;
}

.custom-tree-heading {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(246, 195, 90, 0.34);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.13), rgba(5, 19, 27, 0.78));
}

.custom-tree-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.custom-tree-heading > div > span,
.custom-node-kind,
.custom-input-label {
  color: var(--gold);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.custom-tree-heading strong,
.custom-node-copy strong {
  color: var(--cream);
  overflow-wrap: anywhere;
}

.custom-tree-heading strong {
  font-size: 0.82rem;
}

.custom-tree-count {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.63rem;
}

.custom-tree-folder,
.custom-tree-node.is-recipe > .custom-node-header > .custom-node-icon {
  position: relative;
  width: 19px;
  height: 13px;
  border: 1px solid rgba(246, 195, 90, 0.74);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(246, 195, 90, 0.3), rgba(96, 64, 24, 0.5));
}

.custom-tree-folder::before,
.custom-tree-node.is-recipe > .custom-node-header > .custom-node-icon::before {
  position: absolute;
  top: -4px;
  left: 1px;
  width: 8px;
  height: 3px;
  border: 1px solid rgba(246, 195, 90, 0.74);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: rgba(102, 75, 30, 0.94);
  content: "";
}

.custom-tree-children,
.custom-node-children {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-left: 9px;
  padding: 11px 0 0 16px;
  border-left: 1px solid rgba(246, 195, 90, 0.25);
}

.custom-node-children {
  margin-top: 3px;
  padding-top: 7px;
}

.custom-tree-node {
  position: relative;
  min-width: 0;
}

.custom-tree-children > .custom-tree-node::before,
.custom-node-children > .custom-tree-node::before {
  position: absolute;
  top: 17px;
  left: -16px;
  width: 12px;
  border-top: 1px solid rgba(246, 195, 90, 0.3);
  content: "";
}

.custom-tree-node.is-material::before {
  border-top-color: rgba(96, 242, 228, 0.3);
}

.custom-node-header {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 7px 6px;
}

.custom-tree-node.is-recipe > .custom-node-header {
  border-left: 2px solid rgba(246, 195, 90, 0.72);
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.09), transparent 84%);
}

.custom-tree-node.is-material > .custom-node-header > .custom-node-icon {
  align-self: center;
  justify-self: center;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border: 1px solid rgba(96, 242, 228, 0.82);
  border-radius: 50%;
  background: rgba(96, 242, 228, 0.3);
}

.custom-node-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.custom-node-copy strong {
  font-size: 0.76rem;
}

.custom-tree-node.is-material > .custom-node-header .custom-node-kind {
  color: var(--teal);
}

.custom-node-status,
.custom-node-quantity {
  color: var(--muted-2);
  font-size: 0.6rem;
}

.custom-node-quantity {
  white-space: nowrap;
}

.custom-node-inputs {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 2px 0 7px 27px;
}

.custom-tree-node.is-material .custom-input-label {
  color: var(--teal);
}

.custom-override-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--muted);
  font-size: 0.63rem;
  cursor: pointer;
}

.custom-override-toggle input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--gold);
}

.custom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.custom-grid input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 3px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.69rem;
}

.custom-grid input:invalid {
  border-color: rgba(255, 122, 97, 0.72);
}

.custom-grid input:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.custom-tree-node.has-complete-override > .custom-node-header {
  border-left-color: var(--green);
}

.custom-tree-node.has-complete-override > .custom-node-header .custom-node-status {
  color: var(--green);
}

.custom-tree-node.has-partial-override > .custom-node-header .custom-node-status {
  color: var(--gold);
}

.run-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(118px, 1fr);
  gap: 8px;
  width: min(150px, 100%);
  min-width: 118px;
}

.run-stats div,
.stat-card,
.data-grid div {
  border: 1px solid rgba(183, 232, 218, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.05), transparent),
    rgba(4, 14, 21, 0.62);
  padding: 9px 10px;
  box-shadow: var(--inner);
}

.run-stats span {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--gold);
}

.results-stage {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.score-card {
  min-height: 0;
  padding-block: 11px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 138px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 1.05rem;
}

.best-layout {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(260px, 1.28fr);
  gap: 14px;
  align-items: center;
}

.best-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.best-title strong {
  color: var(--cream);
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  line-height: 1.2;
}

.best-title span {
  color: var(--muted);
  font-size: 0.74rem;
}

.summary-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 7px;
}

.summary-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(96, 242, 228, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.summary-stat span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
}

.summary-stat strong {
  min-width: 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.86rem;
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
}

.meter {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(183, 232, 218, 0.12);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.14);
}

.meter header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.meter strong {
  color: var(--text);
  font-family: var(--mono);
}

.bar {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 189, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green) 48%, var(--gold));
  box-shadow: 0 0 14px rgba(96, 242, 228, 0.28);
}

.table-panel {
  padding-bottom: 11px;
}

.table-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.result-controls {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.strategy-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(183, 232, 218, 0.2);
  border-radius: 5px;
  background: rgba(0, 7, 11, 0.68);
}

.strategy-tabs button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 900;
  white-space: nowrap;
}

.strategy-tabs button.active {
  border-color: rgba(246, 195, 90, 0.48);
  color: var(--cream);
  background: rgba(105, 72, 24, 0.52);
  box-shadow: inset 0 -2px 0 rgba(246, 195, 90, 0.55);
}

.strategy-tabs button.is-mapping {
  animation: route-mapping 900ms ease-in-out infinite alternate;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tab {
  min-width: 42px;
  min-height: 36px;
  border-radius: var(--radius);
  color: var(--muted);
}

.tab.active {
  border-color: var(--border-hot);
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.12), transparent),
    rgba(246, 195, 90, 0.12);
}

.result-list {
  display: grid;
  gap: 11px;
}

.combo-card {
  overflow: hidden;
  border: 1px solid rgba(183, 232, 218, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(96, 242, 228, 0.06), transparent 54%),
    rgba(3, 10, 15, 0.5);
}

.combo-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid rgba(183, 232, 218, 0.13);
  text-align: left;
}

.combo-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--cream);
  font-weight: 900;
}

.combo-score {
  color: var(--gold);
  font-family: var(--mono);
  white-space: nowrap;
}

.combo-score[hidden] {
  display: none;
}

.combo-body {
  display: none;
  gap: 14px;
  padding: 14px;
}

.combo-card.open .combo-body {
  display: grid;
}

.travel-plan {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 0;
  border-block: 1px solid rgba(246, 195, 90, 0.15);
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.055), transparent 78%);
}

.travel-plan.is-summary {
  grid-column: 1 / -1;
  padding: 10px 0 0;
  border-bottom: 0;
}

.travel-plan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.travel-plan-heading strong {
  color: var(--gold);
  font-family: var(--mono);
}

.travel-stops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 6px;
}

.travel-stop,
.travel-unlocated {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  border: 1px solid rgba(96, 242, 228, 0.2);
  border-radius: 4px;
  color: var(--text);
  background: rgba(1, 9, 13, 0.62);
  text-align: left;
}

.travel-stop:hover,
.travel-stop:focus-visible {
  border-color: rgba(246, 195, 90, 0.58);
  background: rgba(77, 54, 19, 0.5);
}

.travel-stop-dot {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(246, 195, 90, 0.26);
  box-shadow: 0 0 8px rgba(246, 195, 90, 0.35);
}

.travel-stop strong,
.travel-unlocated strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--cream);
  font-size: 0.7rem;
}

.travel-stop small,
.travel-unlocated small {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.3;
}

.travel-unlocated {
  grid-template-columns: 1fr;
  border-color: rgba(255, 122, 97, 0.25);
}

.travel-unlocated small {
  grid-column: 1;
}

@keyframes route-mapping {
  from {
    box-shadow: inset 0 -2px 0 rgba(246, 195, 90, 0.35);
  }

  to {
    box-shadow: inset 0 -2px 0 rgba(96, 242, 228, 0.72), 0 0 10px rgba(96, 242, 228, 0.14);
  }
}

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

.ingredient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid rgba(183, 232, 218, 0.14);
  border-left: 3px solid var(--teal-deep);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(96, 242, 228, 0.055), transparent 54%),
    rgba(255, 240, 189, 0.035);
}

.ingredient.is-crafted {
  border-color: rgba(246, 195, 90, 0.28);
  border-left-color: var(--gold);
  background:
    linear-gradient(90deg, rgba(246, 195, 90, 0.1), transparent 56%),
    rgba(255, 240, 189, 0.035);
}

.ingredient strong {
  display: block;
  color: var(--cream);
}

.ingredient-identity {
  min-width: 0;
}

.ingredient-title {
  display: grid;
  gap: 6px;
}

.ingredient-title > strong {
  font-size: 0.88rem;
}

.ingredient-kind {
  width: fit-content;
  color: var(--teal);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ingredient.is-crafted .ingredient-kind {
  color: var(--gold);
}

.provenance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.provenance-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(183, 232, 218, 0.16);
  border-radius: 999px;
  color: #dce9e1;
  background: rgba(5, 19, 27, 0.78);
  font-size: 0.68rem;
  line-height: 1.2;
}

.provenance-pill b {
  color: var(--muted-2);
  font-size: 0.61rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.provenance-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.provenance-pill.refined,
.provenance-pill.crafted {
  border-color: rgba(246, 195, 90, 0.25);
  color: var(--cream);
  background: rgba(246, 195, 90, 0.08);
}

.provenance-pill.planet {
  border-color: rgba(96, 242, 228, 0.26);
  background: rgba(96, 242, 228, 0.08);
}

.provenance-pill.wormhole {
  border-color: rgba(255, 122, 97, 0.32);
  color: #ffd5cb;
  background: rgba(255, 122, 97, 0.09);
}

.provenance-pill.custom {
  border-color: rgba(154, 216, 135, 0.3);
  background: rgba(154, 216, 135, 0.08);
}

.ingredient-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(52px, 1fr));
  gap: 5px;
}

.recipe-tree {
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 3px;
  padding-top: 13px;
  border-top: 1px solid rgba(246, 195, 90, 0.24);
}

.recipe-tree-heading {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(246, 195, 90, 0.36);
  border-radius: 6px 6px 2px 2px;
  background:
    linear-gradient(90deg, rgba(246, 195, 90, 0.16), transparent 62%),
    rgba(5, 19, 27, 0.7);
}

.recipe-tree-heading::before {
  position: absolute;
  top: -6px;
  left: 12px;
  width: 48px;
  height: 6px;
  border: 1px solid rgba(246, 195, 90, 0.36);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: rgba(53, 46, 26, 0.96);
  content: "";
}

.recipe-tree-folder,
.recipe-node.is-recipe > .recipe-node-row > .recipe-node-icon {
  position: relative;
  width: 22px;
  height: 15px;
  border: 1px solid rgba(246, 195, 90, 0.78);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(246, 195, 90, 0.34), rgba(96, 64, 24, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 240, 189, 0.22);
}

.recipe-tree-folder::before,
.recipe-node.is-recipe > .recipe-node-row > .recipe-node-icon::before {
  position: absolute;
  top: -5px;
  left: 1px;
  width: 9px;
  height: 4px;
  border: 1px solid rgba(246, 195, 90, 0.78);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: rgba(102, 75, 30, 0.94);
  content: "";
}

.recipe-tree-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recipe-tree-title > span {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recipe-tree-title > strong {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.recipe-tree-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 11px;
  color: var(--muted);
  font-size: 0.67rem;
}

.recipe-tree-summary span + span {
  position: relative;
}

.recipe-tree-summary span + span::before {
  position: absolute;
  left: -7px;
  color: rgba(246, 195, 90, 0.52);
  content: "/";
}

.recipe-tree-children,
.recipe-node-children {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-left: 11px;
  padding: 12px 0 0 25px;
  border-left: 1px solid rgba(246, 195, 90, 0.28);
}

.recipe-node-children {
  margin-top: 4px;
  padding-top: 7px;
}

.recipe-node {
  position: relative;
  min-width: 0;
}

.recipe-tree-children > .recipe-node::before,
.recipe-node-children > .recipe-node::before {
  position: absolute;
  top: 20px;
  left: -25px;
  width: 20px;
  border-top: 1px solid rgba(246, 195, 90, 0.34);
  content: "";
}

.recipe-tree-children > .recipe-node.is-material::before,
.recipe-node-children > .recipe-node.is-material::before {
  border-top-color: rgba(96, 242, 228, 0.32);
}

.recipe-node-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
}

.recipe-node.is-recipe > .recipe-node-row {
  padding: 10px;
  border-left: 3px solid rgba(246, 195, 90, 0.74);
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.1), transparent 72%);
}

.recipe-node.is-material > .recipe-node-row {
  border-bottom: 1px solid rgba(183, 232, 218, 0.08);
}

.recipe-node.is-material > .recipe-node-row > .recipe-node-icon {
  align-self: center;
  justify-self: center;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border: 1px solid rgba(96, 242, 228, 0.84);
  border-radius: 50%;
  background: rgba(96, 242, 228, 0.34);
  box-shadow: 0 0 0 3px rgba(96, 242, 228, 0.07);
}

.recipe-node-identity {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.recipe-node-identity > strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.8rem;
}

.recipe-node.is-recipe > .recipe-node-row .recipe-node-identity > strong {
  color: var(--cream);
  font-size: 0.84rem;
}

.recipe-node-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted-2);
  font-size: 0.61rem;
}

.recipe-node-eyebrow span:first-child {
  color: var(--teal);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recipe-node.is-recipe > .recipe-node-row .recipe-node-eyebrow span:first-child {
  color: var(--gold);
}

.source-material-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(50px, 1fr));
  gap: 5px;
}

.source-material-values .stat-pill {
  padding: 5px 6px;
  font-size: 0.72rem;
}

.stat-pill {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(96, 242, 228, 0.18);
  border-radius: 6px;
  color: var(--text);
  background: rgba(96, 242, 228, 0.08);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.stat-pill b {
  color: var(--teal);
  font-size: 0.64rem;
}

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

.effect {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
}

.effect b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(246, 195, 90, 0.46);
  border-radius: var(--radius);
  color: var(--gold);
  background: rgba(246, 195, 90, 0.1);
}

.effect-values {
  min-width: 0;
  padding-top: 3px;
  color: #d9e3da;
  line-height: 1.4;
}

.effect-labels {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.effect-labels li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.effect-labels li + li {
  padding-top: 5px;
  border-top: 1px solid rgba(183, 232, 218, 0.12);
}

.effect-empty {
  display: inline-block;
  color: var(--muted);
}


.stat-cards {
  display: grid;
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
}

.stat-card strong {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 1.02rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.data-grid {
  display: grid;
  gap: 9px;
  margin: 0;
}

.data-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.data-grid dt,
.data-grid dd {
  margin: 0;
}

.data-grid dd {
  color: var(--text);
  font-family: var(--mono);
}

.recon-view {
  width: min(1740px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.recon-command {
  display: grid;
  grid-template-columns: minmax(210px, 0.42fr) minmax(0, 1.58fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-block: 1px solid rgba(246, 195, 90, 0.3);
  background:
    linear-gradient(90deg, rgba(246, 195, 90, 0.09), transparent 31%),
    rgba(3, 15, 21, 0.56);
}

.recon-title-block {
  min-width: 0;
}

.recon-title-block h1 {
  margin: 3px 0 7px;
  color: var(--cream);
  font-size: 1.7rem;
  line-height: 1;
}

.recon-live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.recon-live-stats b {
  color: var(--teal);
  font-weight: 900;
}

.recon-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.recon-control-cluster,
.recon-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.recon-control-cluster {
  flex: 0 1 auto;
}

.recon-field {
  flex: 1 1 170px;
}

.recon-mode-cluster {
  flex: 0 0 300px;
  max-width: 100%;
}

.recon-control-label,
.recon-field > span {
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, auto);
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(183, 232, 218, 0.2);
  border-radius: 5px;
  background: rgba(0, 7, 11, 0.7);
}

.recon-segment button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.recon-segment button:hover {
  color: var(--cream);
  background: rgba(96, 242, 228, 0.07);
}

.recon-segment button.active {
  border-color: rgba(96, 242, 228, 0.43);
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(96, 242, 228, 0.16), transparent),
    rgba(16, 75, 78, 0.48);
  box-shadow: inset 0 -2px 0 rgba(96, 242, 228, 0.48);
}

.recon-scope button.active {
  border-color: rgba(246, 195, 90, 0.5);
  background:
    linear-gradient(180deg, rgba(246, 195, 90, 0.16), transparent),
    rgba(94, 63, 23, 0.5);
  box-shadow: inset 0 -2px 0 rgba(246, 195, 90, 0.54);
}

.recon-metrics {
  grid-auto-flow: initial;
  grid-template-columns: minmax(60px, 1.15fr) minmax(72px, 1.35fr) repeat(4, minmax(34px, 0.62fr));
  width: 100%;
}

.recon-metrics button {
  padding-inline: 9px;
}

.recon-field select,
.recon-inventory-toolbar input {
  min-height: 44px;
}

.recon-ww-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(255, 122, 97, 0.28);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(35, 12, 14, 0.28);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}

.recon-ww-toggle input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--coral);
}

.recon-console {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(350px, 0.76fr);
  min-height: 670px;
  height: min(820px, calc(100vh - 178px));
  overflow: hidden;
  border: 1px solid rgba(183, 232, 218, 0.28);
  border-radius: 7px;
  background: #030b10;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), var(--inner);
}

.recon-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(246, 195, 90, 0.27);
  background: #02080c;
}

.recon-stage-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1.3fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 55px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(96, 242, 228, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 240, 189, 0.07), transparent),
    rgba(6, 24, 31, 0.96);
}

.recon-stage-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recon-stage-header span,
.recon-inventory-toolbar span,
.recon-signal span {
  color: var(--muted-2);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-stage-header strong {
  overflow: hidden;
  color: var(--cream);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recon-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-live-indicator::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(154, 216, 135, 0.8);
  content: "";
}

.recon-system {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background-color: #02090e;
  background-image:
    linear-gradient(rgba(2, 9, 14, 0.2), rgba(2, 9, 14, 0.42)),
    url("assets/atomic-starfield.svg");
  background-position: center;
  background-size: cover;
}

.recon-system::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(96, 242, 228, 0.025) 5px 6px),
    linear-gradient(90deg, transparent 49.8%, rgba(96, 242, 228, 0.08) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(96, 242, 228, 0.08) 50%, transparent 50.2%);
  content: "";
}

.recon-system::after {
  position: absolute;
  z-index: 0;
  inset: 7%;
  pointer-events: none;
  border: 1px solid rgba(246, 195, 90, 0.13);
  border-radius: 50%;
  content: "";
}

.orbit-ring {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  pointer-events: none;
  border: 1px solid rgba(96, 242, 228, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring::before,
.orbit-ring::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(246, 195, 90, 0.5);
  background: #07141a;
  content: "";
  transform: rotate(45deg);
}

.orbit-ring::before {
  top: -3px;
  left: 50%;
}

.orbit-ring::after {
  right: -3px;
  bottom: 50%;
}

.orbit-ring-1 {
  width: 34%;
  height: 34%;
}

.orbit-ring-2 {
  width: 58%;
  height: 58%;
}

.orbit-ring-3 {
  width: 82%;
  height: 82%;
  border-color: rgba(246, 195, 90, 0.14);
  border-style: dashed;
}

.recon-sweep {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 83%;
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 50%;
  background: conic-gradient(from 270deg, rgba(96, 242, 228, 0.2), transparent 12%, transparent 100%);
  transform: translate(-50%, -50%);
  transform-origin: center;
  animation: recon-sweep 8s linear infinite;
}

.scan-core {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  padding: 18px;
  border: 1px solid rgba(246, 195, 90, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(96, 242, 228, 0.16), rgba(3, 17, 22, 0.93) 64%),
    #041116;
  text-align: center;
  box-shadow:
    inset 0 0 0 9px rgba(246, 195, 90, 0.045),
    0 0 38px rgba(96, 242, 228, 0.13);
  transform: translate(-50%, -50%);
}

.scan-core::before,
.scan-core::after {
  position: absolute;
  inset: -9px;
  border: 1px dashed rgba(96, 242, 228, 0.36);
  border-radius: 50%;
  content: "";
}

.scan-core::after {
  inset: 12px;
  border-color: rgba(246, 195, 90, 0.2);
}

.scan-core span,
.scan-core small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.57rem;
  text-transform: uppercase;
}

.scan-core strong {
  display: -webkit-box;
  max-width: 114px;
  overflow: hidden;
  color: var(--teal);
  font-size: 0.78rem;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.planet-node {
  position: absolute;
  z-index: 4;
  top: var(--planet-y);
  left: var(--planet-x);
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 126px;
  min-height: 104px;
  padding: 5px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: center;
  transform: translate(-50%, -50%);
}

.planet-node:hover,
.planet-node:focus-visible {
  z-index: 8;
}

.planet-orb {
  position: relative;
  display: block;
  width: var(--planet-size);
  height: var(--planet-size);
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--planet-light) 72%, transparent);
  border-radius: 50%;
  opacity: var(--planet-opacity);
  background:
    radial-gradient(circle at 31% 25%, var(--planet-light) 0 5%, transparent 6%),
    radial-gradient(ellipse at 64% 63%, color-mix(in srgb, var(--planet-accent) 74%, transparent) 0 9%, transparent 10%),
    radial-gradient(ellipse at 35% 72%, rgba(0, 0, 0, 0.34) 0 18%, transparent 19%),
    radial-gradient(circle at 36% 31%, var(--planet-base), #07141a 74%);
  box-shadow:
    inset -12px -10px 18px rgba(0, 0, 0, 0.64),
    inset 7px 5px 12px color-mix(in srgb, var(--planet-light) 24%, transparent),
    0 0 var(--planet-glow) color-mix(in srgb, var(--planet-light) 56%, transparent);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.planet-orb::before {
  position: absolute;
  inset: 15% -8%;
  border: 1px solid color-mix(in srgb, var(--planet-accent) 44%, transparent);
  border-radius: 50%;
  content: "";
  transform: rotate(-13deg);
}

.planet-orb::after {
  position: absolute;
  inset: 7%;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
  transform: rotate(28deg);
}

.planet-node:hover .planet-orb,
.planet-node:focus-visible .planet-orb,
.planet-node.selected .planet-orb {
  opacity: 1;
  transform: scale(1.08);
}

.planet-scan-ring {
  position: absolute;
  inset: -10px;
  border: 1px dashed color-mix(in srgb, var(--planet-light) 62%, transparent);
  border-radius: 50%;
  opacity: 0.56;
  animation: recon-ring 7s linear infinite reverse;
}

.planet-node.selected .planet-scan-ring {
  inset: -14px;
  border: 2px solid var(--gold);
  opacity: 0.9;
  box-shadow: 0 0 0 4px rgba(246, 195, 90, 0.08);
}

.planet-node.wormhole .planet-orb {
  border-color: rgba(255, 122, 97, 0.8);
}

.planet-node.wormhole .planet-scan-ring {
  border-color: rgba(255, 122, 97, 0.74);
}

.planet-node.anomaly .planet-orb {
  border-style: dashed;
  background:
    radial-gradient(circle, #020406 0 23%, rgba(255, 122, 97, 0.62) 25%, transparent 28%),
    conic-gradient(from 30deg, #123c43, #060a10, #6b3d31, #060a10, #123c43);
}

.planet-label {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 4px 5px;
  border-block: 1px solid transparent;
  background: rgba(1, 8, 12, 0.72);
}

.planet-label strong,
.planet-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planet-label strong {
  color: var(--cream);
  font-size: 0.67rem;
}

.planet-label small {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.57rem;
  text-transform: uppercase;
}

.planet-node.selected .planet-label {
  border-color: rgba(246, 195, 90, 0.48);
  background: rgba(74, 48, 14, 0.74);
}

.recon-legend {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(100px, 280px) auto;
  justify-content: center;
  gap: 10px;
  align-items: center;
  min-height: 35px;
  padding: 6px 14px;
  border-top: 1px solid rgba(96, 242, 228, 0.18);
  color: var(--muted-2);
  background: rgba(4, 18, 24, 0.96);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-legend i {
  height: 5px;
  border: 1px solid rgba(183, 232, 218, 0.18);
  background: linear-gradient(90deg, rgba(96, 242, 228, 0.1), var(--teal), var(--gold));
}

.recon-detail {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 240, 189, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, rgba(15, 49, 55, 0.96), rgba(4, 14, 20, 0.98) 54%);
}

.recon-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(246, 195, 90, 0.25);
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.09), transparent);
}

.recon-detail-header h2 {
  margin: 4px 0 4px;
  overflow-wrap: anywhere;
  color: var(--cream);
  font-size: 1.17rem;
}

.recon-detail-header p:not(.section-label) {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.recon-signal {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(96, 242, 228, 0.48);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 242, 228, 0.14), rgba(3, 12, 17, 0.82));
  box-shadow: inset 0 0 0 6px rgba(96, 242, 228, 0.035);
}

.recon-signal strong {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.recon-planet-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(46px, 1fr));
  gap: 1px;
  padding: 0 16px 14px;
  border-bottom: 1px solid rgba(183, 232, 218, 0.14);
  background: linear-gradient(90deg, rgba(246, 195, 90, 0.09), transparent);
}

.recon-planet-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 5px;
  border-right: 1px solid rgba(183, 232, 218, 0.1);
  text-align: center;
}

.recon-planet-summary div:last-child {
  border-right: 0;
}

.recon-planet-summary span {
  color: var(--muted-2);
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-planet-summary strong {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.recon-inventory-toolbar {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(183, 232, 218, 0.16);
}

.recon-inventory-toolbar > div {
  display: grid;
  gap: 3px;
}

.recon-inventory-toolbar strong {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.recon-inventory-toolbar input {
  padding: 8px 10px;
  font-size: 0.74rem;
}

.recon-pagination {
  display: grid !important;
  grid-template-columns: 30px minmax(34px, auto) 30px;
  grid-auto-flow: column;
  gap: 5px !important;
  align-items: center;
}

.recon-pagination button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(96, 242, 228, 0.26);
  border-radius: 4px;
  color: var(--cream);
  background: rgba(1, 8, 12, 0.68);
  font-family: var(--mono);
}

.recon-pagination span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-align: center;
}

.recon-inventory {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(96, 242, 228, 0.42) rgba(0, 0, 0, 0.24);
}

.recon-inventory-row {
  display: grid;
  grid-template-columns: minmax(115px, 0.78fr) minmax(120px, 1fr);
  gap: 7px 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(183, 232, 218, 0.12);
  background: linear-gradient(90deg, rgba(96, 242, 228, 0.035), transparent 62%);
}

.recon-inventory-row:hover {
  background: linear-gradient(90deg, rgba(96, 242, 228, 0.09), rgba(246, 195, 90, 0.025));
}

.recon-target-link {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.recon-target-link > span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--teal);
  font-size: 0.57rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recon-target-link > strong {
  overflow-wrap: anywhere;
  color: var(--cream);
  font-size: 0.76rem;
}

.recon-target-link:hover > strong {
  color: var(--gold);
}

.recon-provenance {
  display: inline-flex;
  gap: 4px;
}

.recon-provenance i {
  padding: 2px 4px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.48rem;
  font-style: normal;
  line-height: 1;
}

.recon-provenance .is-base {
  color: var(--teal);
}

.recon-provenance .is-refined {
  color: var(--gold);
}

.recon-row-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.recon-row-copy span,
.recon-row-copy small {
  overflow-wrap: anywhere;
}

.recon-row-copy small {
  color: var(--muted-2);
  font-size: 0.58rem;
}

.recon-forge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recon-forge-actions button {
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid rgba(246, 195, 90, 0.3);
  border-radius: 3px;
  color: var(--gold);
  background: rgba(73, 49, 16, 0.3);
  font-size: 0.55rem;
  font-weight: 900;
  text-align: left;
}

.recon-forge-actions button:hover {
  border-color: rgba(246, 195, 90, 0.64);
  color: var(--cream);
}

.recon-row-stats {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 5px;
}

.recon-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(96, 242, 228, 0.16);
  border-radius: 4px;
  color: var(--text);
  background: rgba(1, 8, 12, 0.52);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.recon-stat b {
  color: var(--teal);
  font-size: 0.56rem;
}

.recon-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 190px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.recon-empty strong {
  color: var(--cream);
}

.recon-empty span {
  font-size: 0.76rem;
}

@keyframes recon-sweep {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes recon-ring {
  to {
    transform: rotate(360deg);
  }
}

.error {
  color: var(--coral);
}

@media (max-width: 1500px) {
  .recon-command {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .recon-title-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .recon-title-block .section-label {
    grid-column: 1 / -1;
  }

  .recon-title-block h1 {
    margin-bottom: 0;
  }
}

@media (max-width: 1250px) {
  .workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .insight-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) 76px auto;
  }

  .run-stats {
    grid-template-columns: 1fr;
  }

  .recon-command {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .recon-title-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .recon-title-block .section-label {
    grid-column: 1 / -1;
  }

  .recon-title-block h1 {
    margin-bottom: 0;
  }

  .recon-console {
    grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.72fr);
  }
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .app-nav {
    width: 100%;
    min-width: 0;
  }

  .topbar-status {
    width: 100%;
    text-align: center;
  }

  .workspace,
  .insight-rail {
    grid-template-columns: 1fr;
  }

  .workspace > .control-rail,
  .workspace > .results-stage,
  .workspace > .insight-rail {
    grid-column: 1;
    min-width: 0;
  }


  .control-rail {
    position: static;
    max-height: none;
  }

  .best-layout,
  .table-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .result-controls {
    width: 100%;
    justify-items: start;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .hero-panel h1 {
    font-size: 1.7rem;
  }

  .hero-asset {
    display: block;
    z-index: 1;
    justify-self: center;
    width: 72px;
    max-width: 72px;
  }

  .run-stats {
    grid-column: 1 / -1;
  }

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

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

  .recipe-tree-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .recipe-tree-summary {
    grid-column: 2;
    justify-content: flex-start;
  }

  .recipe-node-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .recipe-node-row .source-material-values {
    grid-column: 2;
  }

  .recon-view {
    padding: 10px;
  }

  .recon-command {
    gap: 16px;
    padding-inline: 10px;
  }

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

  .recon-field,
  .recon-mode-cluster {
    grid-column: 1 / -1;
  }

  .recon-ww-toggle {
    align-self: end;
  }

  .recon-console {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .recon-stage {
    min-height: 660px;
    border-right: 0;
    border-bottom: 1px solid rgba(246, 195, 90, 0.27);
  }

  .recon-system {
    min-height: 570px;
  }

  .recon-detail {
    min-height: 620px;
  }

  .recon-inventory {
    max-height: 680px;
  }
}

@media (max-width: 560px) {
  .workspace {
    gap: 12px;
    padding: 10px;
  }

  .panel,
  .hero-panel {
    padding: 14px;
  }

  .brand strong {
    font-size: 0.94rem;
  }

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

  .app-nav-tab {
    gap: 6px;
    padding-inline: 7px;
    font-size: 0.68rem;
  }

  .hero-panel h1 {
    font-size: 1.55rem;
  }

  .hero-asset {
    width: 62px;
    max-width: 62px;
  }

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

  .combo-toggle {
    grid-template-columns: 1fr;
  }

  .combo-score {
    white-space: normal;
  }

  .strategy-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .strategy-tabs button {
    padding-inline: 5px;
    font-size: 0.61rem;
  }

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

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

  .ingredient-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .source-material-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .recipe-tree-children,
  .recipe-node-children {
    margin-left: 6px;
    padding-left: 17px;
  }

  .recipe-tree-children > .recipe-node::before,
  .recipe-node-children > .recipe-node::before {
    left: -17px;
    width: 13px;
  }

  .recipe-node.is-recipe > .recipe-node-row {
    padding: 9px 7px;
  }

  .stat-pill {
    padding-inline: 4px;
  }

  .recon-view {
    padding: 8px;
  }

  .recon-command {
    margin-bottom: 8px;
    padding: 12px 7px;
  }

  .recon-title-block {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .recon-title-block .section-label,
  .recon-live-stats {
    grid-column: 1;
  }

  .recon-title-block h1 {
    font-size: 1.45rem;
  }

  .recon-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .recon-field,
  .recon-mode-cluster {
    grid-column: 1;
  }

  .recon-segment {
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
  }

  .recon-segment button {
    padding-inline: 5px;
    font-size: 0.68rem;
  }

  .recon-ww-toggle {
    justify-content: center;
  }

  .recon-stage {
    min-height: 616px;
  }

  .recon-stage-header {
    grid-template-columns: minmax(90px, 0.75fr) minmax(120px, 1.25fr);
    gap: 8px;
    padding-inline: 9px;
  }

  .recon-live-indicator {
    display: none;
  }

  .recon-system {
    min-height: 525px;
  }

  .scan-core {
    width: 118px;
    height: 118px;
    padding: 14px;
  }

  .scan-core strong {
    max-width: 88px;
    font-size: 0.68rem;
  }

  .planet-node {
    width: 102px;
    min-height: 90px;
    gap: 5px;
  }

  .planet-orb {
    width: min(var(--planet-size), 55px);
    height: min(var(--planet-size), 55px);
  }

  .planet-label {
    padding-inline: 3px;
  }

  .planet-label strong {
    font-size: 0.61rem;
  }

  .planet-label small {
    font-size: 0.52rem;
  }

  .recon-legend {
    grid-template-columns: auto minmax(70px, 1fr) auto;
    padding-inline: 10px;
  }

  .recon-detail {
    min-height: 590px;
  }

  .recon-detail-header {
    padding: 14px 12px;
  }

  .recon-planet-summary {
    padding-inline: 10px;
  }

  .recon-planet-summary div {
    padding-inline: 2px;
  }

  .recon-inventory-toolbar {
    grid-template-columns: 1fr;
    padding-inline: 12px;
  }

  .recon-pagination {
    justify-self: end;
  }

  .recon-inventory-row {
    grid-template-columns: minmax(100px, 0.75fr) minmax(0, 1.25fr);
    padding-inline: 12px;
  }

  .recon-row-stats {
    gap: 4px;
  }

  .recon-stat {
    padding-inline: 5px;
    font-size: 0.61rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-action.attention-pulse,
  .strategy-tabs button.is-mapping,
  .recon-sweep,
  .planet-scan-ring {
    animation: none;
  }
}
