:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg-deep: #050812;
  --panel: rgba(16, 28, 40, 0.9);
  --panel-2: rgba(23, 39, 51, 0.86);
  --panel-3: rgba(35, 58, 67, 0.86);
  --line: rgba(128, 228, 216, 0.28);
  --line-soft: rgba(238, 247, 228, 0.1);
  --text: #f6f0dc;
  --muted: #a9c0ba;
  --faint: #718982;
  --teal: #6ef4de;
  --teal-soft: rgba(110, 244, 222, 0.15);
  --green: #8ee899;
  --yellow: #ffd26a;
  --orange: #f5a052;
  --red: #ff756f;
  --cream: #fff2c4;
  --coral: #ff7468;
  --violet: #5f6eb8;
  --panel-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 26px rgba(110, 244, 222, 0.22);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --font-display: "Avenir Next Condensed", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Avenir Next", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-body);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(110, 244, 222, 0.16), transparent 33rem),
    radial-gradient(circle at 84% 84%, rgba(255, 116, 104, 0.1), transparent 30rem),
    url("./assets/star-map.svg") center / cover fixed,
    var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.025) 50%) 0 0 / 100% 4px,
    radial-gradient(circle at center, transparent 40%, rgba(3, 6, 13, 0.48));
  content: "";
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 300px;
  min-height: 100vh;
}

.nav-panel,
.summary-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.035), transparent 34%),
    rgba(11, 20, 31, 0.92);
  border-color: var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(255, 242, 196, 0.08);
  backdrop-filter: blur(18px) saturate(1.14);
}

.nav-panel {
  border-right: 1px solid var(--line-soft);
  padding: 18px 14px;
  background-image:
    linear-gradient(180deg, rgba(255, 242, 196, 0.04), transparent 38%),
    url("./assets/orbit-plate.svg");
  background-position: center top, -310px calc(100% + 220px);
  background-repeat: no-repeat;
  background-size: auto, 640px 640px;
}

.summary-panel {
  border-left: 1px solid var(--line-soft);
  padding: 14px;
  background-image:
    linear-gradient(180deg, rgba(110, 244, 222, 0.05), transparent 34%),
    url("./assets/orbit-plate.svg");
  background-position: center top, 128px -240px;
  background-repeat: no-repeat;
  background-size: auto, 560px 560px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 210, 106, 0.28);
  background:
    radial-gradient(circle at 50% 45%, rgba(110, 244, 222, 0.24), transparent 60%),
    rgba(5, 8, 18, 0.72);
  box-shadow: var(--glow), inset 0 0 20px rgba(255, 242, 196, 0.08);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.brand-mark img {
  width: 48px;
  height: 48px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(110, 244, 222, 0.18);
}

.brand-block p,
.current-family,
.search-field span,
.status-strip span,
.summary-heading span,
.selected-row small,
.node-topline,
.node-card-meta,
.muted {
  color: var(--muted);
}

.brand-block p,
.search-field span,
.status-strip span,
.summary-heading,
.selected-row small,
.node-topline,
.node-card-meta {
  font-size: 12px;
}

.search-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.skill-finder {
  position: relative;
  z-index: 20;
}

.skill-finder .search-field {
  margin-bottom: 18px;
}

.search-field input,
.field-row input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.04), transparent),
    rgba(6, 12, 23, 0.72);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(5, 8, 18, 0.52);
}

.search-field input,
.field-row input {
  height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px;
  color: #d3f8f4;
}

textarea[readonly] {
  color: var(--teal);
}

.build-card textarea[readonly] {
  min-height: 44px;
}

.compact-field {
  margin-bottom: 0;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--teal);
  outline: 2px solid rgba(110, 244, 222, 0.26);
  outline-offset: 1px;
}

.search-results {
  position: absolute;
  top: calc(100% - 12px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  border: 1px solid rgba(110, 244, 222, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.055), transparent 30%),
    rgba(7, 15, 27, 0.985);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.58), 0 0 30px rgba(110, 244, 222, 0.1);
  backdrop-filter: blur(18px);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover,
