@import url('/assets/tokens.css');

* { box-sizing: border-box; }
html { scroll-padding-top: 100px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, var(--accent-wash), transparent 45%),
    radial-gradient(circle at 95% 100%, var(--accent-wash), transparent 45%);
  color: var(--fg);
  font: 16px/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-text); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 4px;
}
::selection { background: var(--primary); color: var(--terminal); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.icon-button {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  transition: background .15s, transform .15s;
}
.icon-button:hover { background: var(--surface-2); transform: translate(-1px,-1px); }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px 20px; transform: translateY(-160%); border: 2px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); }

/* The reference's outlined paper cards, adapted into a persistent schedule. */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 40; display: flex; flex-direction: column; background: var(--surface-2); border-right: 2px solid var(--border); }
.sidebar-heading { padding: 24px 20px; display: flex; align-items: center; justify-content: space-between; border-top: 4px solid var(--primary); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); text-decoration: none; font-size: 19px; font-weight: 800; letter-spacing: -.8px; line-height: 1.2; }
.brand-light { font-weight: 400; color: var(--muted); }
.brand small { display: block; margin-top: 7px; font-size: 9px; font-weight: 500; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
.brand-mark { height: 40px; width: 40px; display: grid; place-items: center; border: 2px solid var(--border); background: var(--primary); color: #2a1a0f; box-shadow: 3px 3px 0 var(--border-soft); }
.brand-mark .icon { width: 25px; height: 25px; }
.sidebar-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 24px; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.schedule-label { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); }
.schedule-label>span:last-child { padding: 2px 6px; background: var(--surface); border: 1px solid var(--border-soft); font-size: 10px; letter-spacing: 0; color: var(--fg); }
.nav-group+.nav-group { margin-top: 24px; }
.nav-group h2 { margin: 0 8px 10px; color: var(--accent-text); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.nav-group ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.section-link { position: relative; display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding: 9px 8px; border: 1px solid transparent; color: var(--fg); text-decoration: none; transition: background .15s, border-color .15s; }
.section-link:hover { background: var(--surface); border-color: var(--border-soft); }
.section-number { min-width: 22px; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 19px; }
.section-number .icon { height: 14px; width: 14px; vertical-align: -2px; }
.section-label { flex: 1; min-width: 0; font-size: 12px; font-weight: 500; line-height: 21px; }
.section-link time { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 18px; font-variant-numeric: tabular-nums; }
.section-link.is-current { border-color: var(--border); background: var(--surface); box-shadow: 3px 3px 0 var(--accent-wash); }
.section-link.is-current:before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--primary); }
.is-current .section-label { font-weight: 700; }
.is-current .section-number, .is-current time { color: var(--accent-text); }
.section-progress { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 12px; }
.progress-track { display: flex; gap: 2px; width: 48px; height: 3px; overflow: hidden; }
.progress-track>span { flex: 1; background: var(--border-soft); }
.progress-track>span.complete { background: var(--good); }
.is-complete .section-progress { color: var(--good); }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 16px 20px; background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; line-height: 1.7; }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; background: var(--good); }
.sidebar-close, .menu-button { display: none; }

