/* ══════════════════════════════════════════════════════════
   BMB app.css — built on tokens.css.
   Blueprint family resemblance: drafting-paper body, card anatomy
   with primary header + teal laser-line rule, DM Sans display,
   Plus Jakarta Sans body, JetBrains Mono mono-labels.
   ══════════════════════════════════════════════════════════ */

@import url("tokens.css");

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Blueprint-paper grid (blueprint.css:66-81) */
  background-image:
    linear-gradient(var(--grid-line-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-strong) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;

  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

/* ── Shell ───────────────────────────────────────────────── */

.app-shell {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--sp-32) var(--sp-32);
}

/* ══════════════════════════════════════════════════════════
   MASTHEAD — indigo anchor frame at the top of every page.

   The application has a dark frame; the body inside it is the
   sand drafting surface. This is *not* the v1 indigo-strip-on-
   every-card pattern — it's one app-level anchor used once,
   per-page, to signal "the chrome ends here, the work begins".

   Bleeds full viewport width via a -50vw negative margin trick
   while staying aligned to the .app-shell content column.
   ══════════════════════════════════════════════════════════ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--sp-24);
  height: 56px;
  padding: 0 var(--sp-32);
  margin: calc(-1 * var(--sp-32)) calc(50% - 50vw) var(--sp-16);
  background: var(--primary);
  border-bottom: 2px solid var(--secondary);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.mast-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}
.mast-mark-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  background: var(--secondary);
  padding: 3px 8px;
  border-radius: 4px;
}
.mast-mark-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--sand);
}

.mast-nav {
  display: flex;
  gap: 2px;
  margin-left: var(--sp-16);
  flex: 1;
}
.mast-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(244, 244, 239, 0.55);
  padding: 6px var(--sp-12);
  border-radius: 4px;
  transition: color 0.12s ease, background 0.12s ease;
  text-decoration: none;
}
.mast-nav a:hover {
  color: var(--sand);
  background: rgba(244, 244, 239, 0.08);
}

.mast-search {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  padding: 9px var(--sp-16);
  background: rgba(63, 199, 160, 0.10);
  border: 1.5px solid rgba(63, 199, 160, 0.45);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.14s ease, background 0.14s ease,
              box-shadow 0.14s ease;
  min-width: 320px;
}
.mast-search:hover,
.mast-search:focus-visible {
  border-color: var(--secondary);
  background: rgba(63, 199, 160, 0.20);
  box-shadow: 0 0 0 4px var(--glow-teal);
  outline: none;
}
.mast-search-glyph {
  color: var(--secondary);
  font-size: 1.05rem;
  font-weight: 700;
}
.mast-search-hint {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sand);
  text-align: left;
}
.mast-search-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--secondary);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 4px;
}

@media (max-width: 1100px) {
  .mast-mark-text { display: none; }
}
@media (max-width: 800px) {
  .mast-search-hint { display: none; }
  .mast-search { min-width: 0; }
  .masthead { gap: var(--sp-12); padding: 0 var(--sp-16); }
  .mast-nav a { padding: 6px var(--sp-8); }
}

/* ══════════════════════════════════════════════════════════
   THE DRAFTING SURFACE — corner registration marks + title block.

   The body of every page reads as one large architectural drawing
   sheet. Four registration marks (small + crosses) anchor the
   visible corners of the content column; a title block in the
   bottom-right carries CATALYST · BMB metadata in mono — exactly
   like a real drawing's title block.

   These are decorative-by-purpose: they make the page feel like
   a Catalyst tool, not a vanilla SaaS dashboard. Pure CSS, no
   per-page template touch-up needed.
   ══════════════════════════════════════════════════════════ */

/* Corner registration marks — fixed at the viewport corners so they
   stay in view as you scroll, exactly like the registration marks on
   a real architectural drawing sheet. The masthead lands above them
   on the top edge; the title block lands inside the bottom-right one. */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%2326265E' stroke-width='1.2' stroke-linecap='round' opacity='0.42'><line x1='9' y1='2' x2='9' y2='16'/><line x1='2' y1='9' x2='16' y2='9'/><circle cx='9' cy='9' r='3.5'/></svg>");
  pointer-events: none;
  z-index: 4;
}
body::before {
  bottom: var(--sp-12);
  left: var(--sp-12);
}
body::after {
  /* Top-left corner mark — sits in the indigo masthead area but the
     SVG stroke colour `%2326265E` (indigo) blends in there; that's
     intentional, the mark is for the drawing-surface corner not the
     chrome corner. Hide on tiny screens. */
  display: none;
}

/* Bottom-right title block — fixed at the page corner, like a real
   drawing's title block. Click target small; visual weight low; it's
   a brand mark, not a UI element. */
.title-block {
  position: fixed;
  right: var(--sp-16);
  bottom: var(--sp-12);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(38, 38, 94, 0.4);
  background: rgba(244, 244, 239, 0.85);
  border: 1px solid rgba(38, 38, 94, 0.12);
  border-radius: 3px;
  padding: 4px 10px;
  pointer-events: none;
  user-select: none;
  z-index: 5;
  backdrop-filter: blur(2px);
}
.title-block::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.4px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.title-block-sep {
  color: rgba(38, 38, 94, 0.2);
  margin: 0 2px;
}

/* ── /pack/{slug} page ─────────────────────────────────── */

.pack-page {
  max-width: 1200px;
}

.pack-header {
  background: var(--white);
  border: 1px solid var(--surface);
  border-top: 4px solid var(--secondary);
  border-radius: var(--radius);
  padding: var(--sp-24) var(--sp-32);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sp-24);
}

.pack-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  display: block;
  margin-bottom: var(--sp-8);
}

.pack-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.5px;
  color: var(--primary);
  margin-bottom: var(--sp-12);
}

.pack-desc {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: var(--sp-16);
}

.pack-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
  margin-bottom: var(--sp-16);
  align-items: baseline;
}
.pack-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
}
.pack-count b {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
  letter-spacing: -0.2px;
  margin-right: 4px;
  text-transform: none;
}
.pack-fam-chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 10px;
  background: var(--glow-teal);
  color: var(--secondary-deep);
  border-radius: 4px;
}

.pack-actions {
  display: flex;
  gap: var(--sp-12);
  flex-wrap: wrap;
}

.pack-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-16);
  margin-bottom: var(--sp-32);
}

.pack-other {
  margin-top: var(--sp-48);
  padding-top: var(--sp-16);
  border-top: 1px solid var(--surface);
}

/* ── /validate, /generate, /operations, /draw pages ────── */

.validate-page, .generate-page, .operations-page, .draw-page {
  max-width: 820px;
}

/* ── /draw page ────────────────────────────────────────── */

.draw-token-card,
.draw-form-card {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-16) var(--sp-24);
  margin-bottom: var(--sp-16);
  box-shadow: var(--shadow-subtle);
}

.draw-token-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-16);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}

#draw-token-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  background: var(--sand);
  color: var(--ink);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-12);
}
#draw-token-input:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

.draw-token-help {
  font-size: 0.86rem;
  margin-top: var(--sp-8);
}
.draw-token-help summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--sp-8);
}
.draw-token-help ol {
  padding-left: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin: var(--sp-8) 0 var(--sp-16);
}
.draw-token-help li {
  line-height: 1.55;
}
.draw-token-help em {
  font-style: italic;
  color: var(--neutral);
  font-size: 0.92em;
}
.draw-token-help-foot {
  margin-top: var(--sp-12);
  padding: var(--sp-8) var(--sp-12);
  background: var(--sand);
  border-radius: var(--radius);
  font-size: 0.84rem;
}

.draw-row {
  margin-bottom: var(--sp-16);
}
.draw-row label {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.draw-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
}
.draw-row select,
.draw-row input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
.draw-row select:focus,
.draw-row input[type="text"]:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}
.draw-hint {
  font-size: 0.78rem;
  color: var(--neutral);
  margin: var(--sp-4) 0 0;
}
.draw-hint code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 4px;
  background: var(--sand);
  border-radius: 3px;
}

.draw-wipe {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  font-size: 0.84rem;
  color: var(--ink);
  padding: var(--sp-8) var(--sp-12);
  background: var(--sand);
  border-radius: var(--radius);
  margin-bottom: var(--sp-16);
  cursor: pointer;
}
.draw-wipe input { margin-top: 3px; }

.draw-actions {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

/* ── /operations page ──────────────────────────────────── */

.ops-group {
  margin-top: var(--sp-32);
}

.ops-group-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
  margin-bottom: var(--sp-12);
}

.ops-group-note {
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--neutral);
  margin-left: var(--sp-8);
}

.ops-card {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-16) var(--sp-24);
  margin-bottom: var(--sp-12);
  box-shadow: var(--shadow-subtle);
}

.ops-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-16);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.ops-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.ops-card-cmd {
  font-size: 0.78rem;
  color: var(--neutral);
}
.ops-card-cmd code {
  background: var(--sand);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

.ops-card-blurb {
  font-size: 0.88rem;
  color: var(--ink);
  margin: var(--sp-4) 0 var(--sp-12);
  line-height: 1.5;
}

.ops-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}

.ops-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 4px;
  vertical-align: middle;
}
.ops-pill-ok    { background: var(--glow-teal); color: var(--secondary-deep); }
.ops-pill-warn  { background: rgba(255, 138, 76, 0.18); color: #b54a08; }
.ops-pill-info  { background: var(--sand); color: var(--neutral); }

.ops-drift-list {
  margin-top: var(--sp-8);
  font-size: 0.84rem;
}
.ops-drift-list summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--sp-8);
}
.ops-drift-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ops-drift-list li {
  padding: var(--sp-4) var(--sp-8);
  background: var(--sand);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
}
.ops-drift-list code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  color: var(--primary);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: var(--sp-8);
  letter-spacing: -0.4px;
}

.page-lede {
  font-size: 0.92rem;
  color: var(--neutral);
  margin-bottom: var(--sp-24);
}

.page-lede code,
.callout-risk code,
.callout-insight code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 2px 6px;
  background: var(--sand);
  border-radius: 4px;
  color: var(--primary);
}

.validate-errors {
  list-style: none;
  margin-top: var(--sp-16);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.validate-errors li {
  padding: var(--sp-8) var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
}

.validate-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-16);
  flex-wrap: wrap;
}
.validate-head .page-title {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}

.validate-warnings {
  margin-top: var(--sp-24);
  font-size: 0.86rem;
}
.validate-warnings summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--sp-8);
}
.validate-warnings ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.validate-warnings li {
  padding: var(--sp-8) var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-left: 3px solid var(--neutral);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
}

.generate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
}

.generate-prune {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  font-size: 0.84rem;
  color: var(--ink);
  margin-bottom: var(--sp-16);
  padding: var(--sp-8) var(--sp-12);
  background: var(--sand);
  border-radius: var(--radius);
  cursor: pointer;
}
.generate-prune input { margin-top: 3px; }
.generate-prune code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--white);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--primary);
}

.generate-log {
  background: var(--ink);
  color: var(--sand);
  padding: var(--sp-16);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  min-height: 280px;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--surface);
  box-shadow: var(--shadow-subtle);
}

/* ── Empty state (fresh clone) ─────────────────────────── */

.empty-state {
  max-width: 640px;
  margin: var(--sp-48) auto 0;
  padding: var(--sp-32);
  background: var(--white);
  border: 1px solid var(--surface);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--primary);
  letter-spacing: -0.3px;
  margin-bottom: var(--sp-12);
}
.empty-state p {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: var(--sp-12);
}
.shell-hint {
  background: var(--ink);
  color: var(--sand);
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: var(--sp-8) 0 var(--sp-16);
  user-select: all;
}

