/* Shared rule statements: explanation and a local example per operation. */
.rules-page .rule-statements>li{display:block;padding:30px 0;counter-increment:none}
.rules-page .rule-statements>li::before{content:none}
.rules-page .rule-statements h3{display:flex;gap:12px;align-items:baseline;margin:0 0 18px;color:#ad304d;font-size:18px;line-height:1.5}
.rules-page .rule-statements h3>span{color:#507459;font:500 11px ui-monospace,monospace}
.rule-example-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:32px;align-items:start}
.rule-explanation{display:grid;gap:14px}
.rules-page .rule-statements .rule-explanation p{font-size:14px;line-height:1.9}
.rule-example{margin:0;padding:16px;background:#f6f5ef;border:1px solid #e2e0d5;border-radius:10px;min-width:0}
.rule-example svg{display:block;width:100%;height:auto}
.rules-page .rule-example figcaption{font-size:12px;line-height:1.7;color:#62665d;border-top:1px solid #e2e0d5;padding-top:12px;margin-top:6px}
.rule-example-key{font-size:12px;color:#62665d;line-height:1.8;margin:0 0 20px}
.example-defs{position:absolute;overflow:hidden}
.ex-label{font:11px system-ui,sans-serif;fill:#555e53}
.ex-node{font:600 14px system-ui,sans-serif;fill:#30392f}
.ex-value{font:11px ui-monospace,monospace;fill:#555e53}
.ex-edge{stroke:#507459;stroke-width:1.8;fill:none}
.ex-cut{stroke:#ae7276;stroke-dasharray:5 4}
.ex-record{fill:#fff;stroke:#d0d5cb}
.ex-current{stroke:#507459;stroke-width:2}
.ex-removed{fill:#e8e7e2;stroke:#cac7c0}
.ex-strike{stroke:#a27d7d;stroke-width:1.4}
@media(max-width:760px){.rule-example-layout{grid-template-columns:1fr;gap:20px}.rule-example{max-width:520px;width:100%}.rules-page .rule-statements h3{font-size:17px}}

.rule-browser{display:grid;grid-template-columns:235px minmax(0,1fr);gap:28px;align-items:start}
.rule-selector{display:flex;flex-direction:column;gap:5px;position:sticky;top:20px}
.rule-selector button{display:flex;gap:10px;text-align:left;align-items:baseline;font:500 12px/1.6 system-ui;color:#62665d;background:transparent;border:1px solid transparent;border-radius:6px;padding:10px;cursor:pointer}
.rule-selector button>span{flex:0 0 34px;font:11px ui-monospace,monospace;color:#507459}
.rule-selector button[aria-selected="true"]{background:#efeee5;border-color:#deddd3;color:#ad304d}
.rule-selector button:hover{background:#f2f1ea}
.rule-selector button:focus-visible,.rule-statements [role="tabpanel"]:focus-visible{outline:2px solid #507459;outline-offset:3px}
.rules-page .rule-browser .rule-statements>li{padding:22px 0}
.rules-page .rule-browser .rule-statements>li[hidden]{display:none}
.rule-browser .rule-example-layout{gap:22px;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
@media(max-width:1050px){.rule-browser{grid-template-columns:200px minmax(0,1fr);gap:20px}.rule-browser .rule-example-layout{grid-template-columns:1fr}}
@media(max-width:600px){.rule-browser{grid-template-columns:1fr;gap:18px}.rule-selector{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.rule-selector button{font-size:11px;padding:8px;gap:4px}.rule-selector button>span{flex-basis:30px}}
.rules-page .rule-statements .backward-mode-note{margin:0 0 22px;padding:12px 16px;border-left:3px solid #507459;background:#f0f1e9;color:#53614c;font-size:12px;line-height:1.8}
.rule-selector button>span{flex-basis:44px;white-space:nowrap}
.cut-definitions{margin:0;font-size:13px;line-height:1.7}
.cut-definitions>div{padding:10px 0;border-bottom:1px solid #e2e0d5}
.cut-definitions dt{font-weight:600;color:#507459}.cut-definitions dd{margin:3px 0 0;color:#555e53}
.cut-controls{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:16px}
.cut-controls button{border:1px solid #d0d5cb;border-radius:5px;padding:7px 13px;background:white;color:#555e53;cursor:pointer;font:12px system-ui}
.cut-controls button[aria-pressed="true"]{background:#507459;border-color:#507459;color:white}
.cut-controls button:focus-visible{outline:2px solid #ad304d;outline-offset:3px}
.rules-page .rule-statements .cut-example-note{font-size:11px;color:#62665d;line-height:1.7;margin-top:12px}
.ex-focus-box{fill:#e9c87d;fill-opacity:.09;stroke:#b58b36;stroke-width:1.5;stroke-dasharray:none;pointer-events:none}
.ex-cf-ring{fill:none;stroke:#8255b4;stroke-width:2.5;pointer-events:none}
.ex-cf-label{fill:#8255b4;font:700 10px system-ui,sans-serif;paint-order:stroke;stroke:#f6f5ef;stroke-width:3px;stroke-linejoin:round}
.cf-legend{color:#8255b4;font-weight:650}.focus-legend{border:1px solid #b58b36;border-radius:3px;padding:0 5px;color:#886723}
.example-focus-label{font:600 11px/1.6 system-ui;color:#886723;margin:8px 0}.example-focus-label>span{font-size:15px}
/* Focus framing stays quiet; node colors carry the semantic meaning. */
.ex-focus-box{fill:#77839a;fill-opacity:.035;stroke:#b5bdca;stroke-width:1;stroke-dasharray:4 4}
.focus-legend{border-color:#b5bdca;color:#626c7b}
/* Rule statements are primary content, rather than small diagram annotations. */
.ex-rule{font:650 15px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;fill:#344b40;paint-order:stroke;stroke:#f6f5ef;stroke-width:6px;stroke-linejoin:round}
.rule-example .ex-label{font-size:12px;fill:#4c574a}
.rule-example .ex-node{font-size:16px}
.rule-example .ex-value{font-size:12px}
.retraction-boundary{fill:#edf2f8;fill-opacity:.55;stroke:#7295bd;stroke-width:1.3;stroke-dasharray:4 3}
.retracted-value{font:500 14px ui-monospace,monospace;fill:#af8289}
.retracted-strike{stroke:#af8289;stroke-width:1.8;stroke-linecap:round}
.cf-request{border-left:3px solid #8255b4;padding:4px 0 4px 12px;display:grid;gap:3px;color:#74469f}
.cf-request strong{font:650 11px system-ui;text-transform:uppercase;letter-spacing:.06em}.cf-request>span{font:650 19px system-ui}.cf-request small{font:11px/1.6 system-ui;color:#6b6670}
.cf-phase-controls{display:flex;flex-wrap:wrap;gap:6px;margin:20px 0}
.cf-phase-controls button{font:500 11px/1.5 system-ui;padding:7px 9px;border:1px solid #d7d4dd;border-radius:5px;background:transparent;color:#655b6d;cursor:pointer}
.cf-phase-controls button[aria-pressed="true"]{background:#eee6f5;border-color:#8255b4;color:#673c91}.cf-phase-controls button:focus-visible{outline:2px solid #8255b4;outline-offset:3px}
.cf-single-state{display:flex;align-items:center;gap:20px;min-height:140px;margin:16px 0 24px}
.cf-single-node{flex:0 0 100px;min-height:120px;border:2px solid #8255b4;border-radius:18px;background:white;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
.cf-node-name{font:650 17px system-ui;color:#4e3b60}.cf-single-node>strong{font:650 30px ui-monospace,monospace;color:#343e35}.cf-single-node>span:last-child{font:10px system-ui;color:#756c7d}
.cf-support-state>strong{font:600 14px/1.6 system-ui;color:#4e3b60}.rules-page .rule-statements .cf-support-state p{font-size:12px;line-height:1.8;margin-top:7px}
.cf-history{border-top:1px solid #deddd3;padding-top:12px;margin-bottom:18px}.cf-history>span{font:500 11px system-ui;color:#737569}.cf-history>div{display:flex;justify-content:space-between;gap:12px;align-items:center;font:12px/1.6 system-ui;background:white;border:1px solid #deddd3;border-radius:5px;padding:10px;margin-top:8px}.cf-history>div[hidden]{display:none}.cf-history strong{font-size:10px;color:#6a6470}.cf-old-support.is-retracted>span{text-decoration:line-through;color:#a07f87}.cf-old-support.is-retracted{background:#eeece8}
@media(max-width:400px){.cf-single-state{gap:14px}.cf-single-node{flex-basis:85px}}
/* One state per diagram. Explanations and history never share graph coordinates. */
.rule-browser .rule-example-layout{grid-template-columns:1fr;gap:24px}
.rule-explanation{max-width:760px}
.clean-example{width:100%;max-width:none;padding:22px;background:#fafaf7}
.example-heading{font:600 14px/1.6 system-ui;color:#344b40;margin-bottom:14px}
.example-stages{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:20px}
.example-stages button{font:500 12px/1.5 system-ui;padding:8px 12px;background:white;border:1px solid #d8ded5;border-radius:6px;color:#54604f;cursor:pointer}
.example-stages button[aria-pressed="true"]{background:#405b47;color:white;border-color:#405b47}
.example-stages button:focus-visible{outline:2px solid #8255b4;outline-offset:3px}
.example-canvas svg{width:100%;height:auto;display:block}
.example-event{border-top:1px solid #deddd3;margin-top:16px;padding-top:16px;display:grid;gap:8px;min-height:78px;font:14px/1.8 system-ui;color:#414d3f}
.example-event strong{color:#344b40;font-size:14px}.example-event span{font-size:13px;color:#626b5e}
.example-node-name{font:600 17px system-ui;fill:#343e35}.example-node-value{font:650 24px ui-monospace,monospace;fill:#343e35}
.example-rule{font:650 17px ui-monospace,monospace;fill:#344b40;paint-order:stroke;stroke:#fafaf7;stroke-width:5px;stroke-linejoin:round}
.example-note{font:13px system-ui;fill:#65715f}
.example-support-row{fill:white;stroke:#cdd5c9;stroke-width:1.3}.example-support-text{font:500 15px ui-monospace,monospace;fill:#344b40}
@media(max-width:600px){.clean-example{padding:14px}.example-stages button{font-size:11px;padding:7px 9px}.example-event{font-size:13px}}
@media(max-width:600px){.example-rule{font-size:26px}.example-node-name{font-size:25px}.example-node-value{font-size:36px}.example-note{font-size:20px}.example-support-text{font-size:24px}}
.context-region{font:600 18px system-ui;fill:#5f7059}.context-rule{font:650 20px ui-monospace,monospace;fill:#405b47;paint-order:stroke;stroke:#fafaf7;stroke-width:5px}.context-value{font:500 31px ui-monospace,monospace}.context-old{font:18px ui-monospace,monospace;fill:#af8990}.context-note{font:12px system-ui;fill:#76816c}.context-cf{font:600 17px system-ui;fill:#8255b4}.context-cut{font:650 25px system-ui;fill:#bc6374;paint-order:stroke;stroke:#fafaf7;stroke-width:4px}
.example-canvas{overflow-x:auto}.example-canvas:has(.context-value) svg{min-width:760px}
@media(max-width:600px){.example-canvas:has(.context-value)::after{content:'Scroll horizontally to inspect the full graph →';display:block;font:11px/1.6 system-ui;color:#76816c;margin-top:8px}}
/* Keep rule navigation on the left; fit each illustration inside the right panel. */
.rule-browser{grid-template-columns:210px minmax(0,1fr);gap:28px}
.rule-selector{position:sticky;top:20px;display:flex;flex-direction:column;gap:5px}
.rule-browser .rule-statements{min-width:0}
.clean-example{padding:18px;max-width:100%;min-width:0}
.example-canvas:has(.context-value) svg{min-width:0;width:100%}
.example-canvas{overflow:visible}
.example-canvas:has(.context-value)::after{content:none}
.clean-example[data-example="2"] .example-canvas,.clean-example[data-example="3"] .example-canvas{max-width:560px;margin:0 auto}
.example-event{min-height:0}
@media(max-width:600px){.rule-browser{grid-template-columns:1fr;gap:18px}.rule-selector{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.clean-example{padding:12px}}
.activation-rule{font:650 22px ui-monospace,monospace;fill:#344b40;paint-order:stroke;stroke:#fafaf7;stroke-width:5px;stroke-linejoin:round}
.activation-value{font:500 30px ui-monospace,monospace}.activation-caption{font:600 14px system-ui;fill:#65715f}.activation-status{font:13px system-ui;fill:#76816c}
.activation-rule-id{font:650 14px ui-monospace,monospace}
.activation-rule-expression{font:550 19px ui-monospace,monospace;fill:#344b40}
/* Compact, balanced letterforms for node truth values. */
.activation-value{font:600 26px Arial,Helvetica,sans-serif}
.context-value{font:600 27px Arial,Helvetica,sans-serif}
.example-node-value{font:600 24px Arial,Helvetica,sans-serif}
@media(max-width:600px){.example-node-value{font-size:32px}}
.support-bar-caption{font:500 13px system-ui;fill:#6d7965}.support-bar-value{font:650 23px Arial,Helvetica,sans-serif}
.clean-example[data-example="2"] .example-canvas{max-width:none}
.clean-example[data-example="3"] .example-canvas{max-width:none}
.changed-focus-label{font:600 15px system-ui;paint-order:stroke;stroke:#fafaf7;stroke-width:4px;stroke-linejoin:round}
.cf-request-caption{font:650 16px system-ui;fill:#8255b4}
.forward-recompute-note{border-left:3px solid #819773;padding:4px 0 4px 16px;margin-top:24px;max-width:850px}
.forward-recompute-note h4{font:600 14px/1.6 system-ui;color:#405b47;margin:0 0 7px}
.rules-page .rule-statements .forward-recompute-note p{font-size:13px;line-height:1.8;color:#626b5e}
.rules-page .rule-statements .backward-intro{font-size:14px;line-height:1.9;margin:0 0 24px}
.rule-group-key{font:12px/1.9 system-ui;color:#796773;margin:0 0 20px}.rule-group-key strong{color:#842f49}.rule-group-key>span{margin:0 8px;color:#b3a7aa}
.rule-selector #tab-3,.rule-selector #tab-5{border-top:1px solid #deddd3;margin-top:10px;padding-top:14px}

.rhp-aggregation{margin-top:22px;padding-top:18px;border-top:1px solid #dedbd2}.rules-page .rhp-aggregation h4{margin:0 0 9px;color:#843e54;font:650 15px/1.5 Arial,sans-serif}.rules-page .rhp-aggregation p{font-size:13px;line-height:1.7;margin:8px 0}.rhp-aggregation-scroll{overflow-x:auto;margin:12px 0}.rhp-aggregation table{background:transparent;font:13px/1.65 Arial,sans-serif}.rhp-aggregation th,.rhp-aggregation td{padding:10px 14px;border-bottom:1px solid #dedbd2;vertical-align:top}.rhp-aggregation thead{background:#eeece5;color:#843e54}.rhp-aggregation tbody th{width:145px;color:#795062;font-weight:600}@media(max-width:600px){.rhp-aggregation th,.rhp-aggregation td{padding:9px 8px}.rhp-aggregation tbody th{width:105px}}
