/* ── Design tokens ─────────────────────────────────────────────── */

:root {
  --navy:   #0A2540;
  --slate:  #3C4A5E;
  --accent: #B7372C;
  --amber:  #C68A24;
  --green:  #2F6B4F;
  --orange: #C65124;

  --bg:         #F0F2F5;
  --card-bg:    #FFFFFF;
  --border:     #E2E7ED;
  --text-dim:   #9AA5B4;

  --radius: 8px;
  --shadow: 0 1px 4px rgba(10,37,64,.07), 0 1px 2px rgba(10,37,64,.04);
  --gap: 16px;
  --max-w: 800px;
}

/* ── Reset ─────────────────────────────────────────────────────── */

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

/* Ensure [hidden] always wins over component display rules */
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────── */

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}

.title-line-1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.title-line-2 {
  font-size: 1.36rem;
  font-weight: 700;
  color: #E89342;
  margin: 2px 0 0;
  letter-spacing: 0.02em;
}

.snapshot-date-block {
  margin-top: 10px;
}

.snapshot-date-label {
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0;
}

.snapshot-date-value {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 2px 0 0;
}

.refresh-hint {
  font-size: 0.72rem;
  opacity: 0.65;
  margin-top: 3px;
  letter-spacing: 0.01em;
}

/* ── Intro band ────────────────────────────────────────────────── */

.intro-band {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.intro-band__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px;
  font-size: 0.82rem;
  color: var(--slate);
}

.playbook-link {
  color: var(--navy);
  text-decoration: underline;
}

.playbook-link:hover {
  opacity: 0.8;
}

/* ── Playbook page ─────────────────────────────────────────────── */

.playbook-main {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 16px;
}

.playbook-body {
  margin-top: 8px;
  line-height: 1.6;
  color: var(--slate);
  font-size: 0.9rem;
}

.playbook-back-link {
  color: var(--navy);
  font-size: 0.88rem;
}

.playbook-back-wrap {
  margin-top: 16px;
}

/* ── Main layout ───────────────────────────────────────────────── */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.site-footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--slate);
  font-size: 0.72rem;
}

/* ── Card ──────────────────────────────────────────────────────── */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
}

.card-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--slate);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--slate);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── out-of label (Tier Scores heading) ────────────────────────── */

.out-of {
  font-weight: normal;
  font-size: 0.72rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-dim);
}

/* ── Score band hint ───────────────────────────────────────────── */

.score-band-hint {
  font-size: 0.75rem;
  color: var(--slate);
  margin-top: 8px;
  text-align: center;
}

/* ── Composite score ───────────────────────────────────────────── */

#composite-posture-section {
  text-align: center;
}

.composite-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 22px;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.composite-score-num {
  /* inherits all styles from .composite-value */
}

.composite-score-denom {
  font-size: 55%;
  font-weight: 800;
  color: #fff;
  -webkit-text-stroke: 1px #0A2540;
  letter-spacing: normal;
}

/* ── Delta indicators ──────────────────────────────────────────── */

.tier-delta {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  white-space: nowrap;
}

.snapshot-count-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Composite + Posture merged gauge ──────────────────────────── */

.composite-posture-gauge {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 12px;
}

.composite-posture-gauge svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ── Posture ───────────────────────────────────────────────────── */

.coverage-text {
  font-size: 0.82rem;
  color: var(--slate);
}

