/* LOPW docs: the institutional navy-and-brass design system shared with the homepage.
   Day theme by default; night only via data-theme="dark" (no prefers-color-scheme rules). */
:root {
  --bg: #f5f3ed;
  --surface: #fffdf8;
  --surface-2: #ece8de;
  --ink: #0f1a2b;
  --ink-2: #34405a;
  --muted: #5b647a;
  --line: #dbd5c6;
  --line-2: #bdb4a0;
  --accent: #876420;
  --accent-2: #b8893a;
  --accent-soft: rgba(184, 137, 58, .13);
  --ok: #2f6b4a;
  --ok-soft: rgba(47, 107, 74, .12);
  --warn: #9b2c2c;
  --warn-soft: rgba(155, 44, 44, .07);
  --navy: #0f1b30;
  --code-bg: #0f1b30;
  --code-ink: #dfe4ee;
  --code-dim: #8792a8;
  --code-key: #d6aa52;
  --code-str: #9fd3b8;
  --code-fn: #c9d3e6;
  --serif: "Spectral", "Iowan Old Style", Georgia, serif;
  --f: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --m: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --top: 62px;
  --g: clamp(16px, 3vw, 32px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #101c31; --surface-2: #14223a; --ink: #e8eaef; --ink-2: #c0c8d6; --muted: #8e98ad;
  --line: #1d2a41; --line-2: #2f3f5b; --accent: #d4a84f; --accent-2: #b48a3c; --accent-soft: rgba(212, 168, 79, .12);
  --ok: #7cc49a; --ok-soft: rgba(124, 196, 154, .12); --warn: #e8807a; --warn-soft: rgba(232, 128, 122, .08);
  --navy: #060c17; --code-bg: #070d19; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; scroll-padding-top: calc(var(--top) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.65 var(--f); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overflow-x: clip; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-2); color: #fff; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font-family: inherit; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 max(var(--g), env(safe-area-inset-right)) 0 max(var(--g), env(safe-area-inset-left)); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .18em; font-size: .95rem; min-height: 44px; }
.wordmark svg { width: 26px; height: 26px; flex: none; }
.wordmark span { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); letter-spacing: 0; padding-left: 12px; border-left: 1px solid var(--line-2); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: .88rem; padding: 0 12px; min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; }
.topnav a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-2); }
.topnav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent-2); }
.theme-toggle { appearance: none; margin-left: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 500 .72rem/1 var(--m); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; border-radius: 2px; }
.theme-toggle:hover { border-color: var(--accent-2); }
.theme-toggle i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); flex: none; }
@media (max-width: 400px) { .theme-toggle .lbl { display: none; } .theme-toggle { padding: 0; width: 44px; } }
@media (max-width: 760px) { .wordmark span { display: none; } }
.mnu { display: none; position: relative; }
.mnu summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px; cursor: pointer; font: 500 .72rem/1 var(--m); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line-2); border-radius: 2px; }
.mnu summary::-webkit-details-marker { display: none; }
.mnu summary svg { width: 16px; height: 16px; flex: none; }
.mnu summary:hover, .mnu[open] summary { border-color: var(--accent-2); }
.mnu-p { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--surface); border: 1px solid var(--line-2); border-top: 2px solid var(--accent-2); box-shadow: 0 30px 60px -30px rgba(15, 26, 43, .5); padding: 6px; display: grid; z-index: 50; }
.topnav .mnu-p a { display: flex; justify-content: flex-start; min-height: 44px; padding: 0 14px; font-size: .95rem; color: var(--ink); box-shadow: none; font-weight: 400; }
.topnav .mnu-p a:hover { background: var(--accent-soft); }
.topnav .mnu-p a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.mnu-p hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@media (max-width: 640px) { .topnav > a { display: none; } .mnu { display: block; } }

