/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[15].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[15].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* ============ LABA Post — Design Tokens (ported from Claude Design) ============ */
@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');

:root {
  --font: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --accent: #6366F1;
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-press: color-mix(in srgb, var(--accent) 74%, #000);
  --on-accent: #FFFFFF;

  --tg: #229ED9;
  --vk: #0077FF;
  --dzen: #FF6600;
  --max: #7C3AED;
  --vcru: #F2402F;

  --ok: #34D399;
  --warn: #FB923C;
  --danger: #F87171;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.18);
  --shadow: 0 8px 28px rgba(0,0,0,.28);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.40);
}

/* ---- Dark (default) ---- */
[data-theme="dark"] {
  /* Гарантирует тёмную отрисовку нативных контролов (попап <option>,
     date/time-пикеры, скроллбары) во всём поддереве темы. */
  color-scheme: dark;
  --bg-base: #0E0E10;
  --surface: #161619;
  --surface-2: #1B1B1F;
  --elevated: #232328;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.15);
  --text-primary: #F3F3F4;
  --text-secondary: #A2A2AB;
  --text-tertiary: #6A6A73;
  --accent-subtle: color-mix(in srgb, var(--accent) 17%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 68%, #fff);
  --scrim: rgba(0,0,0,.55);
  --stripe: rgba(255,255,255,.045);
  --stripe-2: rgba(255,255,255,.025);
}

/* ---- Light ---- */
[data-theme="light"] {
  color-scheme: light;
  --bg-base: #F6F6F7;
  --surface: #FFFFFF;
  --surface-2: #FBFBFC;
  --elevated: #EFEFF1;
  --border: rgba(9,9,11,.09);
  --border-strong: rgba(9,9,11,.16);
  --text-primary: #18181B;
  --text-secondary: #56565F;
  --text-tertiary: #9B9BA4;
  --accent-subtle: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 90%, #000);
  --scrim: rgba(20,20,25,.32);
  --stripe: rgba(9,9,11,.05);
  --stripe-2: rgba(9,9,11,.025);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
.no-sb::-webkit-scrollbar { display: none; }
.no-sb { scrollbar-width: none; }

html, body { height: 100%; }
body { margin: 0; font-family: var(--font); }

/* App surface — anchor height to the viewport directly (dvh) so the menu's
   height never depends on the html/body/% percolation chain resolving. */
.laba {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* generic helpers */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap1 { gap: 4px; } .gap2 { gap: 8px; } .gap3 { gap: 12px; } .gap4 { gap: 16px; }
.spread { justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.flex1 { flex: 1 1; min-width: 0; }
.clip1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-tertiary); }

/* ---------- components ---------- */
.btn {
  font-family: var(--font); font-weight: 540; font-size: 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .08s;
  white-space: nowrap; line-height: 1; letter-spacing: -.01em;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--elevated); color: var(--text-primary); }
.btn-soft { background: var(--elevated); color: var(--text-primary); }
.btn-soft:hover { background: var(--border-strong); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--elevated); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-md { height: 40px; padding: 0 16px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; color: var(--text-secondary);
  border-radius: var(--radius-sm); transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--elevated); color: var(--text-primary); }
.iconbtn:active { transform: scale(.94); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Тарифные карточки (админка: Подписки и выручка) */
.plan-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-tile:active { cursor: grabbing; }
.plan-tile .plan-tile-edit,
.plan-tile .plan-tile-grip { opacity: 0; transition: opacity .15s; }
.plan-tile:hover .plan-tile-edit,
.plan-tile:hover .plan-tile-grip { opacity: 1; }
.add-tile:hover { border-color: var(--accent); color: var(--accent-text); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.add-tile:active { transform: scale(.99); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 99px; font-size: 11.5px; font-weight: 540; letter-spacing: -.01em;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 99px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  white-space: nowrap; transition: all .15s;
}
.pill:hover { background: var(--elevated); color: var(--text-primary); }
.pill.on { background: var(--accent-subtle); border-color: transparent; color: var(--accent-text); font-weight: 560; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--elevated); border-radius: 11px; }
.seg button {
  border: none; background: transparent; cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 520; color: var(--text-secondary); padding: 7px 14px;
  border-radius: 8px; transition: all .15s; letter-spacing: -.01em;
}
.seg button.on { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.stripe-l { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px; }

.divider { height: 1px; background: var(--border); }
.sectionlabel { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }

.avatar { border-radius: 50%; background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 600; flex: none; }

input.field, textarea.field, select.field {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
input.field::placeholder, textarea.field::placeholder { color: var(--text-tertiary); }
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* Нативный <select>: рисуем фон, стрелку-шеврон и убираем дефолтную стрелку ОС,
   чтобы контрол был виден на тёмной теме. */
select.field {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

/* Подстраховка для браузеров, не темнящих попап через color-scheme (напр. Firefox). */
select option, select optgroup {
  background: var(--surface); color: var(--text-primary); }

/* ---------- Select (тематический Headless UI Listbox, замена нативного <select>) ---------- */
.lc-select {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.lc-select:hover:not(:disabled) { border-color: var(--border-strong); }
.lc-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.lc-select[data-open] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); background: var(--surface); }
.lc-select:disabled { opacity: .55; cursor: not-allowed; }
.lc-select-val { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lc-select-val[data-empty] { color: var(--text-tertiary); }
.lc-select-chev { display: inline-flex; color: var(--text-tertiary); flex: none; transition: transform .2s cubic-bezier(.32,.72,0,1); }

.lc-pop {
  display: flex; flex-direction: column; gap: 1px; padding: 5px;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--elevated); box-shadow: var(--shadow-lg);
  /* Портал на <body>: попап — сосед оверлея модалки. Оверлеи доходят до ~460 (тост),
     модалки с Select — до 410 (CreateTemplateModal). Держим список заведомо ВЫШЕ всех,
     иначе он уходит ПОД модалку. */
  z-index: 500; }
.lc-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.lc-opt-bg { position: absolute; inset: 0; border-radius: 8px; pointer-events: none; transition: background .12s ease; }
.lc-opt-lbl { position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lc-opt[data-selected] { font-weight: 600; }

/* ---------- sheets / overlays ---------- */
.scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  z-index: 40; animation: labaFadeIn .2s ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface);
  border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  animation: labaSheetUp .32s cubic-bezier(.32,.72,0,1); display: flex; flex-direction: column;
  max-height: 88%; }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong);
  margin: 10px auto 4px; flex: none; }

/* ---------- calendar ---------- */
.cal-cell { position: relative; transition: background .14s, border-color .14s; }
.cal-add { opacity: 0; transition: opacity .14s; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-chip { transition: transform .1s, box-shadow .14s, opacity .14s; }
.cal-chip:hover { background: var(--elevated); }
.cal-chip:active { cursor: grabbing; }
.cal-chip.dragging { opacity: .4; }
.cal-drop { background: var(--accent-subtle) !important; border-color: var(--accent) !important; box-shadow: inset 0 0 0 1px var(--accent); }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; }
.nowline::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.gridline { border-top: 1px solid var(--border); }

/* ---------- channel · «Основное» — centered single column (как «Стиль») ---------- */
.bt-wrap  { width: 100%; max-width: 880px; margin: 0 auto; }
.bt-id2   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.bt-types-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bt-rules-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; align-items: stretch; }
.bt-seg   { grid-column: span 6; }
.bt-tog-1, .bt-tog-2, .bt-tog-3 { grid-column: span 4; }

/* md 768–1023: карточки типов в 2 колонки, сегменты на всю ширину */
@media (max-width: 1023px) {
  .bt-types-grid { grid-template-columns: repeat(2, 1fr); }
  .bt-seg { grid-column: span 12; }
  .bt-tog-1, .bt-tog-2 { grid-column: span 6; }
  .bt-tog-3 { grid-column: span 12; }
}
/* sm <768: всё в одну колонку */
@media (max-width: 767px) {
  .bt-types-grid { grid-template-columns: 1fr; }
  .bt-id2 { grid-template-columns: 1fr; }
  .bt-tog-1, .bt-tog-2, .bt-tog-3 { grid-column: span 12; }
}

/* ---------- channel · «Стиль и рубрики» ---------- */
.bt-field-lbl { font-size: 12px; font-weight: 540; color: var(--text-tertiary); }
/* legacy sp-* kept for compat */
.sp-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; align-items: stretch; }
.sp-full { grid-column: span 12; }
.sp-sub3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.sp-sub2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }

