/* ══════════════════════════════════════════════════════════
   MR//OS — documentation pages (public/docs/*.html)
   Loaded after /style.css, which supplies the colour themes,
   fonts, top bar and buttons. This file adds the reading layout.
   ══════════════════════════════════════════════════════════ */

body.docs {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  background-attachment: fixed;
}
/* Long-form reading: no scanline overlay here, whatever the board is set to */
body.docs::after { display: none; }

/* ── Top bar additions ──────────────────────────────────── */
.doc-crumbs {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); white-space: nowrap;
}
.doc-crumbs a { color: var(--ink-dim); }
.doc-crumbs a:hover { color: var(--primary); }
.doc-crumbs i { font-style: normal; color: var(--line-hi); }
.doc-crumbs b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.doc-back { margin-left: auto; flex: none; }

/* ── Page ───────────────────────────────────────────────── */
.doc { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 44px 24px 72px; }
.doc--index { max-width: 980px; }

.doc h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.01em; }
.doc-lede { margin-top: 14px; max-width: 62ch; font-size: 1.16rem; line-height: 1.55; color: var(--ink-dim); }

.doc h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 40px 0 12px; font-size: 1.28rem; font-weight: 600; line-height: 1.25; letter-spacing: 0.01em;
}
.doc h2::before { content: ''; width: 8px; height: 8px; flex: none; background: var(--primary); }

.doc article p, .doc article li, .doc article td { font-size: 16px; line-height: 1.68; color: var(--ink-dim); }
.doc article p { max-width: 70ch; margin-bottom: 12px; }
.doc article strong { color: var(--ink); font-weight: 600; }
.doc article p a, .doc article li a {
  color: var(--primary); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--primary) 50%, transparent);
}
.doc article p a:hover, .doc article li a:hover { text-decoration-color: var(--primary); }

.doc article ul, .doc article ol { display: grid; gap: 9px; max-width: 72ch; margin-bottom: 12px; list-style: none; }
.doc article ul > li { position: relative; padding-left: 20px; }
.doc article ul > li::before { content: ''; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 6px; background: var(--line-hi); }
.doc article ol { counter-reset: step; }
.doc article ol > li { position: relative; padding-left: 38px; counter-increment: step; }
.doc article ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.2em;
  width: 24px; height: 24px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--primary); border: 1px solid var(--line-hi);
}

/* Facts box under the title */
.doc-facts { margin: 28px 0 8px; border: 1px solid var(--line); border-left: 3px solid var(--primary); background: var(--panel); }
.doc-facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc-facts > div:last-child { border-bottom: 0; }
.doc-facts dt { padding-top: 3px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.doc-facts dd { font-size: 15px; line-height: 1.55; color: var(--ink); }

/* Tables scroll sideways on narrow screens instead of squeezing */
.doc-table { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); }
.doc-table table { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--panel); }
.doc-table th, .doc-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc-table tr:last-child > * { border-bottom: 0; }
.doc-table thead th { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); background: var(--panel-2); }
.doc-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.doc article .doc-table td { font-size: 14.5px; line-height: 1.55; }

.doc-note {
  margin-top: 44px; padding: 14px 16px; max-width: none !important;
  font-family: var(--font-mono); font-size: 12px !important; line-height: 1.6 !important; color: var(--ink-mute) !important;
  border: 1px dashed var(--line-hi);
}

/* ── Cards: the index, and "Related" under each page ────── */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.doc-card {
  display: flex; flex-direction: column; gap: 5px; padding: 14px 14px 15px;
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--primary);
  transition: transform 0.16s var(--ease), border-color 0.16s, box-shadow 0.16s;
}
.doc-card:hover, .doc-card:focus-visible { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 10px 28px -14px var(--primary); }
.doc-card strong { font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.doc-card span { font-size: 13.5px; line-height: 1.45; color: var(--ink-dim); }
.doc-card .doc-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }

.doc-more { margin-top: 20px; }
.doc-all { display: inline-block; margin-top: 22px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim); }
.doc-all:hover { color: var(--primary); }

/* Start-here row on the index: the map card is the wide one */
.doc-cards--feature { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.doc-card--map { position: relative; padding-right: 236px; min-height: 124px; }
.doc-card-art { position: absolute; right: 16px; top: 50%; width: 200px; transform: translateY(-50%); }
.doc-card-art rect { fill: none; stroke: var(--line-hi); stroke-width: 1.2; transition: stroke 0.16s; }
.doc-card-art rect.on { fill: color-mix(in srgb, var(--primary) 22%, transparent); stroke: var(--primary); }
.doc-card--map:hover .doc-card-art rect { stroke: var(--primary); }

.doc-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 22px; }
.doc-links .doc-all { margin-top: 0; }

