/* Load after /calliary/docs-r1.css. All additions are scoped to the guide. */
.guide {
  --guide-tip: #52695e;
  --guide-tip-paper: #f1f5ef;
  --guide-warning: #88364a;
}
.guide :where(main, article, section, nav, figure, li, div) { min-width: 0; }
.guide :where(h1, h2, h3) { overflow-wrap: anywhere; }
.guide :where(a, summary) { -webkit-tap-highlight-color: #dfbac855; }
.guide-shell { padding-block: 40px 72px; }
.guide-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; font-size: 13px; color: var(--muted); }
.guide-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
.guide-breadcrumb > span { align-self: center; }
.guide-head { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 28px; align-items: center; margin-bottom: 32px; }
.guide-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--rose); }
.guide-head h1 { font-size: clamp(30px, 3.4vw, 42px); }
.guide-lede { max-width: 660px; margin: 14px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.guide-sticker { width: 76px; justify-self: center; transform: rotate(6deg); }
.guide-hub-paper { padding: 40px 48px; }
.guide-block + .guide-block { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--line); }
.guide-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.guide-section-head h2 { margin: 0; }
.guide-section-head > p { margin: 0; color: var(--muted); font-size: 13px; }
.situation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; list-style: none; padding: 0; margin: 0; }
.situation-list li { border-bottom: 1px solid var(--line); }
.situation-list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding-block: 12px; text-decoration: none; font-size: 15px; line-height: 1.65; }
.situation-list a:hover > span:first-child { text-decoration: underline; }
.situation-ref { flex-shrink: 0; color: var(--rose); font-size: 12px; font-variant-numeric: tabular-nums; }
.situation-ref span { padding-left: 7px; }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list > li + li { border-top: 1px solid var(--line); }
.chapter-list a { display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; gap: 20px; align-items: center; padding-block: 22px; text-decoration: none; }
.chapter-list a:hover .chapter-title { text-decoration: underline; }
.chapter-no { color: var(--rose); font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.chapter-title { display: block; font-size: 19px; font-weight: 700; line-height: 1.5; }
.chapter-description { display: block; margin-top: 5px; font-size: 14px; line-height: 1.75; color: var(--muted); }
.chapter-arrow { color: var(--rose); }
.guide-hub-end { display: flex; justify-content: flex-end; margin-top: 20px; }
.guide-hub-end a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--rose); }

/* One TOC in source order: after the heading, before the body. */
.guide-reading { padding-block: 0; }
.guide-chapter-head { margin-left: 296px; grid-template-columns: minmax(0, 1fr); }
.guide-toc { padding: 16px 14px; }
.guide-toc summary { padding: 8px 4px; }
.guide-toc summary > span { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.guide-toc .toc-list { padding: 4px; }
.guide-toc .clause-number { min-width: 28px; font-size: 12px; }
.guide-toc .toc-top { position: static; padding: 12px 4px 0; margin-top: 8px; border-top: 1px solid var(--line); }
.guide-toc a[aria-current="location"] { text-decoration: none; }
.guide-toc a[aria-current="location"] > span:last-child { text-decoration: underline; }
.guide-document { font-size: 16px; line-height: 1.9; }
.guide-section { scroll-margin-top: 28px; }
.guide-section + .guide-section { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--line); }
.guide-section h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-no { flex-shrink: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--rose); }
.guide-section h2 a { color: inherit; text-decoration: none; }
.guide-section h2 a:hover { text-decoration: underline; }
.guide-section h3 { margin-top: 24px; }
.guide-section > :last-child { margin-bottom: 0; }
.guide-section :where(ul, ol):not(.steps) { padding-left: 24px; }
.guide-section :where(ul, ol):not(.steps) li { margin-block: 8px; }

/* Semantic list numbering stays available to assistive technology. */
.steps { margin: 22px 0 26px; padding-left: 30px; list-style: decimal; }
.steps > li { padding: 13px 0 13px 9px; border-bottom: 1px solid var(--line); }
.steps > li:first-child { padding-top: 0; }
.steps > li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps > li::marker { color: var(--rose); font-weight: 750; font-variant-numeric: tabular-nums; }
.steps p { margin: 0; }
.steps .step-note { margin-top: 5px; font-size: 14px; color: var(--muted); }
.ui { font-weight: 600; }
.ui-path { font-size: .96em; font-weight: 600; }
.path-sep { padding-inline: .22em; font-size: .78em; color: var(--rose); }
.guide-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Labels and border treatments distinguish these without color alone. */
.callout { margin-block: 24px; padding: 17px 20px; font-size: 15px; line-height: 1.85; }
.callout-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 750; letter-spacing: .025em; }
.callout p { margin-bottom: 8px; }
.callout > :last-child { margin-bottom: 0; }
.callout--tip { background: var(--guide-tip-paper); border-left: 2px solid var(--guide-tip); border-radius: 0 8px 8px 0; }
.callout--tip .callout-label { color: var(--guide-tip); }
.callout--warning { background: var(--pale); border: 1px solid var(--line); border-left: 4px solid var(--guide-warning); border-radius: 0 8px 8px 0; }
.callout--warning .callout-label { color: var(--guide-warning); }
.callout--help { padding-inline: 0; border-block: 1px dashed var(--line); }
.callout--help .callout-label { color: var(--rose); }
.callout-question { font-weight: 650; }

