/* ==========================================================
   Shared chapter components
   (used by foundations · prompting · advisors-day · advisory · action)
   ========================================================== */

/* ─── Orbital diagram (hero accent) ─── */
.orbit-wrap { width: 340px; height: 340px; position: relative; margin: 0 auto; }
.o-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 1.5px dashed var(--border); border-radius: 50%; }
.o-ring-1 { width: 210px; height: 210px; }
.o-ring-2 { width: 310px; height: 310px; }
.o-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 90px; height: 90px; background: var(--red); border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: white; box-shadow: var(--shadow-red); z-index: 2;
}
.o-center b { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.o-center small { font-size: 9px; opacity: .8; }
.o-node {
  position: absolute; width: 62px; height: 62px;
  background: white; border: 1.5px solid var(--border); border-radius: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: var(--shadow-md); transition: transform .3s var(--ease-spring), box-shadow .3s; z-index: 3;
}
.o-node:hover { box-shadow: var(--shadow-lg); }
.o-node svg { width: 18px; height: 18px; }
.o-node span { font-size: 9px; font-weight: 600; }

/* ─── Stack grid (3 click-to-expand cards) ─── */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 22px; cursor: pointer;
  transition: all .4s var(--ease-out); position: relative; overflow: hidden;
}
.stack-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-color, var(--red));
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.stack-card:hover, .stack-card.active {
  border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px);
}
.stack-card:hover::before, .stack-card.active::before { transform: scaleX(1); }
.sc-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.sc-icon svg { width: 20px; height: 20px; }
.stack-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 5px; }
.stack-card > p { font-size: 13px; color: var(--slate); line-height: 1.6; }
.sc-expand { max-height: 0; overflow: hidden; transition: max-height .5s var(--ease-out), opacity .3s; opacity: 0; }
.stack-card.active .sc-expand { max-height: 300px; opacity: 1; }
.sc-expand-inner {
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex; flex-wrap: wrap; gap: 5px;
}

/* Stack card with two stacked sub-sections (What it is + What it does) */
.sc-expand-block { width: 100%; margin-bottom: 14px; }
.sc-expand-block:last-child { margin-bottom: 0; }
.sc-expand-block-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--card-color, var(--red));
  letter-spacing: .2em; text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.sc-expand-block-label::before {
  content: ''; width: 12px; height: 2px;
  background: var(--card-color, var(--red)); border-radius: 1px;
}
.sc-expand-block p { font-size: 12.5px; color: var(--navy-soft); line-height: 1.55; }
.sc-expand-block-tags { display: flex; flex-wrap: wrap; gap: 5px; }

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

/* ─── Tabs ─── */
.tabs {
  display: flex; justify-content: center; gap: 3px; margin-bottom: 32px;
  background: var(--bg-alt); border-radius: 10px; padding: 3px;
  max-width: max-content; margin-left: auto; margin-right: auto;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 18px; font-family: var(--font-body);
  font-size: 13px; font-weight: 600; color: var(--slate);
  background: transparent; border: none; border-radius: 7px;
  cursor: pointer; transition: all .25s;
}
.tab-btn.active { background: white; color: var(--navy); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--navy); }
.tab-panel { display: none; animation: fadeUp .35s var(--ease-out); }
.tab-panel.active { display: block; }

.cap-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px; max-width: 860px; margin: 0 auto;
}
.cap-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; background: white; border: 1px solid var(--border);
  border-radius: var(--radius); transition: box-shadow .3s, border-color .3s;
}
.cap-item:hover { border-color: transparent; box-shadow: var(--shadow-md); }
.cap-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.cap-item span { font-size: 13px; font-weight: 500; color: var(--navy-soft); }

