/* The docs pages on the Sheet, on top of sheet.css: a quiet page list, a reading column of 720px, an on-this-page list.
   Loaded by templates/docs/sheet.html.twig only, so the header and footer widths below touch nothing else.
   Callouts keep the class names gate, door, wall, note and planned. Green and red appear only in output samples (.a, .d). */
header .wrap, footer .wrap { width: min(1320px, 100% - 32px); }
footer { border-top: 1px solid var(--rule); }

/* the page: list, column, on this page */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); width: min(1320px, 100% - 32px); margin: 0 auto; align-items: start; }
.docs > * { min-width: 0; }
@media (min-width: 860px) { .docs { grid-template-columns: 232px minmax(0, 1fr); gap: 0 48px; } }

/* the page list */
.docs .side { padding: 16px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 860px) {
  .docs .side { position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; padding: 32px 20px 32px 0; border-bottom: 0; border-right: 1px solid var(--rule); scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
}
.side summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-family: var(--grid); font-size: 12px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.side summary::-webkit-details-marker { display: none; }
.side summary .t { display: none; }
.side details[open] summary { margin-bottom: 22px; }
.side h4 { margin: 22px 0 6px; padding: 0 8px; font-size: 12px; line-height: 1.4; font-weight: 510; letter-spacing: -.005em; color: var(--ink-2); }
.side h4:first-of-type { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 5px 8px; border-radius: 6px; font-size: 13.5px; line-height: 1.35; font-weight: 450; letter-spacing: -.008em; color: var(--ink-3); text-decoration: none; transition: background .16s var(--quick), color .16s var(--quick); }
.side li a:hover { background: var(--glass); color: var(--ink); }
.side li a[aria-current="page"] { background: var(--glass-2); color: var(--ink); font-weight: 510; }
.side .side-foot { margin: 22px 0 0; padding: 14px 8px 0; border-top: 1px solid var(--rule); font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.side .side-foot a { color: var(--ink-3); text-underline-offset: 3px; }
@media (max-width: 859px) { .side summary .t { display: inline; } }

/* the column and the on-this-page list */
.docs-stage { display: grid; grid-template-columns: minmax(0, 720px); gap: 0 64px; align-items: start; min-width: 0; }
.docs-stage main { min-width: 0; position: relative; padding: 24px 0 64px; }
@media (min-width: 860px) { .docs-stage main { padding: 48px 0 80px; } }
@media (min-width: 1240px) { .docs-stage { grid-template-columns: minmax(0, 720px) 200px; } }

.doc-actions { margin: 0 0 18px; }
@media (min-width: 560px) { .doc-actions { position: absolute; top: 18px; right: 0; margin: 0; } }
@media (min-width: 860px) { .doc-actions { top: 42px; } }
.doc-actions button { appearance: none; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 7px; background: var(--glass); color: var(--ink-3); font: 510 12.5px/1.2 var(--sans); letter-spacing: -.01em; cursor: pointer; transition: background .16s var(--quick), color .16s var(--quick); }
.doc-actions button:hover { background: var(--glass-2); color: var(--ink); }

.toc-slot { position: sticky; top: 61px; min-width: 0; display: none; padding-top: 48px; }
@media (min-width: 1240px) { .toc-slot { display: block; } }
.toc { max-height: calc(100vh - 125px); overflow-y: auto; font-size: 12.5px; line-height: 1.4; letter-spacing: -.005em; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.toc p { margin: 0 0 12px; font-family: var(--grid); font-size: 12px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-2); text-decoration: none; transition: color .16s var(--quick); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }

/* the article: Inter, set for reading */
article { font-size: 15.5px; line-height: 1.65; letter-spacing: -.009em; color: var(--ink-3); }
article h1 { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.12; margin: 0 0 14px; color: var(--ink); }
article h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.018em; margin: 52px 0 12px; color: var(--ink); }
article h3 { font-size: 17px; line-height: 1.35; letter-spacing: -.012em; margin: 30px 0 8px; color: var(--ink); }
article h4 { font-size: 15px; line-height: 1.35; font-weight: 510; letter-spacing: -.011em; margin: 22px 0 6px; color: var(--ink); }
article b, article strong { font-weight: 590; color: var(--ink); }
article a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; transition: text-decoration-color .16s var(--quick); }
article a:hover { text-decoration-color: var(--ink); }
article a.ab { display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 510; letter-spacing: -.013em; text-decoration: none; transition: background .16s var(--quick); }
article a.ab:hover { background: #e6e7e8; }
article code { padding: 1px 5px; border-radius: 4px; background: var(--glass); font-family: var(--mono); font-size: .86em; color: var(--ink); overflow-wrap: anywhere; }
article ul, article ol:not(.steps) { padding-left: 20px; margin: 0 0 18px; }
article li { margin-bottom: 6px; }
article li::marker { color: var(--ink-2); }
.kicker { margin: 0 0 14px; font-family: var(--grid); font-size: 12px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.lede { margin: 0 0 20px; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.5; letter-spacing: -.013em; color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 32px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-family: var(--grid); font-size: 12px; line-height: 1.6; letter-spacing: .02em; color: var(--ink-2); }
details.upstream { margin: -6px 0 18px; }
details.upstream summary { cursor: pointer; width: fit-content; font-family: var(--grid); font-size: 12px; line-height: 1.6; letter-spacing: .02em; color: var(--ink-2); }
details.upstream[open] summary { margin-bottom: 6px; }
details.upstream p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* commands: they wrap, never scroll */
.cmd { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 22px; padding: 6px 6px 6px 14px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--panel); }
.cmd .ps { padding: 5px 0; font: 500 13.5px/1.6 var(--mono); color: var(--muted); }
.cmd code { flex: 1; min-width: 0; padding: 5px 0; background: none; border-radius: 0; font: 500 13.5px/1.6 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd > button { appearance: none; flex: none; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 7px; background: var(--glass); color: var(--ink-3); font: 510 12.5px/1.2 var(--sans); letter-spacing: -.01em; cursor: pointer; transition: background .16s var(--quick), color .16s var(--quick); }
.cmd > button:hover { background: var(--glass-2); color: var(--ink); }

/* output and files: they may scroll sideways, the page may not */
.block { margin: 14px 0 22px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); overflow: hidden; }
.block .label { display: block; padding: 8px 14px; border-bottom: 1px solid var(--rule); font-family: var(--grid); font-size: 12px; line-height: 1.4; letter-spacing: .02em; color: var(--ink-2); }
.block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 400 12.5px/1.65 var(--mono); letter-spacing: 0; color: var(--ink-3); }
.block pre code, pre.doc code { padding: 0; background: none; border-radius: 0; font: inherit; color: inherit; overflow-wrap: normal; }
.block .a { color: var(--allow); }
.block .d { color: var(--deny); }
.block .m { color: var(--ink-2); }