/* single-column, calmer layout (sub-grids reused inside panels) */
.st-sub3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.st-sub2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: start; }
.st-fmt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 1023px) {
  .st-sub3 { grid-template-columns: repeat(2, 1fr); }
  .sp-sub3 { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .sp-grid { gap: 14px; } .sp-sub2 { grid-template-columns: 1fr; }
  .st-sub3, .st-sub2 { grid-template-columns: 1fr; }
  .st-fmt-grid { grid-template-columns: repeat(2, 1fr); }
}

/* redesigned «Стиль и рубрики» — centered single column (Claude Design handoff) */
.st-wrap   { width: 100%; max-width: 880px; margin: 0 auto; }
.st-ef     { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
.st-fmt2   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.st-aud2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.st-brand2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.st-rub    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* ghost-инпуты в карточке рубрики: подложка-акцент по фокусу */
.st-ghost  { transition: background .15s; }
.st-ghost:focus { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; }
@media (max-width: 680px) {
  .st-ef, .st-aud2, .st-brand2, .st-rub, .st-fmt2 { grid-template-columns: 1fr; }
}

/* ---------- channel · «Аналитика» (centered single column, like «Стиль») ---------- */
.an-wrap  { width: 100%; max-width: 880px; margin: 0 auto; container-type: inline-size; }
.an-kpi   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.an-sub2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
@container (max-width: 720px) { .an-kpi { grid-template-columns: repeat(2, 1fr); } }
@container (max-width: 600px) { .an-sub2 { grid-template-columns: 1fr; } }
@container (max-width: 420px) { .an-kpi { grid-template-columns: 1fr; } }
/* лёгкая под-карточка внутри панели (на тон светлее самой панели) */
.an-subcard { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 13px;
              background: var(--surface); border: 1px solid var(--border); min-width: 0; }
/* строка рекомендованного слота — подсветка по наведению */
.an-slot { transition: background .15s, border-color .15s, transform .12s; }
.an-slot:hover { border-color: var(--border-strong); background: var(--elevated); }

/* ---------- channel · «Рубрики» (master-detail) ---------- */
.rb-wrap   { width: 100%; max-width: 1060px; margin: 0 auto; }
.rb-split  { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.rb-list   { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 4px; }
.rb-card   { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 18px;
             background: var(--surface-2); border: 1px solid var(--border); }
.rb-seg3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.rb-grid2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rb-note   { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-tertiary); }
.rb-hint   { margin-left: auto; font-size: 11.5px; color: var(--text-tertiary); }
.rb-lbl    { font-size: 12px; font-weight: 540; color: var(--text-tertiary); }

.rb-rowitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
              border-radius: 11px; cursor: pointer; font-family: var(--font);
              transition: background .15s, border-color .15s; }
.rb-rowitem:hover { border-color: var(--border-strong); }

.rb-add { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
          height: 38px; border: 1px dashed var(--border-strong); border-radius: 11px; background: transparent;
          color: var(--text-secondary); font-family: var(--font); font-weight: 540; font-size: 13px; cursor: pointer;
          transition: background .15s, border-color .15s, color .15s; }
.rb-add:hover { border-color: var(--accent); color: var(--text-primary); background: color-mix(in srgb, var(--accent) 6%, transparent); }

.rb-emoji { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
            flex: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
            font-size: 26px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.rb-emoji:hover { border-color: var(--border-strong); }
.rb-emoji:active { transform: scale(.95); }

.rb-ghost { border: none; background: transparent; outline: none; width: 100%; padding: 2px 4px;
            font-family: var(--font); transition: background .15s; }
.rb-ghost:focus { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; }

.rb-sug { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px;
          background: var(--surface); border: 1px dashed var(--border-strong); font-size: 12px;
          color: var(--text-secondary); cursor: pointer; font-family: var(--font); transition: background .15s, border-color .15s, color .15s; }
.rb-sug:hover { border-color: var(--accent); color: var(--text-primary); }

.rb-savebar { position: sticky; bottom: 0; margin-top: 8px; padding: 12px 0; display: flex;
              justify-content: center; z-index: 30; pointer-events: none; }
.rb-savebar-inner { pointer-events: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                    padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent);
                    border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

@media (max-width: 760px) {
  .rb-split { grid-template-columns: 1fr; }
  .rb-list  { position: static; }
  .rb-seg3  { grid-template-columns: 1fr; }
  .rb-grid2 { grid-template-columns: 1fr; }
}

/* «Что собрал ИИ» — отпечаток слога рубрики (read-only витрина синтеза) */
.rb-fp        { overflow: hidden; }
.rb-fp-badge  { margin-left: auto; display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px;
                background: var(--accent-subtle); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
                font-size: 11px; font-weight: 560; color: var(--accent-text); white-space: nowrap; }
.rb-fp-voice  { display: flex; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--surface); }
.rb-fp-voice-q{ flex: none; margin-top: 2px; color: var(--accent-text); opacity: .85; }
.rb-fp-voice p{ margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-primary); max-width: 68ch; }
.rb-fp-meta   { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 2px 0; }
.rb-fp-fact   { display: flex; flex-direction: column; gap: 2px; }
.rb-fp-fact b { font-size: 13px; font-weight: 580; color: var(--text-primary); }
.rb-fp-group  { display: flex; flex-direction: column; gap: 8px; }
.rb-fp-head   { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 560; color: var(--text-secondary); }
.rb-fp-head svg { color: var(--accent-text); }
.rb-fp-text   { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-secondary); max-width: 70ch; }
.rb-fp-chips  { display: flex; flex-wrap: wrap; gap: 7px; }
.rb-fp-chip   { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 9px; font-size: 12.5px;
                line-height: 1.15; background: var(--accent-subtle); color: var(--text-primary);
                border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.rb-fp-chip.muted { background: var(--surface); color: var(--text-secondary); border-color: var(--border-strong); }
.rb-fp-chip.avoid { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--text-secondary);
                    border-color: color-mix(in srgb, var(--danger) 26%, transparent);
                    text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.rb-fp-lines  { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rb-fp-lines li { position: relative; padding-left: 16px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); max-width: 70ch; }
.rb-fp-lines li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 4px; height: 4px; border-radius: 50%;
                          background: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.rb-fp-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 4px; background: none;
                border: none; cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 560;
                color: var(--text-secondary); transition: color .15s; }
.rb-fp-toggle:hover { color: var(--text-primary); }
.rb-fp-chev   { color: var(--text-tertiary); transition: transform .2s ease; }
.rb-fp-craft  { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-top: 8px; border-radius: 11px; background: var(--surface); }
.rb-fp-craftrow { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.rb-fp-skel   { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 480px) {
  .rb-fp-craftrow { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- channel · «Брендбук» (single column, как «Стиль»: max-width 880) ---------- */
.bb-roles   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bb-styles  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bb-formats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.bb-refs    { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.bb-brand-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bb-pv2     { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 680px) {
  .bb-roles   { grid-template-columns: repeat(2, 1fr); }
  .bb-styles  { grid-template-columns: repeat(2, 1fr); }
  .bb-formats { grid-template-columns: repeat(3, 1fr); }
  .bb-refs    { grid-template-columns: repeat(3, 1fr); }
  .bb-brand-row, .bb-pv2 { grid-template-columns: 1fr; }
}

/* ---------- channel · «Запреты» (single centered column, mirrors «Стиль») ---------- */
.rn-grid    { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rn-editor  { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rn-preview { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rn-rules   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 980px) {
  .rn-rules { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .rn-grid, .rn-editor, .rn-preview { gap: 14px; }
  .rn-addbar { grid-template-columns: 1fr !important; }
}
/* строгость: трек заливается accent до позиции ползунка (--p) */
input[type=range].rn-range { appearance: none; width: 100%; height: 5px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--p, 50%), color-mix(in srgb, var(--text-primary) 12%, transparent) var(--p, 50%)); }
input[type=range].rn-range::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface-2); border: 3px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer; }
input[type=range].rn-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-2); border: 3px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer; }
input[type=range].rn-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-subtle); }
/* подсветка нарушителей в живом превью */
.rn-vio { border-radius: 4px; padding: 0 2px; transition: background .18s, color .18s; }
.rn-raw .rn-vio.hl { background: color-mix(in srgb, var(--danger) 22%, transparent); color: #ffb3b6; text-decoration: line-through; text-decoration-color: var(--danger); }
.rn-res .rn-vio.hl { display: none; }

/* energy/tempo slider — gradient-fill track (--p = thumb position %) */
input[type=range].laba-range { appearance: none; height: 5px; border-radius: 6px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--p, 50%), color-mix(in srgb, var(--text-primary) 12%, transparent) var(--p, 50%)); }
input[type=range].laba-range::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
input[type=range].laba-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface-2); border: 3px solid var(--accent); cursor: pointer; border-collapse: initial; }
input[type=range].laba-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-subtle); }

