:root {
  color-scheme: dark;
  --bg: #070906;
  --panel: rgba(14, 17, 13, 0.88);
  --panel-strong: rgba(18, 23, 16, 0.96);
  --soft: rgba(245, 240, 220, 0.06);
  --line: rgba(245, 240, 220, 0.14);
  --line-strong: rgba(245, 240, 220, 0.24);
  --ink: #f5f0dc;
  --muted: #b9b39e;
  --acid: #b9ff3b;
  --moss: #2dd881;
  --ember: #ff5c35;
  --blood: #cf273f;
  --gold: #f0b84a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 9, 6, 0.52), rgba(7, 9, 6, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(245, 240, 220, 0.022),
      rgba(245, 240, 220, 0.022) 1px,
      transparent 1px,
      transparent 8px
    );
}

#pool-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(245, 240, 220, 0.1);
  background: rgba(7, 9, 6, 0.78);
  backdrop-filter: blur(16px);
}

.brand,
.primary-nav,
.header-actions,
.wallet-button,
.primary-action,
.secondary-action,
.icon-button,
.toolbar-tabs,
.segmented-control {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border: 2px solid var(--acid);
  border-radius: 6px;
  position: relative;
  background: rgba(185, 255, 59, 0.1);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--acid);
}

.brand-mark::before {
  left: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 3px;
}

.brand-mark::after {
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 2px;
}

.primary-nav {
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.04);
}

.nav-button,
.toolbar-tabs button,
.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.nav-button.active,
.toolbar-tabs button.active,
.segmented-control button.active {
  color: #101408;
  background: var(--acid);
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.icon-button {
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(245, 240, 220, 0.04);
}

.icon-button:hover {
  color: var(--acid);
  border-color: rgba(185, 255, 59, 0.36);
}

.wallet-button,
.primary-action,
.secondary-action {
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
}

.wallet-button {
  border: 1px solid rgba(185, 255, 59, 0.34);
  color: var(--acid);
  background: rgba(185, 255, 59, 0.08);
}

.wallet-button.connected {
  color: #101408;
  background: var(--acid);
}

.wallet-button.connected .live-dot {
  background: #101408;
  box-shadow: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(185, 255, 59, 0.7);
}

.primary-action {
  border: 0;
  color: #101408;
  background: var(--acid);
  box-shadow: 0 12px 36px rgba(185, 255, 59, 0.18);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(245, 240, 220, 0.05);
}

.full {
  width: 100%;
}

.activity-tape {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(245, 240, 220, 0.09);
  background: rgba(7, 9, 6, 0.72);
  backdrop-filter: blur(12px);
}

.tape-label {
  color: var(--acid);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.tape-track {
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.tape-track-inner {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: tape-scroll 32s linear infinite;
}

.tape-track:hover .tape-track-inner {
  animation-play-state: paused;
}

.tape-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border: 1px solid rgba(245, 240, 220, 0.12);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(245, 240, 220, 0.045);
  font-size: 12px;
  white-space: nowrap;
}

.tape-item strong {
  color: var(--ink);
}

.tape-item.win strong {
  color: var(--gold);
}

.tape-item.loss strong {
  color: #ff907a;
}

.tape-item.lp strong {
  color: var(--acid);
}

@keyframes tape-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.app-main {
  min-height: calc(100vh - 72px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 18px;
}

.rail,
.pool-board,
.side-panel,
.studio-shell,
.hooklab-shell,
.forge-shell,
.portfolio-shell {
  min-height: calc(100vh - 108px);
}

.rail,
.pool-board,
.selected-card,
.hunt-card,
.feed-card,
.protocol-card,
.studio-editor,
.launch-preview,
.hooklab-console,
.hooklab-ledger,
.forge-console,
.forge-preview,
.position-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--acid);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.rail h1,
.board-toolbar h1,
.board-toolbar h2,
.studio-editor h1,
.portfolio-shell h1 {
  margin: 8px 0 0;
  line-height: 1.04;
}

.rail h1 {
  font-size: 34px;
}

.rail-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.segmented-control,
.toolbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.04);
}

.rail-metrics {
  display: grid;
  gap: 8px;
}

.rail-metrics div,
.selected-stats div,
.hunt-quote div,
.position-stats span {
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 240, 220, 0.04);
}

.rail-metrics span,
.selected-stats span,
.hunt-quote span,
.event-row span,
.position-stats span,
.gauge-label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.rail-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.pool-board {
  padding: 18px;
  background: rgba(11, 14, 10, 0.82);
}

