/* SPDX-License-Identifier: AGPL-3.0-only */
/* kit.css — строгая дизайн-система платформы. tokens → base → layout → chrome → components → modules.
   Тема инстанса переопределяет ТОЛЬКО переменные из блока «тема инстанса»; всё остальное — общее. */

/* ───────────── tokens ───────────── */
:root {
  /* шкала отступов (4px) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  /* шкала шрифта */
  --t1: 12px; --t2: 13px; --t3: 14px; --t4: 16px; --t5: 18px; --t6: 22px; --t7: 28px; --t8: 36px; --t9: 48px;
  /* радиусы */
  --r1: 2px; --r2: 4px; --r3: 6px;
  --wrap: 1200px; --header-h: 56px; --line-w: 1px;

  /* тема инстанса (закрытый перечень) */
  --acc: #3b82f6; --acc-strong: #2563eb; --acc-ink: #ffffff;
  --acc2: #10b981;
  --font-ui: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-head: var(--font-ui);
  --head-tracking: -0.02em;
  /* поверх чужого содержимого (слайды, превью): светлого или тёмного — тёмное стекло, белый знак, светлый кант и тень; в обеих темах одинаково */
  --ov-bg: rgba(12, 14, 18, .74); --ov-bg-strong: rgba(12, 14, 18, .92); --ov-fg: #ffffff; --ov-ring: rgba(255, 255, 255, .62);
  --ov-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .35); --ov-edge: rgba(0, 0, 0, .28);
}

/* тёмная тема (по умолчанию у KimigaeTech) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220; --surface: #0f172a; --surface-2: #131c31; --surface-3: #18233b;
  --line: #1e293b; --line-2: #2a3850;
  --text: #c3cddb; --strong: #f1f5f9; --muted: #8494aa; --faint: #5a6a82;
  --ok: #10b981; --warn: #f59e0b; --bad: #ef4444; --info: #38bdf8;
  --acc-soft: color-mix(in srgb, var(--acc) 14%, transparent);
  --acc2-soft: color-mix(in srgb, var(--acc2) 14%, transparent);
  --code-bg: #0a101c;
  --shadow-pop: 0 12px 32px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
  --line: #e2e7ee; --line-2: #cfd7e2;
  --text: #334155; --strong: #0f172a; --muted: #64748b; --faint: #94a3b8;
  --ok: #059669; --warn: #b45309; --bad: #dc2626; --info: #0284c7;
  --code-bg: #f1f4f8;
  --shadow-pop: 0 12px 32px rgba(15,23,42,.14);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;
    --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
    --line: #e2e7ee; --line-2: #cfd7e2;
    --text: #334155; --strong: #0f172a; --muted: #64748b; --faint: #94a3b8;
    --ok: #059669; --warn: #b45309; --bad: #dc2626; --info: #0284c7;
    --code-bg: #f1f4f8; --shadow-pop: 0 12px 32px rgba(15,23,42,.14);
  }
}

/* инстанс slnknrr: изумрудный основной, mono-заголовки */
:root[data-instance="sl"] {
  --acc: #10b981; --acc-strong: #059669; --acc-ink: #04120c; --acc2: #3b82f6;
  --font-head: var(--font-mono); --head-tracking: -0.01em;
}
:root[data-instance="sl"][data-theme="light"] { --acc: #059669; --acc-strong: #047857; --acc-ink: #fff; }

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--t3)/1.6 var(--font-ui); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--strong); font-family: var(--font-head); letter-spacing: var(--head-tracking); line-height: 1.2; margin: 0; }
h1 { font-size: var(--t8); font-weight: 700; }
h2 { font-size: var(--t6); font-weight: 650; }
h3 { font-size: var(--t4); font-weight: 650; }
p { margin: 0 0 var(--s3); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
code { font-size: .92em; background: var(--surface-3); border: var(--line-w) solid var(--line); border-radius: var(--r1); padding: 0 4px; }
kbd { font-size: var(--t1); border: var(--line-w) solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r1); padding: 0 5px; color: var(--muted); background: var(--surface-2); }
hr { border: 0; border-top: var(--line-w) solid var(--line); margin: var(--s5) 0; }
img { max-width: 100%; display: block; }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
::selection { background: var(--acc-soft); color: var(--strong); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ───────────── layout ───────────── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.layout-side { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--s6); align-items: start; }
.layout-toc { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: var(--s7); align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + var(--s5)); }
.section { padding: var(--s7) 0; border-top: var(--line-w) solid var(--line); }
.section:first-of-type { border-top: 0; }
.page-head { padding: var(--s7) 0 var(--s5); }
.page-head p { color: var(--muted); font-size: var(--t4); max-width: 64ch; margin-top: var(--s2); }
@media (max-width: 960px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .layout-side, .layout-toc { grid-template-columns: minmax(0, 1fr); }   /* not 1fr: a long code line would stretch the page (UI_RND §5) */
  .sticky { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 var(--s4); }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }   /* not 1fr: its minimum is the content width, a wide table would stretch the page (UI_RND §5) */
  h1 { font-size: var(--t7); }
}

/* ───────────── typography helpers ───────────── */
.eyebrow { font: 500 var(--t1)/1 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.eyebrow b { color: var(--acc); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--t2); }
.tiny { font-size: var(--t1); }
.strong { color: var(--strong); font-weight: 600; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.sec-title h2 { display: flex; align-items: baseline; gap: var(--s3); }
.sec-title h2 .eyebrow { font-size: var(--t2); }

/* ───────────── chrome: header ───────────── */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: var(--line-w) solid var(--line); }
.hdr .wrap { height: var(--header-h); display: flex; align-items: center; gap: var(--s5); }
/* .wide (настройка «растягивать шапку»): шире текста страницы — до ширины главной с боками (центр + два бока + промежутки), края совпадают с боками */
.hdr.wide .wrap { max-width: calc(var(--wrap) + 2 * 400px + 2 * var(--s3)); }
@media (min-width: 1280px) { .hdr.wide .wrap { padding: 0 var(--s4); } }
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--strong); font: 700 var(--t4)/1 var(--font-head); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: var(--r2); background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font: 700 12px/1 var(--font-mono); }
.brand .p2 { color: var(--acc); }
.nav { display: flex; gap: 2px; height: 100%; min-width: 0; flex: 0 1 auto; overflow: hidden; }   /* не помещается — лишнее уходит в «ещё» (app.js) */
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; flex: none; }
.brand, .hdr-tools { flex: none; }
.nav a { display: flex; align-items: center; padding: 0 var(--s3); color: var(--muted); font-weight: 500; font-size: var(--t3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--strong); text-decoration: none; }
.nav a.on { color: var(--strong); border-bottom-color: var(--acc); }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.search-btn { display: flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s2); min-width: 0; border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--faint); font-size: var(--t2); cursor: pointer; }
.search-btn span, .search-btn kbd { display: none; }                               /* поиск — иконкой: место меню; ⌘K работает */
/* «ещё» (app.js): пункты меню, которым не хватило места */
.nav-more { position: relative; height: 100%; flex: none; }
.nav-more[hidden] { display: none; }
.nav-more > summary { list-style: none; height: 100%; display: flex; align-items: center; gap: 4px; padding: 0 var(--s2); color: var(--muted); font-weight: 500; font-size: var(--t3); cursor: pointer; border-bottom: 2px solid transparent; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover, .nav-more[open] > summary { color: var(--strong); }
.nav-more.on > summary { color: var(--strong); border-bottom-color: var(--acc); }
.nav-more .pop { left: 0; right: auto; width: auto; min-width: 180px; padding: var(--s2); display: flex; flex-direction: column; }
.nav-more .pop a { padding: 6px var(--s3); border-radius: var(--r2); color: var(--text); font-size: var(--t3); white-space: nowrap; }
.nav-more .pop a:hover { background: var(--surface-2); text-decoration: none; }
.nav-more .pop a.on { color: var(--acc); }
.icon-btn.menu-btn { display: none; }
.pop-wrap { position: relative; }
.lang-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s2); border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface); color: var(--strong); font: 600 var(--t1)/1 var(--font-mono); }
.lang-btn:hover { border-color: var(--line-2); }
.lang-btn svg.i { color: var(--muted); width: 14px; height: 14px; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 260px; padding: var(--s3); background: var(--surface); border: var(--line-w) solid var(--line-2); border-radius: var(--r3); box-shadow: var(--shadow-pop); }
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 6px 0; }
@media (max-width: 1440px) { .hdr .wrap { gap: var(--s4); } .nav a { padding: 0 var(--s2); } }
@media (max-width: 1120px) { .nav, .nav-more { display: none; } .icon-btn.menu-btn { display: grid; } }
@media (max-width: 640px) { .hdr .wrap { gap: var(--s2); } .hdr-tools .user-chip, .hdr-tools .search-btn { display: none; } .hdr-tools .seg button { padding: 3px 6px; } }
@media (max-width: 480px) { .hdr .brand > span:last-child { display: none; } }