.search-result[data-active="true"] {
  background: linear-gradient(90deg, rgba(110, 244, 222, 0.18), rgba(255, 210, 106, 0.055));
  box-shadow: inset 3px 0 0 var(--teal);
}

.search-result-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.search-result-copy strong,
.search-result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy strong {
  color: var(--cream);
  font-size: 13px;
}

.search-result-copy small {
  color: var(--muted);
  font-size: 10px;
}

.search-result-state {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-result-state[data-status="selected"],
.search-result-state[data-status="free"] {
  color: var(--green);
}

.search-result-state[data-status="available"] {
  color: var(--teal);
}

.search-result-state[data-status="blocked"] {
  color: var(--red);
}

.search-result-state[data-status="future"] {
  color: var(--yellow);
}

.search-result-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
}

.family-nav {
  display: grid;
  gap: 7px;
}

.family-section {
  display: grid;
  gap: 6px;
}

.family-button,
.subtree-button,
.tool-button,
.small-button,
.danger-button,
.icon-button,
.selected-row,
.warning-link {
  border: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.family-button,
.subtree-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.family-button {
  min-height: 36px;
  padding: 7px 10px;
  background:
    linear-gradient(90deg, rgba(110, 244, 222, 0.04), rgba(255, 210, 106, 0.02)),
    var(--panel-2);
  font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.unified-button {
  margin-bottom: 6px;
  border-color: rgba(255, 210, 106, 0.44);
  box-shadow: inset 3px 0 0 rgba(255, 210, 106, 0.5);
}

.family-button[data-active="true"],
.subtree-button[data-active="true"] {
  border-color: rgba(110, 244, 222, 0.72);
  background:
    linear-gradient(90deg, rgba(110, 244, 222, 0.2), rgba(255, 210, 106, 0.08)),
    rgba(14, 35, 45, 0.82);
  box-shadow: inset 4px 0 0 rgba(110, 244, 222, 0.72), 0 0 22px rgba(110, 244, 222, 0.11);
  color: #effffb;
}

.family-button strong,
.subtree-button strong {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-label {
  display: block;
  min-width: 0;
  line-height: 1.2;
}

.nav-identity {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.profession-glyph {
  display: inline-grid;
  width: 26px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(110, 244, 222, 0.34);
  background: rgba(5, 10, 20, 0.72);
  color: var(--teal);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 10px rgba(110, 244, 222, 0.08);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.family-button[data-active="true"] .profession-glyph,
.subtree-button[data-active="true"] .profession-glyph {
  border-color: rgba(255, 210, 106, 0.58);
  color: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 210, 106, 0.12);
}

.nav-label > span {
  overflow-wrap: normal;
}

.nav-selected-count {
  display: inline-block;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.nav-selected-count[hidden] {
  display: none;
}

.nav-counts {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
  white-space: nowrap;
}

.subtree-list {
  display: grid;
  gap: 4px;
  padding-left: 10px;
  border-left: 1px solid rgba(110, 244, 222, 0.18);
}

.subtree-button {
  min-height: 30px;
  padding: 6px 9px;
  color: #c5d5d2;
  font-size: 13px;
  background: rgba(6, 12, 23, 0.46);
}

.family-button:hover,
.subtree-button:hover,
.tool-button:hover,
.small-button:hover,
.icon-button:hover,
.selected-row:hover {
  border-color: rgba(255, 210, 106, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 210, 106, 0.08), rgba(110, 244, 222, 0.06)),
    rgba(255, 255, 255, 0.045);
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(5, 8, 18, 0.94), rgba(15, 34, 46, 0.86)),
    rgba(13, 17, 19, 0.88);
  box-shadow: inset 0 -1px 0 rgba(110, 244, 222, 0.16);
}

.topbar > div:first-child {
  flex: 0 1 250px;
  min-width: 168px;
}

.topbar::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 244, 222, 0.82), rgba(255, 210, 106, 0.58), transparent);
  content: "";
}

