:root {
    --brand: #c95bc1;
    --brand-lo: #f7e6f6;
    --brand-md: #dda0d9;
    --brand-hi: #a84ba1;
    --brand-dk: #8a3a84;
    --brand-ink: #6b2c67;
    --agent: #c95bc1;
    --agent-lo: #f7e6f6;
    --human: #635D68;
    --human-lo: #f0eef1;
    --ink: #1c2733;
    --sub: #4b5563;
    --line: #e2e6ec;
    --perform: #c95bc1;
    --verify: #8a3a84;
    --govern: #4f214c;
    --gate: #6b2c67;
    --core: #c95bc1;
    --pass: #8a3a84;
    --fail: #4f214c;
    --na: #8a94a3;
    --srcA: #8a3a84;
    --srcR: #c95bc1;
    --srcH: #6b2c67;
}

.subtitle {
    font-size: 1.15em;
    color: var(--sub);
    margin: 0 0 .5em;
    text-align: center
}

.byline {
    color: var(--sub);
    margin-bottom: 2em;
    text-align: center
}

a.cite {
    text-decoration: none;
    font-weight: 600
}

.refs p {
    scroll-margin-top: 24px
}

.refs p:target {
    background: #fbf3d5;
    border-radius: 4px
}

.figcap {
    font-size: .85em;
    color: var(--sub);
    margin: .6em 0 1.6em
}

.figcap b {
    color: var(--ink)
}

img.fig {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px
}

.footnotes {
    font-size: .85em;
    color: var(--sub);
    border-top: 1px solid var(--line);
    margin-top: 2.2em;
    padding-top: .7em
}

.footnotes p {
    scroll-margin-top: 24px
}

.footnotes p:target {
    background: #fbf3d5;
    border-radius: 4px
}

.refs {
    font-size: .85em;
    color: var(--sub)
}

.refs p {
    margin: .45em 0
}

/* ---------- interactive figure 1 : roles ladder ---------- */
#ladder {
    margin: 1.2em 0 .4em;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
}

.interactive {
    margin-bottom: 1.2em
}

.lphases {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    min-width: 720px
}

.lphase {
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 7px 4px;
    font-size: .72em
}

.lphase b {
    display: block;
    font-size: 1.05em;
    letter-spacing: .04em
}

.lphase i {
    opacity: .85
}

.lcols {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 6px;
    min-width: 720px
}

.lcol {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 8px 6px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, transform .15s;
    background: #fff
}

.lcol:hover {
    transform: translateY(-2px)
}

.lcol.sel {
    border-color: var(--ink)
}

.lcol .lid {
    font-weight: 800;
    font-size: 1.25em
}

.lcol .lname {
    font-size: .72em;
    color: var(--sub);
    min-height: 2.4em;
    line-height: 1.2
}

.lcell {
    border-radius: 6px;
    padding: 9px 3px;
    font-weight: 700;
    font-size: .78em;
    margin-top: 6px;
    line-height: 1.25
}

.ljob {
    font-size: .68em;
    color: var(--sub);
    font-style: italic;
    margin-top: 6px;
    min-height: 2.2em
}

.larrows {
    display: flex;
    justify-content: space-between;
    font-size: .75em;
    margin-top: 10px;
    min-width: 720px;
    gap: 12px
}

.larrows .a1 {
    color: var(--agent)
}

.larrows .a2 {
    color: var(--human)
}

#ladderdetail {
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .9em;
    margin-top: 12px;
    background: #fafbfc
}

#ladderdetail b {
    font-size: 1.02em
}

/* ---------- reimagined workflow (levels explorer) ---------- */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 1.2em 0
}

.tab {
    border: 1.5px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: .9em;
    cursor: pointer;
    font-weight: 600;
    color: var(--sub)
}

.tab:hover {
    border-color: var(--ink);
    color: var(--ink)
}

.tab.sel {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff
}

.rolebar {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: .9em;
    margin: .6em 0 1em
}

.rolebar span b {
    font-weight: 700
}

.rolebar .ra {
    color: var(--agent)
}