.composite-weights-formula {
  font-size: 0.72rem;
  color: var(--slate);
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.trend-subtitle {
  font-size: 0.75rem;
  color: var(--slate);
  margin: -6px 0 6px 0;
  letter-spacing: 0.01em;
}

/* ── Posture description ───────────────────────────────────────── */

.posture-description {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.posture-summary-text {
  font-size: 0.84rem;
  color: var(--navy);
  line-height: 1.55;
  margin-bottom: 8px;
}

.posture-playbook-link {
  font-size: 0.78rem;
  margin-top: 6px;
}

/* ── Posture legend ───────────────────────────────────────────── */

.posture-legend {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.posture-legend__slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.posture-legend__box {
  flex-grow: 1;
  padding: 10px 12px;
  border-radius: 6px;
  color: #fff;
  text-align: left;
}

.posture-legend__name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.posture-legend__state {
  font-size: 0.625rem;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.3;
}

.posture-legend__body {
  font-size: 0.65rem;
  line-height: 1.4;
  margin-top: 8px;
}

.posture-legend__line {
  display: block;
}

.posture-legend__bar {
  height: 4px;
  border-radius: 6px;
  margin-top: 7px;
}

/* Mobile: 2+2+1 layout */
@media (max-width: 599px) {
  .posture-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .posture-legend__slot:last-child {
    grid-column: 1 / -1;
    width: 50%;
    margin: 0 auto;
  }
}

/* ── Derivation arrow (posture → allocation connector) ─────────── */

.derivation-arrow {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 4px 0;
  letter-spacing: 0.04em;
}

/* ── Allocation table ──────────────────────────────────────────── */

.posture-allocation {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.alloc-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.alloc-posture-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.alloc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.alloc-table th {
  padding: 4px 6px;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.alloc-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.alloc-table tr:last-child td {
  border-bottom: none;
}

.alloc-layer {
  color: var(--navy);
  text-align: right;
}

.alloc-range {
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

/* Range bar column */
.alloc-table .alloc-th-layer { text-align: right; }
.alloc-th-bar   { width: 28%; text-align: left; }

.alloc-bar-cell { width: 28%; padding: 7px 8px; vertical-align: middle; }

.alloc-bar-track {
  position: relative;
  height: 12px;
  background: #E2E7ED;
  border-radius: 2px;
  overflow: hidden;
}
.alloc-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
}

/* Responsive bar widths */
@media (max-width: 767px) {
  .alloc-th-bar, .alloc-bar-cell { width: 22%; min-width: 100px; }
}
@media (max-width: 479px) {
  .alloc-th-bar, .alloc-bar-cell { width: 18%; min-width: 64px; }
}
@media (max-width: 374px) {
  .alloc-th-bar, .alloc-bar-cell { display: none; }
}

/* ── Tier rows ─────────────────────────────────────────────────── */

.tier-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.tier-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tier-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  --tier-indent: 38px;
}

.tier-desc {
  font-size: 0.75rem;
  color: var(--slate);
  line-height: 1.4;
  margin-top: 6px;
  margin-bottom: 0;
  margin-left: var(--tier-indent);
}

/* Mobile: tier description hidden by default, shown on expand */
@media (max-width: 480px) {
  .tier-desc {
    display: none;
  }

  .tier-row--expanded .tier-desc {
    display: block;
  }

  .tier-header-row {
    cursor: pointer;
    min-height: 44px; /* touch target */
  }
}

.tier-tag {
  flex: 0 0 28px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tier-full-name {
  flex: 1 1 auto;
  font-size: 0.8rem;
  color: var(--navy);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-bar-wrap {
  flex: 0 0 72px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.tier-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.tier-score {
  flex: 0 0 28px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Metric groups ─────────────────────────────────────────────── */

.metric-group {
  border-bottom: 1px solid var(--border);
}

.metric-group:last-child {
  border-bottom: none;
}

.metric-group summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--slate);
  text-transform: uppercase;
  list-style: none;
  user-select: none;
  min-height: 44px;
}

.metric-group summary::-webkit-details-marker { display: none; }

.metric-group summary::before {
  content: '▶';
  font-size: 0.55rem;
  color: var(--text-dim);
  transition: transform 0.18s;
  flex-shrink: 0;
}

.metric-group[open] summary::before {
  transform: rotate(90deg);
}

/* ── Metric table ──────────────────────────────────────────────── */

.metric-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.metric-table th {
  padding: 5px 6px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

/* First header (Metric) centred; content left via td.metric-name */
.metric-table th:first-child { text-align: center; }

.metric-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.metric-table tr:last-child td {
  border-bottom: none;
}

.metric-table td:nth-child(n+2) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.metric-name {
  color: var(--navy);
  line-height: 1.3;
}

.score-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  min-width: 30px;
  text-align: center;
}

.age-text {
  font-size: 0.72rem;
  color: var(--slate);
  white-space: nowrap;
}

.age-stale {
  color: var(--accent);
}

/* ── Loading ───────────────────────────────────────────────────── */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 16px;
  text-align: center;
  color: var(--slate);
  font-size: 0.88rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ─────────────────────────────────────────────────────── */

.error-box {
  max-width: 480px;
  margin: 40px auto;
  padding: 28px 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--accent);
  font-size: 0.9rem;
}

.error-box button {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 28px;
  min-height: 44px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.error-box button:hover {
  background: #0e3060;
}

/* ── Responsive — tablet / desktop ────────────────────────────── */

@media (min-width: 600px) {
  main {
    padding: 24px 32px;
    gap: 20px;
  }

  .card {
    padding: 24px;
  }

  .site-header {
    padding: 20px 32px 16px;
  }

  .composite-value {
    font-size: 2.75rem;
  }

  .tier-bar-wrap {
    flex: 0 0 140px;
  }

  .tier-full-name {
    white-space: normal;
  }

  .tier-score {
    flex: 0 0 36px;
  }
}

@media (min-width: 800px) {
  .card {
    padding: 28px 28px;
  }

  .composite-value {
    font-size: 3rem;
  }
}

/* ── Trend charts ──────────────────────────────────────────────── */

#trend-section {
  position: relative;
  overflow: visible;
}

.chart-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.trend-chart {
  display: block;
  width: 100%;
  height: auto;
}

.trend-buildup-caption {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.4;
}

.trend-buildup {
  margin-bottom: 12px;
}

.trend-buildup-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.trend-buildup-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.t4-footnote {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: right;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
  margin-left: 50px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chart-tooltip {
  position: absolute;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--navy);
}

/* ── Narrow phones: compact metric table ───────────────────────── */

@media (max-width: 380px) {
  .metric-table .col-value,
  .metric-table th.col-value,
  .metric-table .col-delta,
  .metric-table th.col-delta {
    display: none;
  }
}

/* ── Metric tooltip ────────────────────────────────────────────── */

.metric-name--tip {
  cursor: help;
  text-decoration: underline dotted var(--text-dim);
}

.metric-tooltip {
  position: fixed;
  max-width: 280px;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 1000;
  pointer-events: none;
}

.mtt-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.mtt-source, .mtt-cadence { color: var(--text-dim); font-size: 0.68rem; }

.mtt-band { margin-top: 4px; }

.mtt-why {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-style: italic;
  color: #C8D0DB;
}

/* ── Score chip ────────────────────────────────────────────────── */

.score-chip--clickable {
  cursor: pointer;
}

.score-chip--clickable:hover {
  filter: brightness(1.15);
}

/* ── Score popup ───────────────────────────────────────────────── */

.score-popup {
  position: fixed;
  max-width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
  font-size: 0.78rem;
}

.score-popup-msg {
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 8px;
}

.score-popup-close {
  display: block;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
}

/* ── Value column (right-aligned) ──────────────────────────────── */

.metric-table .col-value { text-align: right; }

/* ── Tier info button (ⓘ in metric-group summary) ──────────────── */

.tier-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0 0 0 6px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: help;
  line-height: 1;
  vertical-align: middle;
}

.tier-info-btn:hover {
  color: var(--navy);
}

/* ── Cadence column ────────────────────────────────────────────── */

.col-cadence {
  text-align: center;
  font-size: 0.72rem;
  color: var(--slate);
  white-space: nowrap;
}

/* ── Score column (centred) ─────────────────────────────────────── */

.metric-table .col-score { text-align: center; }

/* ── Delta column ──────────────────────────────────────────────── */

.col-delta {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Age column ─────────────────────────────────────────────────── */

.metric-table .col-age { text-align: center; }

/* ── Age warn ──────────────────────────────────────────────────── */

.age-warn {
  color: var(--amber);
}

/* ── Narrow mobile: hide cadence column ────────────────────────── */

@media (max-width: 480px) {
  .metric-table .col-cadence {
    display: none;
  }
}

/* ── Fetch age indicator ────────────────────────────────────────── */

.fetch-age-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.fetch-age-text--failed {
  color: var(--amber);
}

/* ── §7.4 Deployment plan section ──────────────────────────────── */

.card--alert {
  border: 2px solid var(--accent);
}

.card-title--alert {
  color: var(--accent);
}

.deploy-plan-desc {
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.5;
  margin-bottom: 12px;
}

.deploy-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.deploy-plan-table th {
  padding: 4px 6px;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.deploy-plan-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.deploy-plan-table tr:last-child td {
  border-bottom: none;
}

.deploy-drawdown {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deploy-action {
  color: var(--slate);
}

/* ── Tier gauge layout ──────────────────────────────────────────── */

#tier-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-gauge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.tier-gauge-wrap {
  flex: 1 1 140px;
  max-width: 180px;
  text-align: center;
}

.tier-gauge-svg {
  display: block;
  width: 100%;
  height: auto;
}

.tier-gauge-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 2px;
  line-height: 1.2;
}

.tier-gauge-comment {
  font-size: 0.65rem;
  color: var(--slate);
  line-height: 1.3;
  margin-top: 3px;
  user-select: text;
}

.tier-gauge-comment--dim {
  color: var(--text-dim);
}

/* Tier legend */
.tier-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 0.68rem;
  color: #3C4A5E;
}
.tier-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Mobile: stack gauges vertically, full width */
@media (max-width: 480px) {
  .tier-gauge-row {
    flex-direction: column;
    align-items: center;
  }
  .tier-gauge-wrap {
    width: 100%;
    max-width: 240px;
  }
}

/* ── Playbook page ─────────────────────────────────────────────── */

.playbook-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap);
}

/* Framework intro collapsible */
.playbook-intro-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--navy);
}

