/* ToonClip CRM. Стиль как у сайта и Attio: белый фон, чёрный акцент, тонкие серые линии; красный только для «клиент ждёт» и просрочки. Только светлая тема. */
:root{--bg:#FFFFFF;--surface:#F7F7F6;--surface2:#EFEFED;--border:#E8E8E5;--text:#111214;--text2:#4F545B;--text3:#6E737A;
--accent:#111214;--accent-bg:#EFEFED;--on-accent:#FFFFFF;--red:#C4291C;--red-bg:#FCEBE9;--green:#1E7A3C;--green-bg:#E8F5EC;--amber:#A35C00;--amber-bg:#FFF4E0;
--radius:10px;--radius-lg:14px;--font:"Albert Sans","Onest",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;--display:"Bricolage Grotesque","Onest","Albert Sans",sans-serif;
--tabbar-h:56px;--safe-b:env(safe-area-inset-bottom,0px);--safe-t:env(safe-area-inset-top,0px);--vvh:100dvh;--shadow:0 8px 28px rgba(17,18,20,.10);color-scheme:light}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;margin:0}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:var(--bg);color:var(--text);font:400 15px/1.45 var(--font);overflow:hidden;overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
h1,h2,h3,h4,p{margin:0}
a{color:var(--accent);text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:inherit}
button:disabled{cursor:default}
strong,b{font-weight:600}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.icon{flex:none;display:block}
.red{color:var(--red)}
.muted{color:var(--text3)}
.t2{color:var(--text2)}
.meta{font-size:13px;color:var(--text3)}
.nowrap{white-space:nowrap}
.stack{display:flex;flex-direction:column;gap:12px}
.stack.s8{gap:8px}
.stack.s16{gap:16px}
.hstack{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hstack.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.pre{white-space:pre-wrap;overflow-wrap:anywhere}

/* ---------- оболочка ---------- */
.shell{position:fixed;top:0;left:0;right:0;height:var(--vvh);display:flex;flex-direction:column;background:var(--bg)}
.main{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;padding-top:var(--safe-t)}
.sidebar{display:none}
.tabbar{flex:none;display:flex;border-top:1px solid var(--border);background:var(--bg);padding:0 4px var(--safe-b)}
.tabbar a{flex:1;min-width:0;height:var(--tabbar-h);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--text3);font-size:11px;position:relative}
.tabbar a span.tab-l{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 2px}
.tabbar a.on{color:var(--accent);font-weight:600}
.tabbar .tab-ic{position:relative;display:block}
.badge{position:absolute;top:-5px;left:calc(50% + 4px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center}

.shell.bare .tabbar,html.kb .tabbar{display:none}
/* Плавающих кнопок нет: они закрывали даты, суммы и кнопки в строках. ИИ-помощник (.page-ai) и «добавить» (.page-add) живут значками в шапке. */
.boot{height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:var(--text3);padding:24px;text-align:center}

/* ---------- страница ---------- */
.page{max-width:760px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}
.page.wide{max-width:none}
.page-head{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:8px;min-height:56px;padding:8px 16px;background:var(--bg)}
.page-head.sub{padding-left:4px}
.page-titles{flex:1;min-width:0}
.page-title{font-family:var(--display);font-size:28px;font-weight:700;line-height:1.15;letter-spacing:-.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:359px){.page-title{font-size:24px}}
.page-head.sub .page-title{font-size:20px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.page-sub{font-size:13px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.page-actions{display:flex;align-items:center;gap:4px;flex:none}
.page-body{flex:1;padding:8px 16px calc(32px + var(--safe-b));display:flex;flex-direction:column;gap:24px}
.page.fill{height:100%;min-height:0}
.page.fill .page-body{min-height:0;padding:0;gap:0}

.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}
.section-title{font-size:17px;font-weight:600}
.section-count{color:var(--text3);font-weight:400;margin-left:4px}
.section-title.red .section-count{color:var(--red);font-weight:600}
.section-action{font-size:15px;color:var(--accent);min-height:44px;min-width:44px;margin:-12px 0;display:inline-flex;align-items:center;justify-content:flex-end;flex:none}
.section-body{display:flex;flex-direction:column}
.card{background:var(--surface);border-radius:var(--radius-lg);overflow:hidden}
.card.pad,.section-body.card.pad{padding:16px}
.section-body.card>.row{padding-left:12px;padding-right:12px}
.banner{display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:var(--radius);background:var(--surface);color:var(--text2);font-size:15px}
.banner.red{background:var(--red-bg);color:var(--red)}
.banner-text{flex:1;min-width:0}
.banner-action{font-weight:600;color:inherit;min-height:44px;margin:-12px 0;flex:none;text-decoration:underline}

/* ---------- строки ---------- */
.row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 0;color:var(--text);border-bottom:1px solid var(--border);text-align:left}
.row:last-child{border-bottom:0}
.row.tap{cursor:pointer}
.row-lead{flex:none;display:flex;align-items:center;justify-content:center;color:var(--text2)}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;text-align:left;color:var(--text)}
button.row-main{min-height:44px;justify-content:center}
/* Название в строке — до двух строк, потом многоточие: на узком телефоне «Напоминания о неотвеченных» не должно теряться. */
.row-title{font-size:17px;font-weight:400;line-height:1.25;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.row-title.strong{font-weight:600}
.row-sub{font-size:15px;color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-sub.l2{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.row-end{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:45%}
.row-meta{font-size:13px;color:var(--text3);white-space:nowrap}
.row-meta.red{color:var(--red);font-weight:600}
.check-row{align-items:flex-start}
.check-row .row-end{padding-top:12px}
.check-row .row-title{white-space:normal;overflow-wrap:anywhere;display:block;-webkit-line-clamp:unset}
.check{flex:none;width:44px;height:44px;margin-left:-10px;margin-right:-8px;display:flex;align-items:center;justify-content:center}
.check-box{width:24px;height:24px;border-radius:50%;border:1.75px solid var(--text3);display:flex;align-items:center;justify-content:center;color:var(--bg)}
.check-row.checked .check-box{background:var(--text3);border-color:var(--text3)}
.check-row.checked .row-title{color:var(--text3);text-decoration:line-through}
.check:disabled{opacity:.5}

.chip{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 8px;border-radius:12px;font-size:13px;line-height:1;white-space:nowrap;background:var(--surface2);color:var(--text2);max-width:100%}
.card .chip.neutral,.card .chip.done{background:var(--border)}
.chip.red{background:var(--red-bg);color:var(--red);font-weight:600}
.chip.accent{background:var(--accent-bg);color:var(--accent)}
.chip.done{color:var(--text2)}
.chips{display:flex;flex-wrap:wrap;gap:4px}
.chips>a{display:inline-flex;align-items:center;min-height:44px;margin:-10px 0}
.avatar{position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--surface2);color:var(--text2);font-weight:600;user-select:none}
.card .avatar{background:var(--border)}
.avatar-ch{position:absolute;right:-3px;bottom:-3px;width:20px;height:20px;border-radius:50%;background:var(--bg);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;color:var(--text2)}
.avatar-dot{position:absolute;right:-1px;top:-1px;width:12px;height:12px;border-radius:50%;background:var(--red);border:2px solid var(--bg)}

/* ---------- кнопки ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border-radius:var(--radius);font-size:15px;font-weight:600;white-space:nowrap;cursor:pointer;border:1px solid transparent;max-width:100%}
.btn-label{overflow:hidden;text-overflow:ellipsis}
.btn.primary{background:var(--accent);color:var(--on-accent)}
.btn.plain{background:var(--surface);color:var(--text);border-color:var(--border)}
.card .btn.plain,.sheet .btn.plain{background:var(--bg)}
/* Красный — только «клиент ждёт» и просрочка. Удаление без красного: значок корзины, текст и обязательное подтверждение. */
.btn.danger-text{color:var(--text)}
.sheet.confirm .btn.danger-text{background:var(--text);color:var(--bg)}
.btn.text{color:var(--accent);padding:0 8px}
.btn.block{display:flex;width:100%}
.btn.small{font-size:13px;padding:0 12px}
.btn:disabled{opacity:.5}
.btn.busy{opacity:.8}
.icon-btn{position:relative;flex:none;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:var(--text2)}
.icon-btn:disabled{opacity:.4}
.icon-btn .badge{top:2px;left:auto;right:0}
.icon-btn.page-ai{color:var(--accent)}
/* Главное «добавить» экрана: бирюзовый круг в шапке, там же, где был плавающий «+». Ничего не закрывает. */
.icon-btn.page-add,.icon-btn.page-add:hover{background:var(--accent);color:var(--on-accent)}
.link-btn{color:var(--accent);font-size:15px;min-height:44px;padding:0 4px;display:inline-flex;align-items:center}
.btn-row{display:flex;gap:8px;flex-wrap:wrap}
.btn-row>.btn{flex:1}

/* ---------- формы ---------- */
.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field-label{font-size:13px;color:var(--text2)}
.field-hint{font-size:13px;color:var(--text3)}
.field-hint.err{color:var(--text);font-weight:600}
.input{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);color:var(--text);font-size:16px;line-height:1.35;appearance:none;-webkit-appearance:none;min-width:0}
.input::placeholder{color:var(--text3)}
.input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.input.invalid{border-color:var(--text)}
.input:disabled{background:var(--surface);color:var(--text3)}
textarea.input{resize:vertical;min-height:88px}
select.input{padding-right:36px;background-image:linear-gradient(45deg,transparent 50%,var(--text3) 50%),linear-gradient(135deg,var(--text3) 50%,transparent 50%);background-position:calc(100% - 19px) 19px,calc(100% - 14px) 19px;background-size:5px 5px;background-repeat:no-repeat}
input[type="date"].input,input[type="time"].input{min-width:0}
.dt{display:grid;grid-template-columns:3fr 2fr;gap:8px}
.dt-quick{display:flex;gap:12px;margin:-4px 0}
.search{position:relative;display:flex;align-items:center}
.search .icon{position:absolute;left:12px;color:var(--text3);pointer-events:none}
.search .input{padding-left:38px;background:var(--surface);border-color:transparent}
.switch-row{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer}
.switch-row.disabled{opacity:.5;cursor:default}
.switch-text{flex:1;min-width:0;display:flex;flex-direction:column}
.switch-label{font-size:15px}
.switch{appearance:none;-webkit-appearance:none;flex:none;width:48px;height:28px;border-radius:14px;background:var(--border);position:relative;cursor:pointer;margin:0}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.switch:checked{background:var(--accent)}
.switch:checked::after{transform:translateX(20px)}
.form{display:flex;flex-direction:column;gap:16px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
/* Совсем узкий телефон (320 px): в половине ширины выбранное значение («Не повторять», «Вся команда») обрезалось, поэтому поля идут в один столбец. */
@media (max-width:359px){.grid2{grid-template-columns:minmax(0,1fr)}}
.quick-add{display:flex;gap:8px}
.quick-add .input{flex:1}
/* Быстрый ввод задачи: на телефоне кнопка «+» без слова, чтобы подсказка в поле не обрезалась. */
@media (max-width:520px){.quick-add.qa-icon .btn{padding:0;width:48px;flex:none}.quick-add.qa-icon .btn-label{display:none}}

/* ---------- вкладки ---------- */
.tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px;border-bottom:1px solid var(--border);flex:none}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:none;min-height:44px;padding:0 12px;display:inline-flex;align-items:center;gap:6px;font-size:15px;color:var(--text2);white-space:nowrap;border-bottom:2px solid transparent;margin-bottom:-1px}
.tab.on{color:var(--text);font-weight:600;border-bottom-color:var(--accent)}
.tab-count{font-size:13px;font-weight:400;color:var(--text3)}
.tab-count.red{color:var(--red);font-weight:600}
.tabs.seg{border-bottom:0;gap:8px;padding-top:2px;padding-bottom:2px}
.tabs.seg .tab{min-height:44px;border:1px solid var(--border);border-radius:22px;padding:0 16px;margin:0}
.tabs.seg .tab.on{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}
.tabs.seg .tab.on .tab-count{color:var(--accent)}