/* keyframes used by agent + flyout + sheets */
@keyframes labaGrowL { from { opacity:0; transform: scale(.9) } to { opacity:1; transform: scale(1) } }
@keyframes labaPop { from { opacity:0; transform: scale(.96) translateY(6px) } to { opacity:1; transform: scale(1) translateY(0) } }
@keyframes labaMsgIn { from { opacity:0; transform: translateY(10px) } to { opacity:1; transform: translateY(0) } }
@keyframes labaBlink { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes labaWaitIn { from { opacity:0; transform: translateY(4px) } to { opacity:1; transform: translateY(0) } }
@keyframes labaFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@keyframes labaOrbHalo { 0%,100% { opacity:.5; transform: scale(1) } 50% { opacity:.92; transform: scale(1.12) } }
@keyframes labaFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes labaSwitchIn { from { opacity: 0; transform: translateY(-5px) scale(.98) } to { opacity: 1; transform: translateY(0) scale(1) } }
@keyframes labaSheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes labaSpin { from { transform: rotate(0) } to { transform: rotate(360deg) } }

/* Меню аккаунта (подвал сайдбара): мягкое появление вверх от карточки,
   уход — обратно. transition-проп Headless UI выставляет data-closed. */
.acct-menu { transition: opacity .19s ease, transform .22s cubic-bezier(.32,.72,0,1); will-change: opacity, transform; }
.acct-menu[data-closed] { opacity: 0; transform: scale(.97) translateY(6px); }
.acct-menu--side[data-closed] { transform: scale(.97) translateX(-6px); }
@media (prefers-reduced-motion: reduce) {
  .acct-menu { transition: opacity .12s ease; }
  .acct-menu[data-closed] { transform: none; }
}

/* Image generation animation keyframes */
@keyframes labaImgGenGrad {
  0%   { background-position: 0%   0%; }
  25%  { background-position: 100% 0%; }
  50%  { background-position: 100% 100%; }
  75%  { background-position: 0%   100%; }
  100% { background-position: 0%   0%; }
}
/* GPU-composited glow: filter:drop-shadow не вызывает repaint, интерполируется плавно */
@keyframes labaImgGenGlow {
  0%, 100% { filter: brightness(.86) drop-shadow(0 0 10px rgba(42,171,238,.38)) drop-shadow(0 0 26px rgba(42,171,238,.16)) drop-shadow(0 0  6px rgba(83,52,131,.22)); }
  50%       { filter: brightness(1.08) drop-shadow(0 0 28px rgba(42,171,238,.80)) drop-shadow(0 0 58px rgba(42,171,238,.42)) drop-shadow(0 0 38px rgba(83,52,131,.52)); }
}
@keyframes labaImgGenScan {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(380%); opacity: 0; }
}

/* ---------- agent canvas (AI-summoned right panel) ---------- */
@keyframes labaPanelIn { from { transform: translateX(102%) } to { transform: translateX(0) } }
@keyframes labaPanelOut { from { transform: translateX(0) } to { transform: translateX(102%) } }
@keyframes labaShimmer { 100% { background-position: -160% 0 } }
@keyframes labaRise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }
.laba-skel {
  border-radius: 7px;
  background: linear-gradient(100deg, var(--elevated) 30%, color-mix(in srgb, var(--accent) 16%, var(--elevated)) 50%, var(--elevated) 70%);
  background-size: 220% 100%;
  animation: labaShimmer 1.25s linear infinite;
}
.laba-canvas-rise > * { animation: labaRise .42s cubic-bezier(.32,.72,0,1) both; }
.laba-canvas-rise > *:nth-child(2) { animation-delay: .05s; }
.laba-canvas-rise > *:nth-child(3) { animation-delay: .1s; }
.laba-canvas-rise > *:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .laba-skel { animation: none; }
  .laba-canvas-rise > * { animation: none; }
}

/* ---------- ImageManager (холст агента): генерация изображения ---------- */
@keyframes labaSheen { 0% { transform: translateX(-130%) skewX(-12deg) } 55%,100% { transform: translateX(260%) skewX(-12deg) } }
@keyframes labaPulseRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent) } 70%,100% { box-shadow: 0 0 0 7px transparent } }

/* Первичная CTA «Создать изображение»: лифт, мягкое свечение, бегущий блик */
.im-cta { position: relative; overflow: hidden; isolation: isolate;
  transition: transform .16s cubic-bezier(.32,.72,0,1), box-shadow .2s ease, filter .2s ease, opacity .15s ease; }
.im-cta:not(:disabled):hover { transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.im-cta:not(:disabled):active { transform: translateY(0) scale(.985); }
.im-cta::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; z-index: 0;
  width: 42%; pointer-events: none; transform: translateX(-130%) skewX(-12deg);
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.34), transparent); }
.im-cta:not(:disabled):hover::after { animation: labaSheen 1.05s cubic-bezier(.32,.72,0,1); }
.im-cta > * { position: relative; z-index: 1; }

/* Появление чипа-вложения и подсветка поля промпта при клике по рамке */
.im-attach-in { animation: labaPop .22s cubic-bezier(.32,.72,0,1) both; }
.im-prompt-flash { animation: labaPulseRing 1s ease; }

/* Рамка «Редактировать изображение» поверх превью */
.im-frame { opacity: 0; transition: opacity .18s ease; }
.im-frame-wrap:hover .im-frame { opacity: 1; }

/* Кнопка генерации: квадратная стоп-кнопка плавно «отливается» при генерации.
   Ширина/отступ освобождают место (layout), а scale+opacity дают органичное появление
   (GPU-композит → без рывков). will-change держит слой на композиторе. */
.im-liquid-anim {
  will-change: width, transform, opacity;
  transition:
    width .4s cubic-bezier(.45,0,.2,1),
    margin-left .4s cubic-bezier(.45,0,.2,1),
    transform .44s cubic-bezier(.34,1.26,.5,1),
    opacity .24s ease;
}
@media (prefers-reduced-motion: reduce) {
  .im-liquid-anim { transition: width .15s ease, margin-left .15s ease, opacity .12s ease; transform: none !important; }
}

/* Выпадающий список формата кадра (открывается вверх от триггера) */
.im-aspect-menu { animation: labaPop .16s cubic-bezier(.32,.72,0,1); transform-origin: bottom left; }
.im-aspect-row { transition: background .14s ease; }
.im-aspect-row:hover { background: var(--elevated); }

@media (prefers-reduced-motion: reduce) {
  .im-cta, .im-cta:not(:disabled):hover, .im-cta:not(:disabled):active { transform: none; }
  .im-cta::after { display: none; }
  .im-attach-in, .im-prompt-flash, .im-aspect-menu { animation: none; }
  .im-frame { transition: none; }
}

/* ---------- ImageManager: медиа-трей (лента миниатюр альбома) ---------- */
.im-tray-thumb {
  transition: border-color .15s ease, transform .16s cubic-bezier(.32,.72,0,1), box-shadow .18s ease, opacity .15s ease;
  animation: labaPop .24s cubic-bezier(.32,.72,0,1) both;
}
.im-tray-thumb:hover { transform: translateY(-2px); }
.im-tray-thumb.im-tray-dragging { opacity: .45; transform: scale(.96); }
.im-tray-thumb.im-tray-dragover { box-shadow: 0 0 0 2px var(--accent) inset; }
.im-tray-check {
  transition: background .14s ease, border-color .14s ease, transform .12s cubic-bezier(.34,1.26,.5,1);
}
.im-tray-check.checked { transform: scale(1.06); }
.im-tray-hover-actions { opacity: 0; transition: opacity .15s ease; }
.im-tray-thumb:hover .im-tray-hover-actions,
.im-tray-thumb:focus-within .im-tray-hover-actions { opacity: 1; }
.im-tray-hint { animation: labaPop .2s cubic-bezier(.32,.72,0,1) both; }
@media (prefers-reduced-motion: reduce) {
  .im-tray-thumb { animation: none; transition: border-color .1s ease, box-shadow .1s ease, opacity .1s ease; }
  .im-tray-thumb:hover { transform: none; }
  .im-tray-check { transition: none; }
  .im-tray-check.checked { transform: none; }
  .im-tray-hover-actions { transition: none; }
  .im-tray-hint { animation: none; }
}
@media (hover: none) {
  /* Тач-устройства: hover недоступен — кнопки действий тайла видны всегда. */
  .im-tray-hover-actions { opacity: 1; }
}

/* ---------- PostEditor (холст «+» календаря): двухпанельная модалка ---------- */
@keyframes labaScrimIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes labaPanelPop { from { opacity: 0; transform: scale(.975) translateY(10px) } to { opacity: 1; transform: scale(1) translateY(0) } }
@keyframes labaBadgeSheen { 0% { transform: translateX(-130%) skewX(-14deg) } 60%,100% { transform: translateX(260%) skewX(-14deg) } }
@keyframes labaOrbDrift { 0%,100% { transform: translateY(0) rotate(0deg) } 50% { transform: translateY(-9px) rotate(4deg) } }
@keyframes labaDotPulse { 0%,100% { opacity: .45; transform: scale(.8) } 50% { opacity: 1; transform: scale(1) } }

