/* Piko Research Unified Paper Standard (paper-kit v2.0) — builds on home.css tokens. */
:root {
  --ok-bg: rgba(22, 163, 74, .10); --ok-ink: #15803d; --ok-line: rgba(22, 163, 74, .28);
  --wip-bg: rgba(37, 99, 235, .10); --wip-ink: #1d4ed8; --wip-line: rgba(37, 99, 235, .28);
  --deny-bg: rgba(220, 38, 38, .08); --deny-ink: #b91c1c; --deny-line: rgba(220, 38, 38, .32);
  --code-kw: #0f172a; --code-str: #0369a1; --code-cmt: #64748b; --code-op: #7c3aed;
  --rq-bg: #f3f6fb; --rq-line: #cbd5e1; --rq-accent: #1d4ed8;
  --rqa-bg: #fffdf5; --rqa-line: #e2cfa4;
  --plt-p50: #0f766e; --plt-p90: #c25e1a; --plt-mid: #475569; --plt-iqr: rgba(15, 118, 110, .14);
  --plt-bar-a: #94a3b8; --plt-bar-b: #0f766e; --plt-bar-hi: #c25e1a; --plt-on-bar: #ffffff;
  --plt-quiet: rgba(37, 99, 235, .07); --plt-ref: #64748b;
  --hi-bg: #eaf5f3; --hi-line: #0f766e; --hi-ink: #0d4b46; --hi-sub: #2d6a64;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok-bg: rgba(74, 222, 128, .12); --ok-ink: #4ade80; --ok-line: rgba(74, 222, 128, .32);
    --wip-bg: rgba(96, 165, 250, .14); --wip-ink: #60a5fa; --wip-line: rgba(96, 165, 250, .34);
    --deny-bg: rgba(248, 113, 113, .12); --deny-ink: #f87171; --deny-line: rgba(248, 113, 113, .34);
    --code-kw: #f8fafc; --code-str: #38bdf8; --code-cmt: #94a3b8; --code-op: #c084fc;
    --rq-bg: rgba(59, 130, 246, .09); --rq-line: rgba(148, 163, 184, .28); --rq-accent: #60a5fa;
    --rqa-bg: rgba(245, 158, 11, .08); --rqa-line: rgba(251, 191, 36, .30);
    --plt-p50: #2dd4bf; --plt-p90: #fb923c; --plt-mid: #94a3b8; --plt-iqr: rgba(45, 212, 191, .16);
    --plt-bar-a: #64748b; --plt-bar-b: #2dd4bf; --plt-bar-hi: #fb923c; --plt-on-bar: #042f2e;
    --plt-quiet: rgba(96, 165, 250, .10); --plt-ref: #94a3b8;
    --hi-bg: rgba(45, 212, 191, .14); --hi-line: #2dd4bf; --hi-ink: #ccfbf1; --hi-sub: #99f6e4;
  }
}
:root[data-theme="dark"] {
  --ok-bg: rgba(74, 222, 128, .12); --ok-ink: #4ade80; --ok-line: rgba(74, 222, 128, .32);
  --wip-bg: rgba(96, 165, 250, .14); --wip-ink: #60a5fa; --wip-line: rgba(96, 165, 250, .34);
  --deny-bg: rgba(248, 113, 113, .12); --deny-ink: #f87171; --deny-line: rgba(248, 113, 113, .34);
  --code-kw: #f8fafc; --code-str: #38bdf8; --code-cmt: #94a3b8; --code-op: #c084fc;
  --rq-bg: rgba(59, 130, 246, .09); --rq-line: rgba(148, 163, 184, .28); --rq-accent: #60a5fa;
  --rqa-bg: rgba(245, 158, 11, .08); --rqa-line: rgba(251, 191, 36, .30);
  --plt-p50: #2dd4bf; --plt-p90: #fb923c; --plt-mid: #94a3b8; --plt-iqr: rgba(45, 212, 191, .16);
  --plt-bar-a: #64748b; --plt-bar-b: #2dd4bf; --plt-bar-hi: #fb923c; --plt-on-bar: #042f2e;
  --plt-quiet: rgba(96, 165, 250, .10); --plt-ref: #94a3b8;
  --hi-bg: rgba(45, 212, 191, .14); --hi-line: #2dd4bf; --hi-ink: #ccfbf1; --hi-sub: #99f6e4;
}

.paper-site { --page-padding: 28px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* Neutralise naked details/summary element rules inherited from home.css */
.paper-site details { border-bottom: 0; }
.paper-site details > summary { padding-block: 0; min-height: 0; font-weight: inherit; }
.paper-site .faq-item { border-bottom: 1px solid var(--line); }
.paper-site .faq-item > summary { min-height: 54px; padding-block: 14px; font-weight: 600; }
.paper-site .faq-item[open] > summary .disclosure::after { transform: rotate(90deg) scaleX(0); opacity: 0; }
.paper-site .export-menu > summary { min-height: 40px; padding: 0 15px; }
.paper-site .paper-toc summary { min-height: 42px; padding: 0; }
.paper-header-inner, .paper-main, .paper-footer-inner { width: min(1080px, 100% - 48px); margin-inline: auto; }

/* Unified frosted sticky site header + responsive nav drawer + synced theme picker */
.paper-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 84%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); position: sticky; top: 0; z-index: 30; }
.paper-header-inner { min-height: 76px; display: flex; align-items: center; gap: 20px; }
.paper-header .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 650; letter-spacing: -.035em; white-space: nowrap; flex-shrink: 0; }
.nav-drawer { margin-left: auto; display: flex; align-items: center; }
.nav-drawer > summary { display: none; }
.nav-drawer-panel { display: flex; align-items: center; gap: 20px; }
.paper-nav { display: flex; align-items: center; gap: 22px; font-size: 13px; }
.paper-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); transition: color .2s ease; white-space: nowrap; }
.paper-nav a:hover, .paper-nav a[aria-current="page"] { color: var(--ink); font-weight: 550; }
.paper-header .theme-control { min-height: 36px; gap: 6px; padding-left: 12px; border-left: 1px solid var(--line); }
.paper-header .nav-cta { display: inline-flex; align-items: center; padding: 0 16px; min-height: 38px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; white-space: nowrap; flex-shrink: 0; transition: opacity .2s ease; }
.paper-header .nav-cta:hover { color: var(--on-ink); opacity: .82; }