/* ─── Agents grid ─── */
.agents-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.agent-card {
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .35s var(--ease-out);
}
.agent-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.ac-hd { padding: 18px 20px 0; display: flex; align-items: center; gap: 10px; }
.ac-num {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: white; flex-shrink: 0;
}
.ac-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.ac-body { padding: 14px 20px 20px; }
.af { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 12px; }
.af-box { padding: 7px 10px; border-radius: 7px; font-size: 12px; font-weight: 500; }
.af-in { background: var(--bg-alt); border: 1px solid var(--border); color: var(--navy-soft); }
.af-arr { color: var(--muted); font-size: 15px; text-align: center; }
.af-out { background: var(--teal-light); border: 1px solid rgba(13,148,136,.15); color: #0f766e; }
.av {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--teal);
  padding: 7px 10px; background: rgba(13,148,136,.05); border-radius: 7px;
}
.av svg { width: 13px; height: 13px; }

/* ─── Value cards ─── */
.val-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 920px; margin: 0 auto; }
.val-card {
  text-align: center; padding: 24px 16px;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); transition: all .35s var(--ease-out);
}
.val-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.val-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.val-icon svg { width: 24px; height: 24px; }
.val-card h3 { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.val-card p { font-size: 12px; color: var(--slate); line-height: 1.5; }

@media (max-width: 880px) {
  .val-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Before / After comparison ─── */
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: stretch; max-width: 820px; margin: 0 auto; }
.cmp-col { padding: 24px 20px; border-radius: var(--radius-lg); }
.cmp-before { background: var(--bg-alt); border: 1.5px solid var(--border); }
.cmp-after { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); border: 1.5px solid rgba(13,148,136,.15); }
.cmp-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.cmp-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.cmp-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--navy-soft); font-weight: 500; }
.cmp-list li svg { width: 15px; height: 15px; flex-shrink: 0; }
.cmp-div { display: flex; align-items: center; justify-content: center; }
.cmp-arrow {
  width: 40px; height: 40px; background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: white; box-shadow: var(--shadow-red);
}
.cmp-arrow svg { width: 20px; height: 20px; }

@media (max-width: 720px) {
  .cmp { grid-template-columns: 1fr; }
  .cmp-arrow { transform: rotate(90deg); }
}

/* ─── Steps track ─── */
.steps { display: flex; align-items: flex-start; max-width: 920px; margin: 0 auto; }
.stp { flex: 1; text-align: center; position: relative; padding: 0 10px; }
.stp-conn {
  position: absolute; top: 24px;
  left: calc(50% + 24px); right: calc(-50% + 24px);
  height: 3px; background: var(--border); z-index: 0;
}
.stp-fill { height: 100%; width: 0; background: var(--red); border-radius: 2px; transition: width .8s var(--ease-out); }
.stp.reached .stp-conn .stp-fill { width: 100%; }
.stp-circle {
  width: 48px; height: 48px; border-radius: 50%; background: white;
  border: 2.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--muted);
  position: relative; z-index: 1;
  transition: all .4s var(--ease-out); cursor: pointer;
}
.stp.reached .stp-circle, .stp:hover .stp-circle {
  background: var(--red); border-color: var(--red); color: white; box-shadow: var(--shadow-red);
}
.stp h4 { font-family: var(--font-display); font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.stp p { font-size: 12px; color: var(--slate); line-height: 1.4; }

@media (max-width: 720px) {
  .steps { flex-direction: column; gap: 24px; }
  .stp-conn { display: none; }
}

/* ─── Rule cards (left-bordered) ─── */
.rules-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; max-width: 920px; margin: 0 auto;
}
.rule-card {
  background: white; border: 1.5px solid var(--border);
  border-left: 4px solid var(--rule-color, var(--red));
  border-radius: var(--radius); padding: 20px;
  transition: box-shadow .3s, transform .3s;
}
.rule-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.rule-ico {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--rule-bg, var(--red-light));
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
  color: var(--rule-color, var(--red));
}
.rule-ico svg { width: 15px; height: 15px; }
.rule-card h3 { font-family: var(--font-display); font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.rule-card p { font-size: 12px; color: var(--slate); line-height: 1.5; }

/* ─── Terminal-style block (prompting hero accent) ─── */
.tv-block {
  background: var(--navy); border-radius: var(--radius-xl); padding: 28px;
  color: white; font-family: var(--font-mono); font-size: 12px; line-height: 1.9;
  box-shadow: var(--shadow-xl); position: relative; overflow: hidden;
  max-width: 420px; margin: 0 auto;
}
.tv-block::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(230,30,40,.12) 0%, transparent 70%);
  pointer-events: none;
}
.tv-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.tv-dots span { width: 10px; height: 10px; border-radius: 50%; }
.tv-line { margin-bottom: 3px; }
.tv-label { color: var(--red); font-weight: 600; }
.tv-val { color: rgba(255,255,255,.65); }