.board-toolbar,
.selected-top,
.hunt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.board-toolbar {
  margin-bottom: 16px;
}

.board-toolbar h2 {
  font-size: 28px;
}

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

.pool-card {
  min-height: 300px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.pool-card.active {
  border-color: rgba(185, 255, 59, 0.52);
  box-shadow: 0 0 0 1px rgba(185, 255, 59, 0.18);
}

.pool-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.pool-card h3 {
  margin: 6px 0 0;
  font-size: 23px;
}

.pool-card-visual {
  min-height: 128px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at bottom, rgba(185, 255, 59, 0.14), transparent 60%),
    rgba(245, 240, 220, 0.03);
}

.pool-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.pool-card-stats div {
  padding: 13px;
  background: rgba(7, 9, 6, 0.76);
}

.pool-card-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}

.pool-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}

.pool-card button {
  min-height: 38px;
  border-radius: 7px;
  font-weight: 820;
}

.pool-card .select-pool {
  border: 0;
  color: #101408;
  background: var(--acid);
}

.pool-card .view-vault {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(245, 240, 220, 0.04);
}

.side-panel {
  display: grid;
  gap: 14px;
}

.selected-card,
.hunt-card,
.feed-card,
.protocol-card {
  padding: 16px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(185, 255, 59, 0.32);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--acid);
  background: rgba(185, 255, 59, 0.07);
  font-size: 11px;
  font-weight: 850;
}

.selected-top h2,
.hunt-card h3,
.feed-card h3,
.protocol-card h3,
.launch-preview h2 {
  margin: 7px 0 0;
}

.defender-stage {
  min-height: 210px;
  display: grid;
  place-items: center;
  position: relative;
  margin: 16px 0;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(185, 255, 59, 0.1), transparent),
    rgba(245, 240, 220, 0.035);
}

.stage-ring {
  position: absolute;
  bottom: 28px;
  width: 190px;
  height: 24px;
  border: 2px solid rgba(240, 184, 74, 0.4);
  border-radius: 50%;
}

.beast {
  width: 144px;
  height: 132px;
  position: relative;
  z-index: 1;
  border: 3px solid rgba(245, 240, 220, 0.72);
  border-radius: 44% 56% 50% 50% / 42% 42% 58% 58%;
  background:
    linear-gradient(140deg, rgba(185, 255, 59, 0.72), rgba(45, 216, 129, 0.34)),
    #18240e;
  box-shadow:
    inset 0 -20px 0 rgba(0, 0, 0, 0.25),
    0 16px 42px rgba(185, 255, 59, 0.18);
}

.pool-card .beast {
  width: 100px;
  height: 94px;
}

.beast::before,
.beast::after {
  content: "";
  position: absolute;
  top: -20px;
  width: 34px;
  height: 46px;
  border: 3px solid rgba(245, 240, 220, 0.72);
  border-bottom: 0;
  background: #202910;
}

.beast::before {
  left: 25px;
  transform: rotate(-18deg);
  border-radius: 22px 12px 0 0;
}

.beast::after {
  right: 25px;
  transform: rotate(18deg);
  border-radius: 12px 22px 0 0;
}

.eye {
  position: absolute;
  top: 47px;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--blood);
  box-shadow: 0 0 16px rgba(207, 39, 63, 0.75);
}

.eye.left {
  left: 40px;
}

.eye.right {
  right: 40px;
}

.mouth {
  position: absolute;
  left: 38px;
  right: 38px;
  bottom: 35px;
  height: 18px;
  border-bottom: 4px solid #090a08;
  border-radius: 50%;
}

.beast-b {
  background:
    linear-gradient(140deg, rgba(255, 92, 53, 0.78), rgba(207, 39, 63, 0.3)),
    #2b120d;
  box-shadow:
    inset 0 -20px 0 rgba(0, 0, 0, 0.25),
    0 16px 42px rgba(255, 92, 53, 0.2);
}

.beast-c {
  background:
    linear-gradient(140deg, rgba(240, 184, 74, 0.85), rgba(185, 255, 59, 0.24)),
    #2a220c;
  box-shadow:
    inset 0 -20px 0 rgba(0, 0, 0, 0.25),
    0 16px 42px rgba(240, 184, 74, 0.22);
}

.beast.shake {
  animation: shake 360ms linear 1;
}

