:root {
  --bg: #fbf7f2;
  --surface: #fffdfa;
  --surface-soft: #f8efe6;
  --line: #e7dbce;
  --line-strong: #d7c4b2;
  --ink: #1d1712;
  --muted: #6d6054;
  --subtle: #998676;
  --blue: #d56a43;
  --blue-soft: #fff1e7;
  --green: #0f6b57;
  --green-soft: #ecf8f3;
  --amber: #9a6130;
  --amber-soft: #fff3e3;
  --red: #9e3232;
  --red-soft: #fff2f2;
  --purple: #b86b4d;
  --purple-soft: #f9ece5;
  --brand: #fe5e35;
  --brand-soft: #fff2ea;
  --brand-soft-strong: #f6e5da;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: linear-gradient(180deg, #fffdfa 0%, #faf4ed 52%, #f6efe7 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.page,
.nl-shell { max-width: 1140px; margin: 0 auto; padding: 28px 18px 56px; }

.reference-strip {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.reference-strip-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.reference-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.reference-links a {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.reference-links a:hover { color: var(--brand); }

.family-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.nav-group-title {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.family-nav a,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 10px;
}
.family-nav a.active,
.chip.active {
  background: var(--brand-soft);
  border-color: #efc6b2;
  color: var(--brand);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h1 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: -0.04em;
}
h2 {
  margin: 30px 0 12px;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}
h3 {
  margin: 20px 0 10px;
  font-size: 18px;
  line-height: 1.25;
}
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 14px 20px; padding: 0; }
li { margin-bottom: 8px; }
.lede {
  max-width: 70rem;
  font-size: 18px;
  color: #243140;
}
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.footnote {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.45;
}
.section-label {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-note {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.nl-powered-by {
  margin-top: 40px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
}
.nl-powered-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
}
.nl-powered-link:hover {
  color: var(--ink);
  text-decoration: none;
}
.nl-powered-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.nl-powered-copy {
  display: grid;
  gap: 2px;
}
.nl-powered-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle);
}
.nl-powered-wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
}

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