.current-family {
  margin-bottom: 4px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  text-shadow: 0 0 22px rgba(110, 244, 222, 0.18);
  text-wrap: balance;
}

.topbar-actions,
.field-row,
.action-grid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.zoom-tools {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(6, 12, 23, 0.72);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.zoom-tools .icon-button {
  border: 0;
  clip-path: none;
}

.zoom-tools .icon-button:first-child {
  border-right: 1px solid var(--line-soft);
}

.zoom-tools .icon-button:last-child {
  border-left: 1px solid var(--line-soft);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.06), transparent),
    var(--panel-2);
  font-size: 20px;
  line-height: 1;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.zoom-label {
  min-width: 46px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tool-button,
.small-button,
.danger-button {
  min-height: 34px;
  padding: 0 12px;
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.06), rgba(255, 255, 255, 0)),
    var(--panel-2);
  font-size: 13px;
  font-weight: 700;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.tool-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.full-button {
  width: 100%;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(60px, auto));
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 23, 0.72);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.segmented-control button {
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button[data-active="true"] {
  background: linear-gradient(90deg, rgba(110, 244, 222, 0.24), rgba(255, 210, 106, 0.08));
  color: #effffb;
}

.danger-button {
  border-color: rgba(255, 116, 104, 0.42);
  color: #ffc3c1;
}

.toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 242, 196, 0.05), transparent),
    var(--panel-2);
  color: #cfddda;
  font-size: 13px;
  font-weight: 700;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 27px;
  height: 15px;
  flex: 0 0 auto;
  border: 1px solid rgba(169, 192, 186, 0.42);
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.86);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}

.toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  content: "";
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.toggle-control input:checked + .toggle-track {
  border-color: rgba(110, 244, 222, 0.68);
  background: rgba(110, 244, 222, 0.12);
}

.toggle-control input:checked + .toggle-track::after {
  background: var(--teal);
  box-shadow: 0 0 9px rgba(110, 244, 222, 0.7);
  transform: translateX(12px);
}

.toggle-control:has(input:focus-visible) {
  border-color: var(--teal);
  outline: 2px solid rgba(110, 244, 222, 0.26);
  outline-offset: 1px;
}

.toggle-control[hidden] {
  display: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 242, 196, 0.1);
}

.status-strip > div {
  display: grid;
  gap: 3px;
  padding: 12px 18px;
  background:
    linear-gradient(180deg, rgba(110, 244, 222, 0.05), rgba(5, 8, 18, 0.08)),
    rgba(7, 13, 24, 0.88);
}

.status-strip strong {
  color: var(--cream);
  font-size: 18px;
  text-shadow: 0 0 18px rgba(110, 244, 222, 0.16);
}

.warning-link {
  width: max-content;
  padding: 0;
  border: 0;
  color: var(--yellow);
  font-size: 18px;
  font-weight: 800;
}

.tree-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(110, 244, 222, 0.09), transparent 34rem),
    linear-gradient(rgba(255, 242, 196, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 242, 196, 0.035) 1px, transparent 1px),
    rgba(5, 8, 18, 0.94);
  background-size: auto, 42px 42px, 42px 42px;
}

.tree-stage::before,
.tree-stage::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.tree-stage::before {
  z-index: 1;
  border: 1px solid rgba(255, 242, 196, 0.08);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

.tree-stage::after {
  z-index: 0;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(110, 244, 222, 0.055) 44%, transparent 48%),
    linear-gradient(295deg, transparent 0 64%, rgba(255, 210, 106, 0.04) 66%, transparent 71%);
  opacity: 0.42;
}

.tree-viewport {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(110, 244, 222, 0.38) rgba(5, 8, 18, 0.42);
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.tree-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.tree-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  z-index: 1;
}

.tree-lines,
.tree-nodes {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.tree-lines {
  overflow: visible;
}

.line {
  fill: none;
  stroke: rgba(169, 192, 186, 0.38);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(110, 244, 222, 0.12));
  vector-effect: non-scaling-stroke;
}

