/* AML-FOS, кабинет шага 2: свой слой поверх CSS прода FOS (fos-theme.css, components.css, frame.css; D-UX-25).
   Только токены --fos-*; литералы цвета — только в определении токенов риска (15 § 3.2, 54 § 10.1) ниже.
   Классы — с префиксом aml-. Атрибутов style в разметке нет: CSP style-src без unsafe-inline (67 PR-10 п. 1). */

/* ---------- шрифт Jura на своём хосте (@fontsource-variable/jura 5.3.0, OFL-1.1) ---------- */
@font-face {
  font-family: "Jura"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../vendor/fontsource-variable-jura@5.3.0/jura-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Jura"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../vendor/fontsource-variable-jura@5.3.0/jura-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Jura"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../vendor/fontsource-variable-jura@5.3.0/jura-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Jura"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../vendor/fontsource-variable-jura@5.3.0/jura-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- токены риска (предложение совета 15 § 3.2; 54 § 10.1) ---------- */
:root {
  --fos-risk-low: #0A7A4B; --fos-risk-low-soft: #E5F4EC;
  --fos-risk-medium: #806A00; --fos-risk-medium-soft: #FFF6D6;
  --fos-risk-high: #9F3600; --fos-risk-high-soft: #FFEDE3;
  --fos-risk-critical: #A3104F; --fos-risk-critical-soft: #FCE7F0;
  --fos-risk-block-fill: #A3104F;
  --aml-mono: "Jura", "Segoe UI", system-ui, sans-serif;
}
.dark {
  --fos-risk-low: #34C784; --fos-risk-low-soft: #10281E;
  --fos-risk-medium: #E2D04B; --fos-risk-medium-soft: #26230F;
  --fos-risk-high: #FF8F5A; --fos-risk-high-soft: #2E1A10;
  --fos-risk-critical: #FF6B9A; --fos-risk-critical-soft: #331424;
  --fos-risk-block-fill: #A3104F;
  color-scheme: dark;
}

/* ---------- база: слой base, ниже компонентов прода ---------- */
@layer base {
*, *::before, *::after { box-sizing: border-box; }
html {
  background-color: var(--fos-canvas);
  background-image: radial-gradient(circle at 1px 1px, var(--fos-canvas-dot) 1px, transparent 1.25px);
  background-size: 16px 16px; background-position: 7px 7px;
  scrollbar-width: thin; scrollbar-color: var(--fos-line-2) transparent;
}
body {
  margin: 0; min-height: 100vh; background: transparent; color: var(--fos-fg); font-family: var(--fos-font);
  font-size: var(--fos-text-14); line-height: var(--fos-text-14-lh); font-weight: 500; letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; font-synthesis: none;
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: transparent; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { background: transparent; border: 0; }
input:focus, select:focus, textarea:focus { outline: none; }
::selection { background: var(--fos-sel); }
:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: 1px; }
[hidden] { display: none !important; }
.fos-i { width: 20px; height: 20px; }
}

.aml-mono { font-family: var(--aml-mono); font-weight: 600; letter-spacing: .02em; word-break: break-all; }
.aml-r { text-align: right; }
.aml-skip {
  position: absolute; left: 16px; top: -48px; z-index: 100000; padding: 8px 12px; border-radius: var(--fos-radius-ctl);
  background: var(--fos-surface); border: 1px solid var(--fos-accent); color: var(--fos-accent-ink); font-weight: 700;
}
.aml-skip:focus { top: 12px; }

/* ---------- каркас ---------- */
.aml-page { display: flex; flex-direction: column; gap: var(--fos-gap-cards); padding: 16px 24px 32px; min-width: 0; outline: none; }
.aml-pg-h { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 4px 2px 0; }
.aml-pg-h h1 { font-size: var(--fos-text-24); line-height: var(--fos-text-24-lh); font-weight: 700; }
.aml-pg-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.aml-user { cursor: default; }
.aml-grid { display: grid; gap: var(--fos-gap-cards); min-width: 0; }
.aml-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aml-grid--side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.aml-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.aml-row-i { display: inline-flex; align-items: center; gap: 8px; }
.aml-stack { display: flex; flex-direction: column; gap: 12px; }
.aml-h3 { font-size: var(--fos-text-14); line-height: var(--fos-text-14-lh); font-weight: 700; margin-bottom: 8px; }
.aml-list { display: flex; flex-direction: column; gap: 6px; }
.fos-card-b { margin-top: 16px; }
.fos-tbl-wrap--box { margin: 0; border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile); }
.aml-chip-wait { color: var(--fos-wait); border-color: var(--fos-wait); }

