.journal-heading { padding: 5rem 0 2rem; }
.journal-heading h1 { font-size: clamp(3.5rem, 9vw, 6rem); max-width: none; }
.journal-feature { margin-bottom: 5rem; }
.journal-feature h2 { max-width: none; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; }
.journal-feature h2 a { text-decoration: none; }
.article-hero { padding: clamp(3rem, 7vw, 6rem) 0 2.5rem; }
.article-hero h1 { max-width: 20ch; font-size: clamp(2.65rem, 6vw, 5.1rem); line-height: 1.02; letter-spacing: -0.055em; }
.article-hero .lede { max-width: 48rem; font-size: 1.2rem; }
.article-meta { display: flex; gap: .5rem 1.3rem; flex-wrap: wrap; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.article-cover { margin: 0 0 3rem; }
.article-cover img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 1.3rem; }
figcaption { margin-top: .85rem; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 3rem; align-items: start; }
.article-body { min-width: 0; font-size: 1.075rem; line-height: 1.8; }
.article-body section { margin-bottom: 3.75rem; }
.article-body h2 { max-width: none; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.13; letter-spacing: -.035em; margin: .65rem 0 1.2rem; }
.article-body h3 { margin-top: 2rem; line-height: 1.35; }
.article-body p, .article-body li { color: #c2cfdf; }
.article-body strong { color: var(--text); }
.article-body a:not(.button) { color: var(--cyan); text-underline-offset: .18em; }
.article-body li + li { margin-top: .6rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body .eyebrow { color: var(--cyan); font-size: .75rem; }
.article-toc { position: sticky; top: 6.5rem; border-left: 1px solid var(--line); padding-left: 1.3rem; }
.article-toc nav { display: block; }
.article-toc ol { padding-left: 1.25rem; color: var(--muted); }
.article-toc li { margin: .8rem 0; line-height: 1.4; }
.article-toc a { font-size: .87rem; }
.article-toc .toc-repo { display: inline-block; font-size: .87rem; color: var(--cyan); margin-top: .7rem; }
.callout { margin: 1.8rem 0; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 0 .8rem .8rem 0; background: var(--card); }
.callout p:last-child { margin-bottom: 0; }
.callout.status { border-left-color: var(--violet); }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .86em; }
:not(pre) > code { overflow-wrap: anywhere; color: #d6e9ff; background: #122239; padding: .15em .3em; border-radius: .25rem; }
pre { margin: 0; padding: 1.25rem; overflow-x: auto; line-height: 1.65; background: #040b16; color: #d8eaff; tab-size: 2; }
pre code { font-size: inherit; }
.code-block { margin: 1.5rem 0; border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; }
.code-label { display: block; padding: .55rem 1.25rem; background: #101e32; color: var(--muted); font-size: .78rem; letter-spacing: .03em; }
.diagram { margin: 2rem 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: 1.1rem; background: #081425; }
.diagram h3 { margin: 0 0 1rem; font-size: 1rem; }
.diagram p { font-size: .92rem; line-height: 1.5; margin: .4rem 0 0; }
.lane-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); font-weight: 800; }
.flow-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: .65rem; align-items: center; margin: .8rem 0 1.5rem; }
.flow-node { min-width: 0; border: 1px solid #34526e; border-radius: .7rem; padding: .8rem; background: #0c2135; font-size: .9rem; line-height: 1.4; }
.flow-node strong { display: block; }
.flow-node small { display: block; color: var(--muted); margin-top: .3rem; font-size: .78rem; }
.flow-arrow { color: var(--cyan); }
.native-boundary { border: 1px dashed #867bbb; border-radius: .8rem; padding: 1rem; }
.native-boundary .lane-label { color: #c3baff; }
.native-boundary .flow-row { margin-bottom: .25rem; }
.diagram-note { border-top: 1px solid var(--line); padding-top: 1rem; }
.gate-controls { border: 0; padding: 0; margin: 1.2rem 0; }
.gate-controls legend { font-weight: 700; margin-bottom: .65rem; }
.gate-controls label { display: flex; align-items: center; gap: .7rem; min-height: 2.75rem; font-size: .92rem; cursor: pointer; }
.gate-controls input { accent-color: var(--cyan); width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.gate-controls select { display: block; width: 100%; padding: .65rem; border-radius: .5rem; border: 1px solid #587493; background: #0a1a2c; color: var(--text); font: inherit; }
.gate-trace { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: 0 !important; list-style: none; }
.gate-trace li { margin: 0 !important; padding: .6rem; border: 1px solid #52637c; border-radius: .5rem; font-size: .8rem; line-height: 1.5; }
.gate-trace span { display: block; font-weight: 700; }
.gate-trace .pass { border-color: #7df4ff; background: #0c2b36; }
.gate-trace .deny { border-color: #ffb9a7; background: #382329; }
.gate-trace .skip { border-style: dashed; }
.gate-result { padding: .9rem; border-left: 3px solid var(--cyan); background: #10253b; min-height: 5rem; }
.gate-result[data-allowed="false"] { border-left-color: #ffb9a7; }
.gate-result strong { display: block; }
.gate-explanation { margin-top: 1rem !important; }
[hidden] { display: none !important; }
.workflow { counter-reset: delivery; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 0 !important; list-style: none; }
.workflow li { counter-increment: delivery; margin: 0 !important; padding: 1rem; background: #0c2135; border: 1px solid var(--line); border-radius: .7rem; font-size: .9rem; line-height: 1.5; }
.workflow li::before { content: "0" counter(delivery); color: var(--cyan); display: block; font-size: .8rem; margin-bottom: .5rem; }
.workflow strong { display: block; }
.workflow span { display: block; margin-top: .4rem; }
.phone-figure { float: right; width: 34%; margin: .3rem 0 1.2rem 1.5rem; }
.phone-figure img { display: block; width: 100%; height: auto; border-radius: .8rem; border: 1px solid var(--line); }
.clear-section::after { content: ""; display: table; clear: both; }
.evidence-list { display: grid; gap: .9rem; }
.evidence-list div { border-top: 1px solid var(--line); padding-top: 1rem; }
.evidence-list dt { font-weight: 750; color: var(--text); }
.evidence-list dd { margin: .3rem 0 0; color: #c2cfdf; }
.source-list { font-size: .95rem; }
.article-end { margin: 1rem 0 4rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; }
.article-end h2 { font-size: 1.8rem; }
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .article-toc { position: static; grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 1rem; }
  .article-toc ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.8rem; }
  .article-toc li { margin: .4rem 0; }
  .article-body { width: 100%; max-width: 52rem; margin-inline: auto; }
}
@media (max-width: 560px) {
  .article-hero h1 { font-size: 2.65rem; }
  .article-body { font-size: 1rem; }
  .diagram { padding: 1rem; }
  .flow-row { grid-template-columns: 1fr; gap: .4rem; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .workflow { grid-template-columns: 1fr; }
  .gate-trace { grid-template-columns: 1fr 1fr; }
  .phone-figure { float: none; width: min(100%, 280px); margin: 1.5rem auto; }
  .article-toc ol { grid-template-columns: 1fr; }
  pre { padding: 1rem; font-size: .78rem; }
}
@media print {
  :root { color-scheme: light; }
  body { background: white; color: #111; }
  body::before, .site-header, .article-toc, .gate-controls, .site-footer, .skip-link { display: none; }
  main { width: 100%; }
  .article-layout { display: block; }
  .article-body, .article-body p, .article-body li, .article-body strong, .article-body a:not(.button), .article-body dd, .article-body dt, figcaption, .article-meta { color: #111; }
  .diagram, .flow-node, .workflow li, .callout, .gate-result, .gate-trace li { background: white; color: #111; break-inside: avoid; }
  .flow-node small, .lane-label, .eyebrow, .flow-arrow, .native-boundary .lane-label { color: #333 !important; }
  pre, :not(pre) > code, .code-label { background: #eee; color: #111; white-space: pre-wrap; overflow-wrap: anywhere; }
}