/* ---------- окна ---------- */
.sheet-wrap{position:fixed;top:0;left:0;right:0;height:var(--vvh);z-index:50;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center}
.sheet{width:100%;max-width:560px;max-height:calc(var(--vvh) - 24px - var(--safe-t));display:flex;flex-direction:column;background:var(--bg);border-radius:var(--radius-lg) var(--radius-lg) 0 0;box-shadow:var(--shadow);outline:none}
.sheet.wide{max-width:760px}
.sheet-head{flex:none;display:flex;align-items:center;gap:8px;padding:8px 4px 4px 16px}
.sheet-title{flex:1;min-width:0;font-size:17px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheet-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:8px 16px 16px;display:flex;flex-direction:column;gap:16px}
.sheet-body:last-child{padding-bottom:calc(16px + var(--safe-b))}
/* Карточка (overflow:hidden) в колонке с прокруткой не должна сжиматься: иначе у поста «Заявки с поста» превращались в узкую полоску. */
.sheet-body>*{flex-shrink:0}
.sheet-foot{flex:none;display:flex;gap:8px;padding:12px 16px calc(12px + var(--safe-b));border-top:1px solid var(--border)}
.sheet-foot>.btn{flex:1}
.confirm-text{color:var(--text2);white-space:pre-wrap}
.toasts{position:fixed;left:16px;right:16px;bottom:calc(var(--tabbar-h) + var(--safe-b) + 16px);z-index:60;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
html.kb .toasts{bottom:calc(100dvh - var(--vvh) + 16px)}
/* Переписка: внизу поле ответа и кнопка отправки, поэтому сообщения («Записано», «Скопировано») встают прямо над ними, поверх уже прочитанных сообщений.
   Высоту поля ответа сообщает сама переписка (--composer-h). */
html.bare .toasts{bottom:calc(var(--safe-b) + var(--composer-h,0px) + 12px)}
html.bare.kb .toasts{bottom:calc(100dvh - var(--vvh) + var(--composer-h,0px) + 12px)}
.toast{pointer-events:auto;display:flex;align-items:center;gap:12px;max-width:480px;padding:12px 16px;border-radius:var(--radius);background:var(--text);color:var(--bg);font-size:15px;box-shadow:var(--shadow)}
.toast-action{color:inherit;font-weight:600;text-decoration:underline;min-height:44px;margin:-12px 0;flex:none}

/* ---------- состояния ---------- */
.spinner{display:flex;justify-content:center;padding:24px}
.spin{width:24px;height:24px;border-radius:50%;border:2px solid var(--border);border-top-color:var(--accent);display:block}
.spin.small{width:16px;height:16px;border-top-color:currentColor}
.empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:24px 16px;text-align:center}
.empty-text{color:var(--text3)}
.skeleton{display:flex;flex-direction:column}
.sk-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 0}
.sk-dot{width:40px;height:40px;border-radius:50%;background:var(--surface2);flex:none}
.sk-lines{flex:1;display:flex;flex-direction:column;gap:8px}
.sk-lines i{display:block;height:12px;border-radius:6px;background:var(--surface2)}
.progress-wrap{display:flex;flex-direction:column;gap:4px}
.progress{height:8px;border-radius:4px;background:var(--surface2);overflow:hidden}
.card .progress{background:var(--border)}
.progress>span{display:block;height:100%;border-radius:4px;background:var(--accent)}
.progress.red>span{background:var(--red)}
.progress-label{font-size:13px;color:var(--text3)}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{display:flex;flex-direction:column;gap:2px;padding:12px;border-radius:var(--radius);background:var(--surface);color:var(--text);min-width:0}
.card .stat{background:none;padding:0}
.stat-v{font-size:28px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Три плитки в ряд на телефоне: число подгоняем под ширину плитки, чтобы «348 900» не превращалось в «348 …». */
@media (max-width:520px){.stat-v{font-size:clamp(20px,7vw,28px)}.stat-v.s{font-size:clamp(18px,6vw,24px)}.stat-v.xs{font-size:clamp(15px,5.1vw,20px)}}
.stat-l{font-size:13px;color:var(--text2)}
.stat-s{font-size:13px;color:var(--text3)}

/* ---------- текст ---------- */
.md{font-size:15px;line-height:1.5;overflow-wrap:anywhere;display:flex;flex-direction:column;gap:8px}
.md h3{font-size:17px;font-weight:600;margin-top:8px}
.md h4{font-size:15px;font-weight:600;margin-top:4px}
.md ul,.md ol{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:4px}
.md code{font:13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--surface2);padding:1px 5px;border-radius:5px}
.md pre{margin:0;padding:12px;border-radius:var(--radius);background:var(--surface2);overflow-x:auto}
.md pre code{background:none;padding:0}
.md a{text-decoration:underline}

