/* Docs section (tools/build_docs.py): a sidebar of sections, the article, and an "On this page"
   list. Colours and type come from editorial.css. Wide: three columns. Medium: the list moves
   into the article. Phone: one column, the sidebar becomes a "Docs menu" disclosure. */
.docs-shell{display:grid;grid-template-columns:236px minmax(0,760px) 216px;grid-template-areas:"side crumbs toc" "side head toc" "side body toc" "side foot toc";grid-template-rows:auto auto auto 1fr;column-gap:clamp(36px,4.5vw,72px);justify-content:space-between;width:min(1360px,calc(100% - 48px));margin:0 auto;padding:34px 0 120px}
.docs-sidebar{grid-area:side;position:sticky;top:96px;align-self:start;max-height:calc(100vh - 116px);overflow-y:auto;padding:4px 8px 32px 0}
.docs-crumbs{grid-area:crumbs}
.docs-page-header{grid-area:head}
.docs-body{grid-area:body;min-width:0}
.docs-page-footer{grid-area:foot}
.docs-toc{grid-area:toc;position:sticky;top:96px;align-self:start;padding-top:4px}
.docs-menu{display:none}

/* Sidebar */
.docs-home-link{display:block;margin-bottom:20px;color:var(--ink);font-size:.95rem;font-weight:600;text-decoration:none}
.docs-nav-group+.docs-nav-group{margin-top:22px}
.docs-nav-group p{margin:0 0 8px;color:var(--muted);font-size:.78rem;font-weight:600}
.docs-nav-group ul{margin:0;padding:0;list-style:none;border-left:1px solid var(--line)}
.docs-nav-group a{display:block;margin-left:-1px;padding:6px 0 6px 13px;border-left:2px solid transparent;color:#4b4b4b;font-size:.88rem;line-height:1.35;text-decoration:none}
.docs-nav-group a:hover{color:var(--ink)}
.docs-nav-group a[aria-current="page"]{border-left-color:var(--ink);color:var(--ink);font-weight:600}

/* Breadcrumbs and page header */
.docs-crumbs ol{display:flex;flex-wrap:wrap;gap:4px 0;margin:0 0 26px;padding:0;list-style:none;color:var(--muted);font-size:.8rem}
.docs-crumbs li+li::before{content:"/";margin:0 8px;color:#b5b5b0}
.docs-crumbs a{color:var(--muted);text-decoration:none}
.docs-crumbs a:hover{color:var(--ink);text-decoration:underline}
.docs-page-header{padding-bottom:26px;border-bottom:1px solid var(--line)}
.docs-page-header h1{margin:0;font-size:clamp(2.2rem,4vw,3.3rem);font-weight:400;letter-spacing:-.05em;line-height:1.02}
.docs-lede{max-width:680px;margin:16px 0 0;color:#373737;font-size:1.18rem;line-height:1.55}
.docs-updated{margin:14px 0 0;color:var(--muted);font-size:.8rem}

/* On this page */
.docs-toc h2{margin:0 0 10px;color:var(--ink);font-size:.8rem;font-weight:600;letter-spacing:0}
.docs-toc ol{margin:0;padding:0;list-style:none;border-left:1px solid var(--line)}
.docs-toc a{display:block;padding:5px 0 5px 13px;color:#595959;font-size:.83rem;line-height:1.35;text-decoration:none}
.docs-toc a:hover{color:var(--ink)}

/* Article body */
.docs-body{padding-top:8px}
.docs-body>:first-child{margin-top:26px}
.docs-body h2{margin:58px 0 14px;font-size:1.65rem;font-weight:500;letter-spacing:-.035em;line-height:1.15;scroll-margin-top:100px}
.docs-body h3{margin:36px 0 10px;font-size:1.16rem;font-weight:600;letter-spacing:-.02em;scroll-margin-top:100px}
.docs-body p,.docs-body li,.docs-body dd{color:#373737;font-size:1.01rem;line-height:1.7}
.docs-body p{margin:0 0 18px}
.docs-body ul,.docs-body ol{margin:12px 0 22px;padding-left:22px}
.docs-body li+li{margin-top:8px}
.docs-body a{color:var(--ink);text-decoration:underline;text-decoration-color:#9d9d98;text-underline-offset:3px}
.docs-body a:hover{text-decoration-color:currentColor}
.docs-body code{padding:.08em .32em;border-radius:3px;background:var(--wash);color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86em;overflow-wrap:anywhere}
.docs-body strong{color:var(--ink)}
.docs-body kbd{display:inline-block;min-width:1.5em;padding:.05em .4em;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;background:var(--paper);color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.82em;line-height:1.4;text-align:center}
.docs-body ol.docs-steps>li{padding-left:6px}
.docs-body ol.docs-steps>li::marker{font-weight:600}

/* Definition lists: glossary, records, connections */
.docs-body dl{margin:18px 0 28px}
.docs-body dt{margin-top:26px;color:var(--ink);font-size:1.04rem;font-weight:600;scroll-margin-top:100px}
.docs-body dt:first-child{margin-top:0}
.docs-body dd{margin:6px 0 0}
.docs-body dd p{margin:0 0 8px}
.docs-body dt:target{text-decoration:underline;text-underline-offset:4px}
.docs-see{color:var(--muted);font-size:.92rem}

/* Tables scroll on their own, never the page */
.docs-table{margin:18px 0 30px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.docs-table table{width:100%;min-width:520px;border-collapse:collapse;font-size:.9rem;line-height:1.5}
.docs-table th{padding:0 14px 9px 0;border-bottom:1px solid var(--ink);color:var(--ink);font-weight:600;text-align:left;vertical-align:bottom;white-space:nowrap}
.docs-table td{padding:11px 14px 11px 0;border-bottom:1px solid var(--line);color:#373737;vertical-align:top}
.docs-table td:last-child,.docs-table th:last-child{padding-right:0}
.docs-table td:first-child code{white-space:nowrap}
.docs-table td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.docs-table caption{padding-bottom:10px;color:var(--muted);font-size:.84rem;text-align:left}

/* Callouts: Note for useful context, Caution for anything that changes how a figure reads */
.callout{margin:26px 0;padding:16px 20px 4px;border-left:4px solid var(--ink);background:var(--wash)}
.callout.caution{border-left-color:var(--red)}
.callout>strong{display:block;margin-bottom:6px;color:var(--ink);font-size:.9rem}
.callout p{font-size:.97rem}

/* Docs home */
.docs-sections{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;margin:34px 0 40px}
.docs-section-card{padding-top:18px;border-top:1px solid var(--ink)}
.docs-body .docs-section-card h2{margin:0 0 6px;font-size:1.35rem}
.docs-section-card>p{color:var(--muted);font-size:.93rem}
.docs-section-card ul{margin:12px 0 0;padding:0;list-style:none}
.docs-section-card li+li{margin-top:12px}
.docs-section-card li a{font-weight:600;text-decoration:none}
.docs-section-card li a:hover{text-decoration:underline}
.docs-section-card li span{display:block;color:#5b5b5b;font-size:.9rem;line-height:1.5}

/* Previous / next and feedback */
.docs-pager{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:64px}
.docs-pager a{display:block;padding:16px 18px;border:1px solid var(--line);color:var(--ink);text-decoration:none}
.docs-pager a:hover{border-color:var(--ink)}
.docs-pager a.next{grid-column:2;text-align:right}
.docs-pager span{display:block;margin-bottom:4px;color:var(--muted);font-size:.78rem}
.docs-pager strong{font-size:.98rem;font-weight:600}
.docs-feedback{margin:28px 0 0;padding-top:20px;border-top:1px solid var(--line);color:var(--muted);font-size:.88rem;line-height:1.6}
.docs-feedback a{color:var(--ink)}

@media(max-width:1220px){
  .docs-shell{grid-template-columns:220px minmax(0,1fr);grid-template-areas:"side crumbs" "side head" "side toc" "side body" "side foot";grid-template-rows:auto auto auto auto 1fr}
  .docs-toc{position:static;margin-top:24px;padding:16px 18px;background:var(--wash)}
  .docs-toc ol{border-left:0}
  .docs-toc a{padding:4px 0}
}
@media(max-width:820px){
  .docs-shell{grid-template-columns:minmax(0,1fr);grid-template-areas:"crumbs" "menu" "head" "toc" "body" "foot";grid-template-rows:none;width:calc(100% - 32px);padding-top:18px}
  .docs-sidebar{display:none}
  .docs-menu{display:block;grid-area:menu;margin:0 0 24px;border:1px solid var(--line)}
  .docs-menu summary{display:flex;align-items:center;justify-content:space-between;min-height:46px;padding:0 16px;color:var(--ink);font-size:.95rem;font-weight:600;cursor:pointer;list-style:none}
  .docs-menu summary::-webkit-details-marker{display:none}
  .docs-menu summary::after{content:"";width:8px;height:8px;margin-left:12px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
  .docs-menu[open] summary::after{transform:translateY(2px) rotate(-135deg)}
  .docs-menu nav{padding:4px 16px 18px;border-top:1px solid var(--line)}
  .docs-crumbs ol{margin-bottom:14px}
  .docs-page-header h1{font-size:clamp(2rem,9vw,2.6rem)}
  .docs-lede{font-size:1.08rem}
  .docs-body h2{margin-top:46px;font-size:1.42rem}
  .docs-sections{grid-template-columns:minmax(0,1fr)}
  /* Wide tables stack: one block per row, each cell labelled with its column */
  .docs-table table.docs-stack{display:block;min-width:0;border-top:1px solid var(--ink)}
  .docs-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .docs-stack tbody,.docs-stack tr{display:block}
  .docs-stack tr{padding:12px 0;border-bottom:1px solid var(--line)}
  .docs-stack td{display:block;position:relative;min-height:1.9em;padding:4px 0 4px 104px;border:0}
  .docs-stack td::before{content:attr(data-label);position:absolute;top:6px;left:0;width:92px;color:var(--muted);font-size:.78rem;line-height:1.4}
  .docs-stack td:empty{display:none}
  .docs-stack td.num{text-align:left}
  .docs-stack td:first-child code{white-space:normal}
  .docs-pager{grid-template-columns:minmax(0,1fr)}
  .docs-pager a.next{grid-column:1}
}

/* Documentation uses the same calm panel treatment as the map controls. */
.docs-page-header{padding:26px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03),0 8px 24px rgba(15,23,42,.05)}
.docs-body .callout,.docs-pager a,.docs-section-card{border-color:var(--line);border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03),0 8px 24px rgba(15,23,42,.045)}
.docs-section-card{padding:20px}
.docs-pager a:hover{border-color:rgba(15,23,42,.22);background:#fff}
.docs-table{border:1px solid var(--line);border-radius:12px;background:#fff;padding:0 14px}
@media(max-width:820px){.docs-page-header{padding:22px}.docs-table{padding:0 10px}}

.docs-page-header,.docs-body .callout,.docs-pager a,.docs-section-card,.docs-table{border-radius:0;box-shadow:none}

/* September 18: the map's surface language, matching editorial.css. */
.docs-page-header,.docs-table,.docs-section-card,.callout{border:1px solid var(--ui-line,rgba(15,23,42,.09));border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.04),0 8px 24px rgba(15,23,42,.08)}
.docs-section-card{padding:22px 24px}
.callout{border-left:4px solid #1d2127;background:#f8f9fa;box-shadow:none}
.docs-table{padding:0 14px}
/* Spacing: room under the header bar, air between the title card and the body, roomier
   table cards, pager cards on the same surface. */
.docs-shell{padding-top:44px}
.docs-crumbs ol{margin-bottom:18px}
.docs-page-header{padding:30px 32px}
.docs-body>:first-child{margin-top:36px}
.docs-body h2{margin-top:56px}
.docs-table{margin:22px 0 34px;padding:10px 20px 4px}
.docs-table th{padding-top:8px;border-bottom-color:var(--ui-line,rgba(15,23,42,.09))}
.docs-table tr:last-child td{border-bottom:0}
.docs-pager{margin-top:56px}
.docs-pager a{padding:18px 20px;border:1px solid var(--ui-line,rgba(15,23,42,.09));border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.04),0 8px 24px rgba(15,23,42,.08);transition:transform .2s ease,box-shadow .2s ease}
.docs-pager a:hover{border-color:var(--ui-line,rgba(15,23,42,.09));transform:translateY(-2px);box-shadow:0 2px 4px rgba(15,23,42,.05),0 14px 34px rgba(15,23,42,.1)}
.callout{margin:30px 0;padding:18px 22px 6px;border-left:1px solid var(--ui-line,rgba(15,23,42,.09))}
.docs-sidebar,.docs-toc{top:108px}
@media(max-width:1180px){.docs-shell{padding-top:32px}}
@media(max-width:820px){.docs-shell{padding-top:20px}.docs-page-header{padding:22px}.docs-table{padding:6px 12px 2px}}
.docs-body p,.docs-body li,.docs-body dd,.docs-table td{color:#3f4650}
.docs-nav-group a{color:#4b5563}