/* callouts: gate and door apply live, wall needs a new sandbox, note is a note, planned is not built */
.callout { margin: 20px 0 24px; padding: 14px 16px 2px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--panel); }
.callout > b:first-child { display: block; margin-bottom: 6px; font-size: 14.5px; line-height: 1.4; font-weight: 590; color: var(--ink); }
.callout p { margin-bottom: 12px; }
.callout.door, .callout.gate { border-color: rgba(79, 242, 240, .4); }
.callout.door > b:first-child, .callout.gate > b:first-child { color: var(--accent); }
.callout.wall { border-color: var(--ink-2); }
.callout.note { border-color: var(--rule); }
.callout.planned { border-style: dashed; background: none; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 8px 44px; margin: 0 0 22px; }
.steps > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 3px; padding: 5px 6px 4px; background: var(--paper-2); font-family: var(--grid); font-size: 12px; line-height: 1; color: var(--ink); }
.steps > li > h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.3; }

/* tables */
.tw { margin: 16px 0 26px; border: 1px solid var(--rule); border-radius: 10px; overflow-x: auto; }
table.ref { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; letter-spacing: -.008em; }
table.ref th, table.ref td { padding: 9px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.ref th { background: var(--panel); font-family: var(--grid); font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: .02em; color: var(--ink-2); }
table.ref tbody tr:last-child td { border-bottom: 0; }
table.ref td code { white-space: nowrap; overflow-wrap: normal; }
.chip { display: inline-block; padding: 3px 7px 2px; border: 1px solid var(--rule-2); border-radius: 5px; font-family: var(--grid); font-size: 12px; line-height: 1.3; letter-spacing: .02em; white-space: nowrap; color: var(--ink-3); }
.chip.ok { border-color: rgba(79, 242, 240, .4); color: var(--accent); }
.chip.wait { border-style: dashed; color: var(--ink-2); }

/* the drawing on How it works keeps its markup; the stylesheet recolours it. Green and red mark allowed and refused calls. */
.drawing { margin: 18px 0 26px; padding: 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); overflow-x: auto; }
.drawing svg { display: block; width: 100%; min-width: 600px; height: auto; }
.drawing svg g { font-family: var(--sans) !important; font-weight: 510; }
.drawing svg [fill="#12294c"] { fill: var(--paper-2); }
.drawing svg [fill="#e8eff9"] { fill: var(--ink-3); }
.drawing svg [stroke="#e8eff9"] { stroke: var(--rule-2); }
.drawing svg [fill="rgba(232,239,249,.7)"] { fill: var(--ink-2); }
.drawing svg [fill="#9fe0b8"] { fill: var(--allow); }
.drawing svg [stroke="#9fe0b8"] { stroke: var(--allow); }
.drawing svg [fill="#f4a08c"] { fill: var(--deny); }
.drawing svg [stroke="#f4a08c"] { stroke: var(--deny); }
.drawing figcaption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* glossary */
.terms { margin: 8px 0 0; }
.terms dt { margin: 22px 0 4px; font-size: 16px; line-height: 1.35; font-weight: 510; letter-spacing: -.012em; color: var(--ink); }
.terms dt:first-child { margin-top: 0; }
.terms dd { margin: 0; padding: 0 0 18px; border-bottom: 1px solid var(--rule); }
.terms dd p:last-child { margin-bottom: 0; }