/* Без fill-mode `both`: на скрытой вкладке/в headless-рендере CSS-анимации стоят на кадре
   `from` — с `both` это оставило бы панель/скрим невидимыми (opacity:0). Их «естественное»
   состояние — конечное (видимое); анимация лишь добавляет вход на активной вкладке. */
.pe-scrim { position: fixed; inset: 0; background: rgba(6,6,9,.62); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  animation: labaScrimIn .2s ease; }
.pe-panel { position: relative; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: labaPanelPop .34s cubic-bezier(.32,.72,0,1); }

/* Заголовок: иконка-плитка с фирменным градиентом и пробегающим бликом */
.pe-badge { position: relative; overflow: hidden; isolation: isolate; width: 34px; height: 34px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; color: #fff; flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #B07CFF));
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 75%, transparent), inset 0 1px 0 rgba(255,255,255,.28); }
.pe-badge::after { content: ""; position: absolute; inset: 0; z-index: 1; width: 50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-130%) skewX(-14deg); animation: labaBadgeSheen 3.6s ease-in-out 1s infinite; }
.pe-badge > svg { position: relative; z-index: 2; }

/* Карточка генерации — единственная «committed»-поверхность модалки */
.pe-ai-card { position: relative; overflow: hidden; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  background:
    radial-gradient(130% 120% at 100% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 58%),
    var(--surface-2);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 12%, transparent) inset; }

.pe-textarea { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-base); color: var(--text-primary); font-family: var(--font); font-size: 14px;
  line-height: 1.45; resize: vertical; outline: none; transition: border-color .15s, box-shadow .15s; }
.pe-textarea::placeholder { color: var(--text-tertiary); }
.pe-textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px var(--accent-subtle); }

.pe-field { width: 100%; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-base); color: var(--text-primary); font-family: var(--font); font-size: 14px;
  color-scheme: dark; outline: none; transition: border-color .15s, box-shadow .15s; }
.pe-field:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* Правая колонка — «чат»-подложка, чтобы превью читалось как лента Telegram */
.pe-canvas-bg { background:
  radial-gradient(90% 55% at 50% -6%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 72%),
  var(--bg-base); }

/* Живой индикатор готовности в шапке превью */
.pe-live-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); animation: labaDotPulse 1.8s ease-in-out infinite; }

/* Пустое состояние холста — парящая фирменная плитка */
.pe-empty-orb { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  color: var(--accent-text); animation: labaOrbDrift 5s ease-in-out infinite;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--accent) 26%, transparent), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--accent) 60%, transparent); }

/* Раскрытие настроек картинки под тумблером «Картинка к посту» */
@keyframes labeImgReveal { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: translateY(0) } }
.pe-img-reveal { animation: labeImgReveal .26s cubic-bezier(.32,.72,0,1); }

/* Выпадашка Listbox (Headless UI v2 transition prop, data-closed) — появление/уход от верха */
.pe-pop { transition: opacity .18s ease, transform .2s cubic-bezier(.32,.72,0,1); transform-origin: top center; will-change: opacity, transform; }
.pe-pop[data-closed] { opacity: 0; transform: scale(.96) translateY(-6px); }

/* Бегущий блик по акцентной кнопке во время генерации (акцент-цвет остаётся фоном) */
@keyframes peGenSweep { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.pe-gen-sweep { background-image: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.22) 50%, transparent 75%); background-size: 220% 100%; animation: peGenSweep 1.15s linear infinite; }

/* Стаггер-появление плиток вариантов картинки (транзиентно, по клику пользователя) */
.pe-variants-in > * { animation: labaRise .4s cubic-bezier(.32,.72,0,1) backwards; }
.pe-variants-in > *:nth-child(2){ animation-delay:.05s }
.pe-variants-in > *:nth-child(3){ animation-delay:.1s }
.pe-variants-in > *:nth-child(4){ animation-delay:.15s }

/* Стаггер-появление строк управления генерацией картинки при открытии секции (транзиентно) */
.pe-ctrl-rise > * { animation: labaRise .34s cubic-bezier(.32,.72,0,1) backwards; }
.pe-ctrl-rise > *:nth-child(2){ animation-delay:.04s }
.pe-ctrl-rise > *:nth-child(3){ animation-delay:.08s }
.pe-ctrl-rise > *:nth-child(4){ animation-delay:.12s }

@media (prefers-reduced-motion: reduce) {
  .pe-scrim, .pe-panel { animation: none; }
  .pe-badge::after, .pe-empty-orb, .pe-live-dot { animation: none; }
  .pe-img-reveal { animation: none; }
  .pe-pop, .pe-pop[data-closed] { transition: opacity .12s ease; transform: none; }
  .pe-gen-sweep { animation: none; }
  .pe-variants-in > *, .pe-ctrl-rise > * { animation: none; }
}

/* ---------- Вкладка «Обзор» канала: адаптивная сетка ---------- */
/* container-query, чтобы реагировать на ширину панели, а не вьюпорта
   (слева висит сайдбар, поэтому медиа-запросы по вьюпорту врали бы). */
.ov { display: flex; flex-direction: column; gap: 16px; container-type: inline-size; width: 100%; max-width: 880px; margin: 0 auto; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
/* Главный блок слева гибкий, рейл «Эффективность» — фиксированной ширины справа. ВСЕГДА. */
.ov-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(236px, 300px); gap: 16px; align-items: start; }
.ov-col { display: flex; flex-direction: column; gap: 16px; }
/* На мобилке (≤860px, как и переключение оболочки приложения) рейл уходит во «летающую»
   карточку (.ov-fab-wrap), а основной блок занимает всю ширину. */
@media (max-width: 860px) {
  .ov-body { grid-template-columns: 1fr; }
  .ov-rail { display: none; }
}
.ov-quick:hover:not(:disabled) { background: var(--elevated); }

/* Пульс канала — ряд капсул: подписчики, частота, статус бота */
.ov-pulse { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px 10px; padding: 0 2px; }
.ov-pulse-stat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.ov-pulse-stat > svg { color: var(--text-tertiary); flex: none; }
.ov-pulse-stat b { font-weight: 600; color: var(--text-primary); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Пилюля статуса бота — единственный кликабельный индикатор в строке */
.ov-botpill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font); font-size: 13px; font-weight: 540; line-height: 1; padding: 7px 13px 7px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); transition: background .15s, border-color .15s; }
.ov-botpill:hover:not(:disabled) { background: var(--elevated); }
.ov-botpill:disabled { cursor: default; opacity: .7; }
.ov-botpill-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-tertiary); }
.ov-botpill[data-state="ok"] { color: var(--text-primary); }
.ov-botpill[data-state="ok"] .ov-botpill-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.ov-botpill[data-state="danger"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.ov-botpill[data-state="danger"] .ov-botpill-dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }

/* Тревожный баннер бота — мягкий, появляется только когда публикация сломана */
.ov-alert { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 14px; background: color-mix(in srgb, var(--danger) 8%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--border)); }
.ov-alert-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }
@container (max-width: 520px) { .ov-alert { flex-wrap: wrap; } .ov-alert > button { margin-left: 0 !important; width: 100%; } }

/* Завершение настройки — единственный фокус; без градиента и кольца */
.ov-setup { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.ov-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ov-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .9s cubic-bezier(.2,.7,.2,1); }

