/* =====================================================================
   SimpleVM documentation — v2 design system.
   Layout modeled on the approved docs mock (full-tree TOC drawer,
   dynamic breadcrumb, right "On this page" sidebar) rebuilt on the
   main site's tokens in css/main.css. Self-contained: no CDNs.
   Code blocks stay dark in both themes, like the site terminal.
   ===================================================================== */

/* ---------- header extras ---------- */
.nav__version {
  font-family: var(--font-m); font-size: 11px; font-weight: 500;
  color: var(--accent); background: var(--accent-08);
  border: 1px solid var(--accent-15);
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- breadcrumb bar (sticky, dynamic) ---------- */
.crumb {
  position: sticky; top: var(--nav-h); z-index: 90;
  background: var(--nav-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  margin-top: var(--nav-h);
}
.crumb__inner {
  display: flex; align-items: center; gap: 10px;
  height: 46px; font-size: 13px; color: var(--ink-faint);
  min-width: 0;
}
.crumb__inner a { color: var(--ink-dim); transition: color 0.25s; }
.crumb__inner a:hover { color: var(--accent); }
.crumb .sep { opacity: 0.5; flex: 0 0 auto; }
.crumb .here { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb__toc {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-dim);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 14px;
  transition: color 0.25s, border-color 0.25s;
}
.crumb__toc:hover { color: var(--accent); border-color: var(--accent); }
.crumb__toc svg { width: 14px; height: 14px; }

/* ---------- page grid ---------- */
.doc-wrap { max-width: var(--shell); margin-inline: auto; padding: 40px var(--gut) 90px; }
.doc-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(32px, 4vw, 64px); align-items: start;
}

/* ---------- article ---------- */
.doc-article h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 800; font-stretch: 108%;
  letter-spacing: -0.02em; line-height: 1.06;
  margin-bottom: 10px;
}
.doc-article .doc-meta { color: var(--ink-faint); font-size: 13px; margin-bottom: 40px; }
.doc-article h2 {
  font-size: 24px; font-weight: 700; font-stretch: 106%; letter-spacing: -0.015em;
  margin: 52px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 64px);
}
.doc-article h3 { font-size: 18px; font-weight: 700; margin: 34px 0 12px; scroll-margin-top: calc(var(--nav-h) + 64px); }
.doc-article h4 { font-size: 15px; font-weight: 650; }
.doc-article p { color: var(--ink-dim); font-size: 15.5px; margin-bottom: 14px; }
.doc-article p strong, .doc-article li strong { color: var(--ink); }
.doc-article ul.plain { list-style: disc; padding-left: 22px; color: var(--ink-dim); font-size: 15px; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 20px; }
.doc-article .lead { font-size: 16.5px; }

/* checkmark feature list */
.checklist { display: flex; flex-direction: column; gap: 18px; margin: 20px 0 28px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; }
.checklist li::before {
  content: ""; flex: 0 0 auto; width: 19px; height: 19px; margin-top: 3px;
  background-color: var(--accent);
  -webkit-mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 4 4 10-10"/></svg>');
  mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 4 4 10-10"/></svg>');
}
.checklist strong { display: block; color: var(--ink); font-size: 15.5px; }
.checklist p { margin: 4px 0 0; font-size: 14.5px; }

/* callout */
.callout {
  border-radius: 12px; padding: 18px 20px; margin: 26px 0 34px;
  font-size: 14px; color: var(--ink-dim);
  border: 1px solid rgba(245, 181, 68, 0.38);
  background: rgba(245, 181, 68, 0.07);
}
.callout strong { color: var(--ink); }
.callout--warn::before {
  content: "IMPORTANT"; display: block;
  font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.18em;
  color: #d99b2b; margin-bottom: 8px;
}

/* configuration cards */
.cfgcards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 26px; }
.cfgcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 24px;
  transition: border-color 0.3s;
}
.cfgcard:hover { border-color: var(--accent-35); }
.cfgcard .pill {
  display: inline-block; font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.14em;
  color: var(--accent); background: var(--accent-08); border: 1px solid var(--accent-15);
  border-radius: 999px; padding: 4px 11px; margin-bottom: 14px;
}
.cfgcard h3 { margin: 0 0 8px; font-size: 19px; }
.cfgcard p { margin: 0; font-size: 14.5px; }