/* A term that has a glossary entry: dotted underline, definition one click away */
.doc article a.gl {
  color: inherit; cursor: help;
  text-decoration: underline dotted; text-decoration-color: var(--ink-mute); text-underline-offset: 3px;
}
.doc article a.gl:hover { color: var(--primary); text-decoration-color: var(--primary); }

/* Chips shared by the glossary filter and the map's "what applies" bar */
.gl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-chips button {
  height: 30px; padding: 0 11px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-dim); border: 1px solid var(--line); background: var(--panel);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.gl-chips button:hover { border-color: var(--line-hi); color: var(--ink); }
.gl-chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }

/* ── Glossary ───────────────────────────────────────────── */
.doc--glossary { max-width: 900px; }
.gl-tools {
  position: sticky; top: var(--top-h); z-index: 5;
  display: grid; gap: 10px; margin: 26px -12px 0; padding: 12px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.gl-search {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-hi); background: var(--panel); color: var(--ink-mute);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gl-search:focus-within { border-color: var(--primary); box-shadow: 0 0 18px -8px var(--primary); }
.gl-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--font-ui); font-size: 16px; color: var(--ink); }
.gl-search input::placeholder { color: var(--ink-mute); }
.gl-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }
.gl-count { font-family: var(--font-mono); font-size: 11px !important; letter-spacing: 0.06em; color: var(--ink-mute) !important; margin: 0 !important; }

.gl-az { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 4px; }
.gl-az a {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); border: 1px solid var(--line);
}
.gl-az a:hover { color: var(--primary); border-color: var(--primary); }
.gl-az a.off { opacity: 0.28; pointer-events: none; }

.gl-letter { scroll-margin-top: calc(var(--top-h) + 150px); }
.doc .gl-letter h2 {
  margin: 34px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
  font-family: var(--font-crt); font-size: 38px; font-weight: 400; line-height: 1; color: var(--primary);
}
.doc .gl-letter h2::before { display: none; }

.gl-term {
  position: relative; padding: 10px 14px 10px 16px; margin-bottom: 4px;
  border: 1px solid transparent; border-left: 2px solid var(--line);
  scroll-margin-top: calc(var(--top-h) + 150px);
  transition: border-color 0.2s, background 0.2s;
}
.gl-term:hover { border-left-color: var(--line-hi); }
.gl-term:target { border-color: var(--primary); border-left-width: 2px; background: color-mix(in srgb, var(--primary) 7%, transparent); }
.gl-term dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 3px; }
.gl-name { font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.gl-full { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }
.gl-anchor { position: absolute; left: -16px; top: 13px; width: 16px; font-family: var(--font-mono); font-size: 14px; color: var(--line-hi); opacity: 0; }
.gl-term:hover .gl-anchor, .gl-anchor:focus-visible { opacity: 1; }
.gl-anchor:hover { color: var(--primary); }
.doc article .gl-term dd p { max-width: 78ch; margin-bottom: 5px; font-size: 15.5px; line-height: 1.58; }
.doc article .gl-term .gl-see { display: flex; flex-wrap: wrap; gap: 2px 22px; margin-bottom: 0; font-size: 13.5px; }
.gl-see b { margin-right: 8px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.gl-areas { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; align-self: center; }
.gl-area { padding: 1px 6px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); border: 1px solid var(--line); }
.gl-empty { padding: 28px 0; font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); }

/* ── Standards map ──────────────────────────────────────── */
.doc--map { max-width: 1320px; padding-top: 28px; }
.map-head { max-width: 900px; }
.doc--map h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.doc--map .doc-lede { margin-top: 8px; max-width: 86ch; font-size: 1.04rem; }

.map-lens { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; }
.map-lens-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.map-lens-note { flex: 1 1 320px; font-size: 14px; line-height: 1.4; color: var(--ink-dim); }

