/* ============================================================
   CRM каналов — стили страниц и графиков
   ============================================================ */

.main.loading [data-body], .main.loading .tiles, .main.loading .grid { opacity: .55; transition: opacity .15s; }

/* ---------------- панель инструментов ---------------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.grow-1 { flex: 1 1 260px; min-width: 200px; }
.select.auto { width: auto; min-width: 130px; max-width: 220px; }
/* Кнопка-фильтр с меню галочек (несколько ниш) — выглядит как список, длинная подпись обрезается. */
.select.filter-pick { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select.filter-pick.on { border-color: var(--accent); color: var(--accent-text); }
.status-chips { margin-bottom: 14px; }
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px;
  border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--c-blue) 35%, transparent);
}
.bulk-bar b { margin-right: 6px; }
@media (max-width: 700px) { .hide-sm { display: none; } }

/* ---------------- таблица каналов ---------------- */
.channels-table .col-name { min-width: 210px; max-width: 300px; }
.channels-table .table th, .channels-table .table td { padding-left: 9px; padding-right: 9px; }
.channels-table td { height: 58px; }
.flag { display: inline-flex; vertical-align: -2px; }
.flag.bad { color: var(--bad-text); }
.flag.warn { color: var(--warn-text); }
.flag.muted { color: var(--text-3); }
.cell-edit { display: block; width: 100%; text-align: left; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: var(--radius-sm);
  background: none; color: inherit; font: inherit; cursor: pointer; }
.cell-edit:hover { background: var(--surface-3); }
.cell-edit .sub-line { pointer-events: none; }
.sub-line.warn { color: var(--warn-text); }
.sub-line svg { vertical-align: -1px; }

/* ---------------- канбан ---------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-col { background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius); min-height: 180px; display: flex; flex-direction: column; transition: border-color .12s, background .12s; }
.kb-col.over { border-color: var(--accent); background: var(--accent-soft); }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 9px; }
.kb-head .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.kb-sum { margin-left: auto; font-size: 12px; font-weight: 700; }
.kb-list { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; flex: 1; }
.kb-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 10px 11px; cursor: grab;
  display: flex; flex-direction: column; gap: 7px; box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
.kb-card:hover { border-color: var(--border-strong); }
.kb-card.dragging { opacity: .45; }
.kb-card:active { cursor: grabbing; }
.kb-offer { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.kb-offer svg { color: var(--text-3); }
.kb-metrics { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.kb-metrics span { display: inline-flex; align-items: center; gap: 3px; }
.kb-metrics .good { color: var(--good-text); } .kb-metrics .bad { color: var(--bad-text); }
.kb-empty { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 18px 10px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---------------- графики ---------------- */
.chart { position: relative; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: -4px 0 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-plot { position: relative; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--baseline); stroke-width: 1; }
.chart-svg .wash { fill: var(--text); opacity: .045; }
.chart-svg .cross { stroke: var(--text-3); stroke-width: 1; }
.chart-empty { display: grid; place-items: center; min-height: 160px; color: var(--text-3); font-size: 13px; text-align: center; padding: 20px; }
.chart-table .table-scroll { max-height: 280px; overflow: auto; }
.card .chart-table .table th:first-child, .card .chart-table .table td:first-child { padding-left: 10px; }

/* ---------------- полосы (статусы, воронка) ---------------- */
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hb-row {
  display: grid; grid-template-columns: minmax(84px, 128px) 1fr 44px; align-items: center; gap: 10px;
  padding: 5px 6px; margin: 0 -6px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
a.hb-row:hover { background: var(--surface-2); text-decoration: none; }
.hb-label { font-size: 13px; color: var(--text-2); }
.hb-track { height: 10px; position: relative; }
.hb-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 0; }
.hb-value { text-align: right; font-weight: 700; font-size: 13px; }
.big-count { display: inline-block; font-size: 13px; color: var(--text-2); margin: -4px 0 10px; }
a.big-count:hover { text-decoration: none; color: var(--text); }
.chip-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border-strong); }
.big-count b { font-size: 26px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; margin-right: 4px; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.funnel .hb-row { grid-template-columns: 96px 1fr 64px; }
.fn-conv { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); padding: 0 0 0 106px; margin: -1px 0; }
.fn-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--border); }
.fn-foot div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.fn-foot b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- тревоги ---------------- */
.alerts { list-style: none; margin: 0 -8px; padding: 0; max-height: 330px; overflow: auto; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.alert-row:hover { background: var(--surface-2); text-decoration: none; }
.alert-ic { display: inline-flex; }
.alert-ic.critical { color: var(--bad-text); }
.alert-ic.warning { color: var(--warn-text); }
.alert-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; line-height: 1.35; }
.alert-text .ch-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-line { display: inline-flex; align-items: center; gap: 8px; color: var(--good-text); font-weight: 600; }

/* ---------------- разное ---------------- */
.head-right { display: flex; align-items: center; gap: 12px; }
.segmented.small { padding: 2px; }
.segmented.small button { height: 26px; padding: 0 10px; font-size: 12.5px; }
.hero-empty { padding: 56px 20px; }
.btn.on { background: var(--accent-soft); color: var(--accent-text); }

/* ---------------- формы каналов ---------------- */
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
.lookup { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); margin-top: 4px; }
.lookup.ok { border: 1px solid color-mix(in srgb, var(--st-good) 40%, transparent); }
.lookup.warn { border: 1px solid color-mix(in srgb, var(--st-warning) 55%, transparent); color: var(--warn-text); }
.lk-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lk-text b { color: var(--text); }
.manual-stats summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 0; }
.manual-stats[open] summary { margin-bottom: 10px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------- ввод за день ---------------- */
.daily-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); }
.field-inline .input { width: auto; }
.daily-search { width: 200px; }
.daily-search .input { height: 30px; }
.daily-hint { font-size: 12.5px; flex: 1 1 220px; }
.daily-table { max-height: calc(58vh / var(--zoom, 1)); overflow: auto; }
.daily-table .input, .daily-table .select { height: 30px; font-size: 13px; }
.daily-table td { padding: 5px 6px; }
.daily-table td:first-child { min-width: 190px; }
.daily-table td:nth-child(2) { min-width: 150px; }
.daily-table td:nth-child(n+3):nth-child(-n+8) .input { width: 76px; }
.daily-table td:last-child { min-width: 170px; }
.daily-table .ch-name { font-size: 13px; }

/* ---------------- карточка канала ---------------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.ch-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ch-head-text { flex: 1; min-width: 220px; }
.ch-head-text h1 { font-size: 24px; overflow-wrap: anywhere; }
.ch-head-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.ch-head-meta a { display: inline-flex; align-items: center; gap: 4px; }
.ch-head .badge { font-size: 13.5px; line-height: 28px; padding: 1px 12px 1px 10px; }
.info-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.info-chip { display: flex; flex-direction: column; gap: 1px; min-width: 110px; max-width: 280px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 2px solid var(--border); font-size: 13.5px; }
.info-chip .muted { font-size: 11.5px; }
.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.notes { min-height: 140px; }
.count-text { font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.more-row { display: flex; justify-content: center; padding: 12px 0 0; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 0; }
.timeline li { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 0 0 12px 0; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 1px; background: var(--border-strong); }
.timeline li:last-child::before { display: none; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: relative; top: 1px; }
.timeline li:not(.now) b { font-weight: 600; }

/* ---------------- журнал ---------------- */
.sum-strip { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--border); }
.sum-strip div { display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.sum-strip b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- настройки ---------------- */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.settings > section { scroll-margin-top: 16px; }
@media (max-width: 860px) { .settings > section { scroll-margin-top: 68px; } }
.settings h2 { display: inline-flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--st-good) 16%, transparent); color: var(--good-text); }
.lead-text { margin: -4px 0 14px; color: var(--text-2); max-width: 760px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--border); }
.btns-row { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); }
.howto { margin-top: 14px; border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 14px; }
.howto summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.howto ol { margin: 10px 0 6px; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.status-editor { display: flex; flex-direction: column; gap: 6px; }
.st-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.st-move { display: flex; flex-direction: column; }
.st-move .btn { height: 18px; width: 24px; }
.swatch { width: 26px; height: 26px; border-radius: var(--radius-sm); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); background: var(--dot); cursor: pointer; flex: 0 0 26px; }
.st-name { flex: 1 1 180px; width: auto; min-width: 140px; }
.st-count { min-width: 56px; text-align: right; font-size: 12.5px; }
.data-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--border); }