/* steps */
.stepnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14px;
}
.stephead { display: flex; align-items: center; gap: 12px; }
.stepchip {
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent); background: var(--accent-08); border: 1px solid var(--accent-15);
  border-radius: 6px; padding: 4px 9px; flex: 0 0 auto;
}
.stepblock { margin: 22px 0 34px; }
.stepblock .fine { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; }

/* code blocks — always dark, with copy button */
.code { position: relative; margin: 14px 0 8px; }
.code pre {
  margin: 0; padding: 18px 20px;
  background: #05090f;
  border: 1px solid rgba(147, 163, 184, 0.26);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-m); font-size: 13px; line-height: 1.7;
  color: #b9c7d8;
}
.code pre .c { color: #55667c; }
.code__copy {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.08em;
  color: #93a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(147, 163, 184, 0.26);
  border-radius: 7px; padding: 5px 10px;
  transition: color 0.25s, border-color 0.25s;
}
.code__copy:hover { color: #3db7ff; border-color: #009ff3; }
.code__copy svg { width: 13px; height: 13px; }
.code__copy.is-done { color: #34d399; border-color: rgba(52, 211, 153, 0.5); }

/* ---------- right sidebar ---------- */
.doc-side { position: sticky; top: calc(var(--nav-h) + 66px); }
.doc-side__card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px;
}
.doc-side__btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-size: 14px; font-weight: 650; color: var(--ink);
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  transition: color 0.25s;
  text-align: left;
}
.doc-side__btn:hover { color: var(--accent); }
.doc-side__btn svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.doc-side h4 {
  font-family: var(--font-m); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; color: var(--ink-faint);
  margin-bottom: 14px;
}
.doc-side__toc { display: flex; flex-direction: column; }
.doc-side__toc a {
  font-size: 13.5px; color: var(--ink-dim);
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--line);
  transition: color 0.25s, border-color 0.25s;
}
.doc-side__toc a:hover { color: var(--accent); }
.doc-side__toc a.is-here { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.doc-side__toc a.sub { padding-left: 26px; font-size: 12.5px; }
.doc-side__meta {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--font-m); font-size: 11px; line-height: 1.8; color: var(--ink-faint);
}

/* ---------- pager ---------- */
.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.doc-pager a {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.3s;
}
.doc-pager a:hover { border-color: var(--accent-35); }
.doc-pager .dir { font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-faint); }
.doc-pager .ttl { font-size: 14px; font-weight: 650; color: var(--ink); }
.doc-pager a.next { text-align: right; align-items: flex-end; }

/* ---------- TOC drawer (full documentation tree) ---------- */
.drawer { position: fixed; inset: 0; z-index: 300; }
.drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 4, 7, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s;
}
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--panel-solid);
  border-right: 1px solid var(--line-strong);
  padding: 22px 24px 40px;
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.45s var(--ease);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer__head h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.drawer__head h3 svg { width: 17px; height: 17px; color: var(--accent); }
.drawer__close {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-dim);
  transition: color 0.25s, border-color 0.25s;
}
.drawer__close:hover { color: var(--accent); border-color: var(--accent); }
.drawer__close svg { width: 16px; height: 16px; }
.drawer__filter {
  width: 100%; margin-bottom: 14px;
  padding: 10px 14px; font: inherit; font-size: 13.5px;
  color: var(--ink); background: var(--input-bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-input);
}
.drawer__filter::placeholder { color: var(--ink-faint); }
.drawer__filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-15); }

