/* Model architecture exploration page.
   Companion to style.css — only the architecture-specific layout +
   typography lives here. The .quality-badge classes are re-used from
   style.css (rich tooltip styling), so badges look consistent across
   the chart and this page. */

.architecture-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.architecture-page .header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.architecture-page .lede {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 70ch;
}

.architecture-page .back-link {
  font-size: 13px;
  white-space: nowrap;
}

/* Table-of-contents nav */
.arch-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 16px;
  margin: 24px 0;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #161b22;
  font-size: 13px;
}
.arch-toc a {
  color: var(--accent);
  text-decoration: none;
}
.arch-toc a:hover { text-decoration: underline; }

/* Each section card */
.arch-section {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #30363d;
}
.arch-section h2 {
  margin-bottom: 8px;
  font-size: 20px;
}
.arch-section p,
.arch-section ul {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  max-width: 70ch;
}
.arch-section ul { padding-left: 20px; }
.arch-section li { margin: 4px 0; }
.arch-section code {
  background: #161b22;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12.5px;
}

/* "Coming soon" placeholder card */
.arch-placeholder {
  margin: 16px 0 8px;
  padding: 14px 18px;
  background: #161b22;
  border: 1px dashed #30363d;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  max-width: 70ch;
}
.arch-placeholder em {
  color: var(--accent);
  font-style: italic;
  margin-right: 4px;
}

/* Re-use quality-badge styles from style.css — they were defined under
   .sankey-tooltip there. Replicate the rules at root scope so the
   architecture page can show the legend without depending on the tooltip
   DOM. Keep colors in sync with style.css. */