/* ---------- вход ---------- */
.auth{height:var(--vvh);overflow-y:auto;display:flex;padding:24px 16px calc(24px + var(--safe-b))}
.auth-box{width:100%;max-width:380px;margin:auto;display:flex;flex-direction:column;gap:24px}
.auth-logo{width:56px;height:56px;border-radius:14px}
.auth-title{font-size:28px;font-weight:600;line-height:1.15}
.auth-note{color:var(--text2)}

/* ---------- мелочи экранов ---------- */
.nav-list .row-lead{width:28px}
.kv{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);font-size:15px}
.kv:last-child{border-bottom:0}
.kv>span:first-child{color:var(--text2)}
.kv>span:last-child{text-align:right;overflow-wrap:anywhere;min-width:0}
.perm-grid{display:flex;flex-direction:column}
.person-head{display:flex;align-items:center;gap:12px}
.person-nums{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}
.person-nums .stat-v{font-size:20px}
.group-title{font-size:13px;font-weight:600;color:var(--text3);text-transform:uppercase;letter-spacing:.04em;padding:16px 0 4px}
.group-title.red{color:var(--red)}
.group-title:first-child{padding-top:0}
.link-box{padding:12px;border-radius:var(--radius);background:var(--surface);font-size:15px;overflow-wrap:anywhere;user-select:all}
.sheet .link-box{background:var(--surface)}