/* ---------- страница без каркаса: вход и регистрация ключей ---------- */
.aml-bare-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 16px; }
.aml-bare-brand { display: flex; align-items: center; gap: 12px; }
.aml-bare-brand .fos-adm-ver { margin-left: 0; }
.aml-auth { width: min(440px, 100%); display: flex; flex-direction: column; gap: 16px; }
.aml-auth .fos-h-card { font-size: var(--fos-text-20); line-height: var(--fos-text-20-lh); }
.aml-auth-note { text-align: start; }
.aml-bare-foot { text-align: center; }
.aml-form { display: flex; flex-direction: column; gap: 16px; }
.aml-form--row { flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
.aml-form--row .fos-field { flex: 1 1 320px; }
.aml-form--row .fos-btn { margin-top: 29px; }
.aml-steps { display: flex; flex-direction: column; border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile); }
.aml-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.aml-step + .aml-step { border-top: 1px solid var(--fos-line); }
.aml-step > span:nth-child(2) { flex: 1; font-weight: 600; }
.aml-step-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--fos-line-2); font-weight: 700; color: var(--fos-fg-2);
}
.aml-step.is-done .aml-step-n { background: var(--fos-up-soft); border-color: var(--fos-up); color: var(--fos-up); }
.aml-copyline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.aml-copyline code { flex: 1 1 260px; padding: 8px; border-radius: var(--fos-radius-ctl); background: var(--fos-surface); border: 1px solid var(--fos-line); }

/* ---------- бейдж уровня риска: слово, число, 4 деления (WCAG 1.4.1) ---------- */
.aml-rb {
  --rb: var(--fos-fg-3); --rb-soft: var(--fos-surface-3);
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: var(--fos-radius-chip);
  background: var(--rb-soft); color: var(--rb); font-size: var(--fos-text-13); font-weight: 700; letter-spacing: var(--fos-tracking-13);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.aml-rb--low { --rb: var(--fos-risk-low); --rb-soft: var(--fos-risk-low-soft); }
.aml-rb--medium { --rb: var(--fos-risk-medium); --rb-soft: var(--fos-risk-medium-soft); }
.aml-rb--high { --rb: var(--fos-risk-high); --rb-soft: var(--fos-risk-high-soft); }
.aml-rb--critical { --rb: var(--fos-risk-critical); --rb-soft: var(--fos-risk-critical-soft); }
.aml-rb--block { --rb: var(--fos-on-accent); --rb-soft: var(--fos-risk-block-fill); }
.aml-rb--none { border: 1px dashed var(--fos-line-2); background: transparent; }
.aml-rb-bars { display: inline-flex; gap: 2px; }
.aml-rb-bars i { display: block; width: 4px; height: 12px; border-radius: 1px; background: currentColor; opacity: .22; }
.aml-rb-bars--1 i:nth-child(-n+1), .aml-rb-bars--2 i:nth-child(-n+2), .aml-rb-bars--3 i:nth-child(-n+3),
.aml-rb-bars--4 i, .aml-rb--block .aml-rb-bars i { opacity: 1; }

/* уровни для SVG и знаков */
.aml-lvl-low { --lv: var(--fos-risk-low); }
.aml-lvl-medium { --lv: var(--fos-risk-medium); }
.aml-lvl-high { --lv: var(--fos-risk-high); }
.aml-lvl-critical { --lv: var(--fos-risk-critical); }
.aml-lvl-none, .aml-lvl- { --lv: var(--fos-heat-0); }

/* ---------- знак Т П Р ---------- */
.aml-triad { width: 32px; height: 32px; flex: none; }
.aml-triad-a { fill: none; stroke: var(--lv); stroke-width: 4; stroke-linecap: round; }

/* ---------- профиль ---------- */
.aml-sum { display: flex; flex-direction: column; gap: 16px; }
.aml-sum-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.aml-sum-id { min-width: 0; flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px; }
.aml-addr { display: flex; flex-direction: column; gap: 4px; font-size: var(--fos-text-20); line-height: var(--fos-text-20-lh); font-weight: 700; }
.aml-addr-full { font-size: var(--fos-text-16); line-height: var(--fos-text-16-lh); overflow-wrap: anywhere; word-break: break-all; }
.aml-addr-name + .aml-addr-full { font-size: var(--fos-text-13); line-height: var(--fos-text-13-lh); color: var(--fos-fg-2); }
.aml-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aml-selfname { color: var(--fos-wait); }
.aml-anchors { margin: 0 -20px -20px; padding: 0 12px; border-top: 1px solid var(--fos-line); overflow-x: auto; }
.aml-anchors .fos-tab { text-decoration: none; }
.aml-kv { display: flex; flex-direction: column; margin-top: 12px; }
.aml-kv > div { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--fos-line); }
.aml-kv > div:last-child { border-bottom: 0; }
.aml-kv dt { color: var(--fos-fg-3); font-weight: 600; font-size: var(--fos-text-13); }
.aml-kv dd { min-width: 0; overflow-wrap: anywhere; }
.aml-fam { display: flex; flex-direction: column; gap: 16px; }
.aml-fam-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aml-fam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.aml-fam-b { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile); min-width: 0; }
.aml-fam-bh { display: flex; align-items: center; gap: 8px; }
.aml-fam-l {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--lv);
  font-weight: 700; font-size: var(--fos-text-12); color: var(--fos-fg);
}
.aml-bar { width: 100%; height: 10px; display: block; }
.aml-bar-t { fill: var(--fos-heat-0); }
.aml-bar-f { fill: var(--lv); }
.aml-sigs { display: flex; flex-direction: column; gap: 6px; }
.aml-sigs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.aml-facts { flex-basis: 100%; }
.aml-peers { min-width: 0; }
.aml-labels { display: flex; flex-direction: column; gap: 8px; }
.aml-label { padding: 8px 0; border-bottom: 1px solid var(--fos-line); display: flex; flex-direction: column; gap: 4px; }
.aml-label:last-child { border-bottom: 0; }
.aml-search-card { max-width: 880px; }