/* Intrinsic table width is contained here; never clip the page to hide overflow. */
.guide-table-hint { margin: 20px 0 8px; font-size: 12px; color: var(--muted); }
.guide-table { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin-block: 8px 24px; scrollbar-color: var(--line) var(--paper); }
.guide-table table { min-width: 620px; font-size: 14px; line-height: 1.75; }
.guide-table caption { font-size: 13px; }
.guide-table th, .guide-table td { padding: 14px 13px; font-size: inherit; }
.guide-table thead th { color: var(--rose); font-weight: 700; }
.guide-table tbody th { background: transparent; font-weight: 650; }

/* Already-cropped captures: no invented hardware frames or image crops. */
.shot { width: 100%; margin: 28px auto; }
.shot--phone { max-width: 280px; }
.shot--tablet { max-width: 600px; }
.shot--desktop, .shot--web { max-width: 760px; }
.shot > img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.shot figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.shot-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; aspect-ratio: 360 / 735; padding: 24px; background: var(--pale); border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: var(--muted); font-size: 14px; }
.shot-ph small { font-size: 12px; }
.shot--tablet .shot-ph { aspect-ratio: 4 / 3; }
.shot--desktop .shot-ph, .shot--web .shot-ph { aspect-ratio: 16 / 10; }
.shot-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-block: 28px; }
.shot-pair > .shot { margin-block: 0; }
.chapter-pagination { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.chapter-neighbors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chapter-neighbors a { display: flex; flex-direction: column; align-items: flex-start; min-height: 64px; padding-block: 8px; text-decoration: none; font-size: 15px; font-weight: 650; }
.chapter-neighbors a:hover > span:last-child { text-decoration: underline; }
.chapter-neighbors a:last-child { text-align: right; align-items: flex-end; }
.chapter-direction { color: var(--muted); font-size: 12px; font-weight: 400; margin-bottom: 4px; }
.guide-return { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 22px; }
.guide-return a { display: inline-flex; align-items: center; min-height: 44px; color: var(--rose); font-size: 13px; }

@media (max-width: 1100px) {
  .guide-chapter-head { margin-left: 254px; }
  .guide-hub-paper { padding: 32px; }
}
@media (min-width: 1024px) {
  .guide-toc .toc-list { max-height: calc(100dvh - 184px); }
}
@media (max-width: 1023px) {
  .guide-reading { display: block; padding: 0; }
  .guide-chapter-head { margin-left: 0; }
  .guide-toc { position: static; margin-bottom: 24px; padding: 12px 16px; }
  .guide-toc .toc-list { max-height: none; overflow: visible; }
  .guide-toc .toc-top { display: none; }
  .guide-shell { padding-top: 24px; }
  .guide-section { scroll-margin-top: 24px; }
  .guide main { scroll-margin-top: 24px; }
}
@media (min-width: 768px) {
  .shot-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 767px) {
  .situation-list { grid-template-columns: minmax(0, 1fr); }
  .guide-section-head { display: block; }
  .guide-section-head > p { margin-top: 10px; padding-left: 17px; }
}
@media (max-width: 600px) {
  .guide-shell { padding-block: 20px 40px; }
  .guide-breadcrumb { margin-bottom: 16px; }
  .guide-head { grid-template-columns: minmax(0, 1fr) 58px; gap: 16px; margin-bottom: 26px; }
  .guide-chapter-head { grid-template-columns: minmax(0, 1fr); }
  .guide-sticker { width: 54px; align-self: start; margin-top: 14px; }
  .guide-lede { font-size: 16px; }
  .guide-hub-paper, .guide-document { padding: 26px 20px; }
  .guide-document { font-size: 16px; }
  .guide-block + .guide-block { margin-top: 32px; padding-top: 28px; }
  .guide-section-head > p { padding-left: 14px; }
  .situation-list a { gap: 10px; }
  .chapter-list a { grid-template-columns: 32px minmax(0, 1fr) 16px; gap: 12px; padding-block: 20px; }
  .chapter-no { font-size: 24px; }
  .chapter-title { font-size: 18px; }
  .chapter-description { font-size: 14px; }
  .guide-section h2 { flex-direction: column; align-items: flex-start; gap: 4px; }
  .guide-section + .guide-section { margin-top: 36px; padding-top: 28px; }
  .callout { padding: 15px 16px; }
  .callout--help { padding-inline: 0; }
  .steps { padding-left: 25px; }
  .steps > li { padding-left: 5px; }
  .chapter-neighbors { gap: 20px; }
}
@media (max-width: 359px) {
  .guide-hub-paper, .guide-document { padding-inline: 16px; }
  .guide-head { gap: 12px; grid-template-columns: minmax(0, 1fr) 44px; }
  .guide-chapter-head { grid-template-columns: minmax(0, 1fr); }
  .guide-sticker { width: 42px; }
  .situation-list a { font-size: 14px; }
  .chapter-list a { gap: 10px; }
}
@media print {
  .guide-shell { padding: 0; }
  .guide-reading { display: block; }
  .guide-breadcrumb, .guide-toc, .guide-sticker, .chapter-pagination, .guide-hub-end, .guide-table-hint { display: none; }
  .guide-chapter-head { margin-left: 0; }
  .guide-document, .guide-hub-paper { padding: 0; }
  .guide-section { break-before: auto; }
  .guide-section h2, .guide-section h3 { break-after: avoid; }
  .callout, .shot, .steps > li { break-inside: avoid; }
  .guide-table { overflow: visible; }
  .guide-table table { min-width: 0; }
  .shot--phone { max-width: 190px; }
  .shot-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
