/* ============================================================
   MCP architecture page
   Reuses tokens and base components from styles.css
   ============================================================ */

/* ---------- Hero chips ---------- */
.chip-host { color: #2c6273; border-color: #d7e7ec; background: #f3f9fb; }
.chip-client { color: #46657a; border-color: #dce7ed; background: #f6fafc; }
.chip-server { color: #5d6b3a; border-color: #e2e8cf; background: #f9fbf1; }
.chip-code { color: #6a5a93; border-color: #e3ddf0; background: #f8f5fd; }
.chip-sandbox { color: #8a6420; border-color: #ecdfc2; background: #fdf8ec; }
.chip-auth { color: #8a4d3a; border-color: #eedbd4; background: #fdf5f2; }

/* ---------- Section shell ---------- */
.section-block {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(205, 216, 209, .7);
}

/* Give the MCP host slightly more room for its version pill. */
.root-node { width: min(410px, 100%); }

/* ---------- Topology ---------- */
.topology {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 108px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #dfe9ee;
  border-radius: 17px;
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(63, 109, 132, .06), transparent 58%),
    linear-gradient(180deg, #fff, #fbfdfd);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
.topo-host {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid #cfe2e9;
  border-radius: 13px;
  background: linear-gradient(155deg, #f7fcfd, #eef7fa);
}
.topo-label {
  display: block;
  color: #5d7f8b;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}
.topo-host > strong {
  display: block;
  margin-top: 3px;
  color: #274c5a;
  font-size: 15px;
  letter-spacing: -.02em;
}
.topo-host > p {
  margin: 3px 0 10px;
  color: #5b747d;
  font-size: 10px;
  line-height: 1.55;
}
.topo-clients {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.topo-client {
  padding: 6px 7px;
  border: 1px solid #d9e8ed;
  border-radius: 7px;
  color: #52707b;
  background: #fff;
  font-size: 8.5px;
  line-height: 1.4;
  text-align: center;
}
.topo-client b {
  display: block;
  color: #2e5a69;
  font-size: 9px;
  font-weight: 750;
}
.topo-link {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #7a929b;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .08em;
  text-align: center;
}
.topo-link b {
  color: #5c8b99;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}
.topo-servers {
  display: grid;
  gap: 6px;
}
.topo-server {
  padding: 8px 11px;
  border: 1px solid #e3ebd7;
  border-radius: 8px;
  color: #63704b;
  background: #fbfcf5;
  font-size: 9px;
  line-height: 1.4;
}
.topo-server b {
  margin-right: 6px;
  color: #4b5934;
  font-weight: 750;
}

/* ---------- Roles ---------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.role-card {
  --accent: #3f6d84;
  --accent-soft: #eef6f9;
  position: relative;
  min-width: 0;
  padding: 16px 16px 15px;
  overflow: hidden;
  border: 1px solid #e2ebe4;
  border-radius: 15px;
  background: linear-gradient(165deg, #fff, #f9fcfb);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.role-card::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 2px;
  border-radius: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: .55;
}
.role-card:hover,
.role-card:focus-visible {
  border-color: #cfe0d5;
  box-shadow: 0 12px 26px -18px rgba(21, 42, 38, .4);
  transform: translateY(-2px);
}
.role-client { --accent: #5a8b9c; --accent-soft: #f0f7f9; }
.role-server { --accent: #7d8a4e; --accent-soft: #f7f9ef; }
.role-kicker {
  display: block;
  color: #6a8075;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .16em;
}
.role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.role-head h3 {
  margin: 0;
  color: #2c433c;
  font-size: 17px;
  letter-spacing: -.02em;
}
.role-count {
  padding: 2px 7px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}
.role-card > p {
  margin: 7px 0 0;
  color: #5c6e67;
  font-size: 10.5px;
  line-height: 1.65;
}
.role-list {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.role-list li {
  position: relative;
  padding-left: 11px;
  color: #53665d;
  font-size: 9.5px;
  line-height: 1.55;
}
.role-list li::before {
  position: absolute;
  top: .6em;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  content: "";
  background: var(--accent);
  opacity: .6;
}
.role-list b {
  color: #35514a;
  font-weight: 720;
}

/* ---------- Protocol ---------- */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.mcp-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid #dfe9ee;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(63, 109, 132, .05), transparent 55%),
    linear-gradient(180deg, #fff, #fbfdfd);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.panel-tag {
  padding: 2px 7px;
  border-radius: 5px;
  color: #466b7a;
  background: #edf5f8;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.panel-head h3 {
  margin: 0;
  color: #2a4a55;
  font-size: 15px;
  letter-spacing: -.02em;
}
.mcp-panel > p {
  margin: 0;
  color: #5c6e67;
  font-size: 10.5px;
  line-height: 1.7;
}
.mcp-panel code,
.primitive-card code,
.check-card code {
  padding: 1px 5px;
  border: 1px solid #e3ebee;
  border-radius: 5px;
  color: #355b68;
  background: #f7fbfc;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}
.mcp-code {
  margin: 12px 0 0;
  padding: 13px 14px;
  overflow-x: auto;
  border: 1px solid #233b42;
  border-radius: 10px;
  color: #dcebf1;
  background: #14262c;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.75;
  scrollbar-width: thin;
}
.mcp-code .c { color: #8aa4ae; }
.mcp-code .k { color: #9fd8c3; }
.mcp-code .s { color: #e4c992; }
.panel-note {
  margin: 10px 0 0 !important;
  color: #6b7f78 !important;
  font-size: 9.5px !important;
  line-height: 1.6 !important;
}
.lifecycle-list {
  display: grid;
  gap: 6px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: lifecycle;
}
.lifecycle-list li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  align-items: baseline;
  gap: 9px;
  padding: 7px 9px 7px 29px;
  border: 1px solid #e4edf0;
  border-radius: 8px;
  background: #fbfdfd;
  counter-increment: lifecycle;
}
.lifecycle-list li::before {
  position: absolute;
  top: 50%;
  left: 9px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid #d3e3e9;
  border-radius: 50%;
  color: #6b8b95;
  background: #fff;
  content: counter(lifecycle);
  font-family: var(--font-mono);
  font-size: 7px;
  transform: translateY(-50%);
}
.lifecycle-list b {
  color: #2f5360;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.lifecycle-list span {
  color: #6b7d76;
  font-size: 9px;
  line-height: 1.5;
}
.transport-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}
.transport-chip {
  padding: 5px 8px;
  border: 1px solid #dce9ee;
  border-radius: 7px;
  color: #4b6670;
  background: #f7fbfc;
  font-size: 8.5px;
  line-height: 1.35;
}
.transport-chip b {
  color: #2f5663;
  font-family: var(--font-mono);
  font-weight: 700;
}
.transport-chip.is-legacy {
  color: #7a6a4e;
  border-color: #ece1cd;
  background: #fdf9f1;
}

/* ---------- Primitives ---------- */
.primitive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.primitive-card {
  min-width: 0;
  padding: 14px 14px 13px;
  border: 1px solid #e2ebe4;
  border-radius: 13px;
  background: linear-gradient(165deg, #fff, #f9fcfb);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.primitive-card:hover,
.primitive-card:focus-visible {
  border-color: #cfe0d5;
  box-shadow: 0 10px 24px -16px rgba(21, 42, 38, .38);
  transform: translateY(-2px);
}
.primitive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.primitive-index {
  color: #7c9188;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}
.dir-badge {
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.dir-server { color: #3f6d84; border: 1px solid #d9e7ed; background: #f2f8fa; }
.dir-client { color: #7a5c2f; border: 1px solid #ece0ca; background: #fdf9f1; }
.dir-ext { color: #6b5a9a; border: 1px solid #e3ddf0; background: #f8f5fd; }
.primitive-card h3 {
  margin: 7px 0 4px;
  color: #2d433d;
  font-size: 14px;
  letter-spacing: -.015em;
}
.primitive-card > p {
  margin: 0;
  color: #5c6e67;
  font-size: 10px;
  line-height: 1.62;
}
.primitive-meta {
  display: grid;
  gap: 3px;
  margin: 9px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid #eef2ef;
  list-style: none;
}
.primitive-meta li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
  color: #6a7c74;
  font-size: 8.5px;
  line-height: 1.5;
}
.primitive-meta b {
  color: #4a6259;
  font-weight: 720;
}
.primitive-footnote {
  margin: 11px 0 0;
  color: #6f8178;
  font-size: 9.5px;
  line-height: 1.6;
}
.primitive-footnote code {
  padding: 1px 5px;
  border: 1px solid #e4ebe6;
  border-radius: 5px;
  color: #35584b;
  background: #f8fbf8;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

/* ---------- Context budget ---------- */
.codemode-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}
.codemode-sequence span {
  padding: 4px 8px;
  border: 1px solid #dce9ee;
  border-radius: 6px;
  color: #4b6670;
  background: #f7fbfc;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.3;
}
.codemode-sequence b {
  color: #9aac9f;
  font-size: 10px;
  font-weight: 400;
}
.budget-card {
  padding: 17px 18px 16px;
  border: 1px solid #e2e8ec;
  border-radius: 16px;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(63, 109, 132, .06), transparent 60%),
    linear-gradient(180deg, #fff, #fbfdfd);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
.budget-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 14px;
}
.budget-row + .budget-row { margin-top: 13px; }
.budget-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.budget-label span {
  color: #6a8075;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .13em;
}
.budget-label strong {
  color: #2f4a42;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: -.005em;
}
.budget-value {
  color: #8a4d3a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.budget-value.is-low { color: #2c7a67; }
.budget-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2ef;
}
.budget-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c58a6c, #a85f45);
}
.budget-fill.is-full { width: 100%; }
.budget-fill.is-low {
  width: 8%;
  min-width: 34px;
  background: linear-gradient(90deg, #6cb8a1, #2c7a67);
}
.budget-foot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2ef;
}
.saving-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #cfe4d8;
  border-radius: 7px;
  color: #2c6b59;
  background: #f0f9f4;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}
.budget-foot p {
  margin: 0;
  color: #6a7c74;
  font-size: 9.5px;
  line-height: 1.55;
}

/* ---------- Code mode ---------- */
.codemode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 14px;
}
.cm-card {
  min-width: 0;
  padding: 14px 14px 13px;
  border: 1px solid #e2ebe4;
  border-radius: 13px;
  background: linear-gradient(165deg, #fff, #f9fcfb);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cm-card:hover,
.cm-card:focus-visible {
  border-color: #d5ddd5;
  box-shadow: 0 10px 24px -16px rgba(21, 42, 38, .38);
  transform: translateY(-2px);
}
.cm-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #dce9ee;
  border-radius: 6px;
  color: #4b7180;
  background: #f3f9fb;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
}
.cm-card h3 {
  margin: 8px 0 4px;
  color: #2d433d;
  font-size: 13.5px;
  letter-spacing: -.015em;
}
.cm-card > p {
  margin: 0;
  color: #5c6e67;
  font-size: 10px;
  line-height: 1.62;
}
.cm-card code,
.codemode-foot code {
  padding: 1px 5px;
  border: 1px solid #e4ebe6;
  border-radius: 5px;
  color: #35584b;
  background: #f8fbf8;
  font-family: var(--font-mono);
  font-size: 8.5px;
}
.cm-code {
  margin: 9px 0 0;
  padding: 9px 10px;
  overflow-x: auto;
  border: 1px solid #e6ece8;
  border-radius: 8px;
  color: #4a6058;
  background: #f8fbf9;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.65;
  scrollbar-width: thin;
  white-space: pre;
}
.cm-code .k { color: #3f7f6a; }
.cm-code .s { color: #8a6420; }
.cm-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.cm-facts span {
  padding: 4px 7px;
  border: 1px solid #dce9ee;
  border-radius: 6px;
  color: #4b6670;
  background: #f7fbfc;
  font-size: 8px;
  line-height: 1.35;
}
.cm-facts b {
  color: #274c5a;
  font-family: var(--font-mono);
  font-weight: 750;
}
.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.token-list span {
  padding: 4px 7px;
  border: 1px solid #ece1cd;
  border-radius: 6px;
  color: #7a6240;
  background: #fdf9f1;
  font-family: var(--font-mono);
  font-size: 8px;
}
.codemode-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #eee3d1;
  border-radius: 11px;
  background: #fdfaf4;
}
.codemode-foot p {
  margin: 0;
  color: #6a5c46;
  font-size: 9.5px;
  line-height: 1.6;
}
.codemode-foot b { color: #584a36; }
.codemode-foot a {
  color: #2f6b5c;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.codemode-foot a:hover { color: var(--green-deep); }
.codemode-links {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

/* ---------- Pipeline modifiers ---------- */
.pipeline-eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Failure matrix ---------- */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid #e0e9e2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 0 #fff inset;
  scrollbar-width: thin;
}
table.matrix {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 10.5px;
}
.matrix thead th {
  padding: 11px 13px;
  border-bottom: 1px solid #dde8e1;
  color: #4d675c;
  background: linear-gradient(180deg, #f7fbf8, #f1f7f3);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  text-align: left;
  white-space: nowrap;
}
.matrix tbody td {
  padding: 11px 13px;
  border-top: 1px solid #edf1ee;
  color: #54665e;
  line-height: 1.65;
  vertical-align: top;
}
.matrix tbody tr:first-child td { border-top: 0; }
.matrix tbody tr:hover { background: #fbfdfb; }
.matrix td strong {
  display: block;
  color: #2d433d;
  font-size: 11px;
  font-weight: 720;
}
.matrix td span.sub {
  display: block;
  margin-top: 2px;
  color: #7a8c83;
  font-size: 9px;
}
.matrix code {
  padding: 1px 5px;
  border: 1px solid #e4ebe6;
  border-radius: 5px;
  color: #35584b;
  background: #f8fbf8;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

/* ---------- Guardrails ---------- */
.mcp-guard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mcp-guard {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2ebe4;
  border-radius: 15px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(58, 141, 121, .05), transparent 55%),
    linear-gradient(180deg, #fff, #fbfdfb);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
.guard-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  color: #47685d;
  background: #edf5f0;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.mcp-guard h3 {
  margin: 9px 0 6px;
  color: #2d433d;
  font-size: 14px;
  letter-spacing: -.02em;
}
.guard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.guard-list li {
  position: relative;
  padding-left: 12px;
  color: #51645c;
  font-size: 10px;
  line-height: 1.6;
}
.guard-list li::before {
  position: absolute;
  top: .6em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  content: "";
  background: #7fa697;
}

/* ---------- Checklist ---------- */
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.check-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e2ebe4;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f8fbf8);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.check-card:hover,
.check-card:focus-visible {
  border-color: #cfe0d5;
  box-shadow: 0 10px 24px -16px rgba(21, 42, 38, .38);
  transform: translateY(-2px);
}
.check-no {
  color: #7c9188;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}
.check-card h3 {
  margin: 6px 0 4px;
  color: #2d433d;
  font-size: 11.5px;
  letter-spacing: -.01em;
}
.check-card p {
  margin: 0;
  color: #5c6e67;
  font-size: 9.5px;
  line-height: 1.6;
}

/* ---------- Anchor offset for sticky header ---------- */
h2[id] { scroll-margin-top: 92px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .primitive-grid,
  .codemode-grid,
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-eight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline-eight .pipeline-stage::after { content: none; }
}

@media (max-width: 960px) {
  .topology { grid-template-columns: 1fr; }
  .topo-link { grid-auto-flow: column; justify-content: center; align-items: center; gap: 8px; }
  .topo-link b { transform: rotate(90deg); }
  .protocol-grid { grid-template-columns: 1fr; }
  .role-grid,
  .mcp-guard-grid { grid-template-columns: 1fr; }
  .codemode-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 700px) {
  .topo-clients { grid-template-columns: 1fr; }
  .role-grid,
  .primitive-grid,
  .codemode-grid,
  .mcp-guard-grid,
  .check-grid { grid-template-columns: 1fr; }
  .pipeline-eight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-block { margin-top: 26px; padding-top: 22px; }
}

@media (max-width: 460px) {
  .pipeline-eight { grid-template-columns: 1fr; }
  .budget-row { grid-template-columns: 1fr; }
  .budget-value { justify-self: start; }
  .lifecycle-list li { grid-template-columns: 1fr; gap: 2px; }
}

/* ============================================================
   Collaboration surface (Skills / Tasks / Elicitation / Files)
   ============================================================ */

.chip-skills { color: #2c7a67; border-color: #d6e9e1; background: #f4faf7; }
.chip-tasks { color: #46657a; border-color: #dce7ed; background: #f6fafc; }
.chip-elicitation { color: #7a5c2f; border-color: #ece0ca; background: #fdf9f1; }
.chip-files { color: #5a6a80; border-color: #e1e8f0; background: #f5f8fc; }
.chip-apps { color: #6a5a93; border-color: #e3ddf0; background: #f8f5fd; }

.role-note {
  margin: 11px 0 0;
  color: #6a7c74;
  font-size: 9.5px;
  line-height: 1.65;
}

/* ---------- Capability stack ---------- */
.cap-stack { display: grid; gap: 8px; }
.cap-layer {
  --accent: #2c7a67;
  --accent-soft: #edf5f0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid #e2ebe4;
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, #f9fcf9);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cap-layer:hover,
.cap-layer:focus-visible {
  border-color: #cfe0d5;
  box-shadow: 0 12px 26px -18px rgba(21, 42, 38, .4);
  transform: translateY(-1px);
}
.cap-tools { --accent: #3f6d84; --accent-soft: #eef6f9; }
.cap-resources { --accent: #7d8a4e; --accent-soft: #f7f9ef; }
.cap-index {
  width: 30px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #4f6a60;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}
.cap-info { min-width: 0; }
.cap-kicker {
  display: block;
  color: #6a8075;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
}
.cap-info h3 {
  margin: 3px 0 4px;
  color: #283e38;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -.02em;
}
.cap-info h3 span {
  margin-left: 7px;
  color: #6b7f76;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.cap-info p {
  margin: 0;
  color: #5c6e67;
  font-size: 10.5px;
  line-height: 1.65;
}
.cap-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cap-tags li {
  padding: 4px 7px;
  border: 1px solid #e5ece7;
  border-radius: 6px;
  color: #4b6058;
  background: #fff;
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- Collaboration moves ---------- */
.collab-caption {
  margin: 12px 0 0;
  color: #667a70;
  font-size: 10.5px;
  line-height: 1.65;
}
.collab-caption b { color: #2f5147; font-weight: 720; }
.collab-caption.is-final {
  padding: 10px 12px;
  border: 1px solid #e5ece7;
  border-radius: 9px;
  background: #f9fcf9;
}
.move-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 12px;
}
.move-card {
  --accent: #2c7a67;
  --accent-soft: #edf5f0;
  position: relative;
  min-width: 0;
  padding: 15px 16px 14px;
  overflow: hidden;
  border: 1px solid #e2ebe4;
  border-radius: 15px;
  background:
    radial-gradient(120% 150% at 0% 0%, var(--accent-soft), transparent 58%),
    linear-gradient(180deg, #fff, #fbfdfb);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.move-card::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 2px;
  border-radius: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: .55;
}
.move-card:hover,
.move-card:focus-visible {
  border-color: #cfe0d5;
  box-shadow: 0 14px 30px -20px rgba(21, 42, 38, .4);
  transform: translateY(-2px);
}
.move-delegate { --accent: #3f6d84; --accent-soft: #eef6f9; }
.move-ask { --accent: #8a6420; --accent-soft: #fdf6e7; }
.move-exchange { --accent: #6b5a9a; --accent-soft: #f2eefb; }
.move-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.move-tag {
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.move-status {
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}
.move-status.is-beta { color: #7a5c2f; border: 1px solid #ece0ca; background: #fdf9f1; }
.move-status.is-ga { color: #2c6b59; border: 1px solid #cfe4d8; background: #f0f9f4; }
.move-status.is-roll { color: #5a6a80; border: 1px solid #e1e8f0; background: #f5f8fc; }
.move-card h3 {
  margin: 8px 0 5px;
  color: #2d433d;
  font-size: 14.5px;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.move-card h3 span {
  margin-left: 6px;
  color: #6b7f76;
  font-size: 10px;
  font-weight: 600;
}
.move-card > p {
  margin: 0;
  color: #5c6e67;
  font-size: 10.5px;
  line-height: 1.65;
}
.move-card .move-example {
  margin-top: 9px !important;
  padding-top: 8px;
  border-top: 1px solid #eef2ef;
  color: #72847b !important;
  font-size: 9px !important;
  line-height: 1.55 !important;
}

/* ---------- Platform extensions ---------- */
.platform-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.platform-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e2ebe4;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f8fbf8);
  box-shadow: 0 1px 0 #fff inset;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.platform-card:hover {
  border-color: #cfe0d5;
  box-shadow: 0 10px 24px -16px rgba(21, 42, 38, .38);
  transform: translateY(-2px);
}
.platform-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  color: #47685d;
  background: #edf5f0;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.platform-card h3 {
  margin: 7px 0 4px;
  color: #2d433d;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.platform-card p {
  margin: 0;
  color: #5c6e67;
  font-size: 9.5px;
  line-height: 1.6;
}

.collab-stat {
  margin: 9px 0 0;
  color: #72847b;
  font-size: 9px;
  line-height: 1.55;
}
.collab-stat b {
  color: #2f5147;
  font-family: var(--font-mono);
  font-weight: 750;
}
.collab-stat span { margin: 0 3px; color: #a3b6aa; }
.collab-sources {
  margin: 7px 0 0;
  color: #7a8c83;
  font-size: 8.5px;
  line-height: 1.6;
}
.collab-sources a {
  color: #2f6b5c;
  font-weight: 650;
  text-decoration: none;
}
.collab-sources a:hover { color: var(--green-deep); }

/* ---------- Context bridge ---------- */
.context-bridge {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.bridge-card {
  min-width: 0;
  padding: 14px 15px 13px;
  border: 1px solid #e2ebe4;
  border-radius: 13px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(63, 109, 132, .05), transparent 58%),
    linear-gradient(180deg, #fff, #fbfdfb);
  box-shadow: 0 1px 0 #fff inset;
}
.bridge-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  color: #466b7a;
  background: #edf5f8;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.bridge-card h3 {
  margin: 7px 0 4px;
  color: #2d433d;
  font-size: 13px;
  letter-spacing: -.015em;
}
.bridge-card p {
  margin: 0;
  color: #5c6e67;
  font-size: 10px;
  line-height: 1.6;
}
.bridge-card b {
  display: block;
  margin-top: 7px;
  color: #2f6b5c;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.02em;
}

@media (max-width: 960px) {
  .cap-layer { grid-template-columns: 42px minmax(0, 1fr); }
  .cap-tags { grid-column: 2; justify-content: flex-start; }
  .platform-strip { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .move-grid,
  .context-bridge { grid-template-columns: 1fr; }
  .cap-layer { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px 13px; }
  .cap-tags { grid-column: 1 / -1; }
}

@media (min-width: 1180px) {
  .primitive-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1081px) and (max-width: 1179px) {
  .primitive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.collab-status-note {
  margin: 8px 0 0;
  color: #7a8c83;
  font-size: 9px;
  line-height: 1.6;
}

/* ---------- Protocol mechanics / concept boundaries / orchestrator ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.detail-card {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #e2ebe4;
  border-radius: 13px;
  background: linear-gradient(160deg, #fff, #f8fbf8);
  box-shadow: 0 1px 0 #fff inset;
}
.detail-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  color: #4b7180;
  background: #edf5f8;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.detail-card h3 {
  margin: 7px 0 4px;
  color: #2d433d;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -.015em;
}
.detail-card p {
  margin: 0;
  color: #5c6e67;
  font-size: 10px;
  line-height: 1.65;
}
.detail-card code {
  padding: 1px 5px;
  border: 1px solid #e4ebe6;
  border-radius: 5px;
  color: #35584b;
  background: #f8fbf8;
  font-family: var(--font-mono);
  font-size: 8.5px;
}
.detail-card .detail-note {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #eef2ef;
  color: #72847b;
  font-size: 8.5px;
  line-height: 1.55;
}

.boundary-matrix { min-width: 880px; }
.boundary-note {
  margin: 11px 0 0;
  padding: 10px 12px;
  border: 1px solid #e5ece7;
  border-radius: 9px;
  color: #5c6e67;
  background: #f9fcf9;
  font-size: 10px;
  line-height: 1.65;
}
.boundary-note b { color: #2f5147; font-weight: 720; }
.boundary-note.is-muted {
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: #72847b;
  background: none;
  font-size: 9.5px;
}
.boundary-caption {
  margin: 12px 0 7px;
  color: #6a7c74;
  font-size: 9.5px;
  line-height: 1.6;
}
.dimension-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dimension-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #e5ece7;
  border-radius: 8px;
  color: #5c6e67;
  background: #fff;
  font-size: 9px;
  line-height: 1.4;
}
.dimension-pill b {
  color: #2f5147;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 750;
}

.orch-flow {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid #dfe9ee;
  border-radius: 17px;
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(63, 109, 132, .05), transparent 58%),
    linear-gradient(180deg, #fff, #fbfdfd);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
.orch-node {
  width: min(620px, 100%);
  padding: 13px 16px;
  border: 1px solid #e2ebe4;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.orch-user { border-color: #e3ebd7; background: #fbfcf5; }
.orch-main { border-color: #cfe2e9; background: #f7fcfd; }
.orch-protocol { border-color: #dce9ee; background: #f3f9fb; }
.orch-label {
  display: block;
  color: #6a8075;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .14em;
}
.orch-node strong {
  display: block;
  margin-top: 3px;
  color: #2d433d;
  font-size: 14px;
  letter-spacing: -.015em;
}
.orch-node p {
  margin: 3px 0 0;
  color: #5c6e67;
  font-size: 10px;
  line-height: 1.55;
}
.orch-arrow {
  color: #9aac9f;
  font-size: 14px;
  line-height: 1;
}
.orch-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}
.orch-pills span {
  padding: 4px 7px;
  border: 1px solid #dce9ee;
  border-radius: 6px;
  color: #4b6670;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.35;
}
.orch-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(760px, 100%);
}
.orch-service {
  padding: 11px 12px;
  border: 1px solid #e2ebe4;
  border-radius: 10px;
  background: #fff;
  text-align: center;
}
.orch-service strong {
  display: block;
  color: #2d433d;
  font-size: 11px;
  font-weight: 720;
}
.orch-service span {
  display: block;
  margin-top: 2px;
  color: #72847b;
  font-size: 8.5px;
  line-height: 1.4;
}
.orch-caption {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #e5ece7;
  border-radius: 9px;
  color: #5c6e67;
  background: #f9fcf9;
  font-size: 10px;
  line-height: 1.65;
}
.orch-caption b { color: #2f5147; font-weight: 720; }
.evolution-caption {
  margin: 14px 0 7px;
  color: #6a7c74;
  font-size: 9.5px;
  line-height: 1.6;
}
.evolution-caption span { color: #7a8c83; font-size: 8.5px; }
.evolution-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.evolution-track li {
  position: relative;
  min-width: 0;
  padding: 11px 11px 12px;
  border: 1px solid #e2ebe4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 0 #fff inset;
}
.evolution-track li::after {
  position: absolute;
  top: 50%;
  right: -7px;
  color: #a3b6aa;
  content: "¡ú";
  font-size: 10px;
  transform: translateY(-50%);
}
.evolution-track li:last-child::after { content: none; }
.evolution-track span {
  color: #7c9188;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
}
.evolution-track b {
  display: block;
  margin-top: 4px;
  color: #2f4a42;
  font-size: 10px;
  line-height: 1.4;
}
.evolution-track p {
  margin: 4px 0 0;
  color: #6a7c74;
  font-size: 9px;
  line-height: 1.5;
}
.implication-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #eee3d1;
  border-radius: 9px;
  color: #6a5c46;
  background: #fdfaf4;
  font-size: 9.5px;
  line-height: 1.6;
}
.implication-note b { color: #584a36; }

@media (max-width: 960px) {
  .evolution-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evolution-track li::after { content: none; }
}

@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
  .orch-services { grid-template-columns: 1fr; }
  .evolution-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .evolution-track { grid-template-columns: 1fr; }
}

.combo-case {
  margin-top: 14px;
  padding: 14px 15px;
  border: 1px solid #e2ebe4;
  border-radius: 13px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(44, 122, 103, .05), transparent 58%),
    linear-gradient(180deg, #fff, #fbfdfb);
  box-shadow: 0 1px 0 #fff inset;
}
.combo-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
}
.combo-tag {
  padding: 2px 7px;
  border-radius: 5px;
  color: #2c6b59;
  background: #edf5f0;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.combo-head strong {
  color: #2d433d;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -.01em;
}
.combo-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.combo-steps li {
  min-width: 0;
  padding: 9px 9px 10px;
  border: 1px solid #e5ece7;
  border-radius: 8px;
  background: #fff;
}
.combo-steps b {
  display: block;
  color: #2f5147;
  font-size: 9.5px;
  font-weight: 720;
}
.combo-steps span {
  display: block;
  margin-top: 3px;
  color: #6a7c74;
  font-size: 8.5px;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .combo-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .combo-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .combo-steps { grid-template-columns: 1fr; }
}

.detail-card .detail-note + .detail-note {
  margin-top: 5px;
  padding-top: 0;
  border-top: 0;
}