.beast.claimed {
  animation: claimed 520ms ease 1;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  25% {
    transform: translateX(-8px) rotate(-2deg);
  }
  50% {
    transform: translateX(7px) rotate(2deg);
  }
  75% {
    transform: translateX(-4px) rotate(-1deg);
  }
}

@keyframes claimed {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

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

.selected-stats strong,
.hunt-quote strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}

.gauge-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.gauge-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.gauge-label strong {
  font-size: 12px;
}

.gauge {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(245, 240, 220, 0.1);
}

.gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--moss), var(--acid));
  transition: width 220ms ease;
}

.gauge-hot span {
  background: linear-gradient(90deg, var(--ember), var(--gold));
}

.inventory-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 240, 220, 0.1);
}

.panel-title h3 {
  margin: 7px 0 0;
}

.panel-title.compact h3 {
  font-size: 15px;
}

.defender-inventory {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.defender-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: rgba(245, 240, 220, 0.035);
  text-align: left;
}

.defender-button.active {
  color: var(--ink);
  border-color: rgba(185, 255, 59, 0.42);
  background: rgba(185, 255, 59, 0.075);
}

.defender-token {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(245, 240, 220, 0.16);
  border-radius: 8px;
  color: var(--acid);
  background: rgba(7, 9, 6, 0.52);
  font-size: 11px;
  font-weight: 900;
}

.defender-copy {
  min-width: 0;
}

.defender-copy strong,
.defender-rank {
  display: block;
}

.defender-copy strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.defender-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.defender-rank {
  color: var(--acid);
  font-size: 11px;
  font-weight: 850;
}

.defender-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(245, 240, 220, 0.09);
}

.defender-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ember), var(--acid));
}

.range-control {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  margin: 12px 0 16px;
  accent-color: var(--acid);
}

.hunt-quote {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.hunt-quote strong {
  font-size: 16px;
}

.result-log {
  min-height: 58px;
  margin-top: 12px;
  border: 1px solid rgba(245, 240, 220, 0.12);
  border-radius: 8px;
  padding: 13px;
  color: var(--muted);
  background: rgba(245, 240, 220, 0.04);
  line-height: 1.45;
}

.result-log.win {
  color: var(--gold);
  border-color: rgba(240, 184, 74, 0.34);
}

.result-log.loss {
  color: #ff907a;
  border-color: rgba(255, 92, 53, 0.36);
}

.event-feed {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(245, 240, 220, 0.035);
  font-size: 12px;
}

.event-row strong {
  color: var(--ink);
}

.event-row.win strong {
  color: var(--gold);
}

.event-row.loss strong {
  color: #ff907a;
}

.event-row.lp strong {
  color: var(--acid);
}


.protocol-rail {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.protocol-status-grid div,
.contract-row,
.route-row {
  min-width: 0;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.035);
}

.protocol-status-grid div {
  padding: 10px;
}

.protocol-status-grid span,
.contract-row span,
.route-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.protocol-status-grid strong,
.contract-row strong,
.route-row strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contract-stack {
  display: grid;
  gap: 7px;
}

.contract-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
}

.contract-row strong {
  margin-top: 0;
}

.contract-row code {
  color: var(--acid);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 7px;
}

.route-row {
  min-height: 64px;
  padding: 10px;
}

.write-path-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.035);
}

.write-path-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.write-path-row strong {
  color: var(--ink);
  font-size: 12px;
}

.write-path-row.live {
  border-color: rgba(185, 255, 59, 0.5);
  background: rgba(185, 255, 59, 0.08);
}

.write-path-row.live strong {
  color: var(--acid);
}

button.busy,
button:disabled {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

.hooklab-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 18px;
}

.hooklab-console,
.hooklab-ledger {
  min-height: calc(100vh - 108px);
  padding: 18px;
}

.hook-controls {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr;
  gap: 10px;
  margin-top: 16px;
}

.hook-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.hook-controls input,
.hook-controls select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(245, 240, 220, 0.06);
  outline: none;
}

.hook-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.pipeline-card {
  min-height: 166px;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(185, 255, 59, 0.055), transparent),
    rgba(245, 240, 220, 0.035);
}

.pipeline-card.active {
  border-color: rgba(185, 255, 59, 0.4);
}