/* Шаги настройки — компактные строки, основная кнопка только у активного */
.ov-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; font-family: var(--font); border: 1px solid transparent; background: none; }
.ov-step-label { font-size: 13.5px; }
.ov-step--active { background: var(--accent-subtle); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.ov-step--pending { cursor: pointer; transition: background .15s; }
.ov-step--pending:hover { background: var(--elevated); }
.ov-step-num { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.ov-step--active .ov-step-num { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.ov-step-num--empty { border: 1.5px solid var(--border-strong); }

/* Стат-строка портрета — спокойные факты с точками-разделителями */
.ov-pstats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--text-secondary); }
.ov-pstats > span { position: relative; }
.ov-pstats > span + span::before { content: "·"; position: absolute; left: -9px; color: var(--text-tertiary); }
.ov-pstats b { font-weight: 600; color: var(--text-primary); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ─── Обзор: профиль канала (обложка + аватар) ─── */
.ov-profile { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.ov-cover { position: relative; height: 150px; background:
  radial-gradient(440px 240px at 72% 34%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 72%),
  radial-gradient(380px 260px at 24% 86%, color-mix(in srgb, #22D3EE 30%, transparent), transparent 72%),
  linear-gradient(120deg, #0a0a0e, #12121a 55%, #0a0a0e); }
.ov-cover-emoji { position: absolute; right: 22px; bottom: 16px; font-size: 56px; opacity: .9; filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); }
.ov-idbar { display: flex; align-items: flex-start; gap: 18px; padding: 0 24px 20px; }
.ov-avatar { position: relative; z-index: 2; flex: none; margin-top: -42px; width: 92px; height: 92px; border-radius: 50%;
  background: var(--surface-2); border: 4px solid var(--surface); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 26px; letter-spacing: .5px; color: var(--accent-text); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.ov-idmeta { flex: 1 1; min-width: 0; padding-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.ov-name { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -.03em; color: var(--text-primary); }
.ov-handle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-tertiary); }
.ov-handle > svg { flex: none; }
.ov-desc { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); max-width: 70ch; }
@container (max-width: 560px) {
  .ov-idbar { flex-direction: column; align-items: center; text-align: center; }
  .ov-idmeta { padding-top: 6px; align-items: center; }
}
.ov-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─── Правка фирменного образа прямо на картинках (аватар/обложка) ─── */
/* dash-обводка + карандаш по центру при наведении; клик → модалка генерации */
.ov-edit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: transparent; border: 2px dashed transparent; border-radius: inherit; padding: 0;
  opacity: 0; transition: opacity .16s ease, background .16s ease, border-color .16s ease; z-index: 3; }
.ov-cover .ov-edit-cover { border-radius: 0; }
.ov-cover:hover .ov-edit-cover,
.ov-avatar:hover .ov-edit-ava,
.ov-edit:focus-visible { opacity: 1; background: color-mix(in srgb, #000 42%, transparent); border-color: color-mix(in srgb, #fff 55%, transparent); }
.ov-edit-ic { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, #000 55%, transparent); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.ov-edit-ava .ov-edit-ic { width: 30px; height: 30px; }
@media (prefers-reduced-motion: reduce) { .ov-edit { transition: none; } }

/* ─── Сетка референсов в модалке фирменного образа ─── */
.bim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.bim-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.bim-thumb[data-err="true"] { border-color: var(--danger); }
.bim-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bim-thumb-load, .bim-thumb-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #000 45%, transparent); color: #fff; }
.bim-thumb-err { color: var(--danger); background: color-mix(in srgb, #000 30%, transparent); }
.bim-thumb-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #000 62%, transparent); color: #fff; border: none; cursor: pointer; transition: background .15s; }
.bim-thumb-x:hover:not(:disabled) { background: var(--danger); }
.bim-thumb-x:disabled { opacity: .4; cursor: not-allowed; }
.bim-add { aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface-2);
  color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: color .15s, border-color .15s; }
.bim-add:hover:not(:disabled) { color: var(--accent-text); border-color: var(--accent); }
.bim-add:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Обзор: секции (портрет / с чего начать) ─── */
.ov-section { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ov-sec-head { display: flex; align-items: center; gap: 11px; }
.ov-sec-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: var(--accent-text); background: var(--accent-subtle); }

/* три плитки портрета */
.ov-statgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ov-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.ov-stat-val { font-size: 20px; font-weight: 680; letter-spacing: -.02em; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ov-stat-lbl { font-size: 11.5px; color: var(--text-tertiary); }
@container (max-width: 520px) { .ov-statgrid { grid-template-columns: 1fr; } }

/* быстрый старт — карточки 3-up */
.ov-quickgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ov-qcard { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 14px; text-align: left; cursor: pointer; font-family: var(--font); background: var(--surface-2); border: 1px solid var(--border); transition: background .16s, border-color .16s, transform .14s; }
.ov-qcard:hover:not(:disabled) { background: var(--elevated); border-color: var(--border-strong); transform: translateY(-2px); }
.ov-qcard:disabled { cursor: default; opacity: .55; }
.ov-qcard:hover:not(:disabled) .ov-qarr { transform: translateX(3px); opacity: 1; }
.ov-qarr { opacity: .5; transition: transform .18s, opacity .18s; }
.ov-qico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--elevated); color: var(--accent-text); }
@container (max-width: 520px) { .ov-quickgrid { grid-template-columns: 1fr; } }

/* ─── Обзор: эффективность канала (рейл) ─── */
.ov-eff { position: sticky; top: 0; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface)); border: 1px solid var(--border); }
.ov-eff-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 15px; border-bottom: 1px solid var(--border); }
.ov-ring { position: relative; width: 62px; height: 62px; flex: none; }
.ov-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; letter-spacing: -.03em; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ov-eff-list { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.ov-todo { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border-radius: 12px; text-align: left; font-family: var(--font); cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); transition: background .16s, border-color .16s; }
.ov-todo:hover:not(:disabled) { background: var(--elevated); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.ov-todo[data-state="hero"] { background: var(--accent-subtle); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.ov-todo[data-state="done"] { background: transparent; border-color: transparent; cursor: default; }
.ov-todo-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--elevated); color: var(--text-secondary); }
.ov-todo-ico[data-state="done"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.ov-todo-ico[data-state="hero"] { background: var(--accent); color: #fff; }
.ov-todo-lbl { font-size: 13px; font-weight: 550; color: var(--text-primary); }
.ov-todo-lbl[data-state="done"] { color: var(--text-tertiary); }
.ov-todo-disc { padding: 9px 12px 6px 48px; display: flex; flex-direction: column; gap: 9px; animation: labaFadeIn .2s ease; }
.ov-eff-done { margin: 0 12px 14px; display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 13px; background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--border)); }

/* ─── Обзор: «летающая» карточка эффективности (мобилка) ─── */
/* По умолчанию скрыта; показывается только на узких экранах (≤860px). Рендерится ВНЕ
   контейнера .ov (container-type создаёт containing block для fixed) — иначе position:fixed
   считался бы от .ov, и карточка не «летала» бы за пользователем при скролле. */
.ov-fab-wrap { display: none; }
@media (max-width: 860px) { .ov-fab-wrap { display: block; } }
.ov-fab {
  position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-fab, 90); display: inline-flex; align-items: center; gap: 11px;
  padding: 9px 15px 9px 9px; border-radius: 999px; cursor: pointer; font-family: var(--font);
  background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.18); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); transition: transform .14s, box-shadow .2s;
}
.ov-fab:active { transform: scale(.96); }
.ov-fab-meta { display: flex; flex-direction: column; gap: 1px; text-align: left; line-height: 1.2; }
.ov-fab-meta b { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.ov-fab-meta span { font-size: 11px; color: var(--text-tertiary); }

/* Шторка снизу с чек-листом (раскрывается по тапу на карточку) */
.ov-sheet-scrim { position: fixed; inset: 0; z-index: var(--z-sheet-scrim, 300); background: var(--scrim, rgba(0,0,0,.5)); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.ov-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet, 301);
  max-height: 82vh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 8px 14px calc(20px + env(safe-area-inset-bottom, 0px)); gap: 4px;
  background: var(--surface); border-top: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.4);
}
.ov-sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 2px auto 8px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .ov-fab { transition: none; }
  .ov-eff [style*="stroke-dashoffset"], .ov-fab [style*="stroke-dashoffset"] { transition: none !important; }
}

.laba-spin { animation: labaSpin 1s linear infinite; }
/* пустое состояние портрета — вертикально на узкой колонке */
@container (max-width: 460px) {
  .ov-empty { flex-direction: column; align-items: flex-start !important; text-align: left; }
  .ov-empty > button { margin-left: 0 !important; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .laba-spin { animation: none; }
  .ov-bar > i { transition: none; }
}

/* WYSIWYG-редактор поста (Telegram-разметка); цвета унаследованы от пузыря Telegram */
.laba-tg-editor a { color: var(--tg-link); text-decoration: none; }
.laba-tg-editor code,
.laba-tg-editor pre { background: rgba(255,255,255,.12); border-radius: 4px; padding: 0 4px; font-size: .92em; font-family: var(--font-mono, ui-monospace, monospace); }
.laba-tg-editor blockquote { margin: 4px 0; padding-left: 8px; border-left: 3px solid rgba(255,255,255,.25); }

/* ============ Карусель тематических сфер (выбор тем) ============ */
/* Один блок = крупная сфера с градиентом тематики; внутри узкие темы.
   Используется в онбординге (TopicsStep) и в лендинг-туре (StepNiche). */
.tsc-root { display: flex; flex-direction: column; gap: 14px; }
.tsc-stage { position: relative; }

.tsc-block {
  position: relative; overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--g-border, var(--border-strong));
  background: var(--surface-2, var(--surface));
  padding: 16px 18px;
  box-shadow: 0 18px 44px -28px color-mix(in srgb, var(--g-accent, var(--accent)) 60%, transparent);
  display: flex; flex-direction: column; gap: 12px;
  cursor: grab;
}
.tsc-block:active { cursor: grabbing; }
.tsc-glow { position: absolute; inset: 0; background: var(--g-glow); pointer-events: none; z-index: 0; }