/* Outlined labels and a quiet, paper-colored sticky header. */
.workspace { margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-location { display: flex; align-items: center; gap: 14px; min-width: 0; font-size: 11px; }
.topbar-location>a { padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); color: var(--fg); font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar-location>a:hover { background: var(--accent-wash); }
.topbar-divider { color: var(--primary); }
.topbar-current { min-width: 0; color: var(--muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.workshop-time { padding: 5px 8px; border: 1px solid var(--border-soft); color: var(--muted); font-size: 10px; white-space: nowrap; }
.workshop-time>span { margin: 0 4px; color: var(--accent-text); }
.theme-button .icon { display: none; width: 17px; height: 17px; }
.theme-button[data-mode=system] .theme-system, .theme-button[data-mode=light] .theme-sun, .theme-button[data-mode=dark] .theme-moon { display: block; }
.trail-button .icon { width: 18px; height: 18px; }
.trail-button[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent-text); }
.trail-button .trail-off-mark { display: none; }
.trail-button[aria-pressed="false"] .trail-off-mark { display: block; }
.trail-button:disabled { opacity: .5; cursor: not-allowed; transform: none; background: var(--surface); }
/* Decorative overlay only: it cannot receive focus, pointer events, or selection.
   The zero-width border and absent outline also serve as resolved palette colors. */
.cursor-smoke { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; user-select: none; contain: strict; color: var(--primary); border: 0 solid color-mix(in srgb, var(--surface) 40%, #92918b); outline-color: var(--terminal-fg); }
@media (prefers-reduced-motion: reduce), (pointer: coarse), (hover: none) {
  .cursor-smoke { display: none !important; }
}
.reading-layout { display: grid; grid-template-columns: minmax(0,780px) 174px; gap: 32px; max-width: 1260px; margin: 0 auto; padding: 40px 32px 0; }
main { min-width: 0; }
main:focus { outline: none; }
.guide-article { min-width: 0; animation: arrive .35s ease-out both; }
.eyebrow { margin: 0 0 24px; font-size: 10px; font-weight: 700; line-height: 1.7; letter-spacing: 1.3px; text-transform: uppercase; color: var(--accent-text); }
.article-header { position: relative; margin-bottom: 32px; padding: 28px 28px 24px; border: 2px solid var(--border); border-left: 5px solid var(--primary); background: var(--surface); box-shadow: var(--shadow-strong); }
.article-header>.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 5px 9px; margin-bottom: 24px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.article-header>.eyebrow:before { content: ''; width: 6px; height: 6px; flex-shrink: 0; background: var(--primary); }
h1 { margin: 0 0 24px; font-size: clamp(32px,3.6vw,48px); font-weight: 700; line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance; }
.welcome-header { padding-top: 32px; padding-bottom: 28px; background-image: linear-gradient(var(--grid-line) 1px,transparent 1px), linear-gradient(90deg,var(--grid-line) 1px,transparent 1px); background-size: 28px 28px; }
.welcome-header h1 { max-width: 680px; font-size: clamp(36px,4vw,56px); margin-bottom: 28px; }
.title-highlight { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb,var(--accent) 32%,transparent); text-decoration-thickness: .15em; text-underline-offset: -.1em; text-decoration-skip-ink: none; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.article-meta>span { display: inline-flex; align-items: center; gap: 7px; }
.article-meta .icon { width: 14px; height: 14px; }
.meta-dot { color: var(--accent-text); }
.page-progress.all-complete { color: var(--good); }

/* Long-form reading keeps the reference's mono type, with a larger baseline. */
.markdown { font-size: 16px; line-height: 1.85; overflow-wrap: break-word; }
.markdown>*:first-child { margin-top: 0; }
.markdown p { margin: 20px 0; }
.markdown strong { font-weight: 700; }
.markdown h2 { position: relative; margin: 48px 0 20px; padding-top: 24px; border-top: 1px solid var(--border-soft); font-size: 24px; font-weight: 700; line-height: 1.35; letter-spacing: -.035em; scroll-margin-top: 96px; overflow-wrap: anywhere; }
.markdown h3 { margin: 32px 0 16px; font-size: 19px; font-weight: 700; line-height: 1.5; letter-spacing: -.025em; scroll-margin-top: 96px; }
.markdown h4 { margin: 24px 0 12px; font-size: 16px; scroll-margin-top: 96px; }
.heading-anchor { margin-left: 10px; color: var(--accent-text); font-size: .65em; font-weight: 400; text-decoration: none; opacity: 0; transition: opacity .15s; }
.markdown :is(h2,h3,h4):hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.markdown ul, .markdown ol { padding-left: 27px; margin: 20px 0; }
.markdown li { margin: 10px 0; padding-left: 4px; }
.markdown li::marker { color: var(--accent-text); font-size: .9em; font-weight: 700; }
.markdown li p { margin: 8px 0; }
.markdown li>ul, .markdown li>ol { margin: 10px 0; }
.markdown :not(pre)>code { padding: 2px 4px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--fg); font: .86em/1.5 var(--font); box-decoration-break: clone; -webkit-box-decoration-break: clone; overflow-wrap: anywhere; }
.markdown a>code { color: inherit; }
.markdown a { text-decoration-color: color-mix(in srgb,var(--accent-text) 55%,transparent); }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown hr { border: 0; border-top: 1px dashed var(--border-soft); margin: 32px 0; }
.markdown img { max-width: 100%; height: auto; }
.markdown>p:last-child:has(>a[href^="/lab/"]) { margin-top: 32px; font-size: 13px; }

.callout { margin: 28px 0; padding: 2px 20px; border: 1px solid var(--border-soft); border-left: 4px solid var(--primary); background: var(--surface); font-size: 14px; line-height: 1.8; }
.callout>p { margin: 16px 0; }
.callout>ul { margin: 12px 0; }
.callout-warning, .callout-waiting { border-left-color: var(--warn); background: var(--warning-wash); }
.callout-stretch { background: var(--accent-wash); border-color: var(--border-soft); border-left-color: var(--primary); }
.markdown li>.callout { margin: 16px 0; }
.table-scroll { max-width: 100%; overflow: auto; margin: 24px 0 32px; border: 2px solid var(--border); background: var(--surface); box-shadow: 4px 4px 0 var(--accent-wash); scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; line-height: 1.8; }
th, td { padding: 13px 16px; vertical-align: top; min-width: 75px; }
thead { background: var(--surface-2); }
th { border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; }
td { border-bottom: 1px solid var(--border-soft); }
tr:last-child>td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-wash); }
table code { font-size: 11px !important; }
.align-center { text-align: center; }
.align-right { text-align: right; }

/* Warm terminal colors from developer-platform's .agent-terminal/.terminal-bar. */
.code-block { margin: 24px 0 32px; max-width: 100%; border: 2px solid var(--border); border-left: 4px solid var(--primary); background: var(--terminal); color: var(--terminal-fg); box-shadow: var(--shadow); overflow: hidden; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 0 16px; padding: 3px 0; border-bottom: 1px solid #fdfaf32e; }
.code-toolbar>span { color: var(--terminal-accent); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.copy-button { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 8px; border: 1px solid #fdfaf34a; background: transparent; color: var(--terminal-fg); font-size: 10px; font-weight: 500; transition: background .15s; }
.copy-button .icon { height: 14px; width: 14px; }
.copy-button:hover { background: #fdfaf312; }
.copy-button.copied { color: #a1d7aa; border-color: #a1d7aa; }
.code-block :focus-visible { outline-color: var(--terminal-accent); }
pre { margin: 0; padding: 20px 18px 24px; overflow: auto; tab-size: 2; scrollbar-width: thin; scrollbar-color: #a69481 transparent; }
pre code { display: block; width: max-content; min-width: 100%; color: var(--terminal-fg); font: 13px/1.85 var(--font); overflow-wrap: normal; }
.hljs-comment, .hljs-quote { color: #c8b8a6; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #ff8a3d; }
.hljs-string, .hljs-addition { color: #b9d5aa; }
.hljs-attr, .hljs-number, .hljs-symbol { color: #ffc486; }
.hljs-title, .hljs-function, .hljs-built_in { color: #f1d4a8; }
.hljs-variable, .hljs-template-variable, .hljs-params { color: #e1cab6; }

details { margin: 24px 0; border: 2px solid var(--border); background: var(--surface); box-shadow: 4px 4px 0 var(--accent-wash); overflow: hidden; }
summary { position: relative; min-height: 60px; padding: 16px 52px 16px 20px; list-style: none; color: var(--fg); font-size: 14px; font-weight: 700; line-height: 1.85; cursor: pointer; transition: background .15s; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }
summary:after { content: '+'; position: absolute; top: 17px; right: 16px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--accent-text); font-size: 18px; font-weight: 400; line-height: 1; }
summary:hover { background: var(--surface-2); }
details[open]>summary { border-bottom: 1px solid var(--border); background: var(--accent-wash); }
details[open]>summary:after { content: '−'; }
details>:not(summary) { margin-left: 20px; margin-right: 20px; }
details>:last-child { margin-bottom: 24px; }
details>p:first-of-type { margin-top: 24px; }
details .code-block { margin-top: 24px; }

.markdown ul:has(>.task-list-item) { padding: 0; list-style: none; margin: 24px 0 28px; display: grid; gap: 8px; }
.markdown .task-list-item { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 13px 16px; list-style: none; border: 1px solid var(--border-soft); background: var(--surface); font-size: 14px; line-height: 1.8; cursor: pointer; transition: border-color .15s, background .15s; }
.task-list-item:hover { border-color: var(--border); }
.task-list-item input { appearance: none; -webkit-appearance: none; display: block; position: relative; flex-shrink: 0; width: 20px; height: 20px; margin: 3px 0 0; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; }
.task-list-item input:checked { background: var(--good); border-color: var(--good); }
.task-list-item input:checked:after { content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid light-dark(#fdfaf3,#1c1510); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task-list-item.is-checked { background: var(--good-wash); border-color: var(--good); }
.task-text { min-width: 0; }
.task-text>p { margin: 0 !important; }
.save-note { margin-top: 28px; color: var(--muted); font-size: 11px; }
.placeholder-link { display: inline-flex; align-items: flex-start; flex-direction: column; gap: 8px; vertical-align: middle; }
.deploy-button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid var(--border); background: var(--primary); color: #2a1a0f; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; line-height: 1.6; }
.deploy-button .icon { width: 20px; }
.placeholder-note { display: inline-block; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.6; }

.page-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0 0; padding-top: 32px; border-top: 1px dashed var(--border-soft); }
.page-nav-card { min-width: 0; min-height: 104px; padding: 16px 20px; border: 2px solid var(--border); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.page-nav-card>span { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.page-nav-card>span .icon { width: 18px; height: 18px; color: var(--accent-text); }
.page-nav-card strong { display: block; margin-top: 12px; font-size: 14px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.page-nav-card:hover { background: var(--surface-2); transform: translate(-2px,-2px); box-shadow: var(--shadow-strong); }
.page-nav-card.next { border-top: 4px solid var(--primary); padding-top: 14px; }
.page-nav-card.next>span { color: var(--accent-text); }
.finish-note { padding: 20px; margin: 32px 0; border-top: 2px solid var(--primary); border-bottom: 2px solid var(--primary); text-align: center; font-size: 17px; font-weight: 700; }
.page-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 40px; padding: 24px 0 32px; color: var(--muted); font-size: 9px; line-height: 1.8; }
.page-footer a { color: var(--muted); text-decoration: none; }
.page-footer a:hover { color: var(--accent-text); }
.page-footer>a:first-child { font-weight: 700; }
.page-footer>span { font-size: 9px; }
.page-outline { position: sticky; top: 112px; align-self: start; max-height: calc(100dvh - 144px); overflow-y: auto; padding-top: 4px; scrollbar-width: thin; }
.page-outline>.eyebrow { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; letter-spacing: .8px; }
.page-outline nav { display: grid; }
.page-outline nav a { padding: 8px 0 8px 12px; border-left: 2px solid var(--border-soft); color: var(--muted); font-size: 11px; line-height: 1.7; text-decoration: none; }
.page-outline nav a:hover { color: var(--fg); }
.page-outline nav a[aria-current] { border-color: var(--primary); color: var(--accent-text); font-weight: 700; }
.help-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; padding: 12px 10px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-size: 10px; text-decoration: none; }
.help-link .icon { width: 14px; height: 14px; color: var(--accent-text); }
.not-found { display: grid; place-items: center; min-height: 100dvh; padding: 32px; }
.not-found main { max-width: 600px; padding: 32px; border: 2px solid var(--border); border-top: 4px solid var(--primary); background: var(--surface); box-shadow: var(--shadow-strong); }
.not-found p { color: var(--muted); line-height: 1.8; }
.primary-link { display: inline-flex; gap: 24px; margin-top: 16px; padding: 12px 16px; border: 2px solid var(--border); background: var(--surface-2); box-shadow: var(--shadow); text-decoration: none; font-size: 13px; font-weight: 700; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1600px) {
  .reading-layout { gap: 48px; padding-top: 48px; }
  .welcome-header h1 { font-size: 60px; }
}
@media (max-width: 1320px) {
  .reading-layout { grid-template-columns: minmax(0,780px); max-width: 880px; padding: 32px 32px 0; }
  .page-outline { display: none; }
}
@media (max-width: 1050px) {
  :root { --sidebar-width: 280px; }
  .sidebar-heading { padding: 24px 16px; }
  .brand { font-size: 17px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand small { font-size: 8px; }
  .sidebar-scroll { padding-left: 10px; padding-right: 10px; }
  .section-link { gap: 6px; padding-left: 7px; padding-right: 7px; }
  .section-label { font-size: 11px; }
  .section-link time { font-size: 9px; }
  .reading-layout { padding-left: 24px; padding-right: 24px; }
  .topbar { padding: 0 24px; }
  .article-header { padding: 24px; }
  .topbar-current { max-width: 150px; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 300px; }
  .workspace { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-heading { padding: 24px 20px; }
  .brand { font-size: 19px; gap: 12px; }
  .brand-mark { height: 40px; width: 40px; }
  .brand small { font-size: 9px; }
  .sidebar-scroll { padding-left: 14px; padding-right: 14px; }
  .section-link { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .section-label { font-size: 12px; }
  .section-link time { font-size: 10px; }
  .sidebar-close, .menu-button { display: inline-flex; }
  .sidebar-close { width: 30px; height: 34px; margin-right: -7px; border: 0; background: transparent; }
  .sidebar-close .icon { width: 18px; height: 18px; }
  .menu-open { overflow: hidden; }
  .menu-open .sidebar { transform: translateX(0); box-shadow: 12px 0 0 #2a1a0f1f; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: #21150ea6; border: 0; }
  .topbar { height: 64px; }
  .topbar-location { gap: 12px; }
  .topbar-current { max-width: 220px; }
  .reading-layout { max-width: 860px; padding: 32px 32px 0; }
  .article-header { padding: 28px; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 88px; }
  .topbar { height: 62px; padding: 0 18px; }
  .topbar-location { flex: 1; gap: 10px; font-size: 11px; }
  .topbar-location>a, .topbar-divider, .workshop-time { display: none; }
  .topbar-current { max-width: none; }
  .topbar-actions { gap: 8px; }
  .icon-button { width: 36px; height: 36px; }
  .reading-layout { display: block; padding: 24px 18px 0; }
  .article-header { margin-bottom: 28px; padding: 20px 18px; box-shadow: 5px 5px 0 var(--accent-wash); }
  .article-header>.eyebrow { padding: 4px 6px; font-size: 8px; letter-spacing: .6px; margin-bottom: 20px; gap: 7px; }
  h1 { font-size: clamp(26px,7.4vw,40px); margin-bottom: 20px; }
  .welcome-header h1 { font-size: clamp(29px,8.8vw,48px); margin-bottom: 24px; }
  .article-meta { gap: 8px; font-size: 10px; }
  .article-meta .icon { width: 12px; height: 12px; }
  .markdown { font-size: 14px; line-height: 1.85; }
  .markdown p { margin: 20px 0; }
  .markdown h2 { font-size: 21px; margin-top: 36px; padding-top: 20px; }
  .markdown h3 { font-size: 17px; }
  .markdown ul, .markdown ol { padding-left: 22px; }
  .markdown li { padding-left: 2px; }
  .heading-anchor { opacity: .7; margin-left: 6px; }
  .table-scroll { margin: 24px 0 28px; }
  table { min-width: 440px; font-size: 12px; }
  th, td { padding: 12px; }
  th { font-size: 11px; }
  table code { font-size: 10px !important; }
  .code-block { margin: 24px 0 28px; box-shadow: 3px 3px 0 var(--accent-wash); }
  .code-toolbar { margin: 0 12px; }
  .code-toolbar>span { font-size: 9px; }
  pre { padding: 16px 12px 20px; }
  pre code { font-size: 12px; }
  .copy-button { min-height: 36px; }
  .callout { padding: 0 14px; font-size: 13px; }
  summary { padding: 16px 48px 16px 14px; font-size: 13px; }
  summary:after { right: 12px; }
  details>:not(summary) { margin-left: 12px; margin-right: 12px; }
  .markdown .task-list-item { padding: 12px; gap: 10px; font-size: 13px; }
  .page-navigation { gap: 12px; margin-top: 32px; padding-top: 24px; }
  .page-nav-card { padding: 14px 12px; min-height: 108px; box-shadow: 3px 3px 0 var(--accent-wash); }
  .page-nav-card>span { font-size: 9px; letter-spacing: 0; }
  .page-nav-card.next { padding-top: 12px; }
  .page-nav-card strong { font-size: 12px; }
  .page-footer { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 28px; font-size: 8px; }
  .page-footer>span { grid-column: 1; grid-row: 2; font-size: 8px; }
  .page-footer>a:last-child { grid-column: 2; grid-row: 1/3; }
  .not-found { padding: 20px; }
  .not-found main { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root, :root[data-theme] { color-scheme: light; }
  body { background: #fff; }
  .sidebar, .topbar, .page-outline, .page-navigation, .copy-button, .heading-anchor, .skip-link, .sidebar-backdrop, .cursor-smoke { display: none !important; }
  .workspace { margin: 0; }
  .reading-layout { display: block; max-width: none; padding: 0; }
  .guide-article { animation: none; }
  .markdown { font-size: 10pt; }
  .article-header { break-after: avoid; box-shadow: none; }
  .code-block, .callout { break-inside: avoid; box-shadow: none; }
  .code-block { background: #fff; color: #2a1a0f; color-scheme: light; }
  .code-toolbar { border-bottom-color: #ccc; }
  .code-toolbar>span { color: #6b5a4a; }
  pre code, pre code span { color: #2a1a0f !important; white-space: pre-wrap; width: auto; font-size: 9pt; }
  .table-scroll { overflow: visible; box-shadow: none; }
  table { min-width: 0; }
  a { color: inherit; }
  .page-footer { margin-top: 20px; }
}

/* Text labels for callouts (no emoji markers) */
.callout-label { margin: 14px 0 -8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.callout-warning .callout-label { color: var(--warn); }
.callout-important { border-left-color: var(--ink, currentColor); }
.callout-important .callout-label { color: inherit; }

/* One local identity, carried through the guide's prose and copyable commands. */
.project-var { color: var(--muted); text-decoration: underline dotted var(--dim); text-underline-offset: 4px; }
.project-var.is-filled { color: var(--accent-text); background: var(--accent-wash); text-decoration: none; box-shadow: 0 1px 0 var(--border-soft); }
.project-var.is-partial { text-decoration: underline dotted; text-underline-offset: 4px; }
pre .project-var { color: var(--terminal-muted); text-decoration-color: var(--terminal-muted); }
pre .project-var.is-filled { color: #ffd2a8; background: #ff8a3d1f; box-shadow: 0 1px 0 #ff8a3d66; }
.project-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-size: 10px; white-space: nowrap; }
.project-button:hover { background: var(--accent-wash); }
.project-button .icon { width: 16px; height: 16px; }
.project-button-dot { width: 6px; height: 6px; border: 1px solid var(--muted); flex-shrink: 0; }
.project-button.is-set .project-button-dot { background: var(--good); border-color: var(--good); }
.project-button-state { color: var(--muted); font-size: 9px; }
.project-panel { margin: 28px 0 36px; padding: 24px; border: 2px solid var(--border); border-top: 4px solid var(--primary); background: var(--surface); box-shadow: var(--shadow); color: var(--fg); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.project-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-panel .project-panel-heading :is(h2,h3) { margin: 0; padding: 0; border: 0; font-size: 21px; letter-spacing: -.7px; line-height: 1.4; }
.project-local-label { color: var(--muted); border: 1px solid var(--border-soft); padding: 3px 7px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.project-panel .project-privacy { margin: 12px 0 24px; color: var(--muted); font-size: 11px; }
.project-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.project-field { min-width: 0; }
.project-field-wide { grid-column: 1/-1; }
.project-field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.project-field input { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 0; background: var(--bg); color: var(--fg); font-size: 13px; }
.project-field input::placeholder { color: var(--muted); opacity: .8; }
.project-field input[aria-invalid="true"] { border: 2px solid var(--accent-text); }
.project-panel .project-field-help, .project-panel .project-field-error { margin: 7px 0 0; font-size: 10px; line-height: 1.75; }
.project-field-help { color: var(--muted); }
.project-field-error { color: var(--accent-text); font-weight: 600; }
.project-panel .project-override { margin: 22px 0; border: 1px solid var(--border-soft); background: transparent; box-shadow: none; }
.project-override>summary { min-height: 44px; padding: 11px 44px 11px 12px; color: var(--muted); font-size: 11px; font-weight: 500; }
.project-override>summary:after { top: 11px; right: 10px; height: 22px; width: 22px; font-size: 15px; }
.project-override>.project-field { margin: 16px 12px; }
.project-preview { padding: 16px; border-left: 3px solid var(--primary); background: var(--surface-2); }
.project-panel .project-preview p { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.project-panel .project-preview .project-preview-label { margin: 0 0 12px; color: var(--accent-text); font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.project-preview strong { display: block; margin-top: 4px; color: var(--fg); font-size: 12px; font-weight: 500; }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.project-action { min-height: 44px; padding: 9px 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg); font-size: 11px; font-weight: 700; }
.project-action:hover { background: var(--accent-wash); }
.project-action-primary { border: 2px solid var(--border); background: var(--primary); color: #21150e; box-shadow: 3px 3px 0 var(--border-soft); }
.project-action-primary:hover { background: var(--accent); }
.project-action-quiet { background: transparent; border-color: var(--border-soft); color: var(--muted); font-weight: 400; }
.project-panel .project-saved-title { margin: 0 0 18px; padding: 10px 12px; border-left: 3px solid var(--good); color: var(--fg); background: var(--good-wash); font-size: 12px; font-weight: 600; }
.project-saved-title:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.project-saved dl { margin: 0; display: grid; gap: 12px; }
.project-saved dt { color: var(--muted); font-size: 10px; }
.project-saved dd { margin: 3px 0 0; font-size: 12px; }
.project-panel .project-feedback { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed var(--border-soft); color: var(--muted); font-size: 11px; }
.project-dialog { width: min(640px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 2px solid var(--border); background: var(--surface); color: var(--fg); box-shadow: 8px 8px 0 #21150e55; overscroll-behavior: contain; }
.project-dialog::backdrop { background: #170d08b8; backdrop-filter: blur(3px); }
.project-dialog .project-panel { margin: 0; border: 0; border-top: 4px solid var(--primary); box-shadow: none; }
.project-close { flex-shrink: 0; font-size: 24px; font-weight: 400; }
.project-dialog-open { overflow: hidden; }
@media (max-width: 1200px) {
  .topbar-actions { gap: 10px; }
  .workshop-time { display: none; }
}
@media (max-width: 1050px) {
  .project-button-state { display: none; }
}
@media (max-width: 600px) {
  .project-button { min-height: 36px; padding: 6px 8px; gap: 6px; }
  .project-button .icon { display: none; }
  .project-panel { padding: 18px 14px; box-shadow: 3px 3px 0 var(--accent-wash); }
  .project-fields { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .project-field input { font-size: 16px; }
  .project-panel .project-panel-heading :is(h2,h3) { font-size: 19px; }
  .project-local-label { font-size: 8px; padding: 3px 5px; }
  .project-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .project-preview { padding: 12px; }
}
@media (max-width: 380px) {
  .topbar-current { display: none; }
  .topbar-actions { gap: 6px; }
}
@media print {
  .project-dialog, .project-editor, .project-local-label, .project-actions { display: none !important; }
  .project-panel { box-shadow: none; break-inside: avoid; }
}

/* Build-time diagrams get their own narrow composition, not microscopic labels.
   Container queries follow the reading column (which also changes at 900px). */
.lab-diagram { container: lab-diagram / inline-size; margin: 28px 0 36px; max-width: 100%; border: 2px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.diagram-header { display: grid; gap: 8px; padding: 20px 20px 18px; border-top: 4px solid var(--primary); border-bottom: 1px solid var(--border-soft); }
.diagram-kicker { color: var(--accent-text); font-size: 9px; line-height: 1.6; font-weight: 700; letter-spacing: 1.2px; }
.diagram-header strong { font-size: 18px; line-height: 1.5; letter-spacing: -.6px; }
.diagram-canvas { padding: 10px 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; }
.lab-diagram svg { height: auto; font-family: var(--font); overflow: visible; }
.diagram-wide { display: none; width: 100%; }
.diagram-narrow { display: block; width: min(100%, 360px); margin: 0 auto; }
.lab-diagram text { fill: var(--fg); }
.diagram-node { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.diagram-boundary { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; }
.diagram-route { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.diagram-hub { fill: var(--surface-2); stroke: var(--primary); stroke-width: 2; }
.diagram-label { font-size: 16px; font-weight: 600; }
.diagram-heading { font-size: 18px; font-weight: 700; letter-spacing: -.7px; }
.diagram-route-label { font-size: 17px; font-weight: 700; }
.lab-diagram .diagram-detail { fill: var(--muted); font-size: 13px; }
.lab-diagram .diagram-small { fill: var(--muted); font-size: 12px; }
.lab-diagram .diagram-tag { fill: var(--accent-text); font-size: 10px; font-weight: 700; letter-spacing: .6px; }
.diagram-glyph { fill: none; stroke: currentColor; stroke-width: 1.6; color: var(--accent-text); }
.diagram-flow, .diagram-branch { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: miter; }
.diagram-junction, .diagram-arrowhead { fill: var(--primary); }
.lab-diagram figcaption { padding: 14px 20px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 11px; line-height: 1.8; }
@container lab-diagram (min-width: 640px) {
  .diagram-wide { display: block; }
  .diagram-narrow { display: none; }
}
@media (max-width: 600px) {
  .diagram-header { padding: 16px 14px; }
  .diagram-header strong { font-size: 16px; }
  .diagram-kicker { font-size: 8px; letter-spacing: .8px; }
  .lab-diagram figcaption { padding: 12px 14px; font-size: 10px; }
}
@media print {
  .lab-diagram { box-shadow: none; break-inside: avoid; }
}