.panel,
.card-panel {
  margin: 14px 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.panel.soft,
.card-panel.soft { background: var(--surface-soft); }
.panel.blue { background: var(--brand-soft); border-color: #efc6b2; }
.panel.green { background: var(--green-soft); border-color: #bfdfd4; }
.panel.amber { background: var(--amber-soft); border-color: #eed8aa; }
.panel.red { background: var(--red-soft); border-color: #e8c4c4; }

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.green { background: var(--green-soft); border-color: #bfdfd4; color: var(--green); }
.badge.amber { background: var(--amber-soft); border-color: #eed8aa; color: var(--amber); }
.badge.red { background: var(--red-soft); border-color: #e8c4c4; color: var(--red); }
.badge.blue { background: var(--brand-soft); border-color: #efc6b2; color: var(--brand); }
.badge.purple { background: var(--purple-soft); border-color: #e7c5b6; color: var(--purple); }

.card-link,
.cta-card-link,
.card-panel {
  display: block;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.card-link strong,
.cta-card-link strong,
.card-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.3;
}
.card-link span,
.cta-card-link span,
.card-panel span { display: block; }
.route-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.scenario {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 18px;
}
.scenario .badge { margin-bottom: 12px; }

.metadata,
table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
}
.metadata th,
.metadata td,
table th,
table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.metadata tr:first-child th,
.metadata tr:first-child td,
table tr:first-child th,
table tr:first-child td { border-top: 0; }
.metadata th:last-child,
.metadata td:last-child,
table th:last-child,
table td:last-child { border-right: 0; }
.metadata th {
  width: 18%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  background: var(--surface-soft);
}
table thead th {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
  background: var(--surface-soft);
}
.source-link {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.stat {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}
.stat strong {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.callout {
  border-left: 4px solid var(--brand);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  margin: 12px 0 16px;
}

.venue-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.venue-tag.blue,
.venue-tag.indoor { background: var(--brand-soft); border-color: #efc6b2; color: var(--brand); }
.venue-tag.green,
.venue-tag.arena { background: var(--green-soft); border-color: #bfdfd4; color: var(--green); }
.venue-tag.outdoor { background: var(--amber-soft); border-color: #eed8aa; color: var(--amber); }
.venue-tag.purple,
.venue-tag.festival { background: var(--purple-soft); border-color: #e7c5b6; color: var(--purple); }

/* Inventory (merch) table: keep only the genuinely short columns on one line —
   Price (2), Stock (4), Variants (5) — so "In stock" / "3 of 5 available" never
   wrap mid-phrase. The Item name (1) and the Category size-detail (3) can both be
   long ("…, XL +18 more"), so they MUST wrap; forcing them nowrap blows the table
   past the container and triggers horizontal scroll. */
table.inventory-grid th,
table.inventory-grid td { white-space: nowrap; }
table.inventory-grid th:first-child,
table.inventory-grid td:first-child,
table.inventory-grid th:nth-child(3),
table.inventory-grid td:nth-child(3) { white-space: normal; }

td.weather { white-space: nowrap; }
td.weather-hot { color: var(--red); }
td.weather-warm { color: var(--amber); }
td.weather-mild { color: var(--green); }

.traffic-note {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--amber-soft);
  border: 1px solid #eed8aa;
  margin: 8px 0;
}

.nl-page { display: grid; gap: 18px; }
.nl-hero,
.nl-section,
.nl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.nl-hero { padding: 28px; }
.nl-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.nl-dek {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 72ch;
}
.nl-section { padding: 22px; }
.nl-section h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nl-section p { margin: 0 0 12px; }
.nl-list,
.nl-sublist,
.nl-index-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.nl-list li,
.nl-index-list li {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.nl-list li:first-child,
.nl-index-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.nl-list--ordered { counter-reset: item; }
.nl-list--ordered > li {
  position: relative;
  padding-left: 42px;
}
.nl-list--ordered > li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  background: #fff;
}
.nl-item-title { font-weight: 700; }
.nl-sublist { margin-top: 8px; padding-left: 0; }
.nl-sublist li {
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.nl-inline-label { font-weight: 700; color: var(--ink); }
.nl-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.nl-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.nl-kv { display: grid; gap: 10px; }
.nl-kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.nl-kv-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.nl-kv-key { font-weight: 700; }
.nl-index-grid { display: grid; gap: 14px; }
.nl-index-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
}
.nl-index-card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.2;
}
.nl-index-card p {
  margin: 0 0 12px;
  color: var(--muted);
}
.nl-index-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.section-intro {
  max-width: 68ch;
  margin: 0 0 14px;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 18px;
  margin: 20px 0 26px;
  align-items: stretch;
}

.hero-aside,
.stack {
  display: grid;
  gap: 14px;
}

.hero-panel,
.hero-card,
.proof-card,
.comparison-card,
.signal-card,
.metric-card {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-panel h2 {
  margin-top: 0;
}

.hero-panel p:last-child,
.hero-card p:last-child,
.proof-card p:last-child,
.comparison-card p:last-child,
.signal-card p:last-child {
  margin-bottom: 0;
}

.metric-grid,
.comparison-grid,
.proof-grid,
.signal-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

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

/* The goldanswer renderer emits a <table class="comparison-grid"> for
   comparison blocks (writeComparison). The grid rule above is meant for div
   card grids; on a <table> it collapses thead/tbody into grid items and makes
   the table unviewable. Restore table layout so the generic table styling
   (borders, padding, header row) applies. */
table.comparison-grid {
  display: table;
}

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

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

.metric-label,
.card-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric-value,
.proof-stat {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.microcopy,
.comparison-meta {
  font-size: 13px;
  color: var(--muted);
}

.card-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.25;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill.brand {
  background: var(--brand-soft);
  border-color: #efc6b2;
  color: var(--brand);
}

.pill.green {
  background: var(--green-soft);
  border-color: #bfdfd4;
  color: var(--green);
}

.pill.amber {
  background: var(--amber-soft);
  border-color: #eed8aa;
  color: var(--amber);
}

.pill.purple {
  background: var(--purple-soft);
  border-color: #e7c5b6;
  color: var(--purple);
}

.list-clean {
  margin: 0;
  padding-left: 18px;
}

.list-clean li {
  margin-bottom: 8px;
}

.split-callout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.keyline {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .grid-4,
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-grid,
  .signal-grid,
  .metric-grid,
  .hero-grid,
  .split-callout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page,
  .nl-shell { padding: 18px 12px 40px; }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .reference-strip { justify-content: flex-start; margin-bottom: 12px; }
  h1 { font-size: 32px; }
  .lede { font-size: 16px; }
  .family-nav { padding: 12px; gap: 10px; }
  .nav-group { display: grid; gap: 6px; width: 100%; }
  .metadata th,
  table thead th { width: auto; }
  .proof-grid,
  .comparison-grid,
  .signal-grid,
  .metric-grid { grid-template-columns: 1fr; }
}