.line.path {
  stroke: rgba(110, 244, 222, 0.96);
  stroke-width: 4;
  stroke-dasharray: 11 7;
  filter: drop-shadow(0 0 7px rgba(110, 244, 222, 0.52));
  animation: path-signal 1100ms linear infinite;
}

.line.secondary {
  opacity: 0.42;
  stroke-dasharray: 5 8;
}

.line.unlock {
  stroke: rgba(255, 210, 106, 0.82);
}

.line.merged {
  stroke: rgba(142, 232, 153, 0.8);
}

.line.external {
  stroke: rgba(245, 160, 82, 0.84);
  stroke-dasharray: 8 7;
}

.line.path:not(.build-active) {
  stroke: rgba(110, 244, 222, 0.98);
  stroke-width: 4;
  stroke-dasharray: 11 7;
  opacity: 1;
  animation: path-signal 1100ms linear infinite;
  will-change: stroke-dashoffset;
}

.line.build-active {
  stroke: rgba(142, 232, 153, 0.96);
  stroke-width: 3.2;
  stroke-dasharray: none;
  opacity: 0.86;
  filter: drop-shadow(0 0 5px rgba(142, 232, 153, 0.46));
  animation: selected-line-pulse 1800ms ease-in-out infinite;
  will-change: opacity;
}

.line.build-active.path {
  stroke: rgba(173, 250, 181, 1);
  stroke-width: 4;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 7px rgba(142, 232, 153, 0.58));
  animation: selected-line-pulse 1500ms ease-in-out infinite;
}

.skill-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 242, 196, 0.07), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, rgba(20, 41, 54, 0.98), rgba(9, 16, 28, 0.98));
  color: var(--text);
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 196, 0.08),
    inset 0 -1px 0 rgba(5, 8, 18, 0.8),
    0 16px 34px rgba(0, 0, 0, 0.34);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  overflow: hidden;
}

.skill-node::before {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 32px;
  height: 12px;
  border-top: 1px solid rgba(255, 210, 106, 0.36);
  border-right: 1px solid rgba(255, 210, 106, 0.28);
  content: "";
  opacity: 0.72;
}

.skill-node::after {
  display: none;
}

.skill-node:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 244, 222, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 196, 0.12),
    0 0 24px rgba(110, 244, 222, 0.18),
    0 18px 38px rgba(0, 0, 0, 0.36);
}

.skill-node[data-selected="true"] {
  border-color: rgba(110, 244, 222, 0.96);
  background:
    radial-gradient(circle at 16% 16%, rgba(110, 244, 222, 0.24), transparent 45%),
    linear-gradient(180deg, rgba(33, 69, 78, 0.98), rgba(11, 20, 31, 0.98));
  box-shadow: var(--glow), inset 4px 0 0 rgba(110, 244, 222, 0.74), 0 18px 38px rgba(0, 0, 0, 0.34);
  animation: node-acquired 420ms ease-out;
}

.skill-node.branch-reveal {
  animation: branch-reveal 720ms ease-out;
}