/* layout */
.shell { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 0 clamp(24px, 3vw, 48px); padding: 0 max(var(--g), env(safe-area-inset-right)) 0 max(var(--g), env(safe-area-inset-left)); }
.sidebar { position: sticky; top: var(--top); align-self: start; max-height: calc(100dvh - var(--top)); overflow: auto; padding: 24px 0 40px; font-size: .9rem; border-right: 1px solid var(--line); overscroll-behavior: contain; }
.sidebar details > summary { display: none; }
.sidebar .grp { margin: 0 0 18px; }
.sidebar .grp-t, .grp-map .grp-t { font-family: var(--m); font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; padding: 0 12px; }
.sidebar .grp.cur .grp-t { color: var(--accent); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; min-height: 34px; padding: 5px 12px; margin-right: 14px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.3; }
.sidebar a:hover { background: var(--surface); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent-2); font-weight: 600; }
.side-note { font-size: .78rem; color: var(--muted); padding: 10px 12px 0; margin: 0; border-top: 1px solid var(--line); }
.side-note a { color: var(--muted); }

/* search */
.search { position: relative; display: flex; align-items: center; margin: 0 14px 14px 0; border: 1px solid var(--line-2); border-radius: 2px; background: var(--surface); }
.search svg { width: 16px; height: 16px; margin: 0 8px 0 12px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .92rem; min-height: 44px; padding: 0; outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.search kbd { font: 500 .7rem var(--m); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; margin-right: 10px; }
.sr { margin: 0 14px 16px 0; border: 1px solid var(--line-2); border-top: 2px solid var(--accent-2); background: var(--surface); padding: 6px 0 4px; }
.sr .sr-n { font-family: var(--m); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 4px 12px 6px; }
.sr ol { list-style: none; margin: 0; padding: 0; }
.sr a { display: block; padding: 8px 12px; min-height: 44px; color: var(--ink); text-decoration: none; border-left: 2px solid transparent; }
.sr a:hover, .sr a[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent-2); }
.sr a b { display: block; font-weight: 600; font-size: .9rem; }
.sr a span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.sr a small { font-family: var(--m); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sr mark { background: var(--accent-soft); color: inherit; padding: 0 1px; }

.content { min-width: 0; padding: 40px 0 96px; max-width: 800px; }
.otp { position: sticky; top: var(--top); align-self: start; padding: 40px 0; font-size: .84rem; max-height: calc(100dvh - var(--top)); overflow: auto; }
.otp p { font-family: var(--m); font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.otp ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.otp a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.otp a:hover { color: var(--ink); }
.otp a.active { color: var(--accent); border-left-color: var(--accent); }
.otp .otp-md { margin-top: 16px; text-transform: none; letter-spacing: 0; font-family: var(--f); font-size: .8rem; }

@media (max-width: 1200px) { .shell { grid-template-columns: 240px minmax(0, 1fr); } .otp { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; border-right: 0; padding: 16px 0 0; }
  .sidebar details { border: 1px solid var(--line-2); border-radius: 2px; background: var(--surface); }
  .sidebar details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; cursor: pointer; font-weight: 600; list-style: none; }
  .sidebar details > summary::-webkit-details-marker { display: none; }
  .sidebar details > summary::after { content: "+"; font-family: var(--m); color: var(--muted); }
  .sidebar details[open] > summary::after { content: "–"; }
  .sidebar details[open] > summary { border-bottom: 1px solid var(--line); }
  .sidebar .nav-in { padding: 14px 0 6px; }
  .sidebar a { min-height: 44px; }
  .search { margin: 0 12px 12px; }
  .sr { margin: 0 12px 12px; }
  .side-note { padding: 10px 14px 6px; }
  .content { padding-top: 24px; }
}

/* type */
.crumb { font-family: var(--m); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--muted); }
h1 { font-family: var(--serif); font-size: clamp(2.1rem, 4.6vw, 3.1rem); line-height: 1.06; letter-spacing: -.012em; margin: 0 0 16px; font-weight: 300; overflow-wrap: anywhere; }
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 28px; max-width: 42em; }
h2 { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.01em; margin: 56px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); font-weight: 400; }
h3 { font-size: 1.1rem; line-height: 1.3; margin: 32px 0 10px; font-weight: 600; }
h4 { font-size: 1rem; margin: 22px 0 8px; }
h2 .anchor, h3 .anchor { color: var(--line-2); text-decoration: none; margin-left: 8px; font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
p, li, dd { color: var(--ink-2); }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin: 6px 0; }
strong { color: var(--ink); font-weight: 600; }
code { font-family: var(--m); font-size: .86em; background: var(--surface-2); padding: .1em .36em; border-radius: 2px; overflow-wrap: anywhere; }
kbd { font-family: var(--m); font-size: .85em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* code blocks */
.codeblock { position: relative; margin: 18px 0 24px; border-radius: 3px; background: var(--code-bg); border: 1px solid rgba(233, 235, 240, .08); overflow: hidden; }
.codeblock .cb-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 0 16px; min-height: 44px; border-bottom: 1px solid rgba(233, 235, 240, .12); font-family: var(--m); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--code-dim); }
.codeblock pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-family: var(--m); font-size: .82rem; line-height: 1.65; color: var(--code-ink); tab-size: 2; }
.codeblock pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; color: inherit; }
.copy { appearance: none; border: 0; background: transparent; color: var(--code-dim); font: 500 .74rem var(--m); min-width: 64px; min-height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer; }
.copy:hover, .copy:focus-visible { color: var(--code-key); background: rgba(233, 235, 240, .06); }
.copy.done { color: var(--code-str); }
.tk-k { color: var(--code-key); } .tk-s { color: var(--code-str); } .tk-c { color: var(--code-dim); font-style: italic; } .tk-f { color: var(--code-fn); } .tk-n { color: #e8c98a; }

/* callouts */
.callout { border: 1px solid var(--line); border-left: 2px solid var(--accent-2); background: var(--surface); padding: 14px 16px; margin: 20px 0; }
.callout p { margin: 0; color: var(--ink-2); }
.callout p + p, .callout p + ul { margin-top: 8px; }
.callout ul { margin: 0; }
.callout .ct { font-family: var(--m); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.warn .ct { color: var(--warn); }

/* tables */
.table { overflow-x: auto; margin: 16px 0 24px; border-top: 1px solid var(--ink); -webkit-overflow-scrolling: touch; max-width: 100%; }
.table table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table.wide table { min-width: 560px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
.table th { background: transparent; font-family: var(--m); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table td:first-child { font-weight: 500; color: var(--ink); }
.table td code { white-space: nowrap; }
.table td code:only-child { white-space: normal; }

/* plain-English intro */
.analogy { padding-left: 0 !important; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 18px; padding: 0; list-style: none; counter-reset: a; }
.analogy li { counter-increment: a; border: 1px solid var(--line-2); padding: 18px; background: var(--surface); margin: 0; }
.analogy li::before { content: counter(a); display: block; font-family: var(--serif); font-weight: 300; font-size: 2.2rem; line-height: 1; color: var(--accent); margin-bottom: 10px; }
.analogy b { display: block; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 700px) { .analogy { grid-template-columns: minmax(0, 1fr); } }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.card { display: block; border: 1px solid var(--line-2); padding: 18px 20px; text-decoration: none; color: inherit; background: var(--surface); transition: background-color .15s, border-color .15s; min-height: 44px; }
.card:hover { border-color: var(--accent-2); background: var(--accent-soft); text-decoration: none; }
.card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--ink); margin-bottom: 4px; }
.card span { color: var(--muted); font-size: .92rem; }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }

.flowline { padding-left: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.flowline li { margin: 0; font-family: var(--m); font-size: .76rem; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); padding: 6px 12px; }
.flowline li:last-child { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-2); }