/* ── Bulk copy selection ───────────────────────────────── */

.asset-card.selected {
  outline: 3px solid var(--secondary);
  outline-offset: -3px;
}

.selection-bar {
  position: fixed;
  bottom: var(--sp-24);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--primary);
  color: var(--sand);
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--radius);
  border-bottom: 1px solid var(--teal-line-20);
  box-shadow: var(--shadow-lift);
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  transition: transform 0.2s ease;
  z-index: 40;
}
.selection-bar.visible { transform: translateX(-50%) translateY(0); }

.selection-bar .count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.selection-bar .btn {
  padding: var(--sp-8) var(--sp-16);
}

/* ── Featured workshop packs (landing) ─────────────────── */

.pack-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-12);
}

.pack-tile {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-subtle);
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.1s ease;
}
.pack-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

/* Thumbnail strip — the part that makes the tiles read as content,
   not generic cards. Two SVGs side-by-side on top, two below. */
.pack-tile-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--surface);
  height: 140px;
  overflow: hidden;
  position: relative;
}
.pack-thumb {
  background: var(--sand);
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--sp-8);
}
.pack-thumb.pack-thumb-empty { background: var(--sand); }

/* Initiative accents — left stripe on the body, accent border on top
   of the thumbnail strip. Each EverDriven initiative reads as itself. */
.pack-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-12) var(--sp-16);
  position: relative;
}

.pack-tile-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-12);
}
.pack-tile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--primary);
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.pack-tile-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neutral);
  background: var(--sand);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pack-tile-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--neutral);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* Per-initiative differentiation lives in the SVG thumbnails themselves;
   no decorative accent stripe on tiles. The .pack-accent-* classes stay
   on the markup so we can re-introduce subtle hover or label color
   later if needed without changing the template. */

/* "Browse every pack →" CTA tile — high contrast, no thumbnails, lives
   in the same grid slot as a regular pack tile. */
.pack-tile.pack-tile-more {
  background: var(--primary);
  color: var(--sand);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--sp-8);
  padding: var(--sp-24);
  border: none;
  min-height: 240px;
}
.pack-tile.pack-tile-more:hover { background: var(--ink); }
.pack-tile-more-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--secondary);
}
.pack-tile-more-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.pack-tile-more-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sand);
}

/* ── /dev/themes preview ───────────────────────────────── */

.themes-preview-page { max-width: 880px; }

.themes-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-32);
  margin-top: var(--sp-24);
}

.theme-row {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-24);
}

.theme-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.theme-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}

.theme-blurb {
  font-size: 0.9rem;
  color: var(--neutral);
  margin-bottom: var(--sp-16);
}

.theme-svg {
  display: flex;
  justify-content: flex-start;
  background: var(--sand);
  padding: var(--sp-16);
  border-radius: var(--radius);
}
.theme-svg svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── /packs index page ─────────────────────────────────── */

.packs-page { max-width: var(--content-wide, 1180px); }

.packs-search {
  width: 100%;
  max-width: 480px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  background: var(--white);
  margin: var(--sp-16) 0 var(--sp-24);
}
.packs-search:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

/* "Browse all packs →" tile on the landing page — visually distinct
   from the regular themed-tiles so the eye lands on the CTA, not on
   it being just-another-pack-tile. */
.themed-tile.themed-tile-more {
  background: var(--primary);
  color: var(--sand);
  border-top-color: var(--secondary);
}
.themed-tile.themed-tile-more .themed-tile-kicker,
.themed-tile.themed-tile-more .themed-tile-count {
  color: var(--sand);
  opacity: 0.85;
}
.themed-tile.themed-tile-more .themed-tile-name { color: var(--sand); }
.themed-tile.themed-tile-more .themed-tile-desc { color: rgba(255, 255, 255, 0.85); }
.themed-tile.themed-tile-more:hover {
  background: var(--ink);
  color: var(--sand);
}

/* ══════════════════════════════════════════════════════════
   Landing — corporate-aligned, EverDriven brand colors
   (Primary #26265E, Secondary #3FC7A0, Accent #3673B0,
   per EVERDRIVEN-MERMAID-THEME-STANDARD.md). Indigo dominance
   for hierarchy, teal for action signal, ocean blue for content.
   ══════════════════════════════════════════════════════════ */

/* Bleed the indigo bands the full width of the viewport while
   keeping their inner content aligned to the app-shell column. */
.hero-band, .actions-band, .packs-band, .credit-band {
  margin-left:  calc((var(--content-wide, 1180px) - 100vw) / 2 + var(--sp-32));
  margin-right: calc((var(--content-wide, 1180px) - 100vw) / 2 + var(--sp-32));
}
@media (max-width: 1240px) {
  .hero-band, .actions-band, .packs-band, .credit-band {
    margin-left: calc(50% - 50vw + var(--sp-32));
    margin-right: calc(50% - 50vw + var(--sp-32));
  }
}

/* ── Hero band — indigo block, white text ─────────────── */

.hero-band {
  background: linear-gradient(135deg, #1f1f4f 0%, var(--primary) 60%, #2d2d6e 100%);
  color: var(--sand);
  border-radius: var(--radius-lg, 16px);
  padding: var(--sp-48) var(--sp-48);
  margin-bottom: var(--sp-32);
  position: relative;
  overflow: hidden;
  /* Subtle drafting grid ghosting on the indigo, echoes the body bg
     so the engineering DNA stays visible even on the corporate block. */
  background-image:
    linear-gradient(135deg, #1f1f4f 0%, var(--primary) 60%, #2d2d6e 100%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: cover, 120px 120px, 120px 120px;
  background-blend-mode: normal, overlay, overlay;
}

.hero-band-inner {
  max-width: 880px;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  margin-bottom: var(--sp-24);
  flex-wrap: wrap;
}
.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--secondary);
  padding: 4px 12px;
  border-radius: 4px;
}
.hero-eyebrow-sep {
  color: rgba(255, 255, 255, 0.35);
}
.hero-eyebrow-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--sand);
  margin-bottom: var(--sp-16);
  max-width: 800px;
}

.hero-sub {
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--sp-32);
  max-width: 720px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-24);
  padding: var(--sp-24) 0;
  margin-bottom: var(--sp-24);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 720px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--secondary);
}
.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.hero-pulse {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}
.hero-pulse-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-8);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  text-decoration: none;
  color: var(--sand);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.hero-pulse-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
}
.hero-pulse-chip.is-ok   { border-color: var(--secondary); }
.hero-pulse-chip.is-warn { border-color: #ff8a4c; }
.hero-pulse-key {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.hero-pulse-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--sand);
}
.hero-pulse-chip.is-ok .hero-pulse-val { color: var(--secondary); }

/* ── Section header pattern (used by all bands) ───────── */

.band-header {
  margin-bottom: var(--sp-24);
  max-width: 720px;
}
.band-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  margin-bottom: var(--sp-8);
}
.band-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--primary);
  margin-bottom: var(--sp-8);
}
.band-sub {
  font-size: 0.95rem;
  color: var(--neutral);
  line-height: 1.6;
}
.band-sub a {
  color: var(--accent);
  font-weight: 600;
}

/* ── Actions band — 4 icon-led cards ──────────────────── */

.actions-band {
  margin-bottom: var(--sp-48);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-16);
  margin-bottom: var(--sp-24);
}

.act-card {
  display: flex;
  gap: var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-20, var(--sp-16)) var(--sp-20, var(--sp-16));
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.12s ease;
  min-height: 180px;
}
.act-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift, var(--shadow-card));
  border-color: var(--ink);
  text-decoration: none;
}
.act-card.act-primary {
  background:
    radial-gradient(circle at top right, var(--glow-teal) 0%, var(--white) 65%);
}

.act-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  align-self: flex-start;
  filter: drop-shadow(0 2px 4px rgba(38, 38, 94, 0.08));
}

.act-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex-grow: 1;
}
.act-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
  color: var(--primary);
  margin-bottom: 2px;
}
.act-blurb {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
  flex-grow: 1;
}
.act-blurb code,
.act-blurb em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.88em;
  padding: 1px 5px;
  background: var(--sand);
  border-radius: 3px;
  color: var(--primary);
}
.act-cli {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--neutral);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px dashed var(--surface);
}
.act-cli code {
  color: var(--secondary-deep);
  font-weight: 600;
}

/* ── Engineering ops chip strip ───────────────────────── */

.ops-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
}
.ops-strip-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.ops-strip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.12s ease;
}
.ops-strip-link:hover {
  background: var(--sand);
  text-decoration: none;
}
.ops-strip-link img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Packs band ───────────────────────────────────────── */

.packs-band {
  margin-bottom: var(--sp-48);
}

/* ── Credit footer ────────────────────────────────────── */

.credit-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-24);
  padding: var(--sp-24) var(--sp-32);
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  margin-bottom: var(--sp-32);
}
.credit-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.credit-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.credit-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.2px;
}

/* ── Collections band (landing page) ───────────────────── */

.collections {
  margin-bottom: var(--sp-32);
}

.collections-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: var(--sp-16);
  letter-spacing: -0.3px;
}

.collection-group {
  margin-bottom: var(--sp-24);
}

.collection-group-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
  margin-bottom: var(--sp-12);
}

/* ── Context tiles (14 BCs) ───────────────────────────── */

.context-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-8);
}

.context-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-12) var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-left: 3px solid var(--neutral);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.context-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}
.context-tile.classification-core       { border-left-color: var(--secondary); }
.context-tile.classification-supporting { border-left-color: var(--accent); }
.context-tile.classification-generic    { border-left-color: var(--neutral); }

.ctx-class {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.context-tile.classification-supporting .ctx-class { color: var(--accent); }
.context-tile.classification-generic    .ctx-class { color: var(--neutral); }

.ctx-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.ctx-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--neutral);
}

/* ── Themed cross-cutting tiles ────────────────────────── */

.themed-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-12);
}

.themed-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-16) var(--sp-24);
  background: var(--white);
  border: 1px solid var(--surface);
  border-top: 3px solid var(--neutral);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 140px;
}
.themed-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}
.themed-tile.accent-accent    { border-top-color: var(--accent); }
.themed-tile.accent-secondary { border-top-color: var(--secondary); }
.themed-tile.accent-warning   { border-top-color: var(--warning); }
.themed-tile.accent-primary   { border-top-color: var(--primary); }

.themed-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.themed-tile-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
}

.themed-tile-count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  line-height: 1;
}

.themed-tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.themed-tile-desc {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.5;
}

/* ── Corpus banner ─────────────────────────────────────── */

.corpus {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-24);
  padding: var(--sp-12) var(--sp-16);
  margin-bottom: var(--sp-16);
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
  border-bottom: 1px solid var(--teal-line-20);
}
.corpus-item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--neutral);
  text-transform: uppercase;
}
.corpus-item b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.2px;
  margin-right: 6px;
  text-transform: none;
}
.corpus-total {
  margin-left: auto;
}
.corpus-total b {
  color: var(--secondary-deep);
}

/* ── Filter bar ─────────────────────────────────────────── */

.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: var(--sp-12);
  padding: var(--sp-16);
  margin-bottom: var(--sp-24);
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
}

.filter-bar input,
.filter-bar select {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: var(--sp-8) var(--sp-12);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--glow-teal);
}

.filter-bar .count {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
  padding: 0 var(--sp-12);
  white-space: nowrap;
}