.tsc-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.tsc-icon {
  width: 42px; height: 42px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--g-accent), color-mix(in srgb, var(--g-accent) 55%, #000 12%));
  box-shadow: 0 8px 20px -8px var(--g-accent);
}
.tsc-head-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tsc-title { font-size: 16px; font-weight: 640; letter-spacing: -.02em; color: var(--text-primary); }
.tsc-meta { font-size: 12px; color: var(--text-tertiary); font-weight: 520; }
.tsc-meta-on { color: var(--g-accent); font-weight: 640; }

.tsc-scroll { position: relative; z-index: 1; overflow-y: auto; overscroll-behavior: contain; margin: 0 -2px; padding: 2px; }
.tsc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tsc-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  border-radius: 99px; font-family: var(--font); font-size: 13px; font-weight: 520;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.tsc-pill:hover:not(:disabled) {
  border-color: var(--g-border, var(--border-strong));
  color: var(--text-primary);
  transform: translateY(-1px);
}
.tsc-pill.on {
  background: var(--g-soft);
  border-color: color-mix(in srgb, var(--g-accent) 55%, transparent);
  color: var(--text-primary); font-weight: 600;
}
.tsc-pill.on :first-child { color: var(--g-accent); }
.tsc-pill:disabled { cursor: not-allowed; }

.tsc-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; box-shadow: var(--shadow-sm, 0 4px 12px -6px rgba(0,0,0,.3));
  transition: background .15s, color .15s, transform .12s, opacity .15s; opacity: .85;
}
.tsc-arrow:hover { background: var(--elevated); color: var(--text-primary); opacity: 1; transform: translateY(-50%) scale(1.08); }
.tsc-arrow:active { transform: translateY(-50%) scale(.94); }
.tsc-arrow-l { left: -8px; }
.tsc-arrow-r { right: -8px; }

.tsc-dots { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; }
.tsc-dot {
  width: 8px; height: 8px; border-radius: 99px; flex: none; cursor: pointer;
  border: none; padding: 0; background: var(--elevated);
  transition: width .25s cubic-bezier(.32,.72,0,1), background .2s, transform .15s;
}
.tsc-dot:hover { transform: scale(1.25); background: color-mix(in srgb, var(--dot) 50%, var(--elevated)); }
.tsc-dot.on { width: 24px; background: var(--dot, var(--accent)); }

@media (prefers-reduced-motion: reduce) {
  .tsc-block, .tsc-pill, .tsc-arrow, .tsc-dot { transition: none; }
}

/* ============ «Шаблоны» — каталог рецептов генерации ============ */
/* container-query по ширине области (слева сайдбар), а не вьюпорта: на 1920px минус
   панель помещается ≥6 карточек в ряд; на узких — деградация до 1 колонки. */
.tpl-screen { container-type: inline-size; width: 100%; height: 100%; overflow-y: auto; }
.tpl-wrap { max-width: 1760px; margin: 0 auto; padding: 22px 26px 60px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 720px) { .tpl-wrap { padding: 16px 14px 80px; gap: 16px; } }

.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@container (min-width: 560px)  { .tpl-grid { grid-template-columns: repeat(3, 1fr); } }
@container (min-width: 840px)  { .tpl-grid { grid-template-columns: repeat(4, 1fr); } }
@container (min-width: 1120px) { .tpl-grid { grid-template-columns: repeat(5, 1fr); } }
@container (min-width: 1400px) { .tpl-grid { grid-template-columns: repeat(6, 1fr); } }
@container (min-width: 1680px) { .tpl-grid { grid-template-columns: repeat(7, 1fr); } }

/* Карточка шаблона: компактная, превью-градиент из акцента + эмодзи, hover-лифт. */
.tpl-card {
  position: relative; display: flex; flex-direction: column; gap: 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 15px;
  overflow: hidden; cursor: pointer; font-family: var(--font);
  transition: border-color .16s, box-shadow .2s, transform .16s cubic-bezier(.32,.72,0,1);
}
.tpl-card:hover {
  border-color: color-mix(in srgb, var(--tpl-accent, var(--accent)) 45%, var(--border));
  box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--tpl-accent, var(--accent)) 70%, transparent);
  transform: translateY(-3px);
}
.tpl-thumb {
  position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 25% 20%, color-mix(in srgb, var(--tpl-accent, var(--accent)) 40%, transparent), transparent 60%),
    linear-gradient(150deg, color-mix(in srgb, var(--tpl-accent, var(--accent)) 26%, var(--surface-2)), var(--surface-2));
  overflow: hidden;
}
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-thumb-emoji { font-size: 40px; line-height: 1; filter: drop-shadow(0 4px 14px rgba(0,0,0,.32)); transition: transform .2s cubic-bezier(.32,.72,0,1); }
.tpl-thumb-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 15px;
  color: #fff; background: color-mix(in srgb, var(--tpl-accent, var(--accent)) 78%, transparent);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--tpl-accent, var(--accent)) 90%, transparent), inset 0 0 0 1px rgba(255,255,255,.14);
  transition: transform .2s cubic-bezier(.32,.72,0,1); }
.tpl-card:hover .tpl-thumb-emoji { transform: scale(1.12) rotate(-3deg); }
.tpl-card:hover .tpl-thumb-ico { transform: scale(1.08) rotate(-3deg); }
.tpl-kind {
  position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: -.01em;
  background: color-mix(in srgb, var(--bg-base) 72%, transparent); color: var(--text-secondary);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px); border: 1px solid var(--border);
}
.tpl-lock {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 7px; display: flex;
  align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg-base) 72%, transparent);
  color: var(--text-tertiary); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid var(--border);
}
.tpl-body { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px 12px; flex: 1 1; min-width: 0; }
.tpl-name { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; color: var(--text-primary); line-height: 1.25; }
.tpl-purpose { font-size: 11.5px; line-height: 1.45; color: var(--text-tertiary); }
.tpl-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 7px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px; border-radius: 99px;
  font-size: 10px; font-weight: 540; background: var(--elevated); color: var(--text-tertiary);
}
.tpl-uses { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-tertiary); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.tpl-card.expanded { z-index: 2; }

/* Развернуть пример плана прямо в карточке */
.tpl-expand { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 9px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); cursor: pointer;
  font-family: var(--font); font-size: 11.5px; font-weight: 560; transition: border-color .15s, color .15s, background .15s; }
.tpl-expand:hover { border-color: color-mix(in srgb, var(--tpl-accent, var(--accent)) 45%, var(--border)); color: var(--text-primary); }
.tpl-expand-caret { margin-left: auto; transition: transform .2s cubic-bezier(.32,.72,0,1); }
.tpl-card-plan { overflow: hidden; }
.tpl-card-plan-inner { display: flex; flex-direction: column; gap: 5px; padding: 10px 0 2px; }
.tpl-card-slot { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.tpl-card-slot-day { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; flex: none;
  padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 700; color: var(--accent-text); background: var(--accent-subtle); }
.tpl-card-slot-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
  border-radius: 6px; color: var(--text-secondary); background: var(--elevated); }
.tpl-card-slot-rubric { font-size: 11.5px; font-weight: 620; color: var(--text-primary); flex: none; white-space: nowrap; }
.tpl-card-slot-topic { font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tpl-card-plan-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 3px; padding: 8px; border-radius: 9px;
  border: none; cursor: pointer; font-family: var(--font); font-size: 11.5px; font-weight: 620; letter-spacing: -.01em;
  color: #fff; background: color-mix(in srgb, var(--tpl-accent, var(--accent)) 82%, transparent);
  transition: filter .15s; }
.tpl-card-plan-cta:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .tpl-card:hover .tpl-thumb-ico, .tpl-expand-caret { transition: none; } }

/* Кнопка-меню «⋯» в углу карточки — проявляется на hover. */
.tpl-menu-btn {
  position: absolute; bottom: 10px; right: 10px; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-tertiary); cursor: pointer; opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}
.tpl-card:hover .tpl-menu-btn { opacity: 1; }
.tpl-menu-btn:hover { color: var(--text-primary); background: var(--elevated); }

/* Тулбар: поиск + сортировка + чипы категорий. */
.tpl-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-search { position: relative; flex: 1 1; min-width: 220px; }
.tpl-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.tpl-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); font-family: var(--font); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.tpl-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.tpl-search select { width: 100%; height: 40px; padding: 0 32px 0 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); font-family: var(--font); font-size: 14px; outline: none;
  cursor: pointer; appearance: none; -webkit-appearance: none; transition: border-color .15s, box-shadow .15s; }
.tpl-search select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.tpl-ch-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.tpl-search-anim { animation: labaSwitchIn .22s cubic-bezier(.32,.72,0,1) both; }
@media (prefers-reduced-motion: reduce) { .tpl-search-anim { animation: none; } }

