/* Lexmetry docs: a site navigation rail beside one reading column; tables and diagrams may run wider. */
:root {
  --paper: #fbfcfd;
  --panel: #f1f4f8;
  --ink: #1c2631;
  --muted: #586676;
  --rule: #d6dee7;
  --accent: #1d5a85;
  --accent-soft: #e6eff6;
  --auto: #1d5a85;
  --hand: #6a4b86;
  --hand-soft: #f1ebf6;
  --warn: #8a5a00;
  --warn-soft: #fbf2df;
  --stop: #9b2c2c;
  --stop-soft: #fbeaea;
  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12171d; --panel: #1a2129; --ink: #e3e9ef; --muted: #9aa8b6; --rule: #2c3743;
    --accent: #7db4dc; --accent-soft: #1b2b39; --auto: #7db4dc; --hand: #c3a6dc; --hand-soft: #2a2234;
    --warn: #e2b660; --warn-soft: #2e2615; --stop: #f08f8f; --stop-soft: #331d1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12171d; --panel: #1a2129; --ink: #e3e9ef; --muted: #9aa8b6; --rule: #2c3743;
  --accent: #7db4dc; --accent-soft: #1b2b39; --auto: #7db4dc; --hand: #c3a6dc; --hand-soft: #2a2234;
  --warn: #e2b660; --warn-soft: #2e2615; --stop: #f08f8f; --stop-soft: #331d1d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding-block: 40px 80px;
}
nav.site-nav {
  position: sticky;
  top: 40px; /* equals .shell's top padding, so the rail never moves when the page scrolls */
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
}
nav.site-nav .brand {
  display: block;
  font: 600 20px/1.2 var(--f-display);
  color: var(--ink);
  text-decoration: none;
  padding: 0;
  margin: 0 0 24px 10px;
}
nav.site-nav .brand span { color: var(--muted); font-weight: 400; }
nav.site-nav .nav-group {
  font: 600 12px/1 var(--f-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 8px 10px;
}
nav.site-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
nav.site-nav ol.toc { margin: 4px 0 8px 10px; padding-left: 8px; border-left: 1px solid var(--rule); }
nav.site-nav ol.toc a { padding: 4px 10px; color: var(--muted); }
nav.site-nav a {
  display: block;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}
nav.site-nav a[aria-current="page"] { font-weight: 600; color: var(--accent); }
nav.site-nav a:hover, nav.site-nav a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.soon { color: var(--muted); font-weight: 400; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0 24px; }
.card { display: block; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--ink); text-decoration: none; }
a.card:hover, a.card:focus-visible { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
main { min-width: 0; }
main > section { max-width: 760px; }
main > section.wide { max-width: none; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; text-wrap: balance; line-height: 1.2; }
h1 { font-size: 40px; margin: 0 0 8px; letter-spacing: -.01em; }
h2 {
  font-size: 28px;
  margin: 64px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 20px; margin: 32px 0 8px; }
h4 { font: 600 15px/1.3 var(--f-body); margin: 20px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 4px; }
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
strong { font-weight: 600; }
.lede { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.eyebrow {
  font: 600 12px/1 var(--f-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.ui {
  font-weight: 600;
  white-space: nowrap;
}
.ui::before { content: "\201C"; font-weight: 400; color: var(--muted); }
.ui::after { content: "\201D"; font-weight: 400; color: var(--muted); }
.path { font-weight: 600; }
.path .sep { color: var(--muted); font-weight: 400; padding: 0 4px; }

blockquote.summary {
  margin: 24px 0 32px;
  padding: 20px 24px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  font-size: 17px;
}
blockquote.summary p:last-child { margin-bottom: 0; }

.callout {
  margin: 16px 0 20px;
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 15px;
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout-label {
  display: block;
  font: 600 12px/1 var(--f-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.callout.note { background: var(--panel); }
.callout.note .callout-label { color: var(--muted); }
.callout.warn { background: var(--warn-soft); }
.callout.warn .callout-label { color: var(--warn); }
.callout.stop { background: var(--stop-soft); }
.callout.stop .callout-label { color: var(--stop); }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font: 600 12px/1.6 var(--f-body);
  white-space: nowrap;
}
.chip.auto { background: var(--accent-soft); color: var(--auto); }
.chip.hand { background: var(--hand-soft); color: var(--hand); }

.table-wrap { overflow-x: auto; margin: 12px 0 20px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
thead th {
  font: 600 12px/1.3 var(--f-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--rule);
}
tbody th { font-weight: 600; }
td.dr, td.cr { white-space: nowrap; }
.entry { display: grid; grid-template-columns: 28px 1fr; column-gap: 4px; }
.entry .side { font: 600 12px/1.9 var(--f-mono); color: var(--muted); }

ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 13px/26px var(--f-body);
  text-align: center;
}

figure.shot { margin: 20px 0 28px; }
figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); }
figure.shot a:focus-visible img { outline: 2px solid var(--accent); outline-offset: 2px; }
figure.shot.dialog img { max-width: 620px; }
figure.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
figure.flow { margin: 24px 0 8px; }
figure.flow .svg-wrap { overflow-x: auto; background: var(--panel); border-radius: 8px; padding: 16px; }
figure.flow svg { display: block; width: 100%; min-width: 860px; height: auto; color: var(--ink); }
figure.flow figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; max-width: 760px; }

dl.glossary { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px 24px; margin: 0; }
dl.glossary dt { font-weight: 600; }
dl.glossary dd { margin: 0; }

.screen-group { margin-bottom: 8px; }
footer.doc-foot { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; max-width: 760px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 24px 64px; }
  nav.site-nav { position: static; max-height: none; margin-bottom: 8px; padding: 16px; background: var(--panel); border-radius: 8px; }
  nav.site-nav ol.toc { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; margin-top: 48px; }
  dl.glossary { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.glossary dd { margin-bottom: 10px; }
}

@media print {
  :root { --paper: #fff; --panel: #f4f4f4; --ink: #000; --muted: #444; --rule: #bbb; --accent: #000; --accent-soft: #eee; }
  body { font-size: 11pt; padding: 0; }
  .shell { display: block; padding: 0; max-width: none; }
  nav.site-nav { display: none; }
  main > section { max-width: none; }
  h2 { break-before: page; border-top: 0; margin-top: 0; }
  h2, h3, h4 { break-after: avoid; }
  table, figure, .callout { break-inside: avoid; }
  figure.shot img { max-height: 80vh; width: auto; max-width: 100%; }
  figure.flow svg { min-width: 0; }
  a { color: inherit; text-decoration: none; }
}
