:root {
  --guide-bg: #f3efe4;
  --guide-surface: #fffdf7;
  --guide-surface-2: #e9e4d6;
  --guide-ink: #172521;
  --guide-muted: #4f5e58;
  --guide-line: #c9c2b3;
  --guide-teal: #126e65;
  --guide-coral: #a84032;
  --guide-mustard: #9a6500;
  --guide-focus: #7d5200;
  --guide-shadow: 0 18px 50px rgba(24, 42, 36, .1);
  --guide-radius: 14px;
  --guide-serif: Fraunces, Georgia, serif;
  --guide-sans: Karla, "Segoe UI", Arial, sans-serif;
  --guide-mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --guide-bg: #0c1523;
  --guide-surface: #132039;
  --guide-surface-2: #1d304f;
  --guide-ink: #f0e9d9;
  --guide-muted: #c2c7c2;
  --guide-line: #47566f;
  --guide-teal: #78d2c2;
  --guide-coral: #f49a87;
  --guide-mustard: #efb95f;
  --guide-focus: #ffd47a;
  --guide-shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 9rem; }
body { margin: 0; background: var(--guide-bg); color: var(--guide-ink); font: 1rem/1.62 var(--guide-sans); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 10% 5%, color-mix(in srgb, var(--guide-teal) 10%, transparent), transparent 28rem), linear-gradient(115deg, transparent 78%, color-mix(in srgb, var(--guide-mustard) 5%, transparent)); }
a { color: var(--guide-teal); text-underline-offset: .18em; }
a:hover { color: var(--guide-coral); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--guide-focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.guide-nav { position: sticky; top: 76px; z-index: 900; border-bottom: 1px solid var(--guide-line); background: color-mix(in srgb, var(--guide-bg) 94%, transparent); backdrop-filter: blur(14px); }
.guide-nav-inner { width: min(1240px, calc(100% - 2rem)); min-height: 58px; margin: auto; display: flex; align-items: center; gap: 1.25rem; }
.guide-brand { color: var(--guide-ink); font: 600 .78rem var(--guide-mono); text-decoration: none; white-space: nowrap; }
.guide-brand span { color: var(--guide-coral); }
.guide-links { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.guide-links a { color: var(--guide-muted); padding: .55rem .65rem; border-radius: 6px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.guide-links a:hover, .guide-links a[aria-current="page"] { color: var(--guide-ink); background: var(--guide-surface-2); }
.saved-link span { min-width: 1.3rem; padding: .05rem .32rem; display: inline-block; color: var(--guide-bg); background: var(--guide-teal); border-radius: 999px; text-align: center; }
.guide-menu-button { display: none; margin-left: auto; border: 1px solid var(--guide-line); background: var(--guide-surface); color: var(--guide-ink); padding: .5rem .7rem; border-radius: 6px; }

main { width: min(1180px, calc(100% - 2rem)); min-height: 70vh; margin: 0 auto; padding: 1.25rem 0 6rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 2rem; color: var(--guide-muted); font: 600 .7rem var(--guide-mono); text-transform: uppercase; letter-spacing: .05em; }
.breadcrumbs a { color: inherit; }
.kicker, .hero-label { color: var(--guide-teal); font: 700 .72rem var(--guide-mono); text-transform: uppercase; letter-spacing: .09em; }
h1, h2, h3 { color: var(--guide-ink); }
h1 { max-width: 18ch; margin: .5rem 0 1rem; font: 600 clamp(2.6rem, 7vw, 5.6rem)/.98 var(--guide-serif); letter-spacing: -.045em; }
h2 { margin: .45rem 0 1rem; font: 600 clamp(1.55rem, 3vw, 2.35rem)/1.12 var(--guide-serif); letter-spacing: -.025em; }
h3 { margin: 0 0 .45rem; font: 700 1.05rem/1.25 var(--guide-sans); }
p, li, dd { max-width: 72ch; }
.lede { max-width: 62ch; color: var(--guide-muted); font-size: 1.16rem; }
section { margin: 0 0 4rem; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--guide-line); border-radius: 8px; padding: .6rem .85rem; color: var(--guide-ink); background: var(--guide-surface); font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--guide-teal); color: var(--guide-ink); }
.button.primary { border-color: var(--guide-teal); color: var(--guide-bg); background: var(--guide-teal); }
.button.primary:hover { filter: brightness(1.08); color: var(--guide-bg); }
.button.secondary { background: var(--guide-surface-2); }
.button.quiet, .text-button { border: 0; color: var(--guide-teal); background: transparent; text-decoration: underline; text-underline-offset: .2em; }
.text-button { padding: .35rem; cursor: pointer; }

.home-hero, .workflow-hero, .page-hero { position: relative; overflow: hidden; margin: 0 0 3.5rem; padding: clamp(1.4rem, 5vw, 3.5rem); border: 1px solid var(--guide-line); border-radius: 24px 14px 24px 14px; background: linear-gradient(130deg, color-mix(in srgb, var(--guide-teal) 9%, transparent), transparent 60%), var(--guide-surface); box-shadow: var(--guide-shadow); }
.home-hero::after, .workflow-hero::after { content: ""; position: absolute; right: -4rem; top: -4rem; width: 13rem; height: 13rem; border: 2rem solid color-mix(in srgb, var(--guide-mustard) 17%, transparent); border-radius: 42% 58% 64% 36%; transform: rotate(15deg); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .38fr); gap: 2rem; align-items: end; }
.boundary-note { position: relative; z-index: 1; border-left: 4px solid var(--guide-coral); padding: 1rem; background: color-mix(in srgb, var(--guide-coral) 8%, var(--guide-surface)); }
.boundary-note p { margin: .35rem 0 0; color: var(--guide-muted); }
.operator-line { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.5rem; }
.operator-line span { position: relative; padding: .35rem .65rem; border: 1px solid var(--guide-line); background: var(--guide-bg); border-radius: 999px; font: 700 .72rem var(--guide-mono); }
.operator-line span:not(:last-child)::after { content: "/"; position: absolute; right: -.35rem; color: var(--guide-mustard); }