/* ── Выбор канала в «Планах» ── */
.plan-ch-picker { position: relative; overflow: visible; }
.plan-ch-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 40px; padding: 0 10px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); font-family: var(--font);
  cursor: pointer; outline: none; text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.plan-ch-trigger:hover { border-color: var(--border-strong); }
.plan-ch-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.plan-ch-name { flex: 1 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13.5px; font-weight: 520; color: var(--text-primary); }
.plan-ch-cnt { font-size: 11px; font-weight: 620; padding: 2px 7px; border-radius: 999px; flex: none;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-text, var(--accent)); white-space: nowrap; }
.plan-ch-drop {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 5px;
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.28), 0 2px 8px -4px rgba(0,0,0,.12);
}
.plan-ch-divider { height: 1px; background: var(--border); margin: 4px 4px; }
.plan-ch-opt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border-radius: 10px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); text-align: left;
  transition: background .1s;
}
.plan-ch-opt:hover { background: var(--elevated, rgba(127,127,127,.07)); }
.plan-ch-opt.sel { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.plan-ch-opt-name { font-size: 13px; font-weight: 540; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-ch-opt-sub { font-size: 11px; color: var(--text-tertiary); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tpl-cats { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tpl-cats::-webkit-scrollbar { display: none; }

/* Заголовок секции «первый блок». */
.tpl-sec-head { display: flex; align-items: center; gap: 9px; }
.tpl-sec-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px;
  color: var(--accent-text); background: var(--accent-subtle); flex: none; }

/* Стаггер-появление карточек. */
.tpl-grid > * { animation: labaRise .4s cubic-bezier(.32,.72,0,1) backwards; }
.tpl-grid > *:nth-child(2) { animation-delay: .03s; }
.tpl-grid > *:nth-child(3) { animation-delay: .06s; }
.tpl-grid > *:nth-child(4) { animation-delay: .09s; }
.tpl-grid > *:nth-child(5) { animation-delay: .12s; }
.tpl-grid > *:nth-child(6) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .tpl-card, .tpl-thumb-emoji { transition: none; }
  .tpl-grid > * { animation: none; }
}

/* Модалка запуска/создания — двухпанельная (переиспользует .pe-scrim/.pe-panel). */
.tpl-modal { width: min(1080px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.tpl-modal-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 0; flex: 1 1; }
@media (max-width: 880px) { .tpl-modal-2col { grid-template-columns: 1fr; } }
.tpl-pane { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.tpl-pane-l { padding: 18px 20px; gap: 14px; border-right: 1px solid var(--border); }
@media (max-width: 880px) { .tpl-pane-l { border-right: none; border-bottom: 1px solid var(--border); } }
.tpl-pane-r { padding: 18px 20px; gap: 12px; background: var(--bg-base); }

/* Поле ввода входа шаблона. */
.tpl-input-card { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--border); }
.tpl-input-card.req { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.tpl-req-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.tpl-dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 76px; border-radius: 11px;
  border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--text-tertiary); cursor: pointer;
  font-size: 12.5px; transition: border-color .15s, color .15s, background .15s; }
.tpl-dropzone:hover { border-color: var(--accent); color: var(--text-secondary); background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ── Hero ── */
.tpl-hero { display: flex; flex-direction: column; gap: 16px; }
.tpl-hero-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 13px; color: var(--accent-text); background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.tpl-hero-title { font-size: 23px; font-weight: 700; letter-spacing: -.035em; color: var(--text-primary); line-height: 1.1; }
.tpl-hero-sub { font-size: 13px; line-height: 1.5; color: var(--text-secondary); max-width: 640px; margin-top: 2px; }

/* «Как это работает» */
.tpl-hiw { position: relative; overflow: hidden; }
.tpl-hiw-inner { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px 4px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%),
    var(--surface); }
.tpl-hiw-step { display: flex; align-items: center; gap: 11px; padding: 4px 8px; min-width: 0; }
.tpl-hiw-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
  border-radius: 50%; font-size: 11.5px; font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums;
  color: var(--accent-text); background: var(--accent-subtle); }
.tpl-hiw-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 9px; color: var(--text-secondary); background: var(--elevated); }
.tpl-hiw-t { font-size: 13px; font-weight: 620; color: var(--text-primary); letter-spacing: -.01em; line-height: 1.25; }
.tpl-hiw-d { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.3; }
.tpl-hiw-arrow { color: var(--text-tertiary); opacity: .55; flex: none; margin: 0 2px; }
.tpl-hiw-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-tertiary); cursor: pointer;
  transition: background .15s, color .15s; }
.tpl-hiw-close:hover { background: var(--elevated); color: var(--text-primary); }
@media (max-width: 720px) { .tpl-hiw-arrow { display: none; } .tpl-hiw-inner { gap: 4px; } }

/* ── Тулбар (sticky) ── */
.tpl-bar-wrap { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 12px;
  padding: 8px 0; margin: -8px 0; background: linear-gradient(var(--bg-base), var(--bg-base) 72%, transparent); }
.seg button { display: inline-flex; align-items: center; gap: 5px; }
.tpl-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px;
  border-radius: 7px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
  background: var(--elevated); color: var(--text-tertiary); transition: color .15s, background .15s; }
.tpl-search-clear:hover { color: var(--text-primary); background: var(--border); }
.pill-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 99px; font-size: 10.5px; font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; line-height: 1;
  background: color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-tertiary); }
.pill.on .pill-cnt { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }

/* ── Заголовок секции ── */
.tpl-sec-ico.accent { color: var(--accent-text); background: var(--accent-subtle); }
.tpl-sec-title { font-size: 16px; font-weight: 680; letter-spacing: -.02em; color: var(--text-primary); }
.tpl-sec-cnt { font-size: 12px; font-weight: 600; color: var(--text-tertiary); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.tpl-sec-sub { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.35; margin-top: 1px; }
.tpl-sec-all { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 540; transition: all .15s; }
.tpl-sec-all:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--accent-text); background: var(--accent-subtle); }
.tpl-sec-all svg { transition: transform .18s cubic-bezier(.32,.72,0,1); }
.tpl-sec-all:hover svg { transform: translateX(3px); }
.tpl-count { font-size: 13px; font-weight: 600; color: var(--text-secondary); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ── Пример результата в модалке запуска ── */
.tpl-ex { display: flex; flex-direction: column; gap: 14px; }
.tpl-ex-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-ex-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 11px; font-weight: 640; letter-spacing: -.01em; color: var(--accent-text); background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.tpl-ex-hint { font-size: 12px; color: var(--text-tertiary); }
.tpl-ex-body { display: flex; flex-direction: column; gap: 14px; }

/* Анатомия поста */
.tpl-anatomy { display: flex; flex-direction: column; gap: 6px; padding: 12px 13px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--surface-2); }
.tpl-anatomy-row { display: flex; align-items: center; gap: 9px; }
.tpl-anatomy-ico { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; flex: none;
  border-radius: 7px; color: var(--accent-text); background: var(--accent-subtle); }
.tpl-anatomy-lbl { font-size: 12.5px; font-weight: 620; color: var(--text-primary); flex: none; min-width: 76px; }
.tpl-anatomy-desc { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.3; }
.tpl-ex-tg { border-radius: 14px; }
.tpl-ex-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; line-height: 1.4; color: var(--text-tertiary); }
.tpl-ex-foot svg { color: var(--accent-text); flex: none; }

/* План-образец: недельный ритм */
.tpl-ex-plan { display: flex; flex-direction: column; gap: 7px; }
.tpl-ex-slot { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, transform .15s; }
.tpl-ex-slot:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); transform: translateX(2px); }
.tpl-ex-slot-day { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; flex: none;
  border-radius: 8px; font-size: 12px; font-weight: 680; color: var(--accent-text); background: var(--accent-subtle); }
.tpl-ex-slot-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none;
  border-radius: 8px; color: var(--accent-text); background: var(--accent-subtle); }
.tpl-ex-slot-rubric { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.tpl-ex-slot-topic { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-ex-slot-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--accent) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .tpl-ex-slot:hover { transform: none; } }

/* ─────────────────────────────────────────────────────────────────────────────
   Сценарии — триггерная автоматизация постинга. Экран + карточки + мастер + дровер.
   ───────────────────────────────────────────────────────────────────────────── */
.sc-screen { display: flex; flex-direction: column; gap: 18px; padding: clamp(16px, 3vw, 30px); max-width: 1240px; margin: 0 auto; width: 100%; height: 100%; min-height: 0; overflow-y: auto; }
.sc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sc-top-titles { min-width: 0; }
.sc-h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 680; letter-spacing: -.03em; color: var(--text-primary); line-height: 1.05; }
.sc-subtitle { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; max-width: 60ch; }

.sc-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-filter-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 17px; margin-left: 6px;
  padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 640; background: color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-secondary); }