.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 18px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent-2); display: grid; place-items: center; font-family: var(--m); font-size: .76rem; font-weight: 500; color: var(--accent); background: var(--bg); }

.tag { display: inline-block; font-family: var(--m); font-size: .68rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.tag.ok { background: var(--accent-soft); color: var(--accent); }

/* networks: cards, addresses, the "for agents" box */
.nets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 26px; }
.net { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); padding: 16px 18px; text-decoration: none; color: inherit; min-height: 44px; min-width: 0; transition: background-color .15s, border-color .15s; }
.net:hover { border-color: var(--accent-2); background: var(--accent-soft); text-decoration: none; }
.net.ref { grid-column: 1 / -1; border-color: var(--accent-2); border-left-width: 3px; }
.net-n { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.15; color: var(--ink); }
.net .tag { align-self: flex-start; }
.net-d { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.net-d code { white-space: nowrap; }
@media (max-width: 760px) { .nets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .nets { grid-template-columns: minmax(0, 1fr); } }
.table td code.addr, code.addr { white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.callout.agents { border-left-color: var(--accent); }
.callout.agents .table { margin: 6px 0 0; border-top: 0; }
.callout.agents .table td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .callout.agents .table td:first-child { white-space: normal; } }

.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 56px; }
.pager a { border: 1px solid var(--line-2); background: var(--surface); padding: 14px 16px; text-decoration: none; color: var(--ink); min-height: 44px; overflow-wrap: anywhere; }
.pager a:hover { border-color: var(--accent-2); background: var(--accent-soft); }
.pager small { display: block; color: var(--accent); font-family: var(--m); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 480px) { .pager { grid-template-columns: minmax(0, 1fr); } .pager .next { grid-column: 1; } }

