/* Security page (security.html). Uses the tokens from landing.css; everything here is prefixed sc- so it cannot touch other pages.
   Layout: each step is text on the left and a "bench" figure on the right that stays in view (sticky) while its text scrolls past.
   Phones (<= 900 px) get one stacked column with no sticky parts. Motion: security.js adds .sc-js to <html> and .in to things as
   they scroll into view; with prefers-reduced-motion or no JS everything simply shows (landing.css also stops all transitions). */

html:has(.sc) { scroll-padding-top: 76px; }
.sc-page { max-width: 1120px; }
.sc { width: 100%; max-width: 1080px; margin: 0 auto; padding-bottom: 32px; }
.sc code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
.sc a:not(.btn) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.sc-muted { color: var(--muted); }
.sc [hidden] { display: none !important; }   /* several pieces here set display: flex, which would otherwise beat the hidden attribute */
.sc-break { word-break: break-all; }

/* scroll progress */
.sc-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; pointer-events: none; }
.sc-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* reveal (only when JS runs) */
.sc-js .sc-r { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.sc-js .sc-r.in { opacity: 1; transform: none; }
/* texts that depend on JS being on or off */
.sc-js-only { display: none; }
.sc-js .sc-js-only { display: inline; }
.sc-js .sc-nojs { display: none; }

/* ---------- title ---------- */
.sc-hero { padding: clamp(28px, 6vh, 64px) 0 clamp(20px, 3vh, 32px); }
.sc-crumb { display: flex; gap: 8px; align-items: center; margin: 0 0 18px; font: 500 13px var(--font-mono); letter-spacing: .06em; color: var(--muted); }
.sc-crumb a { color: inherit !important; text-decoration: none !important; }
.sc-crumb a:hover { color: var(--text) !important; }
.sc-crumb span { opacity: .5; }
.sc-hero h1 { margin: 0; max-width: 13em; font-family: var(--font-display); font-size: clamp(40px, 7vw, 84px); line-height: 1; letter-spacing: -.04em; font-weight: 800; text-wrap: balance; }
.sc-lead { margin: clamp(16px, 2.6vw, 24px) 0 0; max-width: 36em; color: var(--muted); font-size: clamp(16.5px, 1.8vw, 19px); line-height: 1.6; }
.sc-doc { margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1.5px solid var(--text); border-bottom: 1.5px solid var(--border); }
.sc-doc div { padding: 12px 16px 14px 0; }
.sc-doc div + div { padding-left: 16px; border-left: 1.5px solid var(--border); }
.sc-doc dt { font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sc-doc dd { margin: 4px 0 0; font-size: 14.5px; font-weight: 500; }

/* ---------- on-this-page nav ---------- */
.sc-nav { position: sticky; top: 8px; z-index: 30; display: flex; gap: 4px; margin: 26px 0 0; padding: 5px; border: 1.5px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow-x: auto; scrollbar-width: none; }
.sc-nav::-webkit-scrollbar { display: none; }
.sc .sc-nav a { flex: none; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.sc .sc-nav a:hover { color: var(--text); background: var(--surface); }
.sc .sc-nav a[aria-current="true"] { background: var(--text); color: var(--bg); }

/* ---------- shared text column ---------- */
.sc-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 500 12.5px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.sc-kicker span { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent); color: var(--accent-fg); letter-spacing: .04em; }
.sc-text h2 { margin: 0 0 14px; font-family: var(--font-display); font-size: clamp(27px, 3.6vw, 40px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.sc-text > p:not(.sc-kicker) { margin: 0 0 14px; font-size: 16.5px; line-height: 1.65; max-width: 36em; }
.sc-text strong { font-weight: 700; }

/* ---------- steps: text + sticky figure ---------- */
.sc-step, .sc-wide, .sc-order { padding-top: clamp(64px, 9vw, 112px); }
.sc-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.sc-step .sc-fig { position: sticky; top: 76px; }

/* what you see / what leaves / what the server holds */
.sc-flow { margin: 22px 0 0; border-top: 1.5px solid var(--border); }
.sc-flow div { display: grid; grid-template-columns: 9.6em minmax(0, 1fr); gap: 4px 16px; padding: 11px 0; border-bottom: 1.5px solid var(--border); }
.sc-flow dt { position: relative; padding-left: 16px; font: 500 12px/1.5 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sc-flow dt::before { content: ""; position: absolute; left: 0; top: .42em; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.sc-flow div:nth-child(2) dt::before { background: var(--text); border-color: var(--text); }
.sc-flow div:nth-child(3) dt::before { background: var(--enc); border-color: var(--enc); }
.sc-flow dd { margin: 0; font-size: 15px; line-height: 1.55; }

/* details expander */
.sc-more { margin: 16px 0 0; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); }
.sc-more summary { cursor: pointer; list-style: none; padding: 11px 44px 11px 16px; font: 500 13px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; position: relative; border-radius: 11px; }
.sc-more summary::-webkit-details-marker { display: none; }
.sc-more summary::after { content: "+"; position: absolute; right: 16px; top: 6px; font: 400 21px/1.4 var(--font-mono); color: var(--accent-text); }
.sc-more[open] summary::after { content: "\2212"; }
.sc-more ul { margin: 0; padding: 2px 18px 14px 34px; font-size: 14.5px; line-height: 1.6; }
.sc-more li { margin: 0 0 7px; }

/* ---------- the figure ("bench") ---------- */
.sc-fig { margin: 0; min-width: 0; background: var(--surface); border: 1.5px solid var(--text); border-radius: 16px; box-shadow: 6px 6px 0 var(--border); }
.sc-fig-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1.5px solid var(--border); font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sc-fig-head span { color: var(--text); }
.sc-fig-head span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 2px; background: var(--accent); vertical-align: 0; }
.sc-fig-head em { font-style: normal; padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; }
.sc-fig-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; }
.sc-fig figcaption { padding: 12px 16px 14px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 13px; line-height: 1.5; }

.sc-k { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 5px; font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sc-v { min-width: 0; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); }
.sc .sc-v code, .sc-v .sc-input { display: block; background: none; border: 0; padding: 0; font: 500 13px/1.5 var(--font-mono); color: var(--text); word-break: break-all; }
.sc-v.hot { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.sc-v.hot .sc-k { color: var(--accent-text); }   /* muted grey drops to about 4.4:1 on this tint */
.sc-v.keep { background: var(--enc-bg); border-color: color-mix(in srgb, var(--enc) 40%, transparent); }
.sc .sc-v.keep code { color: var(--enc); }
.sc-v.out { border-color: var(--text); }
.sc .sc-json { white-space: pre-wrap; word-break: normal !important; overflow-wrap: anywhere; }
.sc-tag { padding: 2px 6px; border-radius: 5px; font-weight: 500; font-size: 10.5px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sc-tag.sent { background: var(--text); color: var(--bg); border-color: var(--text); }
.sc-tag.kept { background: var(--enc); color: var(--surface); border-color: var(--enc); }
.sc-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

/* an operation between two values: a short down-arrow with its label */
.sc-op { position: relative; padding: 2px 0 2px 34px; min-height: 26px; display: flex; align-items: center; font: 500 12px/1.4 var(--font-mono); color: var(--accent-text); }
.sc-op::before { content: ""; position: absolute; left: 17px; top: -4px; bottom: -4px; width: 2px; background: var(--accent); transform-origin: top; }
.sc-op::after { content: ""; position: absolute; left: 13px; bottom: -6px; border: 5px solid transparent; border-top: 6px solid var(--accent); border-bottom: 0; }
.sc-op.split::before { left: 25%; }
.sc-op.split::after { left: calc(25% - 4px); }
.sc-op.split { padding-left: calc(25% + 16px); }
.sc .sc-op code { background: none; border: 0; padding: 0; color: inherit; }

.sc-live { margin: 2px 0 0; display: flex; align-items: center; gap: 8px; font: 500 12.5px/1.4 var(--font-mono); color: var(--enc); }
.sc-live::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--enc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.sc-live.bad { color: var(--accent-text); }
.sc-live.bad::before { background: var(--accent-text); }

/* step 02: the trade-off line */
.sc-lost { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border: 1.5px dashed var(--muted); border-radius: 10px; font: 500 12.5px/1.4 var(--font-mono); color: var(--muted); }
.sc-lost s { text-decoration-thickness: 2px; text-decoration-color: var(--accent-text); }
.sc-lost b { color: var(--text); font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }

/* step 03: sealed bytes, coloured by part */
.sc-input { width: 100%; min-width: 0; margin: 0; outline: none; }
.sc-input[readonly] { cursor: default; }
.sc-v:has(.sc-input:not([readonly])) { border-color: var(--text); }
.sc-v:has(.sc-input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sc .sc-ct span { border-radius: 3px; }
.sc .sc-ct .iv { color: var(--muted); }
.sc .sc-ct .tg { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sc .sc-ct mark { background: var(--hl); color: var(--text); border-radius: 2px; outline: 1.5px solid var(--text); }
.sc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 0; font: 400 11.5px var(--font-mono); color: var(--muted); }
.sc-legend i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; }
.sc-legend i::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid currentColor; }
.sc-legend .ct { color: var(--text); }
.sc-legend .tg { color: var(--accent-text); }
.sc-act { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-act .btn { height: 34px; font-size: 13.5px; padding: 0 13px; }
.sc-out { margin: 0; padding: 9px 12px 9px 34px; position: relative; border-radius: 10px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.sc-out::before { position: absolute; left: 12px; top: 9px; font: 700 14px/1.45 var(--font-mono); }
.sc-out.ok { background: var(--enc-bg); color: var(--enc); }
.sc-out.ok::before { content: "\2713"; }
.sc-out.bad { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--text); }
.sc-out.bad::before { content: "\2715"; color: var(--accent-text); }

/* chunk order demo */
.sc-order { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.sc-order-text h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 23px; letter-spacing: -.02em; line-height: 1.2; }
.sc-order-text p { margin: 0; font-size: 15.5px; line-height: 1.65; }
.sc-order-lab { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1.5px solid var(--text); border-radius: 16px; box-shadow: 6px 6px 0 var(--border); min-width: 0; }
.sc-chunks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sc-chunks li { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: var(--enc-bg); border: 1.5px solid color-mix(in srgb, var(--enc) 40%, transparent); color: var(--enc); min-width: 0; transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.sc-chunks b { font: 500 11.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.sc-chunks span { color: var(--text); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.sc .sc-chunks code { background: none; border: 0; padding: 0; font-size: 11.5px; color: inherit; }
.sc-chunks li.moved { border-color: var(--text); border-style: dashed; }
.sc-chunks li.gone { opacity: .35; border-style: dashed; }
.sc-chunks li.gone span { text-decoration: line-through; }
.sc-reader { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--border); }
.sc-reader .sc-k { margin: 0; }
.sc-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-checks li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; font: 500 12.5px/1.4 var(--font-mono); background: var(--bg); }
.sc-checks b { font-weight: 500; flex: none; }
.sc-checks li.ok b { color: var(--enc); }
.sc-checks li.bad b { color: var(--accent-text); }
.sc-checks li.bad { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.sc-naive { margin: 0; }
.sc-naive q { display: block; font-weight: 600; font-size: 15px; quotes: "\201C" "\201D"; overflow-wrap: anywhere; }

/* step 06: the link */
.sc .sc-url { display: block; background: none; border: 0; padding: 0; font: 500 14px/1.7 var(--font-mono); word-break: break-all; }
.sc-url .u-host { color: var(--muted); }
.sc-url .u-hash { color: var(--accent-fg); background: var(--accent); border-radius: 5px; padding: 1px 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sc-wire { display: grid; gap: 8px; }
.sc-wire > div { display: grid; grid-template-columns: auto minmax(20px, 1fr) auto; align-items: center; gap: 10px; font: 500 12.5px var(--font-mono); }
.sc-wire span { padding: 4px 8px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--bg); }
.sc-wire i { height: 2px; background: var(--muted); position: relative; }
.sc-wire i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--muted); border-right: 0; }
.sc-wire b { font-weight: 500; color: var(--muted); }
.sc-wire .w-keep span { border-color: var(--accent); color: var(--accent-text); }
.sc-wire .w-keep i { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 11px); }
.sc-wire .w-keep i::after { content: none; }
.sc-wire .w-keep b { color: var(--accent-text); }

/* step 07: the gates */
.sc-gates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-gates li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg); }
.sc-gates b { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--bg); font: 800 15px var(--font-display); }
.sc-gates span { font-weight: 700; }
.sc-gates em { font-style: normal; font: 400 12.5px/1.4 var(--font-mono); color: var(--muted); }
.sc-gates li.skip { border-style: dashed; }
.sc-gates li.skip b { background: var(--enc); color: var(--surface); }

/* figure parts appear one after another once the figure is in view */
.sc-js .sc-fig .sc-fig-body > * { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.sc-js .sc-fig.in .sc-fig-body > * { opacity: 1; transform: none; }
.sc-js .sc-fig.in .sc-fig-body > :nth-child(2) { transition-delay: .15s; }
.sc-js .sc-fig.in .sc-fig-body > :nth-child(3) { transition-delay: .3s; }
.sc-js .sc-fig.in .sc-fig-body > :nth-child(4) { transition-delay: .45s; }
.sc-js .sc-fig.in .sc-fig-body > :nth-child(5) { transition-delay: .6s; }
.sc-js .sc-fig.in .sc-fig-body > :nth-child(n+6) { transition-delay: .75s; }
.sc-js .sc-fig .sc-op::before { transform: scaleY(0); transition: transform .5s ease .2s; }
.sc-js .sc-fig.in .sc-op::before { transform: none; }
.sc-js .sc-fig .sc-fig-body > [hidden] { display: none; }

/* ---------- the server table ---------- */
.sc-table-wrap { margin-top: 26px; overflow-x: auto; border: 1.5px solid var(--text); border-radius: 14px; background: var(--surface); box-shadow: 6px 6px 0 var(--border); }
.sc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sc-table th, .sc-table td { text-align: left; vertical-align: top; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.sc-table thead th { font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--border); }
.sc-table tbody th { font-weight: 700; width: 30%; }
.sc-table tbody tr:last-child > * { border-bottom: 0; }
.sc-table td:last-child { width: 1%; white-space: nowrap; }
.sc-no, .sc-yes { display: inline-block; padding: 2px 9px; border-radius: 6px; font: 500 12.5px/1.5 var(--font-mono); }
.sc-no { background: var(--enc-bg); color: var(--enc); }
.sc-yes { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* ---------- limits ---------- */
.sc-limit-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; counter-reset: lim; border-top: 1.5px solid var(--text); }
.sc-limit-list li { counter-increment: lim; position: relative; padding: 18px 0 18px 44px; border-bottom: 1.5px solid var(--border); }
.sc-limit-list li::before { content: counter(lim, decimal-leading-zero); position: absolute; left: 0; top: 20px; font: 500 13px var(--font-mono); color: var(--accent-text); }
.sc-limit-list h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 18.5px; letter-spacing: -.01em; line-height: 1.25; }
.sc-limit-list p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- the spec ---------- */
.sc-spec { margin-top: 26px; padding: clamp(18px, 4vw, 44px); background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; font-size: 15.5px; line-height: 1.65; }
.sc-spec > *, .sc-spec .sc-pre, .sc-spec .sc-table-wrap { max-width: 820px !important; }
.sc-spec-head { padding-bottom: 14px; border-bottom: 1.5px solid var(--border); }
.sc-spec-head p { margin: 0 0 8px; }
.sc-spec h3 { margin: 30px 0 10px; font-family: var(--font-display); font-size: 20px; letter-spacing: -.01em; line-height: 1.25; scroll-margin-top: 76px; }
.sc-spec p { margin: 0 0 12px; }
.sc-spec ul, .sc-spec ol { margin: 0 0 12px; padding-left: 1.3em; }
.sc-spec li { margin: 0 0 6px; }
.sc-spec .sc-table-wrap { margin: 6px 0 14px; box-shadow: none; border-width: 1.5px; border-color: var(--border); max-width: none; }
.sc-spec-table { font-size: 14.5px; }
.sc-spec-table tbody th { width: 34%; }
.sc-spec-table td:last-child { width: auto; white-space: normal; }

.sc-pre { margin: 6px 0 14px; padding: 14px 16px; overflow: auto; max-width: 100%; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; font: 400 12.5px/1.6 var(--font-mono); tab-size: 2; }
.sc .sc-pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.sc-pre:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- vectors + verify ---------- */
.sc-files { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1.5px solid var(--text); }
.sc-files li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: 4px 18px; align-items: baseline; padding: 12px 0; border-bottom: 1.5px solid var(--border); }
.sc-files a { font: 500 15px var(--font-mono); overflow-wrap: anywhere; }
.sc-files span { color: var(--muted); font-size: 14.5px; }
.sc-files em { font-style: normal; font: 400 13px var(--font-mono); color: var(--muted); white-space: nowrap; }
.sc-verify { margin-top: 26px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.sc-run, .sc-node { min-width: 0; padding: 20px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); }
.sc-run { border-color: var(--text); box-shadow: 6px 6px 0 var(--border); }
.sc-run h3, .sc-node h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 20px; letter-spacing: -.01em; }
.sc-run p, .sc-node p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.sc-fine { font-size: 13.5px !important; margin: 14px 0 0 !important; }
.sc-node .sc-pre:first-of-type { max-height: 420px; }
.sc-sum { margin: 12px 0 6px !important; font: 500 14px/1.4 var(--font-mono) !important; }
.sc-sum.ok { color: var(--enc); }
.sc-sum.bad { color: var(--accent-text); }
.sc-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sc-results:empty { display: none; }
.sc-results li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 9px; border-radius: 7px; background: var(--bg); font: 400 12.5px/1.4 var(--font-mono); }
.sc-results b { flex: none; font-weight: 500; }
.sc-results li.ok b { color: var(--enc); }
.sc-results li.bad b, .sc-results li.bad { color: var(--accent-text); }
.sc-results li.skip b { color: var(--muted); }