/* ─── 5-part template grid ─── */
.tp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; max-width: 960px; margin: 0 auto; }
.tp-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 16px; text-align: center;
  transition: all .35s var(--ease-out); position: relative; overflow: hidden;
}
.tp-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--tp-color);
}
.tp-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tp-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: white;
}
.tp-card h3 { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.tp-card p { font-size: 11px; color: var(--slate); line-height: 1.5; }

@media (max-width: 880px) { .tp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tp-grid { grid-template-columns: 1fr; } }

/* ─── Weak / Strong example cards ─── */
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 920px; margin: 0 auto; }
.ex-card {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1.5px solid var(--border); transition: box-shadow .3s; background: white;
}
.ex-card:hover { box-shadow: var(--shadow-lg); }
.ex-hd {
  padding: 14px 18px; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.ex-hd.weak { background: #fef2f2; color: #dc2626; border-bottom: 1px solid #fecaca; }
.ex-hd.strong { background: #f0fdf4; color: #16a34a; border-bottom: 1px solid #bbf7d0; }
.ex-hd svg { width: 16px; height: 16px; }
.ex-body {
  padding: 18px; font-family: var(--font-mono); font-size: 12px;
  line-height: 1.7; color: var(--navy-soft); white-space: pre-wrap;
}
.ex-why {
  padding: 12px 18px; border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--slate); line-height: 1.5;
}
.ex-why strong { color: var(--navy); }

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

/* ─── Live scorer ─── */
.scorer {
  max-width: 660px; margin: 0 auto;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg);
}
.scorer textarea {
  width: 100%; min-height: 140px; padding: 22px;
  border: none; outline: none;
  font-family: var(--font-body); font-size: 14px; line-height: 1.7;
  color: var(--navy); resize: vertical; background: transparent;
}
.scorer textarea::placeholder { color: var(--muted); }
.scorer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-top: 1px solid var(--border-light); background: var(--bg-alt);
}
.scorer-btn {
  padding: 9px 22px; background: var(--red); color: white;
  border: none; border-radius: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all .25s;
}
.scorer-btn:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: var(--shadow-red); }
.scorer-hint { font-size: 12px; color: var(--muted); }
.scorer-result { display: none; padding: 18px 22px; border-top: 1px solid var(--border-light); }
.scorer-result.show { display: block; animation: fadeUp .35s var(--ease-out); }
.sc-meter { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sc-ring {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  color: white; flex-shrink: 0;
}
.sc-label { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.sc-sublabel { font-size: 12px; color: var(--slate); margin-top: 1px; }
.sc-checks { display: flex; flex-direction: column; gap: 6px; }
.sc-chk { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.sc-chk svg { width: 16px; height: 16px; flex-shrink: 0; }
.sc-chk.pass { color: #16a34a; }
.sc-chk.fail { color: #dc2626; }
.sc-chk-note { color: var(--slate); font-weight: 400; margin-left: 4px; }

/* ─── Domain packs (tabbed dark terminal) ─── */
.dom-tabs {
  display: flex; justify-content: center; gap: 5px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.dom-panel { display: none; animation: fadeUp .35s var(--ease-out); }
.dom-panel.active { display: block; }
.dom-ex {
  max-width: 720px; margin: 0 auto;
  background: var(--navy); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-xl); position: relative;
}
.dom-ex-hd {
  padding: 14px 22px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: white; display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
}
.dom-ex-hd-l { display: flex; align-items: center; gap: 8px; }
.dom-ex-hd .dot { width: 7px; height: 7px; border-radius: 50%; }
.dom-ex-body {
  padding: 22px; font-family: var(--font-mono); font-size: 12.5px;
  line-height: 1.85; color: rgba(255,255,255,.78); white-space: pre-wrap;
}
.dom-ex-body .role { color: #f87171; font-weight: 600; }
.dom-ex-body .ctx { color: #60a5fa; font-weight: 600; }
.dom-ex-body .task { color: #5eead4; font-weight: 600; }
.dom-ex-body .fmt { color: #fbbf24; font-weight: 600; }
.dom-ex-body .gd { color: #c4b5fd; font-weight: 600; }

.dom-copy {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: white; padding: 5px 12px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 5px;
}
.dom-copy:hover { background: rgba(255,255,255,.15); }
.dom-copy.copied { background: rgba(13,148,136,.4); border-color: rgba(13,148,136,.6); }
.dom-copy svg { width: 12px; height: 12px; }

/* Domain tab pills (re-styles f-btn for prompting use) */
.dom-tabs .f-btn {
  padding: 6px 16px; font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border); background: white; color: var(--slate);
  border-radius: 100px; cursor: pointer; transition: all .25s;
}
.dom-tabs .f-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.dom-tabs .f-btn:hover:not(.active) { border-color: var(--navy-soft); color: var(--navy); }

/* ─── Tips grid ─── */
.tips-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; max-width: 920px; margin: 0 auto;
}
.tip-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: all .3s var(--ease-out);
}
.tip-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tip-card h3 {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.tip-card h3 .emoji { font-size: 16px; }
.tip-card p { font-size: 12px; color: var(--slate); line-height: 1.5; }

/* ─── Prompt Coach CTA (dark) ─── */
.coach-cta {
  max-width: 660px; margin: 0 auto;
  background: linear-gradient(135deg, var(--navy) 0%, #1a2744 100%);
  border-radius: var(--radius-xl); padding: 36px;
  text-align: center; color: white; position: relative; overflow: hidden;
}
.coach-cta::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(230,30,40,.18) 0%, transparent 60%);
  pointer-events: none;
}
.coach-cta h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  margin-bottom: 8px; position: relative;
}
.coach-cta p {
  font-size: 13px; color: rgba(255,255,255,.7);
  margin: 0 auto 22px; max-width: 380px; position: relative;
}
.coach-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 26px; background: var(--red); color: white;
  border: none; border-radius: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all .25s; position: relative;
}
.coach-btn:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: var(--shadow-red); }
.coach-btn svg { width: 16px; height: 16px; }

/* ─── Where-to-go-next strip (shared) ─── */
.next-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; max-width: 1000px; margin: 0 auto;
}
.next-card {
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 20px;
  transition: all .35s var(--ease-out); color: var(--navy);
  display: flex; flex-direction: column;
}
.next-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.next-card h3 {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 6px; color: var(--next-color, var(--red));
}
.next-card p { font-size: 12px; color: var(--slate); line-height: 1.55; flex: 1; margin-bottom: 12px; }
.next-cta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--next-color, var(--red));
}
.next-cta svg { width: 13px; height: 13px; transition: transform .3s var(--ease-spring); }
.next-card:hover .next-cta svg { transform: translateX(3px); }

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


/* ==========================================================
   Playbook navigation layer
   - Skip-to-content
   - Breadcrumbs (sub-pages)
   - Chapter meta (reading time + last reviewed)
   - TOC sidebar (auto-injected by playbook-nav.js)
   - Prev / Next chapter footer
   ========================================================== */

/* ─── Skip-to-content (visible on focus only) ─── */
.skip-link {
  position: absolute;
  top: -50px;
  left: 12px;
  z-index: 1000;
  background: var(--red);
  color: white;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: -4px;
}

/* ─── Breadcrumbs ─── */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--slate);
  padding: 3px 8px;
  border-radius: 4px;
  transition: all .2s;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--red);
  background: var(--bg-alt);
}
.breadcrumb .breadcrumb-sep {
  color: var(--muted);
  font-weight: 400;
  opacity: .6;
}
.breadcrumb .breadcrumb-current {
  color: var(--navy);
  font-weight: 600;
  padding: 3px 8px;
}
/* Hide the legacy back-link when a breadcrumb is present */
.sub-hero:has(.breadcrumb) .sub-back { display: none; }