/* ── Asset grid ─────────────────────────────────────────── */

/* Library tiles — image-first, metadata only on hover.
   The SVG IS the card; the chrome is just a rest state for the eye. */

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-12);
  align-items: start;
}

.asset-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.12s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift, var(--shadow-card));
  border-color: var(--ink);
  text-decoration: none;
}

/* Preview is the entire visible surface in rest state. */
.asset-card .preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16);
  background: var(--sand);
  /* No drafting grid here — the cards that need it bake it inside their
     own SVG. A grid here would double up. */
  overflow: hidden;
}

.asset-card .preview img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}

.asset-card .preview-architectural img { max-height: 220px; }

/* Chrome — slides in from edges on hover. The header pill carries
   family + profile on the top-left; the body strip carries slug +
   context + Copy on the bottom. */
.asset-card .header,
.asset-card .body {
  position: absolute;
  left: 0;
  right: 0;
  padding: var(--sp-8) var(--sp-12);
  background: rgba(15, 23, 42, 0.94);   /* ink with alpha */
  color: var(--sand);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
}
.asset-card .header { top: 0; }
.asset-card .body  {
  bottom: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--sp-8) var(--sp-12) var(--sp-12);
}

.asset-card:hover .header,
.asset-card:focus-within .header,
.asset-card:hover .body,
.asset-card:focus-within .body {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.asset-card .header .family {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
}
.asset-card .header .profile {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(244, 244, 239, 0.6);
}
.asset-card .header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
}

.asset-card .body .name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sand);
  word-break: break-word;
  letter-spacing: 0.2px;
}
.asset-card .body .meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: rgba(244, 244, 239, 0.55);
  text-transform: uppercase;
}

.card-copy {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  background: var(--teal-line-20);
  color: var(--secondary-deep);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.card-copy:hover {
  background: var(--secondary);
  color: var(--primary);
}
.card-copy:active {
  transform: translateY(1px);
}
.card-copy.copied {
  background: var(--secondary-deep);
  color: var(--sand);
}

.btn-ghost {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: var(--sp-8) var(--sp-16);
  background: transparent;
  color: var(--neutral);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.grid-hint {
  font-size: 0.82rem;
  color: var(--neutral);
  margin: 0 0 var(--sp-16);
  padding: var(--sp-8) var(--sp-12);
  background: var(--glow-teal);
  border-left: 3px solid var(--secondary);
  border-radius: 4px;
  line-height: 1.5;
}
.grid-hint strong {
  color: var(--primary);
  font-weight: 700;
}

/* Keyboard-shortcut chips — used in the grid hint and inline on
   selection-bar buttons. */
kbd, .kbd-hint {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--surface);
  border-bottom-width: 2px;
  border-radius: 4px;
  line-height: 1.4;
  margin: 0 2px;
}
.selection-bar .kbd-hint {
  background: rgba(244, 244, 239, 0.15);
  color: var(--sand);
  border-color: rgba(244, 244, 239, 0.2);
  margin-left: var(--sp-4);
}
.btn-ghost:hover {
  background: var(--sand);
  color: var(--primary);
  border-color: var(--primary);
}

/* Semantic tag pills (variant, kind, role, …) */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.tag.emit    { background: var(--glow-teal);   color: var(--secondary-deep); }
.tag.consume { background: var(--glow-accent); color: var(--accent); }
.tag.role    { background: var(--glow-accent); color: var(--accent); }

/* Deep-link pill on the element sidebar — subtly teal under hover to
   signal it's navigable. */
.tag-link {
  text-decoration: none;
  border-bottom: 1px dashed var(--surface);
  transition: color 0.12s ease, border-color 0.12s ease;
}
.tag-link:hover {
  text-decoration: none;
  color: var(--primary);
  border-bottom-color: var(--secondary);
}
.tag.tag-link:hover {
  color: var(--primary);
  background: var(--secondary);
  border-bottom-color: transparent;
}

/* ── Back-nav on element page ──────────────────────────── */

.back-nav {
  margin-bottom: var(--sp-16);
}
.back-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
}
.back-nav a:hover { color: var(--primary); text-decoration: none; }

/* Compatible kits list */
.kit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}
.kit-list li a {
  display: inline-block;
  text-transform: capitalize;
}

/* Sibling list on the element page */
.sibling-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.sibling-list li a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  word-break: break-word;
}

/* Miro AI prompt viewer */
.prompt-text {
  margin-top: var(--sp-12);
  background: var(--sand);
  padding: var(--sp-12);
  border-radius: var(--radius);
  border: 1px solid var(--surface);
  border-left: 3px solid var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Raw SVG source viewer */
.svg-source {
  background: var(--sand);
  padding: var(--sp-12);
  border-radius: var(--radius);
  border: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
}

/* ── Element detail page ────────────────────────────────── */

.element-detail {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--sp-32);
}

.element-preview {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-32);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.element-preview svg {
  max-width: 100%;
  height: auto;
}

.element-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

.element-sidebar .pane {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
  padding: var(--sp-24);
}

.element-sidebar .pane h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: var(--sp-12);
}

.element-sidebar dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-8) var(--sp-16);
  font-size: 0.88rem;
}

.element-sidebar dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
  align-self: center;
}

.element-sidebar dd {
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}

/* ── Primary button (copy SVG) ─────────────────────────── */

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: var(--sp-12) var(--sp-16);
  background: var(--primary);
  color: var(--sand);
  border: none;
  border-radius: var(--radius);
  transition: background 0.12s ease, transform 0.08s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
}

.btn:hover { background: var(--primary-80); }
.btn:active { transform: translateY(1px); }

.btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.secondary:hover { background: var(--glow-teal); }

.btn.copied {
  background: var(--secondary-deep);
}

/* ── Toast ─────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: var(--sp-32);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: var(--sand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--radius);
  border-bottom: 1px solid var(--teal-line-20);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Empty state ───────────────────────────────────────── */

.empty {
  padding: var(--sp-64);
  text-align: center;
  color: var(--neutral);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Callouts (blueprint.css:1004-1039) ───────────────── */

.callout-insight,
.callout-risk,
.callout-decision {
  padding: var(--sp-16) var(--sp-24);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.callout-insight  { border-left: 3px solid var(--secondary); background: rgba(63, 199, 160, 0.04); }
.callout-risk     { border-left: 3px solid var(--danger);    background: rgba(198, 40, 40, 0.03); }
.callout-decision { border-left: 3px solid var(--accent);    background: rgba(54, 115, 176, 0.03); }

/* ── Forge — interactive ad-hoc card maker ─────────────── */

.forge-intro {
  margin-bottom: var(--sp-32);
}

.forge-intro-blurb {
  max-width: 70ch;
  font-size: 0.95rem;
  color: var(--neutral);
  line-height: 1.55;
}

.forge-intro-blurb code {
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.forge-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-32);
  align-items: start;
}

.forge-form-pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

.forge-form-pane .pane h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: var(--sp-8);
}

.pane-blurb {
  font-size: 0.88rem;
  color: var(--neutral);
  margin-bottom: var(--sp-24);
  line-height: 1.5;
}

.forge-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

.forge-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forge-field-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
}

.forge-field-optional {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--neutral);
  text-transform: none;
}

.forge-field input[type="text"],
.forge-field input[type="number"],
.forge-field select,
.forge-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--primary);
}

.forge-field input:focus,
.forge-field select:focus,
.forge-field textarea:focus {
  outline: 2px solid var(--secondary);
  outline-offset: -1px;
  border-color: var(--secondary);
}

.forge-field textarea {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.4;
  resize: vertical;
}

.forge-field-help {
  font-size: 0.78rem;
  color: var(--neutral);
  font-style: italic;
}

.forge-actions {
  display: flex;
  gap: var(--sp-8);
  align-items: center;
}

.forge-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
  margin-left: auto;
}

.forge-preview-pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  position: sticky;
  top: var(--sp-16);
}

.forge-preview {
  background: var(--white);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-24);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.forge-preview svg {
  max-width: 100%;
  height: auto;
}

.forge-preview-empty {
  font-size: 0.88rem;
  color: var(--neutral);
  text-align: center;
}

.forge-error {
  background: rgba(198, 40, 40, 0.06);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  padding: var(--sp-12) var(--sp-16);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: var(--sp-12);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1080px) {
  .forge-detail {
    grid-template-columns: 1fr;
  }
  .forge-preview-pane {
    position: static;
  }
}

/* ── Footer ────────────────────────────────────────────── */

.footer {
  margin-top: var(--sp-64);
  padding-top: var(--sp-16);
  border-top: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════
   LANDING PORTAL — narrative entry into Catalyst 2.0.

   Design intent: NeXT-era restraint. Type as content, generous
   whitespace, the drafting-paper grid as the only ambient texture, no
   gradient flourishes. Section structure mirrors a quiet exhibit
   gallery — kicker label, big display headline, terse subline, then
   the actual artefacts (initiative hero cards, BC chips, thread tiles).

   Every colour cites a brand token (visual-system.md §Palette).
   ══════════════════════════════════════════════════════════════════════ */

/* The opening — "what story are you telling?" */

.landing-prompt {
  padding: var(--sp-128) 0 var(--sp-96);
  border-bottom: 1px solid var(--surface);
}
.landing-prompt-inner {
  max-width: 760px;
}
.landing-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--neutral);
  margin-bottom: var(--sp-32);
}
.landing-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -1.6px;
  color: var(--primary);
  margin: 0 0 var(--sp-32);
}
.landing-sub {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink);
  max-width: 620px;
  margin: 0;
}

/* Section frame — repeats for transformation / domain / cross-cutting */

.landing-section {
  padding: var(--sp-96) 0;
  border-bottom: 1px solid var(--surface);
}
.landing-section:last-of-type {
  border-bottom: none;
}
.landing-section-head {
  max-width: 760px;
  margin-bottom: var(--sp-64);
}
.landing-section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  margin-bottom: var(--sp-16);
}
.landing-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--primary);
  margin: 0 0 var(--sp-16);
  /* Short teal laser line under the section title — Blueprint signature.
     Renders via ::after rather than border so it stays a measured
     2px × 56px rule, not the full text width. */
  position: relative;
}
.landing-section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--secondary);
  margin-top: var(--sp-16);
  border-radius: 1px;
}
.landing-section-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  margin: var(--sp-16) 0 0;
  max-width: 640px;
}

/* ── The Transformation — initiative tiles ──────────────────────────── */

.initiative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-24);
}
.initiative-tile {
  display: flex;
  flex-direction: column;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.initiative-tile:hover {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 12px 32px -16px rgba(38, 38, 94, 0.18);
}
.initiative-thumb {
  background: var(--surface);
  padding: var(--sp-24);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 520 / 260;
  /* Drafting-paper backdrop on the thumbnail well — echoes the grid
     pattern from the SVG card itself. */
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.initiative-thumb img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.initiative-meta {
  padding: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  flex: 1;
}
.initiative-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.initiative-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--primary);
  line-height: 1.1;
}
.initiative-tagline {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  margin: var(--sp-4) 0 0;
  flex: 1;
}
.initiative-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-12);
  margin-top: var(--sp-8);
  border-top: 1px solid var(--surface);
}
.initiative-cta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.initiative-tile:hover .initiative-cta::after {
  content: "  →";
}
.initiative-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neutral);
}

/* ── The Domain — bounded-context chips ─────────────────────────────── */