/* Institutional Prysai Masthead — clean top spine, zero extra dividing line on Web */
.paper-masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 0; margin-bottom: 14px; border-bottom: 0; }
.masthead-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.prysai-wordmark { display: block; height: 20px; width: auto; color: var(--ink); flex-shrink: 0; }
.masthead-lab { padding-left: 10px; border-left: 1px solid var(--line); font-size: 10.5px; font-weight: 550; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.masthead-stamp { font: 400 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); letter-spacing: .03em; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Breadcrumb, paper head & 3-tier typographic hierarchy */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 11.5px; color: var(--muted); padding-top: 20px; opacity: .82; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.paper-head { padding: 18px 0 28px; border-bottom: 1px solid var(--line); }
.paper-head .eyebrow { display: none; }
.paper-head h1, .hub h1 { max-width: 880px; font-size: clamp(32px, 4.1vw, 50px); line-height: 1.13; letter-spacing: -.038em; margin: 0 0 14px; font-weight: 700; text-wrap: balance; }
.paper-subtitle { font-size: clamp(16px, 1.45vw, 18.5px); font-weight: 400; color: var(--muted); line-height: 1.65; max-width: 720px; margin: 0; }
.paper-subtitle span { display: block; }
/* 3-tier metadata: Tier 1 Author (15.5px bold), Tier 2 Version/DOI (12.5px medium), Tier 3 Dates/Read-time (12px regular muted) */
.paper-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 22px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.paper-meta div { display: inline-flex; align-items: baseline; gap: 5px; }
.paper-meta div:not(.meta-author):not(.meta-ver)::before { content: "·"; color: var(--control-line); margin-right: 4px; }
.paper-meta dt { color: var(--muted); font-size: 12px; font-weight: 400; }
.paper-meta dd { margin: 0; font-weight: 400; color: var(--muted); }
.paper-meta .meta-author { flex: 0 0 100%; margin-bottom: 2px; }
.paper-meta .meta-author dt { display: none; }
.paper-meta .meta-author dd { font-size: 15.5px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.paper-meta .meta-author .affil { font-size: 14px; font-weight: 400; color: var(--muted); }
.paper-meta .meta-ver dt { display: none; }
.paper-meta .meta-ver dd { font-size: 12.5px; font-weight: 550; color: var(--ink); }
.paper-meta .meta-pub dt::after { content: ""; }
.paper-meta .meta-read dt { display: none; }
.paper-meta .meta-doi dt { display: none; }
.paper-meta .author-orcid { display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--wash); color: var(--muted); font: 550 9.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-decoration: none; vertical-align: 2px; transition: color .18s ease, border-color .18s ease; }
.paper-meta .author-orcid::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ok-ink); flex-shrink: 0; }
.paper-meta .author-orcid:hover { color: var(--ink); border-color: var(--ink); }
.paper-meta .doi-badge { display: inline; padding: 0; border: 0; background: transparent; color: var(--ink); font: 500 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; text-decoration: underline; text-decoration-color: var(--control-line); text-underline-offset: 3px; white-space: nowrap; transition: text-decoration-color .18s ease; }
.paper-meta .doi-badge:hover { text-decoration-color: var(--ink); }

/* Folded action toolbar: segmented language switcher + PDF & export drawer */
.paper-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 20px; }
.lang-switch { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; background: var(--wash); border: 1px solid var(--line); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: color .2s ease, background .2s ease; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { color: var(--on-ink); background: var(--ink); font-weight: 550; }
.paper-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.action-pdf { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: opacity .2s ease; }
.action-pdf:hover { opacity: .84; }
.export-menu { position: relative; }
.export-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--canvas); color: var(--ink); font-size: 12.5px; font-weight: 550; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; transition: border-color .2s ease, background .2s ease; }
.export-trigger::-webkit-details-marker { display: none; }
.export-trigger:hover { border-color: var(--ink); background: var(--wash); }
.export-menu[open] .export-trigger { border-color: var(--ink); background: var(--wash); }
.export-menu[open] .chev { transform: rotate(180deg); display: inline-block; }
.export-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: min(272px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); box-shadow: 0 18px 46px rgba(0, 0, 0, .14); display: grid; gap: 2px; }
.export-popover a, .export-popover button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.export-popover a:hover, .export-popover button:hover { background: var(--wash); }
.export-popover kbd { font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); background: var(--wash); padding: 2px 6px; border-radius: 6px; }
.export-popover hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* Responsive rail + bento + reading body grid */
.paper-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding: 40px 0 72px; align-items: start; }
.paper-toc { position: sticky; top: 28px; max-height: calc(100dvh - 56px); overflow: auto; scrollbar-width: thin; min-width: 0; }
.paper-toc summary { font-size: 12px; font-weight: 650; letter-spacing: .06em; color: var(--muted); min-height: 38px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; user-select: none; }
.paper-toc summary::-webkit-details-marker { display: none; }
.paper-toc ol { list-style: none; margin: 4px 0 0; padding: 0; border-left: 1px solid var(--line); }
.paper-toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 12.5px; line-height: 1.55; color: var(--muted); transition: color .18s ease, border-color .18s ease; }
.paper-toc a:hover { color: var(--ink); }
.paper-toc a[aria-current] { color: var(--ink); border-color: var(--ink); font-weight: 600; }