.rolebar .rh {
    color: var(--human)
}

.lvldesc {
    font-size: .95em;
    color: var(--sub);
    margin: -.3em 0 1em
}

.orch {
    border: 1.5px solid var(--agent);
    background: linear-gradient(#f7e6f6, #f0ddef);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .85em;
    margin-bottom: 10px
}

.orch b {
    color: var(--agent)
}

.queue {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px
}

.qitem {
    background: #fff;
    border: 1px solid var(--agent);
    color: var(--agent);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .85em
}

.stackwrap {
    position: relative
}

.stackwrap.stacked::before,
.stackwrap.stacked::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    z-index: -1
}

.stackwrap.stacked::before {
    transform: translate(6px, 6px)
}

.stackwrap.stacked::after {
    transform: translate(12px, 12px);
    opacity: .6
}

.stacknote {
    font-size: .8em;
    color: var(--sub);
    text-align: right;
    margin-top: 14px;
    font-style: italic
}

.flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 14px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff
}

.step {
    min-width: 118px;
    max-width: 138px;
    flex: 1;
    border-radius: 9px;
    padding: 8px 8px 9px;
    position: relative;
    border: 1.6px solid var(--agent);
    background: var(--agent-lo)
}

.step.h {
    border-color: var(--human);
    background: var(--human-lo)
}

.step .n {
    position: absolute;
    top: -9px;
    left: -6px;
    background: var(--agent);
    color: #fff;
    border-radius: 50%;
    width: 19px;
    height: 19px;
    font-size: .68em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center
}

.step.h .n {
    background: var(--human)
}

.step b {
    display: block;
    font-size: .74em;
    line-height: 1.25;
    margin-bottom: 3px
}

.step small {
    display: block;
    font-size: .64em;
    color: var(--sub);
    line-height: 1.3
}

.step .badge {
    display: inline-block;
    margin-top: 5px;
    font-size: .6em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    background: var(--human);
    color: #fff
}

.step .assist {
    display: inline-block;
    margin-top: 5px;
    font-size: .6em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    border: 1px solid var(--agent);
    color: var(--agent);
    background: #fff
}

.step .loopb {
    display: inline-block;
    margin-top: 5px;
    font-size: .6em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    background: var(--agent);
    color: #fff
}

.arrow {
    align-self: center;
    color: #9aa6b5;
    font-size: 1.05em;
    padding: 0 3px;
    flex: none
}

.lanekey {
    display: flex;
    gap: 16px;
    font-size: .75em;
    color: var(--sub);
    margin: 8px 2px 0
}

.lanekey i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: -1px
}

.humanstrip {
    border: 1.5px dashed var(--human);
    border-radius: 10px;
    background: #fdf7fd;
    padding: 10px 14px;
    font-size: .85em;
    margin-top: 12px
}

.humanstrip b {
    color: var(--human)
}

/* shared chips & notes */
.chip {
    flex: none;
    font-size: .72em;
    font-weight: 700;
    color: #fff;
    border-radius: 4px;
    padding: 1px 7px;
    margin-top: 2px
}

.chip.A {
    background: var(--srcA)
}

.chip.R {
    background: var(--srcR)
}

.chip.H {
    background: var(--srcH)
}

.nocrit {
    font-size: .9em;
    color: var(--sub);
    font-style: italic
}

/* ---------- rubric explorer ---------- */
.rubx {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    margin: 1.2em 0;
    background: #fff
}

.rpills {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 6px
}

.rpills .lab {
    font-size: .8em;
    color: var(--sub);
    font-weight: 600;
    margin-right: 2px
}

.rpill {
    border: 1.5px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 5px 13px;
    font-size: .78em;
    font-weight: 700;
    color: var(--sub);
    cursor: pointer;
    font-family: inherit
}

.rpill:hover {
    border-color: var(--ink);
    color: var(--ink)
}

.rpill.sel {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff
}

.rpill small {
    font-weight: 400;
    opacity: .75
}

.rhint {
    font-size: .75em;
    color: var(--sub);
    margin: 0 0 12px
}

.rsect {
    margin-top: 14px
}