.quality-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin: 0 2px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  color: #111;
  vertical-align: middle;
  line-height: 14px;
}
.quality-badge.q-L1 { background: #4ade80; }
.quality-badge.q-L2 { background: #bef264; }
.quality-badge.q-L3 { background: #fbbf24; }
.quality-badge.q-L4 { background: #fb923c; color: #fff; }

.arch-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #30363d;
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------
   Decision timeline (Section #decisions). Replaces .arch-placeholder
   for that section once the data fetch completes.
   -------------------------------------------------------------------- */

.arch-dec-host {
  margin: 16px 0 8px;
  max-width: none;
}

.arch-dec-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.arch-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.arch-chip {
  background: #161b22;
  color: var(--fg);
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}
.arch-chip:hover { border-color: var(--accent); }
.arch-chip.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 600;
}
.arch-chip-count {
  opacity: 0.65;
  margin-left: 4px;
  font-size: 11px;
}
.arch-chip.active .arch-chip-count { opacity: 0.85; }

.arch-dec-hint {
  color: var(--muted);
  font-size: 12px;
}

.arch-dec-themes { display: flex; flex-direction: column; gap: 24px; }
.arch-dec-theme {}
.arch-dec-theme-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.arch-dec-theme-count {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

.arch-dec-list {
  display: flex;
  flex-direction: column;
  border-left: 2px solid #30363d;
  padding-left: 14px;
  gap: 4px;
}

.arch-dec {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 13px;
  scroll-margin-top: 16px;
}
.arch-dec[open] { border-color: var(--accent); }
.arch-dec summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 56px 92px 1fr;
  align-items: baseline;
  gap: 10px;
  color: var(--fg);
}
.arch-dec summary::-webkit-details-marker { display: none; }
.arch-dec summary:hover { background: #1c2330; }
.arch-dec-id {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 600;
  color: var(--accent);
}
.arch-dec-date {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}
.arch-dec-title { line-height: 1.4; }

.arch-dec-body {
  padding: 4px 12px 12px;
  border-top: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--fg);
  line-height: 1.55;
}
.arch-dec-section {}
.arch-dec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}
.arch-dec-text {
  font-size: 13px;
}
.arch-dec-text code {
  background: #0e1116;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.arch-dec-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.arch-decref {
  color: var(--accent);
  text-decoration: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.95em;
  padding: 0 2px;
}
.arch-decref:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .arch-dec summary {
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
  }
  .arch-dec-date { grid-column: 1 / -1; font-size: 11px; }
}

/* --------------------------------------------------------------------
   Research values table (Section #research)
   -------------------------------------------------------------------- */

.arch-rv-host {
  margin: 16px 0 8px;
  max-width: none;
}

.arch-rv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.arch-rv-search {
  flex: 1 1 240px;
  background: #0e1116;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: var(--fg);
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
}
.arch-rv-search:focus {
  outline: none;
  border-color: var(--accent);
}
.arch-rv-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.arch-rv-filters label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.arch-rv-filters select {
  background: #0e1116;
  color: var(--fg);
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
}

.arch-rv-summary {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.arch-rv-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #30363d;
  border-radius: 6px;
}
.arch-rv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--fg);
}
.arch-rv-table thead th {
  position: sticky;
  top: 0;
  background: #1c2330;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid #30363d;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.arch-rv-table thead th:hover { color: var(--accent); }
.arch-rv-table thead th.sort-asc::after { content: " ▲"; color: var(--accent); }
.arch-rv-table thead th.sort-desc::after { content: " ▼"; color: var(--accent); }
.arch-rv-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid #21262d;
}
.arch-rv-table tbody tr:hover:not(.arch-rv-detail) { background: #1c2330; }
.arch-rv-table tbody tr.expanded { background: #1c2330; }
.arch-rv-table td {
  padding: 6px 10px;
  vertical-align: top;
  line-height: 1.4;
}
.arch-rv-doc {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.arch-rv-key {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}
.arch-rv-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arch-rv-units { color: var(--muted); white-space: nowrap; }
.arch-rv-date { color: var(--muted); white-space: nowrap; }
.arch-rv-review { white-space: nowrap; }

.arch-rv-detail td {
  background: #0e1116;
  padding: 10px 14px 12px;
  border-bottom: 1px solid #30363d;
}
.arch-rv-detail-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.55;
}
.arch-rv-detail-body strong {
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.arch-rv-detail-meta {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
}

.arch-rv-truncated {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 12px;
}

.arch-review-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #111;
}
.arch-review-stale { background: #fb7185; color: #111; }
.arch-review-soon  { background: #fbbf24; color: #111; }
.arch-review-warn  { background: #bef264; color: #111; }
.arch-review-ok    { background: #2d333b; color: var(--muted); }

/* --------------------------------------------------------------------
   Generation source cards (Section #sources)
   -------------------------------------------------------------------- */

.arch-cards-host { margin: 16px 0 8px; max-width: none; }
.arch-cards-meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 12px;
}

.arch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.arch-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.arch-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.arch-card-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.arch-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

.arch-card-spark-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: #0e1116;
  border-radius: 4px;
  padding: 4px 8px;
}
.arch-spark { display: block; }
.arch-card-spark-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.arch-card-spark-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.arch-card-spark-year {
  font-size: 10.5px;
}

.arch-card-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.arch-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  gap: 8px;
}
.arch-card-row-key { color: var(--muted); }
.arch-card-row-val {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.arch-card-units {
  color: var(--muted);
  font-size: 11px;
  margin: 0 2px;
}

.arch-card-eff {
  background: #0e1116;
  border-radius: 4px;
  padding: 8px 10px;
}
.arch-card-eff-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.arch-card-eff-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.arch-card-eff-note {
  font-size: 11px;
  color: var(--muted);
}

.arch-card-citation {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid #21262d;
  padding-top: 8px;
}
.arch-card-citation strong {
  color: var(--fg);
  font-weight: 600;
  margin-right: 4px;
}

/* --------------------------------------------------------------------
   Feedback loops diagram (Section #feedback) — v2
   -------------------------------------------------------------------- */

.fb-host { margin: 16px 0 8px; max-width: none; }

.fb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  align-items: center;
}
.fb-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.fb-swatch-input    { background: #1f6feb; }
.fb-swatch-state    { background: #3d4d63; }
.fb-swatch-submodel { background: #8957e5; }
.fb-swatch-output   { background: #2da44e; }

.fb-arrow-key {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 2px solid #8b949e;
  margin-right: 4px;
  vertical-align: middle;
}
.fb-arrow-key-feedback { border-color: var(--accent); border-top-style: dashed; }

.fb-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.fb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}
.fb-toolbar .fb-meta { margin: 0; flex: 1 1 320px; }
.fb-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fb-seed-label {
  font-size: 11.5px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.fb-seed-value { color: var(--fg); }
.fb-shuffle {
  background: #161b22;
  color: var(--fg);
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.fb-shuffle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fb-svg-wrap {
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0e1116;
  padding: 8px;
}
.fb-svg {
  width: 100%;
  height: auto;
  display: block;
}

.fb-node rect {
  fill: #3d4d63;
  stroke: #30363d;
  stroke-width: 1;
  transition: filter 0.12s ease;
}
.fb-node:hover rect {
  filter: brightness(1.4);
  cursor: pointer;
}
.fb-node-input rect    { fill: #1f6feb; }
.fb-node-state rect    { fill: #3d4d63; }
.fb-node-submodel rect { fill: #8957e5; }
.fb-node-output rect   { fill: #2da44e; }

.fb-node-label {
  color: var(--fg);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  word-break: break-word;
}

.fb-edge {
  fill: none;
  stroke: #c9d1d9;
  stroke-width: 2;
  cursor: pointer;
  transition: stroke-width 0.12s ease, stroke 0.12s ease, opacity 0.12s ease;
  opacity: 0.9;
}
.fb-edge:hover { stroke-width: 3.4; opacity: 1; }
/* Source-kind tinted edge bodies. The arrowhead marker is colored to match. */
.fb-edge-from-input    { stroke: #79b8ff; }
.fb-edge-from-state    { stroke: #c9d1d9; }
.fb-edge-from-submodel { stroke: #b292f5; }
.fb-edge-from-output   { stroke: #7fdca0; }
.fb-edge-feedback {
  stroke: var(--accent);
  stroke-dasharray: 5 4;
  opacity: 0.95;
}
.fb-edge-feedback:hover { stroke: #ffd07a; }

/* Floating tooltip pinned to the cursor — replaces the side panel from v1. */
.fb-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 340px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--fg);
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.fb-tip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}
.fb-tip-input    { color: #79b8ff; }
.fb-tip-state    { color: #d1d5da; }
.fb-tip-submodel { color: #b292f5; }
.fb-tip-output   { color: #7fdca0; }
.fb-tip-kind {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.fb-tip-body { font-size: 12.5px; }
.fb-tip-math {
  margin-top: 6px;
  padding: 6px 8px;
  background: #0e1116;
  border-left: 2px solid var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
  border-radius: 0 3px 3px 0;
}
.fb-tip-sens {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.fb-tip-sens strong { color: var(--fg); font-weight: 600; }
.fb-tip-sens-num {
  margin-top: 4px;
  padding: 4px 8px;
  background: #0e1116;
  border-radius: 3px;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
}
.fb-tip-refs {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.fb-tip-refs .arch-decref { pointer-events: auto; }

/* --------------------------------------------------------------------
   Submodels section
   -------------------------------------------------------------------- */

.sm-host { margin: 16px 0 8px; max-width: none; }
.sm-meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 14px;
}
.sm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
}
.sm-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.sm-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.sm-card-refs {
  font-size: 11px;
}
.sm-card-intro {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg);
}
.sm-card-math {
  background: #0e1116;
  border-left: 2px solid var(--accent);
  padding: 7px 10px;
  border-radius: 0 4px 4px 0;
}
.sm-card-math code {
  background: transparent;
  padding: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  color: var(--fg);
  white-space: pre-wrap;
  line-height: 1.5;
}
.sm-card-headline-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0e1116;
  padding: 8px 10px;
  border-radius: 4px;
}
.sm-card-headline-meta { text-align: right; }
.sm-card-headline-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sm-card-headline-val {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.sm-card-headline-year {
  font-size: 11px;
  color: var(--muted);
}
.sm-card-units {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
.sm-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.sm-card-col-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.sm-card-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sm-card-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.sm-card-row-key {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-card-row-val {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.sm-card-minis {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sm-card-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e1116;
  border-radius: 3px;
  padding: 4px 6px;
}
.sm-card-mini-spark .arch-spark { display: block; }
.sm-card-mini-meta {
  font-size: 11px;
  line-height: 1.3;
  flex: 1;
}
.sm-card-mini-label {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.sm-card-mini-val {
  display: block;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .sm-card-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------
   Policy layer section
   -------------------------------------------------------------------- */

.pol-host { margin: 16px 0 8px; max-width: none; }
.pol-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.pol-legend-pill {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.pol-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.pol-column {}
.pol-column-header {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pol-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.pol-state-block { margin-bottom: 14px; }
.pol-state-header {
  margin: 4px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px dashed #30363d;
  padding-bottom: 4px;
}

.pol-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pol-card-carrot { border-left: 3px solid #4ade80; }
.pol-card-stick { border-left: 3px solid #fb7185; }

.pol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.pol-card-id-block { min-width: 0; flex: 1; }
.pol-card-jur {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1px;
}
.pol-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  color: var(--fg);
  word-break: break-word;
}
.pol-card-meta {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}
.pol-card-class { font-weight: 600; }
.pol-card-years {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10.5px;
}

.pol-card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg);
}

.pol-card-effects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.pol-card-effect {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  background: #0e1116;
  flex-wrap: wrap;
}
.pol-card-effect-carrot    { background: rgba(74, 222, 128, 0.10); border-left: 2px solid #4ade80; }
.pol-card-effect-stick     { background: rgba(251, 113, 133, 0.10); border-left: 2px solid #fb7185; }
.pol-card-effect-lifecycle { background: rgba(125, 145, 240, 0.12); border-left: 2px solid #818cf8; }
.pol-card-effect-quantity  { background: rgba(251, 191, 36, 0.10); border-left: 2px solid #fbbf24; }

.pol-card-mech {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  color: var(--fg);
}
.pol-card-target {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}
.pol-card-mag {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
  font-size: 11.5px;
  margin-left: auto;
}

.pol-card-dur {
  align-self: flex-start;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  margin-top: 2px;
}
.pol-card-dur-high { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.pol-card-dur-mid  { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.pol-card-dur-low  { background: rgba(251, 113, 133, 0.15); color: #fb7185; }

@media (max-width: 920px) {
  .pol-columns { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------
   Levers section
   -------------------------------------------------------------------- */

.lev-host { margin: 16px 0 8px; max-width: none; }
.lev-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.lev-meta code {
  background: #0e1116;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.lev-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lev-cat {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  overflow: hidden;
}
.lev-cat-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c2330;
  user-select: none;
}
.lev-cat-summary::-webkit-details-marker { display: none; }
.lev-cat-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 0.12s ease;
}
.lev-cat[open] .lev-cat-summary::before { transform: rotate(90deg); }
.lev-cat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.lev-cat-count {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.lev-cat-body { padding: 10px 14px 12px; }
.lev-cat-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.lev-sub { margin-top: 10px; }
.lev-sub:first-child { margin-top: 0; }
.lev-sub-header {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lev-sub-count {
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  margin-left: 4px;
}
.lev-sub-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lev-row {
  background: #0e1116;
  border: 1px solid #21262d;
  border-radius: 4px;
}
.lev-row[open] { border-color: var(--accent); }
.lev-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
}
.lev-summary::-webkit-details-marker { display: none; }
.lev-summary:hover { background: #1c2330; }
.lev-summary-main { min-width: 0; }
.lev-summary-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
}
.lev-summary-path {
  display: block;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  padding: 0;
  margin-top: 1px;
}
.lev-summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 11.5px;
}
.lev-summary-default {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}
.lev-summary-units {
  font-size: 10.5px;
  color: var(--muted);
}

.lev-body {
  padding: 10px 14px 12px;
  border-top: 1px solid #21262d;
  font-size: 12px;
  line-height: 1.55;
}
.lev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 14px;
  margin-bottom: 8px;
}
.lev-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lev-label-key {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10.5px;
}
.lev-label-val {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.lev-desc { margin: 6px 0 0; color: var(--fg); }
.lev-example {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-style: italic;
}
.lev-example strong {
  font-style: normal;
  color: var(--fg);
  margin-right: 4px;
}
.lev-open-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background: #161b22;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}
.lev-open-btn:hover {
  background: var(--accent);
  color: #111;
}