/* сегментный переключатель (вариант подачи, язык) */
.seg { display: inline-flex; border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface); padding: 2px; gap: 2px; }
.seg button, .seg a { all: unset; cursor: pointer; padding: 3px 9px; border-radius: var(--r1); font: 500 var(--t1)/18px var(--font-ui); color: var(--muted); white-space: nowrap; }
.seg button:hover, .seg a:hover { color: var(--strong); }
.seg .on { background: var(--surface-3); color: var(--strong); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.acc .on { background: var(--acc); color: var(--acc-ink); box-shadow: none; }
.seg .lbl { padding: 3px 4px 3px 6px; color: var(--faint); font: 500 10px/18px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; cursor: default; }
.icon-btn { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r2); color: var(--muted); border: var(--line-w) solid transparent; }
.icon-btn:hover { color: var(--strong); border-color: var(--line); background: var(--surface); }
.user-chip { display: flex; align-items: center; gap: var(--s2); padding: 2px var(--s2) 2px 2px; border: var(--line-w) solid var(--line); border-radius: var(--r2); color: var(--strong); font-size: var(--t2); font-weight: 500; }
.user-chip:hover { text-decoration: none; border-color: var(--line-2); }

/* панель-полоса «вы смотрите как» / приватность */
.notice { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); border: var(--line-w) solid var(--line); border-left: 3px solid var(--acc); background: var(--surface); border-radius: var(--r2); font-size: var(--t2); }
.notice.warn { border-left-color: var(--warn); }
.notice.ok { border-left-color: var(--ok); }

/* ───────────── chrome: footer ───────────── */
.ftr { border-top: var(--line-w) solid var(--line); margin-top: var(--s8); padding: var(--s7) 0 var(--s5); background: var(--surface); }
.ftr-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s6); }
.ftr h4 { font: 500 var(--t1)/1 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s4); }
.ftr ul { list-style: none; margin: 0; padding: 0; }
.ftr li { margin: 0 0 var(--s2); }
.ftr li a { color: var(--text); font-size: var(--t2); }
.ftr-bottom { margin-top: var(--s7); padding-top: var(--s4); border-top: var(--line-w) solid var(--line); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; font-size: var(--t1); color: var(--faint); font-family: var(--font-mono); }
.ftr-bottom .ftr-src { color: inherit; }
@media (max-width: 760px) { .ftr-grid { grid-template-columns: 1fr 1fr; } }