/* ---------- кит ---------- */
.aml-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.aml-sw { display: flex; flex-direction: column; gap: 6px; }
.aml-sw-c { display: block; height: 40px; border-radius: var(--fos-radius-tile); border: 1px solid var(--fos-line); }
.aml-sw--canvas { background: var(--fos-canvas); } .aml-sw--surface { background: var(--fos-surface); }
.aml-sw--surface-2 { background: var(--fos-surface-2); } .aml-sw--surface-3 { background: var(--fos-surface-3); }
.aml-sw--line { background: var(--fos-line); } .aml-sw--line-2 { background: var(--fos-line-2); }
.aml-sw--fg { background: var(--fos-fg); } .aml-sw--fg-2 { background: var(--fos-fg-2); } .aml-sw--fg-3 { background: var(--fos-fg-3); }
.aml-sw--accent { background: var(--fos-accent); } .aml-sw--accent-ink { background: var(--fos-accent-ink); }
.aml-sw--accent-soft { background: var(--fos-accent-soft); } .aml-sw--accent-line { background: var(--fos-accent-line); }
.aml-sw--up { background: var(--fos-up); } .aml-sw--down { background: var(--fos-down); } .aml-sw--wait { background: var(--fos-wait); }
.aml-sw--heat-0 { background: var(--fos-heat-0); } .aml-sw--heat-1 { background: var(--fos-heat-1); }
.aml-sw--heat-2 { background: var(--fos-heat-2); } .aml-sw--heat-3 { background: var(--fos-heat-3); } .aml-sw--heat-4 { background: var(--fos-heat-4); }
.aml-sw--risk-low { background: var(--fos-risk-low); } .aml-sw--risk-medium { background: var(--fos-risk-medium); }
.aml-sw--risk-high { background: var(--fos-risk-high); } .aml-sw--risk-critical { background: var(--fos-risk-critical); }
.aml-sw--risk-block-fill { background: var(--fos-risk-block-fill); }
.aml-type { display: flex; flex-direction: column; gap: 8px; }
.aml-t24 { font-size: var(--fos-text-24); line-height: var(--fos-text-24-lh); font-weight: 700; }
.aml-t20 { font-size: var(--fos-text-20); line-height: var(--fos-text-20-lh); font-weight: 700; }
.aml-glyphs { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.aml-glyph { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; text-align: center; }
.aml-glyph svg { width: 64px; height: 64px; }
.aml-g-ring { fill: none; stroke: var(--lv); }
.aml-g-low { --lv: var(--fos-risk-low); stroke-width: 1.5; }
.aml-g-medium { --lv: var(--fos-risk-medium); stroke-width: 2.5; }
.aml-g-high { --lv: var(--fos-risk-high); stroke-width: 3.5; }
.aml-g-critical { --lv: var(--fos-risk-critical); stroke-width: 4.5; }
.aml-g-none { stroke: var(--fos-fg-3); stroke-width: 1.5; stroke-dasharray: 4 3; }
.aml-g-block, .aml-g-block2 { stroke: var(--fos-risk-critical); stroke-width: 3; }
.aml-g-body { fill: var(--fos-surface); stroke: var(--fos-line-2); stroke-width: 1; }
.aml-edges { width: 240px; height: 120px; }
.aml-e { stroke: var(--fos-line-2); stroke-width: 2; }
.aml-e--risk { stroke: var(--fos-risk-high); stroke-width: 4; }
.aml-e--tent { stroke-dasharray: 6 4; }
.aml-e--ev { stroke: var(--fos-accent-line); stroke-width: 6; }
.aml-sk-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile); }
.aml-sk-1 { height: 12px; width: 45%; } .aml-sk-2 { height: 28px; width: 70%; } .aml-sk-3 { height: 32px; width: 100%; }

