/* dt-verify docs: a documentation layout with greys and one accent. */
:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --text: #1c2b35;
  --text-2: #36444f;
  --muted: #52616d;
  --border: #d6e0e5;
  --side-bg: #eef3f6;
  --accent: #17634d;
  --accent-bg: #edf7f2;
  --code-bg: rgba(28, 43, 53, 0.07);
  --pre-bg: #ffffff;
  --pre-bar: #eef3f6;
  --pre-text: #1c2b35;
  --pre-dim: #52616d;
  --top-h: 60px;
  --tabs-h: 44px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + var(--tabs-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.75; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); padding-top: env(safe-area-inset-top, 0px); }
.top-row { height: var(--top-h); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border);
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.top-row { background: #edf7f2; border-bottom-color: #b6d4c7; }
/* Narrow screens wrap the page path under the market link; both lines fit the 60px row. */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.crumb-page { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.crumb a { color: var(--text); }
.crumb a:hover { color: var(--accent); text-decoration: none; }
.crumb [aria-hidden] { color: var(--muted); font-weight: 400; }
.ver { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 100px; padding: 0 8px; line-height: 20px; }
.menu { display: none; width: 34px; height: 34px; border-radius: 8px; font-size: 18px; color: var(--text-2); }
.tabs { height: var(--tabs-h); display: flex; gap: 8px; align-items: stretch; border-bottom: 1px solid var(--border); overflow-x: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.tabs a { display: flex; align-items: center; padding: 0 12px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Layout */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.side { position: sticky; top: calc(var(--top-h) + var(--tabs-h) + env(safe-area-inset-top, 0px)); align-self: start;
  height: calc(100vh - var(--top-h) - var(--tabs-h)); overflow-y: auto; background: var(--side-bg); border-right: 1px solid var(--border);
  padding: 16px 14px 32px max(14px, env(safe-area-inset-left, 0px)); }
.side-group { margin-bottom: 14px; }
.side-title { font-size: 13px; font-weight: 600; color: var(--text); padding: 6px 12px; }
.side a { display: block; padding: 7px 12px; border-radius: 6px; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.side a:hover { background: var(--border); text-decoration: none; }
.side a.on { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.main { display: grid; grid-template-columns: minmax(0, 780px) 200px; gap: 56px; justify-content: start;
  padding: 32px max(40px, env(safe-area-inset-right, 0px)) 64px 48px; min-width: 0; }

/* Article */
.doc { min-width: 0; }
.doc h1 { font-size: 28px; line-height: 1.4; font-weight: 600; margin: 0 0 20px; }
.doc h2 { font-size: 22px; line-height: 1.4; font-weight: 600; margin: 40px 0 14px; }
.doc h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc strong { font-weight: 600; }
.hash { margin-left: 8px; color: var(--muted); opacity: 0; font-weight: 400; }
h2:hover .hash, .hash:focus { opacity: 1; text-decoration: none; }
.small { font-size: 14px; color: var(--muted); }
code { font-family: var(--mono); font-size: 0.86em; background: var(--code-bg); border-radius: 6px; padding: 1px 5px; overflow-wrap: break-word; }
.table { overflow-x: auto; margin: 0 0 16px; }
table { border-collapse: collapse; font-size: 15px; line-height: 1.6; min-width: 100%; }
th, td { border: 1px solid var(--border); padding: 9px 16px; text-align: left; vertical-align: top; }
th { background: var(--side-bg); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
td code { white-space: normal; }
.code { margin: 0 0 18px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--pre-bg); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--pre-bar); color: var(--pre-dim); font-size: 12px; font-family: var(--mono); }
.code-bar .copy { color: var(--pre-dim); font-family: var(--sans); font-size: 12px; }
.code-bar .copy:hover { color: var(--pre-text); }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--pre-text); font: 13.5px/1.7 var(--mono); }
pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; overflow-wrap: normal; white-space: pre; }
.note { border: 1px solid var(--border); border-left: 3px solid var(--muted); background: var(--side-bg); border-radius: 6px; padding: 12px 16px; margin: 0 0 18px; }
.note strong { display: block; font-size: 14px; margin-bottom: 2px; }
.note p { margin: 0; font-size: 15px; color: var(--text-2); }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pg { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; color: var(--accent); font-weight: 500; line-height: 1.5; }
.pg:hover { border-color: var(--accent); text-decoration: none; }
.pg span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.pg.next { grid-column: 2; text-align: right; }

/* On this page */
.toc { position: sticky; top: calc(var(--top-h) + var(--tabs-h) + 32px); align-self: start; font-size: 13px; line-height: 1.5;
  max-height: calc(100vh - 160px); overflow-y: auto; }
.toc-title { font-weight: 600; color: var(--text); margin-bottom: 8px; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--muted); border-left: 1px solid var(--border); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }

.foot { border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--muted);
  padding: 20px max(24px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); }
