.guide-page { background: var(--bg); }
.guide-hero { min-height: calc(100svh - 72px); display: grid; grid-template-columns: 0.48fr 0.52fr; }
.guide-hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(70px, 9vw, 130px) var(--margin); }
.guide-hero h1 { max-width: 12ch; font-size: var(--display); font-weight: 490; line-height: .94; letter-spacing: -.062em; }
.guide-lede { max-width: 37ch; margin: 34px 0 0; font-size: var(--lead); line-height: 1.4; }
.guide-hero-image { min-width: 0; display: flex; flex-direction: column; justify-content: center; margin: 0; padding: clamp(28px, 4vw, 62px); background: var(--accent); color: var(--accent-ink); }
.guide-hero-image img { width: min(82%, 720px); height: auto; max-height: 76svh; align-self: center; display: block; border-radius: var(--radius-media); object-fit: contain; object-position: top; }
.guide-hero-image figcaption { margin: 18px auto 0; width: min(82%, 720px); font-size: var(--small); }
.guide-note { display: grid; grid-template-columns: 0.28fr 0.72fr; gap: var(--gutter); margin: 0; padding: clamp(54px, 7vw, 100px) var(--margin); background: var(--ink); color: var(--paper); }
.guide-note strong { font-size: clamp(1.8rem, 3vw, 3.4rem); line-height: 1; letter-spacing: -.045em; }
.guide-note p { max-width: 48ch; margin: 0; font-size: var(--lead); }
.guide-article { width: min(100% - (var(--margin) * 2), var(--content-max)); margin-inline: auto; }
.guide-section { padding-block: clamp(90px, 11vw, 170px); }
.guide-section h2 { max-width: 12ch; font-size: var(--head); }
.guide-section p, .guide-section li, .guide-section dd { line-height: 1.68; }
.guide-source { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: var(--gutter); }
.guide-source > div:first-child { grid-column: 1 / 6; }
.guide-source > div:first-child p { margin-top: 34px; color: var(--muted); }
.guide-code { grid-column: 7 / 13; background: var(--surface); padding: clamp(26px, 4vw, 56px); }
.guide-code > p:first-child { margin-top: 0; }
.guide-code pre { overflow-x: auto; margin: 24px 0 38px; padding: 22px; background: var(--ink); color: var(--paper); font-size: 0.9rem; line-height: 1.65; }
.guide-code code { font-family: var(--font); }
.guide-code dl { margin: 0; }
.guide-code dl div { margin-bottom: 24px; }
.guide-code dt { font-weight: 680; }
.guide-code dd { margin: 4px 0 0; color: var(--muted); }
.casepack-tool { display: grid; grid-template-columns: .66fr 1.34fr; gap: var(--gutter); align-items: start; margin-inline: calc(var(--margin) * -1); padding-inline: var(--margin); background: var(--ink); color: var(--paper); }
.casepack-copy { position: sticky; top: 32px; }
.casepack-copy > p { margin-top: 30px; color: rgba(255,255,255,.72); }
.casepack-result-label { margin: 0 0 14px; color: rgba(255,255,255,.62); font-size: var(--small); font-weight: 650; }
.casepack-form { padding: clamp(24px, 4vw, 52px); background: var(--paper); color: var(--ink); }
.casepack-fields input, .casepack-fields select { background: var(--bg); }
.casepack-wide { grid-column: 1 / -1; }
.casepack-help { margin: 18px 0 24px; }
.casepack-result { grid-column: 2; padding: clamp(24px, 4vw, 52px); background: var(--accent); color: var(--accent-ink); }
.casepack-result:focus { outline-color: var(--paper); outline-offset: -5px; }
.casepack-result dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: rgba(255,255,255,.28); }
.casepack-result dl div { min-width: 0; padding: 20px; background: var(--accent); }
.casepack-result dt { color: rgba(255,255,255,.72); font-size: var(--small); }
.casepack-result dd { margin: 14px 0 0; overflow-wrap: anywhere; font-size: clamp(1.8rem, 3.2vw, 3.5rem); font-weight: 620; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.casepack-result > p:not(.casepack-result-label) { margin: 24px 0; color: rgba(255,255,255,.78); }
.casepack-result .button { background: var(--paper); color: var(--accent); }
.guide-math { margin-inline: calc(var(--margin) * -1); padding-inline: var(--margin); background: var(--surface); }
.guide-math-intro { display: grid; grid-template-columns: 0.55fr 0.45fr; gap: var(--gutter); align-items: end; }
.guide-math-intro p { margin: 0; color: var(--muted); }
.guide-table { overflow-x: auto; margin-top: 64px; background: var(--paper); }
.guide-table table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.guide-table caption { padding: 22px 20px; text-align: left; color: var(--muted); }
.guide-table td, .guide-table th { padding: 18px 16px; border-bottom: 1px solid var(--rule); text-align: right; }
.guide-table tr > :first-child { text-align: left; }
.guide-table thead th { font-size: var(--small); }
.guide-table tfoot { font-weight: 720; }
.guide-math-notes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: 38px; }
.guide-math-notes p { margin: 0; }
.guide-process { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: var(--gutter); }
.guide-process > div { grid-column: 1 / 6; }
.guide-process > div p { margin-top: 34px; color: var(--muted); }
.guide-process ol { grid-column: 7 / 13; margin: 0; padding-left: 1.4em; }
.guide-process li { margin-bottom: 24px; padding-left: 10px; }
.guide-next { display: grid; grid-template-columns: 0.48fr 0.52fr; gap: clamp(34px, 6vw, 100px); align-items: center; margin-inline: calc(var(--margin) * -1); padding-inline: var(--margin); background: var(--accent); color: var(--accent-ink); }
.guide-next img { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; border-radius: var(--radius-media); object-fit: contain; }
.guide-next h2 { max-width: 10ch; }
.guide-next p { color: rgba(255,255,255,.82); }
.guide-next .button { margin-top: 18px; background: var(--paper); color: var(--accent); }