.playbook-intro-toggle .card-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.playbook-intro-chevron {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.playbook-intro-chevron--open { transform: rotate(180deg); }

.playbook-intro-body {
  margin-top: 12px;
}

.playbook-intro-body[hidden] { display: none !important; }

/* Tables inside the intro */
.playbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 12px 0;
}

.playbook-table th {
  text-align: left;
  font-weight: 600;
  color: var(--slate);
  border-bottom: 2px solid var(--border);
  padding: 6px 8px;
}

.playbook-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Posture selector pills */
.playbook-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.playbook-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 2px solid var(--pill-color, var(--slate));
  background: white;
  color: var(--pill-color, var(--slate));
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.playbook-pill--active {
  background: var(--pill-color, var(--slate));
  color: white;
}

.playbook-pill-range {
  font-weight: 400;
  font-size: 0.74rem;
  opacity: 0.8;
}

/* Posture sections */
.playbook-posture { display: none; }
.playbook-posture--visible { display: block; }

.playbook-posture-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.playbook-posture-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
}

.playbook-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
}

/* Per-section layout */
.playbook-section {
  margin-bottom: 28px;
}

.playbook-section h3 {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

/* Principles block */
.principles-block {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--navy);
}

.principles-block p { margin: 0 0 10px; }
.principles-block p:last-child { margin-bottom: 0; }
.principles-block ul, .principles-block ol {
  padding-left: 1.4em;
  margin: 8px 0;
}
.principles-block li { margin-bottom: 4px; }