.pipeline-step {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.pipeline-step span:last-child {
  color: var(--acid);
}

.pipeline-card strong {
  display: block;
  margin-top: 13px;
  font-size: 17px;
}

.pipeline-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pipeline-metric {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.pipeline-metric span {
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(7, 9, 6, 0.36);
  font-size: 11px;
  font-weight: 800;
}

.hook-terminal {
  margin-top: 16px;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  background: rgba(4, 6, 5, 0.78);
}

.terminal-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(245, 240, 220, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.terminal-title strong {
  color: var(--acid);
}

.hook-trace {
  display: grid;
  gap: 1px;
  padding: 8px;
}

.trace-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(245, 240, 220, 0.035);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.trace-row strong {
  color: var(--acid);
}

.trace-row span:last-child {
  color: var(--ink);
}

.hooklab-ledger h2 {
  margin: 7px 0 14px;
}

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

.ledger-grid div,
.curve-panel {
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 240, 220, 0.035);
}

.ledger-grid span,
.curve-title span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.ledger-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.delta-up {
  color: var(--acid);
}

.delta-down {
  color: #ff907a;
}

.curve-panel {
  margin: 12px 0;
}

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

.curve-title strong {
  color: var(--ink);
  font-size: 12px;
}

.curve-visual {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 142px;
  border: 1px solid rgba(245, 240, 220, 0.08);
  border-radius: 8px;
  padding: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(245, 240, 220, 0.035),
      rgba(245, 240, 220, 0.035) 1px,
      transparent 1px,
      transparent 24px
    ),
    rgba(7, 9, 6, 0.5);
}

.curve-bar {
  min-height: 10px;
  border: 1px solid rgba(185, 255, 59, 0.18);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--acid), rgba(45, 216, 129, 0.34));
}

.forge-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 18px;
}

.forge-console,
.forge-preview {
  min-height: calc(100vh - 108px);
  padding: 18px;
}

.forge-topline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 10px;
  margin-top: 16px;
}

.forge-topline label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.forge-topline select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(245, 240, 220, 0.06);
  outline: none;
}

.forge-ratio,
.forge-lever,
.forge-map-card,
.armor-card,
.forge-stats div {
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.035);
}

.forge-ratio {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px 12px;
}

.forge-ratio span,
.forge-lever span,
.forge-stats span {
  color: var(--muted);
  font-size: 11px;
}

.forge-ratio strong {
  font-size: 14px;
}

.forge-levers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.forge-lever {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.forge-lever output {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.forge-lever input[type="range"] {
  margin: 0;
}

.forge-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  margin-top: 12px;
}

.forge-map-card {
  padding: 13px;
}

.forge-depth-map {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 5px;
  align-items: end;
  height: 246px;
  margin-top: 12px;
  border: 1px solid rgba(245, 240, 220, 0.08);
  border-radius: 8px;
  padding: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(245, 240, 220, 0.035),
      rgba(245, 240, 220, 0.035) 1px,
      transparent 1px,
      transparent 28px
    ),
    rgba(7, 9, 6, 0.52);
}

.depth-column {
  min-height: 14px;
  border: 1px solid rgba(185, 255, 59, 0.18);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--gold), var(--acid) 45%, rgba(45, 216, 129, 0.36));
}

.forge-anatomy {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.anatomy-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185, 255, 59, 0.18);
  border-radius: 8px;
  color: var(--acid);
  background:
    radial-gradient(circle at 35% 30%, rgba(185, 255, 59, 0.24), transparent 42%),
    rgba(245, 240, 220, 0.04);
  font-size: 10px;
  font-weight: 900;
}

.anatomy-cell.hot {
  color: var(--gold);
  border-color: rgba(240, 184, 74, 0.34);
  background:
    radial-gradient(circle at 35% 30%, rgba(240, 184, 74, 0.28), transparent 42%),
    rgba(245, 240, 220, 0.04);
}

.forge-preview h2 {
  margin: 7px 0 14px;
}

.armor-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(185, 255, 59, 0.09), rgba(240, 184, 74, 0.06)),
    rgba(245, 240, 220, 0.035);
}

.armor-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 2px solid rgba(185, 255, 59, 0.54);
  border-radius: 8px;
  background: rgba(7, 9, 6, 0.5);
}

.armor-mark span {
  width: 38px;
  height: 48px;
  border: 3px solid var(--acid);
  border-top-width: 8px;
  border-radius: 8px 8px 14px 14px;
}

.armor-mark i {
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(240, 184, 74, 0.55);
}

.armor-card strong,
.armor-card span {
  display: block;
}

