:root {
  /* Палитра в духе Threads: монохром, тонкие линии, без теней; цвет — только для статусов */
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f5; --line: #e6e6e6; --line-strong: #d0d0d0;
  --text: #000000; --text-2: #424242; --muted: #8e8e8e;
  --accent: #000000; --accent-ink: #ffffff; --accent-soft: #f2f2f2;
  --good: #1f9d55; --good-ink: #127a40; --warn: #e8a33c; --serious: #ec835a; --critical: #ff3040;
  --s1: #000000; --s2: #8e8e8e; --s3: #1f9d55; --s4: #e8a33c; --s5: #ff3040; --s6: #5b5b5b; --s7: #2f6fde; --s8: #b14ad6;
  --q0: #f2f2f2; --q1: #dcdcdc; --q2: #c2c2c2; --q3: #a3a3a3; --q4: #7a7a7a; --q5: #4d4d4d; --q6: #1f1f1f;
  --radius: 18px; --shadow: none;
  --font: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #101010; --surface: #181818; --surface-2: #262626; --line: #2d2d2d; --line-strong: #3d3d3d;
    --text: #f3f5f7; --text-2: #cfcfcf; --muted: #777777;
    --accent: #f3f5f7; --accent-ink: #000000; --accent-soft: #262626; --good-ink: #4ade80;
    --s1: #f3f5f7; --s2: #8e8e8e; --s6: #b5b5b5;
    --q0: #262626; --q1: #333333; --q2: #4a4a4a; --q3: #666666; --q4: #8a8a8a; --q5: #b5b5b5; --q6: #e6e6e6;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 0; }
p { margin: 0; }

/* каркас */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100vh; }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.brand { font-weight: 700; font-size: 15px; padding: 4px 10px 14px; display: flex; gap: 8px; align-items: center; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--text); color: var(--surface); display: grid; place-items: center; font-style: normal; font-size: 15px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .badge { margin-left: auto; }
.nav .spacer { flex: 1; }
.main { overflow-y: auto; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 28px 60px; display: grid; gap: 18px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; position: sticky; top: 0; z-index: 5; }
  .brand, .nav .spacer { display: none; }
  .nav a { white-space: nowrap; }
  .main { overflow: visible; }
  .page { padding: 16px; }
}