/* ---------- report ---------- */
.sc-report { margin-top: clamp(64px, 9vw, 104px); padding: clamp(20px, 4vw, 36px); border: 1.5px dashed var(--text); border-radius: 16px; }
.sc-report h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; }
.sc-report p { margin: 0; font-size: 16px; line-height: 1.6; max-width: 40em; }

/* ---------- phones and narrow tablets: one stacked column, nothing sticky ---------- */
@media (max-width: 900px) {
  .sc-step, .sc-order, .sc-verify { grid-template-columns: minmax(0, 1fr); }
  .sc-step .sc-fig { position: static; }
  .sc-doc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-doc div:nth-child(3) { padding-left: 0; border-left: 0; }
  .sc-doc div:nth-child(n+3) { border-top: 1.5px solid var(--border); }
  .sc-limit-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sc-flow div { grid-template-columns: minmax(0, 1fr); }
  .sc-pair { grid-template-columns: minmax(0, 1fr); }
  .sc-op.split::before { left: 17px; }
  .sc-op.split::after { left: 13px; }
  .sc-op.split { padding-left: 34px; }
  .sc-chunks { grid-template-columns: minmax(0, 1fr); }
  .sc-fig, .sc-order-lab, .sc-table-wrap, .sc-run { box-shadow: 3px 3px 0 var(--border); }
  .sc-fig-body, .sc-order-lab { padding: 14px 12px; }
  .sc-table th, .sc-table td { padding: 10px 10px; }
  .sc-table { font-size: 14px; }
  .sc-table tbody th { width: auto; }
  .sc-files li { grid-template-columns: minmax(0, 1fr) auto; }
  .sc-files span { grid-column: 1 / -1; grid-row: 2; }
  .sc-doc dd { font-size: 13.5px; }
  .sc-wire > div { grid-template-columns: auto minmax(14px, 1fr) auto; gap: 6px; font-size: 11.5px; }
}
@media (max-width: 380px) {
  .sc-doc { grid-template-columns: minmax(0, 1fr); }
  .sc-doc div { padding-left: 0 !important; border-left: 0 !important; }
  .sc-doc div + div { border-top: 1.5px solid var(--border); }
}
