/* ════════════════════════════════════════════════════════════════════
   Agentic Governance Blueprint for Fabric — site styles
   Branded with the RVAP (Real Value Acceleration Program) identity:
   white / light-neutral canvas, Deep Navy → RVAP Blue gradient hero,
   Aptos / Outfit / Inter type, and the RVAP blue-dominant palette with
   teal (Scale), purple (Innovate) and navy accents mapped to the five
   governance stages. See .agents/skills/rvap-brand for the brand kit.
═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:            #f5f8fe;   /* page surface — very light blue-white */
  --surface:       #ffffff;   /* cards / panels */
  --surface-2:     #eef3fc;   /* card hover / subtle tint */
  --surface-3:     #e6eefb;
  --border:        #e6eaf1;
  --border-md:     #dce2ec;
  --border-lg:     #cbd5e5;

  --accent:        #1a77e3;   /* RVAP Blue — primary */
  --accent-dim:    rgba(26,119,227,0.10);

  /* 5 governance stages — mapped to the RVAP palette */
  --foundation:        #032254;   /* Deep Navy — the base */
  --foundation-dim:    rgba(3,34,84,0.08);
  --core:              #1a77e3;   /* RVAP Blue — the primary loop */
  --core-dim:          rgba(26,119,227,0.10);
  --governed:          #14868a;   /* Teal (Scale) — trust & control */
  --governed-dim:      rgba(20,134,138,0.10);
  --intelligent:       #504092;   /* Purple (Innovate) — AI & agents */
  --intelligent-dim:   rgba(80,64,146,0.10);
  --capstone:          #0078d4;   /* Microsoft Blue (Build) — the proof */
  --capstone-dim:      rgba(0,120,212,0.10);

  --text:    #032254;   /* Deep Navy — headings & emphasis */
  --text-2:  #47494e;   /* Charcoal — body copy */
  --text-3:  #6b7280;   /* Muted — captions & meta */

  --ff-display: "Aptos Display", "Outfit", "Segoe UI", system-ui, sans-serif;
  --ff-body:    "Aptos", "Inter", "Segoe UI", system-ui, sans-serif;
  --ff-mono:    "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ════════════════════════════════════════════
   LAYOUT WRAPPER
════════════════════════════════════════════ */
.container { position: relative; z-index: 1; max-width: 1380px; margin: 0 auto; padding: 0 48px; }