.map { scroll-margin-top: calc(var(--top-h) + 12px); }
.map-stage { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 20px; align-items: start; margin-top: 12px; }
.map {
  position: relative; display: grid; gap: 13px; padding: 14px 16px 16px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 84%, transparent);
}
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.map-lines path { fill: none; stroke-width: 1.7; stroke-linecap: round; }
.map-lines .out { stroke: var(--primary); fill: none; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--primary) 60%, transparent)); }
.map-lines path.out { stroke-dasharray: 1; stroke-dashoffset: 1; animation: map-draw 0.45s var(--ease) forwards; }
.map-lines .in { stroke: var(--ink-dim); fill: none; }
.map-lines path.in { stroke-dasharray: 5 6; animation: map-fade 0.35s both; }
.map-lines circle { stroke: none; }
.map-lines circle.out { fill: var(--primary); }
.map-lines circle.in { fill: var(--ink-dim); }
@keyframes map-draw { to { stroke-dashoffset: 0; } }
@keyframes map-fade { from { opacity: 0; } }

.doc .map-row h2 {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 7px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.doc .map-row h2::before { display: none; }
.map-row h2 span { letter-spacing: 0.06em; text-transform: none; color: var(--ink-mute); }
.map-groups { display: flex; gap: 14px; }
.map-group { flex: 1 1 0; min-width: 0; }
.map-group[data-count="4"] { flex-grow: 4; }
.map-group[data-count="3"] { flex-grow: 3; }
.map-row[data-row="4"] .map-group:last-child { flex: 0 0 216px; }
.map-group-cap { margin: 0 0 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-mute); }
.map-nodes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }

.map-node {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px;
  padding: 9px 11px 11px;
  background: var(--panel-2); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  transition: transform 0.16s var(--ease), border-color 0.16s, box-shadow 0.16s, opacity 0.2s;
}
.map-row[data-row="2"] .map-node { min-height: 100px; }
/* A link straight to a block (map#iso-14971) should land with the whole map in view */
.map-node { scroll-margin-top: 45vh; }
.map-node strong { font-size: 15.5px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.map-node-tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.map-node-sub { font-size: 12.5px; line-height: 1.35; color: var(--ink-dim); }
.map-node:hover, .map-node:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px -14px var(--accent); }
.map-row[data-row="4"] .map-group:last-child .map-node { border-style: dashed; border-top-style: solid; background: none; }

.map.has-selection .map-node { opacity: 0.26; }
.map.has-selection .map-node.is-linked { opacity: 1; z-index: 3; }
.map.has-selection .map-node.is-selected {
  opacity: 1; z-index: 3; border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 34px -8px var(--accent);
}

/* Lens: dim what does not usually apply, mark what depends */
.map[data-lens="sw"] .map-node[data-lens-sw="n"],
.map[data-lens="me"] .map-node[data-lens-me="n"],
.map[data-lens="ivd"] .map-node[data-lens-ivd="n"] { opacity: 0.22; filter: grayscale(1); border-top-color: var(--line-hi); }
.map[data-lens="sw"] .map-node[data-lens-sw="n"]::after,
.map[data-lens="me"] .map-node[data-lens-me="n"]::after,
.map[data-lens="ivd"] .map-node[data-lens-ivd="n"]::after,
.map[data-lens] .map-node[data-lens-sw="?"]::after {
  align-self: flex-start; margin-top: auto; padding: 1px 5px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line-hi); background: var(--bg);
}
.map[data-lens="sw"] .map-node[data-lens-sw="n"]::after,
.map[data-lens="me"] .map-node[data-lens-me="n"]::after,
.map[data-lens="ivd"] .map-node[data-lens-ivd="n"]::after { content: 'Not usually'; }
.map[data-lens] .map-node[data-lens-sw="?"]::after { content: 'Depends'; }

/* Side panel */
.map-panel {
  position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto;
  border: 1px solid var(--line); border-top: 2px solid var(--primary); background: var(--panel);
}
.map-panel-body { position: relative; padding: 18px 18px 20px; }
.map-panel .map-panel-kicker { margin-bottom: 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent, var(--ink-mute)); }
.doc .map-panel h2 { margin: 0 0 8px; padding-right: 30px; font-size: 1.5rem; line-height: 1.15; }
.doc .map-panel h2::before { display: none; }
.map-panel p { margin-bottom: 12px; font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); }
.map-panel .btn { min-height: 34px; }
.map-panel h3 {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute);
}
.map-panel h3 b { font-weight: 500; color: var(--ink-dim); }
.map-panel i.out, .map-panel i.in, .map-legend i { flex: none; width: 22px; height: 0; border-top: 2px solid var(--primary); }
.map-panel i.in, .map-legend i.in { border-top: 2px dashed var(--ink-dim); }
.map-legend { list-style: none; display: grid; gap: 8px; margin: 14px 0; font-size: 13.5px; color: var(--ink-dim); }
.map-legend li { display: flex; align-items: center; gap: 10px; }
.map-conn { list-style: none; display: grid; gap: 6px; }
.map-conn li { padding: 8px 10px; border: 1px solid var(--line); background: var(--panel-2); }
.map-conn button { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); text-align: left; }
.map-conn button:hover { color: var(--primary); }
.map-conn span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.map-lens-line { padding: 7px 10px; font-size: 13px !important; border: 1px solid var(--line); border-left: 3px solid var(--lime); }
.map-lens-line[data-status="n"] { border-left-color: var(--line-hi); }
.map-lens-line[data-status="?"], .map-lens-line[data-status="m"] { border-left-color: var(--amber); }
.map-close {
  position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--ink-dim); border: 1px solid transparent; font-size: 14px;
}
.map-close:hover { color: var(--primary); border-color: var(--line-hi); }