/* glossary, faq, decisions */
.gloss { margin: 20px 0; }
.gloss dt { font-weight: 600; color: var(--ink); margin: 18px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.gloss dd { margin: 0; }
.faq { border-top: 1px solid var(--line); }
.faq:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--m); color: var(--accent); flex: none; }
.faq[open] summary::after { content: "–"; }
.faq > div { padding: 0 0 16px; }
.faq > div p { margin: 0; }
.dec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 24px; }
.dec h3 { margin-top: 12px; }
.dec-id { font-family: var(--m); font-weight: 500; font-size: .78rem; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; margin-right: 6px; vertical-align: middle; }
.grp-map { margin: 18px 0; }
.grp-map .grp-t { padding: 0; }
.grp-map ul { padding-left: 1.2em; }

/* figures */
.fig { margin: 22px 0; }
.fig svg { width: 100%; height: auto; display: block; }
.fig figcaption { font-size: .86rem; color: var(--muted); margin-top: 8px; }

/* tabs */
.tabs { margin: 18px 0 24px; }
.tabs .tl { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-2); }
.tabs .tl button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 .8rem var(--m); letter-spacing: .08em; text-transform: uppercase; min-height: 44px; padding: 0 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tl button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent-2); }
.tabs .tl button:hover { color: var(--ink); }
.tabs .tp > .codeblock:first-child { margin-top: 12px; }
html:not(.js) .tabs .tp[hidden] { display: block; }