/* ---------- профиль: откуда риск, прокрутка таблиц, ключи учётки ---------- */
.aml-paths { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.aml-path-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* Признак прокрутки вбок: тень у края, пока за ним есть столбцы (фон local уходит вместе с содержимым). */
.aml-scrollx {
  background:
    linear-gradient(to right, var(--fos-surface) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--fos-surface) 30%, transparent) right / 32px 100% no-repeat local,
    linear-gradient(to right, var(--fos-line-2), transparent) left / 10px 100% no-repeat scroll,
    linear-gradient(to left, var(--fos-line-2), transparent) right / 10px 100% no-repeat scroll;
}
.aml-scrollx:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: 2px; }
.aml-keys-l { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
/* ---------- граф кейса (67 PR-10б; 54 § 6.1, § 7.12) ---------- */
.aml-gcase { display: flex; flex-direction: column; gap: 12px; }
.aml-gbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aml-gbar-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aml-gcount { margin-left: auto; }
.aml-gbar .fos-seg-b .fos-kbd, .aml-insp-act .fos-kbd, .aml-gbar-act .fos-kbd { margin-left: 6px; }
.aml-gwrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; min-width: 0; }
.aml-gcanvas { position: relative; min-width: 0; }
.aml-cy {
  height: clamp(420px, 62vh, 760px); border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile);
  background: var(--fos-surface); overflow: hidden;
}
.aml-cy:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: 2px; }
.aml-gstate {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; pointer-events: none;
}
.aml-gstate > * { pointer-events: auto; }
.aml-gstate-t { max-width: 420px; padding: 8px 12px; border-radius: var(--fos-radius-ctl); background: var(--fos-surface-2); color: var(--fos-fg-2); }
.aml-insp {
  min-width: 0; max-height: clamp(420px, 62vh, 760px); overflow: auto; padding: 12px; outline: none;
  border: 1px solid var(--fos-line); border-radius: var(--fos-radius-tile); background: var(--fos-surface);
}
.aml-insp:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: 2px; }
.aml-insp-b { display: flex; flex-direction: column; gap: 12px; }
.aml-insp-h { display: flex; flex-direction: column; gap: 4px; }
.aml-insp-t { font-size: var(--fos-text-16); line-height: var(--fos-text-16-lh); font-weight: 700; overflow-wrap: anywhere; }
.aml-insp-act { display: flex; flex-wrap: wrap; gap: 6px; }
.aml-trs { display: flex; flex-direction: column; gap: 8px; }
.aml-trs > li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--fos-line); }
.aml-trs-h { display: flex; justify-content: space-between; gap: 8px; }
.aml-gfoot { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.aml-gfoot > div { display: flex; gap: 6px; }
.aml-gfoot dt { color: var(--fos-fg-3); }
.aml-tip {
  position: fixed; top: 0; left: 0; z-index: 1000; max-width: 280px; padding: 6px 10px; pointer-events: none;
  border-radius: var(--fos-radius-ctl); background: var(--fos-surface); color: var(--fos-fg); border: 1px solid var(--fos-line-2);
  box-shadow: var(--fos-shadow-pop); font-size: var(--fos-text-12); line-height: var(--fos-text-12-lh);
}
.aml-tip b { display: block; overflow-wrap: anywhere; }
.aml-twin { display: flex; flex-direction: column; gap: 8px; }
.aml-twin-p { min-width: 0; outline: none; }
.aml-twin-p:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: 2px; }
.aml-vt { display: flex; flex-direction: column; min-width: 0; }
.aml-vt-h, .aml-vt-r {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) 5.5rem; gap: 8px; align-items: center;
}
[data-vt="nodes"] .aml-vt-h, [data-vt="nodes"] .aml-vt-r { grid-template-columns: minmax(0, 1.4fr) 8rem 5rem 7rem minmax(0, 1fr); column-gap: 16px; }
.aml-legend { border-top: 1px solid var(--fos-line); padding-top: 8px; }
.aml-legend > summary { cursor: pointer; font-weight: 700; color: var(--fos-fg-2); }
.aml-legend-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 20px; margin-top: 8px; }
.aml-legend-l > div { display: flex; gap: 8px; align-items: baseline; }
.aml-legend-l dt { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.aml-legend-l dd { color: var(--fos-fg-2); }
.aml-lg { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fos-fg-3); }
.aml-lg--low { border-color: var(--fos-risk-low); border-width: 1.5px; }
.aml-lg--medium { border-color: var(--fos-risk-medium); border-width: 2.5px; }
.aml-lg--high { border-color: var(--fos-risk-high); border-width: 3.5px; }
.aml-lg--critical { border-color: var(--fos-risk-critical); border-width: 5px; border-style: double; }
.aml-lg--none { border-style: dashed; border-width: 1.5px; }
.aml-vt-h { padding: 6px 8px; color: var(--fos-fg-3); border-bottom: 1px solid var(--fos-line); }
.aml-vt-b { position: relative; height: 72px; max-height: 320px; overflow: auto; contain: strict; }
.aml-vt-in { position: relative; width: 100%; }
.aml-vt-li { position: absolute; left: 0; right: 0; top: 0; height: 36px; }
.aml-vt-r {
  width: 100%; height: 100%; padding: 0 8px; text-align: left; border-bottom: 1px solid var(--fos-line);
  font-size: var(--fos-text-13); color: var(--fos-fg);
}
.aml-vt-r > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aml-vt-r:hover { background: var(--fos-surface-2); }
.aml-vt-r[aria-current="true"] { background: var(--fos-accent-soft); }
.aml-vt-r:focus-visible { outline: 2px solid var(--fos-ring); outline-offset: -2px; }
.aml-path { display: flex; flex-direction: column; gap: 6px; counter-reset: st; }
.aml-path > li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 8px; align-items: baseline; }
.aml-path > li::before { counter-increment: st; content: counter(st); font-weight: 700; color: var(--fos-fg-3); }
dialog.fos-modal { border: 0; padding: 0; color: var(--fos-fg); }
dialog.fos-modal:not([open]) { display: none; }
dialog.fos-modal::backdrop { background: var(--fos-scrim); }
.aml-keys { max-width: 560px; }
.aml-bench { display: flex; flex-direction: column; gap: 12px; }
.aml-cy--bench { height: 520px; }
.aml-bench-out { font-weight: 700; }
.aml-bench-env { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fos-fg-3); }

