:root {
  --canvas:#f3f5f6; --paper:#ffffff; --ink:#172b3a; --body:#22384a; --sub:#5c6c78; --rule:#dde3e7; --soft:#e9eef1;
  --brand:#163854; --link:#1f5f8e; --mark:#ffe48c; --mark-now:#f2b705; --done:#1e6b50;
  --d-GP:#2f6c9b; --d-CAH:#2a7b61; --d-OGN:#9b3f70; --d-MH:#5e4fa2; --d-RAPP:#99591f; --d-Bridge:#a8412f;
  --val-bg:#e7eef5; --c-escalate:#b23a2b; --c-pitfall:#a86a00; --c-counsel:#1f7a60; --c-current:#3f5fb0;
  --bar-h:56px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas:#0f1921; --paper:#16232d; --ink:#e4ebf0; --body:#cfdae2; --sub:#93a5b3; --rule:#25343f; --soft:#1d2c37;
    --brand:#10283c; --link:#83bde8; --mark:#6b5410; --mark-now:#c99a10; --done:#5cc49a;
    --d-GP:#7fb2db; --d-CAH:#6cc3a3; --d-OGN:#e08ab8; --d-MH:#ab9de6; --d-RAPP:#e0a46b; --d-Bridge:#ec8c78;
    --val-bg:#223545; --c-escalate:#f08a7a; --c-pitfall:#e8b04a; --c-counsel:#62c7a6; --c-current:#98aef0;
    color-scheme:dark;
  }
}

* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { -webkit-text-size-adjust:100%; scroll-padding-top:calc(var(--bar-h) + 20px); }
body { margin:0; background:var(--canvas); color:var(--ink); font:400 16px/1.55 "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif; font-synthesis:none; -webkit-font-smoothing:antialiased; }
a { color:var(--link); text-underline-offset:3px; text-decoration-thickness:1px; }
button, input { font:inherit; color:inherit; }
button { cursor:pointer; }
:focus-visible { outline:2px solid var(--link); outline-offset:2px; border-radius:4px; }
svg { display:block; }
.skip-link { position:absolute; left:12px; top:-60px; z-index:100; background:var(--paper); padding:8px 12px; border-radius:6px; }
.skip-link:focus { top:8px; }
.loading { color:var(--sub); padding:48px 24px; text-align:center; }

/* ---------- Bar ---------- */
.bar { position:sticky; top:0; z-index:40; background:var(--brand); color:#fff; }
.bar-inner { height:var(--bar-h); max-width:1440px; margin:0 auto; padding:0 20px; display:flex; align-items:center; gap:16px; }
.brand { color:#fff; text-decoration:none; font-weight:700; font-size:17px; letter-spacing:-.01em; white-space:nowrap; }
.search-wrap { position:relative; flex:1; max-width:560px; margin:0 auto; display:flex; align-items:center; gap:8px; }
.search-icon { position:absolute; left:11px; width:17px; height:17px; color:rgba(255,255,255,.7); pointer-events:none; }
#search { width:100%; height:38px; padding:0 12px 0 36px; border-radius:9px; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.1); color:#fff; font-size:15px; }
#search::placeholder { color:rgba(255,255,255,.66); }
#search:focus { outline:none; background:#fff; color:#172b3a; border-color:#fff; }
#search:focus ~ .search-icon, .search-wrap:focus-within .search-icon { color:#5c6c78; }
#search::-webkit-search-cancel-button { filter:grayscale(1); }
.search-close { display:none; background:none; border:0; color:#fff; font-weight:600; padding:8px 2px; }
.icon-btn { display:none; background:none; border:0; color:#fff; padding:8px; margin-left:auto; }
.icon-btn svg { width:20px; height:20px; }
.bank { display:inline-flex; align-items:center; gap:6px; color:#fff; text-decoration:none; font-weight:600; font-size:14px; white-space:nowrap; padding:7px 12px; border:1px solid rgba(255,255,255,.3); border-radius:9px; }
.bank svg { width:11px; height:11px; opacity:.8; }
.index-btn { display:none; align-items:center; gap:8px; background:none; border:0; color:#fff; padding:8px 10px 8px 6px; margin-left:-6px; border-radius:9px; font-weight:600; font-size:14px; white-space:nowrap; }
.index-btn svg { width:20px; height:20px; }
.index-btn:hover, .index-btn[aria-expanded="true"] { background:rgba(255,255,255,.1); }
.bank:hover { background:rgba(255,255,255,.1); }

/* ---------- Search results ---------- */
.results { position:absolute; top:calc(var(--bar-h) - 4px); left:50%; transform:translateX(-50%); width:min(760px, calc(100% - 32px)); max-height:calc(100vh - var(--bar-h) - 24px); overflow:auto; overscroll-behavior:contain; background:var(--paper); color:var(--ink); border:1px solid var(--rule); border-radius:12px; box-shadow:0 18px 48px rgba(10,30,45,.18); padding:6px 0 10px; }
.results-count, .results-empty { margin:8px 18px 4px; font-size:13px; color:var(--sub); }
.results-empty { padding:18px 0; font-size:15px; }
.results-list { list-style:none; margin:0; padding:0; }
.result { padding:8px 10px; border-top:1px solid var(--soft); }
.result:first-child { border-top:0; }
.result a { display:block; text-decoration:none; color:inherit; border-radius:8px; padding:6px 8px; }
.result a:hover, .result a:focus-visible { background:var(--soft); }
.result-topic { display:flex !important; align-items:baseline; gap:10px; font-weight:600; font-size:15.5px; }
.result-sec { padding-left:52px !important; }
.result-sec-title { display:block; font-size:13.5px; font-weight:600; color:var(--sub); }
.result-snippet { display:block; font-size:14px; line-height:1.5; color:var(--body); }
mark { background:var(--mark); color:inherit; border-radius:2px; padding:0 1px; }
mark.current { background:var(--mark-now); color:#1a1300; box-shadow:0 0 0 2px var(--mark-now); }

/* ---------- Shared ---------- */
.tag { flex:none; display:inline-block; min-width:34px; font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:.02em; color:var(--hue); }
.tick { flex:none; display:inline-grid; place-items:center; width:18px; height:18px; border-radius:50%; background:var(--done); color:var(--paper); }
.tick svg { width:11px; height:11px; }
.switch { display:inline-flex; padding:3px; gap:2px; background:var(--soft); border-radius:9px; }
.switch button { border:0; background:transparent; color:var(--sub); font-size:13px; font-weight:600; padding:6px 12px; border-radius:7px; min-height:32px; }
.switch button[aria-pressed="true"] { background:var(--paper); color:var(--ink); box-shadow:0 1px 2px rgba(10,30,45,.12); }

/* ---------- Contents ---------- */
.contents { max-width:1180px; margin:0 auto; padding:44px 24px 96px; }
.contents-head h1 { font-size:34px; line-height:1.15; letter-spacing:-.025em; margin:0 0 22px; font-weight:700; }
.contents-controls { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 24px; border-bottom:1px solid var(--rule); margin-bottom:28px; }
.tabs { display:flex; gap:24px; }
.tabs a { color:var(--sub); text-decoration:none; font-weight:600; font-size:15px; padding:10px 0 12px; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabs a[aria-current] { color:var(--ink); border-color:var(--ink); }
.contents-right { display:flex; align-items:center; gap:14px; padding-bottom:8px; }
.tally { font-size:13px; color:var(--sub); font-variant-numeric:tabular-nums; }
.group { margin:0 0 40px; }
.group-body { display:grid; gap:4px 56px; align-items:start; }
@media (min-width: 980px) { .group-body { grid-template-columns:1fr 1fr; } }
.block { min-width:0; }
.group h2 { display:flex; align-items:baseline; gap:10px; margin:0 0 6px; padding-left:12px; border-left:3px solid var(--hue); font-size:16px; font-weight:700; color:var(--ink); }
.group h2 .count { font-size:13px; font-weight:500; color:var(--sub); font-variant-numeric:tabular-nums; }
.entries { list-style:none; margin:0; padding:0; }
.group .subgroup { font-size:13.5px; font-weight:600; color:var(--sub); margin:18px 0 2px; padding-left:15px; }
.group-body .block:nth-child(-n+2) .subgroup { margin-top:8px; }
.entry.is-cross .entry-title { color:var(--body); }
.entry.is-cross .tag { opacity:.75; }
.entry { display:grid; grid-template-columns:auto 1fr auto; column-gap:12px; align-items:baseline; text-decoration:none; color:inherit; padding:9px 12px 10px 15px; border-radius:9px; }
.entry:hover { background:var(--paper); }
.entry .tag { grid-row:1; }
.entry-title { font-size:16px; font-weight:500; line-height:1.35; }
.entry .tick { grid-column:3; grid-row:1; align-self:center; }
.entry-focus { grid-column:2 / 4; font-size:13.5px; line-height:1.45; color:var(--sub); margin-top:2px; }
.entry.is-done .entry-title { color:var(--sub); }

.pres { max-width:860px; }
.pres-letter { font-size:15px; font-weight:700; color:var(--sub); margin:26px 0 6px; padding-bottom:6px; border-bottom:1px solid var(--rule); }
.pres-letter:first-child { margin-top:0; }
.pres-row { display:grid; grid-template-columns:minmax(180px, 2fr) 3fr; gap:6px 24px; padding:10px 6px; border-bottom:1px solid var(--soft); scroll-margin-top:calc(var(--bar-h) + 80px); }
.pres-row.flash { animation:flash 1.8s ease-out; }
@keyframes flash { from { background:var(--mark); } to { background:transparent; } }
.pres-name { font-weight:600; font-size:15.5px; line-height:1.4; }
.pres-extra { display:block; font-weight:400; font-size:13px; color:var(--sub); }
.pres-topics { display:flex; flex-direction:column; gap:2px; }
.pres-topic { display:flex; gap:10px; align-items:baseline; text-decoration:none; color:var(--body); font-size:14.5px; padding:2px 0; }
.pres-topic:hover span:last-child { text-decoration:underline; }

/* ---------- Reader ---------- */
.reader { max-width:1440px; margin:0 auto; display:grid; grid-template-columns:minmax(0,1fr); padding:0 20px; }
.side { display:none; }
.otp { display:none; }
.topic { width:100%; max-width:720px; margin:0 auto; padding:40px 0 96px; min-width:0; }
.topic-head { margin-bottom:12px; }
.crumb { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin:0 0 10px; font-size:14px; }
.crumb-domain { color:var(--hue); font-weight:600; text-decoration:none; }
.crumb-domain:hover { text-decoration:underline; }
.crumb-group { color:var(--sub); font-weight:500; }
.crumb-ess { color:var(--sub); font-size:12.5px; border:1px solid var(--rule); border-radius:999px; padding:0 8px; }
.topic h1 { font-size:34px; line-height:1.15; letter-spacing:-.025em; font-weight:700; margin:0 0 12px; text-wrap:balance; }
.focus { font-size:17.5px; line-height:1.5; color:var(--sub); margin:0; }

.sections-m { margin-top:20px; border:1px solid var(--rule); border-radius:10px; background:var(--paper); }
.sections-m summary { cursor:pointer; padding:11px 14px; font-weight:600; font-size:14.5px; list-style:none; display:flex; justify-content:space-between; align-items:center; }
.sections-m summary::-webkit-details-marker { display:none; }
.sections-m summary::after { content:""; width:8px; height:8px; border-right:1.8px solid var(--sub); border-bottom:1.8px solid var(--sub); transform:rotate(45deg) translateY(-3px); }
.sections-m[open] summary::after { transform:rotate(-135deg) translateY(-2px); }
.sections-m-list { margin:0; padding:0 14px 12px 34px; font-size:15px; }
.sections-m-list li { padding:4px 0; }
.sections-m-list a { color:var(--ink); text-decoration:none; }

/* Notes typography */
.notes { font-size:17.5px; line-height:1.65; color:var(--body); overflow-wrap:break-word; hyphens:manual; }
.notes h3 { font-size:21px; line-height:1.3; letter-spacing:-.012em; font-weight:700; color:var(--ink); margin:48px 0 14px; }
.notes h3:first-child { margin-top:32px; }
.notes h3 .anchor { color:inherit; text-decoration:none; }
.notes h3 .anchor:hover::after { content:"#"; color:var(--sub); font-weight:500; margin-left:8px; }
.notes h4 { font-size:17px; font-weight:700; color:var(--ink); margin:28px 0 8px; }
.notes p { margin:0 0 16px; }
.notes ul, .notes ol { margin:0 0 18px; padding-left:24px; }
.notes li { margin:0 0 8px; padding-left:4px; }
.notes li::marker { color:var(--sub); }
.notes ol li::marker { font-weight:600; font-variant-numeric:tabular-nums; }
.notes strong { font-weight:700; color:var(--ink); }
.notes .source-note { font-size:14px; color:var(--sub); }
.notes strong.lead { font-weight:600; }
.notes .term { font-style:italic; font-synthesis:style; font-weight:600; color:var(--ink); }
.notes .val { font-weight:600; font-variant-numeric:tabular-nums; color:var(--ink); background:var(--val-bg); border-radius:4px; padding:1px 4px; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.notes .callout { --tone:var(--sub); margin:6px 0 22px; padding:14px 18px 2px; border-left:3px solid var(--tone); border-radius:0 10px 10px 0; background:color-mix(in srgb, var(--tone) 8%, var(--paper)); }
.notes .callout p, .notes .callout ul, .notes .callout ol { margin-bottom:12px; }
.notes .callout-label { margin:0 0 4px !important; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--tone); }
.notes .callout-escalate { --tone:var(--c-escalate); }
.notes .callout-pitfall { --tone:var(--c-pitfall); }
.notes .callout-counsel { --tone:var(--c-counsel); }
.notes .callout-current { --tone:var(--c-current); }
.xref { font-weight:600; font-size:.92em; text-decoration:none; color:var(--hue); border-bottom:1px solid color-mix(in srgb, var(--hue) 40%, transparent); font-variant-numeric:tabular-nums; }
.xref:hover { border-bottom-color:var(--hue); }

/* Extras */
.extras { margin-top:56px; display:grid; gap:32px; }
.extra h2 { font-size:15px; font-weight:700; margin:0 0 12px; color:var(--ink); }
.extra-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.extra-link { font-size:14px; font-weight:600; text-decoration:none; }
.extra-link:hover { text-decoration:underline; }
.saqs { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; }
.saq { text-align:left; background:var(--paper); border:1px solid var(--rule); border-radius:10px; padding:11px 14px; display:flex; flex-direction:column; gap:3px; }
.saq:hover { border-color:var(--sub); }
.saq-title { font-size:14.5px; font-weight:600; line-height:1.35; color:var(--ink); }
.saq-set { font-size:12.5px; color:var(--sub); }
.cores { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.cores a { display:inline-block; font-size:14px; text-decoration:none; color:var(--body); background:var(--soft); border-radius:999px; padding:5px 12px; }
.cores a:hover { color:var(--ink); background:var(--rule); }

/* Footer */
.topic-foot { margin-top:48px; padding-top:28px; border-top:1px solid var(--rule); display:grid; gap:24px; }
.revised { justify-self:start; display:inline-flex; align-items:center; gap:8px; border:1px solid var(--rule); background:var(--paper); border-radius:10px; padding:10px 16px; font-weight:600; font-size:14.5px; color:var(--ink); }
.revised:hover { border-color:var(--sub); }
.revised[aria-pressed="true"] { color:var(--done); border-color:color-mix(in srgb, var(--done) 45%, transparent); }
.pager { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.pager a { text-decoration:none; color:inherit; border:1px solid var(--rule); border-radius:10px; padding:12px 16px; display:flex; flex-direction:column; gap:2px; background:var(--paper); }
.pager a:hover { border-color:var(--sub); }
.pager-next { text-align:right; grid-column:2; }
.pager-label { font-size:12.5px; color:var(--sub); }
.pager-title { font-size:15px; font-weight:600; line-height:1.35; }

/* Sidebar index and section list (wide screens) */
.side h2, .otp h2 { font-size:13px; font-weight:700; margin:0 0 6px; }
.side { position:sticky; top:var(--bar-h); height:calc(100vh - var(--bar-h)); overflow-y:auto; overscroll-behavior:contain; padding:24px 12px 48px 0; border-right:1px solid var(--rule); scrollbar-width:thin; }
.side .switch { margin:0 0 20px 8px; }
.side-group { margin-bottom:22px; }
.side-group h2 { color:var(--hue); padding-left:8px; }
.side-group ol { list-style:none; margin:0; padding:0; }
.side-link { display:grid; grid-template-columns:34px 1fr auto; gap:6px; align-items:baseline; padding:5px 8px; border-radius:7px; text-decoration:none; color:var(--body); font-size:13.5px; line-height:1.35; }
.side-link:hover { background:var(--soft); }
.side-link[aria-current] { background:var(--paper); color:var(--ink); font-weight:600; box-shadow:inset 3px 0 0 var(--hue); }
.side-id { font-size:11.5px; color:var(--sub); font-variant-numeric:tabular-nums; font-weight:600; }
.side-link .tick { width:14px; height:14px; align-self:center; }
.side-link .tick svg { width:9px; height:9px; }
.otp { position:sticky; top:calc(var(--bar-h) + 40px); align-self:start; max-height:calc(100vh - var(--bar-h) - 60px); overflow-y:auto; padding:0 0 24px; }
.otp h2 { color:var(--sub); }
.otp-list { list-style:none; margin:0; padding:0; border-left:1px solid var(--rule); }
.otp-list a { display:block; padding:6px 0 6px 14px; margin-left:-1px; border-left:2px solid transparent; color:var(--sub); text-decoration:none; font-size:13.5px; line-height:1.4; }
.otp-list a:hover { color:var(--ink); }
.otp-list a.active { color:var(--ink); border-left-color:var(--hue); font-weight:600; }

@media (min-width: 1000px) {
  .reader { grid-template-columns:minmax(0,1fr) 210px; gap:48px; padding:0 32px; }
  .otp { display:block; padding-top:40px; }
  .sections-m { display:none; }
}
@media (min-width: 1240px) {
  .reader { grid-template-columns:270px minmax(0,1fr) 210px; gap:48px; padding:0 24px 0 16px; }
  .side { display:block; }
}
/* Below the three-column width the topic index opens as a drawer from the bar. */
@media (max-width: 1239.98px) {
  body.topic-view .index-btn { display:inline-flex; }
  .side { display:block; position:fixed; z-index:35; top:var(--bar-h); left:0; bottom:0; height:auto; width:min(320px, 86vw); padding:20px 12px 48px 8px; background:var(--canvas); box-shadow:0 18px 48px rgba(10,30,45,.18); transform:translateX(-100%); visibility:hidden; transition:transform .2s ease, visibility 0s linear .2s; }
  body.index-open .side { transform:none; visibility:visible; transition:transform .2s ease; }
  .index-scrim { position:fixed; z-index:34; inset:var(--bar-h) 0 0; background:rgba(10,30,45,.32); }
  body.index-open { overflow:hidden; }
}

/* In-page finder */
.finder { position:fixed; z-index:30; left:50%; bottom:20px; transform:translateX(-50%); display:flex; align-items:center; gap:4px; background:var(--ink); color:var(--paper); border-radius:999px; padding:5px 6px 5px 16px; box-shadow:0 10px 30px rgba(10,30,45,.28); font-size:14px; max-width:calc(100% - 24px); }
.finder-label { font-weight:600; max-width:30vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.finder-count { color:color-mix(in srgb, var(--paper) 72%, transparent); margin:0 6px 0 4px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.finder button { border:0; background:transparent; color:inherit; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; }
.finder button:hover:not(:disabled) { background:color-mix(in srgb, var(--paper) 16%, transparent); }
.finder button:disabled { opacity:.35; cursor:default; }
.finder svg { width:16px; height:16px; }

/* Signature */
.signature { margin:0; padding:0 20px 18px; text-align:right; font-size:13px; font-weight:500; letter-spacing:.1em; color:var(--sub); opacity:.45; user-select:none; pointer-events:none; }
@media (min-width: 1000px) { .signature { position:fixed; right:22px; bottom:16px; padding:0; z-index:5; } }

/* ---------- Phone ---------- */
@media (max-width: 700px) {
  .bar-inner { padding:0 14px; gap:10px; }
  .search-wrap { display:none; }
  .icon-btn { display:block; }
  .bank { padding:6px 10px; font-size:13.5px; }
  body.searching .brand, body.searching .icon-btn, body.searching .bank, body.searching .index-btn { display:none !important; }
  .index-btn { padding:8px; }
  .index-btn span { display:none; }
  body.searching .search-wrap { display:flex; max-width:none; }
  body.searching .search-close { display:block; }
  #search { font-size:16px; }
  .results { position:fixed; top:var(--bar-h); left:0; transform:none; width:100%; max-height:none; bottom:0; border-radius:0; border:0; box-shadow:none; }
  .result-sec { padding-left:8px !important; }
  .contents { padding:28px 16px 72px; }
  .contents-head h1 { font-size:28px; margin-bottom:16px; }
  .contents-controls { border-bottom:0; margin-bottom:20px; }
  .tabs { width:100%; border-bottom:1px solid var(--rule); }
  .contents-right { width:100%; justify-content:space-between; }
  .entry { padding:9px 6px 10px 15px; }
  .pres-row { grid-template-columns:1fr; gap:6px; }
  .reader { padding:0 16px; }
  .topic { padding-top:26px; }
  .topic h1 { font-size:28px; }
  .focus { font-size:16px; }
  .notes { font-size:17px; line-height:1.63; }
  .notes h3 { font-size:19.5px; margin-top:40px; }
  .notes ul, .notes ol { padding-left:20px; }
  .pager { grid-template-columns:1fr; }
  .pager-next { grid-column:1; text-align:left; }
  .finder { bottom:14px; }
  .finder-label { max-width:28vw; }
}
@media (prefers-reduced-motion: reduce) { * { animation:none !important; scroll-behavior:auto !important; } }

@media print {
  .bar, .side, .otp, .sections-m, .finder, .topic-foot, .extras, .skip-link, .signature { display:none !important; }
  body { background:#fff; color:#000; }
  .reader { display:block; padding:0; }
  .topic { max-width:none; padding:0; }
  .notes { font-size:11pt; color:#000; }
  mark { background:none; }
  .notes .callout { background:none; border-left-width:2px; break-inside:avoid; }
  .notes .val { background:none; padding:0; }
}