.bc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-12);
}
.bc-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px var(--sp-12);
  align-items: baseline;
  padding: var(--sp-16) var(--sp-24);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-left: 4px solid var(--neutral);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-left-color 0.18s ease, transform 0.18s ease;
}
.bc-chip:hover {
  transform: translateX(2px);
}
.bc-classification {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.bc-name {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--primary);
}
.bc-count {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral);
}

/* Classification colour rules — load-bearing semantic, like the v2
   A3 context badge stripe. */
.bc-core       { border-left-color: var(--secondary); }
.bc-core       .bc-classification { color: var(--secondary-deep); }
.bc-supporting { border-left-color: var(--accent); }
.bc-supporting .bc-classification { color: var(--accent); }
.bc-generic    { border-left-color: var(--neutral); }
.bc-generic    .bc-classification { color: var(--neutral); }

/* ── Cross-cutting threads ──────────────────────────────────────────── */

.thread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-16);
}
.thread-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-32) var(--sp-32) var(--sp-24);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.thread-tile:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
}
.thread-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.thread-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary);
}
.thread-tagline {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  margin: var(--sp-4) 0 0;
  flex: 1;
}
.thread-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-12);
  margin-top: var(--sp-8);
  border-top: 1px solid var(--surface);
}
.thread-stat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neutral);
}
.thread-cta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}

/* ── Tools — the means, not the headline ────────────────────────────── */

.landing-tools {
  padding: var(--sp-96) 0 var(--sp-128);
}
.landing-tools-head {
  margin-bottom: var(--sp-32);
}
.landing-tools-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-12);
}
.tool-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-16) var(--sp-24);
  background: transparent;
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tool-link:hover {
  border-color: var(--secondary);
  background: var(--sand);
}
.tool-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}
.tool-blurb {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neutral);
}

/* ══════════════════════════════════════════════════════════════════════
   LANDING — Catalyst 2.0 productivity canvas.

   The page is the work. Three layers stack:
     - canvas-rail  : ⌘K + corpus heartbeat (~48 px)
     - canvas-stage : initiative deck + BC strip + architecture map
     - canvas-foot  : keyboard hints

   Plus a full-screen `.palette` overlay for the ⌘K command palette.

   Design discipline: brand tokens only (visual-system.md), v2 voice
   throughout, no marketing chrome. Type-driven hierarchy. The actual
   v2 hero cards carry the visual weight — the chrome stays out of
   the way.
   ══════════════════════════════════════════════════════════════════════ */

.canvas-rail {
  display: flex;
  align-items: stretch;
  gap: var(--sp-16);
  margin: var(--sp-32) 0 var(--sp-24);
  padding: 0;
}
.canvas-rail-id {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--sp-16);
  min-width: 240px;
  border-left: 2px solid var(--secondary);
}
.rail-mark {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--primary);
}
.rail-mark-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--neutral);
  margin-top: 2px;
}
.canvas-rail-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: 0 var(--sp-24);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.canvas-rail-search:hover,
.canvas-rail-search:focus-visible {
  border-color: var(--secondary);
  background: var(--surface);
  outline: none;
}
.palette-trigger-icon {
  font-size: 1.2rem;
  color: var(--secondary-deep);
  font-weight: 700;
}
.palette-trigger-hint {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.palette-trigger-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--primary);
  font-weight: 600;
}
.palette-trigger-key {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--primary);
  color: var(--sand);
  padding: 6px 10px;
  border-radius: 4px;
}

/* ── Canvas stage — three blocks, top to bottom ─────────────────────── */

.canvas-stage {
  display: flex;
  flex-direction: column;
  gap: var(--sp-48);
  padding-top: var(--sp-16);
}
.canvas-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}
.canvas-block-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--surface);
}
.canvas-block-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.canvas-block-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 1.4px;
  color: var(--neutral);
}

/* ── Initiative deck ────────────────────────────────────────────────── */

.initiative-deck {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-16);
}
@media (max-width: 1240px) {
  .initiative-deck { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 940px) {
  .initiative-deck { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .initiative-deck { grid-template-columns: repeat(2, 1fr); }
}

.ini-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.ini-cell:hover,
.ini-cell:focus-visible {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 16px 36px -22px rgba(38, 38, 94, 0.32);
  outline: none;
}
.ini-cell-glyph {
  background: var(--surface);
  /* Drafting paper backdrop on the thumbnail well */
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  aspect-ratio: 520 / 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12);
}
.ini-cell-glyph img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.ini-cell-meta {
  position: relative;
  padding: var(--sp-12) var(--sp-16) var(--sp-16);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ini-cell-key {
  position: absolute;
  top: var(--sp-8);
  right: var(--sp-12);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neutral);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0;
}
.ini-cell-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary);
  line-height: 1.1;
}
.ini-cell-tag {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin-top: var(--sp-4);
  /* Truncate to 2 lines so cells stay regular height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── BC strip ───────────────────────────────────────────────────────── */

.bc-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}
.bc-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  padding: 6px var(--sp-12) 6px var(--sp-8);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-left-width: 3px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bc-pill:hover {
  transform: translateY(-1px);
  border-color: var(--neutral);
}
.bc-pill-cls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--primary);
}
.bc-pill-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--primary);
}
.bc-pill-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--neutral);
}
/* classification-coloured edge — load-bearing semantic */
.bc-pill.bc-core       { border-left-color: var(--secondary); }
.bc-pill.bc-core       .bc-pill-cls { background: var(--secondary); color: var(--sand); }
.bc-pill.bc-supporting { border-left-color: var(--accent); }
.bc-pill.bc-supporting .bc-pill-cls { background: var(--accent); color: var(--sand); }
.bc-pill.bc-generic    { border-left-color: var(--neutral); }
.bc-pill.bc-generic    .bc-pill-cls { background: var(--neutral); color: var(--sand); }

/* ── Architecture map block ─────────────────────────────────────────── */

.arch-map {
  display: block;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-16);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.arch-map:hover {
  border-color: var(--secondary);
}
.arch-map img {
  width: 100%;
  height: auto;
  display: block;
}
.canvas-block-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-8);
  margin-top: var(--sp-4);
}
.thread-quick {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-12) var(--sp-16);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.thread-quick:hover { border-color: var(--secondary); }
.thread-quick-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--secondary-deep);
}
.thread-quick-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}

/* ── Bottom keyboard-hint strip ─────────────────────────────────────── */

.canvas-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-24);
  align-items: center;
  margin-top: var(--sp-48);
  padding: var(--sp-16) 0;
  border-top: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--neutral);
}
.canvas-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--primary);
  font-weight: 700;
  margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   ⌘K command palette overlay
   ══════════════════════════════════════════════════════════════════════ */

.palette {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.palette[hidden] { display: none; }
body.palette-open { overflow: hidden; }

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.palette-window {
  position: relative;
  width: min(720px, 92vw);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px -32px rgba(15, 23, 42, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.palette-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-24);
  border-bottom: 1px solid var(--surface);
}
.palette-glyph {
  font-size: 1.3rem;
  color: var(--secondary-deep);
  font-weight: 700;
}
.palette-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.2px;
  outline: none;
}
.palette-input::placeholder {
  color: var(--neutral);
  font-weight: 500;
  font-size: 0.95rem;
}
.palette-bar-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--primary);
}
.palette-scope {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-8) var(--sp-24);
  border-bottom: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.4px;
  color: var(--neutral);
  min-height: 28px;
}
.palette-scope-count {
  color: var(--secondary-deep);
  font-weight: 700;
}
.palette-scope-hint {
  font-weight: 500;
}
.palette-scope-ok  { color: var(--secondary-deep); font-weight: 700; }
.palette-scope-err { color: var(--danger);         font-weight: 700; }

.palette-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 52vh;
  overflow-y: auto;
}
.palette-hit {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px var(--sp-16);
  padding: var(--sp-12) var(--sp-24);
  cursor: pointer;
  border-bottom: 1px solid var(--surface);
  transition: background 0.1s ease;
}
.palette-hit:last-child { border-bottom: none; }
.palette-hit.is-active {
  background: var(--surface);
}
.palette-hit-slug {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--primary);
}
.palette-hit-meta {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--secondary-deep);
}
.palette-hit-id {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--neutral);
  letter-spacing: 0.4px;
}
.palette-foot {
  display: flex;
  gap: var(--sp-16);
  padding: var(--sp-8) var(--sp-24);
  border-top: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--neutral);
}
.palette-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: 2px;
  padding: 0 5px;
  color: var(--primary);
  font-weight: 700;
  margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   ELEMENT PAGE — the artefact dominates.

   No sidebar of stacked panes. No box-in-box-in-box. The SVG fills the
   canvas; metadata is a thin mono strip; prompt / kits / siblings /
   source are collapsible peripheral strips. Same design discipline
   applies across the app: one hero, one primary action, optional
   context band — never a museum of framed exhibits.
   ══════════════════════════════════════════════════════════════════════ */

.element-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
  padding-top: var(--sp-16);
}

.element-actionbar {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-12) 0;
  border-bottom: 1px solid var(--surface);
  flex-wrap: wrap;
}
.element-back {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neutral);
  text-decoration: none;
  padding: 4px 0;
}
.element-back:hover { color: var(--secondary-deep); }
.element-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--primary);
  margin: 0;
  /* Long slugs get truncated rather than wrapping the action bar */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.element-actions {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}
.element-actions .btn kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(244, 244, 239, 0.18);
  border: 1px solid rgba(244, 244, 239, 0.35);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  font-weight: 700;
}
.element-actions .btn.secondary kbd {
  background: var(--surface);
  border-color: var(--neutral);
  color: var(--primary);
}

/* The SVG canvas — no frame, no card. Drafting-paper grid behind it
   (inherited from body), the SVG floats centered at scale. */
.element-canvas {
  /* Inline JS sets `aspect-ratio` from the SVG's own w/h attributes.
     We size the wrapper here so it fits both viewport-width AND
     viewport-height; the SVG fills 100%/100% inside. Net effect: a
     240×240 stamp gets blown up to ~675×675; a 1280×880 architecture
     map scales down to ~980×675. The artefact dominates either way. */
  width: min(78vw, 1200px);
  max-height: 75vh;
  margin: var(--sp-24) auto var(--sp-16);
  display: grid;
  place-items: center;
  /* Soft drop shadow gives the SVG presence on the drafting grid
     without wrapping it in a chrome card. */
  filter: drop-shadow(0 16px 40px rgba(38, 38, 94, 0.16));
}
.element-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Metadata — single mono strip, key:value pairs separated by middle dots */
.element-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8) var(--sp-24);
  padding: var(--sp-12) 0;
  border-top: 1px solid var(--surface);
  border-bottom: 1px solid var(--surface);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.6px;
}
.element-meta-pair {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-8);
}
.element-meta-key {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--neutral);
}
.element-meta-val {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
a.element-meta-val:hover {
  color: var(--secondary-deep);
  text-decoration: underline;
  text-decoration-color: var(--secondary);
  text-underline-offset: 3px;
}
/* Inline tag badges (variant, kind, role) — already styled by .tag rules
   in the older library section; let them inherit those colours but tighten
   spacing for inline-strip use. */
.element-meta-val.tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  text-transform: lowercase;
  font-weight: 700;
}

/* Peripheral strips — prompt, kits, siblings, source. No card chrome:
   a kicker line + content. Use <details> for expand/collapse on the
   ones that don't need to be open by default. */
.element-strip {
  padding: var(--sp-12) 0;
  border-bottom: 1px solid var(--surface);
}
.element-strip:last-of-type { border-bottom: none; }