/* ─── Chapter meta (reading time + last reviewed) ─── */
.chapter-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 0;
  padding: 8px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  font-weight: 500;
}
.chapter-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chapter-meta-item svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.chapter-meta-divider {
  width: 3px;
  height: 3px;
  background: var(--muted);
  border-radius: 50%;
  opacity: .5;
}

/* "Updated since your last visit" badge */
.chapter-meta-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 5px 11px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: #15803d;
}
.chapter-meta-updated svg {
  width: 11px;
  height: 11px;
  color: #16a34a;
  flex-shrink: 0;
}

/* ─── TOC sidebar (right rail, fixed) ─── */
.toc-sidebar {
  position: fixed;
  top: 90px;
  right: max(20px, calc((100vw - 1248px) / 2));
  width: 220px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  z-index: 50;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  scrollbar-width: thin;
}
@media (prefers-reduced-transparency: reduce) {
  .toc-sidebar { backdrop-filter: none; background: #fbfbfc; }
}
.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.toc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.toc-item {
  display: block;
  padding: 7px 10px 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all .2s var(--ease-out);
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
}
.toc-item:hover {
  color: var(--navy);
  background: var(--bg-alt);
  border-left-color: var(--border);
}
.toc-item.active {
  color: var(--red);
  font-weight: 700;
  border-left-color: var(--red);
  background: var(--red-light);
}

@media (max-width: 1280px) {
  .toc-sidebar { display: none; }
}

/* ─── Prev / Next chapter footer ─── */
.chapter-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chapter-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--navy);
  transition: all .3s var(--ease-out);
  min-height: 76px;
}
.chapter-nav-card:hover:not(.chapter-nav-empty) {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.chapter-nav-empty {
  background: transparent;
  border: 1px dashed var(--border-light);
  pointer-events: none;
}
.chapter-nav-prev { text-align: left; }
.chapter-nav-next {
  text-align: right;
  flex-direction: row-reverse;
}
.chapter-nav-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .3s var(--ease-spring);
  color: var(--slate);
}
.chapter-nav-card:hover .chapter-nav-arrow {
  background: var(--red);
  color: white;
}
.chapter-nav-arrow svg { width: 16px; height: 16px; }
.chapter-nav-card:hover .chapter-nav-prev .chapter-nav-arrow { transform: translateX(-3px); }
.chapter-nav-card:hover .chapter-nav-next .chapter-nav-arrow { transform: translateX(3px); }
.chapter-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chapter-nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
  font-weight: 600;
}
.chapter-nav-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
}