.skill-node[data-build-selected="true"] {
  border-color: rgba(142, 232, 153, 0.96);
  background:
    radial-gradient(circle at 12% 10%, rgba(142, 232, 153, 0.24), transparent 46%),
    linear-gradient(180deg, rgba(28, 57, 48, 0.98), rgba(9, 16, 28, 0.98));
  box-shadow: inset 4px 0 0 rgba(142, 232, 153, 0.86), 0 0 22px rgba(142, 232, 153, 0.14), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.skill-node[data-build-selected="true"] .node-topline strong {
  color: var(--green);
}

.skill-node[data-path="true"] {
  border-color: rgba(255, 210, 106, 0.86);
  box-shadow: 0 0 0 2px rgba(255, 210, 106, 0.12), 0 0 28px rgba(255, 210, 106, 0.14), var(--shadow);
}

.skill-node.unlocked {
  border-color: rgba(142, 232, 153, 0.48);
}

.skill-node.locked {
  border-color: rgba(255, 116, 104, 0.42);
}

.skill-node.WIP {
  border-color: rgba(255, 210, 106, 0.56);
  border-style: dashed;
}

.skill-node[data-build="available"] {
  border-color: rgba(110, 244, 222, 0.82);
  opacity: 1;
  box-shadow: inset 3px 0 0 rgba(110, 244, 222, 0.52), 0 14px 32px rgba(0, 0, 0, 0.34);
}

.skill-node[data-build="available"] .node-topline strong {
  color: var(--teal);
}

.skill-node[data-build="blocked"] {
  border-color: rgba(255, 117, 111, 0.52);
  opacity: 0.68;
  filter: saturate(0.7);
}

.skill-node[data-build="blocked"] .node-topline strong {
  color: var(--red);
}

.skill-node[data-build="selected"] {
  border-color: rgba(142, 232, 153, 0.96);
  opacity: 1;
  filter: none;
}

.skill-node[data-build="selected"] .node-topline strong,
.skill-node[data-build="free"] .node-topline strong {
  color: var(--green);
}

.skill-node[data-build="free"] {
  border-color: rgba(142, 232, 153, 0.62);
  opacity: 1;
}

.skill-node[data-build="future"] {
  border-color: rgba(255, 210, 106, 0.62);
  border-style: dashed;
  opacity: 0.58;
  filter: saturate(0.7);
}

.skill-node[data-build="future"] .node-topline strong {
  color: var(--yellow);
}

.skill-node[data-build="full"] {
  border-color: rgba(245, 160, 82, 0.72);
}

.skill-node[data-build="full"] .node-topline strong {
  color: var(--orange);
}

.skill-node[data-external="true"] {
  outline: 1px dashed rgba(245, 160, 82, 0.64);
  outline-offset: 2px;
}

.skill-node[data-orphan="true"] {
  outline: 1px solid rgba(255, 210, 106, 0.86);
  outline-offset: 2px;
}

.skill-node[data-orphan="true"] .node-card-meta {
  color: var(--yellow);
  font-weight: 800;
}

.node-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-left: 20px;
}