.paper-body { max-width: 940px; min-width: 0; font-size: 16.5px; line-height: 1.92; overflow-wrap: anywhere; }
.paper-body > p, .paper-body > ul, .paper-body > ol, .paper-body > h2, .paper-body > h3, .paper-body > blockquote { max-width: 72ch; }
.paper-body h2 { position: relative; font-size: clamp(22px, 2.2vw, 27px); line-height: 1.38; letter-spacing: -.02em; margin: 56px 0 18px; scroll-margin-top: 24px; }
.paper-body h2:first-child { margin-top: 0; }
.paper-body h3 { position: relative; font-size: 19px; line-height: 1.48; margin: 36px 0 12px; scroll-margin-top: 24px; }
.paper-body a.sec-anchor { opacity: 0; margin-left: 8px; font-weight: 450; font-size: .8em; color: var(--muted); text-decoration: none; transition: opacity .16s ease, color .16s ease; }
.paper-body h2:hover a.sec-anchor, .paper-body h3:hover a.sec-anchor, .paper-body a.sec-anchor:focus { opacity: 1; }
.paper-body a.sec-anchor:hover { color: var(--ink); }
.paper-body p { margin: 0 0 18px; }
.paper-body ul, .paper-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.paper-body li { margin: 6px 0; }
.paper-body strong { font-weight: 650; }
.paper-body code { font: .86em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--wash); padding: 1px 5px; border-radius: 4px; border: 0; }
.paper-body pre code { background: none; padding: 0; border: 0; border-radius: 0; font-size: inherit; }
.math { font-variant-numeric: lining-nums; font-family: "STIX Two Math", "Cambria Math", "Times New Roman", Georgia, serif; }
.math var { font-style: italic; font-family: "STIX Two Math", "Times New Roman", Georgia, serif; font-size: 1.03em; padding-right: .09em; }
.math sub, .math sup { font-size: .72em; font-style: normal; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; margin-left: 1px; line-height: 0; }
.math .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 3px; line-height: 1.2; font-size: .92em; }
.math .frac-num { padding: 0 4px 2px; border-bottom: 1px solid currentColor; }
.math .frac-den { padding: 2px 4px 0; }
.math .math-cases { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; text-align: left; }
.math .cases-brace { font-family: "STIX Two Math", "Times New Roman", Georgia, serif; font-size: 2.8em; font-weight: 300; line-height: .9; transform: scaleY(1.1); color: var(--ink); }
.math .cases-grid { display: grid; grid-template-columns: auto auto; gap: 4px 16px; align-items: baseline; }
.math .case-rhs { color: var(--muted); font-size: .92em; }
.math-block { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0 22px; padding: 14px 20px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; line-height: 1.75; overflow-x: auto; max-width: 72ch; font-variant-numeric: lining-nums; }
.math-block.math-numbered { justify-content: space-between; }
.math-block.math-numbered .math { flex: 1 1 auto; text-align: center; }
.math-block .eq-num { flex: 0 0 auto; font: 500 13px/1 Georgia, "Times New Roman", serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.math-block .math { white-space: normal; }
.qed { float: right; font-size: 1em; line-height: 1.4; color: var(--muted); margin-left: 8px; }
.paper-body a:not(.cite-ref):not(.sec-anchor):not(.faq-item) { text-decoration: underline; text-decoration-color: var(--control-line); }
.paper-body a:not(.cite-ref):not(.sec-anchor):hover { text-decoration-color: var(--ink); }

/* Abstract, Definition callout & Concept + Takeaways Bento Grid */
.abstract-box { display: block; padding: 28px 30px 14px; margin: 0 0 22px; background: var(--wash); border: 1px solid var(--line); border-radius: 14px; max-width: 940px; }
.abstract-box h2 { margin-top: 0; }
.abstract-box p { max-width: 74ch; }
#abstract { font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 14px; }
#abstract + p, #abstract + p + p, #abstract + p + p + p, #abstract + p + p + p + p { color: var(--ink); }

.paper-bento { display: grid; grid-template-columns: minmax(280px, .92fr) minmax(0, 1.08fr); gap: 18px; margin: 18px 0 32px; align-items: stretch; }
.concept-card, .keypoints { margin: 0; padding: 20px 22px; border-radius: 14px; background: var(--canvas); }
.concept-card { border: 1px solid var(--line); }
.keypoints { border: 1px solid var(--line); background: var(--wash); }
.concept-card .eyebrow, .keypoints .eyebrow { margin: 0 0 12px; }
.concept-card dl { margin: 0; display: grid; gap: 0; }
.concept-card dl div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 7.5px 0; border-top: 1px solid var(--line); }
.concept-card dt { font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.concept-card dd { margin: 0; font-size: 13.5px; line-height: 1.58; }
.concept-card dl div:first-child dd { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.keypoints ol { list-style: none; counter-reset: kp; padding: 0; margin: 0; }
.keypoints li { counter-increment: kp; position: relative; padding: 8px 0 8px 32px; margin: 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.62; }
.keypoints li:first-child { border-top: 0; }
.keypoints li::before { content: counter(kp, decimal-leading-zero); position: absolute; left: 0; top: 9px; font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

.paper-body blockquote { margin: 22px 0; padding: 16px 22px; border: 1px solid var(--line); border-left: 3.5px solid var(--ink); background: var(--wash); border-radius: 0 10px 10px 0; }
.paper-body blockquote.def-box { border-left-width: 4px; border-radius: 4px 10px 10px 4px; padding: 18px 22px; }
.paper-body blockquote.prop-box { border: 1px solid var(--control-line); border-left: 4px solid var(--ink); background: var(--canvas); border-radius: 4px 10px 10px 4px; padding: 16px 20px; }
.paper-body blockquote.proof-box { margin-top: -10px; border: 0; border-left: 2px solid var(--line); background: transparent; border-radius: 0; padding: 8px 18px 10px; font-size: .95em; color: var(--muted); }
.paper-body blockquote.proof-box strong { color: var(--ink); font-style: italic; }
.paper-body blockquote.intuition-box { border: 0; border-left: 2.5px solid var(--control-line); background: var(--wash); border-radius: 0 8px 8px 0; padding: 14px 18px; font-size: .96em; }
.paper-body .rq-box { max-width: 72ch; margin: 18px 0 26px; border: 1px solid var(--rq-line); border-radius: 10px; background: var(--rq-bg); overflow: hidden; }
.paper-body .rq-q { padding: 12px 18px 10px; font-size: .97em; line-height: 1.65; color: var(--ink); }
.paper-body .rq-q strong { color: var(--rq-accent); font-weight: 700; margin-right: 4px; }
.paper-body .rq-q p, .paper-body .rq-a p { margin: 0; }
.paper-body .rq-a { margin: 0 12px 12px; padding: 10px 14px; border: 1px solid var(--rqa-line); border-radius: 7px; background: var(--rqa-bg); font-size: .94em; line-height: 1.68; color: var(--ink); }
.paper-body .rq-a strong { color: var(--ink); font-weight: 700; }
.paper-body blockquote p { margin: 0; }
.paper-body blockquote p + p { margin-top: 10px; }
.def-kicker { font: 650 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px !important; text-transform: uppercase; }

/* Semantic Algorithm Cards */
.algo-card { margin: 22px 0 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); overflow: hidden; }
.algo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; background: var(--wash); border-bottom: 1px solid var(--line); font: 600 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.algo-copy { min-height: 28px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--canvas); color: var(--ink); font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; transition: border-color .18s ease; }
.algo-copy:hover { border-color: var(--ink); }
.algo-pre { margin: 0 !important; padding: 14px 16px !important; border: 0 !important; border-radius: 0 !important; background: var(--canvas) !important; overflow-x: auto; font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace !important; }
.algo-pre code { display: block; white-space: pre; }
.algo-pre .al { display: inline-block; min-width: 100%; }
.algo-pre .al::before { content: attr(data-ln); display: inline-block; width: 28px; margin-right: 12px; color: var(--muted); opacity: .55; user-select: none; text-align: right; font-size: 11px; }
.algo-pre .ak { color: var(--code-kw); font-weight: 700; }
.algo-pre .as { color: var(--code-str); }
.algo-pre .ac { color: var(--code-cmt); font-style: italic; }
.algo-pre .ao { color: var(--code-op); font-weight: 600; }

/* Tables + Status Pills */
.cite-ref { font-size: .78em; vertical-align: super; line-height: 0; color: var(--muted); margin-left: 1px; font-variant-numeric: tabular-nums; }
.cite-ref:hover { color: var(--ink); }
.table-card { margin: 22px 0 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); overflow: hidden; }
.table-title { padding: 13px 18px; font-size: 13.5px; font-weight: 650; border-bottom: 1px solid var(--line); background: var(--wash); color: var(--ink); }
.table-wrap { width: 100%; overflow-x: auto; padding: 4px 18px 8px; -webkit-overflow-scrolling: touch; box-sizing: border-box; }
.paper-body table { width: 100%; border-collapse: collapse; margin: 0; font-size: 13.8px; line-height: 1.68; display: table; font-variant-numeric: tabular-nums; }
.paper-body th, .paper-body td { text-align: left; vertical-align: top; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line); }
.paper-body th:last-child, .paper-body td:last-child { padding-right: 0; }
.paper-body th { font-size: 11.5px; color: var(--muted); font-weight: 650; letter-spacing: .04em; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.paper-body tbody tr:last-child td { border-bottom: 0; }
.paper-body tbody tr:hover td { background: var(--wash); }
.paper-body td:first-child { font-weight: 600; }
.paper-body td.nowrap { white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; border: 1px solid var(--line); background: var(--wash); color: var(--ink); }
.status-done { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.status-wip { background: var(--wip-bg); color: var(--wip-ink); border-color: var(--wip-line); }
.status-plan { background: var(--wash); color: var(--muted); border-color: var(--control-line); }
.status-zero { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* Interactive Appendix B FAQ accordions matching home.css */
.faq-list { margin: 18px 0 32px; border-top: 1px solid var(--line); max-width: 72ch; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 54px; padding: 14px 4px; font-size: 16.5px; font-weight: 600; line-height: 1.5; cursor: pointer; list-style: none; user-select: none; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover .disclosure { border-color: var(--ink); }
.faq-item[open] summary .disclosure::after { transform: rotate(90deg) scaleX(0); opacity: 0; }
.faq-answer { padding: 0 4px 18px; color: var(--muted); font-size: 15.5px; line-height: 1.85; }
.faq-answer p { margin: 0 0 12px; }
.faq-answer p:last-child { margin-bottom: 0; }
.disclosure { flex: 0 0 28px; position: relative; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; transition: border-color .2s ease; }
.disclosure::before, .disclosure::after { content: ""; position: absolute; inset: auto; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -.75px 0 0 -5px; background: var(--ink); transition: transform .22s ease, opacity .22s ease; }
.disclosure::after { transform: rotate(90deg); }

/* Figures, Hero & SVG Lightbox Modal */
.paper-hero { margin: 24px 0 0; max-width: 760px; }
.pesa-hero { width: 100%; height: auto; display: block; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Segoe UI", sans-serif; }
.paper-figure { margin: 28px 0 38px; }
.figure-stage { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--canvas); }
.paper-figure svg { width: 100%; height: auto; display: block; min-width: 620px; }
.figure-zoom { position: absolute; top: 12px; right: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--canvas); color: var(--muted); font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; transition: color .18s ease, border-color .18s ease; }
.figure-zoom:hover { color: var(--ink); border-color: var(--ink); }
.paper-figure figcaption { margin-top: 12px; padding: 0 4px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.svg-modal { width: min(1080px, calc(100vw - 32px)); max-width: none; max-height: 90dvh; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--canvas); color: var(--ink); box-shadow: 0 28px 70px rgba(0, 0, 0, .28); }
.svg-modal::backdrop { background: rgba(0, 0, 0, .58); backdrop-filter: blur(4px); }
.svg-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.svg-modal-close { flex-shrink: 0; min-height: 34px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--canvas); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.svg-modal-body { padding: 20px; overflow: auto; }
.svg-modal-svg { width: 100%; height: auto; min-width: 0 !important; max-height: 74dvh; }

/* Unified serene academic figure palette across ALL 13 figures (matching Fig 12 & 13) */
.pesa-figure { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Segoe UI", sans-serif; }
.pesa-figure .f-region { fill: var(--wash); stroke: var(--line); stroke-width: 1.05; }
.pesa-figure .f-region.hands { fill: var(--canvas); stroke: var(--line); }
.pesa-figure .f-label { font-size: 11px; font-weight: 650; letter-spacing: 1.4px; fill: var(--muted); }
.pesa-figure .f-box rect { fill: var(--canvas); stroke: var(--control-line); stroke-width: 1.15; }
.pesa-figure .f-box.strong rect { fill: var(--hi-bg); stroke: var(--hi-line); stroke-width: 1.5; }
.pesa-figure .f-box.soft rect { fill: var(--wash); stroke: var(--line); }
.pesa-figure .f-box.ghost rect { fill: var(--canvas); stroke: var(--muted); stroke-dasharray: 5 5; }
.pesa-figure .f-box.deny rect { fill: var(--deny-bg); stroke: var(--deny-line); stroke-width: 1.3; }
.pesa-figure .f-box.ok rect { fill: var(--ok-bg); stroke: var(--ok-line); stroke-width: 1.3; }
.pesa-figure .f-t { font-size: 15.5px; font-weight: 650; fill: var(--ink); }
.pesa-figure .f-d { font-size: 12px; fill: var(--muted); }
.pesa-figure .f-box.sm .f-t { font-size: 13.5px; }
.pesa-figure .f-box.sm .f-d { font-size: 11px; }
.pesa-figure .f-box.strong .f-t { fill: var(--hi-ink); }
.pesa-figure .f-box.strong .f-d { fill: var(--hi-sub); }
.pesa-figure .f-box.deny .f-t { fill: var(--deny-ink); }
.pesa-figure .f-box.ok .f-t { fill: var(--ok-ink); }
.pesa-figure .f-wall { stroke: var(--deny-ink); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: .75; }
.pesa-figure .f-line { stroke: var(--muted); stroke-width: 1.35; }
.pesa-figure .f-line.dash { stroke-dasharray: 4 5; }
.pesa-figure .f-head { fill: var(--muted); }
.pesa-figure .f-devices { font-size: 18px; font-weight: 600; fill: var(--ink); }
.pesa-figure .f-small { font-size: 12px; fill: var(--muted); }
.pesa-figure .f-small.strong { fill: var(--ink); font-weight: 650; }
.pesa-figure .f-level { font-size: 26px; font-weight: 700; fill: var(--ink); letter-spacing: -.5px; }
.pesa-figure .f-box.strong .f-level { fill: var(--hi-ink); }
.pesa-figure .f-pill rect { fill: var(--wash); stroke: var(--line); }
.pesa-figure .f-pill text { font-size: 11px; font-weight: 550; fill: var(--ink); }
.pesa-figure .f-life { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 5; }
.pesa-figure .f-off { fill: var(--wash); stroke: var(--line); }
.pesa-figure .f-dot { fill: var(--ink); }
/* Quantitative data-plot tokens (Figure 12 & multi-panel scientific charts) */
.pesa-figure .plt-axis { stroke: var(--ink); stroke-width: 1.1; }
.pesa-figure .plt-grid { stroke: var(--line); stroke-width: .85; stroke-dasharray: 2 3; }
.pesa-figure .plt-iqr { fill: var(--plt-iqr); stroke: none; }
.pesa-figure .plt-line-p50 { fill: none; stroke: var(--plt-p50); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pesa-figure .plt-dot-p50 { fill: var(--plt-p50); stroke: var(--canvas); stroke-width: 1.2; }
.pesa-figure .plt-line-p90 { fill: none; stroke: var(--plt-p90); stroke-width: 1.8; stroke-dasharray: 5 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pesa-figure .plt-dot-p90 { fill: var(--plt-p90); stroke: var(--canvas); stroke-width: 1; }
.pesa-figure .plt-line-mid { fill: none; stroke: var(--plt-mid); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pesa-figure .plt-dot-mid { fill: var(--plt-mid); stroke: var(--canvas); stroke-width: 1; }
.pesa-figure .plt-ref { stroke: var(--plt-ref); stroke-width: 1.1; stroke-dasharray: 4 3; }
.pesa-figure .plt-ref-hi { stroke: var(--plt-p50); stroke-width: 1.15; stroke-dasharray: 3 3; }
.pesa-figure .plt-bar-a { fill: var(--plt-bar-a); }
.pesa-figure .plt-bar-b { fill: var(--plt-bar-b); }
.pesa-figure .plt-bar-hi { fill: var(--plt-bar-hi); }
.pesa-figure .f-bar-dark { fill: var(--plt-mid); }
.pesa-figure .plt-bg { fill: var(--canvas); stroke: var(--line); stroke-width: .9; }
.pesa-figure .f-band { fill: var(--canvas); stroke: var(--line); stroke-width: 1; }
.pesa-figure .plt-bar-bg { opacity: .24; }
.pesa-figure .plt-bar-in, .pesa-figure .plt-val-in { font-size: 9.5px; font-weight: 650; fill: var(--plt-on-bar); font-variant-numeric: tabular-nums; }
.pesa-figure .plt-quiet { fill: var(--plt-quiet); stroke: none; }
.pesa-figure .plt-tick { font-size: 9.8px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.pesa-figure .plt-note { font-size: 10px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.pesa-figure .plt-note.p50 { fill: var(--plt-p50); }
.pesa-figure .plt-note.p90 { fill: var(--plt-p90); }
.pesa-figure .plt-kpi-card { fill: var(--canvas); stroke: var(--line); stroke-width: 1; }
.pesa-figure .plt-kpi-num { font-size: 20px; font-weight: 700; fill: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pesa-figure .plt-kpi-num.sm { font-size: 16.5px; }
.pesa-figure .plt-kpi-num.accent { fill: var(--plt-p50); }
.pesa-figure .plt-kpi-lbl { font-size: 10px; font-weight: 600; fill: var(--ink); }
.pesa-figure .plt-kpi-sub { font-size: 9.3px; fill: var(--muted); }
.print-copyright-bar { display: none; }
.paper-body blockquote.proof-box p:last-child:not(:has(.qed))::after { content: " \25A1"; float: right; color: var(--muted); font-style: normal; }
.pesa-hero .h-bus { stroke: var(--line); stroke-width: 1.5; }
.pesa-hero .h-pulse { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 8 200; stroke-dashoffset: 8; }
.pesa-hero .h-dev rect { fill: var(--canvas); stroke: var(--ink); stroke-width: 1.5; }
.pesa-hero .h-chip { fill: var(--wash); stroke: var(--line); }
.pesa-hero .h-bar, .pesa-figure .h-bar { fill: var(--control-line); }
.pesa-hero .h-ink, .pesa-figure .h-ink { fill: var(--ink); }
.pesa-hero .h-mute, .pesa-figure .h-mute { fill: var(--muted); opacity: .55; }
.pesa-hero .h-band { fill: var(--wash); stroke: var(--line); stroke-width: 1.2; }
.pesa-hero .h-check { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pesa-hero { --pk-stage: #f0f0f0; --pk-s1: #f2f2f2; --pk-depth: #e8e8e8; }
.pesa-hero .h-stage { fill: var(--pk-stage); }
.pesa-hero .pk-s0 { stop-color: #fff; }
.pesa-hero .pk-s1 { stop-color: var(--pk-s1); }
.pesa-hero .pk-depth { fill: var(--pk-depth); }
.pesa-hero .pk-eye { fill: #0a0a0a; transform-box: fill-box; transform-origin: center; animation: pesa-blink 4.8s linear infinite; }
.pesa-hero .pk-body { transform-box: fill-box; transform-origin: center; animation: pesa-breathe 14s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pesa-hero { --pk-stage: #0e0e0e; --pk-s1: #e8e8e8; --pk-depth: #d6d6d6; } }
:root[data-theme="dark"] .pesa-hero { --pk-stage: #0e0e0e; --pk-s1: #e8e8e8; --pk-depth: #d6d6d6; }
@keyframes pesa-blink { 0%, 95.5%, 100% { transform: scaleY(1); } 97%, 98.6% { transform: scaleY(.19); } }
@keyframes pesa-breathe { 0%, 64%, 100% { transform: none; } 82% { transform: translateY(-1.6px) scale(1.025); } }
.pesa-hero .h-halo { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pesa-hero .h-cap { fill: var(--muted); font-size: 12.5px; }
.pesa-hero .h-cap.strong { fill: var(--ink); font-weight: 600; }
@keyframes pesa-flow { to { stroke-dashoffset: -26; } }
@keyframes pesa-pulse { 0% { stroke-dashoffset: 8; opacity: 0; } 8% { opacity: 1; } 34% { stroke-dashoffset: -72; opacity: 1; } 40%, 100% { stroke-dashoffset: -72; opacity: 0; } }
@keyframes pesa-halo { 0% { transform: scale(.96); opacity: 0; } 12% { opacity: .35; } 40%, 100% { transform: scale(1.2); opacity: 0; } }
.pesa-figure .f-line.dash { animation: pesa-flow 1.6s linear infinite; }
.pesa-hero .h-pulse { animation: pesa-pulse 4.2s cubic-bezier(.4, 0, .2, 1) infinite; }
.pesa-hero .h-pulse.p1 { animation-delay: .45s; }
.pesa-hero .h-pulse.p2 { animation-delay: 2.1s; }
.pesa-hero .h-pulse.p3 { animation-delay: 2.55s; }
.pesa-hero .h-halo { animation: pesa-halo 4.2s ease-out infinite; }

/* Declarations, Citation Tabs, References & Progress */
.paper-decl, .paper-cite, .paper-refs { border-top: 1px solid var(--line); margin-top: 52px; padding-top: 8px; }
.paper-decl h2, .paper-cite h2, .paper-refs h2 { margin-top: 32px; }
.paper-decl dl, .cite-formats { margin: 0 0 20px; font-size: 14px; line-height: 1.8; }
.paper-decl dl div, .cite-formats div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.paper-decl dl div:first-child, .cite-formats div:first-child { border-top: 0; }
.paper-decl dt, .cite-formats dt { font-size: 12px; color: var(--muted); padding-top: 2px; }
.paper-decl dd, .cite-formats dd { margin: 0; overflow-wrap: anywhere; }
.cite-formats dd { user-select: all; }
.cite-formats div:last-child dd, .cite-formats .cite-doi-row dd { user-select: auto; }
.cite-formats .cite-sub { color: var(--muted); font-size: 13px; }
.cite-tabs { display: inline-flex; gap: 4px; margin-bottom: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--wash); }
.cite-tabs [role="tab"] { min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; }
.cite-tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.bibtex { position: relative; }
.bibtex pre { margin: 0; padding: 18px 20px; background: var(--wash); border: 1px solid var(--line); border-radius: 14px; font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; }
.bibtex .copy { position: absolute; top: 10px; right: 10px; min-height: 32px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--canvas); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; transition: border-color .2s ease; }
.bibtex .copy:hover { border-color: var(--ink); }
.paper-refs ol { font-size: 14px; line-height: 1.8; padding-left: 2.2em; max-width: 78ch; }
.paper-refs li { padding: 4px 8px; margin-left: -8px; border-radius: 8px; scroll-margin-top: 24px; transition: background .3s ease; }
.paper-refs li:target { background: var(--wash); }
.paper-refs a { overflow-wrap: break-word; word-break: normal; }
.note { font-size: 12.5px; line-height: 1.8; color: var(--muted); margin-top: 18px; }
.tm { margin-top: 44px; max-width: 78ch; }

/* Hub /research Bento Grid (single-layer PikoTheme.surface cards, zero pill soup) */
.hub { padding: 48px 0 88px; }
.hub-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.hub-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.hub-strip a { padding: 0; border: 0; border-radius: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; transition: color .18s ease; }
.hub-strip a:hover { color: var(--ink); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 28px; }
.hub-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); transition: border-color .22s ease, transform .22s cubic-bezier(.16, 1, .3, 1); }
.hub-card:hover { border-color: var(--control-line); transform: translateY(-2px); }
.hub-title { margin: 4px 0 0; font-size: 20px; line-height: 1.35; letter-spacing: -.025em; }
.hub-title a:hover { text-decoration: underline; }
.hub-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hub-by { margin: auto 0 0; font-size: 12.5px; color: var(--muted); }
.hub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--line); font-size: 12px; }
.hub-links a { padding: 4px 0; border: 0; border-radius: 0; color: var(--muted); white-space: nowrap; transition: color .18s ease; }
.hub-links a:hover { color: var(--ink); text-decoration: underline; }
.hub-links a.hub-read { flex-basis: 100%; justify-content: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; margin-bottom: 4px; border: 1px solid var(--ink); border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; text-decoration: none; transition: opacity .18s ease; }
.hub-links a.hub-read:hover { color: var(--on-ink); opacity: .88; text-decoration: none; }

/* Unified Footer */
.paper-footer { border-top: 1px solid var(--line); padding: 34px 0 40px; }
.paper-footer-inner { display: grid; gap: 18px; }
.footer-brand-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-brand-row .brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.footer-brand-row p { margin: 0; font-size: 13px; color: var(--muted); }
.paper-footer .footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.paper-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.paper-footer nav a, .paper-footer .back-to-top { min-height: 36px; display: inline-flex; align-items: center; color: var(--muted); transition: color .18s ease; }
.paper-footer nav a:hover, .paper-footer .back-to-top:hover { color: var(--ink); text-decoration: underline; }

/* Progress bar, Popover & Floating Top Pill */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .12s linear; }
.cite-pop { position: absolute; z-index: 60; width: min(360px, calc(100vw - 32px)); padding: 14px 16px; background: var(--canvas); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .14); font-size: 13px; line-height: 1.7; opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.cite-pop.on { opacity: 1; transform: none; pointer-events: auto; }
.cite-pop .n { display: block; font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-bottom: 4px; }
.cite-pop a { word-break: break-all; text-decoration: underline; text-decoration-color: var(--control-line); }
.cite-pop .go { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.fab-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--control-line); background: var(--canvas); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font-size: 16px; text-decoration: none; transition: border-color .2s ease, transform .2s ease; }
.fab-top[hidden] { display: none; }
.fab-top:hover { border-color: var(--ink); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .pesa-figure .f-line.dash, .pesa-hero .h-pulse, .pesa-hero .h-halo, .pesa-hero .pk-eye, .pesa-hero .pk-body { animation: none; }
  .cite-pop, .read-progress span, .paper-refs li, .hub-card, .lang-switch a, .paper-toc a { transition: none; }
  .hub-card:hover { transform: none; }
}

/* iPad Landscape & Small Mac */
@media (max-width: 1179px) {
  .paper-layout { grid-template-columns: 206px minmax(0, 1fr); gap: 36px; }
}

/* iPad Portrait (<= 960px) */
@media (max-width: 960px) {
  .paper-header-inner, .paper-main, .paper-footer-inner { width: calc(100% - 48px); }
  .paper-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; }
  .paper-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .paper-toc { position: static; max-height: none; overflow: visible; background: var(--wash); border: 1px solid var(--line); border-radius: 14px; padding: 2px 16px; }
  .paper-toc summary { min-height: 44px; }
  .paper-toc summary::after { content: "▾"; font-size: 12px; color: var(--muted); transition: transform .2s ease; }
  .paper-toc details[open] summary::after { transform: rotate(180deg); }
  .paper-toc details:not([open]) ol { display: none; margin: 0; }
  .paper-toc details[open] ol { padding: 8px 0 12px; margin: 2px 0 0; border-top: 1px solid var(--line); }
}
@media (max-width: 819px) {
  .paper-bento { grid-template-columns: minmax(0, 1fr); }
}

/* Phone / Mobile (<= 760px): crisp foldable header drawer + single-row folded toolbar */
@media (max-width: 760px) {
  .paper-header-inner, .paper-main, .paper-footer-inner { width: calc(100% - 32px); }
  .paper-header-inner { min-height: 64px; gap: 10px; position: relative; }
  .paper-header .brand { font-size: 18px; }
  .nav-drawer { margin-left: auto; position: static; }
  .nav-drawer > summary { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 1px solid var(--control-line); border-radius: 50%; cursor: pointer; list-style: none; color: var(--ink); }
  .nav-drawer > summary::-webkit-details-marker { display: none; }
  .nav-burger { display: grid; gap: 4px; width: 16px; }
  .nav-burger span { display: block; height: 1.5px; background: currentColor; border-radius: 2px; }
  .nav-drawer:not([open]) .nav-drawer-panel { display: none; }
  .nav-drawer[open] .nav-drawer-panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 45; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); box-shadow: 0 18px 44px rgba(0, 0, 0, .16); display: grid; gap: 10px; }
  .paper-nav { display: grid; gap: 2px; }
  .paper-nav a { min-height: 42px; padding: 0 6px; }
  .paper-header .theme-control { border-left: 0; padding: 8px 6px 0; border-top: 1px solid var(--line); justify-content: space-between; }
  .paper-header .theme-control select { max-width: none; font-size: 13px; }
  .paper-header .nav-cta { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
  .paper-head { padding: 20px 0 24px; }
  .paper-masthead { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 10px; margin-bottom: 14px; }
  .prysai-wordmark { height: 18px; }
  .masthead-lab { display: none; }
  .masthead-stamp { font-size: 10.5px; }
  .paper-meta { gap: 4px 10px; }
  .paper-meta div:not(.meta-author):not(.meta-ver)::before { display: none; }
  .paper-meta .affil { display: inline; margin-top: 0; }
  .paper-meta .affil-sep { display: inline; }
  .paper-head h1, .hub h1 { font-size: clamp(24px, 6.8vw, 31px); letter-spacing: -.03em; }
  .paper-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lang-switch { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lang-switch a { padding: 0 8px; font-size: 12px; }
  .paper-actions { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .export-popover { right: 0; }
  .paper-body { font-size: 15.5px; line-height: 1.88; }
  .abstract-box, .concept-card, .keypoints { padding: 20px; }
  .concept-card dl div, .paper-decl dl div, .cite-formats div { grid-template-columns: 1fr; gap: 2px; }
  .paper-body table { font-size: 13px; }
  .table-wrap { padding: 2px 12px 6px; }
  .pesa-hero .h-cap { font-size: 13.5px; }
  .paper-footer .footer-bottom { align-items: flex-start; }
  .fab-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

@media print {
  @page {
    size: A4;
    margin: 20mm 18mm 20mm 18mm;
    @top-left {
      content: "Delegation Without Approval";
      font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
      font-size: 7pt;
      color: #52525b;
      letter-spacing: .02em;
      border-bottom: .45pt solid #c8c8cc;
      padding-bottom: 3.5pt;
      margin-bottom: 5.5mm;
      vertical-align: bottom;
    }
    @top-right {
      content: "Prysai Lab · Piko Research · v1.0 (2026-12-01)";
      font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
      font-size: 7pt;
      color: #52525b;
      letter-spacing: .02em;
      border-bottom: .45pt solid #c8c8cc;
      padding-bottom: 3.5pt;
      margin-bottom: 5.5mm;
      vertical-align: bottom;
    }
    @bottom-left {
      content: "© 2026 Ruiming Zhao, Prysai Lab · CC BY 4.0 · DOI: 10.5281/zenodo.24729210";
      font-family: Georgia, "Times New Roman", serif;
      font-size: 6.9pt;
      color: #52525b;
      border-top: .45pt solid #c8c8cc;
      padding-top: 3.5pt;
      margin-top: 5.5mm;
      vertical-align: top;
    }
    @bottom-right {
      content: counter(page) " / " counter(pages);
      font-family: Georgia, "Times New Roman", serif;
      font-size: 6.9pt;
      color: #52525b;
      border-top: .45pt solid #c8c8cc;
      padding-top: 3.5pt;
      margin-top: 5.5mm;
      vertical-align: top;
    }
  }
  @page :first {
    margin-top: 16mm;
    @top-left { content: none; border: none; }
    @top-right { content: none; border: none; }
  }
  @page zh-hans {
    @top-left { content: "无需审批的委托"; }
  }
  @page zh-hans:first {
    margin-top: 16mm;
    @top-left { content: none; border: none; }
    @top-right { content: none; border: none; }
  }
  @page zh-hant {
    @top-left { content: "無需審批的委託"; }
  }
  @page zh-hant:first {
    margin-top: 16mm;
    @top-left { content: none; border: none; }
    @top-right { content: none; border: none; }
  }
  html[lang="zh-CN"] body.paper-site { page: zh-hans; }
  html[lang="zh-Hant"] body.paper-site { page: zh-hant; }
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --canvas: #ffffff;
    --surface: #ffffff;
    --elevated: #f4f4f6;
    --ink: #111111;
    --on-ink: #ffffff;
    --muted: #52525b;
    --line: #d4d4d8;
    --wash: #fafafa;
    --panel: #fafafa;
    --control-line: #a1a1aa;
    --ok-bg: transparent; --ok-ink: #111111; --ok-line: #a1a1aa;
    --wip-bg: transparent; --wip-ink: #111111; --wip-line: #a1a1aa;
    --deny-bg: #fef2f2; --deny-ink: #991b1b; --deny-line: #fca5a5;
    --code-kw: #111111; --code-str: #1f2937; --code-cmt: #6b7280; --code-op: #111111;
    --rq-bg: #f4f7fb; --rq-line: #b8c4d4; --rq-accent: #1e3a8a;
    --rqa-bg: #fffdf5; --rqa-line: #d4bf8d;
    --plt-p50: #0f6b63; --plt-p90: #b85314; --plt-mid: #475569; --plt-iqr: rgba(15, 107, 99, .14);
    --plt-bar-a: #9ca3af; --plt-bar-b: #0f6b63; --plt-bar-hi: #b85314; --plt-on-bar: #ffffff;
    --plt-quiet: rgba(30, 64, 175, .07); --plt-ref: #52525b;
    --hi-bg: #eaf5f3; --hi-line: #0f6b63; --hi-ink: #0c443f; --hi-sub: #2d625c;
  }
  .paper-header, .breadcrumb, .paper-toc, .paper-toolbar, .paper-footer, .read-progress, .skip-link, .cite-pop, .bibtex .copy, .algo-copy, .figure-zoom, .fab-top, .cite-tabs, .preview-note, .sec-anchor, .svg-modal, .paper-hero, .paper-bento, .print-copyright-bar { display: none !important; }
  [data-cite-panel][hidden] { display: none !important; }
  body.paper-site { background: #fff; color: #111; }
  .paper-header-inner, .paper-main, .paper-footer-inner { width: 100%; }
  .paper-layout { display: block; padding: 0; }

  /* Institutional Technical Report Masthead + NVIDIA-style Clean Left-Aligned Title Spine (ONLY 1 top hairline rule!) */
  .paper-masthead { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 0 6pt; margin: 0 0 14pt; border-bottom: .75pt solid #222; text-align: left; }
  .masthead-brand { display: inline-flex; align-items: center; gap: 8pt; color: #000; text-decoration: none; }
  .prysai-wordmark { height: 15pt; width: auto; color: #000; }
  .masthead-lab { display: none; }
  .masthead-stamp { font-family: Georgia, "Times New Roman", serif; font-size: 8.2pt; font-weight: 400; color: #444; letter-spacing: .01em; }
  .paper-head { max-width: none; padding: 0 0 6pt; border-bottom: 0; text-align: left; }
  .paper-head .eyebrow { display: none; }
  .paper-head h1 { max-width: none; margin: 0 0 5pt; font-family: Georgia, "Times New Roman", "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif CJK TC", serif; font-size: 20pt; line-height: 1.2; letter-spacing: -.012em; font-weight: 700; text-align: left; color: #111; }
  .paper-subtitle { max-width: none; margin: 0 0 10pt; font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif; font-size: 10pt; font-weight: 400; line-height: 1.46; color: #52525b; font-style: italic; text-align: left; }
  html[lang^="zh"] .paper-subtitle { font-style: normal; }
  /* Clean 2-row typographic weight hierarchy — NO extra horizontal line above or below! */
  .paper-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2.5pt 10pt; margin: 0; padding: 0; border: 0; font-size: 8pt; color: #52525b; text-align: left; }
  .paper-meta .meta-read { display: none !important; }
  .paper-meta div { display: inline-flex; align-items: baseline; gap: 3pt; }
  .paper-meta div:not(.meta-author):not(.meta-ver)::before { content: "·"; color: #a1a1aa; margin-right: 3pt; }
  .paper-meta .meta-author { flex: 0 0 100%; justify-content: flex-start; font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif; margin-bottom: 1.5pt; }
  .paper-meta .meta-author dt { display: none; }
  .paper-meta .meta-author dd { display: inline-flex; align-items: baseline; font-size: 10.2pt; font-weight: 700; color: #111; }
  .paper-meta .meta-author .affil { display: inline; font-size: 9.4pt; font-weight: 400; font-style: italic; color: #52525b; }
  html[lang^="zh"] .paper-meta .meta-author .affil { font-style: normal; }
  .paper-meta .meta-author .affil-sep { display: inline; }
  .paper-meta dt { font-size: 7.8pt; font-weight: 400; color: #71717a; text-transform: none; letter-spacing: 0; }
  .paper-meta .meta-ver dt, .paper-meta .meta-doi dt { display: none; }
  .paper-meta dd { font-size: 8pt; font-weight: 400; color: #52525b; }
  .paper-meta .meta-ver dd { font-weight: 500; color: #27272a; }
  .paper-meta .author-orcid { padding: 0 3.5pt; margin-left: 5pt; border: .45pt solid #a1a1aa; background: transparent; color: #52525b; font-size: 6.4pt; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 500; vertical-align: 1pt; }
  .paper-meta .author-orcid::before { display: none; }
  .paper-meta .doi-badge { padding: 0; border: 0; background: transparent; font-size: 7.8pt; font-weight: 400; color: #3f3f46; text-decoration: none; }

  /* Classic Scholarly Body Typography */
  .paper-body { max-width: none; font-family: Georgia, "Times New Roman", "STIX Two Text", serif; font-size: 9.5pt; line-height: 1.50; color: #111; text-align: justify; hyphens: auto; }
  html[lang^="zh"] .paper-body { font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif CJK TC", Georgia, serif; font-size: 9.35pt; line-height: 1.56; hyphens: none; }
  .paper-body > p, .paper-body > ul, .paper-body > ol, .paper-body > h2, .paper-body > h3, .paper-body > blockquote { max-width: none; }
  .paper-body code, .paper-body pre, .algo-pre, .algo-pre .al, .paper-cite pre { text-align: left; hyphens: none; -webkit-hyphens: none; }

  /* Clean Unboxed Scholarly Abstract (zero heavy horizontal bars, generous breathing room) */
  .abstract-box { padding: 0; margin: 11pt 0 14pt; border: 0; border-radius: 0; background: transparent; font-size: 8.8pt; line-height: 1.48; max-width: none; text-align: justify; }
  .abstract-box p { margin: 0 0 5pt; max-width: none; }
  .abstract-box p:last-child { margin-bottom: 0; font-size: 8.1pt; color: #3f3f46; }
  #abstract { text-align: left; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", sans-serif; font-size: 9.6pt; font-weight: 700; letter-spacing: 0; text-transform: none; color: #111; margin: 0 0 5pt; }

  /* Headings: Crisp Sans-Serif Hierarchy (clean, zero horizontal line fatigue, strictly non-orphaned) */
  .paper-body h2 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Helvetica Neue", sans-serif; font-size: 11.8pt; font-weight: 700; letter-spacing: -.01em; margin: 14pt 0 5.5pt; padding-bottom: 0; border-bottom: 0; break-after: avoid; page-break-after: avoid; text-align: left; }
  .paper-body h3 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "Helvetica Neue", sans-serif; font-size: 9.8pt; font-weight: 650; margin: 10pt 0 3.5pt; break-after: avoid; page-break-after: avoid; text-align: left; }
  .paper-body p { margin-bottom: 5.8pt; orphans: 3; widows: 3; }
  .paper-body ul, .paper-body ol { margin: 0 0 7pt; padding-left: 16pt; }
  .paper-body li { margin: 2.5pt 0; }
  .paper-body code { font-size: .83em; background: #f4f4f6; padding: .4pt 2.4pt; border-radius: 2pt; border: 0; color: #111; }

  /* Academic Callouts (Definition, Proposition, Proof, Intuition) */
  .paper-body blockquote { margin: 7pt 0 9pt; padding: 6.5pt 10.5pt; border: .55pt solid #cbd5e1; border-left: 2.2pt solid #0f6b63; border-radius: 0; background: #fafafa; font-size: 8.9pt; line-height: 1.48; break-inside: avoid; }
  .paper-body blockquote.prop-box { border: .65pt solid #94a3b8; border-left: 2.4pt solid #111; background: #ffffff; }
  .paper-body blockquote.proof-box { margin-top: -4pt; margin-bottom: 9pt; border: 0; border-left: 1.2pt solid #cbd5e1; background: transparent; padding: 3.5pt 10pt; font-size: 8.7pt; color: #333; }
  .paper-body blockquote.intuition-box { border: 0; border-left: 2pt solid #94a3b8; background: #f8fafc; padding: 5.5pt 10pt; font-size: 8.7pt; color: #222; }
  .paper-body .rq-box { max-width: none; margin: 6pt 0 9pt; border: .65pt solid var(--rq-line); border-radius: 3pt; background: var(--rq-bg); break-inside: avoid; }
  .paper-body .rq-q { padding: 5pt 9pt 4pt; font-size: 8.7pt; line-height: 1.44; text-align: left; }
  .paper-body .rq-a { margin: 0 7pt 6pt; padding: 4pt 8pt; border: .55pt solid var(--rqa-line); border-radius: 2pt; background: var(--rqa-bg); font-size: 8.5pt; line-height: 1.44; text-align: left; }

  /* Equations */
  .math-block { background: transparent; border: 0; border-radius: 0; padding: 3.5pt 4pt; margin: 5.5pt 0 8pt; font-size: 8.9pt; line-height: 1.48; max-width: none; overflow: visible !important; break-inside: avoid; }
  .math-block .eq-num { font-size: 8.6pt; color: #333; }
  .math { white-space: normal; }

  /* LaTeX booktabs Three-Line Tables (zero mid-word hyphenation, compact tables kept unbroken) */
  .table-card { border: 0; border-radius: 0; background: transparent; overflow: visible !important; break-inside: auto; margin: 8.5pt 0 11pt; }
  .table-card.table-keep { break-inside: avoid; page-break-inside: avoid; }
  .table-title { background: transparent; border: 0; padding: 0 0 3.5pt; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", sans-serif; font-size: 8.5pt; font-weight: 700; color: #111; break-inside: avoid; break-after: avoid; page-break-after: avoid; text-align: left; hyphens: none; }
  .table-wrap { overflow: visible !important; padding: 0; }
  .paper-body table { width: 100%; table-layout: auto; display: table; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", sans-serif; font-size: 7.55pt; line-height: 1.38; border-top: 1.15pt solid #111; border-bottom: 1.15pt solid #111; overflow: visible !important; text-align: left; hyphens: none !important; }
  .paper-body thead { display: table-header-group; }
  .paper-body th { font-size: 7.5pt; font-weight: 700; color: #111; border-bottom: .7pt solid #222; letter-spacing: 0; padding: 3.4pt 6.5pt 3.4pt 0; hyphens: none !important; }
  .paper-body td { border-bottom: .35pt solid #e4e4e7; padding: 3.1pt 6.5pt 3.1pt 0; color: #111; hyphens: none !important; }
  .paper-body td code { font-size: .81em; overflow-wrap: anywhere; word-break: break-word; }
  .paper-body th, .paper-body td, .paper-body td:first-child, .paper-body td.nowrap { white-space: normal !important; overflow-wrap: break-word; word-break: normal; }
  .paper-body th:last-child, .paper-body td:last-child { padding-right: 0; }
  .status-pill { border: 0; background: transparent !important; color: #111 !important; padding: 0; font-size: 7.5pt; font-weight: 700; white-space: nowrap !important; }
  .paper-body tr, .paper-figure, .algo-card, .paper-refs li { break-inside: avoid; }

  /* Figures */
  .paper-figure { margin: 8pt 0 10pt; }
  .figure-stage { border: 0; padding: 0; overflow: visible !important; }
  .paper-figure svg { min-width: 0; max-height: 102mm; }
  .paper-figure figcaption { margin-top: 3.5pt; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", sans-serif; font-size: 8pt; line-height: 1.42; color: #444; text-align: left; }

  /* LaTeX Three-Rule Algorithm Floats */
  .algo-card { border: 0; border-top: 1.15pt solid #111; border-bottom: 1.15pt solid #111; border-radius: 0; background: transparent; overflow: visible !important; margin: 8pt 0 10.5pt; }
  .algo-head { padding: 3.5pt 2pt; background: transparent; border-bottom: .6pt solid #333; font-size: 8.3pt; font-weight: 700; color: #111; }
  .algo-pre { padding: 4.5pt 2pt !important; background: transparent !important; }
  .algo-pre, .algo-pre code, .algo-pre .al { font-size: 7.7pt !important; line-height: 1.45 !important; white-space: pre-wrap !important; overflow-wrap: anywhere !important; overflow: visible !important; }
  .bibtex pre, .bibtex code { font-size: 7.3pt !important; line-height: 1.35 !important; white-space: pre-wrap !important; overflow-wrap: anywhere !important; overflow: visible !important; padding: 5pt 8.5pt; border-radius: 3pt; }

  /* Appendix B & Backmatter */
  .faq-list { border-top: .6pt solid #bbb; max-width: none; }
  .faq-item { display: block; break-inside: avoid; border-bottom: .4pt solid #e4e4e7; }
  .faq-item summary { min-height: 0; padding: 5.5pt 0 2.5pt; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", sans-serif; font-size: 9pt; font-weight: 700; }
  .faq-item .disclosure { display: none; }
  .faq-answer { display: block !important; color: #222; font-size: 8.8pt; line-height: 1.48; padding: 0 0 5.5pt; }
  .paper-decl, .paper-cite, .paper-refs { margin-top: 10pt; padding-top: 4pt; border-top: .75pt solid #999; }
  .paper-decl { break-inside: auto; }
  .paper-decl dl div, .cite-formats div { break-inside: avoid; }
  .paper-decl h2, .paper-cite h2, .paper-refs h2 { margin-top: 5pt; border-bottom: 0; break-after: avoid; }
  .paper-decl dl, .cite-formats { font-size: 8.2pt; line-height: 1.44; margin-bottom: 6pt; text-align: left; }
  .paper-decl dt, .paper-decl dd, .cite-formats dt, .cite-formats dd { text-align: left; hyphens: none; }
  .paper-cite pre, .cite-card, .cite-box { break-inside: avoid; page-break-inside: avoid; }
  .paper-decl dl div, .cite-formats div { grid-template-columns: 108px minmax(0, 1fr); gap: 8px; padding: 2.8pt 0; border-top: .35pt solid #e4e4e7; }
  .paper-refs ol { font-size: 7.5pt; line-height: 1.32; padding-left: 2.2em; max-width: none; text-align: left; }
  .paper-refs li { margin-left: 0; padding: .55pt 0; }
  html[lang^="zh"] .paper-refs { margin-top: 0; padding-top: 0; border-top: 0; }
  html[lang^="zh"] .paper-refs ol { font-size: 7.3pt; line-height: 1.30; }
  html[lang^="zh"] .paper-refs li { padding: .5pt 0; }
  html[lang^="zh"] .tm { margin-top: 5pt; }
  .paper-refs a, .paper-body a { text-decoration: none; color: #111; }
  .tm { margin-top: 8pt; font-size: 7.5pt; color: #555; }
  .pesa-figure .f-line.dash, .pesa-hero .h-pulse, .pesa-hero .h-halo, .pesa-hero .pk-eye, .pesa-hero .pk-body { animation: none; }
}
