:root {
  color-scheme: light;
  font-family: "Inter", system-ui, sans-serif;
  color: #152336;
  background: #f4f6fa;
  --ink: #152336;
  --muted: #48596e;
  --line: #dce3ed;
  --accent: #1b54a3;
  --tint: #eaf1fd;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, input, select {
  min-height: 2.65rem;
  border: 1px solid #bac7d8;
  border-radius: .45rem;
  background: #fff;
  color: var(--ink);
}
button { padding: .4rem .75rem; cursor: pointer; }
button:hover:not(:disabled) { background: var(--tint); }
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 3px solid #326bc2; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: .5rem auto auto .75rem;
  padding: .75rem;
  transform: translateY(-150%);
  background: white;
}
.skip-link:focus { transform: none; }
.site-header { background: var(--ink); color: white; }
.header-inner, main {
  width: min(100% - 3rem, 76rem);
  margin-inline: auto;
}
.header-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.brand { white-space: nowrap; font-size: 1.125rem; }
.brand strong { color: #9fc0ff; }
.site-header nav { align-self: stretch; display: flex; }
.site-header a {
  display: flex;
  align-items: center;
  padding: .85rem .15rem .7rem;
  border-bottom: 3px solid #9fc0ff;
  color: #f3f7ff;
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
}
.site-header a:focus-visible { outline-color: #9fc0ff; }
main { padding-block: clamp(1.75rem, 5vw, 3.5rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); letter-spacing: -.04em; line-height: 1.1; }
.intro p { margin-top: .75rem; color: var(--muted); line-height: 1.55; }
.reference-note {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .85rem;
  margin-block: 1.35rem 1.5rem;
  border: 1px solid #cedcf0;
  border-inline-start: 4px solid #5880bc;
  border-radius: .5rem;
  padding: .8rem 1rem;
  background: var(--tint);
  color: #243e62;
  font-size: .9rem;
  line-height: 1.5;
}
.reference-guidance { flex-basis: 100%; }
.reference-guidance p { margin-top: .35rem; }
.catalog {
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 8px 28px #182c4e0a;
}
.catalog-header, .toolbar, .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.catalog-header { padding: 1.2rem 1.3rem .85rem; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
#export { background: var(--accent); border-color: var(--accent); color: #fff; }
#export:hover:not(:disabled) { background: #164682; }
.filters {
  display: grid;
  grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(8rem, 1fr));
  gap: .75rem;
  padding: 0 1.3rem 1.05rem;
}
.filters > div { display: grid; gap: .35rem; }
label { color: var(--muted); font-size: .86rem; font-weight: 650; }
input, select { width: 100%; padding: .45rem .65rem; min-width: 0; font-weight: 450; }
.toolbar {
  justify-content: flex-start;
  padding: .7rem 1.3rem;
  border-block: 1px solid var(--line);
  background: #f7f9fd;
}
.toolbar button, .toolbar select { font-size: .86rem; min-height: 2.25rem; }
.view-switch, .view-controls { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.view-controls { margin-inline-start: auto; gap: .65rem; }
.view-controls > div { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
[aria-pressed="true"] { background: var(--tint); border-color: #a7bfe3; color: #123d79; font-weight: 700; }
#status, .pagination { color: var(--muted); font-size: .875rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
caption { padding: .75rem 1.3rem; text-align: left; color: var(--muted); }
th, td { vertical-align: top; border-bottom: 1px solid var(--line); padding: .8rem .85rem; }
th { color: #31445e; background: #f0f4fa; font-weight: 700; }
th:first-child, td:first-child { padding-inline-start: 1.3rem; }
th:last-child, td:last-child { padding-inline-end: 1.3rem; }
td[data-label="Role"] { min-width: 9rem; }
td[data-label="Dimension"] { min-width: 10rem; }
.role-title { margin-top: .2rem; color: var(--muted); font-size: .8rem; }
.level {
  display: inline-block;
  padding: .2rem .45rem;
  border-radius: .3rem;
  background: #eaf1fd;
  color: #194578;
  font-size: .78rem;
  font-weight: 650;
}
[data-level="operational"] { color: #17564d; background: #e4f3ef; }
[data-level="tactical"] { color: #674410; background: #f9efdd; }
summary { cursor: pointer; color: #174b91; line-height: 1.5; overflow-wrap: anywhere; }
details ul { margin: .5rem 0; padding-inline-start: 1.15rem; line-height: 1.55; }
details li + li { margin-top: .25rem; }
.source { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.matrix table { min-width: max-content; }
.matrix :is(th, td):not(:first-child) { width: 15rem; min-width: 15rem; }
.matrix :is(th, td):first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f0f4fa;
  border-right: 1px solid var(--line);
}
.empty { padding: 2rem 1.3rem; color: var(--muted); line-height: 1.55; }
.pagination { justify-content: center; padding: .85rem 1.3rem; }
.pagination button { min-height: 2.25rem; }

@media (max-width: 47rem) {
  .header-inner, main { width: calc(100% - 2rem); }
  .header-inner { gap: 1rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { grid-column: span 2; }
  .catalog-header, .filters, .toolbar { padding-inline: .85rem; }
  .view-controls { margin-inline-start: 0; }
  .list table, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .list tr { padding: .6rem .85rem; border-bottom: 1px solid var(--line); }
  .list td, .list td:first-child, .list td:last-child { padding: .25rem 0; border: 0; }
  .list [data-label="Dimension"] { font-weight: 650; }
}

@media (max-width: 24rem) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .search { grid-column: auto; }
}

.framework-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-block: 1.2rem;
}
.framework-nav a {
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  color: var(--muted);
  background: white;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}
.framework-nav a[aria-current], .framework-nav a:hover {
  color: #123d79;
  background: var(--tint);
  border-color: #a7bfe3;
}
.chat { max-width: 58rem; margin-top: 1.35rem; }
.chat .catalog-header { align-items: flex-start; }
.chat .catalog-header p {
  margin-top: .4rem;
  max-width: 35rem;
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.5;
}
.chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .35rem 1.3rem 1rem;
}
.chat-starters button {
  min-height: 2.3rem;
  text-align: left;
  font-size: .84rem;
  color: #174b91;
  border-color: #cbd8eb;
}
#chat-log {
  display: grid;
  gap: .95rem;
  max-height: 55vh;
  overflow: auto;
  padding: 0 1.3rem 1.1rem;
  overscroll-behavior: contain;
}
#chat-log:empty { display: none; }
.chat-message { max-width: 90%; min-width: 0; padding: .8rem .95rem; border-radius: .6rem; }
.chat-message.user { justify-self: end; background: var(--tint); }
.chat-message.assistant { justify-self: start; background: #f4f6fa; }
.chat-message > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.55; }
.chat-message .message-label { margin-bottom: .3rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.chat-message details { margin-top: .65rem; font-size: .85rem; }
.chat-message a { color: #174b91; }
.chat-status { padding: 0 1.3rem .7rem; color: var(--muted); font-size: .88rem; }
.chat-status:empty { display: none; }
#chat-form { border-top: 1px solid var(--line); padding: 1rem 1.3rem; }
.composer { display: flex; align-items: flex-end; gap: .55rem; margin-top: .35rem; }
.composer textarea {
  min-width: 0;
  width: 100%;
  font: inherit;
  padding: .65rem;
  color: var(--ink);
  border: 1px solid #bac7d8;
  border-radius: .45rem;
  resize: vertical;
}
#chat-send { background: var(--accent); border-color: var(--accent); color: white; }
#chat-send:hover:not(:disabled) { background: #164682; }
.chat-note { margin-top: .55rem; color: var(--muted); font-size: .79rem; }
@media (max-width: 47rem) {
  #chat-form, #chat-log, .chat-starters, .chat-status { padding-inline: .85rem; }
  .chat-message { max-width: 100%; }
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem 2.25rem;
  padding-block: .35rem .55rem;
}
.intro-content { max-width: 41rem; }
.catalog-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  flex: 0 1 22rem;
  margin: 0;
}
.catalog-facts > div {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding-inline-start: .75rem;
  border-left: 2px solid #c7d7ed;
}
.catalog-facts dt { font-size: .77rem; color: var(--muted); }
.catalog-facts dd {
  order: -1;
  margin: 0;
  color: #1a3e72;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.framework-nav {
  border-bottom: 1px solid #d3deec;
  gap: .35rem 1rem;
  margin-block: 1.5rem;
}
.framework-nav a {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: .65rem .45rem;
}
.framework-nav a[aria-current] {
  background: transparent;
  border-color: var(--accent);
}
.reference-note > .reference-guidance { font-size: .79rem; }
.scope-panel, .work-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .75rem;
  box-shadow: 0 4px 18px #182c4e08;
}
.scope-panel { margin-bottom: 1.1rem; }
.scope-panel > summary { padding: .75rem 1rem; font-size: .9rem; font-weight: 680; }
.scope-content { padding: 0 1rem 1rem; }
.scope-content > p, .work-heading > p, .view-heading > p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.scope-content h3 { margin: 1rem 0 .35rem; font-size: .96rem; }
.scope-fields, .role-mappings, .scenario-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: .85rem;
}
.scope-fields > div, .scope-fields label, .role-mappings label, .scenario-grid label, .initiative-row label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.role-mappings small { font-weight: 450; }
.level-glossary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .45rem .85rem;
  font-size: .87rem;
  margin: 0;
}
.level-glossary dt { font-weight: 700; }
.level-glossary dd { margin: 0; color: var(--muted); }
.archive-note { margin: .65rem 0; }
.archive-note summary { font-size: .84rem; }
.view-heading { margin: 0 0 1rem; }
.view-heading h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); }
.view-heading p { margin-top: .3rem; }
.work-panel { padding: clamp(1rem, 3.8vw, 1.65rem); }
.work-heading h3 { font-size: 1.34rem; margin: .2rem 0 .35rem; }
.compact-label {
  color: #31547e;
  font-size: .8rem;
  font-weight: 700;
}
.workflow-overview, .stage-fields, .metric-fields, .result-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.15rem;
  margin-bottom: 0;
}
:is(.workflow-overview, .stage-fields, .metric-fields, .result-fields) dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
:is(.workflow-overview, .stage-fields, .metric-fields, .result-fields) dd {
  margin: .18rem 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.work-panel a { color: #174b91; }
.work-path, .steps {
  display: grid;
  padding: 0;
  list-style: none;
}
.work-path {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-block: 1.35rem;
}
.work-path li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  background: #eef4fb;
  border-inline-start: 3px solid #8aaddc;
  padding: .7rem .85rem;
}
.work-path li + li::before {
  content: "›";
  position: absolute;
  left: -.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7188a7;
}
.work-path span, .steps span { color: var(--muted); font-size: .76rem; }
.steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .85rem;
}
.steps button {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: .3rem;
  height: 100%;
  width: 100%;
  min-height: 4.8rem;
  padding: .65rem;
  text-align: left;
  font-size: .85rem;
}
.stage-panel {
  padding: .95rem 1rem;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: .5rem;
}
.stage-panel h4 { margin: 0; font-size: 1.1rem; }
.stage-fields { font-size: .9rem; }
.record-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
}
.record-links a {
  display: inline-block;
  padding: .2rem .45rem;
  border: 1px solid #cad7e9;
  border-radius: .3rem;
  background: #fff;
}
.measurement-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1rem;
}
.measurement-nav a {
  padding: .55rem .75rem;
  border-radius: .4rem;
  border: 1px solid #cad5e5;
  color: #25456c;
  background: #fff;
  text-decoration: none;
  font-size: .87rem;
  font-weight: 620;
}
.measurement-nav a[aria-current],
.measurement-nav a:hover { background: var(--tint); border-color: #a7bfe3; }
.kpi-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.counter { margin-top: .7rem; color: var(--muted); font-size: .82rem; }
.metric-entry { border-bottom: 1px solid var(--line); }
.metric-entry summary {
  padding: .65rem .25rem;
  font-weight: 650;
}
.metric-entry summary .compact-label {
  margin-inline-start: .55rem;
  font-size: .72rem;
  color: var(--muted);
}
.metric-content { padding: 0 .85rem .8rem; font-size: .88rem; }
.metric-fields { margin: 0 0 .75rem; }
.metric-more { margin-top: .85rem; }
.evidence-note, .form-note {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.55;
}
.evidence-note {
  margin-top: .8rem;
  padding: .65rem .8rem;
  color: #5e4415;
  background: #fff6e4;
  border-left: 3px solid #c89530;
}
.scenario-form { margin-top: .95rem; }
.scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scenario-form .form-note { margin: .7rem 0; }
.scenario-form > .primary { margin-top: .85rem; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: #164682; }
.initiatives {
  border: 1px solid var(--line);
  border-radius: .5rem;
  margin: 1.05rem 0 0;
  padding: 0 .8rem .75rem;
  min-width: 0;
}
.initiatives legend { font-size: .87rem; font-weight: 700; padding: 0 .25rem; }
.initiative-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, .8fr) auto;
  gap: .6rem;
  align-items: end;
  margin-bottom: .75rem;
}
.scenario-result {
  margin-top: .95rem;
  padding: .85rem 1rem;
  border-radius: .5rem;
  border: 1px solid #ccdfd9;
  background: #edf7f3;
}
.scenario-error { border-color: #e2baad; background: #fff4ef; color: #772a12; }
.result-fields dd { font-weight: 650; font-variant-numeric: tabular-nums; font-size: .93rem; }
.effort-chart { margin-top: .85rem; }
.effort-chart h5 { font-size: .88rem; margin: 0 0 .45rem; }
.effort-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  margin-block: .35rem;
  font-size: .83rem;
  font-variant-numeric: tabular-nums;
}
.effort-track {
  border-radius: .25rem;
  background: #dce8e5;
  height: .65rem;
  overflow: hidden;
}
.effort-bar {
  display: block;
  height: 100%;
  background: #2f7767;
}
.effort-row:last-child .effort-bar { background: #3e69a8; }
.roadmap-form { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: .9rem; }
.roadmap-form h4 { margin: 0; }

@media (max-width: 60rem) {
  .intro { flex-wrap: wrap; }
  .catalog-facts { flex-basis: 20rem; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 42rem) {
  .framework-nav { column-gap: .6rem; }
  .framework-nav a { font-size: .8rem; padding-inline: .3rem; }
  .scope-fields, .role-mappings, .initiatives .initiative-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-path { grid-template-columns: 1fr; }
  .work-path li + li::before { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps button { min-height: 3.8rem; }
}
@media (max-width: 26rem) {
  .role-mappings, .scenario-grid, .scope-fields, .stage-fields, .metric-fields, .result-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .initiative-row button { justify-self: start; }
  .work-panel { padding-inline: .8rem; }
}

.cash-treatment { color: #31547e; font-size: .79rem; font-weight: 650; }

.matrix-scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .7rem;
  background: #f8fafd;
  color: var(--muted);
  padding: .65rem 1.3rem;
  font-size: .83rem;
}
#matrix-roles { display: flex; flex-wrap: wrap; gap: .3rem; }
#matrix-roles button { min-height: 2rem; font-size: .78rem; }
