:root {
      --bg: #0f1218;
      --bg-elev: #171b24;
      --bg-soft: #1e2430;
      --line: #2a3140;
      --text: #e8ecf4;
      --muted: #9aa3b5;
      --faint: #6b7385;
      --accent: #4cc2ff;
      --accent-2: #3a9fd4;
      --warn: #e8a54b;
      --ok: #6bcf8e;
      --danger: #e06c75;
      --radius: 10px;
      --shadow: 0 8px 28px rgba(0,0,0,.35);
      --max: 1100px;
      --side: 240px;
      --font: "Segoe UI", system-ui, -apple-system, sans-serif;
      --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      font-family: var(--font);
      color: var(--text);
      background:
        radial-gradient(1200px 600px at 10% -10%, rgba(76,194,255,.08), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(232,165,75,.05), transparent 50%),
        var(--bg);
      line-height: 1.55;
      font-size: 15.5px;
    }

    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }
    img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

    .layout {
      display: grid;
      grid-template-columns: var(--side) minmax(0, 1fr);
      min-height: 100vh;
    }

    nav.toc {
      position: sticky;
      top: 0;
      height: 100vh;
      overflow: auto;
      padding: 20px 14px 40px;
      border-right: 1px solid var(--line);
      background: rgba(15,18,24,.92);
      backdrop-filter: blur(8px);
    }
    nav.toc .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 6px;
      padding: 4px 8px;
    }
    nav.toc .brand img {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      flex-shrink: 0;
    }
    nav.toc .brand strong { font-size: 15px; letter-spacing: .02em; }
    nav.toc .brand span {
      font-size: 11px;
      color: var(--warn);
      border: 1px solid rgba(232,165,75,.35);
      padding: 1px 7px;
      border-radius: 999px;
    }
    nav.toc p.meta {
      margin: 0 8px 16px;
      font-size: 12px;
      color: var(--faint);
    }
    nav.toc ol {
      list-style: none;
      margin: 0;
      padding: 0;
    }
    nav.toc ol li { margin: 0; }
    nav.toc a {
      display: block;
      padding: 6px 10px;
      border-radius: 6px;
      color: var(--muted);
      font-size: 13px;
      text-decoration: none;
    }
    nav.toc a:hover {
      background: var(--bg-soft);
      color: var(--text);
      text-decoration: none;
    }
    nav.toc a.sub {
      padding-left: 22px;
      font-size: 12px;
      color: var(--faint);
    }

    main {
      padding: 36px 40px 80px;
      max-width: calc(var(--max) + 80px);
    }

    header.doc-hero {
      margin-bottom: 36px;
      padding-bottom: 24px;
      border-bottom: 1px solid var(--line);
    }
    header.doc-hero h1 {
      margin: 0 0 8px;
      font-size: 2rem;
      letter-spacing: -.02em;
    }
    header.doc-hero .lede {
      margin: 0;
      max-width: 62ch;
      color: var(--muted);
      font-size: 1.05rem;
    }
    .meta-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 18px;
      margin-top: 14px;
      font-size: 13px;
      color: var(--faint);
    }

    section {
      margin: 0 0 42px;
      scroll-margin-top: 24px;
    }
    h2 {
      margin: 0 0 12px;
      font-size: 1.45rem;
      letter-spacing: -.015em;
      padding-top: 8px;
      border-top: 1px solid var(--line);
    }
    section:first-of-type h2,
    #intro h2 { border-top: 0; padding-top: 0; }
    h3 {
      margin: 22px 0 8px;
      font-size: 1.1rem;
      color: #d7deea;
    }
    h4 {
      margin: 16px 0 6px;
      font-size: .98rem;
      color: var(--muted);
      font-weight: 600;
    }
    p { margin: 0 0 12px; max-width: 72ch; }
    ul, ol { margin: 0 0 14px; padding-left: 1.25rem; max-width: 72ch; }
    li { margin: 0 0 6px; }
    li ul { margin-top: 6px; margin-bottom: 6px; }

    .callout {
      border: 1px solid var(--line);
      background: var(--bg-elev);
      border-radius: var(--radius);
      padding: 14px 16px;
      margin: 14px 0 18px;
      max-width: 72ch;
      box-shadow: var(--shadow);
    }
    .callout.warn { border-color: rgba(232,165,75,.4); }
    .callout.info { border-color: rgba(76,194,255,.35); }
    .callout.ok { border-color: rgba(107,207,142,.35); }
    .callout strong.label {
      display: block;
      font-size: 12px;
      letter-spacing: .06em;
      text-transform: uppercase;
      margin-bottom: 4px;
      color: var(--accent);
    }
    .callout.warn strong.label { color: var(--warn); }
    .callout.ok strong.label { color: var(--ok); }

    figure {
      margin: 16px 0 22px;
      background: var(--bg-elev);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
    }
    /* Default: do not stretch crops to full column width */
    figure img {
      width: auto;
      max-width: 100%;
      height: auto;
      margin: 0 auto;
      border-radius: 0;
    }
    /* Full-app overviews: fill column, stay readable */
    figure.shot-overview {
      max-width: none;
    }
    figure.shot-overview img {
      width: 100%;
      max-height: min(72vh, 820px);
      object-fit: contain;
      object-position: top center;
      background: #0a0c10;
    }
    /* Narrow UI panels (materials, right cards): keep compact */
    figure.shot-panel {
      max-width: 420px;
    }
    figure.shot-panel img {
      width: 100%;
      max-height: 520px;
      object-fit: contain;
      object-position: top center;
      background: #0a0c10;
    }
    /* Wide strips (top bar, variants) */
    figure.shot-strip img {
      width: 100%;
      max-height: 280px;
      object-fit: contain;
      object-position: top center;
      background: #0a0c10;
    }
    /* Center preview crops */
    figure.shot-preview {
      max-width: 560px;
    }
    figure.shot-preview img {
      width: 100%;
      max-height: 480px;
      object-fit: contain;
      background: #0a0c10;
    }
    figcaption {
      padding: 10px 14px 12px;
      font-size: 13px;
      color: var(--muted);
      border-top: 1px solid var(--line);
    }

    table {
      width: 100%;
      max-width: 72ch;
      border-collapse: collapse;
      margin: 12px 0 18px;
      font-size: 14px;
    }
    th, td {
      border: 1px solid var(--line);
      padding: 8px 10px;
      text-align: left;
      vertical-align: top;
    }
    th { background: var(--bg-soft); color: #c9d2e2; font-weight: 600; }
    code, kbd {
      font-family: var(--mono);
      font-size: .88em;
      background: var(--bg-soft);
      border: 1px solid var(--line);
      border-radius: 4px;
      padding: 1px 5px;
    }
    kbd { padding: 2px 6px; color: #dce6f5; }

    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin: 14px 0 18px;
    }
    .grid-2 figure { margin: 0; max-width: none; }
    .grid-2 figure.shot-overview img {
      max-height: min(48vh, 420px);
    }

    .ui-map {
      display: grid;
      gap: 8px;
      max-width: 72ch;
      margin: 12px 0 16px;
    }
    .ui-map div {
      border: 1px dashed var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: rgba(30,36,48,.55);
      font-size: 13.5px;
    }
    .ui-map .top { border-color: rgba(76,194,255,.35); }
    .ui-map .mid {
      display: grid;
      grid-template-columns: .9fr 1.4fr 1fr;
      gap: 8px;
      padding: 0;
      border: 0;
      background: transparent;
    }
    .ui-map .mid > div { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: rgba(30,36,48,.55); }
    .ui-map .bot { border-color: rgba(232,165,75,.35); }

    footer.doc-foot {
      margin-top: 48px;
      padding-top: 18px;
      border-top: 1px solid var(--line);
      color: var(--faint);
      font-size: 13px;
    }

    @media (max-width: 980px) {
      .layout { grid-template-columns: 1fr; }
      nav.toc {
        position: relative;
        height: auto;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }
      main { padding: 24px 18px 60px; }
      .grid-2 { grid-template-columns: 1fr; }
      .ui-map .mid { grid-template-columns: 1fr; }
    }

    @media print {
      nav.toc { display: none; }
      .layout { display: block; }
      body { background: #fff; color: #111; }
      a { color: #06c; }
      figure, .callout { break-inside: avoid; box-shadow: none; }
    }