/* Parameters slot */
.parameters-slot {
  border-left: 3px solid var(--posture-slot-color, var(--slate));
  background: var(--posture-slot-bg, #f5f7fa);
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--navy);
}

.parameters-slot h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 8px;
}

.parameters-slot ul, .parameters-slot ol {
  padding-left: 1.4em;
  margin: 6px 0 0;
}

.parameters-slot li { margin-bottom: 4px; }

.parameters-slot p { margin: 0 0 8px; }
.parameters-slot p:last-child { margin-bottom: 0; }

/* Parameters slot states */
.parameters-slot--loading {
  background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 60px;
  border-left-color: var(--border);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.parameters-slot--error {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.83rem;
}

/* Quick Reference Card (Section 1) — full posture-color background */
.playbook-section--qrc .parameters-slot {
  background: var(--posture-slot-color, var(--slate));
  color: white;
  border-left: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  line-height: 1.6;
}

.playbook-section--qrc .parameters-slot h4 { color: rgba(255,255,255,0.75); }

/* Stub */
.playbook-stub {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.93rem;
}

/* Back link */
.playbook-back-wrap {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.playbook-back-link {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.playbook-back-link:hover { color: var(--navy); }

@media (max-width: 375px) {
  .playbook-pill { font-size: 0.75rem; padding: 6px 12px; }
}

/* ── T5 Radar / Composition chart ──────────────────────────────── */

.radar-svg {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 8px auto 0;
  overflow: visible;
}

.radar-axis-label { font-size: 11px; fill: var(--slate); }
.radar-axis-id    { font-weight: 700; }
.radar-axis-name  { font-size: 10px; fill: var(--text-dim); }

/* Trajectory row */
.radar-traj-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0 4px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.radar-traj-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
}

.radar-traj-label { color: var(--slate); font-weight: 600; }
.radar-traj-arrow { font-size: 1rem; font-weight: 700; }
.radar-traj-delta { font-size: 0.8rem; font-weight: 600; }

/* Footnote */
.radar-footnote {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-dim);
  margin: 8px 0 0;
  text-align: center;
}

/* Mobile bar layout */
.radar-bars-mobile { width: 100%; }

.radar-bar-metric {
  margin-bottom: 16px;
}

.radar-bar-metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 6px;
}

.radar-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.radar-bar-period {
  width: 52px;
  flex-shrink: 0;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.radar-bar-track {
  flex: 1;
  height: 12px;
  background: #e8ecf0;
  border-radius: 6px;
  overflow: hidden;
}

.radar-bar-fill {
  height: 100%;
  border-radius: 6px;
  min-width: 2px;
}

.radar-bar-value {
  width: 32px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
}