/* widgets: shared chrome */
.wg { margin: 22px 0 28px; border: 1px solid var(--line-2); background: var(--surface); }
.wg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.wg-t { margin: 0; font-family: var(--m); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.wg-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wg-ctl button { appearance: none; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: 500 .74rem var(--m); letter-spacing: .08em; text-transform: uppercase; min-height: 44px; min-width: 44px; padding: 0 14px; cursor: pointer; border-radius: 2px; }
.wg-ctl button:hover, .wg-ctl button[aria-pressed="true"] { border-color: var(--accent-2); background: var(--accent-soft); color: var(--ink); }
.wg-ctl button[disabled] { opacity: .45; cursor: default; }
.wg-status { font-family: var(--m); font-size: .72rem; color: var(--muted); margin-left: 6px; min-width: 0; }
.wg-sel { font-size: .84rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.wg-sel select { font: inherit; font-size: .88rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; min-height: 44px; padding: 0 10px; max-width: 100%; }
.wg-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 14px; }
.wg-stage { min-width: 0; }
.wg-stage svg { width: 100%; height: auto; display: block; }
@media (max-width: 760px) { .wg-body { grid-template-columns: minmax(0, 1fr); } }

/* flow (sequence) */
.flow-svg text { font-family: var(--f); font-size: 10.5px; fill: var(--ink-2); }
.flow-svg .lane line { stroke: var(--line-2); stroke-dasharray: 3 4; }
.flow-svg .lane rect { fill: var(--surface-2); stroke: var(--line-2); }
.flow-svg .lane text { font-family: var(--m); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; fill: var(--ink); }
.flow-svg .num { font-family: var(--m); font-size: 9px; fill: var(--muted); }
.flow-svg .msg .arrow { stroke: var(--line-2); stroke-width: 1.4; fill: none; color: var(--line-2); transition: stroke .25s, color .25s; }
.flow-svg .msg text { fill: var(--muted); transition: fill .25s; }
.flow-svg .msg .tok { fill: var(--accent); opacity: 0; }
.flow-svg .msg.done .arrow { stroke: var(--ink-2); color: var(--ink-2); }
.flow-svg .msg.done text { fill: var(--ink-2); }
.flow-svg .msg.on .arrow { stroke: var(--accent); color: var(--accent); stroke-width: 2; }
.flow-svg .msg.on text { fill: var(--ink); font-weight: 600; }
.flow-svg .msg.on .tok { opacity: 1; }
.wg-steps { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.wg-steps li { counter-increment: f; position: relative; padding: 8px 10px 8px 40px; margin: 0; border-left: 2px solid transparent; font-size: .9rem; color: var(--muted); }
.wg-steps li::before { content: counter(f); position: absolute; left: 8px; top: 9px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--m); font-size: .68rem; color: var(--muted); }
.wg-steps li b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }
.wg-steps li.on { border-left-color: var(--accent-2); background: var(--accent-soft); color: var(--ink-2); }
.wg-steps li.on::before { border-color: var(--accent); color: var(--accent); background: var(--bg); }
.wg-steps li.on b { color: var(--ink); }
.wg-steps li.done::before { background: var(--ink-2); color: var(--bg); border-color: var(--ink-2); }
html.js .wg-flow .wg-steps li:not(.on):not(.done) { color: var(--muted); }

/* chains (one protocol, bound to each chain): a hub-and-spoke variant of the flow widget */
.chains-svg .core circle { fill: var(--surface); stroke: var(--accent-2); stroke-width: 1.5; }
.chains-svg .core .ct { font-family: var(--serif); font-size: 17px; fill: var(--ink); letter-spacing: .04em; }
.chains-svg .core .cs { font-family: var(--m); font-size: 7px; letter-spacing: .1em; text-transform: uppercase; fill: var(--accent); }
.chains-svg .node circle { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.2; transition: fill .25s, stroke .25s; }
.chains-svg .msg .node text { font-family: var(--m); font-size: 8.4px; letter-spacing: .02em; fill: var(--ink-2); }
.chains-svg .msg.done .node circle { stroke: var(--ink-2); }
.chains-svg .msg.on .node circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.8; }
.chains-svg .msg.planned .arrow, .chains-svg .msg.planned .node circle { stroke-dasharray: 4 3; }
.chains-svg .msg .ref { font-family: var(--m); font-size: 6.6px; letter-spacing: .12em; text-transform: uppercase; fill: var(--accent); font-weight: 500; }