/* ---------------- ссылки на YouTube и кликабельные ячейки ---------------- */
.yt-link { color: inherit; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.yt-link svg { color: var(--text-3); opacity: 0; transition: opacity .12s; }
.yt-link:hover { color: var(--accent-text); text-decoration: none; }
.yt-link:hover svg, tr:hover .yt-link svg, .alert-row:hover .yt-link svg { opacity: 1; }
.cell-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.cell-link:hover { color: var(--accent-text); text-decoration: underline; }
.alert-row { cursor: pointer; }

/* ---------------- выбор даты «пролито до» ---------------- */
.date-picker { display: grid; gap: 8px; }
.dp-plus { display: flex; gap: 6px; }
.dp-plus .chip { height: 26px; padding: 0 9px; font-size: 12.5px; }
.dp-actions { display: flex; gap: 6px; }
.dp-actions .btn-primary { flex: 1; }
button.info-chip.editable { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.info-chip.editable:hover { border-color: var(--accent); }
.info-chip.editable .muted svg { vertical-align: -1px; opacity: .7; }
.accent { color: var(--accent-text); }

/* ---------------- задачи на сегодня ---------------- */
.pour-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: -4px 0 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.pour-line svg { color: var(--text-3); }
.pour-line.ok svg { color: var(--good-text); }
.pour-line b { color: var(--text); font-weight: 700; }
.task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 5px; font-size: 12px; }
.task-actions .muted { margin-right: 2px; }
.task-actions .chip { height: 24px; padding: 0 8px; font-size: 12px; gap: 2px; }
.task-actions .chip:disabled { opacity: .5; cursor: default; }

/* ---------------- этапы: срок в настройках, чипы в карточке ---------------- */
.st-plan { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.st-plan .input { width: 52px; height: 30px; padding: 0 8px; }
a.info-chip.link { color: inherit; }
a.info-chip.link:hover { border-color: var(--accent); text-decoration: none; }
a.info-chip.link .ellipsis { color: var(--accent-text); }
.info-chip.warn-chip { border-color: color-mix(in srgb, var(--st-warning) 60%, transparent); background: color-mix(in srgb, var(--st-warning) 10%, var(--surface)); }
.info-chip .link-btn { font-size: 13px; }

/* ---------------- ниши ---------------- */
.grid.top { align-items: start; }
.niche-ic { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 60px;
  background: color-mix(in srgb, var(--dot) 16%, var(--surface)); color: color-mix(in srgb, var(--dot) 80%, var(--text)); }
.tile-of { font-size: 16px; color: var(--text-3); font-weight: 600; }
.tile-value.good { color: var(--good-text); } .tile-value.bad { color: var(--bad-text); }
.comp-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.comp-add .textarea { flex: 1; min-height: 40px; height: 40px; resize: vertical; }
.comp-add .textarea:focus { height: 84px; }
.banner.compact { padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.sum-strip.insights { background: var(--surface-2); border: 0; padding: 10px 14px; gap: 6px 24px; }
.sum-strip.insights b { font-size: 15px; }
.tag.young { background: color-mix(in srgb, var(--c-green) 18%, transparent); color: var(--good-text); font-weight: 600; font-size: 11px; vertical-align: 1px; }
.comp-table .ch-meta svg { vertical-align: -2px; }
.comp-table td:first-child { max-width: 260px; }
.comp-table td { white-space: nowrap; }
.comp-table td b { font-weight: 700; }
.pipeline { min-height: 240px; font-size: 13px; line-height: 1.5; }

/* ---------------- вход по паролю (CRM с партнёром) ---------------- */
body.auth-screen .sidebar { display: none; }
.login-wrap { min-height: calc(100vh / var(--zoom, 1) - 70px); display: grid; place-items: center; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px 26px; }
.login-card .brand { padding: 0 0 2px; }
.login-card h1 { font-size: 20px; }
.login-card .btn-primary { height: 38px; justify-content: center; }
.login-note { margin: -6px 0 0; color: var(--text-2); font-size: 13px; }
/* На телефоне в боковой панели остаётся только значок, а на карточке входа название нужно */
@media (max-width: 860px) {
  .login-card .brand span { display: inline; }
  .login-card .brand .brand-logo { display: grid; }
  :root[data-brand] .login-card .brand .brand-text { display: flex; }
}
.user-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.user-box svg { color: var(--text-3); }
.user-box .ellipsis { flex: 1; min-width: 0; font-weight: 600; color: var(--text); }
.row-actions.always { opacity: 1; }
.users-table td { white-space: nowrap; }
/* Несколько аккаунтов: в боковой панели — название аккаунта и логин в две строки */
.user-box .user-acc { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-box .user-acc b { flex: none; font-weight: 700; color: var(--text); }
.user-box .user-acc small { flex: none; font-weight: 400; font-size: 12px; color: var(--text-3); }
/* Аккаунты (видит администратор) */
.accounts-table td { white-space: nowrap; }
/* Оповещения (видит администратор): шаги подключения Telegram, пульса и архива */
.ops-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ops-step { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.ops-step p { margin: 0; }
.ops-step-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.ops-mark { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.ops-mark.ok { color: var(--good-text); }
.ops-mark.bad { color: var(--bad-text); }
.ops-step .input-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-step .input-row .input { flex: 1 1 220px; min-width: 0; }
.ops-step .howto { margin: 0; }
.warn-text { color: var(--warn-text); }
.accounts-table tr.acc-off td:not(.col-actions) { color: var(--text-3); }
.tag.tag-off { background: color-mix(in srgb, var(--bad-text) 14%, transparent); color: var(--bad-text); }
.check.full { align-items: flex-start; line-height: 1.4; }
.check.full input { flex: none; margin-top: 2px; }
/* Логин и пароль, которые нужно передать другу */
.creds-lead { margin: 0 0 12px; }
.creds { margin: 0; display: grid; gap: 8px; }
.creds > div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline;
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.creds dt { color: var(--text-3); font-size: 12.5px; }
.creds dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.creds dd.mono { user-select: all; letter-spacing: 0.02em; }
.creds dd a { font-weight: 600; }
.login-events { margin-top: 12px; border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 14px; }
.login-events summary { cursor: pointer; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.login-events[open] summary { margin-bottom: 10px; }
.mini-list.events li { grid-template-columns: 56px 1fr auto; font-size: 12.5px; }
.pill.warn-pill { background: color-mix(in srgb, var(--st-warning) 18%, transparent); color: var(--warn-text); }

/* ---------------- размер интерфейса ---------------- */
.zoom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 6px; font-size: 12px; color: var(--text-3); }
.zoom-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--surface-2); }
.zoom-switch button {
  display: grid; place-items: center; height: 26px; min-width: 28px; padding: 0 4px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.zoom-switch button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.zoom-switch button:disabled { opacity: .4; cursor: default; }
.zoom-switch .zoom-val { min-width: 46px; }
.zoom-switch.big button { height: 32px; min-width: 36px; font-size: 13px; }
.zoom-switch.big .zoom-val { min-width: 60px; }
.appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.appearance-row p { margin: 4px 0 0; max-width: 560px; }

/* ---------------- ниша канала ---------------- */
.niche-tag {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px 2px 6px; border: 0; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; line-height: 18px;
  white-space: nowrap; cursor: pointer; text-decoration: none; vertical-align: middle;
}
.niche-tag span { overflow: hidden; text-overflow: ellipsis; }
.niche-tag svg { color: var(--accent-text); flex: 0 0 auto; }
.niche-tag:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.niche-tag.plain { cursor: inherit; font-size: 12px; line-height: 16px; padding: 1px 7px 1px 5px; }
.niche-tag.plain:hover { background: var(--surface-3); color: var(--text); }
.kb-card .ch-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.alert-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.alert-title .ch-name { min-width: 0; }
.alert-title .niche-tag { flex: 0 1 auto; min-width: 0; font-size: 12px; line-height: 16px; }

/* ---------------- свой порядок каналов: ручка и перетаскивание ---------------- */
.channels-table .col-drag { width: 30px; padding-left: 6px; padding-right: 0; }
/* Разделы по группам (crm/groups.py): строка-заголовок раздела в той же таблице. */
.channels-table tr.grp-row td { height: auto; padding: 14px 9px 6px; background: var(--surface); border-bottom: 2px solid var(--border); }
.channels-table tr.grp-row:first-child td { padding-top: 8px; }
.grp-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 2px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.grp-toggle:hover { background: var(--surface-2); }
.grp-toggle svg { color: var(--text-3); }
.grp-toggle .n { padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; }
.grp-manage { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.grp-manage li { display: flex; align-items: center; gap: 8px; }
.grp-manage .input { flex: 1; min-width: 0; }
.grp-add { display: flex; gap: 8px; margin-top: 6px; }
.grp-add .input { flex: 1; min-width: 0; }
/* Поле с поиском (picker.js) и поиск в меню. */
.picker-box { position: relative; }
.pick-form { min-height: 320px; align-content: start; } /* окно из одного поля: список подсказок помещается без прокрутки */
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
  max-height: 260px; overflow: auto; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); }
.picker-list li { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.picker-list li.on, .picker-list li:hover { background: var(--surface-2); }
.picker-list li.muted { color: var(--text-3); }
.picker-list li.create, .menu-item.create { color: var(--accent-text); }
.menu-search { padding: 2px 2px 6px; position: sticky; top: -6px; background: var(--surface); z-index: 1; }
.menu-search .input { height: 36px; font-size: 13.5px; }
.drag-handle {
  display: grid; place-items: center; width: 24px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-3); cursor: grab; touch-action: none; opacity: .5;
}
tr:hover .drag-handle, .drag-handle:focus-visible { opacity: 1; }
.drag-handle:hover { background: var(--surface-3); color: var(--text); }
.reordering tr:not(.dragging) { transition: transform 150ms cubic-bezier(0.23, 1, 0.32, 1); }
.reordering tr:not(.dragging) td { pointer-events: none; }
.table tbody tr.dragging { position: relative; z-index: 3; }
.table tbody tr.dragging td { background: var(--surface); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.table tbody tr.dragging td:first-child { box-shadow: inset 1px 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.table tbody tr.dragging td:last-child { box-shadow: inset -1px 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.table tbody tr.dragging .drag-handle { opacity: 1; color: var(--accent-text); cursor: grabbing; }
body.row-dragging, body.row-dragging * { cursor: grabbing !important; user-select: none; }
@media (prefers-reduced-motion: reduce) {
  .reordering tr:not(.dragging) { transition: none; }
}

/* ---------------- ежемесячные траты ---------------- */
.oh-list { display: flex; flex-direction: column; gap: 6px; }
.oh-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 150px auto; align-items: center; gap: 6px 16px;
  padding: 10px 10px 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.oh-row.ended { opacity: .6; }
.oh-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oh-main b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oh-sum { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.oh-sum b { font-size: 15px; font-weight: 700; }
.oh-share { text-align: right; }
.oh-empty { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.oh-empty svg { color: var(--accent-text); }
@media (max-width: 640px) {
  .oh-row { grid-template-columns: minmax(0, 1fr) auto; }
  .oh-share { grid-column: 1; text-align: left; }
}

/* ---------------- детали фирменного оформления: в обычном виде скрыты ---------------- */
.chart-svg .bar-sheen { display: none; }

/* ---------------- выбор существующих каналов в нишу ---------------- */
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(52vh / var(--zoom, 1)); overflow: auto; margin: 10px -6px 8px; padding: 0 6px; }
.pick-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background-color 120ms ease;
}
.pick-row:hover { background: var(--surface-2); }
.pick-row.on { background: var(--accent-soft); }
.pick-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pick-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pick-text b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .pick-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .pick-row > .niche-tag, .pick-row > .badge, .pick-row > .muted { grid-column: 3; justify-self: start; }
}


/* ---------------- отзывы и страница «Продукт» (режим аккаунтов) ---------------- */
.fb-open { width: 100%; justify-content: center; }
.fb-lead { margin: 0 0 10px; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fb-chip { border: 2px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.fb-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.fb-title { font-size: 14px; margin: 16px 0 8px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.fb-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: baseline; font-size: 13px; }
.fb-text { min-width: 0; overflow-wrap: anywhere; }
.fb-kind { font-size: 12px; padding: 1px 8px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.fb-status { font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.fb-status.st-new { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.fb-status.st-accepted { background: color-mix(in srgb, var(--warn-text) 16%, transparent); color: var(--warn-text); }
.fb-status.st-done { background: color-mix(in srgb, var(--good-text) 16%, transparent); color: var(--good-text); }
.fb-items { display: grid; gap: 10px; }
.fb-item { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; min-width: 0; }
.fb-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.fb-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.seg { display: inline-flex; border: 2px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; }
.seg-btn { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.activity-table td { white-space: nowrap; }
.act-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 28px; vertical-align: middle; }
.act-bars i { display: block; width: 4px; min-height: 2px; border-radius: 2px; background: var(--accent); }
.act-bars i.zero { background: var(--surface-3); }
.main[data-page="product"] > .card + .card { margin-top: 16px; }
/* Первые шаги: карточка на дашборде и окно приветствия */
.ob-card { margin: 0 0 16px; }
.ob-progress { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; font-size: 13px; color: var(--text-2); }
.ob-progress b { flex: none; font-variant-numeric: tabular-nums; color: var(--text); }
.ob-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ob-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ob-step { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.ob-mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.ob-step.done .ob-mark { border-color: transparent; background: color-mix(in srgb, var(--st-good) 18%, transparent); color: var(--good-text); }
.ob-title { flex: 1 1 200px; min-width: 0; }
.ob-step.done .ob-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.ob-act { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-left: auto; }
.ob-hint { font-size: 12.5px; color: var(--text-3); }
.ob-done-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.ob-done-row h2 { margin: 0 0 2px; }
.ob-done-row p { margin: 0; }
.ob-done-row .grow { flex: 1 1 220px; min-width: 0; }
.ob-party { font-size: 30px; line-height: 1; }
.ob-welcome p { margin: 0 0 10px; line-height: 1.5; }
.ob-welcome p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .ob-bar span { transition: none; } }
.modal-foot.ob-foot { flex-wrap: wrap; }
.modal-foot.ob-foot [data-w="self"] { margin-right: auto; }
@media (max-width: 560px) { .modal-foot.ob-foot .btn { flex: 1 1 100%; justify-content: center; } }
/* Справка */
.help { display: grid; gap: 16px; max-width: 860px; }
.help-sec p, .help-sec li { line-height: 1.55; color: var(--text-2); }
.help-sec p { margin: 0 0 8px; }
.help-sec p:last-child { margin-bottom: 0; }
.help-sec ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-sec b { color: var(--text); }
.help-again { margin-top: 16px; }
/* Страница приглашения #/join */
.join-card form { display: flex; flex-direction: column; gap: 14px; }
.join-card form h1, .join-card > h1 { margin: 0; }
.join-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.join-alt { margin: 12px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
/* Приглашения в Настройках */
.inv-title { margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.inv-status { display: inline-block; padding: 1px 7px; border-radius: var(--radius-sm); font-size: 12px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.inv-status.st-pending { background: var(--accent-soft); color: var(--accent-text); }
.inv-status.st-accepted { background: color-mix(in srgb, var(--st-good) 16%, transparent); color: var(--good-text); }
.inv-link { width: 100%; font-size: 12.5px; }
/* Telegram для восстановления пароля (Настройки → «Доступ») */
.tg-block { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; }
.tg-head { display: flex; align-items: center; gap: 8px; }
.tg-block p { margin: 0; }
.tg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* Заявки и «Документы» */
.lead-item .fb-item-head a { font-weight: 700; }
.fb-status.st-lead-new { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.fb-status.st-lead-invited { background: color-mix(in srgb, var(--st-good) 16%, transparent); color: var(--good-text); }
.legal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
@media (max-width: 640px) { .legal-grid { grid-template-columns: minmax(0, 1fr); } }
.ok-text { color: var(--good-text); display: inline-flex; align-items: center; gap: 5px; }
/* Ссылки на документы на страницах входа и приглашения */
.legal-links { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); text-align: center; }
.legal-links a { color: var(--text-2); }
/* Тарифы: плашка о сроке, карточки «Тариф» и «Тарифы» */
.billing-bar { position: fixed; right: 16px; bottom: 16px; z-index: 40; max-width: min(460px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 16px; background: var(--surface); border: 2px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4; }
.billing-bar svg { flex: none; color: var(--text-2); }
.billing-bar.warn { border-color: color-mix(in srgb, var(--st-warning) 70%, transparent); background: color-mix(in srgb, var(--st-warning) 12%, var(--surface)); }
.billing-bar.warn svg { color: var(--warn-text); }
.billing-bar.bad { border-color: color-mix(in srgb, var(--st-critical) 55%, transparent); background: color-mix(in srgb, var(--st-critical) 9%, var(--surface)); }
.billing-bar.bad svg { color: var(--bad-text); }
.billing-bar .btn { flex: none; }
.plan-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 8px; }
.plan-name { font-size: 18px; }
.prices-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
@media (max-width: 640px) { .prices-grid { grid-template-columns: minmax(0, 1fr); } .billing-bar { right: 8px; left: 8px; bottom: 8px; max-width: none; } }
/* Сообщения не закрывают плашку тарифа */
body.has-billing-bar .toasts { bottom: 96px; }
@media (max-width: 640px) {
  body.has-billing-bar .toasts { bottom: 120px; }
  body.has-billing-bar .main { padding-bottom: 130px; } /* плашка тарифа не закрывает последние строки и кнопки */
}

/* ---------------- экономика: окна продажи и блок в карточке канала ---------------- */
.sale-total { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.sale-total.good { color: var(--good-text); }
.sale-total.bad { color: var(--bad-text); }
.seg-radio label { position: relative; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.seg-radio label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.bulk-prices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.bulk-prices li { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: 13px; }
.eco-sale { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.eco-sale .btns { display: flex; gap: 14px; margin-top: 4px; }
.eco-sale .link-btn { font-size: 13px; }
.eco-sale .link-btn.danger { color: var(--bad-text); }
.eco-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.eco-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.eco-nums div { min-width: 0; }
.eco-nums dt { font-size: 12px; color: var(--text-3); }
.eco-nums dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; }
.eco-payback { margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.eco-days { margin: 4px 0 0; font-size: 12.5px; }
.eco-more { margin-top: 10px; font-size: 13px; }
.eco-more summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.eco-more h3 { margin: 10px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.eco-list li { grid-template-columns: 1fr auto; }
@media (max-width: 640px) { .bulk-prices li { grid-template-columns: minmax(0, 1fr) 120px; } }
.eco-empty { margin: 4px 0 2px; font-size: 13px; }
/* «Экономика → Обзор»: кто кому должен, лучшие и в минусе */
.eco-debts { display: flex; flex-direction: column; gap: 8px; }
.eco-debt-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; font-size: 12px; font-weight: 800;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.eco-debt-h + .eco-debt, .eco-debt + .eco-debt { margin-top: 0; }
.eco-debt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: inherit; text-decoration: none; transition: background-color 140ms ease; }
.eco-debt:hover { background: var(--surface-3); }
.eco-debt small { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.eco-rank { list-style: none; margin: 0; padding: 0; }
.eco-rank a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 92px; gap: 10px; align-items: center; padding: 9px 2px;
  border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; font-size: 13.5px; }
.eco-rank li:last-child a { border-bottom: 0; }
.eco-rank a:hover b:first-of-type { text-decoration: underline; }
.eco-rank .n { color: var(--text-3); font-weight: 800; }
.eco-rank small { color: var(--text-3); font-weight: 600; text-align: right; }
.eco-rank .ellipsis small { text-align: left; }
.eco-note-s { margin: 10px 0 0; }
.eco-bars .hb-row { grid-template-columns: minmax(84px, 150px) minmax(40px, 1fr) auto; }
.eco-bars .hb-value { white-space: nowrap; min-width: 110px; }
@media (max-width: 640px) { .eco-bars .hb-row { grid-template-columns: minmax(70px, 110px) minmax(30px, 1fr) auto; } .eco-bars .hb-value { min-width: 0; } }
@media (max-width: 640px) { .eco-rank a { grid-template-columns: 18px minmax(0, 1fr) auto; } .eco-rank a > small:last-child { display: none; } }
/* Плитки-кнопки «Доход» / «Расходы» и окно «Из чего сложилось» (breakdown-ui.js) */
button.tile-btn { display: block; width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease; }
button.tile-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(30, 27, 46, .14); }
button.tile-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-btn .tile-label svg { vertical-align: -2px; opacity: .7; }
.bd { display: flex; flex-direction: column; gap: 14px; }
.bd-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.bd-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-2); }
.bd-group { border-radius: var(--radius-sm); background: var(--surface-2); }
.bd-group + .bd-group { margin-top: 8px; }
.bd-group > summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 160px) auto 40px; gap: 12px; align-items: center;
  padding: 10px 14px; cursor: pointer; list-style: none; }
.bd-group > summary::-webkit-details-marker { display: none; }
.bd-name { display: flex; flex-direction: column; min-width: 0; }
.bd-name small { color: var(--text-3); font-size: 12px; font-weight: 600; }
.bd-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bd-bar i { display: block; height: 100%; border-radius: 4px; background: var(--c-orange); }
.bd-pc { text-align: right; font-size: 12.5px; }
.bd-list { list-style: none; margin: 0; padding: 0 14px 10px; }
.bd-list li { display: grid; grid-template-columns: 88px minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 10px; align-items: baseline; padding: 6px 0;
  border-top: 1px solid var(--border); font-size: 13px; }
.bd-note { margin: 0; padding: 0 14px 12px; }
.bd-empty { margin: 6px 0; }
.bd > .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .bd > .segmented button { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
  .bd-group > summary { grid-template-columns: minmax(0, 1fr) auto; } .bd-bar, .bd-pc { display: none; }
  .bd-list li { grid-template-columns: 70px minmax(0, 1fr) auto; } .bd-list li > span:nth-child(3) { display: none; }
}
/* «Экономика → Банк» (economics-bank.js) и окно «Расход» (bank-ui.js) */
.bank-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-chips { margin: 4px 0 12px; }
.bank-days { display: flex; flex-direction: column; gap: 14px; }
.bank-day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.bank-list { list-style: none; margin: 0; padding: 0; }
.bank-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 7px 2px; font-size: 13.5px; }
.bank-list li + li { border-top: 1px dashed var(--border); }
.bank-list li.click { cursor: pointer; border-radius: var(--radius-xs); }
.bank-list li.click:hover { background: var(--surface-2); }
.bank-kind { justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.bank-kind.k-income { background: var(--p-mint); color: var(--p-mint-text); }
.bank-kind.k-salary { background: var(--p-sky); color: var(--p-sky-text); }
.bank-kind.k-subscription { background: var(--p-butter); color: var(--p-butter-text); }
.bank-kind.k-project { background: var(--p-peach); color: var(--p-peach-text); }
.bank-kind.k-draw { background: var(--p-lilac); color: var(--p-lilac-text); }
.bank-kind.k-adjust { background: var(--p-rose); color: var(--p-rose-text); }
.bank-start .card-foot { border-top: 0; padding-top: 0; }
.bx-pick { display: flex; flex-direction: column; gap: 8px; }
.bx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; max-height: 260px; overflow: auto;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.bx-list .check { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
@media (max-width: 640px) { .bank-list li { grid-template-columns: minmax(0, 1fr) auto; } .bank-kind { grid-column: 1 / -1; } }
/* «Банк → Отложено»: копилки */
.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-list li { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(80px, 200px) auto auto; grid-template-areas: "name bar sum acts" "sub bar sum acts";
  gap: 2px 14px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.rv-name { grid-area: name; justify-self: start; text-align: left; }
.rv-sub { grid-area: sub; }
.rv-bar { grid-area: bar; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: 4px; background: var(--c-violet); }
.rv-sum { grid-area: sum; white-space: nowrap; }
.rv-acts { grid-area: acts; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) {
  .rv-list li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name sum" "sub sum" "bar bar" "acts acts"; }
  .rv-acts { justify-content: flex-start; }
}
/* «Экономика» — общая полоса вкладок над журналом, продажами, выплатами и направлениями (eco-tabs.js) */
.eco-tabs { display: flex; gap: 2px; width: max-content; max-width: 100%; margin: 0 0 16px; padding: 4px; overflow-x: auto;
  border-radius: var(--radius-md); background: var(--surface-3); scrollbar-width: none; }
.eco-tabs::-webkit-scrollbar { display: none; }
.eco-tabs a { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 700; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background-color 140ms ease, color 140ms ease; }
.eco-tabs a:hover { color: var(--text); }
.eco-tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(30, 27, 46, .12); }
.eco-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.eco-note { margin: 30px 0 0; }
.eco-table td .small { font-size: 12px; }
.eco-table a { color: inherit; text-decoration: none; }
.eco-table a:hover { text-decoration: underline; }
/* «Экономика → Выплаты и траты»: полосы по месяцам (команде / подписки / себе) и метка прибыли */
.mo-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); }
.mo-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -6px; vertical-align: -1px; }
.mo-legend i.mo-profit-key { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }
.mo-list { display: flex; flex-direction: column; gap: 10px; }
.mo-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 230px; gap: 14px; align-items: center; }
.mo-label { font-weight: 700; font-size: 13.5px; }
.mo-track { position: relative; display: flex; height: 14px; border-radius: 7px; background: var(--surface-3); overflow: visible; }
.mo-track i { display: block; height: 100%; transition: width .5s var(--ease-out); }
.mo-track i:first-child { border-radius: 7px 0 0 7px; }
.mo-team { background: var(--c-blue); }
.mo-oh { background: var(--c-violet); }
.mo-draw { background: var(--c-orange); }
.mo-profit { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.mo-nums { text-align: right; white-space: nowrap; }
.mo-people { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; }
.money-list .row-actions { display: inline-flex; gap: 2px; }
@media (max-width: 640px) {
  .mo-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .mo-track { grid-column: 1 / -1; grid-row: 2; }
}
.eco-buyers li { grid-template-columns: minmax(0, 1fr) auto auto; }

/* ---------------- направления и площадки ---------------- */
.dir-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dir-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.dir-item:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.dir-item input { margin-top: 3px; flex: 0 0 auto; }
.dir-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.dir-item .muted { font-size: 12px; }
@media (max-width: 640px) { .dir-list { grid-template-columns: 1fr; } }
.avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.pf-badge { position: absolute; right: -3px; bottom: -3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; line-height: 1; color: #fff; background: var(--pf, var(--c-gray));
  box-shadow: 0 0 0 2px var(--surface); }
.type-pick { flex-wrap: wrap; height: auto; }
.type-pick button:disabled { cursor: default; }
.income-types td .sub-line { display: block; max-width: 460px; }
td.c { text-align: center; }

/* ============================================================
   «Студия»: страницы
   ============================================================ */
/* Шапка дашборда — без тёмной полосы, аватарки каналов в работе под подзаголовком */
.head-band { margin-bottom: 4px; }
.head-avatars { display: inline-flex; align-items: center; margin-top: 12px; padding-left: 8px; color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 700; text-decoration: none; }
.head-avatars .avatar { margin-left: -8px; box-shadow: 0 0 0 3px #231E57; transition: transform 180ms var(--ease-out); }
.head-avatars:hover .avatar { transform: translateY(-2px); }
.head-avatars:hover { text-decoration: none; color: #fff; }
.head-avatars .more { margin-left: -6px; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 34%;
  background: var(--highlight); color: var(--on-highlight); font-size: 12px; box-shadow: 0 0 0 3px #231E57; }
.head-avatars .label { margin-left: 10px; }
/* Мини-график в плитке — линия цвета текста плитки */
.tile { padding-bottom: 50px; }
.tile-spark { position: absolute; left: 18px; right: 18px; bottom: 14px; width: calc(100% - 36px); height: 26px; color: var(--tile-text); opacity: .55; }
.tile-spark .sp-area { opacity: .5; }
@media (hover: hover) { .tiles > .tile { transition: transform 180ms var(--ease-out); } .tiles > .tile:hover { transform: translateY(-2px); } }
/* Полоса этапов — тонкая цветная шкала; подписи — в списке ниже (и во всплывающей подсказке) */
.stage-strip { display: flex; gap: 4px; height: 16px; margin: 4px 0 18px; min-width: 0; }
.stage-strip a { min-width: 6px; border-radius: 6px; background: var(--dot); transition: transform 160ms var(--ease-out), filter 160ms ease; }
.stage-strip a:hover { transform: scaleY(1.25); filter: saturate(1.15); }
.stage-strip span, .stage-strip b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Большие цифры — Unbounded */
.big-count b, .fn-foot b, .sum-strip b, .eco-nums dd, .oh-sum b, .plan-name, .kb-sum { font-family: var(--font-display); letter-spacing: -0.03em; }
.big-count b { font-size: 30px; }
.hb-track { height: 12px; }
.hb-bar { border-radius: 0 6px 6px 0; }
.count-pill { background: var(--accent); color: #fff; }
/* Полоса массовых действий — тёмная */
.bulk-bar { background: var(--ink); color: var(--on-ink); border: 0; border-radius: 18px; padding: 10px 14px; }
.bulk-bar .btn { background: transparent; border-color: color-mix(in srgb, var(--on-ink) 25%, transparent); color: var(--on-ink); }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); }
.bulk-bar .btn-danger { color: #FF9C88; }
:root[data-theme="dark"] .bulk-bar .btn-danger { color: #B42F18; }
/* Канбан */
.kb-col { border: 0; background: var(--surface-3); border-radius: 22px; }
:root[data-theme="dark"] .kb-col { background: var(--surface-2); }
.kb-col.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.kb-head { padding: 14px 14px 10px; }
.kb-list { padding: 0 10px 12px; }
.kb-card { border-radius: 16px; border: 2px solid var(--border); box-shadow: none; padding: 12px 13px; transition: transform 160ms var(--ease-out), border-color 140ms ease; }
.kb-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kb-empty { border-radius: 14px; }
/* Карточка канала */
.ch-head h1 { font-size: 26px; }
.info-chip { border-radius: 14px; background: var(--surface); }
.back-link { font-weight: 700; }
/* Строки задач и настройки */
.alert-row { border-radius: 14px; }
.ob-step, .oh-row, .oh-empty, .st-row, .creds > div, .ops-step, .fb-item, .tg-block, .howto, .login-events, .pour-line, .lookup, .sale-total, .eco-sale {
  border-radius: 14px; background: var(--surface-2);
}
.ob-bar span { background: var(--accent); }
.ob-mark { border-width: 2px; }
.pill { border-radius: 10px; font-weight: 700; }
.pill.ok { background: var(--p-mint); color: var(--p-mint-text); }
/* Плашка тарифа */
.billing-bar { border-radius: 18px; border: 2px solid var(--border); }
.billing-bar.warn { background: var(--p-butter); color: var(--p-butter-text); border-color: transparent; }
.billing-bar.bad { background: var(--p-rose); color: var(--p-rose-text); border-color: transparent; }
.billing-bar.warn svg, .billing-bar.bad svg { color: inherit; }
/* Вход и приглашение */
.login-card { border-radius: 28px; padding: 32px 30px; }
.login-card h1 { font-size: 22px; }
/* Направления */
.dir-item { border-radius: 16px; }
.dir-item:has(input:checked) { border-color: transparent; background: var(--p-mint); color: var(--p-mint-text); }
.dir-item:has(input:checked) .muted { color: inherit; opacity: .85; }
.pf-badge { border-radius: 6px; }
/* Графики: столбцы со скруглением */
.chart-svg .tick { font-weight: 600; }
.chart-legend { font-weight: 600; }

/* ---------------- монетизация YPP ---------------- */
.ypp-rows { display: flex; flex-direction: column; gap: 10px; }
.ypp-row { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) auto; gap: 14px 22px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--surface-2); }
.ypp-who { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.ypp-who .ch-cell { max-width: 100%; color: inherit; }
.ypp-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ypp-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.ypp-card .ypp-bars { grid-template-columns: 1fr; gap: 12px; }
.ypp-bar { min-width: 0; }
.ypp-bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.ypp-bar-head b { color: var(--text); font-weight: 800; }
.ypp-track { height: 10px; margin-top: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.ypp-track span { display: block; height: 100%; border-radius: 6px; background: var(--c-violet); transition: width .5s var(--ease-out); }
.ypp-bar.done .ypp-track span { background: var(--c-green); }
.ypp-note { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ypp-ready { margin-top: 10px; display: inline-block; padding: 5px 11px; border-radius: 10px; background: var(--p-mint); color: var(--p-mint-text); font-size: 12.5px; font-weight: 800; }
.ypp-since { margin: 0 0 4px; font-weight: 700; color: var(--good-text); }
.ypp-h3 { margin: 16px 0 8px; font-size: 13px; font-weight: 600; }
.ypp-card-acts { margin-top: 12px; margin-left: 0; }
.ypp-months { margin: 0; }
.badge-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text-2); cursor: pointer; }
@media (max-width: 1100px) { .ypp-row { grid-template-columns: minmax(0, 1fr); } .ypp-acts { flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 640px) { .ypp-bars { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- «Пульс сети» в боковой панели ---------------- */
.pulse-slot { margin: 12px 2px 0; }
.pulse { position: relative; isolation: isolate; overflow: hidden; padding: 14px 14px 12px; border-radius: 20px; color: #fff;
  background: radial-gradient(90% 120% at 0% 0%, rgba(140, 108, 255, .55), transparent 60%), radial-gradient(80% 120% at 100% 100%, rgba(31, 181, 165, .35), transparent 60%),
    linear-gradient(150deg, #1B1840, #231E57 60%, #19284F); box-shadow: 0 14px 30px rgba(27, 24, 64, .2); }
.pulse::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .15) 1px, transparent 1.3px); background-size: 14px 14px; }
.pulse-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .72); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #3FCB83; box-shadow: 0 0 0 4px rgba(63, 203, 131, .25); animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 7px rgba(63, 203, 131, 0); } }
.pulse-tasks { display: flex; align-items: baseline; gap: 7px; margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none; transition: background .15s; }
.pulse-tasks:hover { background: rgba(255, 255, 255, .18); text-decoration: none; }
.pulse-tasks b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.pulse-views { display: block; width: calc(100% + 12px); margin: 4px -6px 0; padding: 6px 6px 2px; border: 0; border-radius: 12px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.pulse-views:hover { background: rgba(255, 255, 255, .08); }
.pulse-views:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.pulse-views:active { transform: translateY(1px); }
.pulse-more { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .74); }
.pulse-views:hover .pulse-more { color: #fff; }
.pulse-num { display: block; }
.pulse-num b svg { margin-left: 2px; vertical-align: -1px; opacity: .55; transition: opacity .15s, transform .15s; }
.pulse-views:hover .pulse-num b svg { opacity: 1; transform: translateX(2px); }
.pulse-head-r { display: inline-flex; align-items: center; gap: 6px; }
.pulse-head-r > svg { display: none; opacity: .7; }
/* ↻ «Обновить статистику» — в шапке «Пульса», рядом с точкой; на телефоне — крупнее под палец */
.pulse-refresh { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -6px -2px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: rgba(255, 255, 255, .72); cursor: pointer; transition: background .15s, color .15s; }
.pulse-refresh:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pulse-refresh:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.pulse-refresh:disabled { cursor: progress; color: #fff; }
@media (pointer: coarse) { .pulse-refresh { width: 36px; height: 36px; margin: -10px -6px; } }
.pulse-num b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pulse-num span { font-size: 12px; color: rgba(255, 255, 255, .74); }
.pulse-num em { margin-left: 6px; font-style: normal; font-size: 12px; font-weight: 800; color: #8EE6B4; }
.pulse-num em.down { color: #FFB3A3; }
.pulse-spark { display: block; width: 100%; height: 42px; margin-top: 8px; }
.pulse-spark polygon { fill: rgba(142, 230, 180, .22); }
.pulse-spark polyline { fill: none; stroke: #8EE6B4; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pulse-foot { margin-top: 8px; font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .7); }
.pulse-slot.compact .pulse-spark, .pulse-slot.compact .pulse-foot { display: none; }
.pulse-slot.tiny .pulse-num, .pulse-slot.tiny .pulse-views { display: none; }
.pulse-slot.tiny .pulse-head-r > svg { display: block; }
.pulse[data-day-views] { cursor: pointer; }
.pulse-slot.off { display: none; }

/* «Просмотры за день» (окно из «Пульса»): высота постоянная — при смене дня и разреза кнопки не уезжают из-под мыши */
dialog.modal.dv-modal { width: min(940px, calc(100vw / var(--zoom, 1) - 32px)); height: min(900px, calc(100vh / var(--zoom, 1) - 48px));
  height: min(900px, calc(100dvh / var(--zoom, 1) - 48px)); }
.dv { display: flex; flex-direction: column; gap: 14px; transition: opacity .15s; }
.dv.busy { opacity: .6; }
.dv-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.dv-nav { display: flex; align-items: center; gap: 4px; }
.dv-date { min-width: 150px; text-align: center; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.dv-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; color: var(--text-2); font-size: 13px; }
.dv-total { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.dv-delta { font-style: normal; font-weight: 800; color: var(--good-text); }
.dv-delta.down { color: var(--bad-text); }
.dv-all { margin-left: auto; font-weight: 600; color: var(--text-2); }
.dv-err { margin: 0; color: var(--bad-text); }
.dv-chart { position: relative; padding-top: 16px; }
.dv-max { position: absolute; top: 0; left: 0; font-size: 11px; }
.dv-bars { display: flex; align-items: flex-end; gap: 2px; height: 84px; border-bottom: 1px solid var(--border); }
.dv-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; border-radius: 4px 4px 0 0; background: none; cursor: pointer; }
.dv-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--c-violet) 42%, transparent); transition: background .15s; }
.dv-bar:hover { background: var(--surface-2); }
.dv-bar:hover i { background: color-mix(in srgb, var(--c-violet) 70%, transparent); }
.dv-bar.on i { background: var(--c-violet); }
.dv-bar.on { background: color-mix(in srgb, var(--c-violet) 10%, transparent); }
.dv-bar.none { cursor: default; }
.dv-bar:focus-visible { outline: 2px solid var(--c-violet); outline-offset: 1px; }
.dv-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 11.5px; }
.dv-axis span:nth-child(2) { text-align: center; }
.dv-list { display: flex; flex-direction: column; }
.dv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(50px, 150px) 92px 58px 108px; gap: 12px; align-items: center; padding: 7px 8px; border-radius: var(--radius-sm); }
.dv-row .r { text-align: right; }
.dv-list > .dv-row:not(.dv-head):hover, .dv-sub > .dv-row:hover { background: var(--surface-2); }
.dv-head { padding-block: 0 4px; font-size: 11.5px; font-weight: 700; }
.dv-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dv-who a { color: var(--text); font-weight: 700; }
.dv-who small { flex: none; font-size: 11.5px; font-weight: 600; }
.dv-ico { display: inline-flex; flex: none; color: var(--text-3); }
.dv-caret { display: inline-flex; flex: none; margin-right: -4px; color: var(--text-3); transition: transform .15s; }
.dv-group[open] .dv-caret { transform: rotate(90deg); }
.dv-share { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.dv-share i { display: block; height: 100%; border-radius: 4px; background: var(--c-violet); }
.dv-pc { font-size: 12.5px; color: var(--text-2); }
.dv-ch { font-size: 12.5px; font-weight: 700; }
.dv-ch.up { color: var(--good-text); }
.dv-ch.down { color: var(--bad-text); }
.dv-group > summary { list-style: none; cursor: pointer; }
.dv-group > summary::-webkit-details-marker { display: none; }
.dv-group > summary:hover { background: var(--surface-2); }
.dv-group[open] > summary { background: var(--surface-2); }
.dv-sub { margin: 2px 0 6px 22px; padding-left: 8px; border-left: 2px solid var(--surface-3); }
.dv-empty { padding: 18px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.dv-empty p { margin: 0 0 10px; color: var(--text-2); }
.dv-empty p:last-child { margin: 0; }
.dv-notes p { margin: 0 0 4px; }
@media (max-width: 640px) {
  .dv-row { grid-template-columns: minmax(0, 1fr) 70px 52px; gap: 8px; padding-inline: 4px; }
  .dv-row > :nth-child(2), .dv-row > :nth-child(5), .dv-who small { display: none; }
  .dv-sub { margin-left: 8px; }
  .dv-axis span:nth-child(2) { display: none; }
  .dv-all { margin-left: 0; }
}
#sidebar.tight .brand { padding-bottom: 14px; }
#sidebar.tight .nav a { padding-block: 7px; }
/* Пунктов меню много (все направления включены) — ещё плотнее, чтобы «Пульс» остался на экране 900 px. */
#sidebar.tighter .brand { padding-bottom: 8px; }
#sidebar.tighter .nav { gap: 1px; }
#sidebar.tighter .nav a { padding-block: 5px; }
@media (max-width: 860px) { .pulse-slot { display: none; } }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }

/* ---------------- «Горизонт»: волны и свечение внизу экрана — короткие страницы не выглядят пустыми ---------------- */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; z-index: 0; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='1.4'%3E%3Cpath d='M0 210 C 200 150 400 270 600 210 S 1000 150 1200 210' stroke='%238C6CFF' stroke-opacity='.35'/%3E%3Cpath d='M0 235 C 220 175 420 285 620 230 S 1010 175 1200 235' stroke='%232E9BFF' stroke-opacity='.28'/%3E%3Cpath d='M0 258 C 240 205 440 300 640 252 S 1020 200 1200 258' stroke='%231FB5A5' stroke-opacity='.26'/%3E%3Cpath d='M0 185 C 180 130 380 245 580 190 S 990 125 1200 185' stroke='%23FF6FAE' stroke-opacity='.16'/%3E%3C/g%3E%3C/svg%3E") bottom / 100% 70% no-repeat,
    radial-gradient(45% 70% at 22% 100%, rgba(140, 108, 255, .16), transparent 70%),
    radial-gradient(40% 65% at 86% 100%, rgba(46, 155, 255, .15), transparent 70%),
    radial-gradient(30% 50% at 56% 100%, rgba(31, 181, 165, .12), transparent 70%); }
:root[data-theme="dark"] body::after { opacity: .8; }

/* ---------------- сводки под таблицами (ниши, каналы) ---------------- */
.insights { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.insight .card-head { margin-bottom: 12px; }
.ins-bars { display: grid; gap: 4px; }
.ins-row { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 6px; margin: 0 -6px;
  border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 600; text-align: left; text-decoration: none; }
a.ins-row, button.ins-row { cursor: pointer; transition: background .15s; }
a.ins-row:hover, button.ins-row:hover { background: var(--surface-2); text-decoration: none; }
.ins-track { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.ins-track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--c-green); transition: width .5s var(--ease-out); }
.ins-track span.neg { background: var(--c-orange); }
.ins-v { min-width: 56px; text-align: right; }
.ins-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ins-cell { display: grid; gap: 2px; padding: 14px; border: 0; border-radius: 16px; background: var(--cell); color: var(--cell-text); text-align: left; cursor: pointer;
  transition: transform .15s var(--ease-out); }
.ins-cell:hover { transform: translateY(-2px); }
.ins-cell b { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.ins-cell span { font-size: 12.5px; font-weight: 700; }
.spotlight { position: relative; isolation: isolate; overflow: hidden; display: block; color: #fff; text-decoration: none; border: 0;
  background: radial-gradient(80% 120% at 100% 0%, rgba(46, 155, 255, .5), transparent 60%), radial-gradient(70% 100% at 0% 100%, rgba(140, 108, 255, .45), transparent 60%),
    linear-gradient(150deg, #1B1840, #231E57 60%, #19284F); }
.spotlight::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.3px); background-size: 16px 16px; }
.spotlight:hover { text-decoration: none; }
.spotlight h2 { color: rgba(255, 255, 255, .75); }
.spot-name { margin: 10px 0 4px; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.spot-line { color: rgba(255, 255, 255, .85); font-weight: 600; }
.spot-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.spot-stats b { display: block; font-family: var(--font-display); font-size: 18px; }
.spot-stats span { font-size: 12px; color: rgba(255, 255, 255, .72); }
@media (max-width: 1180px) { .insights { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .insights > :first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .insights { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- команда: задачи, проверка, экран исполнителя ---------------- */
.team-board { grid-auto-columns: minmax(200px, 1fr); }
.team-card { display: grid; gap: 6px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.team-title { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.task-view { display: grid; gap: 14px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.task-brief { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.task-result { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; font-weight: 600; }
.task-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task-log li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.task-log-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.team-ch-list li { display: block; padding: 0; }
.link-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; margin: 0 -6px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.link-row:hover { background: var(--surface-2); }
.link-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.link-row .sub-line { font-size: 12px; font-weight: 600; color: var(--text-3); }
.link-row .badge { flex: none; }
.my-logout { display: none; }
@media (max-width: 860px) { .my-logout { display: flex; } }
/* ---------------- выплаты команде: итоги, начисления, выплаты ---------------- */
.money-view { display: grid; gap: 16px; }
.money-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.money-tiles > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.money-tiles span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.money-tiles b { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.money-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.money-terms { margin: 0 0 6px; overflow-wrap: anywhere; }
.money-list { list-style: none; margin: 0; padding: 0; display: grid; }
.money-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.money-list li:last-child { border-bottom: 0; }
.money-list .ellipsis { white-space: normal; overflow-wrap: anywhere; }
.money-list .sub-line { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); }
.money-date { color: var(--text-3); font-variant-numeric: tabular-nums; }
.pay-preview { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; }
.pay-preview ul { margin: 6px 0 0; padding-left: 18px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; max-height: 220px; overflow: auto; }
.my-money { margin-top: 14px; }
/* ---------------- заказы клиентов: строки заказа, прогресс ---------------- */
.item-rows { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) 74px 96px 32px; gap: 8px; align-items: center; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ord-progress { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ord-bar { width: 56px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.ord-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c-green, #3FCB83); }
a.ord-card { text-decoration: none; }
/* ---------------- шортс-стримы: календарь 30 дней, серия ---------------- */
.st-cal { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 4px; margin: 6px 0 12px; }
.st-day { aspect-ratio: 1; border-radius: 5px; background: var(--surface-3); }
.st-day.ok { background: var(--c-green); }
.st-day.part { background: color-mix(in srgb, var(--st-warning) 75%, var(--surface)); }
.st-day.miss { background: color-mix(in srgb, var(--bad-text) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad-text) 60%, transparent); }
.st-day.off { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.st-day.today { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
/* На телефоне у задачи стрима — только галочка, чтобы было видно название канала. */
@media (max-width: 640px) { .alert-row [data-stream-done] .sd-label, .alert-row [data-clip-add] .sd-label { display: none; } }
/* Клиппинг (clips-ui.js, pages/clipping.js, pages/clip-campaign.js) */
.clip-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "url acts" "meta nums"; gap: 2px 12px; align-items: center; }
.clip-list .clip-url { grid-area: url; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-list .clip-acts { grid-area: acts; white-space: nowrap; }
.clip-list .clip-meta { grid-area: meta; min-width: 0; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-list .clip-nums { grid-area: nums; font-size: 12.5px; color: var(--text-2); white-space: nowrap; text-align: right; }
.clip-name > a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.clip-budget { display: block; height: 6px; margin-top: 6px; min-width: 90px; }
.clip-budget span { display: block; height: 100%; background: var(--c-green); border-radius: inherit; }
.clip-budget span.neg { background: var(--c-orange); }
.clip-budget-row { margin-top: 12px; }
.clip-preview { margin-top: 12px; }
.clip-preview:empty { display: none; }
.clip-name { min-width: 0; max-width: 340px; }
/* Поиск рекламодателей (scout-ui.js): находки из описаний, каналы с рекламой, места «где замечен». */
.scout-finds { margin-bottom: 16px; }
.scout-find-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.scout-find-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.scout-find-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.scout-key-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scout-key { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scout-samples { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.scout-samples a { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.scout-find-acts { display: flex; gap: 8px; flex-shrink: 0; }
.scout-ch-list li { display: flex; align-items: center; gap: 10px; }
.scout-ch-text { display: grid; min-width: 0; flex: 1; }
.scout-sight-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
@media (max-width: 700px) {
  .scout-find-list li { flex-direction: column; align-items: stretch; }
  .scout-find-acts .btn { flex: 1; }
}
@media (max-width: 760px) {
  .scout-table thead { display: none; }
  .scout-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .scout-table td, .scout-table td:first-child, .scout-table td.r { display: block; padding: 0; border: 0; text-align: left; }
  .scout-table td:first-child { grid-column: 1 / -1; }
  .scout-table td[data-label]::before { content: attr(data-label) " "; color: var(--text-3); font-size: 12px; font-weight: 600; }
}
/* Клип исполнителя «не засчитан» — ссылка приглушена и зачёркнута; исполнитель строки «Клипы» — под строкой заказа. */
.clip-off .clip-url, .clip-off .clip-name > a { opacity: .55; text-decoration: line-through; }
.item-row .item-member { grid-column: 1 / -1; }
.item-row .item-member[hidden] { display: none; }
@media (max-width: 760px) {
  .clip-table thead { display: none; }
  .clip-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .clip-table td { display: block; padding: 0; border: 0; text-align: left; }
  .clip-table td.clip-name { grid-column: 1 / -1; max-width: none; }
  .clip-table td.clip-btn { grid-column: 1 / -1; text-align: left; }
  .clip-table td[data-label]::before { content: attr(data-label) " "; color: var(--text-3); font-size: 12px; font-weight: 600; }
}
.st-streak { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.st-week { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ad-payments .sub-line { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); }
@media (max-width: 640px) {
  .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .item-row [name=item_title] { grid-column: 1 / -1; }
}
/* Телефон: строки «Выплат» — карточками: имя и кнопка, под ними «за месяц» и «к выплате». */
@media (max-width: 700px) {
  .pay-table thead { display: none; }
  .pay-table, .pay-table tbody { display: block; }
  .pay-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btn" "terms terms" "earned due";
    gap: 6px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .pay-table td { display: block; padding: 0; border: 0; }
  .pay-table td.hide-sm { display: none; }
  .pay-table .pay-name { grid-area: name; min-width: 0; }
  .pay-table .pay-terms { grid-area: terms; font-size: 12.5px; color: var(--text-2); }
  .pay-table .pay-btn { grid-area: btn; }
  .pay-table .pay-earned { grid-area: earned; text-align: left; }
  .pay-table .pay-due { grid-area: due; }
  .pay-table td[data-label]::before { content: attr(data-label) " "; color: var(--text-3); font-size: 12px; font-weight: 600; }
  .pay-table .pay-due .sub-line { display: none; }
}
@media (max-width: 560px) {
  .money-tiles { gap: 6px; }
  .money-tiles > div { padding: 10px; border-radius: 14px; }
  .money-tiles span { font-size: 11px; }
  .money-tiles b { font-size: 16px; }
}
.my-group { margin-top: 18px; }
.my-group h2 { margin: 0 0 10px; font-size: 16px; }
.my-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.my-card { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow); }
.my-card:hover { border-color: var(--border-strong); }
.my-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

/* ---------------- реклама: сделки, размещения, прайс ---------------- */
.ad-chips { margin-bottom: 12px; }
.ad-avatars { display: inline-flex; align-items: center; padding-left: 6px; }
.ad-avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.ad-avatars .more { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.ad-upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ad-upcoming a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px;
  border-radius: 12px; color: inherit; text-decoration: none; }
.ad-upcoming a:hover { background: var(--surface-2); text-decoration: none; }
.ad-up-text { display: grid; min-width: 0; font-size: 13px; }
.ad-up-date { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ad-pl-table td { vertical-align: middle; }
.ad-payments li { gap: 8px; }
.ad-payments li > span:first-child { flex: 1; }
.ad-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-ch-list a { flex: 1; min-width: 0; display: grid; color: inherit; text-decoration: none; }
.ad-ch-list a:hover b { text-decoration: underline; }
.rates-form { display: grid; gap: 8px; }
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px; align-items: center; gap: 10px; font-weight: 600; }
@media (max-width: 560px) { .rate-row { grid-template-columns: minmax(0, 1fr) 80px 96px; font-size: 13px; } }

/* ---------------- перепродажа: файлы, доступы, паспорт и ссылка ---------------- */
.resale-grid { margin-top: 16px; }
.rs-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-3); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--good-text); background: var(--p-mint); }
.icon-btn.danger:hover { color: var(--bad-text); background: var(--p-rose); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.files-card { transition: box-shadow .2s, background .2s; }
.files-card.drag { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface-2); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.shot { margin: 0; min-width: 0; border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.shot.buyer { box-shadow: inset 0 0 0 2px var(--p-mint); }
.shot-img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot-img img { display: block; width: 100%; height: 120px; object-fit: cover; }
.shot figcaption { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; font-size: 12.5px; font-weight: 600; }
.shot figcaption .ellipsis { flex: 1; min-width: 0; }
.shot-acts { display: flex; flex: none; }
.file-list { margin-top: 12px; }
.file-list li { gap: 10px; }
.file-list a { flex: 1; min-width: 0; color: inherit; display: inline-flex; gap: 6px; align-items: center; }
.files-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: 18px;
  text-align: center; color: var(--text-2); }
.files-empty p { margin: 0; max-width: 46ch; }
.files-empty kbd { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: inherit; font-size: 12px; font-weight: 700; }
.files-usage { margin: 12px 0 0; }
.shot-big { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 12px; }
.creds-filled { margin: 0; font-weight: 600; }
.creds-values { display: grid; gap: 8px; margin: 0; }
.creds-values div { min-width: 0; }
.creds-values dt { font-size: 12px; font-weight: 700; color: var(--text-3); }
.creds-values dd { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; min-width: 0; }
.creds-v { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; white-space: pre-wrap;
  overflow-wrap: anywhere; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); }
.creds-warn { margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--p-butter); color: var(--p-butter-text);
  font-size: 13px; font-weight: 600; }
.creds-log { margin: 10px 0 0; }
.sale-price { font-family: var(--font-display); font-size: 18px; }
.sale-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.share-row { display: flex; gap: 8px; }
.share-row .share-url { flex: 1; min-width: 0; font-size: 13px; }
.sale-card .small { margin: 8px 0 0; }
.select-sm { height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; width: auto; }
.creds-form .input, .creds-form .textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
@media (max-width: 640px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shot-img img { height: 96px; } }

/* ---------------- архив и проданные каналы ---------------- */
.sold-tag { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 8px; background: var(--p-rose); color: var(--p-rose-text);
  font-size: 11.5px; font-weight: 800; line-height: 18px; white-space: nowrap; vertical-align: 1px; }
.ch-head-meta .sold-tag { font-size: 12.5px; line-height: 22px; padding: 0 9px; }
.chip-archive svg { color: var(--text-3); }
.chip-archive.on svg { color: inherit; }
.kb-col-archive { min-height: 0; opacity: .85; }
.kb-col-archive .kb-empty { margin: 0 10px 12px; padding: 12px 8px; }

/* ---------------- планирование: роадмап канала (roadmap-ui.js) ---------------- */
.rm-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 14px; font-size: 13.5px; color: var(--text-2); }
.rm-summary > span { display: inline-flex; align-items: center; gap: 6px; }
.rm-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.rm-summary .warn, .rm-summary .warn b { color: var(--warn-text); }
.rm-summary .good { color: var(--good-text); }
.rm-hint { margin-left: auto; font-size: 12.5px; }
.rm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.rm-col { background: var(--surface-3); border: 2px solid transparent; border-radius: 22px; min-height: 140px; display: flex; flex-direction: column; transition: border-color .12s, background .12s; }
.rm-col.over { border-color: var(--accent); background: var(--accent-soft); }
.rm-col.arch { opacity: .8; }
.rm-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 14px; }
.rm-head b { font-size: 14px; }
.rm-head .n { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.rm-head .btn { margin-left: auto; }
.rm-list { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; flex: 1; }
.rm-step { background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .12s, transform .12s var(--ease-out); }
.rm-step:hover { border-color: var(--border-strong); }
.rm-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-step:active { cursor: grabbing; transform: scale(.98); }
.rm-step.dragging { opacity: .45; }
.rm-step.metric { border-style: dashed; }
.rm-day { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: none; letter-spacing: .01em; }
.rm-step.metric .rm-day { color: var(--accent-text); }
.rm-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.rm-note { font-size: 12.5px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rm-marks { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--good-text); }
.rm-blank { margin: 2px 0 4px; border: 2px dashed var(--border); border-radius: 14px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; padding: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.rm-blank:hover { color: var(--text); border-color: var(--border-strong); }
.rm-empty p { max-width: 560px; margin-left: auto; margin-right: auto; }
.rm-kind label span { display: inline-flex; align-items: center; gap: 6px; }
.rm-card .card-head { gap: 8px; }
.rm-card .rm-tpl { margin-left: auto; font-size: 12.5px; }
.rm-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 0 0 12px; }
.rm-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s var(--ease-out); }
.rm-stage { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 0 0 6px; }
.rm-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rm-check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-radius: 10px; }
.rm-check:hover { background: var(--surface-2); }
.rm-check label { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.rm-check input { margin-top: 2px; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.rm-ct { min-width: 0; overflow-wrap: anywhere; }
.rm-cd { display: block; font-size: 11px; font-weight: 700; color: var(--text-3); }
.rm-fact { display: block; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rm-check.done .rm-ct { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.rm-when { flex: none; font-size: 11.5px; color: var(--text-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; padding-top: 1px; }
.rm-check.behind .rm-when, .rm-check.behind .rm-fact { color: var(--warn-text); }
.rm-check.waiting .rm-when { color: var(--accent-text); }
.rm-other { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.rm-other summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 2px 4px; }
.rm-none { margin: 0 0 4px; }
@media (max-width: 767px) { .rm-summary .rm-hint { display: none; } .rm-board { grid-auto-columns: minmax(78vw, 1fr); } }

/* ---------------- планирование: доска (board.js) ---------------- */
:root {
  --wb-yellow: #FFF0A6; --wb-pink: #FFD5E0; --wb-green: #CDF2D5; --wb-blue: #D2E5FF; --wb-violet: #E4DBFF; --wb-orange: #FFE0C4;
  --wb-sticky-text: #2A2533; --wbl-ink: #2A2533; --wbl-red: #E5484D; --wbl-blue: #3E7BFA; --wbl-green: #23A065; --wbl-orange: #EC8420; --wbl-violet: #8B5CF6;
}
:root[data-theme="dark"] {
  --wb-yellow: #5A5122; --wb-pink: #5C2E3C; --wb-green: #224A2F; --wb-blue: #213C5E; --wb-violet: #3A3062; --wb-orange: #5D3D21;
  --wb-sticky-text: #F4F1FA; --wbl-ink: #ECE9F5; --wbl-red: #FF6B70; --wbl-blue: #6E9BFF; --wbl-green: #4CC488; --wbl-orange: #FFA552; --wbl-violet: #A98BFF;
}
.wb { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.wb-list { padding: 12px 8px; position: sticky; top: 12px; }
.wb-list-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.wb-li { display: flex; align-items: center; gap: 2px; border-radius: 12px; padding-right: 2px; }
.wb-li.on { background: var(--accent-soft); }
.wb-li:not(:hover):not(.on) .btn-icon { opacity: 0; }
.wb-li .btn-icon:focus-visible { opacity: 1; }
.wb-li-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13.5px;
  color: var(--text); text-align: left; padding: 8px 8px; cursor: pointer; border-radius: 12px; }
.wb-li.on .wb-li-name { font-weight: 700; color: var(--accent-text); }
.wb-li-name small { color: var(--text-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.wb-main { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.wb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.wb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wb-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.wb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.wb-tool { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--text-2);
  cursor: pointer; transition: background .12s, color .12s, transform .12s var(--ease-out); }
.wb-tool:hover { background: var(--surface-2); color: var(--text); }
.wb-tool:active { transform: scale(.94); }
.wb-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wb-tool.on { background: var(--ink); color: var(--on-ink); }
.wb-tool.danger:hover { color: var(--bad-text); }
.wb-zoomv { min-width: 52px; height: 34px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer;
  border-radius: 10px; font-variant-numeric: tabular-nums; }
.wb-zoomv:hover { background: var(--surface-2); }
.wb-state { font-size: 12px; color: var(--text-3); margin-right: 6px; white-space: nowrap; }
.wb-state .bad { color: var(--bad-text); }
.wb-props { display: inline-flex; align-items: center; gap: 10px; margin-left: 6px; }
.wb-swatches { display: inline-flex; align-items: center; gap: 4px; }
.wb-sw { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.wb-sw.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.wb-sw.lsw { border-radius: 50%; border: 0; }
.lsw.lc-ink { background: var(--wbl-ink); } .lsw.lc-red { background: var(--wbl-red); } .lsw.lc-blue { background: var(--wbl-blue); }
.lsw.lc-green { background: var(--wbl-green); } .lsw.lc-orange { background: var(--wbl-orange); } .lsw.lc-violet { background: var(--wbl-violet); }
.wb-w span { display: block; width: 18px; border-radius: 4px; background: currentColor; }
.wb-size { font-size: 12px; font-weight: 800; }
.wb-stage { position: relative; height: calc(100dvh - 300px); min-height: 460px; overflow: hidden; touch-action: none; outline: none; cursor: grab;
  background-color: var(--surface); background-image: radial-gradient(var(--border-strong) 1px, transparent 1.2px); }
.wb-stage.panning, .wb-stage.panning * { cursor: grabbing !important; }
.wb-stage[data-tool="sticky"], .wb-stage[data-tool="text"], .wb-stage[data-tool="frame"], .wb-stage[data-tool="arrow"], .wb-stage[data-tool="pen"] { cursor: crosshair; }
.wb-stage[data-tool="eraser"] { cursor: cell; }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.wb-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 2; }
.wb-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wb-line.sel { filter: drop-shadow(0 0 3px var(--accent)); }
.wb-line.preview { opacity: .7; }
.wb-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.wb-line.lc-ink { stroke: var(--wbl-ink); } .wb-line.lc-red { stroke: var(--wbl-red); } .wb-line.lc-blue { stroke: var(--wbl-blue); }
.wb-line.lc-green { stroke: var(--wbl-green); } .wb-line.lc-orange { stroke: var(--wbl-orange); } .wb-line.lc-violet { stroke: var(--wbl-violet); }
.wbf-ink { fill: var(--wbl-ink); } .wbf-red { fill: var(--wbl-red); } .wbf-blue { fill: var(--wbl-blue); }
.wbf-green { fill: var(--wbl-green); } .wbf-orange { fill: var(--wbl-orange); } .wbf-violet { fill: var(--wbl-violet); }
.wb-it { position: absolute; box-sizing: border-box; user-select: none; cursor: move; }
.ro .wb-it { cursor: default; }
.wb-it.sel { outline: 2px solid var(--accent); outline-offset: 3px; }
.wb-sticky { padding: 14px 16px; border-radius: 6px 6px 18px 6px; color: var(--wb-sticky-text); box-shadow: 0 6px 16px rgba(30, 20, 60, .12), 0 1px 2px rgba(30, 20, 60, .1);
  font-size: 15px; line-height: 1.4; overflow: hidden; z-index: 3; }
.wb-sticky .wb-txt, .wb-text .wb-txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-yellow { background: var(--wb-yellow); } .st-pink { background: var(--wb-pink); } .st-green { background: var(--wb-green); }
.st-blue { background: var(--wb-blue); } .st-violet { background: var(--wb-violet); } .st-orange { background: var(--wb-orange); }
.wb-text { z-index: 3; width: max-content; max-width: 640px; font-weight: 600; line-height: 1.25; padding: 2px 4px; border-radius: 6px; }
.wb-text.ts-14 { font-size: 14px; font-weight: 500; } .wb-text.ts-20 { font-size: 20px; } .wb-text.ts-32 { font-size: 32px; font-family: var(--font-display); font-weight: 700; }
.wb-text.lc-ink { color: var(--wbl-ink); } .wb-text.lc-red { color: var(--wbl-red); } .wb-text.lc-blue { color: var(--wbl-blue); }
.wb-text.lc-green { color: var(--wbl-green); } .wb-text.lc-orange { color: var(--wbl-orange); } .wb-text.lc-violet { color: var(--wbl-violet); }
.wb-frame { border: 2px dashed var(--border-strong); border-radius: 18px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); z-index: 1; }
.wb-ftitle { position: absolute; left: 4px; top: -28px; font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; }
.wb-img { z-index: 3; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(30, 20, 60, .12); }
.wb-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.wb-card { z-index: 3; background: var(--surface); border: 2px solid var(--border); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 6px 18px rgba(30, 20, 60, .1); }
.wb-card.gone { flex-direction: row; align-items: center; color: var(--text-3); font-size: 13px; }
.wb-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wb-card-name { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wb-card-name b { font-size: 14px; }
.wb-card-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.wb-card-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.wb-open { color: var(--text-3); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.wb-open:hover { background: var(--surface-2); color: var(--text); }
.wb-card-nums { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wb-card-nums b { color: var(--text); }
.wb-card-nums .good b { color: var(--good-text); } .wb-card-nums .bad b { color: var(--bad-text); }
.wb-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 4px; background: var(--surface); border: 2px solid var(--accent); cursor: nwse-resize; }
.wb-edit { position: absolute; z-index: 10; resize: none; border: 2px solid var(--accent); border-radius: 8px; padding: 12px 14px; font: inherit; font-size: 15px;
  line-height: 1.4; color: var(--wb-sticky-text); background: var(--surface); outline: none; box-shadow: 0 8px 24px rgba(30, 20, 60, .18); }
.wb-edit-text, .wb-edit-frame { color: var(--text); padding: 4px 8px; font-weight: 600; }
.wb-edit-frame { font-size: 13px; }
.wb-marquee { position: absolute; border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; pointer-events: none; z-index: 5; }
.wb-marquee.frame { border-style: dashed; border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.wb-pick { margin-top: 10px; max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.wb-pick-it { display: flex; align-items: baseline; gap: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; text-align: left; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; color: var(--text); }
.wb-pick-it:hover { background: var(--surface-2); }
.wb-empty p { max-width: 520px; margin-left: auto; margin-right: auto; }
@media (max-width: 900px) {
  .wb { grid-template-columns: 1fr; }
  .wb-list { position: static; }
  .wb-list nav { display: flex; gap: 4px; overflow-x: auto; }
  .wb-li .btn-icon { display: none; }
  .wb-stage { height: 64dvh; min-height: 360px; }
}

/* ---------------- планирование: цели и стратегия (goals-ui.js, strategy-ui.js) ---------------- */
.gl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.gl-sum { font-size: 13.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gl-sum b { color: var(--text); }
.gl-sum .warn { color: var(--warn-text); display: inline-flex; align-items: center; gap: 4px; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.gl-card { display: flex; flex-direction: column; gap: 12px; }
.gl-card.behind { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn-text) 35%, transparent); }
.gl-top { display: flex; align-items: flex-start; gap: 8px; }
.gl-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gl-title h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.gl-warn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn-text); }
.gl-nums { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; font-variant-numeric: tabular-nums; }
.gl-nums b { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.gl-pace { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); }
.gl-nums .gl-pace { margin-left: auto; }
.gl-pace.good { color: var(--good-text); } .gl-pace.warn { color: var(--warn-text); } .gl-pace.bad { color: var(--bad-text); }
.gl-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); }
.gl-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease-out); }
.gl-card.achieved .gl-bar span { background: var(--st-good, var(--good-text)); }
.gl-card.behind .gl-bar span { background: var(--warn-text); }
.gl-plan { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--text); opacity: .55; transform: translateX(-1px); }
.gl-months { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 64px; padding-top: 4px; }
.gl-m { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.gl-m i { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--accent) 70%, transparent); }
.gl-m i.neg { background: color-mix(in srgb, var(--bad-text) 60%, transparent); }
.gl-m small { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.gl-target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--text-3); margin-bottom: 16px; pointer-events: none; }
.gl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.gl-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.gl-foot .link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.gl-done ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gl-done li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.gl-done li:first-child { border-top: 0; }
.gl-done-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gl-done-r { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gl-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.gl-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.gl-check input { accent-color: var(--accent); margin: 0; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.st-area { width: 100%; min-height: 420px; font-size: 14px; line-height: 1.6; resize: vertical; }
.st-text .btns-row { margin-top: 8px; }
.ms-group + .ms-group { margin-top: 14px; }
.ms-month { font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--text-3); margin: 0 0 4px; }
.st-ms ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ms { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 12px; }
.ms:hover { background: var(--surface-2); }
.ms input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.ms-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ms-title { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ms-title:hover { color: var(--accent-text); }
.ms.done .ms-title { color: var(--text-3); text-decoration: line-through; }
.ms-due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.ms.overdue .ms-due { color: var(--warn-text); }
.ms-note { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.ms-goals { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.ms-goal { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); text-decoration: none; min-width: 0; font-variant-numeric: tabular-nums; }
.ms-goal .ellipsis { min-width: 0; max-width: 160px; }
.st-empty { margin: 0; font-size: 13px; line-height: 1.5; }
.pulse-goals { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 700; color: #FFD48A; text-decoration: none; }
@media (max-width: 900px) { .st-grid { grid-template-columns: 1fr; } .gl-grid { grid-template-columns: 1fr; } }

/* ---------------- упрощение 16.10: дашборд — 4 плитки на всю ширину ---------------- */
[data-page="dashboard"] .head-band .tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.module-off { max-width: 560px; margin: 24px auto; }

/* свёрнутые блоки карточки канала: «История статусов», «Доступы» */
details.fold > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--text-3); transition: transform .15s var(--ease-out); }
details.fold[open] > summary h2::before { transform: rotate(90deg); }
details.fold[open] > summary { margin-bottom: 12px; }

/* Настройки: админские карточки — одной свёрнутой группой внизу */
.admin-group { margin-top: 8px; }
.admin-group > summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; padding: 16px 20px;
  border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text-2); }
.admin-group > summary::-webkit-details-marker { display: none; }
.admin-group > summary h2 { margin: 0; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.admin-group[open] > summary { margin-bottom: 14px; }

/* формы канала: второстепенные поля — под «Ещё поля» */
.more-fields > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 6px 0; color: var(--text); }
.more-fields > summary .muted { font-weight: 400; }
.more-fields[open] > summary { margin-bottom: 10px; }

/* ---------------- гость: только просмотр (body.guest — main.js initGuest) ---------------- */
.billing-bar.guest-bar { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.billing-bar.guest-bar svg { color: var(--accent); }
.tag.tag-guest { display: inline-flex; align-items: center; gap: 4px; }
.role-pick { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 4px; }
body.guest :is([data-act="add"], [data-act="add-menu"], [data-act="new"], [data-act^="new-"], [data-act^="add-"], [data-act="edit"],
  [data-act="delete"], [data-act^="bulk-"], [data-act="sync"], [data-act="poured"], [data-act="daily"], [data-act="pay"],
  [data-act="payout"], [data-act="draw-add"], [data-act="reserve-add"], [data-act="bank-start"], [data-act="bank-expense"],
  [data-act="bank-reconcile"], [data-act^="rm-"], [data-act="demo"], [data-act="demo-clear"], [data-act="manual-order"],
  [data-act="member-add"], [data-act^="link-"], [data-act^="rep-"], [data-act="template"], [data-act="take"], [data-act="accept"],
  [data-act="revision"], [data-act="comment"], [data-act="pick-channels"], [data-act="more"], [data-act="batches-new"],
  [data-sync-now], [data-guest-hide], .row-actions, .bulk-bar, th.col-check, td.col-check) { display: none !important; }
body.guest :is([data-creds-reveal], [data-creds-edit], [data-files-pick], [data-file-del], [data-file-buyer], [data-share-new],
  [data-share-revoke], [data-passport-edit], [data-sale-edit], [data-sale-delete], [data-set-status], [data-new], [data-ypp-studio],
  [data-team-new], [data-order-new], [data-ad-new], [data-stream-new], [data-stream-edit], [data-stream-del], [data-stream-done],
  [data-stream-schedule], [data-clip-add], [data-clip-del], [data-clip-edit], [data-clip-schedule], [data-clip-views], [data-ms-new],
  [data-ms-edit], [data-wb-new], [data-wb-del], [data-wb-delete], [data-wb-rename], [data-wb-image], [data-wb-file], [data-act="refresh"],
  [data-st-template]) { display: none !important; }
body.guest :is([data-act="status"], [data-rm-check], [data-ms-check]) { pointer-events: none; }
body.guest :is([data-act="money-add"], [data-act="money-more"], .rv-acts) { display: none !important; }
body.guest :is([data-bank-edit], [data-reserve-edit]) { pointer-events: none; }
body.guest :is(a[href^="#/settings"], [data-onboarding], .files-empty, .task-actions, [data-rm-done], [data-ypp-apply], [data-extend], [data-move]) { display: none !important; }

/* ---------------- закуп партии (batches-ui.js) ---------------- */
.b-file-list, .b-ch-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.b-ch-list { max-height: 330px; overflow: auto; }
.b-file-list li, .b-ch-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); }
.b-file-list li .ellipsis, .b-ch-list li a { flex: 1 1 auto; min-width: 0; }
.b-file-list li svg { flex: none; color: var(--text-3); }
.b-ch-list li a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-pick { cursor: pointer; margin: 4px 8px 6px 0; display: inline-flex; width: auto; align-self: flex-start; justify-self: start; }
.b-secret-more { display: inline-flex; vertical-align: middle; }
.b-h { font-size: 14px; margin: 16px 0 8px; }
.b-note { white-space: pre-wrap; margin: 10px 0 0; color: var(--text-2); }
.b-table td .muted.small svg { vertical-align: -2px; }
button.info-chip.link { cursor: pointer; font: inherit; color: inherit; text-align: left; }
button.info-chip.link:hover { border-color: var(--accent); }
.empty-mini { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.empty-mini p { margin: 0; }

/* ---------------- «Экономика → Деньги» (pages/economics-money.js, упрощение 27.10) ---------------- */
.cash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cash-grid { align-items: start; }
.cash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cash-col > .card { margin: 0; }
.cash-note { margin: 10px 0 0; }
a.card.cash-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
a.card.cash-link > span { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
a.card.cash-link:hover { border-color: var(--accent); }
a.card.cash-link > svg:last-child { color: var(--text-3); }
.cash-more { margin-top: 16px; }
.cash-more > summary { cursor: pointer; list-style: none; }
.cash-more > summary::-webkit-details-marker { display: none; }
.cash-more > summary h2 { margin: 0; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.cash-more > summary h2::before { content: "▸"; color: var(--text-3); transition: transform .15s; }
.cash-more[open] > summary h2::before { transform: rotate(90deg); }
.cash-more[open] > summary { margin-bottom: 14px; }
.cash-more h3 { margin: 0; font-size: 15px; }
/* узкая правая колонка: подписки и копилки — в две строки, кнопки копилки под ней */
.cash-col .oh-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main sum" "share acts"; row-gap: 4px; }
.cash-col .oh-row .oh-main { grid-area: main; min-width: 0; }
.cash-col .oh-row .oh-sum { grid-area: sum; }
.cash-col .oh-row .oh-share { grid-area: share; text-align: left; }
.cash-col .oh-row .row-actions { grid-area: acts; justify-content: flex-end; }
.cash-col .rv-list li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name sum" "sub sub" "bar bar" "acts acts"; }
.cash-col .rv-list .rv-name { grid-area: name; } .cash-col .rv-list .rv-sum { grid-area: sum; } .cash-col .rv-list .rv-sub { grid-area: sub; }
.cash-col .rv-list .rv-bar { grid-area: bar; } .cash-col .rv-list .rv-acts { grid-area: acts; flex-wrap: wrap; }
/* ============================================================
   Телефон: меню панелью внизу экрана (как в приложениях) и лист «Ещё» с остальными разделами,
   «Пульсом», темой, отзывом и выходом. Кабинет исполнителя — без панели (у него #sidebar без .tabbar).
   ============================================================ */
.nav-more { display: none; }
@media (max-width: 860px) {
  #sidebar.tabbar {
    position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 60; width: auto; height: auto; display: block; overflow: visible;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); border-bottom: 0;
    background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  #sidebar.tabbar > .brand, #sidebar.tabbar > .pulse-slot, #sidebar.tabbar > .sidebar-foot { display: none; }
  #sidebar.tabbar .nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
  #sidebar.tabbar .nav a.extra { display: none; }
  #sidebar.tabbar .nav :is(a, .nav-more) {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 54px; padding: 6px 2px 5px;
    border: 0; border-radius: 14px; background: transparent; color: var(--text-3); font: inherit; font-size: 11px; font-weight: 700; line-height: 1.1;
    cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color 140ms ease, color 140ms ease;
  }
  #sidebar.tabbar .nav :is(a, .nav-more) span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #sidebar.tabbar .nav :is(a, .nav-more) svg { color: inherit; }
  #sidebar.tabbar .nav :is(a, .nav-more):active { transform: scale(.96); }
  #sidebar.tabbar .nav :is(a.active, a.active:hover, .nav-more.active) { background: var(--surface-3); color: var(--text); }
  #sidebar.tabbar .nav :is(a.active, .nav-more.active) svg { color: var(--accent); }
  #sidebar.tabbar .nav a:hover { background: transparent; color: var(--text-3); }
  #sidebar.tabbar .nav :is(a, .nav-more):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  #sidebar.tabbar ~ .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body:has(#sidebar.tabbar) .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; }
  body:has(#sidebar.tabbar) .billing-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
  body.has-billing-bar:has(#sidebar.tabbar) .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
/* Лист «Ещё»: снизу экрана во всю ширину */
dialog.modal.sheet { width: min(560px, calc(100vw / var(--zoom, 1) - 32px)); }
@media (max-width: 860px) {
  dialog.modal.sheet { width: 100%; max-width: 100%; max-height: 88vh; max-height: 88dvh; margin: auto 0 0; border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheet-up 220ms var(--ease-out); }
}
@keyframes sheet-up { from { opacity: 0; transform: translateY(48px); } }
.more-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.more-links a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2);
  color: var(--text); font-weight: 700; text-decoration: none; }
.more-links a svg { flex: none; color: var(--text-3); }
.more-links a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-links a.active { background: var(--ink); color: var(--on-ink); }
.more-links a.active svg { color: var(--highlight); }
.more-links .count { display: none; }
.more-pulse { margin-bottom: 14px; }
.more-pulse:empty { display: none; }
.more-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.more-foot .zoom-row { display: none; }
.more-foot .theme-switch button { height: 38px; }
@media (prefers-reduced-motion: reduce) { dialog.modal.sheet { animation: none; } }
/* Телефон: каналы карточками, фильтры за кнопкой «Фильтры», этапы — одной строкой с прокруткой */
.tb-filters { display: none; }
.tb-filters .n { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.tb-filters .n:empty { display: none; }
@media (max-width: 640px) {
  .toolbar .search { flex: 1 1 100%; }
  .tb-filters { display: inline-flex; }
  .toolbar.f-open .tb-filters { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
  .toolbar:not(.f-open) > :is(select, .filter-pick, [data-act="groups"], [data-act="export"]) { display: none; }
  .toolbar > :is([data-act="manual-order"], [data-act="cols"]) { display: none; }
  .status-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 4px; }
  .status-chips::-webkit-scrollbar { display: none; }
  .status-chips > * { flex: none; }
}
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.m-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.m-sort .select { height: 36px; font-size: 13px; }
.m-list { display: flex; flex-direction: column; gap: 8px; }
.m-grp { display: flex; width: 100%; margin: 14px 0 8px; padding: 8px 4px; font-size: 14px; }
.m-grp:first-of-type { margin-top: 0; }
.m-grp .n { margin-left: auto; color: var(--text-3); font-weight: 700; }
.m-card { padding: 12px 12px 10px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 120ms ease, border-color 120ms ease; }
.m-card:active { transform: scale(.985); }
.m-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.m-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.m-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.m-title { display: flex; align-items: center; gap: 4px; min-width: 0; }
.m-title b { font-size: 15px; font-weight: 800; }
.m-name small { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.m-quick { width: 40px; height: 40px; }
.m-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.m-stage > span { display: inline-flex; align-items: center; gap: 4px; }
.m-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.m-stat { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.m-stat b { overflow: hidden; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.m-stat small { overflow: hidden; color: var(--text-3); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.m-stat .bad { color: var(--bad-text); }
.m-total { margin: 12px 2px 0; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
/* Телефон: плитки по две в ряд и ниже ростом (задачи дашборда — выше), канбан листается по колонке */
@media (max-width: 640px) {
  .page-head .head-avatars { display: none; } /* то же, что подпись «N каналов в работе» */
  .tiles, [data-page="dashboard"] .head-band .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 12px 36px; }
  .tile-label { font-size: 12px; }
  .tile-delta, .tile-sub { font-size: 11.5px; }
  .tile-spark { left: 12px; right: 12px; bottom: 10px; width: calc(100% - 24px); height: 20px; }
  .kanban { grid-auto-columns: minmax(82vw, 1fr); scroll-snap-type: x mandatory; scroll-padding-inline: 2px; }
  .kanban > .kb-col { scroll-snap-align: start; }
}
@media (max-width: 640px) { .segmented.small button { height: 32px; } } /* телефон: переключатели под палец */