/* ════════════════════════════════════════════
   FILTER NAV
════════════════════════════════════════════ */
.filter-bar {
  position: sticky; top: 58px; z-index: 90;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(245,248,254,0.85);
  backdrop-filter: blur(16px);
}
.filter-inner {
  max-width: 1380px; margin: 0 auto; padding: 0 48px;
  display: flex; align-items: center; gap: 6px; height: 60px;
}
.tab {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 16px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  cursor: pointer; border-radius: 8px; transition: all 0.18s ease;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.tab.active[data-filter="all"]         { background: var(--text);        color: var(--bg); border-color: transparent; }
.tab.active[data-filter="foundation"]  { background: var(--foundation);  color: #fff;      border-color: transparent; }
.tab.active[data-filter="core"]        { background: var(--core);        color: var(--bg); border-color: transparent; }
.tab.active[data-filter="governed"]    { background: var(--governed);    color: var(--bg); border-color: transparent; }
.tab.active[data-filter="intelligent"] { background: var(--intelligent); color: var(--bg); border-color: transparent; }
.tab.active[data-filter="capstone"]    { background: var(--capstone);    color: #fff;      border-color: transparent; }
.tab-n { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: rgba(3,34,84,0.07); }
.tab.active .tab-n { background: rgba(0,0,0,0.18); }

.search-wrap { margin-left: auto; }
.search {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--ff-mono); font-size: 12px; padding: 8px 16px; border-radius: 8px;
  outline: none; width: 230px; transition: all 0.18s ease;
}
.search::placeholder { color: var(--text-3); }
.search:focus { border-color: var(--border-md); background: var(--surface-2); }

/* ════════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════════ */
main { position: relative; z-index: 1; padding: 40px 0 96px; }
.home-main { padding-top: 0; }

.section-label {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); display: flex; align-items: center; gap: 14px; margin: 44px 0 20px;
}
.section-label .sl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.section-label[data-stage="foundation"]  .sl-dot { background: var(--foundation); }
.section-label[data-stage="core"]        .sl-dot { background: var(--core); }
.section-label[data-stage="governed"]    .sl-dot { background: var(--governed); }
.section-label[data-stage="intelligent"] .sl-dot { background: var(--intelligent); }
.section-label[data-stage="capstone"]    .sl-dot { background: var(--capstone); }
.section-label .sl-blurb { color: var(--text-3); text-transform: none; letter-spacing: 0.02em; font-size: 11px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

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

/* ── Cards ── */
.card {
  position: relative; display: flex; flex-direction: column; gap: 11px;
  padding: 22px 22px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; color: inherit; cursor: pointer; overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  animation: cardIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px;
  border-radius: 0 3px 3px 0; transition: top 0.22s ease, bottom 0.22s ease;
}
.card[data-cat="foundation"]::before  { background: var(--foundation); }
.card[data-cat="core"]::before        { background: var(--core); }
.card[data-cat="governed"]::before    { background: var(--governed); }
.card[data-cat="intelligent"]::before { background: var(--intelligent); }
.card[data-cat="capstone"]::before    { background: var(--capstone); }

.card:hover { background: var(--surface-2); transform: translateY(-4px); }
.card:hover::before { top: 12%; bottom: 12%; }
.card[data-cat="foundation"]:hover  { box-shadow: 0 14px 40px rgba(3,34,84,.12), 0 0 0 1px rgba(3,34,84,.18);    border-color: rgba(3,34,84,.22); }
.card[data-cat="core"]:hover        { box-shadow: 0 14px 40px rgba(3,34,84,.12), 0 0 0 1px rgba(26,119,227,.22);  border-color: rgba(26,119,227,.28); }
.card[data-cat="governed"]:hover    { box-shadow: 0 14px 40px rgba(3,34,84,.12), 0 0 0 1px rgba(20,134,138,.22);  border-color: rgba(20,134,138,.28); }
.card[data-cat="intelligent"]:hover { box-shadow: 0 14px 40px rgba(3,34,84,.12), 0 0 0 1px rgba(80,64,146,.22);   border-color: rgba(80,64,146,.28); }
.card[data-cat="capstone"]:hover    { box-shadow: 0 14px 40px rgba(3,34,84,.12), 0 0 0 1px rgba(0,120,212,.22);   border-color: rgba(0,120,212,.28); }

.card-head { display: flex; align-items: center; gap: 8px; }
.badge {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 5px; font-weight: 500;
}
.card[data-cat="foundation"]  .badge { background: var(--foundation-dim);  color: var(--foundation); }
.card[data-cat="core"]        .badge { background: var(--core-dim);        color: var(--core); }
.card[data-cat="governed"]    .badge { background: var(--governed-dim);    color: var(--governed); }
.card[data-cat="intelligent"] .badge { background: var(--intelligent-dim); color: var(--intelligent); }
.card[data-cat="capstone"]    .badge { background: var(--capstone-dim);    color: var(--capstone); }

.card-num {
  font-family: var(--ff-mono); font-size: 10px; padding: 3px 8px; border-radius: 5px;
  background: rgba(3,34,84,0.05); color: var(--text-3); border: 1px solid var(--border);
}
.card-arrow { margin-left: auto; font-size: 17px; color: var(--text-3); line-height: 1; transition: color 0.18s ease, transform 0.18s ease; }
.card:hover .card-arrow { color: var(--text); transform: translate(3px,-3px); }

.card-title { font-family: var(--ff-display); font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-desc {
  font-size: 13px; color: var(--text-2); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.card-meta {
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tag {
  font-family: var(--ff-mono); font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: rgba(3,34,84,0.04); color: var(--text-3); border: 1px solid var(--border);
}

@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.card:nth-child(1){animation-delay:0ms}.card:nth-child(2){animation-delay:40ms}.card:nth-child(3){animation-delay:80ms}
.card:nth-child(4){animation-delay:120ms}.card:nth-child(5){animation-delay:160ms}.card:nth-child(6){animation-delay:200ms}
.card:nth-child(7){animation-delay:240ms}.card:nth-child(8){animation-delay:280ms}.card:nth-child(9){animation-delay:320ms}
.card:nth-child(10){animation-delay:360ms}

.card.hidden, .section-label.hidden, .grid.hidden { display: none !important; }

/* Empty state */
.empty-state { display: none; padding: 80px 0; text-align: center; }
.empty-state.visible { display: block; }
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-msg { font-family: var(--ff-mono); font-size: 13px; color: var(--text-3); letter-spacing: 0.05em; }

/* ════════════════════════════════════════════
   DELIVERY PAGE COMPONENTS
════════════════════════════════════════════ */
.page-intro { max-width: 720px; margin-bottom: 8px; }
.page-intro .eyebrow { margin-bottom: 16px; }
.container.hero {
  padding: clamp(72px, 8vw, 100px) clamp(24px, 5vw, 48px) clamp(64px, 7vw, 88px);
}
.page-intro h2 {
  font-family: var(--ff-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(34px, 4.4vw, 56px); line-height: 1; margin-bottom: 18px;
}
.page-intro p { color: var(--text-2); font-size: 16px; line-height: 1.75; }
.hero .page-intro p { color: rgba(255,255,255,0.84); }
.hero .page-intro a {
  color: var(--c-hero-accent);
  border-bottom: 1px solid rgba(191,219,254,0.44);
  text-decoration: none;
}
.hero .page-intro a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.72);
}

.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fcard {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.fcard:hover { transform: translateY(-3px); background: var(--surface-2); border-color: var(--border-md); }
.fcard.featured { border-color: rgba(26,119,227,0.45); box-shadow: 0 0 0 1px var(--accent-dim), 0 16px 44px rgba(3,34,84,0.14); }
.fcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fcard-dur { font-family: var(--ff-mono); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.fcard-dur .u { font-size: 13px; color: var(--text-2); font-weight: 400; }
.pill {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border-md); color: var(--text-3);
}
.pill.default { color: var(--accent); border-color: rgba(0,212,170,0.4); background: var(--accent-dim); }
.fcard-name { font-family: var(--ff-display); font-size: 18px; font-weight: 700; color: var(--text); }
.fcard-meta { font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.04em; }
.fcard-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.65; }

/* Generic panel + feature rows */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 30px 30px 28px;
}
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.feature { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.feature:last-child { border-bottom: none; }
.feature .fi {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--ff-mono); font-size: 13px; font-weight: 600;
  background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(26,119,227,0.22);
}
.feature h4 { font-family: var(--ff-display); font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.feature p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.feature code {
  font-family: var(--ff-mono); font-size: 12px; color: var(--accent);
  background: var(--accent-dim); padding: 1px 6px; border-radius: 4px;
}

/* Agenda timeline */
.agenda { display: grid; gap: 0; }
.agenda-row {
  display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.agenda-row:last-child { border-bottom: none; }
.agenda-time { font-family: var(--ff-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.04em; }
.agenda-block { font-size: 14px; color: var(--text); }
.agenda-block span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.agenda-day { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); margin: 6px 0 8px; }

/* Evolve / PR-type chips */
.evolve-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ecard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.ecard .prefix {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 6px;
  display: inline-block; margin-bottom: 10px;
}
.ecard.fix      .prefix { background: var(--foundation-dim);  color: var(--foundation); }
.ecard.enhance  .prefix { background: var(--governed-dim);    color: var(--governed); }
.ecard.adapt    .prefix { background: var(--intelligent-dim); color: var(--intelligent); }
.ecard.feat     .prefix { background: var(--capstone-dim);    color: var(--capstone); }
.ecard p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* One-pager preview */
.preview-wrap {
  border: 1px solid var(--border-md); border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: 0 20px 50px rgba(3,34,84,0.16);
}
.preview-wrap img { display: block; width: 100%; height: auto; }

.lead-list { list-style: none; display: grid; gap: 12px; }
.lead-list li { display: flex; gap: 12px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.lead-list .chk { color: var(--accent); flex: none; font-weight: 700; }
.lead-list strong { color: var(--text); font-weight: 500; }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid, .format-grid { grid-template-columns: repeat(2,1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .evolve-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  .container, .filter-inner { padding-left: 20px; padding-right: 20px; }
  .grid, .format-grid, .evolve-grid { grid-template-columns: 1fr; }
  .filter-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .search-wrap { margin-left: 0; width: 100%; }
  .search { width: 100%; }
  .agenda-row { grid-template-columns: 72px 1fr; gap: 12px; }
}

/* ════════════════════════════════════════════
   CONTENT PAGES — compact hero, prose article, TOC
   (generated challenge / doc pages)
════════════════════════════════════════════ */

/* Compact variant of the gradient hero for content pages */
.hero.hero-compact { padding: 40px 48px 32px; }
.doc-h1 {
  font-family: var(--ff-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; color: #fff; margin-bottom: 12px;
}
.doc-tagline { color: rgba(255,255,255,0.86); font-size: 16px; line-height: 1.6; max-width: 760px; }
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px;
  font-family: var(--ff-mono); font-size: 12px; color: rgba(255,255,255,0.78); letter-spacing: 0.03em;
}
.doc-meta .dm b { color: #fff; font-weight: 600; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hero .doc-tags .tag { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.24); color: #fff; }
.doc-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.18);
  font-family: var(--ff-mono); font-size: 12px;
}
.doc-nav a { color: #fff; text-decoration: none; padding: 6px 2px; transition: opacity 0.18s ease; }
.doc-nav a:hover { opacity: 0.72; }
.doc-nav > span:empty { flex: 1; }

/* Two-column article + table of contents */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 52px; align-items: start; }
.doc-layout--notoc { grid-template-columns: minmax(0, 880px); justify-content: center; }

.doc-toc { position: sticky; top: 24px; align-self: start; }
.doc-toc-title {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px; padding-left: 14px;
}
.doc-toc nav { display: flex; flex-direction: column; border-left: 1px solid var(--border-md); }
.doc-toc a {
  font-size: 12.5px; color: var(--text-3); text-decoration: none; padding: 5px 14px;
  border-left: 2px solid transparent; margin-left: -1px; line-height: 1.4; transition: all 0.15s ease;
}
.doc-toc a:hover { color: var(--text); }
.doc-toc a.lvl-3 { padding-left: 26px; font-size: 12px; }
.doc-toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* ── Prose ── */
.prose { max-width: 880px; color: var(--text-2); font-size: 15.5px; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-family: var(--ff-display); font-weight: 700; color: var(--text);
  font-size: 25px; letter-spacing: -0.01em; line-height: 1.25;
  margin: 46px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.prose h3 { font-family: var(--ff-display); font-weight: 700; color: var(--text); font-size: 18.5px; margin: 32px 0 12px; }
.prose h4 { font-family: var(--ff-display); font-weight: 600; color: var(--text); font-size: 15px; margin: 24px 0 10px; }
.prose p { margin: 14px 0; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(26,119,227,0.28); transition: all 0.15s ease; }
.prose a:hover { color: #0078d4; border-bottom-color: #0078d4; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 14px 0; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--text-3); }
.prose li.task { list-style: none; margin-left: -24px; padding-left: 0; display: flex; gap: 9px; align-items: flex-start; }
.prose li.task input[type="checkbox"] { margin-top: 4px; accent-color: var(--accent); flex: none; }
.prose blockquote {
  border: 1px solid var(--border-md);
  box-shadow: inset 0 3px 0 var(--accent);
  background: var(--accent-dim);
  padding: 14px 20px; border-radius: 12px; margin: 20px 0; color: var(--text-2);
}
.prose blockquote p { margin: 6px 0; }
.prose blockquote strong { color: var(--text); }
.prose code {
  font-family: var(--ff-mono); font-size: 0.86em; color: #0b3b8c;
  background: var(--surface-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px;
}
.prose pre {
  background: #f5f8ff; border: 1px solid var(--border-md); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 18px 0;
}
.prose pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 12.7px; line-height: 1.62; }
.prose table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13.5px;
  border: 1px solid var(--border-md); border-radius: 10px; overflow: hidden;
}
.prose th, .prose td { border: 1px solid var(--border-md); padding: 9px 13px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-2); color: var(--text); font-family: var(--ff-display); font-weight: 600; }
.prose tbody tr:nth-child(even) { background: rgba(3,34,84,0.02); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }

@media (max-width: 1000px) {
  .doc-layout, .doc-layout--notoc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-toc { display: none; }
}
@media (max-width: 760px) {
  .hero.hero-compact { padding: 34px 24px 28px; }
}

/* ════════════════════════════════════════════
   DELIVERY BUILDER (builder.html)
════════════════════════════════════════════ */
.builder-grid { display: grid; grid-template-columns: minmax(0,1fr) 366px; gap: 28px; align-items: start; padding-top: 8px; }

/* Presets */
.presets { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.presets-lbl { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-chip {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; transition: all 0.18s ease;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border-md);
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.preset-chip.ghost { color: var(--text-3); }
.preset-chip.ghost:hover { border-color: var(--border-lg); color: var(--text); }

/* Picker rows */
.pick-group { display: grid; gap: 8px; }
.pick {
  position: relative; display: grid; grid-template-columns: 20px 40px 1fr; gap: 14px; align-items: start;
  padding: 15px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.pick:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--border-md); }
.pick-cb { width: 17px; height: 17px; margin-top: 2px; cursor: pointer; accent-color: var(--accent); }
.pick-num {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 600; color: var(--text-3);
  background: rgba(3,34,84,0.05); border: 1px solid var(--border); border-radius: 6px;
  text-align: center; padding: 3px 0; margin-top: 1px;
}
.pick-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pick-name { font-family: var(--ff-display); font-size: 15px; font-weight: 700; color: var(--text); }
.pick-tag { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.pick-meta { font-family: var(--ff-mono); font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

.pick[data-cat="foundation"].on  { box-shadow: inset 3px 0 0 var(--foundation);  border-color: rgba(3,34,84,.28); }
.pick[data-cat="core"].on        { box-shadow: inset 3px 0 0 var(--core);        border-color: rgba(26,119,227,.34); }
.pick[data-cat="governed"].on    { box-shadow: inset 3px 0 0 var(--governed);    border-color: rgba(20,134,138,.34); }
.pick[data-cat="intelligent"].on { box-shadow: inset 3px 0 0 var(--intelligent); border-color: rgba(80,64,146,.34); }
.pick[data-cat="capstone"].on    { box-shadow: inset 3px 0 0 var(--capstone);    border-color: rgba(0,120,212,.34); }
.pick.on { background: var(--surface-2); }
.pick.on .pick-num { background: var(--accent-dim); color: var(--accent); border-color: transparent; }

/* Plan panel */
.builder-plan { position: sticky; top: 24px; align-self: start; }
.plan-card { background: var(--surface); border: 1px solid var(--border-md); border-radius: 16px; padding: 22px 22px 20px; box-shadow: 0 20px 50px rgba(3,34,84,0.10); }
.plan-title { font-family: var(--ff-display); font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.plan-empty { color: var(--text-3); font-size: 13.5px; line-height: 1.6; text-align: center; padding: 22px 6px 12px; }
.plan-empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.6; }

.plan-format { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.pf-badge { align-self: flex-start; font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 12px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.pf-note { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.plan-summary { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.plan-summary b { color: var(--text); font-weight: 600; }
.plan-summary .ps-hrs { display: block; font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); margin-top: 4px; }

.plan-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0 0 6px; padding: 0; }
.plan-item {
  display: grid; grid-template-columns: 34px 1fr auto 22px; align-items: center; gap: 10px;
  padding: 8px 10px 8px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg);
}
.plan-item[data-cat="foundation"]  { box-shadow: inset 0 3px 0 var(--foundation); }
.plan-item[data-cat="core"]        { box-shadow: inset 0 3px 0 var(--core); }
.plan-item[data-cat="governed"]    { box-shadow: inset 0 3px 0 var(--governed); }
.plan-item[data-cat="intelligent"] { box-shadow: inset 0 3px 0 var(--intelligent); }
.plan-item[data-cat="capstone"]    { box-shadow: inset 0 3px 0 var(--capstone); }
.pi-num { font-family: var(--ff-mono); font-size: 11px; font-weight: 600; color: var(--text-3); }
.pi-name { font-size: 13px; color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-name:hover { color: var(--accent); }
.pi-dur { font-family: var(--ff-mono); font-size: 10.5px; color: var(--text-3); }
.pi-rm { width: 22px; height: 22px; border: none; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; transition: all 0.15s ease; }
.pi-rm:hover { background: rgba(3,34,84,0.06); color: #c0392b; }

.plan-warn { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.warn-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: #8a5b00; background: rgba(245,166,35,0.10); border: 1px solid rgba(245,166,35,0.30);
  border-radius: 9px; padding: 9px 12px; line-height: 1.4;
}
.warn-row b { color: #6b4700; }
.warn-add { font-family: var(--ff-mono); font-size: 11px; padding: 5px 10px; border-radius: 7px; cursor: pointer; background: #fff; border: 1px solid rgba(245,166,35,0.5); color: #8a5b00; white-space: nowrap; transition: all 0.15s ease; }
.warn-add:hover { background: #f5a623; color: #fff; border-color: #f5a623; }

.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.plan-actions .btn { padding: 9px 13px; font-size: 10.5px; flex: 1 1 auto; justify-content: center; }
.plan-actions #btnCopyMd { flex-basis: 100%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--text); color: #fff; font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.03em;
  padding: 11px 20px; border-radius: 10px; box-shadow: 0 16px 40px rgba(3,34,84,0.3);
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .builder-grid { grid-template-columns: 1fr; }
  .builder-plan { position: static; margin-top: 8px; }
}

/* Print — show only the composed plan */
@media print {
  .nav, .footer, .presets, .builder-main, .plan-actions, .toast, header.hero { display: none !important; }
  body { background: #fff; }
  .builder-grid { display: block; }
  .builder-plan { position: static; }
  .plan-card { border: none; box-shadow: none; padding: 0; }
}