/* ───────────── components ───────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 36px; padding: 0 var(--s4); border-radius: var(--r2); border: var(--line-w) solid var(--line-2); background: var(--surface); color: var(--strong); font: 600 var(--t3)/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.pri:hover { background: var(--acc-strong); border-color: var(--acc-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--strong); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 var(--s3); font-size: var(--t2); }
.btn.lg { height: 44px; padding: 0 var(--s5); font-size: var(--t4); }

.card { background: var(--surface); border: var(--line-w) solid var(--line); border-radius: var(--r3); }
.card.pad { padding: var(--s5); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: var(--line-w) solid var(--line); }
.card-h h3 { font-size: var(--t3); }
.card-b { padding: var(--s4); }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--line-2); }
a.card:hover .card-title { color: var(--acc); }
.card-title { color: var(--strong); font-weight: 650; font-size: var(--t4); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border: var(--line-w) solid var(--line); border-radius: var(--r1); background: var(--surface-2); color: var(--muted); font: 500 var(--t1)/1 var(--font-ui); white-space: nowrap; }
a.chip:hover { color: var(--strong); border-color: var(--line-2); text-decoration: none; }
.chip.mono { font-family: var(--font-mono); font-size: 11px; }
.chip.acc { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 35%, transparent); background: var(--acc-soft); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* метка видимости — строгая, моно */
.vis { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 5px; border-radius: var(--r1); font: 600 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border: var(--line-w) solid; }
.vis.private { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.vis.staff { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.vis.members { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.vis.public { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

.avatar { width: 32px; height: 32px; border-radius: var(--r2); background: var(--surface-3); color: var(--strong); display: grid; place-items: center; font: 600 var(--t2)/1 var(--font-mono); flex: none; border: var(--line-w) solid var(--line-2); overflow: hidden; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 64px; height: 64px; font-size: var(--t5); }
.avatar.xl { width: 112px; height: 112px; font-size: var(--t7); border-radius: var(--r3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.tabs { display: flex; gap: var(--s1); border-bottom: var(--line-w) solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs a, .tabs button { all: unset; cursor: pointer; padding: var(--s2) var(--s3); color: var(--muted); font-weight: 500; font-size: var(--t3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--strong); text-decoration: none; }
.tabs .on { color: var(--strong); border-bottom-color: var(--acc); }
.tabs .cnt { font: 500 11px/1 var(--font-mono); color: var(--faint); margin-left: 4px; }

.crumbs { display: flex; gap: var(--s2); flex-wrap: wrap; font: 500 var(--t1)/1.4 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.crumbs a { color: var(--muted); }
.crumbs > * + *::before { content: "/"; margin-right: var(--s2); color: var(--line-2); }

/* таблица данных */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t2); }
.tbl th { text-align: left; font: 500 var(--t1)/1 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: var(--s3) var(--s4); border-bottom: var(--line-w) solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: var(--s3) var(--s4); border-bottom: var(--line-w) solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl .w1 { width: 1%; white-space: nowrap; }

/* поля форм */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--t2); font-weight: 600; color: var(--strong); }
.field .hint { font-size: var(--t1); color: var(--faint); }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 var(--s3); border: var(--line-w) solid var(--line-2); border-radius: var(--r2); background: var(--surface); color: var(--strong); font: inherit; font-size: var(--t3); }
textarea.input { height: auto; min-height: 96px; padding: var(--s2) var(--s3); line-height: 1.5; }
.input.mono { font-family: var(--font-mono); } /* .input задаёт font: inherit — моноширинный нужно вернуть явно */
.input:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--t2); }
.check input { accent-color: var(--acc); margin-top: 3px; }
.inherit { font: 500 10px/1 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.inherit.over { color: var(--acc); }

/* статистика-плитка */
.stat { padding: var(--s4); border: var(--line-w) solid var(--line); border-radius: var(--r3); background: var(--surface); }
.stat .v { font: 600 var(--t7)/1 var(--font-mono); color: var(--strong); font-variant-numeric: tabular-nums; }
.stat .l { margin-top: var(--s2); font-size: var(--t2); color: var(--muted); }

/* пустое состояние */
.empty { padding: var(--s6); text-align: center; color: var(--faint); border: var(--line-w) dashed var(--line-2); border-radius: var(--r3); font-size: var(--t2); }

/* бейджи (svg рисует kit.js; контейнер) */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges svg { display: block; height: 20px; }

/* ───────────── modules: hero ───────────── */
.hero { padding: var(--s8) 0 var(--s7); border-bottom: var(--line-w) solid var(--line); }
.hero h1 { font-size: clamp(32px, 5vw, var(--t9)); max-width: 18ch; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--acc); }
.hero h1 i { font-style: normal; color: var(--acc2); }
.hero .lead { margin-top: var(--s4); font-size: var(--t5); color: var(--muted); max-width: 58ch; }
.hero .cta { margin-top: var(--s6); display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero-stats { margin-top: var(--s7); display: grid; grid-template-columns: repeat(4, 1fr); border: var(--line-w) solid var(--line); border-radius: var(--r3); background: var(--surface); }
.hero-stats > div { padding: var(--s4) var(--s5); border-left: var(--line-w) solid var(--line); }
.hero-stats > div:first-child { border-left: 0; }
.hero-stats .v { font: 600 var(--t7)/1 var(--font-mono); color: var(--strong); }
.hero-stats .l { margin-top: 6px; font-size: var(--t2); color: var(--muted); }
@media (max-width: 760px) { .hero-stats { grid-template-columns: 1fr 1fr; } .hero-stats > div:nth-child(3) { border-left: 0; } .hero-stats > div:nth-child(n+3) { border-top: var(--line-w) solid var(--line); } }

/* нумерованная сетка услуг: ячейки делят общие линии */
.cells { display: grid; grid-template-columns: repeat(3, 1fr); border-top: var(--line-w) solid var(--line); border-left: var(--line-w) solid var(--line); }
.cells > * { border-right: var(--line-w) solid var(--line); border-bottom: var(--line-w) solid var(--line); padding: var(--s5); background: var(--surface); color: inherit; display: block; }
.cells > a:hover { background: var(--surface-2); text-decoration: none; }
.cells > a:hover h3 { color: var(--acc); }
.cells .n { font: 500 var(--t1)/1 var(--font-mono); color: var(--acc); }
.cells h3 { margin: var(--s3) 0 var(--s2); }
.cells p { color: var(--muted); font-size: var(--t2); margin: 0; }
.cells .meta { margin-top: var(--s4); display: flex; gap: var(--s4); font: 500 var(--t1)/1 var(--font-mono); color: var(--faint); }
.cells .meta b { color: var(--text); font-weight: 500; }
@media (max-width: 960px) { .cells { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .cells { grid-template-columns: 1fr; } }

/* кейс-карточка */
.case-card .thumb { aspect-ratio: 16/9; border-bottom: var(--line-w) solid var(--line); background: var(--surface-3); position: relative; overflow: hidden; }
.case-card .thumb .ph { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; opacity: .6; }
.case-card .thumb .label { position: absolute; left: var(--s3); bottom: var(--s3); font: 500 var(--t1)/1 var(--font-mono); color: var(--muted); }
.case-card .thumb .vis { position: absolute; top: var(--s3); right: var(--s3); background: var(--surface); }
.case-card .body { padding: var(--s4); display: block; color: inherit; }
.case-card .body:hover { text-decoration: none; }
.case-card:hover { border-color: var(--line-2); }
.case-card .body:hover .card-title { color: var(--acc); }
/* слайдер превью в карточке: дорожка со снапом; ‹ › и точки — app.js; без JS листается прокруткой */
.case-card .thumb-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.case-card .thumb-track::-webkit-scrollbar { display: none; }
.case-card .thumb-slide { flex: 0 0 100%; position: relative; scroll-snap-align: start; display: block; }
.case-card .thumb-slide img, .case-card .thumb-slide video, .case-card .thumb-slide iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; background: var(--surface-3); }
.case-card .thumb-slide iframe { pointer-events: none; }
.case-card .thumb .label { pointer-events: none; padding: 4px 8px; border-radius: var(--r2); background: var(--ov-bg); color: var(--ov-fg); box-shadow: var(--ov-shadow); max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 3; }
.case-card .thumb .vis { z-index: 3; }
.case-card .sub { color: var(--muted); font-size: var(--t2); margin: 4px 0 var(--s3); }

/* репозиторий-строка */
.repo { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: var(--line-w) solid var(--line); align-items: start; }
.repo:last-child { border-bottom: 0; }
.repo .nm { font: 600 var(--t3)/1.3 var(--font-mono); color: var(--strong); word-break: break-all; }
.repo .ds { font-size: var(--t2); color: var(--muted); margin-top: 2px; }
.repo .mt { display: flex; gap: var(--s3); margin-top: 6px; font: 500 var(--t1)/1 var(--font-mono); color: var(--faint); flex-wrap: wrap; }
.lang-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.host-ico { width: 20px; height: 20px; border-radius: var(--r1); display: grid; place-items: center; font: 700 10px/1 var(--font-mono); color: #fff; }
.host-ico.gh { background: #24292f; } .host-ico.cb { background: #2185d0; } .host-ico.gl { background: #e24329; } .host-ico.npm { background: #cb3837; }

/* ───────────── modules: статьи ───────────── */
.post { padding: var(--s5) 0; border-bottom: var(--line-w) solid var(--line); }
.post-meta { display: flex; align-items: center; gap: var(--s2); font-size: var(--t2); color: var(--muted); flex-wrap: wrap; }
.post-meta .author { color: var(--strong); font-weight: 600; }
.post h2 { margin: var(--s3) 0 var(--s2); font-size: var(--t6); }
.post h2 a { color: var(--strong); }
.post h2 a:hover { color: var(--acc); text-decoration: none; }
.post .hubs { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: var(--t2); color: var(--muted); margin-bottom: var(--s3); }
.post .hubs a { color: var(--muted); }
.post .hubs a:hover { color: var(--acc); }
.post .excerpt { color: var(--text); max-width: 72ch; }
.post-foot { display: flex; align-items: center; gap: var(--s5); margin-top: var(--s4); font: 500 var(--t2)/1 var(--font-mono); color: var(--muted); }
.post-foot span { display: inline-flex; align-items: center; gap: 6px; }
.score.up { color: var(--ok); } .score.down { color: var(--bad); }

.md { font-size: var(--t4); line-height: 1.75; color: var(--text); max-width: 72ch; overflow-wrap: break-word; }   /* a long word or URL wraps instead of widening the page (UI_RND §5) */
.md h2 { font-size: var(--t6); margin: var(--s7) 0 var(--s3); scroll-margin-top: calc(var(--header-h) + var(--s4)); }
.md h3 { font-size: var(--t5); margin: var(--s6) 0 var(--s3); }
.md h2 .h-anchor, .md h3 .h-anchor { margin-left: var(--s2); color: var(--faint); opacity: 0; font-family: var(--font-mono); font-weight: 400; }
.md h2:hover .h-anchor, .md h3:hover .h-anchor { opacity: 1; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 var(--s4); }
.md blockquote { border-left: 3px solid var(--line-2); padding: 2px 0 2px var(--s4); color: var(--muted); }
.md pre { background: var(--code-bg); border: var(--line-w) solid var(--line); border-radius: var(--r2); padding: var(--s4); overflow-x: auto; font-size: var(--t2); line-height: 1.6; }
.md pre code { background: none; border: 0; padding: 0; }
.md .tok-k { color: #c084fc; } .md .tok-s { color: #34d399; } .md .tok-c { color: var(--faint); } .md .tok-n { color: #f59e0b; } .md .tok-f { color: #60a5fa; }
:root[data-theme="light"] .md .tok-k { color: #7c3aed; } :root[data-theme="light"] .md .tok-s { color: #047857; } :root[data-theme="light"] .md .tok-n { color: #b45309; } :root[data-theme="light"] .md .tok-f { color: #1d4ed8; }
.term { border-bottom: 1px dashed var(--acc); cursor: help; position: relative; }
.term:hover::after { content: attr(data-def); position: absolute; left: 0; top: 130%; width: 280px; z-index: 5; background: var(--surface); border: var(--line-w) solid var(--line-2); border-radius: var(--r2); box-shadow: var(--shadow-pop); padding: var(--s3); font-size: var(--t2); line-height: 1.5; color: var(--text); }

.toc { border-left: var(--line-w) solid var(--line); padding-left: var(--s4); font-size: var(--t2); }
.toc .eyebrow { display: block; margin-bottom: var(--s3); }
.toc a { display: block; color: var(--muted); padding: 3px 0; }
.toc a.sub { padding-left: var(--s3); font-size: var(--t1); }
.toc a.on { color: var(--strong); box-shadow: -17px 0 0 -15px var(--acc); }
.toc a.dim { color: var(--faint); }

.slice-bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--acc-soft); border: var(--line-w) solid color-mix(in srgb, var(--acc) 30%, transparent); border-radius: var(--r2); font-size: var(--t2); margin-bottom: var(--s5); }
.gap { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; padding: var(--s3) var(--s4); border: var(--line-w) dashed var(--line-2); border-radius: var(--r2); font-size: var(--t2); color: var(--faint); cursor: pointer; }
.gap:hover { color: var(--muted); border-color: var(--faint); }

.comments { border-top: var(--line-w) solid var(--line); margin-top: var(--s7); padding-top: var(--s5); }
.cmt { display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); padding: var(--s3) 0; }
.cmt .cmt { margin-left: 0; padding-left: var(--s4); border-left: var(--line-w) solid var(--line); }
.cmt-h { display: flex; gap: var(--s2); align-items: center; font-size: var(--t2); }
.cmt-h b { color: var(--strong); }
.cmt-b { font-size: var(--t3); margin-top: 2px; }
.cmt-f { display: flex; gap: var(--s4); font: 500 var(--t1)/1 var(--font-mono); color: var(--faint); margin-top: 6px; }

/* ───────────── modules: форум ───────────── */
.fcat { border: var(--line-w) solid var(--line); border-radius: var(--r3); overflow: hidden; margin-bottom: var(--s5); background: var(--surface); }
.fcat-h { display: grid; grid-template-columns: minmax(0,1fr) 80px 90px 260px; background: var(--surface-3); border-bottom: var(--line-w) solid var(--line); }
.fcat-h > div { padding: var(--s2) var(--s4); font: 500 var(--t1)/1.6 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.fcat-h > div:first-child { color: var(--strong); font: 650 var(--t3)/1.6 var(--font-ui); text-transform: none; letter-spacing: 0; }
.frow { display: grid; grid-template-columns: 36px minmax(0,1fr) 80px 90px 260px; border-bottom: var(--line-w) solid var(--line); align-items: center; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--surface-2); }
.frow > div { padding: var(--s3) var(--s4); }
.frow > div:first-child { padding-right: 0; color: var(--faint); }
.frow .fi.new { color: var(--acc); }
.frow .t { font-weight: 600; color: var(--strong); font-size: var(--t3); }
.frow .t a { color: var(--strong); }
.frow .t a:hover { color: var(--acc); }
.frow .d { font-size: var(--t2); color: var(--muted); margin-top: 2px; }
.frow .subs { font-size: var(--t1); color: var(--faint); margin-top: 4px; }
.frow .subs a { color: var(--muted); }
.frow .n { text-align: right; font: 500 var(--t2)/1.3 var(--font-mono); color: var(--text); }
.frow .n small { display: block; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.frow .last { font-size: var(--t1); color: var(--faint); line-height: 1.45; min-width: 0; }
.frow .last a { color: var(--text); font-size: var(--t2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .last b { color: var(--muted); font-weight: 500; }
@media (max-width: 860px) { .fcat-h { grid-template-columns: 1fr; } .fcat-h > div:not(:first-child) { display: none; } .frow { grid-template-columns: 28px 1fr 70px; } .frow > div:nth-child(4), .frow > div:nth-child(5) { display: none; } }

.tpfx { display: inline-block; font: 600 10px/16px var(--font-mono); padding: 0 5px; border-radius: var(--r1); text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; vertical-align: 2px; border: var(--line-w) solid; }
.tpfx.q { color: var(--info); } .tpfx.ok { color: var(--ok); } .tpfx.imp { color: var(--warn); } .tpfx.pin { color: var(--muted); }

.fpost { display: grid; grid-template-columns: 200px minmax(0,1fr); border: var(--line-w) solid var(--line); border-radius: var(--r3); background: var(--surface); margin-bottom: var(--s4); overflow: hidden; }
.fpost.answer { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.fpost-a { padding: var(--s4); border-right: var(--line-w) solid var(--line); background: var(--surface-2); font-size: var(--t1); color: var(--muted); }
.fpost-a .nm { font: 650 var(--t3)/1.3 var(--font-ui); color: var(--strong); display: block; margin: var(--s3) 0 2px; }
.fpost-a .rk { font-family: var(--font-mono); color: var(--acc); }
.fpost-a dl { margin: var(--s3) 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s2); font-family: var(--font-mono); }
.fpost-a dt { color: var(--faint); } .fpost-a dd { margin: 0; text-align: right; color: var(--text); }
.fpost-b { display: flex; flex-direction: column; min-width: 0; }
.fpost-h { display: flex; justify-content: space-between; padding: var(--s2) var(--s4); border-bottom: var(--line-w) solid var(--line); font: 500 var(--t1)/1.6 var(--font-mono); color: var(--faint); }
.fpost-c { padding: var(--s4); font-size: var(--t3); flex: 1; }
.fpost-c .quote { border: var(--line-w) solid var(--line); border-left: 3px solid var(--acc); background: var(--surface-2); padding: var(--s2) var(--s3); margin-bottom: var(--s3); font-size: var(--t2); border-radius: var(--r1); }
.fpost-c .quote b { display: block; font: 500 var(--t1)/1.4 var(--font-mono); color: var(--faint); margin-bottom: 4px; }
.fpost-c pre { background: var(--code-bg); border: var(--line-w) solid var(--line); border-radius: var(--r2); padding: var(--s3); font-size: var(--t2); overflow-x: auto; }
.fpost-sig { padding: var(--s2) var(--s4); border-top: var(--line-w) dashed var(--line); font-size: var(--t1); color: var(--faint); }
.fpost-f { display: flex; gap: var(--s2); justify-content: flex-end; padding: var(--s2) var(--s4); border-top: var(--line-w) solid var(--line); }
@media (max-width: 760px) {
  .fpost { grid-template-columns: 1fr; }
  .fpost-a { border-right: 0; border-bottom: var(--line-w) solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); padding: var(--s3) var(--s4); }
  .fpost-a .avatar.lg { width: 32px; height: 32px; font-size: var(--t1); }
  .fpost-a .nm { margin: 0; } .fpost-a dl, .fpost-a .badges { display: none; }
}

.pager { display: flex; gap: 2px; }
.pager a, .pager span { min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 6px; border: var(--line-w) solid var(--line); border-radius: var(--r1); font: 500 var(--t1)/1 var(--font-mono); color: var(--muted); background: var(--surface); }
.pager .on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }

/* ───────────── modules: профиль ───────────── */
.prof-head { display: grid; grid-template-columns: 112px minmax(0,1fr) auto; gap: var(--s5); align-items: start; padding: var(--s7) 0 var(--s5); }
.prof-head h1 { font-size: var(--t7); display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.prof-head .login { font: 500 var(--t4)/1 var(--font-mono); color: var(--muted); }
.prof-head .tag { margin-top: var(--s2); color: var(--text); font-size: var(--t4); }
.prof-facts { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); font-size: var(--t2); color: var(--muted); }
.prof-facts span { display: inline-flex; align-items: center; gap: 6px; }
.staff-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 4px; border-radius: var(--r1); background: var(--acc-soft); color: var(--acc); font: 600 var(--t1)/1 var(--font-ui); border: var(--line-w) solid color-mix(in srgb, var(--acc) 35%, transparent); }
.staff-badge .mark { width: 14px; height: 14px; border-radius: 2px; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font: 700 8px/1 var(--font-mono); }
@media (max-width: 760px) { .prof-head { grid-template-columns: 64px 1fr; } .prof-head .avatar.xl { width: 64px; height: 64px; font-size: var(--t5); } .prof-head > :last-child { grid-column: 1 / -1; } }

.ach { display: grid; grid-template-columns: 36px 1fr; gap: var(--s3); align-items: center; padding: var(--s2) 0; }
.ach .medal { width: 36px; height: 36px; border-radius: var(--r2); display: grid; place-items: center; font: 700 var(--t2)/1 var(--font-mono); border: var(--line-w) solid; }
.medal.gold { color: #eab308; border-color: #eab30866; background: #eab30814; }
.medal.silver { color: #94a3b8; border-color: #94a3b866; background: #94a3b814; }
.medal.bronze { color: #c2410c; border-color: #c2410c66; background: #c2410c14; }
.medal.copper { color: #b45309; border-color: #b4530966; background: #b4530914; }
.medal.iron { color: #64748b; border-color: #64748b66; background: #64748b14; }

/* календарь активности */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); gap: 3px; overflow: hidden; }
.heat i { width: 10px; height: 10px; border-radius: 2px; background: var(--surface-3); }
.heat i.l1 { background: color-mix(in srgb, var(--acc2) 30%, var(--surface-3)); }
.heat i.l2 { background: color-mix(in srgb, var(--acc2) 55%, var(--surface-3)); }
.heat i.l3 { background: color-mix(in srgb, var(--acc2) 80%, var(--surface-3)); }
.heat i.l4 { background: var(--acc2); }

/* ───────────── modules: панель ───────────── */
.panel { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: 100vh; }
.pside { border-right: var(--line-w) solid var(--line); background: var(--surface); padding: var(--s4) 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.pside .brand { padding: 0 var(--s4) var(--s4); border-bottom: var(--line-w) solid var(--line); margin-bottom: var(--s3); }
.pside .inst { margin: 0 var(--s3) var(--s3); padding: var(--s2) var(--s3); border: var(--line-w) solid var(--line); border-radius: var(--r2); display: flex; align-items: center; gap: var(--s2); font-size: var(--t2); color: var(--strong); background: var(--surface-2); }
.pside h5 { margin: var(--s4) var(--s4) var(--s2); font: 500 10px/1 var(--font-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.pside a { display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s4); color: var(--muted); font-size: var(--t2); font-weight: 500; border-left: 2px solid transparent; }
.pside a:hover { color: var(--strong); background: var(--surface-2); text-decoration: none; }
.pside a.on { color: var(--strong); border-left-color: var(--acc); background: var(--surface-2); }
.pside a .cnt { margin-left: auto; font: 500 11px/1 var(--font-mono); color: var(--faint); }
.pmain { min-width: 0; }
.ptop { height: var(--header-h); display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s6); border-bottom: var(--line-w) solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.pbody { padding: var(--s6); max-width: 1180px; }
.pbody h1 { font-size: var(--t7); }
@media (max-width: 860px) { .panel { grid-template-columns: 1fr; } .pside { position: static; height: auto; } }

/* код-блок в макетах */
.codebox { background: var(--code-bg); border: var(--line-w) solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); font: 400 var(--t2)/1.6 var(--font-mono); color: var(--text); overflow-x: auto; white-space: pre; }

/* consent */
.consent { max-width: 440px; margin: var(--s8) auto; }
.scope-list { list-style: none; padding: 0; margin: 0; }
.scope-list li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: var(--line-w) solid var(--line); font-size: var(--t2); }
.scope-list li:last-child { border-bottom: 0; }

/* ───────── приложение (не в макетах) ───────── */
.pside .soon { display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s4); color: var(--faint); font-size: var(--t2); font-weight: 500; border-left: 2px solid transparent; cursor: default; }
.pside .soon .cnt { margin-left: auto; font: 500 10px/1 var(--font-mono); color: var(--faint); }
.pside a.pside-src { margin-top: var(--s5); font: 500 11px/1 var(--font-mono); color: var(--faint); }   /* AGPL §13: OPENSOURCE_RND §3 */
button[disabled], .btn[disabled] { opacity: .5; cursor: not-allowed; }
details.pop-wrap > summary { list-style: none; }
details.pop-wrap > summary::-webkit-details-marker { display: none; }
.seg a:hover { text-decoration: none; }
.cell-state { font: 600 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.cell-state.stale { color: var(--warn); } .cell-state.missing { color: var(--bad); } .cell-state.inherit { color: var(--faint); } .cell-state.ok { color: var(--ok); } .cell-state.base { color: var(--acc); }
.swatch { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r2); background: none; cursor: pointer; }
.edit-row { display: grid; gap: var(--s2); align-items: center; }
.repo .ds { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details > summary.card-b { list-style: none; color: var(--acc); }
details > summary.card-b::-webkit-details-marker { display: none; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); background: var(--surface-3); }
.gallery figcaption { padding: 10px 16px; font-size: var(--t2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lang-tabs { display: flex; gap: 2px; }
.tabs { overflow-y: hidden; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 72ch; }
.nowrap { white-space: nowrap; }
/* ───────── статьи (этап 5) ───────── */
.md img { max-width: 100%; border-radius: var(--r2); border: 1px solid var(--line); }
.md-table { overflow-x: auto; margin: 0 0 var(--s4); }
.md table { border-collapse: collapse; font-size: var(--t3); }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md th { background: var(--surface-2); color: var(--strong); font-weight: 600; }
.md li.task { list-style: none; margin-left: -18px; }
.md blockquote.quote cite { display: block; font: 500 var(--t1)/1.4 var(--font-mono); color: var(--faint); font-style: normal; margin-bottom: 4px; }
.md details.spoiler { border: 1px solid var(--line); border-radius: var(--r2); padding: 6px 12px; margin: 0 0 var(--s4); background: var(--surface); }
.md details.spoiler > summary { cursor: pointer; color: var(--acc); font-size: var(--t2); }
.md a.term { color: inherit; border-bottom: 1px dashed var(--acc); text-decoration: none; position: relative; }
.md a.term:hover::after { content: attr(data-def); position: absolute; left: 0; top: 130%; width: 280px; z-index: 5; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--shadow-pop); padding: var(--s3); font-size: var(--t2); line-height: 1.5; color: var(--text); white-space: normal; }
details.gap-d { margin: var(--s5) 0; }
details.gap-d > summary { list-style: none; }
details.gap-d > summary::-webkit-details-marker { display: none; }
details.gap-d[open] > summary { margin-bottom: var(--s4); }
.cmt .cmt-f summary::-webkit-details-marker { display: none; }
.post-foot .score svg { display: none; }
/* подсветка кода: токены kit вместо темы highlight.js */
.md .hljs-keyword, .md .hljs-built_in, .md .hljs-selector-tag { color: #c084fc; }
.md .hljs-string, .md .hljs-attr, .md .hljs-regexp { color: #34d399; }
.md .hljs-comment, .md .hljs-quote { color: var(--faint); font-style: italic; }
.md .hljs-number, .md .hljs-literal { color: #f59e0b; }
.md .hljs-title, .md .hljs-function .hljs-title, .md .hljs-title.function_ { color: #60a5fa; }
.md .hljs-type, .md .hljs-class .hljs-title { color: #38bdf8; }
:root[data-theme="light"] .md .hljs-keyword { color: #7c3aed; } :root[data-theme="light"] .md .hljs-string { color: #047857; }
:root[data-theme="light"] .md .hljs-number { color: #b45309; } :root[data-theme="light"] .md .hljs-title { color: #1d4ed8; }
.md pre.mermaid { background: var(--surface); text-align: center; }
/* окно поиска */
.search-dlg { width: min(640px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: var(--r3); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); margin-top: 12vh; }
.search-dlg::backdrop { background: rgba(0,0,0,.45); }
.search-dlg input { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--strong); font: inherit; font-size: var(--t4); outline: 0; }
.search-res { max-height: 60vh; overflow-y: auto; }
.search-res a { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); align-items: center; }
.search-res a small { grid-column: 2; color: var(--muted); font-size: var(--t2); }
.search-res a:hover, .search-res a.on { background: var(--surface-2); text-decoration: none; }
mark { background: color-mix(in srgb, var(--acc) 30%, transparent); color: var(--strong); border-radius: 2px; padding: 0 1px; }
a.search-btn:hover { text-decoration: none; color: var(--muted); }

/* ── хранилища ключей микросервисов: палитра хранилищ (--st-1…12), потомки — тусклее, ключ щедрее хранилища — ярко и янтарём (--elev) ── */
:root {
  --st-1: #3b82f6; --st-2: #10b981; --st-3: #8b5cf6; --st-4: #f43f5e; --st-5: #06b6d4; --st-6: #84cc16;
  --st-7: #d946ef; --st-8: #f97316; --st-9: #14b8a6; --st-10: #6366f1; --st-11: #ec4899; --st-12: #0ea5e9;
  --elev: #fbbf24; --elev-ink: #fbbf24;
}
:root[data-theme="light"] { --elev: #f59e0b; --elev-ink: #b45309; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] { --elev: #f59e0b; --elev-ink: #b45309; } }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: var(--r1); background: var(--c, var(--line-2)); flex: none; vertical-align: middle; }
.swatch.lg { width: 14px; height: 14px; }
.st-bar { box-shadow: inset 3px 0 0 var(--c); }
.st-dim { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 45%, transparent); }
.st-dim2 { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 25%, transparent); }
.st-elev { box-shadow: inset 3px 0 0 var(--elev); background: color-mix(in srgb, var(--elev) 9%, transparent); }
.chip.elev { color: var(--elev-ink); border-color: color-mix(in srgb, var(--elev) 45%, transparent); background: color-mix(in srgb, var(--elev) 14%, transparent); }
.chip.st { color: var(--strong); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
details.st-box { border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface); margin-bottom: var(--s3); }
details.st-box > summary { list-style: none; cursor: pointer; padding: var(--s3) var(--s4); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
details.st-box > summary::-webkit-details-marker { display: none; }
details.st-box[open] > summary { border-bottom: var(--line-w) solid var(--line); }
details.st-box .st-body { padding: var(--s3) var(--s4); }
details.st-box details.st-box { background: var(--surface-2); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches label { cursor: pointer; display: inline-flex; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches .swatch { width: 18px; height: 18px; box-shadow: inset 0 0 0 1px var(--line-2); }
.swatches input:checked + .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--strong); }
/* имиджборд проекта: строка-цитата «>…» */
.quote-line { color: var(--ok); }
/* слайдер кейса: видео и интерактив (singlefile HTML в iframe-песочнице) того же размера, что картинка; «на весь экран» */
.gallery .slide-frame { position: relative; aspect-ratio: 16/9; border-bottom: 1px solid var(--line); background: var(--surface-3); }
.gallery .slide-frame iframe, .gallery .slide-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--surface-3); object-fit: contain; }
.gallery .slide-fs { position: absolute; right: var(--s2); top: var(--s2); background: var(--surface); }

/* слайдер (карточка кейса и галерея кейса, app.js [data-slider]): по бокам — полосы-кнопки поверх слайда; полоса ловит нажатие,
   колесо/трекпад и свайп даже над интерактивом (внутри iframe жесты достаются сайту). Знаки — тёмное стекло: видны на любом слайде */
.slide-nav { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.gallery-box .slide-nav { inset: 0 0 auto 0; aspect-ratio: 16/9; }   /* только над медиа (16:9), подпись под ним — без полос */
/* в галерее кнопки сидят на рамке слайда, наполовину снаружи: так видно, что листают слайд, а не сайт внутри (у него бывают свои стрелки) */
.gallery-box .slide-edge { top: var(--s7); width: 48px; }
.gallery-box .slide-edge.prev { left: -24px; } .gallery-box .slide-edge.next { right: -24px; }
.gallery-box .slide-edge:hover { background: none; }
.gallery-box .slide-btn { width: 48px; height: 48px; box-shadow: inset 0 0 0 2px var(--acc), var(--ov-shadow); }
.gallery-box .slide-btn svg { width: 22px; height: 22px; }
@media (max-width: 720px) { .gallery-box .slide-edge.prev { left: 0; } .gallery-box .slide-edge.next { right: 0; } .gallery-box .slide-btn { width: 40px; height: 40px; } }
.slide-edge { pointer-events: auto; position: absolute; top: 0; bottom: 0; width: var(--s8); display: flex; align-items: center; justify-content: center; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; color: var(--ov-fg); }
.slide-edge.prev { left: 0; } .slide-edge.next { right: 0; }
.slide-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ov-bg); box-shadow: inset 0 0 0 1.5px var(--ov-ring), var(--ov-shadow); backdrop-filter: blur(6px); transition: transform .15s, background .15s; }
.slide-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.slide-edge:hover .slide-btn, .slide-edge:focus-visible .slide-btn { background: var(--acc); transform: scale(1.08); }
.slide-edge:focus-visible { outline: none; }
.slide-edge.flash .slide-btn { animation: slide-flash .5s ease; }
.case-card .slide-edge { width: var(--s7); }
.case-card .slide-btn { width: 32px; height: 32px; } .case-card .slide-btn svg { width: 16px; height: 16px; }
.slide-dots { position: absolute; right: var(--s3); bottom: var(--s3); display: flex; gap: 5px; align-items: center; padding: 5px 7px; border-radius: 999px; background: var(--ov-bg); box-shadow: var(--ov-shadow); pointer-events: none; z-index: 3; }
.slide-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ov-ring); }
.slide-dots i.on { background: var(--ov-fg); width: 16px; border-radius: 3px; }
.slide-count { position: absolute; left: var(--s3); top: var(--s3); padding: 4px 8px; border-radius: var(--r2); background: var(--ov-bg); color: var(--ov-fg); box-shadow: var(--ov-shadow); font: 600 var(--t1)/1.2 var(--font-mono); pointer-events: none; z-index: 3; }
.slide-hint { position: absolute; left: 50%; bottom: var(--s4); translate: -50% 0; padding: 6px 12px; border-radius: var(--r3); background: var(--ov-bg-strong); color: var(--ov-fg); box-shadow: var(--ov-shadow); font-size: var(--t2); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 3; }
[data-slider].hinting .slide-hint { opacity: 1; }
[data-slider].hinting .slide-btn { animation: slide-flash .9s ease 2; }
@keyframes slide-flash { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.22); background: var(--acc); } }
@media (prefers-reduced-motion: reduce) { .slide-btn { transition: none; } .slide-edge.flash .slide-btn, [data-slider].hinting .slide-btn { animation: none; background: var(--acc); } }
.gallery-box { position: relative; }
.gallery-box .gallery { border-radius: inherit; }

/* классы услуг в портфолио (classes.ts): строка фильтров · выбранный класс — схема, путь, примечание, термин, подклассы, характеристики */
.cls-bar { gap: 6px; flex-wrap: wrap; margin-bottom: var(--s3); }
.cls-note { margin-bottom: var(--s4); }
.cls-note .card-b { display: flex; gap: var(--s5); align-items: flex-start; }
.cls-scheme { flex: none; width: 120px; height: 70px; }
.cls-text { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.cls-text p { margin: 0; color: var(--text); max-width: 72ch; }
.cls-trail a { color: var(--muted); }
@media (max-width: 640px) { .cls-note .card-b { flex-direction: column; } }
/* главная по раскладке (home-layout.ts / home-blocks.ts): сетка областей «буквами»; .fit — весь экран; на узком экране — столбиком по порядку букв */
.home-grid { display: grid; gap: var(--s3); padding: var(--s5) 0 var(--s6); }
.home-grid.fit { height: calc(100svh - var(--header-h) - var(--s5) - var(--s6)); min-height: 600px; max-height: 920px; }
/* .edges: крайние колонки — в полях страницы, середина — ровно ширина центра (как у шапки); бока — высотой в экран и липкие (центр листается, они на виду) */
.home-grid.edges { min-height: calc(100svh - var(--header-h) - var(--line-w)); padding-bottom: var(--s4); --gap: var(--s3); --side-min: clamp(220px, 15vw, 250px); --side: minmax(var(--side-min), 400px);
  --center: min(calc(var(--wrap) - 2 * var(--s5)), calc(100vw - 2 * var(--s4) - 2 * var(--side-min) - 2 * var(--gap)));
  width: calc(100vw - 2 * var(--s4)); margin-inline: calc(50% - 50vw + var(--s4)); justify-content: center; gap: 0 var(--gap); }
body:has(.home-grid.edges) { overflow-x: clip; }
.home-grid.edges > .hb--edge { contain: size; align-self: start; position: sticky; top: calc(var(--header-h) + var(--s3)); height: 100%; max-height: calc(100svh - var(--header-h) - 2 * var(--s3)); }
.hb { background: var(--surface); border: var(--line-w) solid var(--line); border-radius: var(--r3); padding: var(--s4); min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--s3); overflow: hidden; position: relative; }
.hb.hb--plain { background: none; border: 0; border-radius: 0; padding: 0; overflow: visible; }
.hb-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; flex: none; }
.hb-h .small { color: var(--muted); }
.hb--text { border-color: var(--line-2); }
.hb-text, .hb-hero { display: flex; flex-direction: column; gap: var(--s3); flex: 1; min-height: 0; }
.hb-text h2, .hb-hero h1 { font: 700 clamp(var(--t5), 1.9vw, var(--t7))/1.15 var(--font-head); letter-spacing: var(--head-tracking); color: var(--strong); margin: 0; }
.hb-hero h1 { font-size: var(--t8); }
.hb-body { color: var(--muted); font-size: var(--t3); overflow: hidden; }
.hb-body p { margin: 0 0 var(--s2); }
.hb-text .cta, .hb-hero .cta { margin-top: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }
.hb-sec { padding-top: var(--s6); }
/* текст как герой классики; справа — свежие работы как часть героя (без рамки и подложки: превью и подпись прямо на фоне);
   отступы и заголовок сжимаются по высоте экрана — герой и «с чем приходят» помещаются в один экран Full HD */
.hb-herox { position: relative; padding: clamp(var(--s4), 3svh, var(--s8)) 0 clamp(var(--s4), 2.2svh, var(--s7)); border-bottom: var(--line-w) solid var(--line); }
.hb--plain > .hb-herox { flex: 1; }                                                    /* растягивается на строку сетки: на высоком экране — больше воздуха и крупнее */
.hb-herox .hero-text { max-width: 60ch; min-width: 0; }
.hb-herox.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) min(40%, clamp(420px, 42svh, 600px)); gap: clamp(var(--s5), 2.4vw, var(--s7)); align-items: center; }
.hb-herox.with-aside .hero-text { max-width: none; }
.hb-herox h1 { font-size: clamp(28px, min(2.7vw, 4.6svh), 56px); letter-spacing: -.03em; margin-top: var(--s3); }
.hb-herox .lead { margin-top: clamp(var(--s3), 1.6svh, var(--s5)); font-size: clamp(var(--t3), 1.75svh, 20px); color: var(--muted); }
.hb-herox .lead p { margin: 0 0 var(--s2); }
.hb-herox .cta { margin-top: clamp(var(--s3), 2.2svh, var(--s6)); display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero-aside { position: relative; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.hero-aside .hb-h .small { display: none; }                                          /* «все кейсы» — уже вторая кнопка героя */
.hero-aside .deck-nav { position: absolute; top: -6px; right: 0; }                     /* ‹ › — в строке «свежие работы» */
.hero-aside .case-card { background: none; border: 0; border-radius: 0; min-width: 0; }
.hero-aside .case-card .thumb { border: var(--line-w) solid var(--line); border-radius: var(--r3); }
/* активность внутри героя — без рамки, квадратики крупнее */
.hb-herox.aside-activity .hero-aside { gap: var(--s3); }
.hero-aside .act-cal.act-wide { grid-template-rows: auto repeat(7, 14px); grid-auto-columns: 14px; }
.hero-aside .act-cal.act-wide .act-m { width: 14px; }
.hero-aside .case-card .body { padding: var(--s3) 0 0; }
.hero-aside .case-card .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: var(--s2); }
.hb--services.hb--plain { padding-top: clamp(var(--s4), 2.6svh, var(--s6)); }
.hb--services.hb--plain .sec-title { margin-bottom: clamp(var(--s3), 1.8svh, var(--s5)); }
.hb--services.hb--plain .cells > * { padding-block: clamp(var(--s3), 1.9svh, var(--s5)); }
.hb--services.hb--plain .cells .meta { margin-top: clamp(var(--s2), 1.4svh, var(--s4)); }
/* активность: календарь — неделя строкой (свежее внизу), сверху дни недели, слева месяцы и год; в широкой секции — столбцами, как в GitHub */
.act-range { display: flex; flex-direction: column; gap: 2px; flex: none; }
.act-range b { font-size: var(--t2); color: var(--strong); font-weight: 600; }
.act-reset { border: var(--line-w) solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: var(--r2); padding: 2px 8px; font-size: var(--t1); cursor: pointer; }
.act-reset:hover { border-color: var(--acc); color: var(--acc); }
.act-cal { display: grid; grid-template-columns: auto repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--weeks), minmax(0, 1fr)); gap: 3px; flex: 1; min-height: 0; user-select: none; touch-action: none; }
.act-cal .act-wd { font: 500 10px/1.4 var(--font-mono); color: var(--faint); text-align: center; text-transform: lowercase; }
.act-cal .act-m { font: 500 10px/1.1 var(--font-mono); color: var(--faint); padding-right: 4px; display: flex; flex-direction: column; justify-content: flex-start; white-space: nowrap; text-transform: lowercase; min-height: 0; overflow: visible; }
.act-cal .act-m[data-month] { cursor: pointer; } .act-cal .act-m[data-month]:hover { color: var(--acc); }
.act-cal .act-m b { color: var(--muted); font-weight: 600; }
.act-cal i { cursor: pointer; }
.act-cal i.x { visibility: hidden; cursor: default; }
.act-cal i, .act-legend i { border-radius: 2px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
.act-cal .l1, .act-legend .l1 { background: color-mix(in srgb, var(--acc) 30%, var(--surface-3)); }
.act-cal .l2, .act-legend .l2 { background: color-mix(in srgb, var(--acc) 55%, var(--surface-3)); }
.act-cal .l3, .act-legend .l3 { background: color-mix(in srgb, var(--acc) 78%, var(--surface-3)); }
.act-cal .l4, .act-legend .l4 { background: var(--acc); }
.act-cal i:hover { box-shadow: inset 0 0 0 1px var(--strong); }
.act-cal.picked i[data-d]:not(.sel) { opacity: .28; }
.act-cal i.sel { box-shadow: inset 0 0 0 2px var(--strong); }
.act-cal.act-wide { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: auto repeat(7, 12px); grid-auto-columns: 12px; grid-template-columns: auto; flex: none; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; }
.act-cal.act-wide .act-m { padding: 0 0 2px; width: 12px; justify-content: flex-end; }
.act-cal.act-wide .act-wd, .act-cal.act-wide > span:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); padding-right: 4px; text-align: left; }
.act-legend { display: flex; align-items: center; gap: 3px; flex: none; }
.act-legend i { width: 10px; height: 10px; display: inline-block; }
.act-legend i:first-of-type { margin-left: 4px; } .act-legend i:last-of-type { margin-right: 4px; }
.act-kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--s3); font-size: var(--t1); color: var(--muted); flex: none; }
.act-kinds b { color: var(--strong); }
/* «что происходит» (app.js [data-feed]): листается вручную и сама — пауза на наведении, фокусе и после ручной прокрутки */
.feed-win { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-right: 2px; outline: none; }
.feed-win:focus-visible { box-shadow: 0 0 0 2px var(--acc-soft); border-radius: var(--r2); }
.feed-list { list-style: none; margin: 0; padding: 0 0 var(--s6); display: flex; flex-direction: column; gap: var(--s2); }
.feed-list li { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s3); border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface-2); }
.feed-list li[hidden] { display: none; }
.feed-list li a { color: var(--strong); font-weight: 600; font-size: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-list li small { font-size: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-list li .chip { font-size: 10px; padding: 0 6px; align-self: flex-start; }
.feed-tabs { flex-wrap: wrap; }
/* «по кругу» (app.js [data-loop]): бесконечная лента — без полосы прокрутки; столбиком или одной линией (полоса на всю ширину) */
.loop-win { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; outline: none; }
.loop-win.h { overflow-x: auto; overflow-y: hidden; min-width: 0; }
.loop-strip { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-block: var(--line-w) solid var(--line); min-width: 0; height: 100%; }
.loop-strip > .eyebrow { flex: none; }
.loop-line { list-style: none; margin: 0; padding: 0; display: flex; }
.loop-line li { flex: none; display: flex; align-items: baseline; gap: var(--s2); padding: 0 var(--s5); border-left: var(--line-w) solid var(--line); white-space: nowrap; }
.loop-line li[hidden] { display: none; }
.loop-line li .chip { font-size: 10px; padding: 0 6px; }
.loop-line li a { color: var(--strong); font-weight: 600; font-size: var(--t3); }
.loop-line li small { font-size: var(--t1); }
.loop-win::-webkit-scrollbar { display: none; }
.loop-list { padding: var(--s2) 0; }
/* «обсуждают сейчас» (app.js [data-talk]): доска или тема — и в ней «кто — что — как давно» */
.talk-win { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; display: flex; flex-direction: column; gap: var(--s3); padding-right: 2px; }
.talk-g { display: flex; flex-direction: column; gap: 4px; padding-bottom: var(--s3); border-bottom: var(--line-w) solid var(--line); }
.talk-g:last-of-type { border-bottom: 0; }
.talk-g[hidden], .talk-g li[hidden] { display: none; }
.talk-t { display: flex; align-items: baseline; gap: var(--s2); color: var(--strong); min-width: 0; }
.talk-t:hover { text-decoration: none; } .talk-t:hover b { color: var(--acc); }
.talk-t .chip { font-size: 10px; padding: 0 6px; flex: none; }
.talk-t b { font-size: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talk-t small { font-size: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.talk-g ul { list-style: none; margin: 0; padding: 0 0 0 var(--s3); border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.talk-g li { display: flex; align-items: baseline; gap: var(--s2); font-size: var(--t2); min-width: 0; }
.talk-g li a { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talk-g li a b { color: var(--text); font-weight: 600; }
.talk-g li a:hover { text-decoration: none; color: var(--strong); }
.talk-g li time { flex: none; font-size: var(--t1); white-space: nowrap; }
/* «один экран» с боками: ровно высота окна; активность в центральной клетке — лёжа, по центру клетки */
.home-grid.edges.fit { height: calc(100svh - var(--header-h) - var(--line-w)); min-height: 620px; max-height: none; padding-bottom: var(--s4); }
.home-grid.edges .hb--activity:not(.hb--edge) .act-cal { align-self: center; margin-block: auto; }
/* плитки услуг */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: var(--s2); flex: 1; min-height: 0; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); border: var(--line-w) solid var(--line); border-radius: var(--r2); background: var(--surface-2); color: inherit; min-height: 0; overflow: hidden; transition: border-color .15s; }
.tile:hover { border-color: var(--acc); text-decoration: none; }
.hb--services { container-type: inline-size; }
@container (max-width: 460px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 260px) { .tiles { grid-template-columns: 1fr; } }
.tile .n { color: var(--acc); font-size: var(--t1); }
.tile b { color: var(--strong); font-size: var(--t3); }
.tile p { margin: 0; color: var(--muted); font-size: var(--t1); }
.tile .meta { margin-top: auto; font-size: var(--t1); color: var(--faint); }
/* колода карточек: по одной, ‹ › и точки сверху */
.deck { display: flex; flex-direction: column; gap: var(--s2); flex: 1; min-height: 0; }
.deck-nav { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex: none; }
.deck-nav .slide-dots { position: static; }
.slide-step { border: 0; padding: 0; margin: 0; background: none; cursor: pointer; color: var(--ov-fg); }
.slide-step .slide-btn { width: 32px; height: 32px; } .slide-step .slide-btn svg { width: 16px; height: 16px; }
.slide-step:hover .slide-btn { background: var(--acc); }
.deck-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; flex: 1; min-height: 0; }
.deck-track::-webkit-scrollbar { display: none; }
.deck-slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; display: flex; }
.deck-slide .case-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hb .deck-slide .case-card .thumb { flex: none; }
.hb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.hb-list li { display: flex; justify-content: space-between; gap: var(--s2); }
@media (max-width: 1100px) {
  .home-grid { display: flex; flex-direction: column; }
  .home-grid.fit { height: auto; max-height: none; min-height: 0; }
  .home-grid.edges { width: auto; margin-inline: 0; gap: var(--s3); }
  .home-grid.edges > .hb--edge { contain: none; position: static; align-self: stretch; height: auto; max-height: none; }
  .hb--activity .act-cal { grid-template-columns: auto; grid-auto-flow: column; grid-template-rows: auto repeat(7, 12px); grid-auto-columns: 12px; flex: none; overflow-x: auto; touch-action: pan-x; }
  .hb--activity .act-cal .act-m { padding: 0 0 2px; width: 12px; justify-content: flex-end; }
  .hb--activity .act-cal .act-wd, .hb--activity .act-cal > span:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); padding-right: 4px; text-align: left; }
  .feed-win, .talk-win { max-height: 420px; }
  .loop-win { max-height: 360px; }
  .home-grid.edges.fit { height: auto; min-height: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-herox { padding: var(--s6) 0 var(--s5); }
  .hb-herox.with-aside { grid-template-columns: 1fr; }
  .hero-aside .deck-nav { position: static; }
}
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }

/* редактор классов услуг (/panel/portfolio/services, public/service-tree.js): дерево мышью · карточка класса · схемы */
.pin-tile { display: grid; gap: var(--s1); min-width: 260px; }
.pin-tile .row { gap: var(--s1); flex-wrap: nowrap; }
.svc-ed { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (max-width: 1100px) { .svc-ed { grid-template-columns: 1fr; } }
.svc-tree, .svc-tree ul { list-style: none; margin: 0; padding: 0; }
.svc-tree ul { padding-left: var(--s5); border-left: var(--line-w) dashed var(--line); margin-left: 10px; }
.svc-tree ul:empty { display: none; }
.svc-tree li { margin: 2px 0; }
.svc-node { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s2); border: var(--line-w) solid transparent; border-radius: var(--r2); }
.svc-node:hover { background: var(--surface-2); }
.svc-node.on { border-color: var(--acc); background: var(--surface-2); }
.svc-node a { color: var(--strong); font-weight: 500; }
.svc-grip { cursor: grab; color: var(--faint); font-size: var(--t1); letter-spacing: -2px; user-select: none; }
.svc-tree li.dragging > .svc-node { opacity: .4; }
.svc-tree li.drop-before > .svc-node { box-shadow: 0 -2px 0 var(--acc); }
.svc-tree li.drop-after > .svc-node { box-shadow: 0 2px 0 var(--acc); }
.svc-tree li.drop-inside > .svc-node { border-color: var(--acc); border-style: dashed; }
.svc-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); }
.svc-scheme { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s2); border: var(--line-w) solid var(--line); border-radius: var(--r2); cursor: pointer; text-align: center; min-height: 92px; justify-content: center; }
.svc-scheme input { position: absolute; opacity: 0; pointer-events: none; }
.svc-scheme.on, .svc-scheme:has(input:checked) { border-color: var(--acc); background: var(--surface-2); }
.svc-scheme .cls-scheme { width: 96px; height: 56px; }
/* редактор раскладки главной (/panel/home, public/home-editor.js) */
.hl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.hl-sp { flex: 1; }
.hl-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); align-items: start; }
@media (max-width: 1100px) { .hl-main { grid-template-columns: 1fr; } }
.hl-canvas { display: grid; gap: var(--s2); padding: var(--s3); border: var(--line-w) dashed var(--line-2); border-radius: var(--r3); background: var(--bg); position: relative; user-select: none; touch-action: none; }
.hl-canvas.fit { min-height: 420px; }
.hl-cell { border: var(--line-w) dashed var(--line); border-radius: var(--r2); display: grid; place-items: center; }
.hl-block { position: relative; border: var(--line-w) solid var(--line-2); border-radius: var(--r2); background: var(--surface); padding: var(--s3); display: flex; flex-direction: column; gap: 4px; cursor: grab; min-width: 0; overflow: hidden; }
.hl-block:active { cursor: grabbing; }
.hl-block b { color: var(--strong); font-size: var(--t3); }
.hl-block small { color: var(--muted); font-size: var(--t1); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.hl-block.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.hl-block:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hl-l { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: var(--r2); background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: var(--t1); align-self: flex-start; }
.hl-h { position: absolute; background: transparent; z-index: 2; }
.hl-h::after { content: ""; position: absolute; background: var(--acc); border-radius: 2px; opacity: 0; transition: opacity .15s; }
.hl-block:hover .hl-h::after, .hl-block.on .hl-h::after { opacity: .85; }
.hl-n, .hl-s { left: 12px; right: 12px; height: 10px; cursor: ns-resize; } .hl-n { top: 0; } .hl-s { bottom: 0; }
.hl-e, .hl-w { top: 12px; bottom: 12px; width: 10px; cursor: ew-resize; } .hl-e { right: 0; } .hl-w { left: 0; }
.hl-n::after, .hl-s::after { left: 50%; width: 28px; height: 4px; translate: -50% 0; top: 3px; }
.hl-e::after, .hl-w::after { top: 50%; height: 28px; width: 4px; translate: 0 -50%; left: 3px; }
.hl-target { border: 2px solid var(--acc); border-radius: var(--r2); background: var(--acc-soft); pointer-events: none; z-index: 3; }
.hl-target.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.hl-widths { display: grid; gap: var(--s2); padding: var(--s2) var(--s3) 0; }
.hl-widths input { width: 64px; height: 24px; font-size: var(--t1); display: inline-block; }
.hl-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.hl-msg { margin-top: var(--s2); min-height: 18px; } .hl-msg.bad { color: var(--bad); }
.hl-insp { position: sticky; top: calc(var(--header-h) + var(--s3)); }
.hl-insp textarea { min-height: 72px; }

/* tools catalog: dense table like classic utility indexes; on phones every row becomes a labelled card (BACKLOG §22) */
.tools-cat { font: 600 var(--t4)/1.2 var(--font-head); margin: var(--s6) 0 var(--s3); }
.tbl.tools { border: var(--line-w) solid var(--line); border-radius: var(--r2); overflow: hidden; table-layout: fixed; }
/* same column widths in every category table, so columns line up down the page */
.tbl.tools th:nth-child(1) { width: 20%; } .tbl.tools th:nth-child(3) { width: 13%; } .tbl.tools th:nth-child(4) { width: 13%; } .tbl.tools th:nth-child(5) { width: 18%; }
.tbl.tools td, .tbl.tools th { padding: var(--s2) var(--s3); }
.tbl.tools td:nth-child(2) { color: var(--muted); }
.tbl.tools-files tr.sha td { border-bottom: var(--line-w) solid var(--line); padding-top: 0; word-break: break-all; }
.tbl.tools-files tr:not(.sha) td { border-bottom: 0; }
@media (max-width: 640px) {
  .tbl.tools thead { display: none; }
  .tbl.tools tr { display: block; padding: var(--s3); border-bottom: var(--line-w) solid var(--line); }
  .tbl.tools td { display: flex; gap: var(--s2); padding: var(--s1) 0; border: 0; }
  .tbl.tools td::before { content: attr(data-l); flex: 0 0 34%; color: var(--faint); font: 500 var(--t1)/1.6 var(--font-mono); text-transform: uppercase; }
}
/* tool page: content + side column; one column on tablets and phones (no inline grid: it would beat the media query) */
.tool-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.tbl.tools-files td:nth-child(2) { overflow-wrap: anywhere; }
.tbl.tools-files td:nth-child(3) { white-space: nowrap; }
@media (max-width: 960px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .tbl.tools-files tr:not(.sha) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .tbl.tools-files tr.sha td:first-child { display: none; }
}
/* buy result on a tool page (buy.js) */
.buy-result { margin-top: var(--s3); }
.buy-result.ok { border-color: var(--ok); }
.buy-result.bad { border-color: var(--bad); }
.buy-result [data-license-key] { font-size: var(--t4); overflow-wrap: anywhere; }
/* layouts with columns in an inline style (page + side panel) would beat the media queries above: one column on tablets and phones (BACKLOG UI №11) */
@media (max-width: 960px) {
  [style*="grid-template-columns"]:not([data-keep-cols]):not(.home-grid) { grid-template-columns: minmax(0, 1fr) !important; }
}

/* GA4 consent bar (INT_RND §1) */
.consent-bar { position: fixed; z-index: 50; left: var(--s4); right: var(--s4); bottom: var(--s4); max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) var(--s4); background: var(--surface); border: var(--line-w) solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow-pop); font-size: var(--t2); }
.consent-bar[hidden] { display: none; }