.drawer__tree details { border-bottom: 1px solid var(--line); }
.drawer__tree summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 2px;
  font-size: 14px; font-weight: 650; color: var(--ink);
  transition: color 0.2s;
}
.drawer__tree summary::-webkit-details-marker { display: none; }
.drawer__tree summary:hover { color: var(--accent); }
.drawer__tree summary::after {
  content: ""; width: 14px; height: 14px; flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg>');
  mask: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg>');
  transition: transform 0.3s var(--ease);
}
.drawer__tree details[open] summary::after { transform: rotate(90deg); }
.drawer__tree details.is-current > summary { color: var(--accent); }
.drawer__tree ul { padding: 2px 0 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.drawer__tree ul a {
  display: block; font-size: 13px; color: var(--ink-dim);
  padding: 5px 8px; border-radius: 7px;
  transition: color 0.2s, background 0.2s;
}
.drawer__tree ul a:hover { color: var(--accent); background: var(--accent-08); }
.drawer__tree ul a.is-current { color: var(--accent); background: var(--accent-08); font-weight: 600; }

/* ---------- docs footer ---------- */
.doc-footer {
  border-top: 1px solid var(--line); background: var(--bg-2);
  padding: 48px var(--gut) 42px; text-align: center;
}
.doc-footer .brand { display: inline-block; }
.doc-footer p { color: var(--ink-dim); font-size: 14px; margin-top: 14px; }
.doc-footer .fine { font-family: var(--font-m); font-size: 11px; color: var(--ink-faint); margin-top: 10px; }
.doc-footer .fine a { color: var(--ink-faint); }
.doc-footer .fine a:hover { color: var(--accent-hot); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-side { display: none; }
}
@media (max-width: 640px) {
  .cfgcards { grid-template-columns: 1fr; }
  .doc-pager { grid-template-columns: 1fr; }
  .crumb .here { max-width: 38vw; }
  /* keep the crumb to one line on phones: Documentation › current section */
  #crumbLink, #crumbSep { display: none !important; }
  .nav__version { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer__panel, .drawer__backdrop { transition: none; }
}

/* ---------- generated manual elements (build-docs.py) ---------- */
/* UI control tokens: [Create VM] etc. */
.ui {
  display: inline-block;
  font-size: 0.86em; font-weight: 600;
  color: var(--ink);
  background: rgba(128, 128, 128, 0.1);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 7px;
  white-space: nowrap;
}

/* figures (labeled screenshots) */
.fig { margin: 26px 0 34px; }
.fig img {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-2);
}
.fig figcaption {
  margin-top: 12px;
  font-size: 13px; color: var(--ink-faint); line-height: 1.6;
}
.fig figcaption b { color: var(--accent); font-weight: 600; }
.fig-caption { font-size: 13px; color: var(--ink-faint); font-style: italic; }

/* article lists */
.doc-list { padding-left: 24px; margin: 10px 0 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-dim); font-size: 15px; }
ul.doc-list { list-style: disc; }
ol.doc-list { list-style: decimal; }
ol.doc-list > li::marker { color: var(--accent); font-weight: 600; }
.doc-list--sub { margin: 8px 0 0; gap: 6px; font-size: 14px; list-style: circle; }
.doc-list code, .doc-article p code, .doc-table code {
  font-family: var(--font-m); font-size: 0.88em;
  color: var(--accent-hot);
  background: rgba(128, 128, 128, 0.09);
  border-radius: 5px; padding: 1px 5px;
}

/* cross-reference notes */
.xref {
  font-size: 13.5px !important;
  color: var(--ink-faint) !important;
  border-left: 2px solid var(--accent-35);
  padding-left: 12px;
}

/* tables */
.doc-table-wrap { overflow-x: auto; margin: 18px 0 26px; border: 1px solid var(--line); border-radius: 12px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th {
  text-align: left; font-weight: 650; color: var(--ink);
  background: rgba(128, 128, 128, 0.06);
  padding: 11px 14px; border-bottom: 1px solid var(--line-strong);
}
.doc-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-dim); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: 0; }

/* chapter directory (documentation/index.html) */
.quicklinks { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 10px; }
.quicklink {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.quicklink span { color: var(--accent); }
.quicklink:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-08); }

.part { margin-top: 46px; scroll-margin-top: calc(var(--nav-h) + 64px); }
.part__head { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: baseline; }
.part__num { font-size: 11px; color: var(--accent); letter-spacing: 0.2em; }
.part__head h2 { border: 0; padding: 0; margin: 0; font-size: 21px; }
.part__head p { grid-column: 2; margin: 0; font-size: 14px; color: var(--ink-faint); }

.chapgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.chapcard {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px;
  transition: border-color 0.3s, transform 0.35s var(--ease);
}
.chapcard:hover { border-color: var(--accent-35); transform: translateY(-3px); }
.chapcard__num { font-size: 12px; color: var(--accent); letter-spacing: 0.12em; }
.chapcard h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin: 0; border: 0; padding: 0; }
.chapcard__desc {
  margin: 0 !important; font-size: 13px !important; color: var(--ink-faint) !important; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chapcard__meta { font-size: 10px; color: var(--ink-faint); letter-spacing: 0.14em; margin-top: auto; padding-top: 6px; }
@media (max-width: 1024px) { .chapgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .chapgrid { grid-template-columns: 1fr; } }

/* ---------- article components (build-docs.py output) ---------- */
/* chapter kicker above the h1 */
.doc-kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.22em; color: var(--accent); margin-bottom: 14px; }

/* typed admonitions: NOTE / TIP / CAUTION */
.admon {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid; border-radius: 12px;
  padding: 16px 18px; margin: 24px 0 28px;
}
.admon__icon { flex: 0 0 auto; margin-top: 1px; }
.admon__icon svg { width: 18px; height: 18px; display: block; }
.admon__label { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0.18em; margin-bottom: 7px; }
.admon__body { min-width: 0; }
.admon__body p { margin: 0 !important; font-size: 14.5px !important; color: var(--ink-dim) !important; }
.admon__body strong { color: var(--ink); }
.admon--note { border-color: rgba(0, 159, 243, 0.3); background: var(--accent-08); }
.admon--note .admon__icon, .admon--note .admon__label { color: var(--accent); }
.admon--tip { border-color: rgba(52, 211, 153, 0.34); background: rgba(52, 211, 153, 0.06); }
.admon--tip .admon__icon, .admon--tip .admon__label { color: #22b884; }
.admon--warn { border-color: rgba(245, 181, 68, 0.4); background: rgba(245, 181, 68, 0.07); }
.admon--warn .admon__icon, .admon--warn .admon__label { color: #d99b2b; }

/* numbered section chips on h2 */
.doc-article h2 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.doc-article h2 .secnum {
  font-size: 13px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-08);
  border: 1px solid var(--accent-35);
  border-radius: 9px; padding: 5px 11px; flex: 0 0 auto;
}

/* task-pattern subheads: Overview / Before you begin / Procedure / ... */
.doc-article h3.subhead {
  display: inline-flex; align-items: center;
  font-family: var(--font-m); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-08);
  border: 1px solid var(--accent-15); border-radius: 999px;
  padding: 6px 15px;
  margin: 34px 0 14px;
}

/* numbered procedure steps with connector rail */
ol.steps { list-style: none; margin: 14px 0 26px; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: step; }
ol.steps > li {
  position: relative; padding-left: 46px; min-height: 30px;
  color: var(--ink-dim); font-size: 15px;
  counter-increment: step;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -3px;
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-m); font-size: 12.5px; font-weight: 500;
  color: var(--accent); background: var(--accent-08);
  border: 1px solid var(--accent-35);
}

/* prerequisite checklists (Before you begin) */
ul.doc-list--req { list-style: none; padding-left: 2px; }
ul.doc-list--req > li { position: relative; padding-left: 30px; }
ul.doc-list--req > li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 17px; height: 17px; border-radius: 5px;
  border: 1px solid var(--accent-35); background: var(--accent-08);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23009ff3" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="m6 12.5 4 4 8-9"/></svg>');
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}

/* zebra striping for reference tables */
.doc-table tr:nth-child(even) td { background: rgba(128, 128, 128, 0.045); }

/* heading anchor links (injected by docs.js) */
.hanchor {
  display: inline-flex; vertical-align: middle;
  margin-left: 10px; opacity: 0;
  color: var(--ink-faint);
  transition: opacity 0.2s, color 0.2s;
}
.hanchor svg { width: 14px; height: 14px; }
.hanchor:hover { color: var(--accent); }
h2:hover .hanchor, h3:hover .hanchor, .hanchor:focus-visible { opacity: 1; }

@media (max-width: 640px) {
  ol.steps > li { padding-left: 40px; }
  .admon { padding: 14px 15px; }
  .part__head { grid-template-columns: 1fr; }
  .part__head p { grid-column: 1; }
}
