/* Promo AI — рабочая консоль. Режим Operate. Тема по референсу «Админ-панель для e-commerce»:
   светлое лавандовое поле, белые карточки с мягкой тенью, синий акцент, пастельные плитки метрик. */
:root {
  --font: "Onest", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --bg: #eff0fb;          /* лавандовое рабочее поле */
  --bg-2: #e9ebf8;
  --rail: #ffffff;
  --surface: #ffffff;
  --ink: #242831;
  --ink-2: #4b5263;
  --ink-3: #687087;       /* 4.9:1 на white */
  --line: #e4e7f4;
  --line-strong: #ccd2e8;

  --accent: #3274f0;      /* действие, выбор, фокус */
  --accent-ink: #ffffff;
  --accent-soft: #e4eeff;
  --accent-text: #1f5fd8; /* текст акцента на светлом, 5.2:1 */
  --high: #d23a3e;   --high-soft: #fdecec;
  --med:  #b05c05;   --med-soft:  #fef2de;
  --ok:   #1a8654;   --ok-soft:   #e5f6ed;
  --violet: #6a4fd3; --violet-soft: #efeafd;

  --r: 10px;
  --r-lg: 14px;
  --pad: 18px;
  --shadow: 0 1px 2px rgba(36, 40, 49, .05), 0 12px 28px -10px rgba(50, 70, 160, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1120; --bg-2: #0b0e1b; --rail: #141830; --surface: #181d36;
    --ink: #eceffa; --ink-2: #b7bed6; --ink-3: #8f98b5;
    --line: #272d4a; --line-strong: #37405f;
    --accent: #6c9bff; --accent-ink: #0b1226; --accent-soft: #1f2a52; --accent-text: #8db1ff;
    --high: #ff7f82; --high-soft: #3b1f27;
    --med: #f3b45a;  --med-soft: #3a2e19;
    --ok: #62d49a;   --ok-soft: #173229;
    --violet: #b5a3ff; --violet-soft: #2a2450;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -10px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed; min-height: 100vh; color: var(--ink); font: 14px/1.5 var(--font); font-feature-settings: "tnum" 1; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 1.625rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; }
h2 { font-size: 1rem; line-height: 1.3; }
p { margin: 0; }
.mute { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- оболочка ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.rail-title { padding: 0 8px; font-size: 12px; color: var(--ink-3); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; transition: background .15s var(--ease); min-height: 34px; }
.rail-link:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.rail-link[aria-current="page"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-weight: 500; }
.rail-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { min-width: 20px; padding: 0 6px; height: 20px; border-radius: 10px; font-size: 12px; line-height: 20px; text-align: center; background: var(--high-soft); color: var(--high); font-weight: 600; }
.count.med { background: var(--med-soft); color: var(--med); }
.count.zero { background: transparent; color: var(--ink-3); font-weight: 400; }
.rail-body { display: flex; flex-direction: column; gap: 16px; flex: 1; }

.main { padding: 24px 32px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: 13px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar form { margin: 0; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease); white-space: nowrap; }
.btn:hover { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- панели ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.panel > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--line); min-height: 48px; }
.panel > header .sub { color: var(--ink-3); font-size: 13px; }
.panel .body { padding: var(--pad); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- источники ---------- */
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.src { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.src.off { color: var(--ink-3); border-style: dashed; background: transparent; }
.src.off::before { background: var(--line-strong); }
.src.err { color: var(--high); border-color: var(--high); }
.src.err::before { background: var(--high); }

/* ---------- рекомендации ---------- */
.recs { list-style: none; margin: 0; padding: 0; }
.rec { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; padding: 12px var(--pad); align-items: start; }
.rec + .rec { border-top: 1px solid var(--line); }
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding-top: 2px; color: var(--ink-3); }
.sev::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.sev.high { color: var(--high); } .sev.medium { color: var(--med); }
.rec .title { font-weight: 500; }
.rec details { margin-top: 6px; }
.rec summary { cursor: pointer; color: var(--ink-3); font-size: 13px; width: max-content; }
.rec summary:hover { color: var(--ink); }
.rec pre { margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border-radius: var(--r); font: 12px/1.5 var(--mono); overflow: auto; max-height: 280px; }
.rec .acts { display: flex; gap: 6px; }
.empty { padding: 28px var(--pad); color: var(--ink-3); display: flex; gap: 10px; align-items: flex-start; }
.empty strong { color: var(--ink); display: block; font-weight: 500; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-3); background: var(--surface); position: sticky; top: 0; white-space: nowrap; font-size: 12px; }
th.num, td.num { text-align: right; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
.cell-trunc { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ключ-значение ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--ok); } .delta-down { color: var(--high); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; padding: 0 2px; }
.bars i { flex: 1; background: var(--accent); opacity: .8; border-radius: 2px 2px 0 0; min-height: 2px; transition: opacity .15s; }
.bars i:hover { opacity: 1; }
.axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; margin-top: 6px; }

/* ---------- формы ---------- */
.form { max-width: 640px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field .hint { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
input, select, textarea { width: 100%; height: 36px; padding: 0 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); transition: border-color .15s var(--ease); }
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder { color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0; margin-bottom: 12px; text-transform: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.form-actions .btn.quiet { white-space: normal; height: auto; min-height: 34px; padding-top: 5px; padding-bottom: 5px; text-align: left; }

/* ---------- сообщения ---------- */
.notice { display: flex; gap: 10px; padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; background: var(--high-soft); color: var(--high); border: 1px solid color-mix(in srgb, var(--high) 35%, transparent); }
.notice.info { background: var(--accent-soft); color: var(--ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.notice p { color: var(--ink); }
.notice strong { display: block; }

/* ---------- чат ---------- */
.chat { display: flex; flex-direction: column; gap: 18px; padding: var(--pad); }
.msg { max-width: 72ch; }
.msg .who { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 2px; }
.msg.user .text { background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; width: fit-content; }
.msg .text { white-space: pre-wrap; }
.composer { display: flex; gap: 8px; padding: 12px var(--pad); border-top: 1px solid var(--line); }

/* ---------- очередь ---------- */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.chip.pending, .chip.proposed, .chip.approved, .chip.applying, .chip.partial, .chip.expired { background: var(--med-soft); color: var(--med); border-color: transparent; }
.chip.applied, .chip.dry_run { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.rejected, .chip.failed, .chip.blocked { background: var(--high-soft); color: var(--high); border-color: transparent; }

/* ---------- мобильная ---------- */
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; flex-direction: column; gap: 8px; }
  .rail .rail-body { display: none; }
  .rail.open .rail-body { display: flex; flex-direction: column; gap: 16px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .rail-top { display: flex; align-items: center; }
  .main { padding: 16px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .rec { grid-template-columns: 1fr; gap: 6px; }
  .rec .acts { flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; }
}
@media (min-width: 961px) { .rail-top { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- настройки ---------- */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.snav-link { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; min-height: 32px; }
.snav-link:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.dot.on { background: var(--ok); border-color: var(--ok); }
.settings-body > .panel { scroll-margin-top: 24px; }
.sec-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-intro { color: var(--ink-2); max-width: 70ch; margin-bottom: 16px; }
.settings-body .field input:not([type=checkbox]):not([type=hidden]), .settings-body .field select { max-width: 460px; }
.current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.current-val { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 4px; }
input[type=file] { height: auto; padding: 6px 8px; }
.test-result { margin-bottom: 16px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); font-size: 13px; }
.test-result[hidden] { display: none; }
.test-result.ok { background: var(--ok-soft); border-color: transparent; color: var(--ink); }
.test-result.warn { background: var(--med-soft); border-color: transparent; color: var(--ink); }
.test-result.err { background: var(--high-soft); border-color: transparent; color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 400 !important; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .15s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.rail-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 960px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .snav-link { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
}


/* ============ тема по референсу ============ */
.rail { box-shadow: 1px 0 0 var(--line), 8px 0 24px -16px rgba(50, 70, 160, .18); border-right: 0; padding: 20px 14px; }
.brand { font-size: 17px; font-weight: 650; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #4aa0ff 0%, #3a56e8 100%); box-shadow: 0 6px 14px -4px rgba(58, 86, 232, .55); }
.brand-mark .i { stroke-width: 2.2; }
.rail-link { border-radius: var(--r); padding: 8px 10px; min-height: 38px; color: var(--ink-2); }
.rail-link:hover { background: var(--accent-soft); color: var(--ink); }
.rail-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; font-weight: 600; }
.rail-title { font-weight: 600; letter-spacing: .02em; }
.count { background: var(--high-soft); }
.rail-foot { border-top: 1px solid var(--line); }

.main { padding: 28px 36px 56px; max-width: 1360px; }
.page-head { margin-bottom: 22px; }

.panel { border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel > header { border-bottom: 1px solid var(--line); min-height: 54px; padding: 14px var(--pad); }
.panel > header h2 { font-size: 1.0625rem; font-weight: 650; }
.panel .body { padding: var(--pad); }

.btn { border-radius: var(--r); height: 36px; padding: 0 14px; border-color: var(--line-strong); }
.btn.sm { height: 30px; border-radius: 8px; }
.btn.primary { background: linear-gradient(180deg, #4584f5 0%, #2f6ee8 100%); border-color: #2f6ee8; box-shadow: 0 6px 14px -6px rgba(50, 116, 240, .65); }
.btn.primary:hover { background: linear-gradient(180deg, #3f7ff3 0%, #2763dc 100%); }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--accent); border-color: var(--accent); box-shadow: none; } }
input, select, textarea { border-radius: var(--r); height: 38px; }
.chip, .src { height: 24px; padding: 0 10px; }

/* ---------- плитки метрик ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { --tone: var(--accent-text); --tone-soft: var(--accent-soft); background: color-mix(in srgb, var(--tone-soft) 55%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 14%, var(--line)); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat.green { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.stat.orange { --tone: var(--med); --tone-soft: var(--med-soft); }
.stat.red { --tone: var(--high); --tone-soft: var(--high-soft); }
.stat.violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 13px; }
.stat-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone) 14%, var(--surface)); color: var(--tone); flex: none; }
.stat-val { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: .9rem; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; min-height: 18px; }
.stat-sub .up { color: var(--ok); font-weight: 600; } .stat-sub .down { color: var(--high); font-weight: 600; }

/* ---------- график ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .area { fill: url(#area-grad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .12s; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .dot, .chart .hit:focus + .dot { opacity: 1; }
.chart-cap { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.stop-a { stop-color: var(--accent); stop-opacity: .28; } .stop-b { stop-color: var(--accent); stop-opacity: 0; }

/* ---------- мелочи ---------- */
.sev { font-weight: 600; padding: 3px 9px; border-radius: 999px; height: fit-content; background: color-mix(in srgb, currentColor 11%, var(--surface)); }
.sev::before { border-radius: 50%; width: 6px; height: 6px; }
.rec { padding: 14px var(--pad); grid-template-columns: 96px minmax(0, 1fr) auto; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
th { background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.notice { border-radius: var(--r); }
@media (max-width: 960px) { .main { padding: 16px 16px 40px; } .rec { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat-val { font-size: 1.5rem; } }

/* ---------- фильтр длинных списков ---------- */
.filter-box { margin-bottom: 6px; }
.filter-input { max-width: 460px; height: 32px; font-size: 13px; }
.filter-count { margin: 3px 0 0; }

a.src { text-decoration: none; transition: border-color .15s var(--ease), background .15s var(--ease); }
a.src:hover { border-color: var(--ink-3); background: color-mix(in srgb, var(--ink) 5%, var(--surface)); color: var(--ink); }
a.src.off:hover { border-style: solid; }

/* ---------- регионы Топвизора ---------- */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; max-height: 260px; overflow-y: auto;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 8px; min-height: 28px; color: var(--ink); font-weight: 400 !important; cursor: pointer; margin: 0 !important; }
.check input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
@media (max-width: 640px) { .checks { grid-template-columns: minmax(0, 1fr); } }

/* ---------- аккаунты Яндекса ---------- */
.acc-table { margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.acc-actions { text-align: right; white-space: nowrap; width: 1%; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.acc-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.acc-box { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.acc-box h3 { font-size: 15px; margin-bottom: 4px; }
.acc-box p { margin-bottom: 12px; }
.acc-box .field { margin-bottom: 12px; }
.acc-box .hint { margin-top: 8px; }
.acc-client { margin-top: 16px; }
.acc-client summary { cursor: pointer; color: var(--ink-2); }
.acc-client input { margin-top: 8px; font-family: var(--mono); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
code.mono { background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 960px) { .acc-add { grid-template-columns: minmax(0, 1fr); } }

/* ---------- подключение аккаунта по шагам ---------- */
.acc-steps { max-width: 560px; }
.steps { list-style: none; counter-reset: s; margin: 12px 0 16px; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 14px 34px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.steps label, .step-label { display: block; font-weight: 500; margin-bottom: 4px; }
.steps .btn { margin-bottom: 4px; }

/* ---------- баллы Директа ---------- */
.acc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.acc-toolbar form { margin: 0; }
.units { min-width: 150px; line-height: 1.35; }
.meter { height: 6px; border-radius: 3px; background: var(--line); margin: 4px 0 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.meter.low i { background: var(--med); }

/* ---------- таблица аккаунтов: ровные колонки ---------- */
.acc-table table { width: 100%; }
.acc-table th, .acc-table td { vertical-align: middle; padding: 10px 10px; }
.acc-table th { white-space: nowrap; }
.acc-table td.nw { white-space: nowrap; }
.acc-table tbody tr:last-child td { border-bottom: 0; }
.acc-table .units { min-width: 170px; }
.acc-table .chip { vertical-align: middle; }
.acc-table td br + .mute { font-size: 12px; }
.acc-toolbar-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc-hidden-note { margin: 4px 0 16px; }
#acc-list[hidden], .acc-hidden-note[hidden] { display: none; }
.acc-table td:nth-child(6) { min-width: 110px; max-width: 170px; }

/* ---------- страница «Позиции» ---------- */
.region-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.region-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 13px; }
.region-tabs a:hover { border-color: var(--ink-3); color: var(--ink); }
.region-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pos-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pos-toolbar input[type=search] { max-width: 300px; height: 32px; font-size: 13px; }
.pos-toolbar label.check { margin: 0; font-weight: 400; }
.pos-table th[data-sort] { cursor: pointer; user-select: none; }
.pos-table th[data-sort]:hover { color: var(--ink); }
.pos-table th[aria-sort="ascending"]::after { content: " ↑"; }
.pos-table th[aria-sort="descending"]::after { content: " ↓"; }
.pos-table td.phrase { max-width: 460px; overflow-wrap: anywhere; }
.pos-pos { font-weight: 600; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--ink-2); }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.tag.lost { background: var(--high-soft); color: var(--high); }

/* ---------- матрица позиций (как в Топвизоре) ---------- */
.pos-matrix-wrap { overflow: auto; max-height: 72vh; }
.pos-matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.pos-matrix th, .pos-matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; background: var(--surface); }
.pos-matrix thead th { position: sticky; top: 0; z-index: 2; padding: 8px 10px; text-align: center; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.pos-matrix thead th small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.pos-matrix .col-phrase { position: sticky; left: 0; z-index: 1; min-width: 260px; max-width: 320px; padding: 8px 12px; text-align: left; background: var(--surface); font-weight: 400; overflow-wrap: anywhere; }
.pos-matrix thead .col-phrase { z-index: 3; font-weight: 600; }
.pos-matrix td.cell { min-width: 74px; height: 40px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; position: relative; }
.pos-matrix td.cell b { font-weight: 500; font-size: 15px; }
.pos-matrix td.cell sup { font-size: 10px; font-weight: 600; margin-left: 2px; }
.pos-matrix td.cell sup.up { color: var(--ok); } .pos-matrix td.cell sup.down { color: var(--high); }
.pos-matrix td.p1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.pos-matrix td.p2 { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); }
.pos-matrix td.p3 { background: color-mix(in srgb, var(--med) 18%, var(--surface)); }
.pos-matrix td.p4 { background: color-mix(in srgb, var(--high) 16%, var(--surface)); }
.pos-matrix td.p5 { background: color-mix(in srgb, var(--high) 28%, var(--surface)); }
.pos-matrix td.p0 { color: var(--ink-3); }
.pos-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.pos-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--line); }
.pos-legend .p1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); } .pos-legend .p2 { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); }
.pos-legend .p3 { background: color-mix(in srgb, var(--med) 18%, var(--surface)); } .pos-legend .p4 { background: color-mix(in srgb, var(--high) 16%, var(--surface)); }
.pos-toolbar select { height: 32px; font-size: 13px; width: auto; }

/* ---------- группы настроек ---------- */
.settings-nav .snav-link { align-items: flex-start; padding: 8px 10px; }
.snav-text { display: flex; flex-direction: column; min-width: 0; }
.snav-title { font-weight: 500; color: var(--ink); }
.snav-meta { font-size: 12px; color: var(--ink-3); }
.snav-link[aria-current="page"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.snav-link .dot { margin-top: 5px; }
.dot.half { background: linear-gradient(90deg, var(--ok) 50%, transparent 50%); border-color: var(--ok); }
.dot.none { visibility: hidden; }
@media (max-width: 960px) { .snav-meta { display: none; } .snav-link { align-items: center; } }

/* Переключатель внутри .field: правило ".field label {display:block}" иначе перебивает inline-flex и схлопывает трек */
.field label.switch { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0; }
.switch .track { display: block; flex: none; }

/* ---------- страница клиента (/connect) ---------- */
body.public { display: grid; place-items: start center; min-height: 100vh; padding: 48px 16px; }
.public-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 28px 24px; box-shadow: 0 8px 28px rgba(40, 50, 90, .08); }
.public-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 18px; }
.public-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.public-card .lead { color: var(--ink-2); margin-bottom: 18px; }
.public-card .steps { margin-top: 4px; }
.public-card form label { display: block; font-weight: 500; margin-bottom: 4px; }
.public-more { margin-top: 18px; color: var(--ink-2); }
.public-more summary { cursor: pointer; color: var(--ink-3); }
.public-more p { margin: 8px 0 0; font-size: 13px; }
.invite-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.invite-form .field { margin: 0; min-width: 220px; }

/* ---------- форма проекта: шаги и поиск по домену ---------- */
.flow { list-style: none; margin: 0 0 8px; padding: 0; }
.flow-step { margin-bottom: 14px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head h2 { font-size: 1.0625rem; font-weight: 650; }
.step-head .step-no { margin: 0; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 650; vertical-align: 1px; }
.step-float { position: absolute; left: 0; top: 18px; }
.step-float ~ .field > label { padding-left: 30px; }
.inline-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.inline-row input { flex: 1 1 260px; width: auto; }
.src-status { font-size: 13px; color: var(--ink-3); margin: 0 0 8px; min-height: 18px; }
.src-status.ok { color: var(--ok); } .src-status.warn { color: var(--med); }
.src-status.busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -1px; }
.src-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.src-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; font-weight: 400 !important; margin: 0 !important; color: var(--ink); }
.src-opt:hover { border-color: var(--ink-3); }
.src-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.src-opt input { width: auto; height: auto; flex: none; }
.src-opt .chip { margin-left: auto; flex: none; }
.src-manual { margin-top: 4px; } .src-manual summary { cursor: pointer; color: var(--ink-3); font-size: 13px; width: max-content; }
.src-manual[open] summary { margin-bottom: 8px; }

/* ---------- переключатели в формах: радиокнопки и галочки не растягиваются на всю ширину ---------- */
.switch-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-weight: 400; cursor: pointer; }
.switch-row input { width: 16px; height: 16px; padding: 0; flex: none; accent-color: var(--accent); }
.switch-row + br { display: none; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field legend { font-weight: 500; padding: 0; margin-bottom: 6px; }
.panel .body > p { margin: 0 0 12px; }
.panel .body > form + p, .panel .body > p + form { margin-top: 4px; }

/* ---------- сноски «i» ---------- */
.i-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; outline: none; }
/* Иконка подсказки: мягкий круг цвета акцента и «i», нарисованная точкой и штрихом (одинаково чётко в любом шрифте); при наведении заливается акцентом с кольцом */
.i-ico { position: relative; width: 17px; height: 17px; box-sizing: border-box; border-radius: 50%; border: 0; font-size: 0; color: transparent; cursor: help;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent); transition: background .15s, box-shadow .15s; }
.i-ico::before, .i-ico::after { content: ""; position: absolute; left: 50%; width: 13%; transform: translateX(-50%); border-radius: 99px; background: var(--accent-text); transition: background .15s; }
.i-ico::before { top: 23%; height: 13%; }
.i-ico::after { top: 43%; height: 35%; }
h1 .i-ico, h2 .i-ico { width: 19px; height: 19px; }
.i-tip:hover .i-ico, .i-tip:focus .i-ico { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.i-tip:hover .i-ico::before, .i-tip:hover .i-ico::after, .i-tip:focus .i-ico::before, .i-tip:focus .i-ico::after { background: var(--accent-ink); }
.i-tip:focus-visible .i-ico { outline: 2px solid var(--accent); outline-offset: 2px; }
.i-pop { display: none; position: fixed; z-index: 1000; width: 340px; max-width: calc(100vw - 16px); padding: 12px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(30, 40, 80, .18); font-size: 12.5px; line-height: 1.45; text-align: left; font-weight: 400; white-space: normal; text-transform: none; letter-spacing: normal; }
.i-tip:hover .i-pop, .i-tip:focus .i-pop { display: block; }
.i-title { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.i-sec { display: block; margin-top: 6px; }
.i-sec b { display: block; color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.i-sec span { display: block; }
th .i-tip, legend .i-tip, label .i-tip, h2 .i-tip { margin-left: 5px; }

/* ---------- адаптивность широких таблиц (проверка интерфейса 2026-10-17) ---------- */
.panel { overflow-x: auto; }
.rec .mute, .rec .title { overflow-wrap: anywhere; }
.kv dd { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .page-head .toolbar { width: 100%; }
}


/* ---------- окно «Подробнее» у аккаунта Яндекса ---------- */
dialog.acc-dlg { border: 1px solid var(--line); border-radius: var(--r-lg, 14px); padding: 20px 22px; width: min(640px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(30, 40, 90, .35); }
dialog.acc-dlg::backdrop { background: rgba(20, 25, 50, .45); }
.acc-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.acc-dlg-head h3 { margin: 0; font-size: 1.125rem; }
.acc-rename { margin-bottom: 14px; }
.acc-rename label { display: block; color: var(--ink-3); font-size: 13px; margin-bottom: 4px; }
.acc-kv { margin-bottom: 4px; }
dialog.acc-dlg .test-result { margin-top: 12px; }

.acc-dlg-head { flex-wrap: wrap; }
.acc-dlg-btns { margin-left: auto; }
.acc-title-edit { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; }
.acc-title-edit input { flex: 1; min-width: 0; }
.acc-del { margin-top: 12px; padding: 12px; border: 1px solid var(--high); border-radius: var(--r); background: var(--high-soft); }
.acc-del label { display: block; margin-bottom: 8px; }
.acc-del input { flex: 1; min-width: 160px; }
.btn.danger { border-color: var(--high); color: var(--high); }
.btn.danger:not(:disabled):hover { background: var(--high); color: #fff; }

dialog.acc-dlg [hidden] { display: none !important; }

.sa-box { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.sa-email { font-family: var(--mono, monospace); word-break: break-all; }
.sa-steps { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); }
.sa-steps li { margin: 4px 0; }

/* ---- бывшие встроенные style="…": вынесены в классы, чтобы CSP не требовал 'unsafe-inline' ---- */
.st-border-top-1px-solid-var-line{border-top:1px solid var(--line)!important;}
.st-color-var-high{color:var(--high)!important;}
.st-display-flex-gap-10px-flex-wrap-wrap-59f747{display:flex!important;gap:10px!important;flex-wrap:wrap!important;align-items:end!important;margin-bottom:10px!important;}
.st-display-flex-gap-10px-flex-wrap-wrap-81e462{display:flex!important;gap:10px!important;flex-wrap:wrap!important;align-items:end!important;}
.st-display-flex-gap-8px-align-items-cen-5803b7{display:flex!important;gap:8px!important;align-items:center!important;margin:6px 0!important;}
.st-display-flex-gap-8px-align-items-cen-9660c0{display:flex!important;gap:8px!important;align-items:center!important;margin:4px 0!important;}
.st-display-flex-gap-8px-align-items-center{display:flex!important;gap:8px!important;align-items:center!important;}
.st-display-inline{display:inline!important;}
.st-flex-1{flex:1!important;}
.st-font-size-13px{font-size:13px!important;}
.st-height-8px-border-radius-4px-backgro-7a1301{height:8px!important;border-radius:4px!important;background:var(--line,#ddd)!important;overflow:hidden!important;margin-bottom:10px!important;}
.st-justify-content-flex-start{justify-content:flex-start!important;}
.st-justify-content-flex-start-margin-top-14px{justify-content:flex-start!important;margin-top:14px!important;}
.st-margin-0-0-12px{margin:0 0 12px!important;}
.st-margin-14px-0-0{margin:14px 0 0!important;}
.st-margin-bottom-16px{margin-bottom:16px!important;}
.st-margin-top-10px{margin-top:10px!important;}
.st-margin-top-12px{margin-top:12px!important;}
.st-margin-top-14px{margin-top:14px!important;}
.st-margin-top-16px{margin-top:16px!important;}
.st-margin-top-4px{margin-top:4px!important;}
.st-margin-top-6px{margin-top:6px!important;}
.st-margin-top-8px{margin-top:8px!important;}
.st-max-width-120px{max-width:120px!important;}
.st-max-width-260px{max-width:260px!important;}
.st-max-width-760px{max-width:760px!important;}
.st-opacity-5-pointer-events-none{opacity:.5!important;pointer-events:none!important;}
.st-overflow-x-auto{overflow-x:auto!important;}
.st-padding-0-16px-12px{padding:0 16px 12px!important;}
.st-padding-10px-16px{padding:10px 16px!important;}
.st-padding-12px-16px{padding:12px 16px!important;}
.st-padding-8px{padding:8px!important;}
.st-padding-8px-0{padding:8px 0!important;}
.st-padding-8px-16px{padding:8px 16px!important;}
.st-padding-8px-16px-12px{padding:8px 16px 12px!important;}
.st-padding-bottom-0{padding-bottom:0!important;}
.st-padding-top-10px{padding-top:10px!important;}
.st-position-absolute{position:absolute!important;}
.st-white-space-pre-wrap{white-space:pre-wrap!important;}
.st-white-space-pre-wrap-line-height-1-55{white-space:pre-wrap!important;line-height:1.55!important;}
.st-width-100{width:100%!important;}
.st-width-100-font-family-var-mono-monospace{width:100%!important;font-family:var(--mono, monospace)!important;}
.st-width-16px{width:16px!important;}
.st-width-70px{width:70px!important;}
.st-width-80px{width:80px!important;}
.st-width-90px{width:90px!important;}
.st-word-break-break-all{word-break:break-all!important;}
.pct-0{width:0%!important}
.pct-1{width:1%!important}
.pct-2{width:2%!important}
.pct-3{width:3%!important}
.pct-4{width:4%!important}
.pct-5{width:5%!important}
.pct-6{width:6%!important}
.pct-7{width:7%!important}
.pct-8{width:8%!important}
.pct-9{width:9%!important}
.pct-10{width:10%!important}
.pct-11{width:11%!important}
.pct-12{width:12%!important}
.pct-13{width:13%!important}
.pct-14{width:14%!important}
.pct-15{width:15%!important}
.pct-16{width:16%!important}
.pct-17{width:17%!important}
.pct-18{width:18%!important}
.pct-19{width:19%!important}
.pct-20{width:20%!important}
.pct-21{width:21%!important}
.pct-22{width:22%!important}
.pct-23{width:23%!important}
.pct-24{width:24%!important}
.pct-25{width:25%!important}
.pct-26{width:26%!important}
.pct-27{width:27%!important}
.pct-28{width:28%!important}
.pct-29{width:29%!important}
.pct-30{width:30%!important}
.pct-31{width:31%!important}
.pct-32{width:32%!important}
.pct-33{width:33%!important}
.pct-34{width:34%!important}
.pct-35{width:35%!important}
.pct-36{width:36%!important}
.pct-37{width:37%!important}
.pct-38{width:38%!important}
.pct-39{width:39%!important}
.pct-40{width:40%!important}
.pct-41{width:41%!important}
.pct-42{width:42%!important}
.pct-43{width:43%!important}
.pct-44{width:44%!important}
.pct-45{width:45%!important}
.pct-46{width:46%!important}
.pct-47{width:47%!important}
.pct-48{width:48%!important}
.pct-49{width:49%!important}
.pct-50{width:50%!important}
.pct-51{width:51%!important}
.pct-52{width:52%!important}
.pct-53{width:53%!important}
.pct-54{width:54%!important}
.pct-55{width:55%!important}
.pct-56{width:56%!important}
.pct-57{width:57%!important}
.pct-58{width:58%!important}
.pct-59{width:59%!important}
.pct-60{width:60%!important}
.pct-61{width:61%!important}
.pct-62{width:62%!important}
.pct-63{width:63%!important}
.pct-64{width:64%!important}
.pct-65{width:65%!important}
.pct-66{width:66%!important}
.pct-67{width:67%!important}
.pct-68{width:68%!important}
.pct-69{width:69%!important}
.pct-70{width:70%!important}
.pct-71{width:71%!important}
.pct-72{width:72%!important}
.pct-73{width:73%!important}
.pct-74{width:74%!important}
.pct-75{width:75%!important}
.pct-76{width:76%!important}
.pct-77{width:77%!important}
.pct-78{width:78%!important}
.pct-79{width:79%!important}
.pct-80{width:80%!important}
.pct-81{width:81%!important}
.pct-82{width:82%!important}
.pct-83{width:83%!important}
.pct-84{width:84%!important}
.pct-85{width:85%!important}
.pct-86{width:86%!important}
.pct-87{width:87%!important}
.pct-88{width:88%!important}
.pct-89{width:89%!important}
.pct-90{width:90%!important}
.pct-91{width:91%!important}
.pct-92{width:92%!important}
.pct-93{width:93%!important}
.pct-94{width:94%!important}
.pct-95{width:95%!important}
.pct-96{width:96%!important}
.pct-97{width:97%!important}
.pct-98{width:98%!important}
.pct-99{width:99%!important}
.pct-100{width:100%!important}
.bar-fill{height:100%}
.bar-ok{background:var(--ok,#2e7d32)}
.bar-warn{background:var(--warn,#e0a800)}
.bar-full{background:var(--bad,#c0392b)}
.chart-fit{max-width:100%;height:auto}
.st-font-family-monospace{font-family:monospace!important}
/* страница «Нет доступа» и монитор: прежние встроенные <style> и style= */
.mx .dot{display:inline-block;width:14px;height:14px;border-radius:50%;background:#9aa0a6;vertical-align:middle;border:0}
.mx .dot.ok{background:#2e7d32}.mx .dot.warn{background:#e0a800}.mx .dot.bad{background:#c0392b}.mx .dot.na{background:transparent;border:1.5px solid #9aa0a6}
.mx td,.mx th{text-align:center}.mx td:first-child,.mx th:first-child{text-align:left}
.denied{font-family:system-ui;padding:48px;max-width:560px}

/* ---------- ожидание данных от сервисов ---------- */
.wait-bar { margin: 0 0 14px; padding: 12px 16px 14px; background: var(--surface); border-radius: 14px; box-shadow: 0 2px 10px rgba(30, 40, 80, .06); }
.wait-track { height: 4px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; margin: 0 0 12px; position: relative; }
.wait-track i { position: absolute; inset: 0 auto 0 -40%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: wait-slide 1.15s ease-in-out infinite; }
.wait-bar.is-done .wait-track i { animation: none; inset: 0; width: 100%; background: var(--ok); opacity: .55; transition: opacity .4s; }
@keyframes wait-slide { to { left: 100%; } }
.wait-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.wait-text { font-size: 13px; color: var(--ink-2); }
.wait-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wait-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 550; background: var(--accent-soft); color: var(--accent-text); transition: background .2s, color .2s; }
.wait-ico { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .75s linear infinite; flex: none; }
.wait-chips li[data-state="ok"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.wait-chips li[data-state="err"] { background: color-mix(in srgb, var(--med) 20%, transparent); color: var(--med); }
.wait-chips li[data-state="ok"] .wait-ico, .wait-chips li[data-state="err"] .wait-ico { animation: none; border: 0; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.wait-chips li[data-state="ok"] .wait-ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.wait-chips li[data-state="err"] .wait-ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3l-6 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3l-6 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.flow-form.is-loading .flow-step:nth-child(n+3) { opacity: .45; pointer-events: none; user-select: none; filter: saturate(.6); transition: opacity .2s; }
.flow-form.is-loading > button.btn.primary, .flow-form.is-loading .form-actions .btn.primary { opacity: .55; pointer-events: none; }
.wait-card .body { text-align: center; padding: 38px 20px 30px; }
.wait-title { font-size: 1.1rem; font-weight: 650; margin: 18px 0 14px; }
.wait-card .wait-chips { justify-content: center; margin-bottom: 16px; }
.wait-orb { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.wait-orb i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); animation: spin 1.1s linear infinite; }
.wait-orb i:nth-child(2) { inset: 9px; border-top-color: color-mix(in srgb, var(--accent) 60%, transparent); animation-duration: 1.6s; animation-direction: reverse; }
.wait-orb i:nth-child(3) { inset: 19px; border-top-color: color-mix(in srgb, var(--accent) 35%, transparent); animation-duration: 2.2s; }
@media (prefers-reduced-motion: reduce) { .wait-track i, .wait-ico, .wait-orb i { animation-duration: 3s; } }