.element-strip > summary,
.element-strip-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-12);
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
  margin-bottom: var(--sp-8);
}
.element-strip > summary::-webkit-details-marker { display: none; }
.element-strip > summary::before {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--neutral);
  margin-right: -4px;
  transition: transform 0.15s ease;
}
.element-strip[open] > summary::before { transform: rotate(90deg); }

.element-strip-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.element-strip-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 1.4px;
  color: var(--neutral);
}
.element-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8) var(--sp-16);
  padding-top: var(--sp-8);
}
.element-siblings-row {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.sibling-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.sibling-link:hover {
  color: var(--secondary-deep);
  text-decoration: underline;
  text-decoration-color: var(--secondary);
  text-underline-offset: 3px;
}

.kit-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 6px var(--sp-12);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: 999px;
  color: var(--primary);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.kit-pill:hover {
  border-color: var(--secondary);
  color: var(--secondary-deep);
}

.prompt-text {
  margin: var(--sp-12) 0 0;
  padding: var(--sp-16) var(--sp-24);
  background: var(--surface);
  border-left: 3px solid var(--secondary);
  border-radius: 0 4px 4px 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.svg-source {
  margin: var(--sp-12) 0 0;
  padding: var(--sp-16) var(--sp-24);
  background: var(--ink);
  color: var(--sand);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.element-source-strip {
  margin-top: var(--sp-24);
}

/* ── Thumbnail rail — used on element page for related cards ────────── */

.thumb-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--sp-12);
  padding-top: var(--sp-12);
}
.thumb-rail-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform 0.15s ease;
}
.thumb-rail-item:hover {
  transform: translateY(-2px);
}
.thumb-rail-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  padding: var(--sp-8);
  /* Tiny drafting paper backdrop on each frame so the SVG sits on the
     same canvas language as everywhere else in the app. */
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  transition: border-color 0.15s ease;
  overflow: hidden;
}
.thumb-rail-item:hover .thumb-rail-frame {
  border-color: var(--secondary);
}
.thumb-rail-frame img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  /* SVG `width=` attributes can fight the parent — let max-width win.
     Setting both width:auto and height:auto makes max-* the binding
     constraint while preserving aspect via the SVG's own viewBox. */
  width: auto;
  height: auto;
  /* Force-override inline width/height attributes baked into rendered
     SVGs so thumbnails actually fit their frame (without this, a 1280-wide
     architecture map renders 1280 wide inside a 168 px frame and gets
     truncated rather than shrunk). */
  max-inline-size: 100%;
  max-block-size: 100%;
}
.thumb-rail-name {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--primary);
  text-align: left;
  /* Truncate long slugs to one line; full slug visible in title= tooltip */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive: tighter thumbnails on narrow viewports */
@media (max-width: 700px) {
  .thumb-rail { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════════
   LIBRARY — dense grid, hover-only tile metadata.

   No page title (URL says it). No lede. The filter row is the visual
   top; the corpus chips compress to one mono line; tiles are just the
   SVG with hover overlay carrying the metadata. Same design discipline
   as the element page: artefact dominates, chrome is a thin frame, no
   nested boxes.
   ══════════════════════════════════════════════════════════════════════ */

.lib-rail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin: var(--sp-12) 0 var(--sp-24);
}

.lib-filter {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  flex-wrap: wrap;
}
.lib-filter input[type="search"] {
  flex: 1;
  min-width: 240px;
  padding: 8px var(--sp-12);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
}
.lib-filter input[type="search"]:focus {
  outline: none;
  border-color: var(--secondary);
}
.lib-filter select {
  padding: 7px var(--sp-12);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
}
.lib-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral);
  margin-left: auto;
}

.lib-corpus {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.6px;
  color: var(--neutral);
}
.lib-corpus-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 0;
}
.lib-corpus-chip b {
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-mono);
}
.lib-corpus-chip + .lib-corpus-chip::before {
  content: "·";
  margin-right: 4px;
  color: var(--surface);
}

.lib-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 1.2px;
  color: var(--neutral);
  margin: 0;
}
.lib-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: 3px;
  padding: 0 5px;
  color: var(--primary);
  font-weight: 700;
}

/* ── The grid — dense, no per-tile chrome ─────────────────────────── */

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-flow: dense;
  gap: var(--sp-12);
  margin-bottom: var(--sp-128);
}
.lib-tile {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.12s ease;
}
.lib-tile-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  padding: var(--sp-12);
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  transition: border-color 0.12s ease;
}
.lib-tile-frame img {
  max-width: 88%;
  max-height: 88%;
  width: auto;
  height: auto;
  display: block;
}

/* High-information tiles span 2 columns so their thumbnails can render
   at legible scale; collab tiles stay square so they read as annotations,
   not features. The SVG max-size cap (60%) keeps callouts/stamps from
   filling their tile with a solid-fill silhouette. */
.lib-tile[data-cat="truth"],
.lib-tile[data-cat="initiatives"],
.lib-tile[data-cat="infra"] {
  grid-column: span 2;
}
.lib-tile[data-cat="collab"] .lib-tile-frame img {
  max-width: 60%;
  max-height: 60%;
}
@media (max-width: 700px) {
  .lib-tile[data-cat="truth"],
  .lib-tile[data-cat="initiatives"],
  .lib-tile[data-cat="infra"] {
    grid-column: span 1;
  }
}
.lib-tile:hover .lib-tile-frame {
  border-color: var(--secondary);
}
.lib-tile.is-selected .lib-tile-frame {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--secondary);
}

/* Hover overlay — the metadata only appears on hover/focus, so the
   grid itself stays clean and the tile's actual SVG carries the
   identity. */
.lib-tile-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--sp-12) var(--sp-12) var(--sp-8);
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(15, 23, 42, 0.78) 60%,
    rgba(15, 23, 42, 0) 100%
  );
  color: var(--sand);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.lib-tile:hover .lib-tile-overlay,
.lib-tile:focus-visible .lib-tile-overlay {
  opacity: 1;
  pointer-events: auto;
}
.lib-tile-meta {
  display: flex;
  gap: var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--secondary);
}
.lib-tile-context { color: rgba(244, 244, 239, 0.7); }
.lib-tile-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--sand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-tile-copy {
  align-self: flex-end;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--secondary);
  color: var(--primary);
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}
.lib-tile-copy:hover {
  background: var(--secondary-deep);
  color: var(--sand);
}

/* Mid-density viewports — slightly tighter tiles */
@media (max-width: 1240px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 700px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .lib-corpus { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   ENGINEER'S ATELIER — landing-page identity.

   The design language lifted from a real architectural drafting board:
   massive cover-sheet typography, numbered drawing sheets, dimension
   callouts as section markers, coordinate-grid plats. Mono is the
   chrome voice; DM Sans is reserved for the cover title and the
   actual artefact display names. Every element earns its weight.
   ══════════════════════════════════════════════════════════════════════ */

.atelier {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
  padding-top: var(--sp-16);
}

/* ── Cover plate ──────────────────────────────────────────────────── */

.atelier-cover {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "side title"
    "side foot";
  gap: var(--sp-12) var(--sp-32);
  padding-bottom: var(--sp-32);
  border-bottom: 1px solid var(--surface);
  position: relative;
}

.atelier-cover-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-12) 0 0;
  border-right: 1px solid var(--surface);
  padding-right: var(--sp-32);
  min-width: 140px;
}
.atelier-edition {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.12);
  padding: 4px 10px;
  border-radius: 3px;
}
.atelier-edition-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--neutral);
  margin-top: var(--sp-4);
}

/* The typographic statement — gigantic CATALYST + tracked-back / 2.0 */
.atelier-title {
  grid-area: title;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 11rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -5px;
  color: var(--primary);
  display: flex;
  align-items: baseline;
  gap: var(--sp-24);
  flex-wrap: wrap;
}
.atelier-title-word {
  /* Full-bleed display weight; the page gets its identity here. */
}
.atelier-title-mark {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.12);
  padding: 6px 14px;
  border-radius: 4px;
  align-self: center;
}

.atelier-cover-foot {
  grid-area: foot;
  display: flex;
  gap: var(--sp-32);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 1.6px;
  color: var(--neutral);
  padding-top: var(--sp-12);
}
.atelier-cover-stat {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-8);
}
.atelier-cover-stat b {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--primary);
}

/* ── Dimension callout — section divider ─────────────────────────── */

.dim-line {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  margin: var(--sp-16) 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.dim-tick {
  color: var(--primary);
  font-size: 1.1rem;
  line-height: 1;
}
.dim-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(38, 38, 94, 0.2) 8%,
    rgba(38, 38, 94, 0.2) 92%,
    transparent
  );
}
.dim-label {
  white-space: nowrap;
}

/* ── Sheet directory — the 10 initiatives as drawing plates ──────── */

.atelier-sheets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-16);
}
@media (max-width: 1240px) {
  .atelier-sheets { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 940px) {
  .atelier-sheets { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .atelier-sheets { grid-template-columns: repeat(2, 1fr); }
}

.atelier-sheet {
  display: flex;
  flex-direction: column;
  background: var(--sand);
  border: 1px solid var(--primary);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.atelier-sheet:hover {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 18px 36px -22px rgba(38, 38, 94, 0.34);
}
/* Crosshair register marks at the four corners of every sheet */
.atelier-sheet::before,
.atelier-sheet::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(38, 38, 94, 0.5);
  pointer-events: none;
  z-index: 2;
}
.atelier-sheet::before {
  top: 4px;
  left: 4px;
  border-right: none;
  border-bottom: none;
}
.atelier-sheet::after {
  bottom: 4px;
  right: 4px;
  border-left: none;
  border-top: none;
}

.atelier-sheet-meta-top {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-8) var(--sp-12);
  background: var(--primary);
  color: var(--sand);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.8px;
}
.atelier-sheet-no {
  color: var(--secondary);
}
.atelier-sheet-rev {
  color: rgba(244, 244, 239, 0.6);
}

.atelier-sheet-plate {
  background: var(--surface);
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  aspect-ratio: 520 / 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12);
  border-bottom: 1px solid var(--primary);
}
.atelier-sheet-plate img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.atelier-sheet-titleblock {
  padding: var(--sp-12) var(--sp-16) var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex: 1;
}
.atelier-sheet-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--primary);
  line-height: 1.05;
}
.atelier-sheet-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 2px 0 0;
  flex: 1;
  /* Clamp to two lines so sheets are uniform height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.atelier-sheet-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-8);
  margin-top: var(--sp-4);
  border-top: 1px dashed rgba(38, 38, 94, 0.18);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.atelier-sheet-foot-l {
  color: var(--secondary-deep);
}
.atelier-sheet-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: var(--primary);
  color: var(--sand);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
}

/* ── Domain plat — 14 BC lots on a coordinate grid ───────────────── */

.atelier-plat {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-8);
}
@media (max-width: 940px) {
  .atelier-plat { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .atelier-plat { grid-template-columns: repeat(2, 1fr); }
}

.atelier-lot {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: var(--sp-8) var(--sp-12);
  padding: var(--sp-12) var(--sp-16);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-left: 4px solid var(--neutral);
  border-radius: 3px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.atelier-lot:hover {
  transform: translateX(2px);
}
.atelier-lot-coord {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--neutral);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 2px;
}
.atelier-lot-class {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: var(--neutral);
  color: var(--sand);
}
.atelier-lot-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--primary);
}
.atelier-lot-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--neutral);
}

