/* Institutional Readiness & Gap Center (#view-readiness). Builds on base.css (theme variables and ins-* primitives). */
#view-readiness .section-card { margin-bottom: 20px; }
#view-readiness .section-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ins-kpi .v small { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.rd-btn { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); padding: 7px 14px; font: inherit; font-size: 0.78rem; cursor: pointer; white-space: nowrap; }
.rd-btn:hover { border-color: var(--border-active); color: var(--text-primary); }
.rd-h5 { margin: 14px 0 10px; font-size: 0.9rem; color: var(--text-primary); }
.rd-small { font-size: 0.76rem; }
.rd-id { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.rd-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 0.8rem; color: var(--text-secondary); height: 100%; box-sizing: border-box; }
.rd-card b { color: var(--text-primary); }
.rd-tag { display: inline-block; font-size: 0.68rem; padding: 2px 8px; border-radius: var(--radius-full); background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-muted); margin: 2px 0; }

/* chips: colour carries state, text always says it */
.rd-chip { display: inline-block; padding: 2px 9px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700; white-space: nowrap;
  color: var(--text-primary); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }
.rd-flag { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-inline-start: 6px; border-radius: 50%; background: var(--status-critical); color: #fff; font-weight: 800; font-size: 0.72rem; cursor: help; }

/* tables */
.rd-tall { max-height: none; }
.rd-table td { vertical-align: middle; }
.rd-table td small { display: block; color: var(--text-muted); font-weight: 400; }
.rd-table .rd-wide { min-width: 220px; }
.rd-num { width: 64px; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); padding: 4px 6px; font: inherit; font-variant-numeric: tabular-nums; text-align: center; }
.rd-num:focus { outline: none; border-color: var(--border-active); }
.rd-bullet-h { min-width: 140px; }
.rd-bullet { position: relative; height: 14px; background: var(--bg-card); border-radius: 4px; min-width: 130px; cursor: default; }
.rd-bullet .bar { position: absolute; left: 0; top: 3px; height: 8px; border-radius: 4px; }
.rd-bullet .tgt { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--text-primary); border-radius: 2px; }
.rd-bullet .base { position: absolute; top: 0; bottom: 0; width: 1px; border-left: 1px dashed var(--text-muted); }
.rd-bands { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 0.74rem; color: var(--text-muted); }

/* case study */
.rd-path { position: relative; height: 74px; margin: 34px 12px 8px; }
.rd-path::before { content: ''; position: absolute; left: 0; right: 0; top: 30px; height: 4px; background: var(--bg-surface); border-radius: 2px; }
.rd-path .seg { position: absolute; top: 28px; height: 8px; border-radius: 4px; }
.rd-path .seg.done { background: var(--status-normal); }
.rd-path .seg.todo { background: repeating-linear-gradient(45deg, var(--status-watch) 0 5px, transparent 5px 9px); opacity: 0.8; }
.rd-path .pt { position: absolute; top: 22px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--bg-card); border: 3px solid var(--text-primary); box-sizing: border-box; }
.rd-path .pt b { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; }
.rd-path .pt em { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.rd-path .pt.p1 { border-color: var(--status-advisory); }
.rd-path .pt.p2 { border-color: var(--status-normal); }
.rd-path i { position: absolute; top: 62px; transform: translateX(-50%); font-style: normal; font-size: 0.66rem; color: var(--text-muted); }

.rd-mx { display: grid; grid-template-columns: 28px 64px repeat(3, 1fr); gap: 3px; font-size: 0.72rem; }
.rd-mx-axis-y { grid-row: 1 / span 3; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; color: var(--text-muted); }
.rd-mx-y { align-self: center; color: var(--text-secondary); text-align: end; padding-inline-end: 6px; }
.rd-mx-c { min-height: 84px; border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border-subtle); }
.rd-mx-x { text-align: center; color: var(--text-secondary); padding-top: 4px; }
.rd-mx-axis-x { text-align: center; color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }
.rd-cause { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 5px; padding: 3px 6px; color: var(--text-primary); line-height: 1.4; cursor: default; }
.rd-types { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.74rem; color: var(--text-muted); }
.rd-types b { color: var(--text-primary); }