/* ---------- предупреждение о простое ---------- */
.aml-idle { position: fixed; right: 24px; bottom: 24px; z-index: 100001; width: min(520px, calc(100vw - 32px)); box-shadow: var(--fos-shadow-pop); }

/* ---------- адаптив: 1024 и 390 ---------- */
@media (max-width: 1100px) {
  .aml-grid--side { grid-template-columns: minmax(0, 1fr); }
  .aml-gwrap { grid-template-columns: minmax(0, 1fr); }
  .aml-insp { max-height: none; }
  .aml-fam-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .aml-grid--2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .aml-page { padding: 12px 16px 24px; }
  .aml-anchors { margin: 0 -16px -16px; }
  .aml-kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .aml-form--row .fos-btn { margin-top: 0; width: 100%; }
  /* 390: таблица-двойник — основной вид и стоит выше холста (54 § 6.1); холст ниже экрана — страница прокручивается. */
  .aml-page > .aml-pg-h, .aml-page > .fos-al { order: -2; }
  .aml-page > .aml-twin { order: -1; }
  .aml-cy { height: 45vh; min-height: 280px; }
  .aml-gcount { margin-left: 0; width: 100%; }
  .aml-vt-h, .aml-vt-r { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr) 5rem; }
  .aml-vt-h > :nth-child(5), .aml-vt-r > :nth-child(5) { display: none; }
  /* «Узлы» на 390: узел, хоп, уровень — колонку «Уровень» не прячем. */
  [data-vt="nodes"] .aml-vt-h, [data-vt="nodes"] .aml-vt-r { grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr); column-gap: 8px; }
  [data-vt="nodes"] .aml-vt-h > :nth-child(2), [data-vt="nodes"] .aml-vt-r > :nth-child(2),
  [data-vt="nodes"] .aml-vt-h > :nth-child(4), [data-vt="nodes"] .aml-vt-r > :nth-child(4) { display: none; }
  [data-vt="nodes"] .aml-vt-h > :nth-child(5), [data-vt="nodes"] .aml-vt-r > :nth-child(5) { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