/* pager */
.pager { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 48px 0 0; }
@media (min-width: 560px) { .pager { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pager .next { text-align: right; grid-column: 2; } }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; color: var(--ink); text-decoration: none; transition: border-color .16s var(--quick), background .16s var(--quick); }
.pager a:hover { border-color: var(--rule-2); background: var(--glass); }
.pager a span { display: block; margin-bottom: 4px; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.pager a b { font-size: 15px; font-weight: 510; letter-spacing: -.012em; }

/* phones */
@media (max-width: 560px) {
  article { font-size: 15px; }
  .cmd { gap: 8px; padding-left: 12px; }
  .cmd .ps, .cmd code { font-size: 12.5px; }
  .block pre { font-size: 12px; padding: 10px 12px; }
  .drawing { padding: 12px; }
  table.ref, table.ref tbody { display: block; }
  table.ref thead { display: none; }
  table.ref tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  table.ref tbody tr:last-child { border-bottom: 0; }
  table.ref td { display: block; border: 0; padding: 2px 12px; }
  table.ref td:first-child { font-weight: 510; color: var(--ink); }
  table.ref td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; margin-top: 6px; font-family: var(--grid); font-size: 11px; line-height: 1.5; letter-spacing: .02em; color: var(--ink-2); }
  table.ref td code { white-space: normal; overflow-wrap: anywhere; }
  .steps > li { padding-left: 0; }
  .steps > li::before { position: static; display: inline-block; margin-bottom: 8px; }
}