@media (prefers-reduced-motion:no-preference){
  .btn,.icon-btn,.tab,.row.tap,.switch,.switch::after,.input{transition:background-color .15s,border-color .15s,color .15s,transform .15s,opacity .15s}
  .sheet{animation:sheet-in .2s ease-out}
  .sheet-wrap{animation:fade-in .15s ease-out}
  .toast{animation:toast-in .2s ease-out}
  .spin{animation:spin .8s linear infinite}
  .sk-lines i,.sk-dot{animation:pulse 1.2s ease-in-out infinite}
  .progress>span{transition:width .2s}
}
@keyframes sheet-in{from{transform:translateY(24px);opacity:0}}
@keyframes fade-in{from{opacity:0}}
@keyframes toast-in{from{transform:translateY(8px);opacity:0}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pulse{50%{opacity:.5}}
@media (hover:hover){
  .row.tap:hover,button.row-main:hover .row-title{color:var(--accent)}
  .btn.plain:hover{border-color:var(--text3)}
  .icon-btn:hover{background:var(--surface)}
  .sidebar a:hover{background:var(--surface2)}
}

/* ---------- компьютер ---------- */
@media (min-width:900px){
  :root{--tabbar-h:0px}
  .shell{flex-direction:row}
  .tabbar,.page-ai{display:none}
  .sidebar{display:flex;flex-direction:column;gap:2px;flex:none;width:232px;padding:16px 12px;background:var(--surface);border-right:1px solid var(--border);overflow-y:auto}
  .sidebar-brand{display:flex;align-items:center;gap:10px;padding:4px 8px 16px;font-size:17px;font-weight:600;color:var(--text)}
  .sidebar-brand img{width:28px;height:28px;border-radius:7px}
  .sidebar a.nav{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:10px;color:var(--text2);font-size:15px}
  .sidebar a.nav.on{background:var(--accent-bg);color:var(--accent);font-weight:600}
  .sidebar a.nav .nav-l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .sidebar .badge{position:static;flex:none}
  .sidebar-sep{height:1px;background:var(--border);margin:8px 12px}
  .sidebar-foot{margin-top:auto;padding-top:12px}
  .page-head{padding:16px 24px 8px}
  .page-head.sub{padding-left:12px}
  .page-body{padding:8px 24px 48px}
  .tabs{margin:0 -24px;padding:0 24px}
  .sheet-wrap{align-items:center;padding:24px}
  .sheet{border-radius:var(--radius-lg);max-height:min(720px,calc(100dvh - 48px))}
  .sheet.confirm{max-width:420px}
  .sheet-foot{padding-bottom:12px;justify-content:flex-end}
  .sheet-foot>.btn{flex:none;min-width:120px}
  .toasts{bottom:24px}
  .stats{gap:12px}
}

/* ==========================================================================
   ЭКРАНЫ «РАБОТА»: ролики (vid-), контент (cnt-), рассылки (lst-), деньги (mny-),
   отчёт и графики (rep-), ИИ (ai-), база знаний (kb-). Только серый и бирюзовый;
   красный — лишь для просроченных сроков.
   ========================================================================== */
/* ---------- ролики ---------- */
.vid-list{display:flex;flex-direction:column;gap:8px}
.vid-card{display:flex;flex-direction:column;gap:6px;width:100%;min-height:56px;padding:12px 16px;border-radius:var(--radius-lg);background:var(--surface);color:var(--text);text-align:left}
.vid-card-title{font-size:17px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.vid-card-sub{font-size:15px;color:var(--text2);overflow-wrap:anywhere}
.vid-card .chip.neutral,.vid-card .chip.done{background:var(--border)}
.vid-link{display:flex;align-items:flex-end;gap:4px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.vid-link-btns{flex:none;display:flex;flex-direction:column}
.vid-check{display:flex;align-items:center;gap:4px;min-height:44px;border-bottom:1px solid var(--border)}
.vid-check .check{margin-left:-10px;margin-right:0}
.vid-check-text{flex:1;min-width:0;overflow-wrap:anywhere}
.vid-check.done .vid-check-text{color:var(--text3);text-decoration:line-through}
.vid-check.done .check-box{background:var(--text3);border-color:var(--text3)}
.vid-save{position:sticky;bottom:0;z-index:2;padding:8px 0;background:var(--bg)}

/* ---------- контент ---------- */
.cnt-post{display:flex;flex-direction:column;gap:4px;width:100%;min-height:56px;padding:12px 0;border-bottom:1px solid var(--border);color:var(--text);text-align:left}
.cnt-post:last-child{border-bottom:0}
.cnt-hook{font-size:17px;line-height:1.3;overflow-wrap:anywhere}
.cnt-meta{font-size:13px;color:var(--text3)}
.cnt-nums{display:flex;flex-wrap:wrap;gap:2px 16px;font-size:15px;color:var(--text2);font-variant-numeric:tabular-nums}
.cnt-nums b{color:var(--text)}
.cnt-period{flex:1;max-width:200px}

/* ---------- рассылки ---------- */
.lst-cards,.lst-items{display:flex;flex-direction:column;gap:8px}
.lst-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:var(--radius-lg);background:var(--surface);color:var(--text)}
.lst-card-title{font-size:17px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.lst-card-sub{font-size:15px;color:var(--text2)}
.lst-card .progress{background:var(--border)}
.lst-card .chip{background:var(--border)}
.lst-card .chip.red{background:var(--red-bg)}
.lst-item{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border:1px solid var(--border);border-radius:var(--radius-lg)}
.lst-item.done{background:var(--surface);border-color:transparent}
.lst-item.done .chip{background:var(--border)}
.lst-item-head{display:flex;align-items:flex-start;gap:8px}
.lst-item-title{font-size:17px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.lst-item.done .lst-item-title{font-weight:400;color:var(--text2)}
.lst-item .btn-row>.btn{padding:0 8px;min-width:max-content}
.lst-item .hstack{margin:-4px -8px}
.lst-body{max-height:40vh;overflow-y:auto}

/* ---------- деньги ---------- */
.mny-big{font-size:28px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}

/* ---------- отчёт и графики ---------- */
.rep-chart{margin:0;display:flex;flex-direction:column;gap:4px}
.rep-chart svg{display:block;width:100%}
.rep-bar{fill:var(--text3)}
.rep-bar.a{fill:var(--accent)}
.rep-axis{stroke:var(--border);stroke-width:1}
.rep-chart-x{display:flex;justify-content:space-between;gap:4px;font-size:13px;color:var(--text3)}
.rep-chart-x.all span{flex:1;min-width:0;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rep-chart-max{font-size:13px;color:var(--text3)}
.rep-legend{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:13px;color:var(--text2)}
.rep-legend span{display:inline-flex;align-items:center;gap:6px}
.rep-legend i{width:10px;height:10px;border-radius:2px;background:var(--text3)}
.rep-legend i.a{background:var(--accent)}
.rep-hbars{display:flex;flex-direction:column;gap:12px}
.rep-hhead{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:15px}
.rep-hlabel{min-width:0;overflow-wrap:anywhere}
.rep-hval{flex:none;font-weight:600;font-variant-numeric:tabular-nums}
.rep-hbar{display:block;width:100%;height:8px;margin-top:4px;border-radius:4px;overflow:hidden}
.rep-hbar .t{fill:var(--surface2)}
.card .rep-hbar .t{fill:var(--border)}
.rep-hsub{font-size:13px;color:var(--text3);margin-top:2px}
.rep-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.rep-table{width:100%;border-collapse:collapse;font-size:15px}
.rep-table th,.rep-table td{padding:10px 4px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.rep-table thead th{font-size:13px;font-weight:400;color:var(--text3);padding-top:4px;padding-bottom:4px}
.rep-table tbody th{font-weight:400;white-space:normal;overflow-wrap:anywhere}
.rep-table tbody tr{border-top:1px solid var(--border)}
.rep-table th:first-child{text-align:left;padding-left:0}
.rep-table td:last-child,.rep-table th:last-child{padding-right:0}
.rep-over{color:var(--red);font-weight:600}
.rep-big{font-size:28px;font-weight:600;line-height:1.15}
.rep-details summary{min-height:44px;display:flex;align-items:center;color:var(--accent);cursor:pointer;list-style:none}
.rep-details summary::-webkit-details-marker{display:none}

/* ---------- ИИ ---------- */
.ai-wrap{flex:1;min-height:0;display:flex}
.ai-side{display:none}
.ai-chat{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
.ai-msgs{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:8px 16px 16px;display:flex;flex-direction:column;gap:12px}
.ai-intro{display:flex;flex-direction:column;gap:16px;margin-top:8px}
.ai-chips{display:flex;flex-wrap:wrap;gap:8px}
.ai-chip{min-height:44px;padding:8px 16px;border:1px solid var(--border);border-radius:22px;font-size:15px;line-height:1.3;color:var(--text);text-align:left}
.ai-msg{max-width:88%;padding:10px 14px;border-radius:var(--radius-lg);overflow-wrap:anywhere}
.ai-msg.user{align-self:flex-end;background:var(--accent-bg);white-space:pre-wrap}
.ai-msg.bot{align-self:flex-start;background:var(--surface)}
.ai-msg.wait{display:flex;align-items:center;gap:8px;color:var(--text2)}
.ai-msg-tools{margin:4px -8px -8px}
.ai-msg .md code,.ai-msg .md pre{background:var(--border)}
.ai-error{display:flex;gap:8px;padding:12px 16px;border-radius:var(--radius);background:var(--surface);color:var(--text);font-weight:600}
.ai-error .btn{font-weight:600}
.ai-composer{flex:none;display:flex;align-items:flex-end;gap:8px;padding:8px 16px;border-top:1px solid var(--border);background:var(--bg)}
.ai-composer textarea.input{flex:1;min-height:44px;max-height:132px;resize:none}
.ai-send{flex:none;width:44px;height:44px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center}
.ai-send:disabled{opacity:.4}
.ai-thread{display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--border)}
.ai-thread:last-child{border-bottom:0}
.ai-thread-main{flex:1;min-width:0;min-height:56px;padding:8px 0;display:flex;flex-direction:column;justify-content:center;gap:2px;color:var(--text);text-align:left}
.ai-thread-title{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-thread-main.on .ai-thread-title{font-weight:600;color:var(--accent)}

/* ---------- база знаний ---------- */
.kb-body{display:flex;flex-direction:column;gap:16px}
.kb-body .md{font-size:16px;line-height:1.55}
.kb-title{font-size:20px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}

@media (hover:hover){
  .vid-card:hover .vid-card-title,.lst-card:hover .lst-card-title,.cnt-post:hover .cnt-hook,.ai-thread-main:hover .ai-thread-title{color:var(--accent)}
  .ai-chip:hover{border-color:var(--text3)}
}
@media (min-width:900px){
  .vid-list,.lst-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
  .ai-side{display:block;flex:none;width:280px;padding:0 12px 16px 24px;border-right:1px solid var(--border);overflow-y:auto}
  .ai-hist-btn{display:none}
  .ai-msgs{padding:8px 24px 16px}
  .ai-composer{padding:12px 24px}
  .ai-msg{max-width:720px}
}

/* ==================== ПРОДАЖИ: диалоги (inb-), контакт (ct-), сделки (dl-), написать сегодня (out-) ==================== */
.page.fill>.page-body>.skeleton,.page.fill>.page-body>.empty{margin:0 16px}

/* ---------- диалоги ---------- */
.inb-list{display:flex;flex-direction:column}
.inb-tools{display:flex;gap:8px;padding:12px 0 4px}
.inb-channel{flex:none;width:auto;max-width:50%}
.inb-rows{margin:0 -8px}
.inb-rows .row{padding-left:8px;padding-right:8px}
.row.inb-on{background:var(--accent-bg)}
.inb-more{padding-top:12px}
.inb-split{flex:1;min-height:0;display:flex}
.inb-left{flex:0 0 400px;min-width:0;overflow-y:auto;padding:0 24px 24px;border-right:1px solid var(--border)}
.inb-right{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
.inb-right>.page{flex:1;min-height:0;width:100%;height:auto}
.inb-right>.empty{margin:auto}

/* ---------- контакт: переписка ---------- */
.ct-sub{display:inline-flex;align-items:center;gap:6px;max-width:100%}
.ct-sub-b{overflow:hidden;text-overflow:ellipsis}
.ct-tabs{flex:none;padding:0 16px}
.ct-hide{display:none!important}
.ct-thread{flex:1;min-height:0;display:flex;flex-direction:column}
.ct-wait{flex:none;display:flex;align-items:center;gap:8px;padding:6px 16px;background:var(--red-bg);color:var(--red);font-weight:600}
.ct-wait.snoozed{background:var(--surface);color:var(--text2);font-weight:400}
.ct-wait-text{flex:1;min-width:0;display:flex;align-items:center;gap:8px}
.ct-wait .btn{color:var(--text)}
.ct-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--red)}
.ct-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 16px;display:flex;flex-direction:column;gap:8px}
.ct-scroll>:first-child{margin-top:auto}
.ct-older{display:flex;justify-content:center}
.ct-none{color:var(--text3);text-align:center;padding:24px 8px}
.ct-day{align-self:center;font-size:13px;color:var(--text3);padding:8px 0 0}
.ct-sys{align-self:center;max-width:90%;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:13px;color:var(--text3);text-align:center}
.ct-sys.note{background:var(--surface2);color:var(--text2);padding:8px 12px;border-radius:var(--radius);font-size:15px;text-align:left;align-items:flex-start}
.ct-sys-l{font-size:13px;font-weight:600}
.ct-sys-t{font-size:13px;color:var(--text3)}
.ct-msg{display:flex;flex-direction:column;gap:2px;max-width:84%;align-items:flex-start;align-self:flex-start}
.ct-msg.out{align-items:flex-end;align-self:flex-end}
.ct-bubble{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border-radius:var(--radius-lg);background:var(--surface);font-size:15px;line-height:1.4;min-width:0;max-width:100%}
.ct-msg.out .ct-bubble{background:var(--accent-bg)}
.ct-msg.failed .ct-bubble{background:var(--surface2);color:var(--text2)}
.ct-subject{font-weight:600}
.ct-media{display:block}
.ct-media img{display:block;max-width:100%;max-height:280px;border-radius:10px;background:var(--surface2)}
.ct-file{display:inline-flex;align-items:center;gap:6px;min-height:44px;text-decoration:underline}
.ct-meta{font-size:13px;color:var(--text3);padding:0 4px}
.ct-fail{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;font-size:13px;color:var(--red);font-weight:600;padding:0 4px}
.ct-fail .btn{color:var(--text)}
.ct-new{flex:none;align-self:center;position:relative;z-index:2;margin:-52px 0 8px;min-height:44px;padding:0 16px;display:inline-flex;align-items:center;gap:6px;border-radius:22px;background:var(--bg);border:1px solid var(--border);box-shadow:var(--shadow);font-size:15px;font-weight:600;color:var(--accent)}
.ct-composer{flex:none;display:flex;flex-direction:column;gap:8px;padding:8px 12px calc(8px + var(--safe-b));border-top:1px solid var(--border);background:var(--bg)}
html.kb .ct-composer{padding-bottom:8px}
html.kb .ct-tabs{display:none}
/* Клавиатура открыта: на маленьком телефоне остаётся 300 px высоты, поле ответа обязано поместиться. Плашка «ждёт» и подсказка канала подождут. */
html.kb .ct-wait,html.kb .ct-hint{display:none}
.ct-pending{display:flex;align-items:center;gap:8px;padding:4px 4px 4px 12px;border-radius:var(--radius);background:var(--accent-bg);color:var(--accent);font-size:15px}
.ct-pending .btn.plain{color:var(--text)}
/* ассистент для переписки: блок над полем ответа. Бирюзовый только у предложенного ответа, передача, пауза и «готовит ответ» нейтральные; красного здесь нет */
.ct-assist{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border-radius:var(--radius);background:var(--accent-bg);color:var(--text)}
.ct-assist.note{background:var(--surface)}
.ct-assist-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0 8px}
.ct-assist-top .btn{flex:none;margin:-4px -8px -4px auto}
.ct-assist-head{flex:1 1 150px;min-width:0;display:flex;align-items:flex-start;gap:8px;font-size:13px;font-weight:600;color:var(--accent)}
.ct-assist-head .icon{flex:none;margin-top:1px}
.ct-assist-title{min-width:0;overflow-wrap:break-word;padding-top:1px}
.ct-assist.note .ct-assist-head{color:var(--text2)}
.ct-assist-text{font-size:15px;line-height:1.4;max-height:132px;overflow-y:auto;overscroll-behavior:contain}
.ct-assist.note .ct-assist-text{color:var(--text2)}
.ct-assist-btns{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ct-assist-btns .btn.plain{color:var(--text)}
.ct-assist-go{font-weight:600}
.as-modes .tabs.seg .tab{padding:0 12px}
html.kb .ct-assist{display:none}
.ct-files{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding-top:4px}
.ct-thumb{position:relative;width:64px;height:64px;flex:none}
.ct-thumb img{width:100%;height:100%;object-fit:cover;border-radius:10px;display:block;background:var(--surface2)}
.ct-thumb-x{position:absolute;top:-14px;right:-14px;width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.ct-thumb-x .icon{width:22px;height:22px;padding:4px;border-radius:50%;background:var(--text);color:var(--bg)}
.ct-comp-top{display:flex;align-items:center;gap:4px}
.ct-channel{flex:1;min-width:0}
.ct-hint{font-size:13px;color:var(--text3);padding:0 4px}
.ct-comp-row{display:flex;align-items:flex-end;gap:8px}
textarea.input.ct-text{flex:1;min-height:44px;max-height:140px;resize:none}
.ct-send{flex:none;width:44px;height:44px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center}
.ct-send:disabled{opacity:.5}

/* ---------- контакт: карточка ---------- */
.ct-card{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px 16px calc(48px + var(--safe-b));display:flex;flex-direction:column;gap:24px}
.ct-card .section-body{gap:8px}
.ct-card .section-body>.row,.ct-card .section-body>.kv{margin:-4px 0}
.ct-notes{color:var(--text2);padding-top:4px}
.ct-card .kv a{display:inline-block;padding:13px 0;margin:-13px 0;text-decoration:underline}
.ct-flags:empty{display:none}
.ct-tags{gap:8px}
.chip.ct-tag{height:36px;padding:0;border-radius:18px;font-size:15px}
.ct-tag-t{min-width:0;overflow:hidden;text-overflow:ellipsis;padding-left:12px}
.ct-tag-t:last-child{padding-right:12px}
.ct-tag-x{flex:none;width:44px;height:44px;margin:-4px 0;display:inline-flex;align-items:center;justify-content:center;color:var(--text3)}
.ct-order-act{padding-top:6px}
.ct-amount{font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}

/* ---------- сделки ---------- */
.dl-wrap{display:flex;flex-direction:column;gap:16px}
.dl-wrap.wide{flex:1;min-height:0;padding:0 24px}
.dl-tools{flex:none;display:flex;gap:8px}
.dl-kind{flex:none;width:auto;max-width:55%}
.dl-found{display:flex;flex-direction:column}
.dl-list .dl-col-body{display:flex;flex-direction:column;gap:8px}
.dl-board{flex:1;min-height:0;display:flex;gap:12px;overflow-x:auto;padding-bottom:16px}
.dl-col{flex:0 0 264px;min-height:0;display:flex;flex-direction:column;background:var(--surface);border-radius:var(--radius-lg);border:2px solid transparent}
.dl-col.over{border-color:var(--accent)}
.dl-col-head{flex:none;display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:12px 12px 4px}
.dl-col-title{font-size:15px;font-weight:600}
.dl-board .dl-col-body{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:8px}
.dl-card{display:flex;align-items:flex-start;background:var(--surface);border-radius:var(--radius)}
.dl-board .dl-card{background:var(--bg);cursor:grab}
.dl-card.drag{opacity:.4}
.dl-card-main{flex:1;min-width:0;min-height:44px;display:flex;flex-direction:column;gap:4px;padding:12px;color:var(--text)}
.dl-card-title{font-size:17px;line-height:1.25;overflow-wrap:anywhere}
.dl-card-title.strong{font-weight:600}
.dl-card-sub{font-size:15px;color:var(--text2);overflow-wrap:anywhere}
.dl-card-meta{font-size:13px;color:var(--text3)}
.dl-card .chips{padding-top:2px}
.dl-card .chip.neutral{background:var(--border)}
.dl-none{color:var(--text3);padding:8px 4px}
.dl-stages{display:flex;flex-direction:column;gap:8px}
.dl-stage-opt{display:flex;align-items:center;gap:8px;width:100%;min-height:48px;padding:0 16px;border:1px solid var(--border);border-radius:var(--radius);font-size:17px}
.dl-stage-opt.cur{background:var(--surface)}
.dl-stage-opt.on{border-color:var(--accent);background:var(--accent-bg);color:var(--accent)}
.dl-stage-opt:disabled{opacity:.6}

/* ---------- написать сегодня ---------- */
.out-days{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-14px 0 -14px}
.out-days .link-btn{gap:4px;padding:0}
.out-card{display:flex;flex-direction:column;gap:12px}
.out-head{display:flex;align-items:flex-start;gap:12px}
.out-title{font-size:20px;font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.out-sub{font-size:15px;color:var(--text2)}
.out-card .hstack .link-btn{margin:-10px 0}
.out-img{display:flex;flex-direction:column;gap:4px}
.out-img img{display:block;width:100%;max-height:420px;object-fit:contain;border-radius:var(--radius);background:var(--surface2);-webkit-touch-callout:default}
.out-text{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);padding:12px;font-size:15px;line-height:1.45;user-select:text;-webkit-user-select:text}
.out-prompt summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--text2);font-size:15px}
.out-prompt-text{font-size:13px;color:var(--text2);margin-bottom:8px}
.out-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;color:var(--text)}
.out-done .row-title{color:var(--text2)}

@media (hover:hover){
  .dl-card-main:hover .dl-card-title,.dl-stage-opt:hover{color:var(--accent)}
}
@media (min-width:900px){
  .page.fill>.page-body>.skeleton,.page.fill>.page-body>.empty{margin:0 24px}
  .ct-tabs{padding:0 24px}
  .ct-scroll{padding:16px 24px}
  .ct-wait{padding:6px 24px}
  .ct-composer{padding:12px 24px 16px}
  .ct-card{padding:16px 24px 48px}
  .ct-msg{max-width:70%}
  .inb-left .tabs{margin:0 -24px;padding:0 24px}
}
/* ==================== конец блока «ПРОДАЖИ» ==================== */

/* ==================== ПЛАН ПОСТОВ (pl-) ====================
   Экран на всю высоту (Page fill): внутри одна прокрутка .pl-scroll, в ней же панель управления .pl-top.
   Красного здесь нет, кроме готовых .red и .chip.red: красным помечается только просрочка. */
.pl-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 16px calc(96px + var(--safe-b))}
.pl-top{display:flex;flex-direction:column;gap:12px;padding:8px 0 12px}
.pl-nav{display:flex;align-items:center;gap:4px;min-height:44px}
.pl-nav-label{flex:1;min-width:0;text-align:center;font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
.pl-saved{flex:none;min-width:76px;text-align:right;font-size:13px;color:var(--text3);opacity:0}
.pl-saved.on{opacity:1}
.pl-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pl-actions{display:flex;flex-wrap:wrap;gap:8px}
.pl-week{padding:0 2px}
.pl-sel{display:block;width:100%;text-overflow:ellipsis}
.pl-filters .pl-sel{padding-left:10px;padding-right:26px;background-position:calc(100% - 14px) 19px,calc(100% - 9px) 19px}
.pl-sel.on{border-color:var(--accent);color:var(--accent)}
.pl-results{padding-top:4px}

.pl-cards{display:flex;flex-direction:column}
.pl-day{display:flex;flex-direction:column;gap:8px;padding-bottom:8px}
.pl-day-head{position:sticky;top:0;z-index:3;display:flex;flex-direction:column;gap:6px;padding:12px 0 6px;background:var(--bg)}
.pl-day-title{display:flex;flex-wrap:wrap;align-items:center;gap:0 4px;font-size:15px;font-weight:400}
.pl-day-title strong{font-size:17px}
.pl-day-title strong.today{color:var(--accent)}
.pl-day-sub{color:var(--text2)}
.pl-day-empty{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.pl-card{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-radius:var(--radius-lg);background:var(--surface)}
.pl-card .chip.neutral{background:var(--border)}
.pl-card.skipped,.pl-row.skipped{opacity:.6}
.pl-card-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pl-card-time{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.pl-card-kind{font-size:15px;color:var(--text2)}
.pl-card-chip{margin-left:auto}
.pl-card-main{display:flex;flex-direction:column;gap:2px;width:100%;min-height:44px;color:var(--text);text-align:left}
.pl-card-title{font-size:17px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.pl-card-hook{font-size:15px;color:var(--text2);overflow-wrap:anywhere}
.pl-card-links{display:flex;flex-wrap:wrap;align-items:center;gap:0 12px}
.pl-chip-link{display:inline-flex;align-items:center;gap:4px;min-height:44px;max-width:100%;font-size:13px;color:var(--accent)}
.pl-chip-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-togs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pl-togs .pl-tog{justify-content:flex-start;padding:0 12px;border:1px solid var(--border);background:var(--bg)}
.pl-togs .pl-tog.on{background:var(--surface2)}
.pl-togs .pl-tog.pub.on{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}
.pl-tog{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;border-radius:var(--radius);color:var(--text)}
.pl-tog-box{width:24px;height:24px;border-radius:50%;border:1.75px solid var(--text3);display:flex;align-items:center;justify-content:center;color:var(--bg)}
.pl-tog.on .pl-tog-box{background:var(--text3);border-color:var(--text3)}
.pl-tog.pub.on .pl-tog-box{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.pl-tog-l{font-size:15px}

.pl-table{width:100%;min-width:960px;border-collapse:separate;border-spacing:0;table-layout:fixed}
.pl-table col.c-time{width:112px}.pl-table col.c-kind{width:148px}.pl-table col.c-link{width:128px}.pl-table col.c-who{width:124px}.pl-table col.c-tog{width:64px}.pl-table col.c-pub{width:92px}
.pl-table .pl-sel{padding-left:10px;padding-right:28px;background-position:calc(100% - 16px) 19px,calc(100% - 11px) 19px}
.pl-table thead th{position:sticky;top:0;z-index:4;padding:10px 8px;background:var(--bg);border-bottom:1px solid var(--border);font-size:13px;font-weight:400;color:var(--text3);text-align:left;white-space:nowrap}
.pl-table thead th:nth-child(n+7){text-align:center}
.pl-table td{padding:6px 8px;vertical-align:top;border-bottom:1px solid var(--border)}
.pl-table .pl-day-tr>td{padding:8px 0 0;border-bottom:0}
.pl-table .pl-day-head{position:static;padding:8px 0 6px}
.pl-table .input{display:block;width:100%}
.pl-table .pl-c-kind .input+.input{margin-top:6px}
.pl-c-time .chip{margin-top:6px}
.pl-time{text-align:center;font-weight:600;font-variant-numeric:tabular-nums}
.pl-time-t{min-height:44px;display:flex;align-items:center;font-weight:600;font-variant-numeric:tabular-nums}
.pl-ghost{border-color:transparent;background:transparent;font-weight:600}
.pl-ghost:hover{border-color:var(--border)}
.pl-ghost:focus{background:var(--bg)}
.pl-idea-t{min-height:44px;display:flex;align-items:center;padding:0 12px;font-weight:600;overflow-wrap:anywhere}
.pl-hook{display:block;width:100%;min-height:44px;padding:4px 12px;font-size:13px;line-height:1.35;color:var(--text2);text-align:left;overflow:hidden;overflow-wrap:anywhere}
.pl-hook.muted{color:var(--text3)}
.pl-link{position:relative;display:flex;align-items:center;min-height:44px}
.pl-link-a{display:inline-flex;align-items:center;gap:4px;flex:1;min-width:0;min-height:44px;font-size:13px}
.pl-link-d{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-link-edit{position:absolute;right:0;top:0;width:36px;height:44px;border-radius:var(--radius);background:var(--bg);color:var(--text3);opacity:0}
.pl-link:hover .pl-link-edit,.pl-link:focus-within .pl-link-edit{opacity:1}
.pl-c-tog{text-align:center}
.pl-c-tog .pl-tog{margin:0 auto}

.pl-tpl-list{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius)}
.pl-tpl-line{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-bottom:1px solid var(--border)}
.pl-tpl-line:last-child{border-bottom:0}
.pl-tpl-t{width:48px;font-weight:600;font-variant-numeric:tabular-nums}
.pl-tpl-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--border)}
.pl-tpl-row .pl-sel{flex:1 1 0;width:auto;min-width:0}
.pl-tpl-row .pl-sel+.pl-sel{order:3;flex:1 1 100%}
.pl-tpl-row .icon-btn{order:2}
.pl-tpl-time{flex:0 0 76px;width:76px;text-align:center}
@media (min-width:560px){.pl-tpl-row .pl-sel+.pl-sel{order:0;flex:1 1 0}.pl-tpl-row .icon-btn{order:0}.pl-tpl-row{border-bottom:0;padding-bottom:0}}
.pl-miss{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border)}
.pl-miss:last-child{border-bottom:0}
.pl-miss-t{display:flex;flex-direction:column;gap:2px;min-width:0;overflow-wrap:anywhere}

@media (min-width:700px){
  .pl-day{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .pl-day>.pl-day-head{grid-column:1/-1}
}
@media (min-width:900px){
  .pl-scroll{padding:0 24px 48px}
}
@media (hover:hover){
  .pl-hook:hover{color:var(--accent)}
  .pl-tog:hover .pl-tog-box{border-color:var(--text2)}
}
/* ==================== конец блока «ПЛАН ПОСТОВ» ==================== */

/* ---------- Плотность как у Attio на компьютере ---------- */
@media (min-width:900px){
  body{font-size:14px}
  .page-title{font-size:24px}
  .row-title{font-size:14.5px}
  .row-sub{font-size:13px}
  .btn{min-height:36px;font-size:14px;padding:0 14px;border-radius:8px}
  .section-title{font-size:15px}
  .sidebar{background:#FBFBFA;width:224px}
  .sidebar a.nav{min-height:34px;font-size:14px;border-radius:8px;gap:10px}
  .sidebar a.nav.on{background:#EDEDEB;color:var(--text);font-weight:600}
  .card{border:1px solid var(--border);background:#fff}
}
button,input,select,textarea{font-family:inherit}

/* вкладки внутри раздела (Клиенты, Контент, Деньги, Команда) */
.subtabs{display:flex;gap:4px;padding:10px 16px 0;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none;position:sticky;top:0;background:var(--bg);z-index:5}
.subtabs a{padding:8px 12px 10px;font-size:14px;color:var(--text3);border-bottom:2px solid transparent;white-space:nowrap;font-weight:500}
.subtabs a.on{color:var(--text);border-bottom-color:var(--text);font-weight:600}
.subtabs a:hover{color:var(--text)}

/* ---------- Привлечение: пульт ---------- */
.chip.green{background:var(--green-bg);color:var(--green);font-weight:600}
.chip.amber{background:var(--amber-bg);color:var(--amber);font-weight:600}
.hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.hub-tile{position:relative;display:flex;flex-direction:column;gap:6px;padding:18px 18px 16px;border:1px solid var(--border);border-radius:16px;background:#fff;color:var(--text);
  box-shadow:0 1px 2px rgba(17,18,20,.04);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;animation:hubIn .45s cubic-bezier(.2,.8,.2,1) both;overflow:hidden;min-height:190px}
.hub-tile::after{content:"";position:absolute;inset:0;background:linear-gradient(120deg,transparent 35%,rgba(17,18,20,.045) 50%,transparent 65%);transform:translateX(-100%);transition:transform .7s ease}
.hub-tile:hover{transform:translateY(-3px);box-shadow:0 12px 30px rgba(17,18,20,.10);border-color:#CFCFCB}
.hub-tile:hover::after{transform:translateX(100%)}
.hub-tile:active{transform:translateY(-1px) scale(.99)}
.hub-tile.soon{background:#FBFBFA}
.hub-top{display:flex;align-items:center;gap:8px}
.hub-mono{width:38px;height:38px;border-radius:11px;background:var(--text);color:#fff;display:inline-flex;align-items:center;justify-content:center;font:700 14px var(--display);letter-spacing:-.02em}
.hub-tile.soon .hub-mono{background:#D9D9D5;color:var(--text)}
.hub-soon{margin-left:auto;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text3);border:1px solid var(--border);border-radius:999px;padding:2px 8px}
.hub-pulse{margin-left:auto;width:9px;height:9px;border-radius:50%;background:var(--text);box-shadow:0 0 0 0 rgba(17,18,20,.4);animation:hubPulse 1.8s infinite}
.hub-title{font:700 17px var(--display);letter-spacing:-.01em;margin-top:6px}
.hub-hint{font-size:13px;color:var(--text3);line-height:1.35}
.hub-big{margin-top:auto;font:800 34px/1 var(--display);letter-spacing:-.03em;display:flex;align-items:baseline;gap:8px}
.hub-big small{font:500 12px var(--font);color:var(--text3);letter-spacing:0}
.hub-big.empty{color:#C9C9C5}
.hub-rows{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;color:var(--text3)}
.hub-rows b{color:var(--text);font-weight:600}
.hub-go{position:absolute;right:14px;bottom:14px;color:var(--text3);transition:transform .18s}
.hub-tile:hover .hub-go{transform:translateX(3px);color:var(--text)}
@keyframes hubIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes hubPulse{0%{box-shadow:0 0 0 0 rgba(17,18,20,.35)}70%{box-shadow:0 0 0 9px rgba(17,18,20,0)}100%{box-shadow:0 0 0 0 rgba(17,18,20,0)}}
/* сектор групп */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.kpi{border:1px solid var(--border);border-radius:12px;padding:12px 14px;background:#fff;display:flex;flex-direction:column;gap:2px;animation:hubIn .4s both}
.kpi b{font:800 24px/1.1 var(--display);letter-spacing:-.02em}
.kpi span{font-size:12px;color:var(--text3)}
.gfilters{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.gfilters>*{flex:1 1 260px}
.gtable{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fff}
.ghead,.grow{display:grid;grid-template-columns:minmax(0,3fr) 150px 160px 110px 110px;gap:12px;align-items:center;padding:10px 14px}
.ghead{background:#FBFBFA;border-bottom:1px solid var(--border);font-size:12px;color:var(--text3);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.grow{width:100%;text-align:left;background:#fff;border:0;border-bottom:1px solid var(--border);cursor:pointer;color:var(--text);font:inherit}
.grow:last-child{border-bottom:0}
.grow:hover{background:#F7F7F6}
.grow-main{display:flex;flex-direction:column;min-width:0}
.grow-name{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grow-sub{font-size:12px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grow-status{font-size:13px;display:flex;flex-direction:column}
.grow-status small{color:var(--text3);font-size:11px}
.grow-who,.grow-n{font-size:13px;color:var(--text2)}
@media (max-width:899px){.ghead{display:none}.grow{grid-template-columns:1fr auto;gap:6px}.grow-status,.grow-who,.grow-n{display:none}}
.gsheet{display:flex;flex-direction:column;gap:16px}
.gsheet-head{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.gsheet-meta{font-size:13px;color:var(--text3)}
.gsheet-block{border:1px solid var(--border);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px;background:#fff}
.gsheet-label{font-size:12px;font-weight:600;color:var(--text3);text-transform:uppercase;letter-spacing:.04em;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.gsheet-rule{font-size:14px;line-height:1.5;margin:0}
.gsheet-admin{font-size:14px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.gsheet-msg{white-space:pre-wrap;font-size:14px;line-height:1.55;background:#F7F7F6;border-radius:10px;padding:12px 14px}
.gsheet-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.gsheet-tip{font-size:12.5px;color:var(--text3)}
.gsheet-actions{display:flex;flex-wrap:wrap;gap:8px}
.gsheet-hist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;font-size:13px}
.gsheet-hist li{border-left:2px solid var(--border);padding-left:10px}
.gsheet-hist li div{color:var(--text2)}
.gstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.gstat-card{border:1px solid var(--border);border-radius:12px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:10px}
.gtab{width:100%;border-collapse:collapse;font-size:13px}
.gtab th{text-align:left;color:var(--text3);font-weight:600;font-size:12px;padding:6px 8px;border-bottom:1px solid var(--border)}
.gtab td{padding:7px 8px;border-bottom:1px solid var(--border)}

.brand-mark{width:28px;height:28px;border-radius:8px;background:var(--text);color:#fff;display:inline-flex;align-items:center;justify-content:center;font:800 15px var(--display)}
@media (min-width:900px){.tabs.seg .tab{min-height:34px;font-size:13.5px;padding:0 14px}}
@media (min-width:1200px){.hub-grid{grid-template-columns:repeat(4,1fr)}}

/* Команда → Работа: посты по дням */
.work-bars{display:flex;align-items:flex-end;gap:3px;height:40px;margin-top:10px;padding-top:4px;border-top:1px solid var(--border)}
.work-bars span{flex:1;min-width:3px;background:var(--text);border-radius:2px 2px 0 0;opacity:.85}
.stat-v.green{color:var(--green)}

/* Контент → Цифры Instagram */
.igtable{border:1px solid var(--border);border-radius:10px;overflow:auto;background:var(--bg)}
.ighead,.igrow{display:grid;grid-template-columns:minmax(220px,3fr) repeat(8,minmax(64px,1fr));align-items:center;gap:8px;padding:8px 12px;min-width:860px}
.ighead{background:var(--surface);border-bottom:1px solid var(--border);font-size:12px;color:var(--muted);position:sticky;top:0}
.igsort{background:none;border:0;padding:0;font:inherit;color:inherit;text-align:left;cursor:pointer}
.igsort.on{color:var(--text);font-weight:600}
.igrow{border-bottom:1px solid var(--border);color:var(--text);text-decoration:none;font-size:13px;font-variant-numeric:tabular-nums}
.igrow:hover{background:var(--surface)}
.igpost{display:flex;gap:10px;align-items:center;min-width:0}
.igpost img,.igpost i{width:36px;height:48px;border-radius:6px;object-fit:cover;flex:none;background:var(--surface)}
.igpost span{display:flex;flex-direction:column;min-width:0}
.igpost b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.igpost small{color:var(--muted);font-size:11px}

/* Привлечение → Рисунки владельцев */
.drw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.drw-card{display:flex;gap:12px;align-items:center;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--bg);text-align:left;cursor:pointer;font:inherit;color:var(--text)}
.drw-card:hover{background:var(--surface)}
.drw-thumb{width:64px;height:80px;flex:none;border-radius:8px;overflow:hidden;background:var(--surface);display:flex;align-items:center;justify-content:center}
.drw-thumb img{width:100%;height:100%;object-fit:cover}
.drw-thumb i{font-style:normal;font-size:22px;color:var(--muted)}
.drw-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.drw-info b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drw-info small{color:var(--muted);font-size:12px}
.drw-sheet{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:20px}
@media (max-width:720px){.drw-sheet{grid-template-columns:1fr}}
.drw-img img{width:100%;border-radius:10px;border:1px solid var(--border);display:block}
.drw-noimg{aspect-ratio:3/4;border:1px dashed var(--border);border-radius:10px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.drw-body{display:flex;flex-direction:column;gap:10px;min-width:0}
.drw-check{border:1px solid var(--border);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;background:var(--surface)}
.drw-ck{display:flex;gap:8px;align-items:flex-start;font-size:14px;cursor:pointer}

/* «Смотреть как сотрудница» */
.viewas-bar{position:sticky;top:0;z-index:30;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 14px;background:#111214;color:#fff;font-size:13px}
.viewas-bar .btn{background:#fff;color:#111214;min-height:32px}

/* «Мой день» сотрудницы: красный, пока не всё; зелёный, когда всё */
.myday{border-radius:16px;padding:18px;border:1px solid var(--border)}
.myday-red{background:#FDF1F0;border-color:#F3C9C4}
.myday-green{background:#EEF8F0;border-color:#BFE3C8}
.myday-status{font-family:var(--display);font-size:26px;font-weight:700;line-height:1.15}
.myday-red .myday-status{color:#B3261E}
.myday-green .myday-status{color:#1E7B34}
.myday-sub{color:var(--muted);font-size:13px;margin-top:4px}
.myday-bar{height:8px;border-radius:8px;background:rgba(0,0,0,.08);margin-top:12px;overflow:hidden}
.myday-bar span{display:block;height:100%;background:currentColor;border-radius:8px}
.myday-red .myday-bar span{background:#B3261E}
.myday-green .myday-bar span{background:#1E7B34}
.myday-list{display:flex;flex-direction:column;gap:8px;margin-top:16px}
.myday-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;background:#fff;border:1px solid var(--border);color:var(--text);text-decoration:none}
.myday-item.todo{border-color:#F3C9C4}
.myday-item.ok{opacity:.75}
.myday-mark{width:26px;height:26px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;border:2px solid #D9D6D0;font-weight:700}
.myday-item.ok .myday-mark{background:#1E7B34;border-color:#1E7B34;color:#fff}
.myday-item.todo .myday-mark{border-color:#B3261E}
.myday-text{display:flex;flex-direction:column;min-width:0;flex:1}
.myday-text small{color:var(--muted);font-size:12px;margin-top:2px}
.myday-num{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.myday-item.todo .myday-num{color:#B3261E}