.armor-card strong {
  font-size: 24px;
}

.armor-card span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

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

.forge-stats div {
  padding: 12px;
}

.forge-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 18px;
}

.studio-editor,
.launch-preview {
  min-height: calc(100vh - 108px);
  padding: 18px;
}

.studio-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 240, 220, 0.04);
}

.studio-toolbar button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.studio-toolbar button.active {
  color: #101408;
  background: var(--acid);
}

.studio-form label,
.script-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.studio-form input,
.studio-form select,
.script-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(245, 240, 220, 0.06);
  outline: none;
}

.studio-form input,
.studio-form select {
  height: 42px;
  padding: 0 12px;
}

.studio-status-grid,
.preview-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

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

.studio-status-grid div,
.preview-meters div {
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 240, 220, 0.035);
}

.studio-status-grid span,
.preview-meters span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.studio-status-grid strong,
.preview-meters strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 14px;
}

.hook-recipe {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.recipe-lane {
  min-height: 122px;
  border: 1px solid rgba(245, 240, 220, 0.1);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(185, 255, 59, 0.06), transparent),
    rgba(245, 240, 220, 0.03);
}

.recipe-lane span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #101408;
  background: var(--acid);
  font-size: 12px;
  font-weight: 900;
}

.recipe-lane strong {
  display: block;
  margin-top: 10px;
}

.recipe-lane p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.script-box {
  margin: 14px 0;
}

.script-box textarea {
  min-height: 190px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.preview-stage {
  min-height: 270px;
}

.portfolio-shell {
  padding: 18px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.position-card {
  min-height: 260px;
  padding: 18px;
}

.position-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(185, 255, 59, 0.3);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--acid);
  font-size: 11px;
  font-weight: 850;
}

.position-card h2 {
  margin: 18px 0 10px;
}

.position-card p {
  color: var(--muted);
  line-height: 1.58;
}

.position-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

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

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

@media (max-width: 920px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .primary-nav,
  .header-actions {
    justify-content: stretch;
  }

  .primary-nav {
    overflow-x: auto;
  }

  .workspace,
  .studio-shell,
  .hooklab-shell,
  .forge-shell,
  .portfolio-grid,
  .side-panel,
  .studio-status-grid,
  .hook-recipe,
  .hook-controls,
  .hook-pipeline,
  .forge-topline,
  .forge-levers,
  .forge-grid {
    grid-template-columns: 1fr;
  }

  .pool-grid,
  .studio-form {
    grid-template-columns: 1fr;
  }

  .rail,
  .pool-board,
  .side-panel,
  .studio-editor,
  .launch-preview,
  .hooklab-console,
  .hooklab-ledger,
  .forge-console,
  .forge-preview,
  .portfolio-shell {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .workspace,
  .studio-shell,
  .hooklab-shell,
  .forge-shell,
  .portfolio-shell {
    padding: 10px;
  }

  .board-toolbar,
  .selected-top,
  .hunt-header {
    display: grid;
  }

  .toolbar-tabs,
  .segmented-control {
    overflow-x: auto;
  }

  .selected-stats,
  .hunt-quote,
  .preview-meters {
    grid-template-columns: 1fr;
  }

  .activity-tape {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

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

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

  .ledger-grid,
  .trace-row,
  .forge-stats {
    grid-template-columns: 1fr;
  }

  .forge-depth-map {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

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

/* --- LOOTPOOL v4 single-view layout --- */
.brand-tag {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--acid);
  color: #0a0d07;
  font-size: 11px;
  font-weight: 900;
}
.v4-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}
.v4-hero {
  margin-bottom: 18px;
}
.v4-hero h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  margin: 6px 0 10px;
}
.v4-hero code {
  color: var(--acid);
  font-family: Consolas, monospace;
}
.mode-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 240, 220, 0.12);
  border-radius: 10px;
  background: rgba(245, 240, 220, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.mode-banner.live {
  border-color: rgba(185, 255, 59, 0.5);
  background: rgba(185, 255, 59, 0.08);
  color: var(--acid);
}
.v4-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1000px) {
  .v4-grid {
    grid-template-columns: 1fr;
  }
}
.v4-grid .hunt-card,
.v4-grid .selected-card,
.v4-grid .side-panel {
  padding: 18px;
}
.v4-grid input[type="number"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(245, 240, 220, 0.14);
  background: rgba(10, 13, 7, 0.6);
  color: var(--ink);
  font-size: 15px;
}