/* The same connections as text */
.map-words { margin-top: 44px; }
.map-words > p { margin-bottom: 14px; color: var(--ink-dim); }
.map-words-grid { columns: 3 300px; column-gap: 22px; }
.map-words-block { break-inside: avoid; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); }
.map-words-block h3 { margin-bottom: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-dim); }
.map-words-block h3 a { font-weight: 600; color: var(--ink); }
.map-words-block ul { list-style: none; display: grid; gap: 8px; }
.map-words-block li a { display: block; font-size: 14px; font-weight: 600; color: var(--primary); }
.map-words-block li span { display: block; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
.map-words-block a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ─────────────────────────────────────────────── */
.doc-foot {
  display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 16px 24px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-mute);
  border-top: 1px solid var(--line); background: var(--panel);
}
.doc-foot a:hover { color: var(--primary); }

@media (max-width: 720px) {
  .doc { padding: 28px 16px 56px; }
  .doc-facts > div { grid-template-columns: 1fr; gap: 3px; }
  .doc-crumbs a, .doc-crumbs i { display: none; }
  .doc-foot { padding: 14px 16px; }
  .doc-cards--feature { grid-template-columns: 1fr; }
  .doc-card--map { padding-right: 14px; }
  .doc-card-art { position: static; width: 100%; max-width: 260px; margin-top: 10px; transform: none; }
  .gl-tools { margin: 20px -16px 0; padding: 10px 16px; }
  .gl-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .gl-chips::-webkit-scrollbar { display: none; }
  .gl-chips button { flex: none; height: 34px; }
  .gl-term, .gl-letter { scroll-margin-top: calc(var(--top-h) + 140px); }
  .gl-anchor { display: none; }
  .gl-areas { margin-left: 0; flex-basis: 100%; margin-top: 3px; }

  /* Tables become stacked rows: each cell is labelled with its column header */
  .doc-table { overflow-x: visible; border: 0; }
  .doc-table table { min-width: 0; background: none; }
  .doc-table table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; }
  .doc-table thead { display: none; }
  .doc-table tr { margin-bottom: 10px; border: 1px solid var(--line); background: var(--panel); }
  .doc-table tbody th, .doc-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: normal; }
  .doc-table tbody th { font-size: 17px; background: var(--panel-2); }
  .doc-table [data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute);
  }
}

/* Map on narrow screens: blocks stack, lines are dropped, the panel becomes a bottom sheet */
@media (max-width: 900px) {
  .map-stage { grid-template-columns: minmax(0, 1fr); }
  .map { padding: 12px; }
  .map-lines { display: none; }
  .map-groups { flex-direction: column; gap: 12px; }
  .map-row[data-row="4"] .map-group:last-child { flex: 1 1 auto; }
  .map-nodes { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .map-node, .map-row[data-row="2"] .map-node { min-height: 0; }
  .map-panel { position: static; max-height: none; }
  .map-js .map-panel:not(.is-open) { display: none; }
  .map-js .map-panel.is-open {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 50; max-height: 56vh;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -24px 60px -10px #000;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .map-node { scroll-margin-top: calc(var(--top-h) + 12px); }
  .map-words-grid { columns: 1; }
}

@media print {
  body.docs { background: #fff; color: #000; }
  .topbar, .doc-more, .doc-foot, .skip-link, .gl-tools, .map-lens, .map-panel, .map-lines { display: none; }
  .doc article p, .doc article li, .doc article td, .doc-facts dd, .doc-lede { color: #000; }
}
