/* ── Docs layout (portfolio as design-system documentation) ── */
body.docs-body { background: var(--surface); }
.docs-body section { margin-top: 0; }

.topbar { position: sticky; top: 0; z-index: 60; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .brand { flex: none; }
.version { font: 500 12px/1 var(--mono); padding: 5px 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.search-btn { margin-left: 24px; flex: 0 1 340px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font: 14px/1 var(--font); cursor: pointer; text-align: left; }
.search-btn:hover { border-color: var(--muted); }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn span { flex: 1; }
kbd { font: 500 11.5px/1 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang-switch { display: flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); margin-right: 4px; }
.lang-switch a { min-width: 32px; min-height: 28px; display: grid; place-items: center; padding: 0 6px; border-radius: calc(var(--r-sm) * .7); font: 500 12px/1 var(--mono); text-decoration: none; color: var(--muted); }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.topbar-actions .btn { min-height: 36px; font-size: 13.5px; }
.menu-btn { display: none; width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; place-items: center; }
.menu-btn svg { width: 18px; height: 18px; }

.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar { position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; padding: 20px 14px 40px; border-right: 1px solid var(--line); background: var(--surface-2); }
.side-group + .side-group { margin-top: 22px; }
.side-group h2 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 10px 8px; }
.side-group ul { list-style: none; }
.side-group a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); text-decoration: none; font-size: 14px; color: var(--muted); }
.side-group a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.side-group a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-weight: 500; }
.side-group .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.side-group .dot.w { background: var(--warn); }
.side-foot { margin-top: 28px; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

.content { padding: 40px clamp(20px, 5vw, 64px) 80px; display: grid; grid-template-columns: minmax(0, 760px) 200px; gap: 48px; justify-content: start; }
.page { grid-column: 1; }
.page[hidden] { display: none; }
.toc { grid-column: 2; position: sticky; top: 100px; align-self: start; font-size: 13px; }
.toc p { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.toc button { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 1px solid var(--line-strong); padding: 5px 0 5px 12px; color: var(--muted); font: 13px/1.35 var(--font); cursor: pointer; }
.toc button:hover { color: var(--ink); border-color: var(--ink); }
.toc:empty { display: none; }

.crumbs { font: 500 12.5px/1 var(--mono); color: var(--muted); margin-bottom: 14px; }
.page h1 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(34px, 5vw, 52px); line-height: 1.05; outline: none; }
.lead { margin-top: 14px; font-size: 19px; line-height: 1.65; color: var(--muted); max-width: 640px; }
.lead strong { color: var(--ink); font-weight: 500; }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.page h2.sec { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 44px 0 14px; padding-top: 4px; scroll-margin-top: 90px; }
.page h2.sec .anchor { color: var(--muted); font-weight: 400; margin-left: 6px; opacity: 0; }
.page h2.sec:hover .anchor { opacity: 1; }
.page p.body { color: var(--muted); font-size: 16px; line-height: 1.75; max-width: 680px; }
.page p.body + p.body { margin-top: 12px; }
.page p.body strong { color: var(--ink); font-weight: 500; }

/* Getting-started cards */
.gs-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gs { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.gs:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.gs .ic { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.gs .ic svg { width: 18px; height: 18px; }
.gs b { display: block; font-weight: 600; font-size: 15px; }
.gs span { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }

/* Code block */
.code { margin-top: 16px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-strong); background: #111110; color: #e9e6e0; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08); font: 12px/1 var(--mono); color: #9b978f; }
.code pre { padding: 14px 16px; overflow: auto; font: 13.5px/1.7 var(--mono); }
.code .k { color: #ff9e7a; } .code .s { color: #a5d6a7; } .code .c { color: #8b949e; } .code .p { color: #9ecbff; }

/* Props table */
.props { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 4px; }
.props th, .props td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.props th { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); }
.props td:first-child { font: 500 13px/1.5 var(--mono); color: var(--accent-text); white-space: nowrap; width: 30%; }
.props td { color: var(--ink); }

/* Callout */
.callout { margin-top: 18px; display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: 14.5px; color: var(--ink); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent-text); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.warn svg { color: var(--warn); }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.principle { padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.principle code { font: 500 12px/1 var(--mono); color: var(--muted); }
.principle h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 10px 0 6px; }
.principle p { font-size: 14.5px; color: var(--muted); }

/* Do / Don't (reuses .dd from styles.css) */
.page .dd { margin-top: 8px; }
.page .dd div { padding: 18px; }
.page .dd li { margin: 6px 0; }

/* Changelog */
.changelog { margin-top: 28px; border-left: 1px solid var(--line-strong); }
.release { position: relative; padding: 0 0 34px 28px; }
.release::before { content: ''; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-text); }
.release.legacy::before { border-color: var(--muted); }
.release header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.release .v { font: 600 16px/1 var(--mono); }
.release time { font: 13px/1 var(--mono); color: var(--muted); }
.release h3 { font-size: 18px; font-weight: 600; margin-top: 8px; letter-spacing: -0.015em; }
.release h3 small { font-weight: 400; color: var(--muted); font-size: 15px; }
.release ul { list-style: none; margin-top: 8px; }
.release li { display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; color: var(--muted); padding: 3px 0; }
.release li .t { flex: none; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; border-radius: 4px; min-width: 76px; text-align: center; }
.t.add { background: var(--ok-soft); color: var(--ok); }
.t.imp { background: var(--accent-soft); color: var(--accent-text); }
.t.dep { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* Prev / next */
.pager { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: block; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); text-decoration: none; }
.pager a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pager small { display: block; font-size: 12.5px; color: var(--muted); }
.pager b { font-weight: 500; }
.pager .next { text-align: right; grid-column: 2; }

/* Search dialog */
.search-dialog { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 12vh; background: rgba(0,0,0,.35); }
.search-dialog[hidden] { display: none; }
.search-box { width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-box input { width: 100%; height: 52px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 16px/1 var(--font); outline: none; }
.search-box ul { list-style: none; max-height: 340px; overflow: auto; padding: 6px; }
.search-box li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.search-box li small { color: var(--muted); font: 12px/1.4 var(--mono); }
.search-box li[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent-text); }
.search-box .empty { padding: 18px; color: var(--muted); font-size: 14px; }
.search-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Responsive */
@media (max-width: 1180px) { .content { grid-template-columns: minmax(0, 760px); } .toc { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 60px; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 55; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); visibility: hidden; }
  body.side-open .sidebar { transform: none; visibility: visible; }
  .menu-btn { display: grid; }
  .search-btn { margin-left: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; }
  .version { display: none; }
  .topbar-actions .btn-ghost { display: none; }
  .gs-grid, .principles { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .topbar { gap: 10px; padding: 0 14px; } .brand small { display: none; } .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* Lists inside docs pages */
.pj-list { list-style: none; border-top: 1px solid var(--line); }
.pj-list li { position: relative; padding: 11px 0 11px 26px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--muted); }
.pj-list li::before { content: '→'; position: absolute; left: 0; color: var(--ink); opacity: .6; }
.pj-list li strong { color: var(--ink); font-weight: 500; }

/* FAB icon only on mobile */
.tk-fab .tk-ic { display: none; }

/* Zoomable preview */
.zoom { display: block; position: relative; }
.zoom-hint { display: none; }

@media (max-width: 760px) {
  .content { padding-bottom: 120px; }
  .tk-fab { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .tk-fab .dot { display: none; }
  .tk-fab .tk-ic { display: block; width: 20px; height: 20px; }
  .search-box li { flex-direction: column; gap: 2px; }
  .zoom-hint { display: inline-flex; position: absolute; right: 10px; bottom: 10px; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(17,17,16,.82); color: #fff; font: 500 12px/1 var(--font); }
}

/* Legal page + legal link in the sidebar */
.side-legal { margin-top: 12px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.side-legal a, .legal .crumbs a, .legal .props a, .page p.body a { color: var(--ink); text-underline-offset: 3px; }
.legal { display: block; max-width: 840px; margin: 0 auto; }

/* Tabs (component pages: overview / case study) */
.tabs { display: flex; gap: 4px; margin-top: 28px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { position: relative; padding: 10px 14px; background: none; border: 0; font: 500 14.5px/1 var(--font); color: var(--muted); cursor: pointer; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tabs [role="tab"]:hover { color: var(--ink); background: var(--surface-2); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-text); }
.tabpanel[hidden] { display: none; }
.tabpanel > h2.sec:first-child { margin-top: 32px; }

/* Numbered steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin-top: 16px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.steps > div { background: var(--surface); padding: 16px; }
.steps code { font: 500 12px/1 var(--mono); color: var(--muted); }
.steps b { display: block; margin: 8px 0 4px; font-weight: 600; }
.steps p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.try { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ── Interactive DS Generator demo ───────────────────────── */
.dsg { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 460px; }
.dsg-side { border-right: 1px solid var(--line); padding: 14px 10px; background: var(--surface-2); }
.dsg-label { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; }
.dsg-list { display: flex; flex-direction: column; gap: 2px; }
.dsg-list [role="tab"] { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font: 14px/1.2 var(--font); text-align: left; cursor: pointer; }
.dsg-list [role="tab"]:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.dsg-list [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.dsg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; transition: background-color .3s; }
.dsg-list [data-state="ok"] .dsg-dot { background: var(--ok); }
.dsg-list [data-state="drift"] .dsg-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dsg-main { padding: 16px 22px 22px; min-width: 0; }
.dsg-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.dsg-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 4px 12px 4px 6px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 13.5px/1 var(--font); cursor: pointer; }
.dsg-switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; flex: none; }
.dsg-switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.dsg-switch[aria-checked="true"] .track { background: var(--accent); }
.dsg-switch[aria-checked="true"] .thumb { transform: translateX(14px); background: var(--on-accent); }
.dsg-summary { font-size: 13.5px; color: var(--muted); }
.is-checked .dsg-summary { color: var(--ink); }
.dsg-panel:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 6px; }
.dsg .preview { margin: 16px 0; }
.dsg-tokens { margin-top: 16px; }
.dsg-tokens .props tr.drift td { background: var(--warn-soft); }
.dsg-tokens .props tr.drift td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.dsg-why { margin-top: 10px; font-size: 13.5px; color: var(--warn); font-weight: 500; }
.dsg-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.is-checking .dsg-panel { position: relative; }
.is-checking .dsg-panel::after { content: ''; position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent), transparent); background-size: 200% 100%; animation: dsg-scan 0.9s linear; pointer-events: none; }
@keyframes dsg-scan { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.demo-field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.demo-input { width: min(320px, 100%); height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 14px/1 var(--mono); }
.demo-table { border-collapse: collapse; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.demo-table th, .demo-table td { padding: 0 14px; height: 44px; text-align: left; border-bottom: 1px solid var(--line); }
.demo-table th { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.demo-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.demo-tabs span { position: relative; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.demo-tabs span.on { color: var(--ink); }
.demo-tabs span.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-text); }
.dsg-fallback { padding: 20px; color: var(--muted); }
@media (max-width: 760px) {
  .dsg { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .dsg-side { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .dsg-label { display: none; }
  .dsg-list { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .dsg-list [role="tab"] { width: auto; flex: none; }
  .dsg-main { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .is-checking .dsg-panel::after { display: none; } }
.dsg-scroll { overflow-x: auto; border-radius: 6px; }
.dsg-scroll:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.dsg-tokens .props { font-size: 13.5px; }
.dsg-tokens .props td, .dsg-tokens .props th { padding: 9px 10px; }
.dsg-tokens .props td:first-child, .dsg-tokens .props td:last-child { white-space: nowrap; }
.dsg-tokens .props td:first-child { width: auto; }

.dsg .docs-head h3 { font-size: 22px; letter-spacing: -0.02em; font-weight: 600; }
.dsg .docs-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dsg-list { position: relative; }
.dsg-list [role="tab"] { position: relative; }

/* ── Suite map ─────────────────────────────────────── */
.sm { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); display: grid; gap: 18px; }
.sm-cap { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.sm-flow { display: grid; grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 22px 1fr; align-items: stretch; }
.sm-node { display: flex; flex-direction: column; gap: 4px; justify-content: center; text-align: left; min-height: 72px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 13px/1.3 var(--font); }
button.sm-node { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
button.sm-node:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sm-node b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sm-node span { color: var(--muted); font-size: 12.5px; }
.sm-mine { border-color: color-mix(in srgb, var(--ok) 55%, transparent); box-shadow: inset 0 3px 0 var(--ok); }
.sm-part { border-style: dashed; border-color: color-mix(in srgb, var(--warn) 70%, transparent); }
.sm-other { background: transparent; border-style: dotted; }
.sm-other b { color: var(--muted); }
.sm-meter { background: transparent; border-style: dashed; }
button.sm-node[aria-pressed="true"] { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sm-arrow { position: relative; align-self: center; height: 2px; background: var(--line-strong); margin: 0 2px; }
.sm-arrow::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 6px solid var(--line-strong); border-right: 0; }
.sm-side { display: grid; grid-template-columns: repeat(5, 1fr); column-gap: 22px; }
.sm-side .sm-cap { grid-column: 2 / span 2; margin-bottom: 6px; }
.sm-side .sm-node { grid-column: 2 / span 2; }
.sm-rest-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.sm-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sm-key { width: 22px; height: 14px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); }
.sm-detail { padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.sm-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.sm-detail h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.sm-detail h3 span { font-weight: 400; color: var(--muted); }
.sm-detail p { font-size: 15px; color: var(--muted); line-height: 1.65; }
.sm-users { margin-top: 6px; font-size: 14px !important; }
.sm-users b { color: var(--ink); font-weight: 500; }
@media (max-width: 900px) {
  .sm-flow { grid-template-columns: 1fr; }
  .sm-arrow { width: 2px; height: 18px; justify-self: center; margin: 2px 0; }
  .sm-arrow::after { right: auto; left: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 6px solid var(--line-strong); border-bottom: 0; }
  .sm-side { grid-template-columns: 1fr; }
  .sm-side .sm-cap, .sm-side .sm-node { grid-column: 1; }
  .sm-rest-row { grid-template-columns: 1fr; }
}
.sm-key.sm-mine { border-color: var(--ok); box-shadow: inset 0 3px 0 var(--ok); }
.sm-key.sm-part { border: 1px dashed var(--warn); }
.sm-key.sm-other { border: 1px dotted var(--muted); background: transparent; }
/* Suite map: numbered steps, verbs and input/output */
.sm-none { background: transparent; border-style: dashed; }
.sm-num { align-self: flex-start; display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 4px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 600 12px/1 var(--mono); font-style: normal; }
.sm-verb { color: var(--muted); font-size: 12.5px; }
.sm-step { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.sm-io { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.sm-io div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink); line-height: 1.45; }
.sm-io span { display: block; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.sm-io i { font-style: normal; color: var(--muted); }
@media (max-width: 520px) { .sm-io { grid-template-columns: 1fr; } .sm-io i { justify-self: center; transform: rotate(90deg); } }
/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.stats div { padding: 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.stats b { display: block; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(32px, 4vw, 44px); line-height: 1; }
.stats span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.45; }

/* ── Gallery: one system, several products ── */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 8px; }
.gallery .frame { margin: 0; }
.gallery .frame-note { font-size: 13px; }
@media (max-width: 760px) { .gallery { grid-template-columns: minmax(0, 1fr); } }