.mail { user-select: all; }

@media (max-width: 1200px) {
  .main { grid-template-columns: minmax(0, 780px); }
  .toc { display: none; }
}
@media (max-width: 996px) {
  .menu { display: inline-flex; align-items: center; justify-content: center; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; width: auto; height: auto; align-self: stretch;
    top: calc(var(--top-h) + var(--tabs-h) + env(safe-area-inset-top, 0px)); border-right: 0; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
  .nav-open .side { display: block; }
  .main { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
  .top-row, .tabs { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (max-width: 560px) {
  .doc h1 { font-size: 24px; }
  .doc h2 { font-size: 20px; }
  th, td { padding: 8px 10px; }
  table { font-size: 14px; }
  .pager { grid-template-columns: 1fr; }
  .pg.next { grid-column: 1; }
  .ver { display: none; }
  .crumb { font-size: 15px; }
}

/* dt-verify: flow chart and demo video. */
.flow { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.flow svg { display: block; width: 100%; min-width: 640px; height: auto; }
.fl-box { fill: var(--side-bg); stroke: var(--border); stroke-width: 1.5; }
.fl-in { fill: var(--bg); stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.fl-loop { fill: var(--accent-bg); stroke: var(--accent); stroke-width: 1.5; }
.fl-ask { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.fl-t { fill: var(--text); font-family: var(--sans); font-size: 15px; font-weight: 600; }
.fl-d { fill: var(--muted); font-family: var(--sans); font-size: 13px; }
.fl-n { fill: var(--accent); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.fl-l { fill: var(--accent); font-family: var(--sans); font-size: 13px; font-weight: 600; }
.fl-a { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.fl-a.loop { stroke: var(--accent); }
.fl-m { fill: var(--muted); }
.fl-m.loop { fill: var(--accent); }
.video { margin: 0 0 20px; }
.video video { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); background: #000; }

/* Result charts: one hue, two shades (validated: #7fbf9f/#17634d on #f7f9fb). */
:root { --viz-2: #7fbf9f; }
.chart { overflow-x: auto; margin: 0 0 16px; }
.chart svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart figcaption { margin-top: 6px; }
.vz-grid { stroke: var(--border); stroke-width: 1; }
.vz-tick { fill: var(--muted); font-family: var(--sans); font-size: 12px; }
.vz-legend { fill: var(--text-2); font-family: var(--sans); font-size: 13px; }
.vz-label { fill: var(--text-2); font-family: var(--sans); font-size: 14px; }
.vz-label.total { fill: var(--text); font-weight: 600; }
.vz-val { fill: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 600; }
.vz-val.muted { fill: var(--muted); font-weight: 400; }
.vz-1 { fill: var(--accent); }
.vz-2 { fill: var(--viz-2); }
.vz-link { stroke: var(--viz-2); stroke-width: 2; }
.vz-dot { stroke: var(--bg); stroke-width: 2; }
.vz-hit { fill: transparent; }
.vz-row { outline: none; }
.vz-row:hover .vz-hit, .vz-row:focus-visible .vz-hit { fill: var(--side-bg); }