.node-status-mark {
  position: absolute;
  top: 6px;
  left: 7px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid currentColor;
  background: rgba(5, 10, 20, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 9px rgba(0, 0, 0, 0.34);
}

.node-status-mark[data-status="selected"],
.node-status-mark[data-status="free"] {
  color: var(--green);
}

.node-status-mark[data-status="available"] {
  color: var(--teal);
}

.node-status-mark[data-status="blocked"] {
  color: var(--red);
}

.node-status-mark[data-status="full"] {
  color: var(--orange);
}

.node-status-mark[data-status="future"] {
  color: var(--yellow);
}

.skill-node[data-show-tree="false"] .node-tree {
  visibility: hidden;
}

.node-topline strong {
  color: var(--teal);
  text-transform: uppercase;
}

.skill-node.locked .node-topline strong {
  color: var(--red);
}

.skill-node.WIP .node-topline strong {
  color: var(--yellow);
}

.skill-node.unlocked .node-topline strong {
  color: var(--green);
}

.skill-node[data-build="available"] .node-topline strong {
  color: var(--teal);
}

.skill-node[data-build="blocked"] .node-topline strong {
  color: var(--red);
}

.skill-node[data-build="selected"] .node-topline strong,
.skill-node[data-build="free"] .node-topline strong {
  color: var(--green);
}

.skill-node[data-build="future"] .node-topline strong {
  color: var(--yellow);
}

.skill-node[data-build="full"] .node-topline strong {
  color: var(--orange);
}

.node-name {
  display: -webkit-box;
  align-self: stretch;
  overflow: hidden;
  color: var(--cream);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.16;
  text-shadow: 0 0 14px rgba(255, 242, 196, 0.12);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.node-description {
  display: -webkit-box;
  overflow: hidden;
  color: #b9cbc4;
  font-size: 10px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.skill-node[data-descriptions="false"] .node-description {
  display: none;
}

.node-card-meta {
  margin-top: auto;
  overflow: hidden;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 242, 196, 0.12);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.tree-nav-tools {
  position: absolute;
  right: 204px;
  bottom: 14px;
  z-index: 4;
}

.tree-nav-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(110, 244, 222, 0.4);
  background: rgba(7, 15, 27, 0.92);
  color: var(--cream);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.tree-nav-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.target-mark {
  color: var(--teal);
  font-size: 16px;
  line-height: 1;
}

.tree-minimap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  width: 178px;
  height: 112px;
  overflow: hidden;
  border: 1px solid rgba(110, 244, 222, 0.46);
  background: rgba(5, 10, 20, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46), inset 0 0 22px rgba(110, 244, 222, 0.06);
  cursor: crosshair;
  touch-action: none;
  backdrop-filter: blur(12px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.tree-minimap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.minimap-window {
  position: absolute;
  min-width: 8px;
  min-height: 8px;
  border: 1px solid var(--cream);
  background: rgba(110, 244, 222, 0.1);
  box-shadow: 0 0 10px rgba(110, 244, 222, 0.26);
  pointer-events: none;
}

@keyframes path-signal {
  to {
    stroke-dashoffset: -36;
  }
}

@keyframes selected-line-pulse {
  0%,
  100% {
    opacity: 0.68;
    stroke-width: 3.1;
  }
  50% {
    opacity: 1;
    stroke-width: 4.1;
  }
}

@keyframes node-acquired {
  0% {
    filter: brightness(1.45);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes branch-reveal {
  0% {
    filter: brightness(1.5);
    transform: translateX(-5px);
  }
  45% {
    filter: brightness(1.2);
  }
  100% {
    filter: brightness(1);
    transform: translateX(0);
  }
}

.summary-card {
  position: relative;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 242, 196, 0.06), transparent 38%),
    linear-gradient(180deg, rgba(25, 43, 55, 0.9), rgba(10, 18, 30, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 242, 196, 0.08), 0 18px 44px rgba(0, 0, 0, 0.2);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.summary-card::before {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 26px;
  height: 8px;
  border-top: 1px solid rgba(255, 210, 106, 0.32);
  content: "";
  pointer-events: none;
}

.build-card {
  border-color: rgba(110, 244, 222, 0.34);
}

.summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-heading > span {
  white-space: nowrap;
}

.summary-heading strong {
  color: var(--teal);
  font-size: 12px;
  line-height: 1.15;
  text-align: right;
}

.summary-heading strong[data-level="yellow"] {
  color: var(--yellow);
}

.summary-heading strong[data-level="orange"] {
  color: var(--orange);
}

.summary-heading strong[data-level="red"] {
  color: var(--red);
}

.meter {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 242, 196, 0.12);
  background: rgba(5, 8, 18, 0.76);
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
}

.meter > div {
  width: 0;
  height: 100%;
  background:
    linear-gradient(90deg, var(--green), var(--yellow)),
    var(--green);
  box-shadow: 0 0 18px rgba(142, 232, 153, 0.32);
  transition: width 180ms ease;
}

.meter > div[data-level="yellow"] {
  background: var(--yellow);
}

.meter > div[data-level="orange"] {
  background: var(--orange);
}

.meter > div[data-level="red"] {
  background: var(--red);
}

.point-meter > div {
  background:
    linear-gradient(90deg, var(--teal), var(--yellow)),
    var(--teal);
}

.cost-breakdown {
  display: grid;
  gap: 7px;
}

.description-summary {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.compact-heading {
  font-size: 11px;
}

.description-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.description-row {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.description-row:last-child {
  border-bottom: 0;
}

.description-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.description-row:hover,
.description-row:focus-visible {
  padding-right: 6px;
  padding-left: 6px;
  background: linear-gradient(90deg, rgba(110, 244, 222, 0.09), transparent);
  box-shadow: inset 2px 0 0 rgba(110, 244, 222, 0.58);
}

.description-identity {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.description-identity > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.description-identity small {
  color: var(--muted);
  font-size: 9px;
}

.description-open {
  color: var(--teal);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.description-row p {
  color: #cbd9d1;
  font-size: 12px;
  line-height: 1.35;
}

.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 242, 196, 0.1);
  color: #d1ded7;
  font-size: 13px;
}

.cost-row:last-child {
  border-bottom: 0;
}

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

.summary-card p,
.warning-list p {
  color: #bdcbc8;
  font-size: 13px;
  line-height: 1.45;
}

.planner-disclosure {
  border-top: 1px solid rgba(255, 242, 196, 0.12);
  padding-top: 10px;
}

.planner-disclosure summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.planner-disclosure summary::marker {
  color: var(--yellow);
}

.disclosure-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.disclosure-body .tool-button {
  width: 100%;
}

.disclosure-body .search-field {
  margin-bottom: 0;
}

.node-detail {
  display: grid;
  gap: 13px;
}

.node-detail h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.node-detail h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.node-detail dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.node-detail dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
}

.node-detail dt {
  color: var(--muted);
  font-size: 12px;
}

.node-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #e7f3f0;
  font-size: 12px;
}

.node-detail ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #bdcbc8;
  font-size: 13px;
  line-height: 1.4;
}

.filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.legend-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d6e4e1;
  font-size: 13px;
}

.legend-line {
  display: inline-block;
  width: 42px;
  height: 0;
  border-top: 3px solid rgba(148, 164, 163, 0.6);
}

.legend-line.unlock {
  border-color: var(--yellow);
}

.legend-line.merged {
  border-color: var(--green);
}

.legend-line.external {
  border-color: var(--orange);
  border-top-style: dashed;
}

.action-grid {
  flex-wrap: wrap;
}

.build-card .action-grid > button {
  flex: 1 1 96px;
}

.selected-card {
  min-height: 220px;
}

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

.selected-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: #111719;
  text-align: left;
}

.selected-row span:first-child {
  display: grid;
  gap: 3px;
}

.selected-row span:last-child {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.selected-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.selected-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.selected-pager .small-button:last-child {
  justify-self: end;
}

.selected-pager .small-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.mobile-sheet-heading,
.mobile-build-bar,
.mobile-sheet-backdrop {
  display: none;
}

.warning-panel {
  border-color: rgba(230, 199, 92, 0.32);
}

.warning-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid rgba(110, 244, 222, 0.58);
  background:
    linear-gradient(145deg, rgba(255, 242, 196, 0.06), transparent),
    rgba(8, 16, 27, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .summary-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 5;
    display: grid;
    width: calc(100vw - 232px);
    height: 32vh;
    grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
    align-items: start;
    gap: 12px;
    border-top: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
    background-size: auto, 420px 420px;
  }

  .summary-panel .summary-card {
    margin-bottom: 0;
  }

  .workspace {
    height: 68vh;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    height: calc(100svh - 58px - env(safe-area-inset-bottom));
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .nav-panel {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    border: 0;
  }

  .nav-panel {
    padding: 10px 12px 12px;
    overflow: visible;
    border-bottom: 1px solid var(--line-soft);
    background-position: center top, calc(100% + 190px) -260px;
    background-size: auto, 520px 520px;
  }

  .brand-block {
    gap: 9px;
    margin-bottom: 9px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  }

  .brand-mark img {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: 16px;
  }

  .brand-block p {
    display: none;
  }

  .skill-finder .search-field {
    gap: 0;
    margin-bottom: 9px;
  }

  .skill-finder .search-field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .skill-finder .search-field input {
    height: 44px;
  }

  .search-results {
    top: calc(100% - 5px);
    right: -1px;
    left: -1px;
    max-height: min(58vh, 480px);
  }

  .family-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 1px 0 4px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }

  .family-section,
  .subtree-list {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .subtree-list {
    padding-left: 0;
    border-left: 0;
  }

  .family-button,
  .subtree-button {
    width: auto;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 7px 11px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .nav-counts {
    margin-left: 4px;
  }

  .unified-button {
    margin-bottom: 0;
  }

  .workspace {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
  }

  .topbar {
    display: grid;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    padding: 11px 12px 10px;
  }

  .topbar > div:first-child {
    flex: none;
    min-width: 0;
  }

  .current-family {
    margin-bottom: 2px;
    font-size: 10px;
  }

  h2 {
    font-size: 21px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
  }

  .icon-button,
  .tool-button,
  .toggle-control {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .zoom-label {
    display: none;
  }

  .description-label {
    font-size: 0;
  }

  .description-label::after {
    font-size: 13px;
    content: "Details";
  }

  .segmented-control {
    display: none;
  }

  .fit-button,
  .toggle-control,
  .zoom-tools {
    flex: 0 0 auto;
  }

  .status-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-strip > div:first-child,
  .status-strip > div:nth-child(2) {
    display: none;
  }

  .status-strip > div {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
  }

  .status-strip strong {
    font-size: 16px;
  }

  .tree-stage {
    background-size: auto, 38px 38px, 38px 38px;
  }

  .skill-node {
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  }

  .skill-node .node-topline,
  .skill-node .node-card-meta {
    display: none;
  }

  .skill-node .node-status-mark {
    top: 5px;
    left: 5px;
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .skill-node .node-name {
    align-self: center;
    font-size: 15px;
    line-height: 1.18;
    text-align: center;
  }

  .skill-node[data-descriptions="true"] {
    justify-content: flex-start;
  }

  .skill-node[data-descriptions="true"] .node-name {
    width: 100%;
    font-size: 13px;
  }

  .skill-node .node-description {
    width: 100%;
    color: #aebfb9;
    font-size: 10px;
    line-height: 1.18;
    text-align: left;
    -webkit-line-clamp: 3;
  }

  .skill-node::before {
    display: none;
  }

  .tree-minimap {
    right: 9px;
    bottom: 9px;
    width: 122px;
    height: 78px;
  }

  .tree-nav-tools {
    right: 140px;
    bottom: 9px;
  }

  .tree-nav-button {
    width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
  }

  .tree-nav-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .summary-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: block;
    width: 100%;
    height: min(78svh, 720px);
    max-height: none;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(110, 244, 222, 0.52);
    border-left: 0;
    background-position: center top, calc(100% + 160px) -220px;
    box-shadow: 0 -28px 70px rgba(0, 0, 0, 0.62);
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  .summary-panel.mobile-open {
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .mobile-sheet-heading {
    position: sticky;
    top: -12px;
    z-index: 2;
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    margin: -12px -12px 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(7, 15, 27, 0.96);
    color: var(--cream);
    backdrop-filter: blur(16px);
  }

  .mobile-sheet-heading strong {
    font-family: var(--font-display);
    font-size: 17px;
  }

  .mobile-build-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    min-height: calc(58px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 14px max(8px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(110, 244, 222, 0.5);
    background:
      linear-gradient(90deg, rgba(110, 244, 222, 0.12), rgba(255, 210, 106, 0.06)),
      rgba(6, 13, 24, 0.97);
    color: var(--text);
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.48);
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(16px);
  }

  .mobile-build-bar > span:not(.build-bar-caret) {
    display: grid;
    gap: 2px;
  }

  .mobile-build-bar small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-build-bar strong {
    color: var(--cream);
    font-size: 15px;
  }

  .mobile-build-bar > span:nth-child(2) strong {
    color: var(--yellow);
  }

  .build-bar-caret {
    color: var(--teal);
    font-size: 21px;
    transition: transform 180ms ease;
  }

  .mobile-build-bar[aria-expanded="true"] .build-bar-caret {
    transform: rotate(180deg);
  }

  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    border: 0;
    background: rgba(2, 6, 13, 0.68);
    backdrop-filter: blur(3px);
  }

  .mobile-sheet-backdrop[hidden] {
    display: none;
  }

  body.build-sheet-open {
    overflow: hidden;
  }

  .toast {
    right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }

  .summary-card {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