.rsect h5 {
    margin: 0 0 2px;
    font-size: .92em
}

.rsect h5.g {
    color: var(--gate)
}

.rsect h5.c {
    color: var(--core)
}

.rsect .rsub {
    font-size: .78em;
    color: var(--sub);
    margin: 0 0 8px
}

.rrow {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid #eef1f5;
    font-size: .82em
}

.rrow:last-of-type {
    border-bottom: none
}

.rrow .mark {
    flex: none;
    font-weight: 800;
    width: 1.1em;
    text-align: center
}

.rrow.g .mark {
    color: var(--gate)
}

.rrow.c .mark {
    color: var(--core)
}

.rrow .cid {
    font-weight: 700;
    flex: none;
    width: 3.4em
}

.rrow .ctext {
    flex: 1
}

.rrow .cnote {
    color: var(--sub);
    font-style: italic;
    font-size: .92em
}

.rrow .capfail {
    display: block;
    font-size: .86em;
    color: var(--gate);
    margin-top: 1px
}

.lstrip {
    display: flex;
    gap: 2px;
    flex: none;
    margin-top: 2px
}

.lstrip i {
    width: 17px;
    height: 17px;
    border-radius: 3px;
    border: 1px solid var(--line);
    font-style: normal;
    font-size: .58em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aab3bf;
    background: #fff
}

.lstrip i.on {
    color: #fff;
    border-color: transparent
}

.rrow.g .lstrip i.on {
    background: var(--gate)
}

.rrow.c .lstrip i.on {
    background: var(--core)
}

.lstrip i.first {
    outline: 2px solid var(--ink);
    outline-offset: -1px
}

.lstrip i.hilite {
    box-shadow: 0 0 0 2px var(--agent)
}

.rgroup {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 8px 0;
    background: #fafbfc
}

.rgroup summary {
    cursor: pointer;
    padding: 9px 14px;
    font-size: .85em;
    list-style: none;
    display: flex;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap
}

.rgroup summary::-webkit-details-marker {
    display: none
}

.rgroup summary::before {
    content: "▸";
    font-size: .8em;
    color: var(--sub)
}

.rgroup[open] summary::before {
    content: "▾"
}

.rgroup summary b {
    font-size: 1em
}

.rgroup summary .dq {
    color: var(--sub);
    font-style: italic;
    font-size: .92em;
    flex: 1;
    min-width: 180px
}

.rgroup summary .dcount {
    font-size: .78em;
    color: var(--sub);
    white-space: nowrap
}

.rgroup .rbody {
    padding: 2px 14px 8px;
    background: #fff;
    border-top: 1px solid var(--line);
    border-radius: 0 0 10px 10px
}

.famtag {
    flex: none;
    font-size: .66em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 7px;
    letter-spacing: .02em
}

.famtag.cap {
    background: var(--brand-lo);
    color: var(--brand-dk)
}

.famtag.gov {
    background: #f0ddef;
    color: var(--brand-ink)
}

.rgroup.empty {
    display: none
}

/* ---------- worked assessment ---------- */
.assess {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0;
    margin: 1.4em 0;
    overflow: hidden
}

.asteps {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    background: #fafbfc
}

.astep {
    flex: 1 1 0;
    min-width: 110px;
    border: none;
    background: none;
    padding: 10px 6px 9px;
    cursor: pointer;
    font-size: .72em;
    font-weight: 600;
    color: var(--sub);
    border-bottom: 3px solid transparent;
    font-family: inherit;
    line-height: 1.3
}

.astep b {
    display: block;
    font-size: 1.15em;
    color: var(--ink)
}

.astep:hover {
    background: #f0f3f8
}

.astep.sel {
    border-bottom-color: var(--ink);
    background: #fff
}

.astep.done b::after {
    content: " ✓";
    color: var(--pass);
    font-size: .9em
}

.abody {
    padding: 18px 20px 20px
}

.abody h4 {
    margin: .1em 0 .5em;
    font-size: 1.05em
}

.abody p {
    font-size: .92em
}

.anav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    background: #fafbfc
}