.pill.on .sc-filter-n { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }

.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

/* Карточка сценария */
.sc-card { display: flex; flex-direction: column; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.sc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.sc-card[data-paused="1"] { opacity: .74; }
.sc-card-head { display: flex; align-items: flex-start; gap: 11px; }
.sc-srcchip { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 12px;
  color: var(--src, var(--accent)); background: color-mix(in srgb, var(--src, var(--accent)) 15%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--src, var(--accent)) 22%, transparent); }
.sc-card-titles { min-width: 0; flex: 1 1; }
.sc-card-title { font-size: 15px; font-weight: 640; letter-spacing: -.02em; color: var(--text-primary); line-height: 1.25; }
.sc-card-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.3; margin-top: 2px; }
.sc-status { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--st, var(--text-secondary)); background: color-mix(in srgb, var(--st, var(--text-secondary)) 12%, transparent); }
.sc-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st, var(--text-secondary)); }
.sc-status-dot[data-pulse="1"] { animation: scDotPulse 2s ease-in-out infinite; }
@keyframes scDotPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 60%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 0%, transparent); } }

.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 540;
  color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border); }
.sc-chip[data-src="1"] { color: var(--src); background: color-mix(in srgb, var(--src) 11%, var(--surface-2)); border-color: color-mix(in srgb, var(--src) 26%, var(--border)); }
.sc-chip svg { opacity: .85; }

.sc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px solid var(--border); }
.sc-foot-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-foot-line { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-tertiary); }
.sc-foot-line svg { opacity: .75; }
.sc-actions { display: flex; gap: 2px; flex: none; }
.sc-iconbtn { width: 30px; height: 30px; color: var(--text-tertiary); }
.sc-iconbtn:hover { color: var(--text-primary); background: var(--surface-2); }
.sc-iconbtn:disabled { opacity: .5; cursor: default; }
.sc-iconbtn-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* Пустое состояние */
.sc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: clamp(28px, 6vw, 56px) 18px;
  border: 1px dashed var(--border-strong); border-radius: 24px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.sc-empty-glyph { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 20px;
  color: var(--accent-text); background: var(--accent-subtle); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 7%, transparent); }
.sc-empty-title { font-size: clamp(19px, 3vw, 24px); font-weight: 680; letter-spacing: -.03em; color: var(--text-primary); text-wrap: balance; }
.sc-empty-sub { font-size: 14px; color: var(--text-secondary); max-width: 56ch; line-height: 1.5; text-wrap: pretty; }
.sc-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; width: 100%; max-width: 760px; margin: 6px 0; }
.sc-example { display: flex; align-items: center; gap: 11px; text-align: left; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.sc-example:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sc-example-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px;
  color: var(--src); background: color-mix(in srgb, var(--src) 15%, var(--surface-2)); }
.sc-example-text { flex: 1 1; font-size: 13px; color: var(--text-primary); line-height: 1.35; }
.sc-example-arrow { color: var(--text-tertiary); flex: none; transition: transform .18s ease; }
.sc-example:hover .sc-example-arrow { transform: translateX(3px); color: var(--accent-text); }

.sc-empty-inline { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; color: var(--text-tertiary); font-size: 13px; text-align: center;
  border: 1px dashed var(--border); border-radius: 14px; }

/* Мастер (модалка) */
.sc-wiz { width: min(640px, 100%); max-height: min(88vh, 760px); display: flex; flex-direction: column; }
.sc-wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex: none; }
.sc-wiz-title { font-size: 15.5px; font-weight: 660; letter-spacing: -.02em; color: var(--text-primary); }
.sc-wiz-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }

.sc-stepper { display: flex; gap: 4px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex: none; overflow-x: auto; }
.sc-step { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 7px; border-radius: 999px; background: transparent; border: none; cursor: pointer; flex: none;
  color: var(--text-tertiary); transition: background .18s ease, color .18s ease; }
.sc-step:disabled { cursor: default; opacity: .55; }
.sc-step[data-state="on"] { background: var(--accent-subtle); color: var(--accent-text); }
.sc-step[data-state="done"] { color: var(--text-secondary); }
.sc-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 680; flex: none;
  background: color-mix(in srgb, currentColor 14%, transparent); }
.sc-step[data-state="on"] .sc-step-dot { background: var(--accent); color: var(--on-accent); }
.sc-step[data-state="done"] .sc-step-dot { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.sc-step-lbl { font-size: 12.5px; font-weight: 580; white-space: nowrap; }

.sc-wiz-body { padding: 18px; overflow-y: auto; flex: 1 1; min-height: 220px; }
.sc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .sc-grid2 { grid-template-columns: 1fr; } }
.sc-hint { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }

.sc-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sc-opt { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 13px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.sc-opt:hover:not(:disabled) { border-color: var(--border-strong); transform: translateY(-1px); }
.sc-opt:disabled { opacity: .4; cursor: not-allowed; }
.sc-opt[data-active="1"] { border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.sc-opt-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; color: var(--text-secondary); background: var(--surface-2); }
.sc-opt[data-active="1"] .sc-opt-icon { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.sc-opt-label { font-size: 13.5px; font-weight: 640; color: var(--text-primary); }
.sc-opt-desc { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.3; }

.sc-weekdays { display: flex; gap: 5px; flex-wrap: wrap; }
.sc-wd { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 580; cursor: pointer;
  transition: all .14s ease; }
.sc-wd:hover { border-color: var(--border-strong); }
.sc-wd[data-on="1"] { border-color: transparent; background: var(--accent); color: var(--on-accent); }

.sc-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.sc-seg button { padding: 6px 12px; border: none; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 12.5px; font-weight: 560; cursor: pointer; transition: all .14s ease; }
.sc-seg button[data-on="1"] { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.sc-cond { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.sc-cond-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 620; color: var(--text-primary); }
.sc-addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.sc-toggle span { display: inline-flex; align-items: center; gap: 6px; }

.sc-wiz-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); flex: none; }
.sc-err { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--danger); }

/* Дровер истории прогонов */
.sc-drawer { width: min(440px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.sc-drawer-body { padding: 18px; overflow-y: auto; flex: 1 1; }
.sc-timeline { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sc-run { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.sc-run::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.sc-run:last-child::before { display: none; }
.sc-run-dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border-radius: 50%; z-index: 1;
  color: var(--st); background: color-mix(in srgb, var(--st) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 30%, transparent); }
.sc-run-body { flex: 1 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.sc-run-status { font-size: 13px; font-weight: 620; }
.sc-run-time { font-size: 11.5px; color: var(--text-tertiary); flex: none; }
.sc-run-reason { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.sc-run-conds { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.sc-run-cond { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 560; }
.sc-run-cond[data-pass="1"] { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.sc-run-cond[data-pass="0"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }

/* Подтверждение удаления */
.sc-confirm { width: min(380px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 8px; text-align: center; align-items: center; }
.sc-confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.sc-confirm-title { font-size: 16px; font-weight: 660; color: var(--text-primary); }
.sc-confirm-text { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.sc-btn-danger { color: var(--on-accent); background: var(--danger); }
.sc-btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }

/* Тост */
.sc-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 460; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 17px; border-radius: 12px; background: var(--elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 540; color: var(--text-primary); }
.sc-toast svg { color: var(--ok); }

@media (prefers-reduced-motion: reduce) {
  .sc-status-dot[data-pulse="1"] { animation: none; }
  .sc-card:hover, .sc-example:hover, .sc-opt:hover:not(:disabled) { transform: none; }
  .sc-example:hover .sc-example-arrow { transform: none; }
}

/* Артефакт сценария в чате агента */
.sc-art { max-width: 420px; width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 11px; padding: 13px; border-radius: 16px;
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--accent-subtle), transparent 70%), var(--surface); box-shadow: var(--shadow-sm); animation: labaMsgIn .22s ease; }
.sc-art-head { display: flex; gap: 10px; align-items: flex-start; }
.sc-art-titlein { width: 100%; border: none; background: transparent; font-family: var(--font); font-size: 14.5px; font-weight: 660; letter-spacing: -.02em; color: var(--text-primary); padding: 2px 0; }
.sc-art-titlein:focus { outline: none; border-bottom: 1px solid var(--accent); }
.sc-art-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sc-art-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (max-width: 460px) { .sc-art-controls { grid-template-columns: 1fr; } }
.sc-art-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sc-art-field > span { font-size: 11px; font-weight: 580; color: var(--text-tertiary); }
.sc-art-foot { display: flex; align-items: center; gap: 10px; padding-top: 3px; }
.sc-art-img { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.sc-art-done { flex-direction: row; align-items: center; gap: 11px; }
.sc-art-doneicon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 11px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface-2)); }
.sc-art-title { font-size: 13.5px; font-weight: 640; color: var(--text-primary); }
.sc-art-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }

