/* RCE spec notebook */
.rs-wrap { max-width: 1240px; margin: 0 auto; padding: 2rem 1.25rem 5rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1000px) { .rs-wrap { grid-template-columns: 260px minmax(0, 1fr); } }
.rs-toc { font-size: 0.9rem; }
@media (min-width: 1000px) { .rs-toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 7rem); overflow: auto; } }
.rs-toc details > summary { cursor: pointer; font-weight: 600; color: var(--color-brand-white); padding: 0.4rem 0; }
@media (min-width: 1000px) { .rs-toc details > summary { display: none; } }
.rs-toc ol { list-style: none; margin: 0; padding: 0; }
.rs-toc li { margin: 0.15rem 0; }
.rs-toc a { color: var(--color-brand-slate); text-decoration: none; display: block; padding: 0.2rem 0.5rem; border-radius: 6px; line-height: 1.35; }
.rs-toc a:hover { color: var(--color-brand-white); background: rgba(127,127,127,0.08); }
.rs-toc a[aria-current="page"] { color: var(--color-brand-amber); background: rgba(245,158,11,0.08); font-weight: 600; }
.rs-toc ol ol { margin: 0.2rem 0 0.4rem 0.75rem; border-left: 1px solid var(--color-brand-border); }
.rs-toc ol ol a { font-size: 0.82rem; }
.rs-toc .rs-num { font-family: var(--font-mono); font-size: 0.75em; opacity: 0.7; margin-right: 0.35rem; }

.rs-main { min-width: 0; max-width: 820px; }
.rs-main .tts-text, .rs-main .rs-prose { font-size: 1.04rem; line-height: 1.7; color: var(--color-brand-light); }
.rs-main h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.2rem 0 1rem; }
.rs-main h2 { font-size: 1.45rem; margin: 2.2rem 0 0.6rem; }
.rs-main h3 { font-size: 1.15rem; margin: 1.6rem 0 0.4rem; }
.rs-main p, .rs-main ul, .rs-main ol, .rs-main table { margin: 0.8rem 0; }
.rs-main ul, .rs-main ol { padding-left: 1.4rem; }
.rs-main ul { list-style: disc; } .rs-main ol { list-style: decimal; }
.rs-main a { color: var(--color-brand-cyan); }
.rs-main strong { color: var(--color-brand-white); }
.rs-main code { font-family: var(--font-mono); font-size: 0.88em; background: rgba(127,127,127,0.12); padding: 0.08em 0.3em; border-radius: 4px; overflow-wrap: anywhere; }
.rs-main table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.92rem; }
.rs-main th, .rs-main td { border: 1px solid var(--color-brand-border); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.rs-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-brand-amber); }
.rs-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.6rem 0 1.4rem; }
.rs-sec { border-top: 1px solid var(--color-brand-border); padding-top: 0.4rem; margin-top: 1.6rem; scroll-margin-top: 5.5rem; }
.rs-sec-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.rs-sec-head h2 { margin: 0.8rem 0 0.2rem; flex: 1 1 auto; }
.rs-intro { border-left: 3px solid var(--color-brand-amber); padding-left: 1rem; }