/* phones and tablets: site menu behind ☰, icon-only search and profile, panel sidebar slides in (UI_RND §2) */
.menu-dd { display: none; position: relative; }
.menu-dd > summary { list-style: none; cursor: pointer; }
.menu-dd > summary::-webkit-details-marker { display: none; }
.menu-pop { left: 0; right: auto; width: min(300px, calc(100vw - 2 * var(--s4))); max-height: calc(100vh - var(--header-h) - var(--s4)); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.menu-pop a { padding: 8px var(--s3); border-radius: var(--r2); color: var(--text); font-size: var(--t3); }
.menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop a.on { color: var(--acc); }
@media (max-width: 1120px) { .menu-dd { display: block; } }
@media (max-width: 640px) {
  .hdr-tools .user-chip, .hdr-tools .search-btn { display: inline-flex; }
  .hdr-tools .user-chip .nm, .hdr-tools .user-chip > .faint, .hdr-tools .search-btn > span, .hdr-tools .search-btn > kbd { display: none; }
}
.icon-btn.menu-btn.pmenu { display: none; }
.pside-backdrop { display: none; }
@media (max-width: 860px) {
  .icon-btn.menu-btn.pmenu { display: grid; }
  .pside { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); height: auto; overflow-y: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .pside:target { transform: none; }
  .pside:target + .pside-backdrop { display: block; position: fixed; inset: 0; z-index: 69; background: var(--ov-bg); }
}
@media (prefers-reduced-motion: reduce) { .pside { transition: none; } }
/* catalog on phones: the tool name is the card title, without a field label (UI_RND §2) */
@media (max-width: 640px) {
  .tbl.tools td.tools-name { font-size: var(--t4); }
  .tbl.tools td.tools-name::before { display: none; }
}

/* panel on phones and tablets: a wide table scrolls inside its card instead of widening the card, the column and the page;
   segmented filters wrap (UI_RND §5) */
@media (max-width: 860px) {
  .pbody .card { min-width: 0; overflow-x: auto; }
  .pbody .seg { flex-wrap: wrap; }
}

/* any long word or URL wraps instead of widening the page: site content and the panel body (UI_RND §5) */
main, .pbody { overflow-wrap: break-word; }