.anav button {
    border: 1.5px solid var(--ink);
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 7px 18px;
    font-size: .85em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit
}

.anav button.primary {
    background: var(--ink);
    color: #fff
}

.anav button:disabled {
    opacity: .35;
    cursor: default
}

.anav .stepno {
    font-size: .78em;
    color: var(--sub)
}

/* ceiling meter */
.meter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 5px;
    margin: 14px 0 4px
}

.mcell {
    border: 1.5px solid var(--line);
    border-radius: 8px;
    text-align: center;
    padding: 7px 2px;
    font-size: .72em;
    font-weight: 700;
    color: var(--sub);
    position: relative;
    background: #fff
}

.mcell small {
    display: block;
    font-weight: 400;
    font-size: .85em
}

.mcell.ok {
    background: var(--brand-lo);
    border-color: var(--pass);
    color: var(--pass)
}

.mcell.cap {
    background: #fce8f9;
    border-color: var(--fail);
    color: var(--fail)
}

.mcell.target {
    background: var(--brand-lo);
    border-color: var(--agent);
    color: var(--agent)
}

.mcell.dim {
    display: none
}

.mlabel {
    font-size: .72em;
    color: var(--sub);
    margin-bottom: 10px
}

.mlabel b.capb {
    color: var(--fail)
}

.mlabel b.tgtb {
    color: var(--agent)
}

/* envelope card */
.envgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0
}

.envbox {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .82em
}

.envbox.in {
    border-left: 4px solid var(--pass)
}

.envbox.out {
    border-left: 4px solid var(--fail)
}

.envbox h5 {
    margin: 0 0 4px;
    font-size: 1em
}

.envbox.in h5 {
    color: var(--pass)
}

.envbox.out h5 {
    color: var(--fail)
}

.envbox ul {
    margin: .2em 0 .2em 1.1em;
    padding: 0
}

.envbox li {
    margin: .18em 0
}

.envmeta {
    font-size: .8em;
    color: var(--sub);
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px
}

@media (max-width:640px) {
    .envgrid {
        grid-template-columns: 1fr
    }
}

/* verdict rows */
.vrow {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #eef1f5;
    font-size: .83em
}

.vrow:last-of-type {
    border-bottom: none
}

.vrow .vmark {
    flex: none;
    width: 1.5em;
    text-align: center;
    font-weight: 800
}

.vrow.pass .vmark {
    color: var(--pass)
}

.vrow.fail .vmark {
    color: var(--fail)
}

.vrow.na .vmark {
    color: var(--na)
}

.vrow .cid {
    font-weight: 700;
    flex: none;
    width: 3.4em
}

.vrow .vtext {
    flex: 1
}

.vrow .vtext b.q {
    font-weight: 700
}

.vrow .ev {
    display: block;
    color: var(--sub);
    font-size: .92em;
    margin-top: 2px
}

.vrow .ev i {
    font-style: normal;
    font-weight: 700;
    font-size: .85em;
    letter-spacing: .03em;
    color: var(--sub)
}

.vrow.fail {
    background: #fce8f9;
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px
}

.vlvl {
    flex: none;
    font-size: .72em;
    color: var(--sub);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 5px;
    margin-top: 2px
}

.gatecapbanner {
    border: 1.5px solid var(--fail);
    background: #fce8f9;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .86em;
    margin: 12px 0
}

.gatecapbanner b {
    color: var(--fail)
}

.oknote {
    border: 1.5px solid var(--pass);
    background: var(--brand-lo);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .86em;
    margin: 12px 0
}

.oknote b {
    color: var(--pass)
}

/* backlog */
.bitem {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 8px 0;
    font-size: .84em
}

.bitem .bno {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: .8em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px
}

.bitem .btags {
    margin-top: 4px
}

.btag {
    display: inline-block;
    font-size: .72em;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 7px;
    margin-right: 6px
}

.btag.g {
    background: var(--fail);
    color: #fff
}

.btag.c {
    background: var(--core);
    color: #fff
}

.btag.f {
    background: #eef1f5;
    color: var(--sub)
}