/* state machine */
.sm-svg text { font-family: var(--m); font-size: 10px; letter-spacing: .04em; fill: var(--ink); pointer-events: none; }
.sm-svg .node circle { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.4; transition: fill .25s, stroke .25s; cursor: pointer; }
.sm-svg .node:hover circle, .sm-svg .node:focus-visible circle { stroke: var(--accent-2); }
.sm-svg .node:focus { outline: none; }
.sm-svg .node.sel circle { stroke: var(--accent); stroke-width: 2.2; }
.sm-svg .node.on circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.2; }
.sm-svg .node.on text { font-weight: 600; }
.sm-svg .edge { stroke: var(--line-2); stroke-width: 1.3; fill: none; color: var(--line-2); transition: stroke .25s, color .25s; }
.sm-svg .edge.hi { stroke: var(--accent); color: var(--accent); stroke-width: 2.2; }
.sm-svg .edge.dim { opacity: .35; }
.sm-svg .sm-tok { fill: var(--accent); opacity: 0; }
.sm-svg .sm-tok.on { opacity: 1; }
.sm-side { font-size: .9rem; }
.sm-narr { margin: 0 0 10px; color: var(--ink-2); min-height: 3em; }
.sm-list { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.sm-list li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); margin: 0; }
.sm-list li b { color: var(--ink); font-family: var(--m); font-weight: 500; font-size: .8rem; }

/* byte layout */
.bl-body { display: block; }
.bl-t { margin: 0 0 10px; font-family: var(--m); font-size: .82rem; color: var(--ink); overflow-wrap: anywhere; }
.bl-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bl-strip .seg { flex: 1 1 140px; min-width: 0; border: 1px solid var(--line-2); border-top: 3px solid var(--line-2); background: var(--bg); padding: 8px 10px; cursor: pointer; margin: 0; }
.bl-strip .seg b { display: block; font-weight: 600; color: var(--ink); font-size: .84rem; overflow-wrap: anywhere; }
.bl-strip .seg span { font-family: var(--m); font-size: .74rem; color: var(--muted); }
.bl-strip .seg.s-tag { border-top-color: var(--accent); flex-grow: 1; }
.bl-strip .seg.s-net { border-top-color: var(--ink-2); flex-grow: 2; }
.bl-strip .seg.s-reg { border-top-color: var(--muted); flex-grow: 2; }
.bl-strip .seg.s-body { border-top-color: var(--accent-2); flex-grow: 6; }
.bl-strip .seg:hover, .bl-strip .seg.sel { background: var(--accent-soft); border-color: var(--accent-2); }
.bl-out { margin: 12px 0 0; }
.bl-out p { margin: 6px 0; font-size: .86rem; }
.bl-out p b { display: block; color: var(--ink); }
.bl-out p code { display: block; font-size: .74rem; overflow-wrap: anywhere; padding: 6px 8px; }
.bl-arrow { display: block; font-family: var(--m); font-size: .74rem; color: var(--accent); margin: 8px 0 2px; }
.bl-detail { margin: 12px 0 0; font-family: var(--m); font-size: .74rem; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; overflow-wrap: anywhere; min-height: 44px; }
.bl-xdr { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.bl-xdr summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--ink); font-weight: 600; font-size: .9rem; }
.bl-xdr .table { font-size: .8rem; }
.bl-xdr td code { white-space: nowrap; font-size: .74rem; }
.bl-xdr tr.d1 td:last-child { padding-left: 8px; } .bl-xdr tr.d2 td:last-child { padding-left: 16px; } .bl-xdr tr.d3 td:last-child { padding-left: 24px; } .bl-xdr tr.d4 td:last-child { padding-left: 32px; }