@media(max-width: 800px) {
  .guide-hero { min-height: 0; grid-template-columns: 1fr; }
  .guide-hero-copy { padding-block: 72px; }
  .guide-hero h1 { font-size: var(--display); }
  .guide-hero-image { min-height: 76svh; }
  .guide-hero-image img, .guide-hero-image figcaption { width: 94%; }
  .guide-note { grid-template-columns: 1fr; }
  .guide-source, .guide-process, .casepack-tool { display: block; }
  .casepack-copy { position: static; }
  .casepack-form, .casepack-result { margin-top: 36px; }
  .guide-code, .guide-process ol { margin-top: 44px; }
  .guide-math-intro, .guide-math-notes { grid-template-columns: 1fr; }
  .guide-math-intro p { margin-top: 28px; }
  .guide-next { grid-template-columns: 1fr; }
  .guide-next img { aspect-ratio: 1 / 1; }
}

@media print {
  body.guide-page > header, body.guide-page > footer, .analytics-consent { display: none !important; }
  body.guide-page > main, body.guide-page > main > * { display: block !important; }
  .guide-hero { min-height: 0; }
  .guide-hero-copy { padding: 0 0 20px; }
  .guide-hero-image { display: none !important; }
  .guide-hero h1 { font-size: 34pt; }
  .guide-note { padding: 18px; }
  .guide-article { width: 100%; }
  .guide-section { padding-block: 22px; }
  .guide-section h2 { font-size: 20pt; }
  .guide-section p, .guide-section li, .guide-section dd { font-size: 10pt; }
  .guide-code { padding: 18px; }
  .casepack-form, .casepack-result { display: none !important; }
  .guide-table { overflow: visible; }
  .guide-table table { min-width: 0; font-size: 8pt; }
  .guide-next { display: block !important; background: #fff; color: #000; }
  .guide-next img, .guide-next .button, .hero-actions { display: none !important; }
}