@media (max-width: 720px) {
  .chapter-nav { grid-template-columns: 1fr; padding-top: 36px; }
  .chapter-nav-empty { display: none; }
}

/* ─── Print: hide nav, TOC, chapter-nav, footer ─── */
@media print {
  .nav, .toc-sidebar, .chapter-nav, .skip-link, .footer, .section-permalink { display: none !important; }
  body { background: white !important; }
  .closing { background: white !important; color: black !important; }
  .closing h2, .cl-formula { color: black !important; }
  section { page-break-inside: avoid; }
}


/* ==========================================================
   Unified callout system
   - .callout + variant: note · tip · warning · decision · governance
   - Optional .callout-title
   - Use as <aside class="callout callout-warning">…</aside>
   ========================================================== */

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--callout-bg, var(--bg-alt));
  border-left: 3px solid var(--callout-color, var(--slate));
  border-radius: 0 10px 10px 0;
  margin: 24px auto;
  max-width: 820px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--navy-soft);
}
.callout-icon {
  flex-shrink: 0;
  color: var(--callout-color, var(--slate));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.callout-icon svg { width: 18px; height: 18px; }
.callout-body { flex: 1; min-width: 0; }
.callout-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: 0;
}
.callout-body p { margin: 0; }
.callout-body p + p { margin-top: 8px; }
.callout-body strong { color: var(--navy); font-weight: 600; }

.callout-note      { --callout-color: #3b82f6; --callout-bg: #eff6ff; }
.callout-tip       { --callout-color: #0d9488; --callout-bg: #ccfbf1; }
.callout-warning   { --callout-color: #f59e0b; --callout-bg: #fffbeb; }
.callout-decision  { --callout-color: #E61E28; --callout-bg: var(--red-light); }
.callout-governance{ --callout-color: #7c3aed; --callout-bg: #f5f3ff; }


/* ==========================================================
   Section permalinks (auto-injected by playbook-nav.js)
   ========================================================== */

.sec-title { position: relative; }
.section-permalink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 10px;
  border-radius: 50%;
  color: var(--muted);
  opacity: 0;
  transition: opacity .2s var(--ease-out), color .2s, background .2s;
  vertical-align: middle;
  text-decoration: none;
}
.section-permalink:focus-visible {
  opacity: 1;
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.sec-title:hover .section-permalink { opacity: 1; }
.section-permalink:hover {
  color: var(--red);
  background: var(--bg-alt);
}
.section-permalink svg { width: 14px; height: 14px; }
.section-permalink.copied {
  opacity: 1;
  color: #16a34a;
  background: #f0fdf4;
}
@media (max-width: 720px) {
  /* Hover doesn't apply on touch; hide to avoid clutter */
  .section-permalink { display: none; }
}


/* ==========================================================
   Inline code — consistent monospace pill
   ========================================================== */

.container code,
.callout code,
.sub-hero code,
section.sec code,
.closing code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: 1px 7px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--navy);
  white-space: nowrap;
}
/* Don't double-style code inside the dark closing band */
.closing code {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: white;
}

@media (prefers-reduced-motion: reduce) {
  .o-node,
  .cap-item,
  .stp-circle,
  .ex-card,
  .dom-copy,
  .dom-tabs .f-btn,
  .breadcrumb a,
  .toc-item,
  .section-permalink,
  .skip-link,
  .stp-fill,
  .sc-expand,
  .tab-btn { transition: none !important; }
  .stack-card,
  .stack-card:hover,
  .stack-card.active,
  .stack-card::before,
  .stack-card:hover::before,
  .stack-card.active::before,
  .agent-card,
  .agent-card:hover,
  .val-card,
  .val-card:hover,
  .rule-card,
  .rule-card:hover,
  .tp-card,
  .tp-card:hover,
  .scorer-btn,
  .scorer-btn:hover,
  .tip-card,
  .tip-card:hover,
  .coach-btn,
  .coach-btn:hover,
  .next-card,
  .next-card:hover,
  .next-cta svg,
  .next-card:hover .next-cta svg,
  .chapter-nav-card,
  .chapter-nav-card:hover:not(.chapter-nav-empty),
  .chapter-nav-arrow,
  .chapter-nav-card:hover .chapter-nav-prev .chapter-nav-arrow,
  .chapter-nav-card:hover .chapter-nav-next .chapter-nav-arrow { transition: none !important; transform: none !important; }
  .tab-panel,
  .scorer-result.show,
  .dom-panel { animation: none; }
}