/* элементы */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin-right: auto; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 18px; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
.split.side { grid-template-columns: 320px minmax(0, 1fr); }
.split.editor { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); }
@media (max-width: 1000px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split, .split.side, .split.editor { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .text-2 { color: var(--text-2); }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-width: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
label.field { display: grid; gap: 5px; font-weight: 500; font-size: 13px; }
label.field .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.good { color: var(--good-ink); } .badge.critical { color: var(--critical); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.critical { background: var(--critical); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--text); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--text-2); }
.avatar.lg { width: 44px; height: 44px; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; font-size: 15px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* KPI */
.kpi { display: grid; gap: 2px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; }

/* пост в стиле Threads */
.tpost { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.tpost .body { display: grid; gap: 6px; min-width: 0; }
.tpost .who { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.tpost .who b { font-size: 14px; }
.tpost .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tpost .media { display: flex; gap: 6px; overflow-x: auto; }
.tpost .media img, .tpost .media video { height: 180px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.tpost .chain { border-left: 2px solid var(--line); margin-left: -28px; padding-left: 26px; display: grid; gap: 10px; }

/* список постов */
.plist { display: grid; }
.pitem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.pitem:last-child { border-bottom: 0; }
.pitem:hover { background: var(--surface-2); }
.pitem .txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.pitem .meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 4px; align-items: center; }
.pitem .err { color: var(--critical); font-size: 12px; margin-top: 4px; }
.thumbs { display: flex; gap: 4px; margin-top: 6px; }
.thumbs img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }

/* календарь */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 180px; display: flex; flex-direction: column; min-width: 0; }
.day.today { border-color: var(--accent); }
.day-head { padding: 8px 10px; font-weight: 600; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.day-body { padding: 6px; display: grid; gap: 5px; align-content: start; }
.slot { border-radius: 7px; padding: 5px 7px; font-size: 12px; background: var(--surface-2); cursor: pointer; border-left: 3px solid var(--acc, var(--accent)); overflow: hidden; }
.slot .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.slot .x { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
.slot.published { opacity: .65; }
.slot.failed { border-left-color: var(--critical); }
@media (max-width: 1000px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* окно */
.modal-back { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 50; display: grid; place-items: start center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: min(760px, 100%); box-shadow: 0 20px 60px rgb(0 0 0 / .3); display: grid; }
.modal.wide { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-head h2 { margin-right: auto; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.modal-foot .hint { margin-right: auto; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 10px; max-width: 380px; box-shadow: 0 6px 20px rgb(0 0 0 / .2); }
.toast.error { background: var(--critical); color: #fff; }

.counter { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.counter.over { color: var(--critical); font-weight: 600; }
.variant { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.variant textarea { min-height: 120px; }
.score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.score div { background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center; }
.score b { display: block; font-size: 20px; }

/* источники */
.items { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.item .pics { display: flex; gap: 2px; height: 150px; background: var(--surface-2); }
.item .pics img { flex: 1; min-width: 0; object-fit: cover; }
.item .in { padding: 12px; display: grid; gap: 8px; flex: 1; align-content: start; }
.item .txt { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .foot { padding: 8px 12px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }

/* графики */
.viz { position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { fill: var(--text-2); font-size: 11px; }
.viz .grid-line { stroke: var(--line); stroke-width: 1; }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 8px; font-size: 12px; z-index: 200; white-space: nowrap; box-shadow: 0 4px 12px rgb(0 0 0 / .2); }
.heat { display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--q0); }
.heat .h { text-align: center; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 14px; }
.bar .fill { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar .val { font-variant-numeric: tabular-nums; color: var(--text-2); text-align: right; font-size: 12px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); display: grid; gap: 14px; padding: 24px; }

/* ── путь: меню по этапам, полоса запуска, шаги, дела ─────────────────── */
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.nav .ico { width: 16px; text-align: center; opacity: .8; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
@media (max-width: 860px) { .nav-group { display: none; } }

.journey { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.journey:hover { text-decoration: none; filter: brightness(1.03); }
.journey-label { font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--accent); }
.journey-track { display: flex; gap: 4px; }
.journey-track i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.journey-track i.on { background: var(--accent); }
.journey-track i.cur { background: var(--accent); opacity: .45; }
@media (max-width: 600px) { .journey-track { display: none; } }

.bar-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-track div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.progress-card { display: grid; gap: 10px; }

.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; cursor: pointer; text-align: left; }
.step-head:hover { background: var(--surface-2); }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--surface-2); color: var(--text-2); }
.step.current .step-num { background: var(--accent); color: #fff; }
.step.done .step-num { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-ink); }
.step.done .step-head b { color: var(--text-2); }
.step-why { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.step-body { padding: 0 16px 16px 56px; display: grid; gap: 10px; }
.chev { color: var(--muted); }
.voice { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.voice input, .voice textarea, .voice select { background: var(--surface); }
@media (max-width: 600px) { .step-body { padding-left: 16px; } }

.setup-cta { display: flex; align-items: center; gap: 16px; color: var(--text); border-color: var(--accent); }
.setup-cta:hover { text-decoration: none; background: var(--accent-soft); }

.tasks { display: grid; gap: 6px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.task:hover { text-decoration: none; filter: brightness(.98); }
.task.critical { box-shadow: inset 3px 0 0 var(--critical); }
.task.action { box-shadow: inset 3px 0 0 var(--accent); }
.task.warn { box-shadow: inset 3px 0 0 var(--warn); }
.task .dot:not(.critical):not(.warn) { background: var(--accent); }

.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: f; }
.flow div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; position: relative; }
.flow div:not(:last-child)::after { content: "→"; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); color: var(--muted); background: var(--bg); font-size: 12px; }
.flow span { color: var(--muted); font-size: 12px; }
@media (max-width: 800px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow div::after { display: none; } }

.advice { border-color: var(--accent); }
.advice ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.next-step { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text); margin-top: 8px; }
.next-step:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.next-step b { flex: 1; }
.item .foot { flex-wrap: wrap; }
.item .foot a.small { white-space: nowrap; }
input[type=search][data-q] { min-width: 200px; }
.slot.review { border-left-style: dashed; background: none; outline: 1px dashed var(--line); }

/* ── несколько аккаунтов: переключатель, карточки ─────────────────────── */
.switcher { padding: 0 4px 10px; }
.switcher select { font-weight: 600; background: var(--surface-2); border-color: transparent; }
@media (max-width: 860px) { .switcher { padding: 0; min-width: 170px; } }
.ctx-note { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.acc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.acc-card { display: grid; gap: 12px; align-content: start; }
.acc-card.focus { border-color: var(--accent); }
.acc-facts { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; }
.acc-facts dt { color: var(--muted); }
.acc-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ── расписание ───────────────────────────────────────────────────────── */
.sched { display: grid; gap: 10px; }
.sched-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 10px; align-items: center; }
.sched-label { color: var(--muted); font-size: 13px; }
.chip.time { cursor: default; font-variant-numeric: tabular-nums; font-weight: 600; }
.chip.time button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; }
.chip.time button:hover { color: var(--critical); }
.sched-preview { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-ava { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

/* ── мастер маршрута ──────────────────────────────────────────────────── */
.wizard { display: grid; gap: 16px; }
.wz { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.wz:last-child { border-bottom: 0; padding-bottom: 0; }
.wz h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.wz-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; }
.option { display: grid; gap: 4px; padding: 12px 14px 12px 38px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; position: relative; }
.option input { position: absolute; left: 14px; top: 15px; }
.option span { color: var(--muted); font-size: 13px; }
.option.on { border-color: var(--accent); background: var(--accent-soft); }
.option.off { opacity: .6; cursor: default; }

/* ── маршруты ─────────────────────────────────────────────────────────── */
.route { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.route.off { opacity: .6; }
.route-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-src { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.route-arrow { color: var(--muted); }
.route-meta, .route-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.route-actions { display: flex; gap: 8px; align-items: center; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--line); cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ── источники ────────────────────────────────────────────────────────── */
.flow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .flow.three { grid-template-columns: 1fr; } }
.src-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.src-card { display: grid; gap: 12px; align-content: start; }
.src-ico { display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--accent-soft); color: var(--accent); }
.src-mode { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.src-stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; }
.src-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.src-stats span { font-size: 11px; color: var(--muted); }
.kind-grid { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 800px) { .kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kind { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.kind .src-ico { width: 32px; height: 32px; border-radius: 9px; }
.kind span:last-child { color: var(--muted); font-size: 12px; }
.kind.on { border-color: var(--accent); background: var(--accent-soft); }
.keybox { padding: 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }

/* ── ИИ-провайдеры ────────────────────────────────────────────────────── */
.prov-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.prov { display: grid; gap: 10px; align-content: start; }
.prov.on { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }

/* ── стиль и рост ─────────────────────────────────────────────────────── */
.chip input[type=radio][hidden] + * { pointer-events: none; }
.stage-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stage-track div { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); display: grid; font-size: 12px; color: var(--muted); }
.stage-track div b { color: var(--text-2); font-size: 13px; }
.stage-track .done { background: color-mix(in srgb, var(--good) 14%, var(--surface-2)); }
.stage-track .cur { background: var(--accent); color: #fff; }
.stage-track .cur b { color: #fff; }
.pillar input[type=number] { text-align: right; }

/* страница никогда не шире экрана: колонка сжимается, а не растягивается под содержимое */
.page { grid-template-columns: minmax(0, 1fr); }
.src-grid, .acc-grid, .prov-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.src-stats span { overflow-wrap: anywhere; }
/* вкладки на узком экране листаются внутри своего ряда, страница не уезжает вбок */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; white-space: nowrap; }

/* понятные ошибки */
.herr { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--critical) 35%, transparent);
  background: color-mix(in srgb, var(--critical) 7%, var(--surface)); font-size: 13px; }
.herr b { color: var(--critical); }
.herr.temp { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.herr.temp b { color: color-mix(in srgb, var(--warn) 55%, var(--text)); }
.herr-hint { color: var(--text); }
.herr-meta { color: var(--muted); font-size: 12px; }
.badge.warn { color: color-mix(in srgb, var(--warn) 55%, var(--text)); background: color-mix(in srgb, var(--warn) 14%, transparent); }

/* список сценариев */
.fl-card { display: grid; gap: 10px; }
.fl-card.off { opacity: .65; }
.fl-name { color: var(--text); font-size: 15px; }
.fl-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.fl-chain:hover { text-decoration: none; outline: 1px solid var(--line); }
.fl-node { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.fl-node.in { flex-wrap: wrap; gap: 4px; padding: 3px; border-style: dashed; }
.fl-node.out { font-weight: 600; border-color: var(--accent); }
.fl-node.robot span { color: var(--text-2); }
.fl-pill { padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.fl-pill i { font-style: normal; opacity: .7; }
.fl-arrow { color: var(--muted); }

/* конструктор */
.fb-head { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0; }
.fb-name { font-size: 17px; font-weight: 600; border: 1px solid transparent; background: transparent; padding: 6px 10px; border-radius: 8px; min-width: 200px; }
.fb-name:hover, .fb-name:focus { border-color: var(--line); background: var(--surface); outline: none; }
.fb-sum { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.fb-sum-ico { color: var(--accent); font-weight: 700; }
.fb-warn { flex-basis: 100%; color: var(--critical); }
.fb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 18px; align-items: start; }
.fb-chain { display: grid; gap: 0; max-width: 620px; width: 100%; justify-self: center; }
.fb-panel { position: sticky; top: 64px; display: grid; gap: 12px; max-height: calc(100vh - 90px); overflow-y: auto; }
.fb-panel h3 { font-size: 15px; }
.fb-group { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.fb-group-h { display: flex; gap: 8px; align-items: center; }
.fb-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fb-block { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; min-width: 0; }
.fb-block:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.fb-block.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fb-block.off { opacity: .55; }
.fb-block .grow { min-width: 0; }
.fb-block .small { overflow-wrap: anywhere; }
.fb-block.out { border-width: 2px; }
.fb-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); font-size: 16px; }
.fb-block.in .fb-ico { background: var(--accent-soft); color: var(--accent); }
.fb-block.out .fb-ico { background: var(--accent); color: var(--accent-ink); }
.fb-share { font-weight: 700; color: var(--accent); }
.fb-tools { display: flex; gap: 2px; }
.fb-add-in { border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 8px; color: var(--accent); cursor: pointer; }
.fb-add-in:hover { background: var(--accent-soft); }
.fb-link { display: grid; place-items: center; height: 40px; position: relative; }
.fb-link::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid var(--line); }
.fb-plus { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-size: 16px; line-height: 1; cursor: pointer; }
.fb-plus:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fb-res { margin: 6px 0 0 20px; padding: 8px 12px; border-left: 3px solid var(--good); background: var(--surface); border-radius: 0 8px 8px 0; font-size: 12.5px; }
.fb-res.drop { border-left-color: var(--warn); }
.fb-res.bad { border-left: 0; padding: 0; background: none; }
.fb-res-text { margin-top: 4px; color: var(--text-2); white-space: pre-wrap; max-height: 7.5em; overflow: hidden; }
.fb-final { margin-top: 16px; }
.fb-final .txt { white-space: pre-wrap; }
.fb-final .part { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.fb-stats { display: grid; gap: 6px; margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.fb-stats > div { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.fb-accs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fb-acc { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.fb-more { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 10px; }
.fb-more summary { cursor: pointer; font-weight: 600; }
.fb-more[open] summary { margin-bottom: 4px; }
.fb-pair { flex-wrap: nowrap; }
.fb-pair input { min-width: 0; }
.fb-fs { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; display: grid; gap: 10px; margin: 0; min-width: 0; }
.fb-fs legend { padding: 0 4px; font-weight: 600; }
.fb-img-prev { display: grid; gap: 4px; justify-items: center; padding: 8px; border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.fb-img-prev img { max-width: 100%; max-height: 260px; border-radius: 6px; }
.fb-img-prev img:not([src]) { display: none; }
.fb-logo { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.fb-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.fb-palette .kind { text-align: left; color: var(--text); }
.fb-palette a.kind:hover { text-decoration: none; }
.fb-runs { display: grid; gap: 4px; }
.fb-run summary { display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 6px 0; min-width: 0; }
.fb-run ol { margin: 4px 0 10px; padding-left: 22px; display: grid; gap: 2px; }
@media (max-width: 980px) {
  .fb { grid-template-columns: minmax(0, 1fr); }
  .fb-panel { position: static; max-height: none; }
  .fb-head { position: static; }
}
.avatar.sm { width: 20px; height: 20px; font-size: 11px; }
/* план сценария */
.fc-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.fc-acc { overflow: hidden; text-overflow: ellipsis; }
.fc-days { display: grid; grid-template-columns: repeat(14, minmax(22px, 1fr)); gap: 3px; }
.fc-day { display: grid; justify-items: center; padding: 3px 0; border-radius: 6px; font-weight: 700; font-size: 12px; background: var(--surface-2); }
.fc-day i { font-style: normal; font-weight: 500; font-size: 10px; color: var(--muted); }
.fc-day.full { background: color-mix(in srgb, var(--good) 22%, var(--surface)); }
.fc-day.part { background: color-mix(in srgb, var(--warn) 25%, var(--surface)); }
.fc-day.gap { background: color-mix(in srgb, var(--critical) 14%, var(--surface)); color: var(--critical); }
.fc-day.off { opacity: .45; }
.fc-note { font-size: 12px; white-space: nowrap; }
@media (max-width: 700px) { .fc-row { grid-template-columns: minmax(0, 1fr); } .fc-days { overflow-x: auto; } }
.fc-day.later { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.steps-mini { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pre { white-space: pre-wrap; font-family: inherit; margin: 0; background: var(--surface-2); padding: 12px; border-radius: 10px; }
.health { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text); font-size: 13px; }
.health.critical { color: var(--critical); }
/* проверка постов */
.rv { display: grid; gap: 12px; max-width: 720px; margin: 0 auto; width: 100%; }
.rv-top { display: flex; align-items: center; gap: 12px; }
.rv-count { font-weight: 700; white-space: nowrap; }
.rv-card { display: grid; gap: 12px; border-left: 4px solid var(--acc, var(--accent)); }
.rv-text { width: 100%; font-size: 15px; line-height: 1.55; resize: vertical; min-height: 140px; }
.rv-parts { display: grid; gap: 8px; }
.rv-part { border-left: 2px solid var(--line); padding-left: 10px; white-space: pre-wrap; }
.rv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rv-reasons { padding-top: 4px; }
.over { color: var(--critical); font-weight: 600; }
kbd { font: 600 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); }
@media (pointer: coarse) { .rv-keys { display: none; } }
.nav-user { padding: 6px 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 860px) { .nav-user { display: none; } }
.advice li.good::marker, .advice li.warn::marker { content: ""; }
.advice li.good { color: var(--text); } .advice li.warn { color: var(--text); }
.kind.dim { opacity: .6; }
.main-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; }
.main-wrap .main { flex: 1; }
.net-pause { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 28px; background: var(--critical); color: #fff; font-size: 13px; }
.net-pause .btn { background: #fff; color: var(--critical); border-color: #fff; }
@media (max-width: 860px) { .main-wrap { height: auto; } .net-pause { padding: 10px 16px; } }
.usage-bars { display: flex; align-items: flex-end; gap: 2px; height: 60px; padding: 4px 0; }
.usage-bars span { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-width: 3px; }
.usage-bars span.err { background: var(--warn); }
/* календарь сети */
.netcal th, .netcal td { text-align: center; padding: 6px 4px; }
.netcal th:first-child, .netcal td:first-child { text-align: left; padding-left: 12px; min-width: 130px; }
.netcal th.quiet { color: var(--critical); }
.nc { font-weight: 700; font-size: 12px; position: relative; }
.nc .muted { font-weight: 400; }
.nc.full { background: color-mix(in srgb, var(--good) 18%, transparent); }
.nc.part { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.nc.gap { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.nc.gap.later { background: transparent; color: var(--muted); }
.nc.off { color: var(--muted); opacity: .5; }
.rv-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* дашборд */
.dash-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; }
.now-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.now-grid a { display: grid; padding: 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.now-grid a:hover { text-decoration: none; outline: 1px solid var(--line); }
.now-grid b { font-size: 22px; } .now-grid b.bad { color: var(--critical); } .now-grid span { font-size: 12px; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(124px, 100%), 1fr)); gap: 10px; }
.dash-kpi { display: grid; gap: 4px; align-content: start; }
.dash-kpi .spark { width: 100%; height: 28px; margin-top: 4px; }
.kpi-foot { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trend { font-size: 12px; font-weight: 700; color: var(--muted); }
.trend.up { color: var(--good-ink); } .trend.down { color: var(--critical); }
.up { color: var(--good-ink); font-size: 11px; }
.warn-note { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); display: block; line-height: 1.6; }
.linechart { width: 100%; height: auto; display: block; overflow: visible; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .base { stroke: var(--muted); stroke-width: 1; }
.linechart .ax { fill: var(--muted); font-size: 11px; }
.linechart + .legend { margin: 4px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 10px; }
.live { display: grid; gap: 6px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.live:hover { border-color: var(--accent); }
.live-text { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live .spark { width: 100%; }
.live-nums { font-size: 12px; }
.live .badge { justify-self: start; }
.toprow { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: 0; background: none; padding: 6px 0; color: var(--text); cursor: pointer; font: inherit; border-bottom: 1px solid var(--line); min-width: 0; }
.toprow:hover { color: var(--accent); }
.toprow .rank { width: 18px; color: var(--muted); font-weight: 700; flex: none; }
.spark { display: block; }
/* динамика поста */
.modal.xwide { width: min(980px, 100%); }
.dyn { display: grid; gap: 12px; }
.dyn-post { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.dyn-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.dyn-kpi div { display: grid; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.dyn-kpi b { font-size: 18px; } .dyn-kpi span { font-size: 11px; color: var(--muted); }
.dyn-verdict { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.dyn-verdict.good { background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.dyn-verdict.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); }
.dyn-table td, .dyn-table th { white-space: nowrap; }
@media (max-width: 860px) { .dash-top { grid-template-columns: minmax(0, 1fr); } }
.page-head > .grow { flex: 1 1 min(340px, 100%); min-width: 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
/* рекомендуемость */
.reach-box:empty { display: none; }
.reach { display: grid; gap: 8px; }
.reach-head { display: flex; gap: 10px; align-items: center; }
.reach-score { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; border: 2px solid currentColor; flex: none; }
.reach-score.good { color: var(--good-ink); } .reach-score.warn { color: var(--warn); } .reach-score.bad { color: var(--critical); }
.reach-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.reach-list li { display: flex; gap: 8px; } .reach-list li.critical b { color: var(--critical); }
/* каналы Instagram / Facebook */
.section-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; }
.ch-card { display: grid; gap: 10px; }
.ch-card-prev { width: 160px; border-radius: 10px; border: 1px solid var(--line); margin-top: 6px; }
.ch-log { border-top: 1px solid var(--line); padding-top: 8px; }


/* ═══ Стиль Threads: минимализм поверх базовых правил ═══ */
body { font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 700; }
.page { gap: 20px; }
.page-head .sub, p.sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.card { border-color: var(--line); border-radius: var(--radius); box-shadow: none; padding: 18px; }
.btn { border-radius: 999px; border-color: var(--line-strong); background: transparent; font-weight: 600; padding: 8px 16px; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { filter: none; opacity: .86; background: var(--text); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--critical); }
.chip { border-color: var(--line-strong); background: transparent; font-weight: 500; }
.chip[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--bg); }
.badge { background: transparent; border: 1px solid var(--line); color: var(--text-2); font-weight: 500; }
.badge.accent { background: var(--surface-2); color: var(--text); border-color: transparent; }
.badge.good { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.badge.critical { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.badge.warn { background: transparent; border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=url], input[type=date], select, textarea {
  border-radius: 12px; border-color: var(--line-strong); background: var(--bg); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--text); outline-offset: 0; border-color: var(--text); }
label.field { font-weight: 600; }
.tabs { border-bottom-color: var(--line); gap: 4px; }
.tabs button { font-weight: 600; padding: 10px 14px; }
table.list th { font-weight: 500; }
.kpi .v { font-weight: 700; }

/* меню: тихое, монохромное; активный пункт — жирный текст */
.nav { background: var(--bg); border-right: 1px solid var(--line); padding: 18px 12px; }
.brand { font-size: 16px; letter-spacing: -.01em; }
.brand i { border-radius: 50%; }
.nav a { color: var(--muted); font-weight: 500; border-radius: 12px; padding: 9px 12px; }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: transparent; color: var(--text); font-weight: 700; }
.nav-group { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 14px 12px 4px; }
.switcher select { border-radius: 999px; }
.main { background: var(--bg); }

/* акцентные плашки — нейтральные */
.journey, .setup-cta, .fb-sum, .ctx-note { background: var(--surface-2); border-color: transparent; }
.journey { border-radius: 14px; }
.fl-pill { background: var(--surface-2); color: var(--text); }
.fl-node.out { border-color: var(--text); }
.fb-block.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.fb-block.in .fb-ico { background: var(--surface-2); color: var(--text); }
.fb-block.out .fb-ico { background: var(--text); color: var(--bg); }
.fb-plus { color: var(--text); }
.fb-plus:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.fb-add-in { color: var(--text); }
.fb-add-in:hover { background: var(--surface-2); }
.fb-share { color: var(--text); }
.option.on { border-color: var(--text) !important; box-shadow: 0 0 0 1px var(--text); }
.kind:hover { border-color: var(--text); }
.wz-n { background: var(--text) !important; color: var(--bg) !important; }
.now-grid a { background: var(--surface-2); border-radius: 14px; }
.live { border-radius: 16px; }
.live:hover { border-color: var(--text); }
.toprow:hover { color: var(--text); text-decoration: underline; }
.health { color: var(--text-2); }
.net-pause { background: var(--critical); }
.herr { border-radius: 14px; }
.dash-kpi .v { font-size: 28px; }
.trend.up { color: var(--good-ink); } .trend.down { color: var(--critical); }
.modal { border-radius: 20px; border: 1px solid var(--line); }
.modal-back { background: rgb(0 0 0 / .55); backdrop-filter: blur(2px); }
.toast { border-radius: 999px; }
.reach-score { border-width: 1.5px; }
.fc-day.full { background: color-mix(in srgb, var(--good) 16%, transparent); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
.btn, .nav a, .kind, .task, .fl-chain, .fl-name, a.badge, .now-grid a, a.health, .next-step, .journey, .setup-cta, .ch-card a.btn { text-decoration: none; }
/* длинные строки с многоточием не распирают колонки; вкладки прокручиваются, а не вылезают */
.stack { grid-template-columns: minmax(0, 1fr); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
code { overflow-wrap: anywhere; word-break: break-word; }
/* качество */
.q-list { display: grid; }
.q-row { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.q-row:last-child { border-bottom: 0; }
.q-row .reach-score { width: 36px; height: 36px; font-size: 13px; }
.ctx-post { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ctx-post:last-child { border-bottom: 0; }
.token { display: block; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 13px; user-select: all; }
.reach-fix { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); justify-items: start; }
a.chip, a.kind, a.btn { text-decoration: none; }

/* ИИ-разбор аккаунта */
.lead { font-size: 17px; line-height: 1.5; margin: 0; }
ul.tight { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.ai-op { display: block; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.ai-op:first-of-type { border-top: 0; }
.ai-op input { margin-top: 3px; }
label.ai-op { display: flex; gap: 10px; }