/* claim pipeline */
.pipe { list-style: none; margin: 0; padding: 14px; counter-reset: g; }
.pipe li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; margin: 0; border-top: 1px solid var(--line); color: var(--muted); transition: color .25s; }
.pipe li:first-child { border-top: 0; }
.pipe li b { display: block; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.pipe li p { margin: 2px 0; font-size: .86rem; color: var(--muted); }
.pipe li small { font-family: var(--m); font-size: .7rem; color: var(--muted); }
.pipe .pg-n { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); margin-top: 2px; position: relative; transition: background-color .25s, border-color .25s; }
.pipe li.pass .pg-n { background: var(--ok); border-color: var(--ok); }
.pipe li.pass .pg-n::after { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pipe li.pass b { color: var(--ink); }
.pipe li.on .pg-n { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pipe li.on b { color: var(--ink); }
.pipe li.rej .pg-n { background: var(--accent-soft); border-color: var(--accent); }
.pipe li.rej b { color: var(--accent); }
.pipe li.fail .pg-n { background: var(--warn); border-color: var(--warn); }
.pipe li.fail .pg-n::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; line-height: 1; }
.pipe li.fail b, .pipe li.fail small { color: var(--warn); }
.pipe-out { margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink); min-height: 44px; }
.pipe-out.paid { color: var(--ok); } .pipe-out.err { color: var(--warn); }

/* calculator */
.calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; margin: 0; }
.calc fieldset { border: 1px solid var(--line); padding: 10px 12px 12px; margin: 0; min-width: 0; }
.calc legend { font-family: var(--m); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 0 6px; }
.calc label { display: block; font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.calc label span { display: block; margin-bottom: 4px; }
.calc input { width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; min-height: 44px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.calc input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.calc-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; padding: 4px 14px 10px; border-top: 1px solid var(--line); }
.calc-out div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.calc-out dt { font-size: .78rem; color: var(--muted); }
.calc-out dd { margin: 0; font-family: var(--m); font-size: .92rem; color: var(--ink); overflow-wrap: anywhere; }
.calc-out dd.warn { color: var(--warn); }
.calc-note { margin: 0; padding: 10px 14px 14px; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .calc { grid-template-columns: minmax(0, 1fr); } .calc-out { grid-template-columns: minmax(0, 1fr); } }

/* predicate explorer */
.ex-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.ex-pick label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg); font: 500 .76rem var(--m); color: var(--ink); cursor: pointer; }
.ex-pick label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-2); }
.ex-pick input { margin: 0; accent-color: var(--accent); }
.ex-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; padding: 14px; }
.ex-form { display: grid; gap: 12px; margin: 0; min-width: 0; }
.ex-form fieldset { border: 1px solid var(--line); padding: 8px 12px 12px; margin: 0; min-width: 0; }
.ex-form legend { font-family: var(--m); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 0 6px; }
.ex-form fieldset > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.ex-form label { display: block; font-size: .8rem; color: var(--muted); min-width: 0; }
.ex-form label span { display: block; margin-bottom: 3px; font-family: var(--m); font-size: .72rem; }
.ex-form input, .ex-form select { width: 100%; font: inherit; font-size: .9rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; min-height: 44px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.ex-form .ro { font-family: var(--m); font-size: .8rem; color: var(--ink-2); grid-column: 1 / -1; overflow-wrap: anywhere; }
.ex-verdict { border: 1px solid var(--line-2); background: var(--bg); padding: 14px; min-width: 0; }
.ex-badge { margin: 0 0 8px; font-family: var(--m); font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 8px 12px; display: inline-block; border: 1px solid var(--line-2); }
.ex-badge.proven { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.ex-badge.not_proven { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.ex-badge.not_verifiable { color: var(--muted); }
.ex-why { margin: 0 0 10px; font-size: .9rem; color: var(--ink-2); }
.ex-rule { margin: 0; font-family: var(--m); font-size: .76rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 10px; }
@media (max-width: 760px) { .ex-body { grid-template-columns: minmax(0, 1fr); } .ex-form fieldset > div { grid-template-columns: minmax(0, 1fr); } }

.foot { border-top: 1px solid var(--ink); padding: 28px max(var(--g), env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(var(--g), env(safe-area-inset-left)); font-size: .86rem; color: var(--muted); }
.foot-in { max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot a { color: var(--muted); min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .topbar, .sidebar, .otp, .pager, .wg-ctl, .copy { display: none !important; } .shell { display: block; } }