.atelier-lot-core       { border-left-color: var(--secondary); }
.atelier-lot-core       .atelier-lot-class { background: var(--secondary); color: var(--primary); }
.atelier-lot-supporting { border-left-color: var(--accent); }
.atelier-lot-supporting .atelier-lot-class { background: var(--accent); color: var(--sand); }
.atelier-lot-generic    { border-left-color: var(--neutral); }

/* ── Substrate plat — cross-cutting threads ───────────────────────── */

.atelier-substrate {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-12);
}
@media (max-width: 800px) {
  .atelier-substrate { grid-template-columns: 1fr; }
}

.atelier-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-16) var(--sp-24);
  background: var(--sand);
  border: 1px solid var(--primary);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.atelier-thread:hover {
  border-color: var(--secondary);
  box-shadow: 0 12px 28px -16px rgba(38, 38, 94, 0.24);
}
.atelier-thread-no {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--secondary-deep);
}
.atelier-thread-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary);
  margin-top: 2px;
}
.atelier-thread-desc {
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink);
  margin: var(--sp-4) 0 0;
}

/* ── Atelier footer — keyboard hint strip ─────────────────────────── */

.atelier-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-24);
  align-items: center;
  margin: var(--sp-32) 0;
  padding: var(--sp-12) 0;
  border-top: 1px dashed rgba(38, 38, 94, 0.2);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--neutral);
}
.atelier-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: 2px;
  padding: 0 5px;
  color: var(--primary);
  font-weight: 700;
  margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   LANDING (refined) — drop the drawing-sheet theatre, keep the identity.

   The big CATALYST cover stays. Every initiative is a verb: click → draw
   cards for that transformation. Section heads are a kicker + a single
   action sentence — no SHT / REV / PLAT scaffolding. The drafting grid,
   indigo masthead, and registration marks supply Catalyst character;
   the content supplies the work.
   ══════════════════════════════════════════════════════════════════════ */

/* Override the older cover/sheets/lots block while keeping the .atelier
   wrapper layout (column flex with generous gap). */
.atelier {
  display: flex;
  flex-direction: column;
  gap: var(--sp-48);
  padding-top: 0;
}

/* ── Cover plate ──────────────────────────────────────────────────── */

.atelier-cover {
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  padding-bottom: var(--sp-24);
  border-bottom: 1px solid var(--surface);
}
.atelier-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -4px;
  color: var(--primary);
  display: flex;
  align-items: baseline;
  gap: var(--sp-16);
  flex-wrap: wrap;
}
.atelier-title-mark {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.12);
  padding: 5px 12px;
  border-radius: 4px;
  align-self: center;
}
.atelier-cover-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  max-width: 640px;
}

/* ── Section head — kicker + action sentence ──────────────────────── */

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-16) 0 var(--sp-12);
  border-bottom: 1px solid var(--surface);
  margin-bottom: var(--sp-16);
}
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.section-sub {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  max-width: 720px;
}

/* ── Initiative cards — verb-led, name dominant ───────────────────── */

.initiative-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-16);
}
@media (max-width: 1240px) { .initiative-cards { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 940px)  { .initiative-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .initiative-cards { grid-template-columns: repeat(2, 1fr); } }

.initiative-card {
  display: flex;
  flex-direction: column;
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.initiative-card:hover,
.initiative-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 18px 36px -22px rgba(38, 38, 94, 0.30);
  outline: none;
}
.initiative-card-plate {
  background: var(--surface);
  background-image:
    linear-gradient(rgba(38, 38, 94, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 38, 94, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  aspect-ratio: 520 / 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12);
}
.initiative-card-plate img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.initiative-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-16);
  flex: 1;
}
.initiative-card-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
  line-height: 1.05;
}
.initiative-card-desc {
  /* Hidden — the user wants the initiative name only, no tagline. */
  display: none;
}
.initiative-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: var(--sp-8);
  margin-top: var(--sp-8);
  border-top: 1px solid var(--surface);
}
.initiative-card-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neutral);
}
.initiative-card-cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.initiative-card:hover .initiative-card-cta { color: var(--primary); }

/* ── Bounded contexts — classification-grouped action list ─────────
   Each row says "everything from this BC, ready to draw onto a Miro
   board." Grouped by classification (CORE → SUPPORTING → GENERIC) with
   a substantial group header line. No left-edge accent strip; the
   classification colour shows up on the group header rule. */

.bc-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-32);
}
.bc-group {
  display: flex;
  flex-direction: column;
}
.bc-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-16);
  padding: var(--sp-8) 0 var(--sp-12);
  border-bottom: 2px solid var(--bc-group-colour, var(--neutral));
  margin-bottom: 0;
}
.bc-group-cls {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--bc-group-colour, var(--primary));
}
.bc-group-meta {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--neutral);
  text-align: right;
}

.bc-group-rows {
  display: flex;
  flex-direction: column;
}
.bc-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: var(--sp-24);
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--surface);
  text-decoration: none;
  color: inherit;
  transition: padding 0.15s ease, color 0.15s ease;
}
.bc-row:hover {
  padding-left: var(--sp-12);
}
.bc-row:last-child { border-bottom: none; }
.bc-row-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--primary);
  line-height: 1;
}
.bc-row:hover .bc-row-name {
  color: var(--bc-group-colour, var(--secondary-deep));
}
.bc-row-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--neutral);
  white-space: nowrap;
}
.bc-row-cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--bc-group-colour, var(--secondary-deep));
  white-space: nowrap;
}

.bc-group-core       { --bc-group-colour: var(--secondary-deep); }
.bc-group-supporting { --bc-group-colour: var(--accent); }
.bc-group-generic    { --bc-group-colour: var(--neutral); }

/* ── Cross-cutting threads — name + description, no SHT prefix ────── */

.thread-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-12);
}
@media (max-width: 800px) { .thread-cards { grid-template-columns: 1fr; } }

.thread-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: var(--sp-4) var(--sp-16);
  padding: var(--sp-16) var(--sp-24);
  background: var(--sand);
  border: 1px solid var(--surface);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.thread-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 12px 28px -16px rgba(38, 38, 94, 0.22);
}
.thread-card-name {
  grid-column: 1 / 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary);
}
.thread-card-cta {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.thread-card:hover .thread-card-cta { color: var(--primary); }
.thread-card-desc {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   LANDING — Tool hero + four paths to a Miro board.

   The front door announces the verb (BMB is a tool to draw Miros)
   before the noun (the Catalyst architecture, demoted to the catalogue
   beneath). Sand body, indigo display, short teal laser line under the
   tool name; A4-hero composition on each path tile (kicker → name →
   laser → tagline → blurb → CTA, with brand glyph in the right zone).
   ══════════════════════════════════════════════════════════════════════ */

/* ── Tool hero ─────────────────────────────────────────────── */

.tool-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-8);
}
.tool-hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.10);
  padding: 4px 10px;
  border-radius: 3px;
}
.tool-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -1.6px;
  color: var(--primary);
  margin: 0;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-16);
  flex-wrap: wrap;
}
.tool-hero-title::after {
  content: "";
  display: inline-block;
  width: 88px;
  height: 3px;
  background: var(--secondary);
  border-radius: 2px;
  align-self: center;
  margin-left: var(--sp-8);
}
.tool-hero-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 760px;
  margin: 0;
}

/* ── Paths band ───────────────────────────────────────────── */

.paths-band {
  margin: 0;
}
.paths-band-head {
  margin-bottom: var(--sp-12);
}
.paths-band-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--primary);
  padding: 5px 12px;
  background: rgba(38, 38, 94, 0.06);
  border-left: 2px solid var(--secondary);
  border-radius: 0 3px 3px 0;
}
.paths-band-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--neutral);
  margin-top: var(--sp-8);
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-24);
}
@media (max-width: 880px) {
  .paths-grid { grid-template-columns: 1fr; }
}

.path-tile {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: var(--sp-24);
  padding: var(--sp-32) var(--sp-40);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    border-color 0.18s ease;
  min-height: 240px;
}
.path-tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s ease;
}
.path-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(38, 38, 94, 0.18);
  text-decoration: none;
}
.path-tile:hover::after { transform: scaleX(1); }
.path-tile:focus-visible {
  outline: none;
  border-color: var(--secondary);
  box-shadow: var(--shadow-lift), 0 0 0 3px var(--glow-teal);
}
.path-tile-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  min-width: 0;
}
.path-tile-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--neutral);
}
.path-tile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--primary);
  margin: 0;
}
.path-tile-laser {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--secondary);
  border-radius: 1px;
  margin: var(--sp-2) 0 var(--sp-4);
}
.path-tile-tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.path-tile-blurb {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--neutral);
  margin: 0;
  flex-grow: 1;
}
.path-tile-cta {
  display: inline-flex;
  align-items: center;
  margin-top: var(--sp-12);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  transition: transform 0.18s ease;
}
.path-tile:hover .path-tile-cta { transform: translateX(3px); }

.path-tile-glyph {
  width: 132px;
  height: 132px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center,
      rgba(63, 199, 160, 0.22) 0%,
      rgba(63, 199, 160, 0.08) 45%,
      transparent 78%);
  border-radius: 50%;
}
.path-tile-glyph svg {
  width: 72%;
  height: 72%;
  filter: drop-shadow(0 4px 10px rgba(38, 38, 94, 0.14));
}

@media (max-width: 540px) {
  .path-tile {
    grid-template-columns: 1fr;
    padding: var(--sp-24);
    min-height: 0;
  }
  .path-tile-glyph {
    width: 96px;
    height: 96px;
    align-self: flex-start;
  }
  .path-tile-name { font-size: 1.8rem; }
}

/* ── Catalogue divider ────────────────────────────────────── */

.catalogue-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  margin: var(--sp-12) 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--neutral);
}
.catalogue-divider-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(38, 38, 94, 0.18) 8%,
    rgba(38, 38, 94, 0.18) 92%,
    transparent
  );
}
.catalogue-divider-label {
  white-space: nowrap;
  padding: 0 var(--sp-12);
}

/* ── Masthead cog (Operations) ────────────────────────────── */

.mast-cog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  color: rgba(244, 244, 239, 0.55);
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}
.mast-cog:hover {
  color: var(--sand);
  background: rgba(244, 244, 239, 0.08);
  text-decoration: none;
}
.mast-cog svg {
  width: 18px;
  height: 18px;
  display: block;
}
@media (max-width: 800px) {
  .mast-cog { width: 28px; height: 28px; }
}

/* ══════════════════════════════════════════════════════════════════════
   /library — search-led rail with grouped family navigation.

   Three-row rail under a sticky masthead:
     1. Big search input (the primary affordance) + small profile/context
        dropdowns + count chip on the right.
     2. Category strip — All · Truth · Initiatives · Collab · Infra (with
        any leftover families bucketed under Other). One is active.
     3. Family chips for the active category, with per-family counts.

   The rail itself is sticky beneath the masthead so filters stay within
   reach as the 17k-tile grid scrolls.
   ══════════════════════════════════════════════════════════════════════ */

.lib-rail {
  position: sticky;
  top: 58px; /* clear the masthead's 2px teal laser line */
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-32) var(--sp-16);
  margin: 0 calc(50% - 50vw) var(--sp-24);
  background:
    linear-gradient(var(--sand), var(--sand));
  border-bottom: 1px solid rgba(38, 38, 94, 0.08);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

/* ── Row 1: search + aux ───────────────────────────────────────────── */