.rd-whys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .rd-whys { grid-template-columns: 1fr; } }
.rd-why-col { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px; }
.rd-why-head { font-weight: 800; color: var(--text-primary); margin-bottom: 10px; font-size: 0.86rem; }
.rd-why, .rd-root { background: var(--bg-card); border-radius: 6px; padding: 7px 10px; font-size: 0.76rem; color: var(--text-secondary); line-height: 1.55; }
.rd-why .n, .rd-root .n { display: block; font-size: 0.66rem; color: var(--text-muted); font-weight: 700; }
.rd-root { border: 1px solid var(--status-critical); color: var(--text-primary); font-weight: 600; }
.rd-root .n { color: var(--status-critical); }
.rd-arrow { text-align: center; color: var(--text-muted); font-size: 0.7rem; line-height: 1.2; }
.rd-lesson { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-surface); border-inline-start: 3px solid var(--accent-cyan); font-size: 0.82rem; color: var(--text-secondary); }

/* actions */
.rd-prog { display: flex; align-items: center; gap: 8px; }
.rd-prog input { width: 110px; accent-color: var(--accent-cyan); }
.rd-prog b { font-variant-numeric: tabular-nums; min-width: 36px; }
.rd-prog-static { height: 8px; background: var(--bg-card); border-radius: 4px; margin: 8px 0 2px; overflow: hidden; }
.rd-prog-static span { display: block; height: 100%; background: var(--status-watch); border-radius: 4px; }
.rd-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; }
.rd-dl dt { color: var(--text-muted); }
.rd-dl dd { margin: 0; color: var(--text-primary); }
.rd-check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.rd-check input { accent-color: var(--status-normal); margin-top: 3px; }
.rd-check.auto { cursor: default; }
.rd-check em { color: var(--text-muted); font-style: normal; font-size: 0.7rem; }
.rd-decision { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-xs); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); color: var(--text-primary); }

