:root {
  --bg: #39ff14;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #0d0d0d;
  --muted: #3a3a3a;
  --line: #0d0d0d;
  --accent: #0d0d0d;
  --accent-deep: #0d0d0d;
  --teal: #0d0d0d;
  --danger: #0d0d0d;
  --ok: #0d0d0d;
  --shadow: 10px 10px 0 #0d0d0d;
  --radius-lg: 0;
  --radius-md: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: var(--bg);
}

code,
pre {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

.shell {
  width: min(1160px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.card {
  margin-top: 1rem;
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}

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

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.55rem;
}

.lede,
.hero-note,
.small-note {
  color: var(--muted);
  line-height: 1.7;
}

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 3px solid var(--line);
}

.hero-kicker {
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-stat {
  font-size: 2rem;
  font-weight: 700;
}

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

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 #0d0d0d;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button {
  color: #ffffff;
  background: #0d0d0d;
}

.ghost-button {
  color: var(--text);
  background: #ffffff;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0d0d0d;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 0.9rem;
}

.seed-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.seed-card {
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 2px solid var(--line);
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-wide {
  grid-column: span 1;
}

.field input {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 0.9rem 1rem;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  box-shadow: 4px 4px 0 #0d0d0d;
}

.field-inline {
  width: 100%;
}

.meta-row {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.tab-row.secondary {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 3px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  padding: 0.72rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 #0d0d0d;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.filter-chip:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0d0d0d;
}

.filter-chip span {
  display: inline-flex;
  min-width: 1.8rem;
  justify-content: center;
  border-radius: 0;
  padding: 0.2rem 0.45rem;
  background: #39ff14;
  color: #0d0d0d;
  font-size: 0.8rem;
  border: 2px solid var(--line);
}

.filter-chip.is-active {
  background: #0d0d0d;
  color: #ffffff;
  border-color: var(--line);
}

.filter-chip.is-active span {
  background: #ffffff;
  color: #0d0d0d;
}

.picker-toolbar {
  display: flex;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.picker-toolbar .ghost-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  max-height: 36rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.node-select-card {
  width: 100%;
  padding: 0.95rem;
  border: 3px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 6px 6px 0 #0d0d0d;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.node-select-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #0d0d0d;
}

.node-select-card.is-active {
  border-color: var(--line);
  background: #39ff14;
}

.node-select-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.node-select-title {
  font-size: 1rem;
  font-weight: 700;
}

.node-select-subtitle {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.node-select-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.node-select-meta span,
.mini-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 0.3rem 0.55rem;
  background: #ffffff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  border: 2px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 1.15fr);
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0;
  font-size: 0.88rem;
  font-weight: 700;
  border: 3px solid var(--line);
}

.badge.idle {
  background: #ffffff;
  color: var(--text);
}

.badge.running {
  background: #39ff14;
  color: var(--text);
}

.badge.ok {
  background: #39ff14;
  color: var(--text);
}

.badge.error {
  background: #ffffff;
  color: var(--text);
}

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

.result-tile {
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 2px solid var(--line);
}

.result-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.result-value {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-word;
}

.payload-box,
.feasibility-box {
  min-height: 22rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 3px solid var(--line);
  background: var(--panel-strong);
  overflow: auto;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 6px 6px 0 #0d0d0d;
}

.feasibility-box {
  min-height: auto;
}

.empty-state {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  border: 3px dashed var(--line);
  background: #ffffff;
  color: var(--text);
  line-height: 1.7;
}

@media (max-width: 920px) {
  .hero,
  .grid,
  .form-grid,
  .result-grid,
  .seed-summary,
  .node-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .picker-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .picker-toolbar .ghost-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 0.8rem, 100%);
    padding: 0.6rem 0 2rem;
  }

  .card {
    padding: 0.9rem;
    box-shadow: 5px 5px 0 #0d0d0d;
  }

  .hero {
    gap: 0.8rem;
  }

  h1 {
    font-size: 2.15rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .hero-stat {
    font-size: 1.45rem;
  }

  .node-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    max-height: none;
    overflow: visible;
  }

  .node-select-card {
    box-shadow: 5px 5px 0 #0d0d0d;
  }

  .node-select-title {
    font-size: 1.08rem;
  }

  .payload-box {
    min-height: 14rem;
    padding: 0.85rem;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .result-grid,
  .seed-summary {
    grid-template-columns: 1fr;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.tabs--sub {
  margin: 8px 0;
}
.tabs button {
  padding: 6px 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  font: inherit;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--accent);
  transition: transform 0.1s ease;
}
.tabs button:hover {
  transform: translate(-1px, -1px);
}
.tabs button[aria-selected="true"] {
  background: var(--bg);
  color: var(--text);
}
.status {
  padding: 8px 12px;
  font: inherit;
  color: var(--muted);
}
.status[data-state="error"] {
  color: var(--danger);
  font-weight: 700;
}