.lib-search-row {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
}
.lib-search {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-12);
  padding: 10px var(--sp-16);
  background: var(--white);
  border: 1.5px solid rgba(38, 38, 94, 0.10);
  border-radius: 999px;
  cursor: text;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.lib-search:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px var(--glow-teal);
}
.lib-search-glyph {
  color: var(--secondary-deep);
  font-size: 1.05rem;
  font-weight: 700;
}
.lib-search input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}
.lib-search input[type="search"]::placeholder {
  color: var(--neutral);
  opacity: 0.85;
}
.lib-search-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  background: rgba(38, 38, 94, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
}

.lib-aux {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  flex-shrink: 0;
}
.lib-aux select {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.12);
  border-radius: 6px;
  padding: 6px var(--sp-8);
  cursor: pointer;
}
.lib-aux select:hover { border-color: rgba(38, 38, 94, 0.24); }
.lib-aux .lib-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--neutral);
  padding: 0 var(--sp-8);
}
.lib-aux .btn-ghost {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--neutral);
  background: transparent;
  border: 1px dashed rgba(38, 38, 94, 0.18);
  border-radius: 6px;
  padding: 6px var(--sp-8);
}
.lib-aux .btn-ghost:hover { color: var(--danger); border-color: var(--danger); }

/* ── Row 2: category strip ─────────────────────────────────────────── */

.lib-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
}
.lib-cat {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-8);
  padding: 7px var(--sp-12);
  background: transparent;
  border: 1px solid rgba(38, 38, 94, 0.12);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease,
              color 0.14s ease;
}
.lib-cat:hover {
  border-color: var(--primary);
  background: rgba(38, 38, 94, 0.04);
}
.lib-cat.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--sand);
}
.lib-cat-label {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--primary);
}
.lib-cat.is-active .lib-cat-label { color: var(--sand); }
.lib-cat-count {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--neutral);
}
.lib-cat.is-active .lib-cat-count { color: var(--secondary); }

/* ── Row 3: family chips for the active category ───────────────────── */

.lib-fams {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-8);
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
}
.lib-fam {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: 4px var(--sp-8);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease,
              color 0.14s ease;
}
.lib-fam:hover {
  background: rgba(38, 38, 94, 0.04);
  border-color: rgba(38, 38, 94, 0.10);
}
.lib-fam.is-active {
  background: var(--secondary);
  border-color: var(--secondary-deep);
}
.lib-fam-name {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--ink);
}
.lib-fam.is-active .lib-fam-name { color: var(--primary); font-weight: 700; }
.lib-fam-count {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--neutral);
}
.lib-fam.is-active .lib-fam-count { color: var(--primary); }

/* ── Sticky offset for selection bar so it doesn't hide behind it ──── */

@media (max-width: 1100px) {
  .lib-aux .lib-count { display: none; }
  .lib-rail { padding: var(--sp-12) var(--sp-16); }
}
@media (max-width: 800px) {
  .lib-search-row { flex-direction: column; align-items: stretch; }
  .lib-aux { justify-content: flex-end; }
}

/* ══════════════════════════════════════════════════════════════════════
   /slides — PMO Slide Preparer (5th-tool tile on the landing + the
   /slides picker page + the /slides/<slug> preview page).

   Slides is a distinct output medium, NOT a Miro path — its landing
   tile is single-row full-width to differentiate it visually from the
   four-paths 2×2 grid above.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Landing band ────────────────────────────────────────── */

.slides-band {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: var(--sp-32);
  padding: var(--sp-32) var(--sp-40);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease;
  margin-top: var(--sp-12);
}
.slides-band::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s ease;
}
.slides-band:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(38, 38, 94, 0.18);
  text-decoration: none;
}
.slides-band:hover::after { transform: scaleX(1); }
.slides-band-body { display: flex; flex-direction: column; gap: var(--sp-8); }
.slides-band-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--neutral);
}
.slides-band-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--primary);
  margin: 0;
}
.slides-band-laser {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--secondary);
  border-radius: 1px;
  margin: var(--sp-2) 0 var(--sp-4);
}
.slides-band-blurb {
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--neutral);
  margin: 0;
  max-width: 880px;
}
.slides-band-cta {
  display: inline-flex;
  align-items: center;
  margin-top: var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  transition: transform 0.18s ease;
}
.slides-band:hover .slides-band-cta { transform: translateX(3px); }

.slides-band-glyph {
  width: 160px;
  height: 160px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center,
      rgba(63, 199, 160, 0.22) 0%,
      rgba(63, 199, 160, 0.08) 45%,
      transparent 78%);
  border-radius: 50%;
}
.slides-band-glyph svg {
  width: 72%;
  height: 72%;
  filter: drop-shadow(0 4px 10px rgba(38, 38, 94, 0.14));
}

@media (max-width: 720px) {
  .slides-band { grid-template-columns: 1fr; }
  .slides-band-glyph { width: 96px; height: 96px; }
}

/* ── Masthead — divider before the Slides entry ─────────── */

.mast-nav-divider {
  position: relative;
  margin-left: var(--sp-12);
  padding-left: var(--sp-16) !important;
}
.mast-nav-divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: rgba(244, 244, 239, 0.18);
}

/* ── /slides picker page ──────────────────────────────────── */

.slides-index {
  padding-top: var(--sp-16);
  margin-bottom: var(--sp-64);
}

/* Hero: copy on the left, stats grid on the right */
.slides-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-48);
  align-items: end;
  padding: var(--sp-24) 0 var(--sp-40);
  border-bottom: 1px solid rgba(38, 38, 94, 0.14);
  margin-bottom: var(--sp-48);
}
.slides-hero-copy { max-width: 720px; }
.slides-hero-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.12);
  padding: 4px 10px;
  border-radius: 4px;
}
.slides-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.4rem;
  line-height: 1;
  letter-spacing: -1.2px;
  color: var(--primary);
  margin: var(--sp-12) 0 var(--sp-12);
}
.slides-hero-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--neutral);
  margin: 0;
}
.slides-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, auto));
  gap: var(--sp-32);
  margin: 0;
  padding: var(--sp-32) var(--sp-40);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(38, 38, 94, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
}
.slides-hero-stats > div { display: flex; flex-direction: column; gap: 10px; }
.slides-hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--neutral);
  margin: 0;
}
.slides-hero-stats dd {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.4px;
  margin: 0;
  line-height: 1.05;
}
.slides-hero-stats-time {
  font-family: var(--font-body) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: var(--secondary-deep) !important;
  text-transform: none !important;
  white-space: nowrap;
}

/* Deck cards */
.slides-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: var(--sp-32);
  margin-bottom: var(--sp-64);
}
.slides-deck-tile {
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.18);
  border-top: 4px solid var(--secondary);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(38, 38, 94, 0.10), 0 2px 4px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-top-color 0.18s ease;
}
.slides-deck-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(38, 38, 94, 0.16), 0 4px 8px rgba(15, 23, 42, 0.08);
  border-top-color: var(--secondary-deep);
}
.slides-deck-tile-link {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: var(--sp-32) var(--sp-40) var(--sp-32);
  text-decoration: none;
  color: var(--ink);
  min-height: 220px;
}
.slides-deck-tile-link:hover { text-decoration: none; }
.slides-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slides-deck-kicker,
.slides-deck-meta {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.slides-deck-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: var(--primary);
  margin: 0;
}
.slides-deck-sub {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--neutral);
  margin: 0;
}
.slides-deck-archetypes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.slides-deck-archetype {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(38, 38, 94, 0.06);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
/* Subtle per-archetype tint cues. Same family as the slide accents. */
.slides-deck-archetype-cover-toc           { background: rgba(63, 199, 160, 0.14); color: var(--secondary-deep); }
.slides-deck-archetype-capability-overview { background: rgba(38, 38, 94, 0.10);   color: var(--primary); }
.slides-deck-archetype-band-detail         { background: rgba(38, 38, 94, 0.10);   color: var(--primary); }
.slides-deck-archetype-cascade             { background: rgba(198, 40, 40, 0.10);  color: var(--danger); }
.slides-deck-archetype-slice-table         { background: rgba(54, 115, 176, 0.10); color: var(--accent); }
.slides-deck-archetype-tier2-cards         { background: rgba(230, 81, 0, 0.10);   color: var(--warning); }
.slides-deck-archetype-dep-map             { background: rgba(54, 115, 176, 0.10); color: var(--accent); }
.slides-deck-archetype-parallel-table      { background: rgba(46, 125, 50, 0.10);  color: var(--success); }
.slides-deck-archetype-risk-lens           { background: rgba(198, 40, 40, 0.14);  color: var(--danger); }

.slides-deck-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-12);
  margin-top: auto;
  padding-top: var(--sp-16);
  border-top: 1px solid rgba(38, 38, 94, 0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.slides-deck-built { color: var(--secondary-deep); }
.slides-deck-unbuilt { color: var(--warning); }
.slides-deck-overlays { color: var(--neutral); }
.slides-deck-cta {
  margin-left: auto;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--secondary-deep);
}

/* PMO data rail — entry points to /data/pmo/<entity> */
.slides-data-rail {
  padding: var(--sp-32) 0;
  border-top: 1px solid rgba(38, 38, 94, 0.10);
}
.slides-data-rail-head { max-width: 720px; margin-bottom: var(--sp-24); }
.slides-data-rail-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--neutral);
}
.slides-data-rail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.6px;
  color: var(--primary);
  margin: var(--sp-4) 0 var(--sp-8);
}
.slides-data-rail-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--neutral);
  line-height: 1.5;
  margin: 0;
}
.slides-data-rail-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-12);
  margin-top: var(--sp-16);
}
.slides-data-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-24) var(--sp-32);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.18);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(38, 38, 94, 0.06);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  min-height: 150px;
}
.slides-data-tile:hover {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 8px 22px rgba(38, 38, 94, 0.14);
  text-decoration: none;
}
.slides-data-tile-count {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.4px;
  line-height: 1;
}
.slides-data-tile-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}
.slides-data-tile-sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--neutral);
  line-height: 1.45;
  margin-top: 2px;
}
.slides-data-tile-cta {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}

/* ── /slides/<slug> preview page ──────────────────────────── */

.slides-preview-page {
  padding-top: var(--sp-12);
  margin-bottom: var(--sp-64);
}
.slides-preview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-24);
  flex-wrap: wrap;
  padding: var(--sp-12) 0 var(--sp-16);
}
.slides-preview-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--neutral);
}
.slides-preview-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.6px;
  color: var(--primary);
  margin: var(--sp-4) 0 var(--sp-2);
}
.slides-preview-sub {
  font-size: 0.95rem;
  color: var(--neutral);
  margin: 0;
  max-width: 720px;
}
.slides-preview-actions {
  display: flex;
  gap: var(--sp-8);
  align-items: center;
}

/* ── Editing-mode toggle pill ─────────────────────────────── */
.edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1.5px solid rgba(38, 38, 94, 0.18);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--neutral);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.edit-toggle:hover {
  border-color: var(--secondary);
  box-shadow: 0 2px 8px rgba(38, 38, 94, 0.08);
}
.edit-toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(38, 38, 94, 0.18);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.edit-toggle-label { color: var(--ink); }
.edit-toggle-state {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--neutral);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(38, 38, 94, 0.06);
}
.edit-toggle.is-on {
  border-color: var(--secondary);
  background: rgba(63, 199, 160, 0.08);
}
.edit-toggle.is-on .edit-toggle-dot {
  background: var(--secondary-deep);
  box-shadow: 0 0 0 3px rgba(63, 199, 160, 0.20);
}
.edit-toggle.is-on .edit-toggle-state {
  color: var(--secondary-deep);
  background: rgba(63, 199, 160, 0.16);
}