/* skills */
.rd-seg { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: var(--radius-full); overflow: hidden; }
.rd-seg button { background: transparent; border: 0; color: var(--text-secondary); padding: 5px 14px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.rd-seg button.on { background: var(--bg-card-hover); color: var(--text-primary); font-weight: 700; }
.rd-focus { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.7; margin: 0 0 8px; }
.rd-skills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 1000px) { .rd-skills { grid-template-columns: 1fr; } }
.rd-slider { display: grid; grid-template-columns: minmax(150px, 1.3fr) 1.4fr 30px 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: 0.8rem; color: var(--text-secondary); }
.rd-slider.pri .lbl { color: var(--text-primary); font-weight: 700; }
.rd-slider input { accent-color: var(--accent-cyan); width: 100%; }
.rd-slider b { color: var(--text-primary); font-variant-numeric: tabular-nums; text-align: end; }
.rd-slider .req { color: var(--accent-amber); font-variant-numeric: tabular-nums; }
.rd-skill-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-top: 14px; }
.rd-gaplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rd-gap { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.8rem; color: var(--text-primary); }
.rd-gap small { display: block; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.rd-gap .num { font-weight: 800; margin-inline-start: 4px; }
.rd-gap .neg, .rd-table .neg { color: var(--status-critical); }
.rd-table .pos { color: var(--status-normal); }

/* roadmap */
.rd-road { position: relative; height: 330px; margin: 6px 0 20px; }
.rd-road > i { position: absolute; bottom: 0; transform: translateX(-50%); font-style: normal; font-size: 0.7rem; color: var(--text-muted); }
.rd-phase { position: absolute; top: 0; bottom: 22px; padding: 0 5px; box-sizing: border-box; }
.rd-phase > * { margin: 0; }
.rd-phase .ph-h { background: var(--bg-card-hover); border: 1px solid var(--border-active); border-radius: var(--radius-xs) var(--radius-xs) 0 0; padding: 8px 10px; font-weight: 800; color: var(--text-primary); font-size: 0.84rem; }
.rd-phase .ph-h .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-cyan); color: #fff; font-size: 0.75rem; margin-inline-end: 8px; }
.rd-phase .ph-h small { display: block; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.rd-phase ul { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-top: 0; padding: 8px 10px 8px 26px; font-size: 0.74rem; color: var(--text-secondary); line-height: 1.6; height: 150px; overflow: auto; }
html[dir="rtl"] .rd-phase ul { padding: 8px 26px 8px 10px; }
.rd-phase .ph-out { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-top: 1px dashed var(--border-subtle); border-radius: 0 0 var(--radius-xs) var(--radius-xs); padding: 8px 10px; font-size: 0.74rem; color: var(--text-secondary); line-height: 1.55; }
.rd-ladder { display: flex; align-items: flex-end; gap: 8px; }
.rd-ladder .step { flex: 1; min-height: var(--h); background: color-mix(in srgb, var(--accent-cyan) 14%, var(--bg-surface)); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs) var(--radius-xs) 0 0; padding: 8px 10px; font-size: 0.74rem; color: var(--text-secondary); display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.rd-ladder .step b { color: var(--text-primary); font-size: 0.82rem; }
.rd-ladder .step .n { font-size: 1.2rem; font-weight: 800; color: var(--accent-cyan); }
@media (max-width: 900px) { .rd-road { height: auto; } .rd-phase { position: static; width: auto !important; margin-bottom: 10px; } .rd-road > i { display: none; } }

/* evaluation windows */
.rd-eval { display: grid; grid-template-columns: minmax(150px, 1.2fr) 1.6fr; gap: 10px; align-items: center; min-height: 26px; font-size: 0.76rem; color: var(--text-secondary); }
.rd-eval .track { position: relative; height: 18px; }
.rd-eval .track::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--border-subtle); }
.rd-eval .b1, .rd-eval .b2 { position: absolute; height: 7px; border-radius: 4px; }
.rd-eval .b1 { top: 1px; background: var(--accent-cyan); }
.rd-eval .b2 { top: 10px; background: var(--accent-purple); }
.rd-eval.axis .track::before { display: none; }
.rd-eval .ticks b { position: absolute; transform: translateX(-50%); font-weight: 400; color: var(--text-muted); font-size: 0.68rem; }
.rd-succ { margin: 0; padding-inline-start: 20px; font-size: 0.8rem; color: var(--text-secondary); line-height: 2; }

/* entity × frequency binding */
.rb-table th.c, .rb-table td.c { text-align: center; }
.rb-table td.c { min-width: 70px; }
.rb-table tbody tr { cursor: pointer; transition: var(--transition-fast); }
.rb-table tbody tr:hover { background: var(--bg-card-hover); }
.rb-table tbody tr.sel { background: var(--bg-card-hover); box-shadow: inset 3px 0 0 var(--accent-cyan); }
html[dir="rtl"] .rb-table tbody tr.sel { box-shadow: inset -3px 0 0 var(--accent-cyan); }
.rb-ent { min-width: 210px; }
.rb-table .neg { color: var(--status-critical); }
.rb-chip { display: inline-block; margin: 2px; padding: 2px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; white-space: nowrap; cursor: default;
  color: var(--text-primary); background: color-mix(in srgb, var(--c) 22%, transparent); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); }
.rb-chip.surge { background: transparent; border-style: dashed; opacity: 0.85; }
.rb-chip.slow { box-shadow: 0 0 0 2px var(--status-critical); }
.rb-partners { margin-bottom: 10px; line-height: 2; }
.rb-item { padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.rb-slow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.rb-slow .lbl small { display: block; color: var(--text-muted); }
.rb-fix { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }
.rb-fix b { color: var(--status-normal); }
#rbMatrix .ins-table-wrap { max-height: none; }