.rs-btn, .nb-run, .nb-reset, .tts-btn { font: 600 0.82rem var(--font-body); border-radius: 8px; padding: 0.42rem 0.8rem; min-height: 36px; cursor: pointer; border: 1px solid var(--color-brand-border); background: rgba(127,127,127,0.1); color: var(--color-brand-white); }
.rs-btn:hover, .nb-reset:hover, .tts-btn:hover { border-color: var(--color-brand-amber); }
.nb-run { background: var(--color-brand-amber); color: #111; border-color: transparent; }
.tts-btn[aria-pressed="true"] { background: var(--color-brand-cyan); color: #04120f; }
.tts-status { font-size: 0.8rem; color: var(--color-brand-slate); }

.nb-cell { border: 1px solid var(--color-brand-border); border-radius: 10px; margin: 1rem 0; background: rgba(127,127,127,0.05); overflow: hidden; }
.nb-head { display: flex; gap: 0.4rem; align-items: center; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--color-brand-border); flex-wrap: wrap; }
.nb-label { font-family: var(--font-mono); font-size: 0.74rem; color: var(--color-brand-amber); overflow-wrap: anywhere; }
.nb-spacer { flex: 1 1 auto; }
.nb-expect { margin: 0 !important; padding: 0.45rem 0.75rem; font-size: 0.86rem; border-bottom: 1px solid var(--color-brand-border); }
.nb-expect.is-ok { color: var(--color-brand-cyan); } .nb-expect.is-bad { color: #f0a35b; }
html[data-theme="light"] .nb-expect.is-bad { color: #9a4a00; }
.nb-editor { position: relative; font: 0.86rem/1.55 var(--font-mono); }
.nb-editor pre, .nb-editor textarea { margin: 0; padding: 0.75rem 0.9rem; font: inherit; white-space: pre; tab-size: 4; border: 0; overflow-x: auto; overflow-y: hidden; }
.nb-hl { color: var(--color-brand-light); pointer-events: none; }
.nb-editor textarea { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; background: transparent; color: transparent; caret-color: var(--color-brand-amber); outline: none; }
.nb-editor textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--color-brand-amber); }
.nb-editor textarea::selection { background: rgba(245,158,11,0.35); color: transparent; }
.t-kw { color: #c792ea; font-weight: 500; } .t-ty { color: #82aaff; } .t-name { color: #ffcb6b; } .t-str { color: #c3e88d; } .t-num { color: #f78c6c; } .t-com { color: #8a93a6; font-style: italic; }
html[data-theme="light"] .t-kw { color: #7c3aed; } html[data-theme="light"] .t-ty { color: #1d4ed8; } html[data-theme="light"] .t-name { color: #a16207; } html[data-theme="light"] .t-str { color: #15803d; } html[data-theme="light"] .t-num { color: #c2410c; } html[data-theme="light"] .t-com { color: #64748b; }
.nb-out:empty { display: none; }
.nb-out { border-top: 1px solid var(--color-brand-border); padding: 0.6rem 0.9rem; font-size: 0.9rem; }
.nb-out p { margin: 0.3rem 0; }
.nb-badge.ok, .nb-match.ok { color: var(--color-brand-cyan); font-weight: 600; }
.nb-badge.bad, .nb-match.bad { color: #f0a35b; font-weight: 600; }
html[data-theme="light"] .nb-badge.bad, html[data-theme="light"] .nb-match.bad { color: #9a4a00; }
.nb-errs { margin: 0.3rem 0; }
.nb-rule { color: var(--color-brand-amber); }
.nb-time, .nb-sub { font-size: 0.8rem; color: var(--color-brand-slate); }
.nb-trace { font-size: 0.82rem; margin: 0.4rem 0; }
.nb-trace caption { text-align: left; font-size: 0.78rem; color: var(--color-brand-slate); }
.nb-trace tr.refused td { color: #f0a35b; }
.nb-json pre, .nb-pre { font: 0.82rem/1.5 var(--font-mono); overflow-x: auto; padding: 0.75rem 0.9rem; background: rgba(127,127,127,0.07); border-radius: 8px; margin: 0.8rem 0; white-space: pre; }
.nb-formal > summary { cursor: pointer; padding: 0.55rem 0.8rem; font-size: 0.86rem; color: var(--color-brand-light); list-style-position: inside; }
.nb-formal[open] > summary { border-bottom: 1px solid var(--color-brand-border); }
.nb-math { overflow-x: auto; padding: 0.4rem 0.8rem; }
.nb-math .katex-display { margin: 0.8rem 0; text-align: left; }
.nb-math .katex-display > .katex { text-align: left; }
.nb-math .katex { font-size: 1.02em; }
.nb-plain { margin: 0 0.8rem 0.6rem; font-size: 0.8rem; }
.nb-plain > summary { cursor: pointer; color: var(--color-brand-slate); }
.nb-receipt { margin-top: 2.5rem; padding: 1rem 1.1rem; border: 1px dashed var(--color-brand-amber); border-radius: 10px; font-size: 0.92rem; }
.nb-receipt code { overflow-wrap: anywhere; word-break: break-all; }
.rs-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.rs-cards { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 0 !important; list-style: none !important; }
.rs-cards li { border: 1px solid var(--color-brand-border); border-radius: 10px; padding: 0.8rem 0.9rem; }
.rs-cards a { font-weight: 600; text-decoration: none; }
.rs-cards p { font-size: 0.86rem; margin: 0.3rem 0 0; color: var(--color-brand-slate); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.t-err { text-decoration: underline wavy #e5484d; text-underline-offset: 3px; }