/* ── First-visit helper banner ────────────────────────────── */
.edit-mode-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-16);
  padding: var(--sp-16) var(--sp-24);
  margin: var(--sp-16) 0;
  background: rgba(63, 199, 160, 0.10);
  border: 1px solid rgba(63, 199, 160, 0.40);
  border-left: 4px solid var(--secondary-deep);
  border-radius: 8px;
  font-family: var(--font-body);
  color: var(--ink);
}
.edit-mode-banner[hidden] { display: none; }
.edit-mode-banner-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--secondary-deep);
  color: var(--sand);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
}
.edit-mode-banner-body { flex: 1; line-height: 1.55; font-size: 0.92rem; }
.edit-mode-banner-body strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--secondary-deep);
}
.edit-mode-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--neutral);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.14s ease, color 0.14s ease;
}
.edit-mode-banner-close:hover {
  background: rgba(38, 38, 94, 0.08);
  color: var(--ink);
}

/* ── Editing-mode visual cue on the deck stage ────────────── */
body.is-editing-mode .deck-fit {
  border-color: rgba(63, 199, 160, 0.45);
  box-shadow: 0 0 0 3px rgba(63, 199, 160, 0.10),
              0 1px 2px rgba(15, 23, 42, 0.04),
              0 12px 32px rgba(15, 23, 42, 0.06);
}
body.is-editing-mode .deck-fit::before {
  content: "EDITING";
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--secondary-deep);
  background: var(--sand);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(63, 199, 160, 0.40);
  pointer-events: none;
}
.slides-preview-status {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--neutral);
  margin-bottom: var(--sp-12);
  padding: var(--sp-8) var(--sp-12);
  background: rgba(38, 38, 94, 0.04);
  border-left: 3px solid var(--secondary);
  border-radius: 0 4px 4px 0;
}
/* Inline deck embed — no iframe.
 * `.deck-fit` is the responsive container; `.deck-stage` is the deck
 * itself, transformed to scale-to-fit. JS sets the wrapper height so
 * the page reflows correctly at any width. */
.deck-fit {
  position: relative;
  width: 100%;
  margin-top: var(--sp-12);
  border-radius: var(--radius-lg);
  background: var(--page-bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(38, 38, 94, 0.08);
  overflow: hidden;
}
.deck-fit .deck-stage {
  /* JS sets transform / width / transformOrigin. Reset visual chrome
   * inherited from the deck's standalone styles so the embedded canvas
   * blends with the host page. */
  background: var(--page-bg) !important;
  margin: 0;
  display: block;
}
.deck-fit .slide {
  /* Soften the black drop-shadow that's intended for the dark
   * standalone canvas — looks heavy when sitting on white sand. */
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12) !important;
  /* More breathing between stacked slides so 8 indigo headers don't
   * feel like a wall. */
  margin: 56px auto !important;
}
/* The deck label between slides ("SLIDE 3 OF 8 · …") sits in the gap
 * between cards. In the embed, give it more presence and use it as a
 * visual divider between slides. */
.deck-fit .slide-label {
  margin: 0 auto !important;
  padding: 22px 16px 14px !important;
  font-size: 11px !important;
  position: relative;
}
.deck-fit .slide-label::before,
.deck-fit .slide-label::after {
  content: "";
  display: inline-block;
  width: 60px;
  height: 1px;
  background: rgba(63, 199, 160, 0.4);
  vertical-align: middle;
  margin: 0 14px;
}

/* Slide pager — small jump-to-slide chip strip above the deck. */
.deck-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--sp-12) 0 0;
  padding: var(--sp-12) var(--sp-12);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.08);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  width: fit-content;
}
.deck-pager-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--neutral);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.deck-pager-chip:hover {
  background: rgba(63, 199, 160, 0.14);
  color: var(--secondary-deep);
  text-decoration: none;
  transform: translateY(-1px);
}
.deck-pager-chip.is-active {
  background: var(--primary);
  color: var(--sand);
}

/* ── /slides/<slug>/overlays — operational data editor ───── */

.slides-overlays-page {
  padding-top: var(--sp-12);
  margin-bottom: var(--sp-64);
}
.overlays-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  margin-top: var(--sp-16);
}
.overlay-row {
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: var(--radius);
  padding: var(--sp-16) var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  box-shadow: var(--shadow-subtle);
}
.overlay-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-16);
}
.overlay-row-band {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--secondary-deep);
  margin-right: var(--sp-12);
}
.overlay-row-name {
  display: inline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: -0.2px;
  margin: 0;
}
.overlay-row-default {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--neutral);
}
.overlay-row-default strong { color: var(--primary); }

.overlay-row-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-8);
}
.overlay-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(38, 38, 94, 0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--neutral);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.overlay-radio:hover { border-color: var(--primary); }
.overlay-radio input { margin: 0; accent-color: var(--primary); }
.overlay-radio:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--sand);
}
.overlay-radio-healthy:has(input:checked) {
  background: var(--success);
  border-color: var(--success);
}
.overlay-radio-watch:has(input:checked) {
  background: var(--warning);
  border-color: var(--warning);
}
.overlay-radio-at-risk:has(input:checked) {
  background: var(--danger);
  border-color: var(--danger);
}
.overlay-note {
  flex: 1;
  min-width: 240px;
  padding: 7px 12px;
  border: 1px solid rgba(38, 38, 94, 0.12);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  background: var(--sand);
  color: var(--ink);
}
.overlay-note:focus {
  outline: none;
  border-color: var(--secondary);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--glow-teal);
}

/* ── Cross-tab collision banner (data editor) ────────────── */

.data-collision-banner {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  max-width: 680px;
  padding: var(--sp-12) var(--sp-24);
  background: var(--white);
  border: 1px solid var(--warning);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  animation: collision-slide-in 0.22s ease;
}
@keyframes collision-slide-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.data-collision-banner strong { color: var(--warning); margin-right: 6px; }
.data-collision-actions {
  display: flex;
  gap: var(--sp-8);
  margin-left: auto;
}

/* ── /data/pmo — structural data picker + Tier 0 editor ─── */

.data-pmo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-24);
  margin-top: var(--sp-32);
}
.data-pmo-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-24) var(--sp-24);
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease;
}
.data-pmo-tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s ease;
}
.data-pmo-tile:hover:not(.data-pmo-tile-pending) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(38, 38, 94, 0.18);
  text-decoration: none;
}
.data-pmo-tile:hover:not(.data-pmo-tile-pending)::after { transform: scaleX(1); }
.data-pmo-tile-pending { opacity: 0.65; cursor: default; }

.data-pmo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.data-pmo-kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.data-pmo-tile-pending .data-pmo-kicker { color: var(--neutral); }
.data-pmo-count {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
}
.data-pmo-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: var(--primary);
  margin: 0;
}
.data-pmo-sub {
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--neutral);
  margin: 0;
  flex: 1;
}
.data-pmo-cta {
  margin-top: var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.data-pmo-pending {
  margin-top: var(--sp-8);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: var(--neutral);
}
.data-pmo-pending code {
  font-size: 0.85em;
  background: rgba(38, 38, 94, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Per-entity edit page ─────────────────────────────────── */

.data-edit-page {
  margin-bottom: var(--sp-128);
}
.data-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin-top: var(--sp-16);
}
.data-row {
  background: var(--white);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
}
.data-row[open] { box-shadow: var(--shadow-card); border-color: rgba(38, 38, 94, 0.18); }
.data-row-summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-16) var(--sp-24);
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  user-select: none;
  transition: background 0.12s ease;
}
.data-row-summary > .data-row-name { flex: 1; min-width: 0; }
.data-row-summary:hover { background: rgba(38, 38, 94, 0.025); }
.data-row[open] .data-row-summary { background: rgba(63, 199, 160, 0.04); }
.data-row-summary::-webkit-details-marker { display: none; }
.data-row-band {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  font-size: 0;
  color: transparent;
}
.data-row-band-security    { background: var(--primary); }
.data-row-band-reliability { background: var(--accent); }
.data-row-band-integration { background: var(--secondary-deep); }
.data-row-band-foundations { background: var(--success); }
.data-row-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.3px;
  line-height: 1.25;
}
.data-row-slug { display: none; }
.data-row-default {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--neutral);
}
.data-row-toggle {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral);
  margin-left: var(--sp-12);
  transition: color 0.12s ease, transform 0.18s ease;
}
.data-row:hover .data-row-toggle { color: var(--secondary-deep); transform: translateX(2px); }
.data-row[open] .data-row-toggle { color: var(--primary); }

.data-row-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
  padding: var(--sp-24) var(--sp-32) var(--sp-32);
  border-top: 1px solid rgba(38, 38, 94, 0.06);
  background: rgba(244, 244, 239, 0.5);
}
.data-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-16);
}
.data-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.data-field-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary);
}
.data-field-help {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--neutral);
  font-style: normal;
}
.data-field input,
.data-field select,
.data-field textarea {
  font-family: var(--font-body);
  font-size: 0.94rem;
  padding: 11px 14px;
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
  line-height: 1.45;
}
.data-field input:hover,
.data-field select:hover,
.data-field textarea:hover {
  border-color: rgba(38, 38, 94, 0.2);
}
.data-field input:focus,
.data-field select:focus,
.data-field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px var(--glow-teal);
}
.data-field textarea { font-family: var(--font-body); font-size: 0.92rem; }

.data-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-12);
  border-top: 1px dashed rgba(38, 38, 94, 0.08);
}
.data-row-delete {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--danger);
  background: transparent;
  border: 1px solid rgba(198, 40, 40, 0.18);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.data-row-delete:hover {
  background: rgba(198, 40, 40, 0.06);
  border-color: var(--danger);
}

/* ── Data editor — extra band/field bits for the 6 new entity types ── */

.data-row-band-rbac      { background: var(--primary); }
.data-row-band-datasync  { background: var(--accent); }
.data-row-band-foundations { background: var(--success); }

.data-field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-8) 0;
}
.data-field-checkbox input[type="checkbox"] {
  margin: 0;
  accent-color: var(--secondary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.data-field-checkbox .data-field-label {
  margin-bottom: 0;
}

.data-cascade-help {
  margin-top: var(--sp-8);
  padding: var(--sp-12);
  background: rgba(38, 38, 94, 0.04);
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: 6px;
}
.data-cascade-help summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
}
.data-cascade-help-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
}
.data-cascade-slug {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--white);
  padding: 3px 8px;
  border: 1px solid rgba(38, 38, 94, 0.10);
  border-radius: 4px;
  color: var(--primary);
  cursor: copy;
  user-select: all;
}
.data-cascade-slug:hover {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

/* ── Inline edit modal (click pill in iframe → modal in parent) ─── */

.inline-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inline-edit-modal[hidden] { display: none; }
.inline-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.inline-edit-window {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hero);
  width: min(560px, 92vw);
  max-height: 80vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  animation: inline-edit-pop 0.18s ease-out;
}
@keyframes inline-edit-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.inline-edit-head {
  padding: var(--sp-24) var(--sp-24) var(--sp-12);
  border-bottom: 1px solid var(--surface);
}
.inline-edit-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--secondary-deep);
}
.inline-edit-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.4px;
  color: var(--primary);
  margin: var(--sp-4) 0 var(--sp-2);
}
.inline-edit-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.6px;
  color: var(--neutral);
  margin: 0;
}
.inline-edit-body {
  padding: var(--sp-16) var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}
.inline-edit-radios {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}
.inline-edit-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-24) var(--sp-24);
  border-top: 1px solid var(--surface);
}