.entrance-grid, .principle-grid, .path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.entrance-grid article, .principle-grid article, .path-grid article { border: 1px solid var(--guide-line); background: var(--guide-surface); padding: 1.2rem; border-radius: var(--guide-radius); }
.entrance-grid article { min-height: 15rem; display: flex; flex-direction: column; align-items: flex-start; box-shadow: var(--guide-shadow); }
.entrance-grid article > span { color: var(--guide-coral); font: 700 .72rem var(--guide-mono); }
.entrance-grid article p { flex: 1; color: var(--guide-muted); }
.principle-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.principle-grid article { border-top: 4px solid var(--guide-teal); }

.task-launcher > div:first-child, .filter-summary { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.home-search { max-width: 44rem; margin-bottom: 1.25rem; }
.home-search label, .filter-grid label { display: grid; gap: .35rem; color: var(--guide-muted); font: 700 .75rem var(--guide-mono); }
.home-search div { display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
input, select { min-height: 42px; width: 100%; border: 1px solid var(--guide-line); border-radius: 7px; background: var(--guide-surface); color: var(--guide-ink); padding: .55rem .65rem; }
.task-grid, .workspace-grid, .asset-grid, .exercise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.task-card, .workspace-card, .asset-card, .exercise-card, .prompt-list-item, .reference-card { border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: var(--guide-radius); padding: 1.1rem; box-shadow: var(--guide-shadow); }
.task-card h2, .workspace-card h2, .asset-card h2, .exercise-card h2, .prompt-list-item h2, .reference-card h2 { font-size: 1.45rem; }
.task-card p, .workspace-card p, .asset-card p { color: var(--guide-muted); }
.card-meta, .currentness { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--guide-muted); font: 700 .68rem var(--guide-mono); text-transform: uppercase; }
.card-meta span, .currentness span, .chip { border: 1px solid var(--guide-line); border-radius: 999px; padding: .18rem .5rem; }
.task-card dl { margin: 1rem 0; }
.task-card dl div { margin: .45rem 0; }
dt { color: var(--guide-teal); font: 700 .7rem var(--guide-mono); text-transform: uppercase; }
dd { margin: .15rem 0 0; color: var(--guide-muted); }
.card-actions, .hero-actions, .prompt-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.role-grid a { display: grid; gap: .2rem; border: 1px solid var(--guide-line); background: var(--guide-surface); padding: .9rem; border-radius: 9px; text-decoration: none; }
.role-grid a span { color: var(--guide-muted); font-size: .85rem; }

.filter-panel { position: relative; padding: 1rem; border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: var(--guide-radius); }
.filter-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: .7rem; }
.filter-summary { margin-top: .8rem; color: var(--guide-muted); }
.process-path { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.process-path a { display: block; border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: 999px; padding: .4rem .75rem; text-decoration: none; }
.no-results { padding: 2rem; border: 1px dashed var(--guide-line); background: var(--guide-surface); text-align: center; }
.no-results p { margin-inline: auto; }

.produce-panel { position: relative; z-index: 1; max-width: 46rem; margin: 1.4rem 0; padding: 1rem; border: 1px solid color-mix(in srgb, var(--guide-teal) 45%, var(--guide-line)); background: color-mix(in srgb, var(--guide-teal) 8%, var(--guide-surface)); border-radius: 9px; }
.produce-panel > span { color: var(--guide-teal); font: 700 .72rem var(--guide-mono); text-transform: uppercase; }
.produce-panel h2 { margin: .3rem 0; }
.produce-panel p { margin: 0; color: var(--guide-muted); }
.workflow-layout { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.workflow-main { min-width: 0; max-width: 52rem; }
.workflow-aside { position: sticky; top: 9.5rem; display: grid; gap: .8rem; }
.workflow-aside > div { border-left: 3px solid var(--guide-line); padding-left: .8rem; }
.workflow-aside strong, .workflow-aside span { display: block; }
.workflow-aside strong { color: var(--guide-teal); font: 700 .7rem var(--guide-mono); text-transform: uppercase; }
.workflow-aside span { margin-top: .2rem; color: var(--guide-muted); font-size: .86rem; }
.boundary-panel, .verify-panel, .next-panel, .failure-panel, .callout, .currentness-panel { padding: 1rem 1.1rem; border: 1px solid var(--guide-line); border-left: 5px solid var(--guide-teal); background: var(--guide-surface); border-radius: 0 10px 10px 0; }
.boundary-panel { border-left-color: var(--guide-coral); }
.next-panel { border-left-color: var(--guide-mustard); }
.failure-panel { border-left-color: var(--guide-coral); }
.steps { padding-left: 0; list-style: none; counter-reset: steps; }
.steps li { counter-increment: steps; position: relative; min-height: 3rem; padding: .25rem 0 1.2rem 3.1rem; }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 2px solid var(--guide-teal); border-radius: 50%; color: var(--guide-teal); font: 700 .82rem var(--guide-mono); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.1rem; top: 2.25rem; bottom: 0; width: 1px; background: var(--guide-line); }

.prompt-block { border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: var(--guide-radius); overflow: hidden; }
.prompt-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding: 1rem; background: var(--guide-surface-2); border-bottom: 1px solid var(--guide-line); }
.prompt-heading h2 { margin-bottom: 0; }
pre { margin: 0; padding: 1.2rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--guide-ink); background: color-mix(in srgb, var(--guide-bg) 82%, #000); font: .82rem/1.7 var(--guide-mono); }
.checklist { display: grid; gap: .55rem; }
.checklist label { display: grid; grid-template-columns: 1.25rem 1fr; gap: .65rem; align-items: start; padding: .55rem; border-radius: 7px; }
.checklist label:hover { background: var(--guide-surface-2); }
.checklist input { min-height: 0; width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; accent-color: var(--guide-teal); }
.checklist input:checked + span { color: var(--guide-muted); text-decoration: line-through; }
details { border: 1px solid var(--guide-line); border-radius: 9px; background: var(--guide-surface); padding: .75rem 1rem; }
summary { min-height: 32px; cursor: pointer; font-weight: 800; color: var(--guide-teal); }
blockquote { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--guide-coral); background: var(--guide-surface-2); color: var(--guide-muted); }
.fictional-label { display: inline-flex; margin-bottom: .5rem; padding: .2rem .55rem; border: 1px solid var(--guide-mustard); border-radius: 999px; color: var(--guide-mustard); font: 700 .68rem var(--guide-mono); text-transform: uppercase; }
.related-list { list-style: none; padding: 0; }
.related-list li { display: grid; grid-template-columns: minmax(0, .55fr) minmax(0, 1fr); gap: 1rem; border-bottom: 1px solid var(--guide-line); padding: .7rem 0; }
.related-list li span { color: var(--guide-muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 4rem; }
.pager a { display: grid; border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: 9px; padding: .8rem; text-decoration: none; }
.pager a span { color: var(--guide-muted); font: 700 .68rem var(--guide-mono); text-transform: uppercase; }
.pager .next { text-align: right; }

.workspace-grid, .asset-grid, .exercise-grid { align-items: start; }
.currentness-panel { display: grid; gap: .35rem; margin-top: 1.25rem; }
.currentness-panel span { color: var(--guide-muted); }
.workspace-detail { max-width: 52rem; }
.source-list { padding-left: 1.2rem; }
.source-list li { margin: .55rem 0; }
.prompt-library { display: grid; gap: .8rem; }
.prompt-list-item { display: grid; grid-template-columns: minmax(0, .4fr) minmax(0, .6fr); gap: 1.2rem; }
.prompt-list-item details { align-self: start; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { color: var(--guide-muted); font: 700 .68rem var(--guide-mono); }
.asset-body { max-width: 54rem; }
.asset-body table, .exercise-card table { width: 100%; border-collapse: collapse; }
.asset-body th, .asset-body td { border: 1px solid var(--guide-line); padding: .55rem; text-align: left; vertical-align: top; }
.asset-body th { background: var(--guide-surface-2); }
.asset-body caption { padding: .6rem; color: var(--guide-muted); text-align: left; }
.exercise-card dl > div { margin: .85rem 0; }
.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.source-records { display: grid; gap: .7rem; }
.source-records article { border-bottom: 1px solid var(--guide-line); padding: .8rem 0; }
.source-records article > span { color: var(--guide-muted); font: 700 .68rem var(--guide-mono); text-transform: uppercase; }
.saved-list { display: grid; gap: .5rem; }
.saved-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid var(--guide-line); background: var(--guide-surface); border-radius: 8px; padding: .75rem; }

.guide-footer { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--guide-line); background: var(--guide-surface); padding: 2rem max(1rem, calc((100vw - 1180px) / 2)); color: var(--guide-muted); }
.guide-footer p { margin: .25rem 0 0; }
.guide-footer > div:last-child { display: flex; flex-direction: column; align-items: flex-end; }
.status { position: fixed; z-index: 1200; right: 1rem; bottom: 1rem; max-width: 24rem; margin: 0; padding: .75rem .95rem; border: 1px solid var(--guide-line); border-radius: 8px; color: var(--guide-bg); background: var(--guide-teal); font-weight: 800; box-shadow: var(--guide-shadow); transform: translateY(150%); opacity: 0; transition: .18s; }
.status.show { transform: none; opacity: 1; }
.print-url { overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .guide-nav { top: 76px; }
  .guide-menu-button { display: block; }
  .guide-links { position: absolute; left: 1rem; right: 1rem; top: 58px; display: none; padding: .65rem; border: 1px solid var(--guide-line); background: var(--guide-surface); box-shadow: var(--guide-shadow); }
  .guide-links.open { display: grid; }
  .guide-links a { padding: .7rem; }
  .workflow-layout { grid-template-columns: 1fr; }
  .workflow-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); order: -1; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 5rem; }
  .guide-nav { top: 76px; }
  .guide-brand { overflow: hidden; text-overflow: ellipsis; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero::after, .workflow-hero::after { opacity: .45; }
  .entrance-grid, .task-grid, .workspace-grid, .asset-grid, .exercise-grid, .role-grid, .principle-grid, .reference-grid, .prompt-list-item { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .workflow-aside { grid-template-columns: 1fr; }
  .prompt-heading { display: block; }
  .prompt-actions { margin-top: .8rem; }
  .related-list li { grid-template-columns: 1fr; gap: .2rem; }
  .guide-footer { display: block; }
  .guide-footer > div:last-child { align-items: flex-start; margin-top: 1rem; }
}

@media (max-width: 500px) {
  main { width: min(100% - 1.2rem, 1180px); }
  .guide-nav-inner { width: calc(100% - 1.2rem); }
  h1 { font-size: clamp(2.3rem, 14vw, 3.4rem); }
  .home-hero, .workflow-hero, .page-hero { padding: 1.1rem; border-radius: 14px; }
  .home-search div { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@page { size: letter; margin: .55in; }
@media print {
  :root, html[data-theme="dark"] { --guide-bg: #fff; --guide-surface: #fff; --guide-surface-2: #f0ece2; --guide-ink: #111; --guide-muted: #333; --guide-line: #aaa; --guide-teal: #0b5d55; --guide-coral: #7c2e25; --guide-mustard: #6f4900; color-scheme: light; }
  html[data-theme] body { background: #fff; color: #111; font-size: 10.5pt; }
  body::before, .site-shell, .guide-nav, .breadcrumbs, .hero-actions, .prompt-actions, .pager, .guide-footer, .status, [data-reset-state] { display: none !important; }
  main { width: 100%; padding: 0; }
  .home-hero, .workflow-hero, .page-hero { border: 0; box-shadow: none; padding: 0; }
  .workflow-layout { display: block; }
  .workflow-aside { position: static; display: block; margin: 1rem 0; }
  .workflow-aside > div { margin: .4rem 0; }
  section, .prompt-block, .reference-card, .asset-card, .exercise-card { break-inside: avoid; }
  details:not([open]) > *:not(summary) { display: none !important; }
  details summary { list-style: none; }
  pre { border: 1px solid #aaa; background: #fff; color: #111; }
  a { color: #111; text-decoration: none; }
  .print-url { display: block; }
}
