/* =====================================================================
   TSDGroup — светлая (по умолчанию) и тёмная темы, бирюзовый акцент
   ===================================================================== */
:root {
    color-scheme: light;

    --bg:          #F3F5F8;   /* фон приложения */
    --bg-2:        #FFFFFF;   /* сайдбар */
    --surface:     #FFFFFF;   /* карточки */
    --surface-2:   #F2F5F8;   /* поля ввода, вложенные */
    --surface-3:   #E7ECF1;   /* ховер */
    --border:        rgba(16,24,40,0.09);
    --border-2:      rgba(16,24,40,0.16);

    --text:        #121821;
    --text-2:      #586374;
    --text-3:      #97A1B0;

    --accent:      #12B5A6;   /* бирюзовый */
    --accent-2:    #0FA093;   /* ховер / темнее */
    --accent-soft: rgba(18,181,166,0.12);
    --accent-ink:  #FFFFFF;   /* текст на бирюзе */

    --red:    #EF5B5B;  --red-bg:    rgba(239,91,91,0.12);
    --green:  #22B07D;  --green-bg:  rgba(34,176,125,0.12);
    --blue:   #4C82F7;  --blue-bg:   rgba(76,130,247,0.12);
    --amber:  #E8993A;  --amber-bg:  rgba(232,153,58,0.14);

    --dot: rgba(16,24,40,0.06);
    --board-bg: #E7ECF2;   /* фон доски — заметно серее белых карточек */

    --radius:    16px;
    --radius-sm: 11px;
    --radius-xs: 8px;
    --shadow:    0 12px 30px -14px rgba(16,24,40,0.16);
    --ring:      0 0 0 3px var(--accent-soft);

    --sidebar-w: 252px;
    --content-w: 1280px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg:          #0D0F13;   /* нейтральный тёмный, без зелёного оттенка */
    --bg-2:        #14161B;
    --surface:     #171A20;
    --surface-2:   #1E222A;
    --surface-3:   #272C36;
    --border:        rgba(255,255,255,0.08);
    --border-2:      rgba(255,255,255,0.15);

    --text:        #ECEEF2;
    --text-2:      #A6ADBB;
    --text-3:      #737B8A;

    --accent:      #2DD4BF;
    --accent-2:    #14B8A6;
    --accent-soft: rgba(45,212,191,0.15);
    --accent-ink:  #05231F;

    --red:    #F0776F;  --red-bg:    rgba(240,119,111,0.15);
    --green:  #34D399;  --green-bg:  rgba(52,211,153,0.15);
    --blue:   #6699F0;  --blue-bg:   rgba(102,153,240,0.15);
    --amber:  #E0A83E;  --amber-bg:  rgba(224,168,62,0.16);

    --dot: rgba(255,255,255,0.05);
    --board-bg: #090A0D;
    --shadow: 0 18px 40px -22px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button { cursor: pointer; font-family: inherit; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; }
::selection { background: var(--accent-soft); }

/* Тонкие скроллбары */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

.hidden { display: none !important; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Каркас: сайдбар-дерево + рабочая область
   ===================================================================== */
#app-shell { display: flex; height: 100vh; overflow: hidden; }

.side {
    width: var(--sidebar-w);
    flex: none;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Переключатель отдела */
.side-head { position: relative; padding: 12px; border-bottom: 1px solid var(--border); }
.dep-switch {
    width: 100%; display: flex; align-items: center; gap: 10px;
    background: none; border: none; padding: 8px; border-radius: 10px;
    color: var(--text); transition: background .15s;
}
.dep-switch:hover { background: var(--surface); }
.dep-mark {
    width: 30px; height: 30px; flex: none;
    border-radius: 8px; background: var(--accent); color: var(--accent-ink);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
}
.dep-mark.sm { width: 24px; height: 24px; font-size: 12px; border-radius: 6px; }
.dep-name { flex: 1; text-align: left; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-caret { color: var(--text-3); font-size: 11px; }
.dep-menu {
    position: absolute; z-index: 30; top: calc(100% - 4px); left: 12px; right: 12px;
    background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px;
    padding: 6px; box-shadow: var(--shadow); animation: fade .15s ease;
}
.dm-item, .dm-action {
    display: flex; align-items: center; gap: 9px; width: 100%;
    border: none; background: none; color: var(--text);
    padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left;
}
.dm-item:hover, .dm-action:hover { background: var(--surface-2); }
.dm-item.active { color: var(--accent); }
.dm-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dm-action { color: var(--text-2); font-weight: 600; }

/* Проекты */
.side-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; }
.side-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 0 8px 9px; }
.project-list { display: flex; flex-direction: column; gap: 2px; }
.proj-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: none; color: var(--text-2);
    padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left;
    transition: background .12s, color .12s;
}
.proj-item:hover { background: var(--surface); color: var(--text); }
.proj-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.proj-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.side-add {
    width: 100%; margin-top: 8px;
    border: 1px dashed var(--border-2); background: none; color: var(--text-3);
    padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: .15s;
}
.side-add:hover { border-color: var(--accent); color: var(--accent); }
.proj-input {
    width: 100%; margin-top: 4px;
    background: var(--surface-2); border: 1px solid var(--accent); border-radius: 8px;
    padding: 9px 10px; color: var(--text); font-size: 14px;
}

/* Низ сайдбара */
.side-foot { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: none; color: var(--text-2);
    padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left; transition: .12s;
}
.side-item:hover { background: var(--surface); color: var(--text); }
.si-ico { width: 18px; text-align: center; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-top: 4px; }
.side-av { width: 30px; height: 30px; font-size: 12px; }
.su-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Рабочая область */
.work { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 30px 32px 28px; }
.work-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* Доска / граф / чат заполняют доступную высоту (без «фантомного» скролла) */
#pane-board:not(.hidden), #pane-graph:not(.hidden), #pane-chat:not(.hidden) { display: flex; flex-direction: column; height: 100%; }
.work-head { margin-bottom: 22px; flex: none; }
.topbar { flex: none; }
.work-title { margin: 0 0 14px; font-size: 26px; }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ptab {
    border: none; background: none; color: var(--text-3);
    padding: 10px 16px; font-size: 14px; font-weight: 600;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .15s;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpane { animation: fade .2s ease; }

/* Список задач */
.list-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.btn-primary { border: none; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 700; transition: background .15s; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border: 1px solid var(--border-2); background: none; color: var(--text-2); padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.btn-ghost:hover { color: var(--text); }
.list-count { color: var(--text-3); font-size: 13px; margin-left: auto; }

.create-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.create-panel #task-title { width: 100%; }
.cp-grid { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.cp-grid .datefield { flex: 1; min-width: 190px; }
.cp-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* Сегмент-контрол */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg .seg-btn { border: none; background: none; color: var(--text-3); padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: .15s; }
.seg .seg-btn:hover { color: var(--text); }
.seg .seg-btn.active { background: var(--accent); color: var(--accent-ink); }

/* Приоритет + метки на карточке */
.prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.prio-high { background: var(--red); }
.prio-normal { background: var(--amber); }
.prio-low { background: var(--text-3); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 6px; padding: 2px 8px; font-size: 11px; }

/* Пустые состояния / заглушки */
.empty-state { text-align: center; padding: 52px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state b { font-size: 16px; color: var(--text); }
.empty-state span { color: var(--text-3); font-size: 14px; }
.empty-state .btn-primary { margin-top: 10px; }
.soon { text-align: center; padding: 72px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-3); }
.soon b { font-size: 18px; color: var(--text-2); }
.soon span { font-size: 14px; max-width: 420px; }

/* Приглашение */
.invite-modal .invite-row { display: flex; gap: 8px; margin-top: 12px; }
.invite-modal input { flex: 1; }

/* Мобильная раскладка */
@media (max-width: 820px) {
    #app-shell { flex-direction: column; height: auto; overflow: visible; }
    .work { height: auto; overflow: visible; }
    .side {
        width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
        flex-direction: column; border-right: none; border-bottom: 1px solid var(--border);
    }
    .side-scroll { display: flex; flex-direction: row; align-items: center; gap: 6px; overflow-x: auto; padding: 8px 12px; }
    .side-label { display: none; }
    .project-list { flex-direction: row; gap: 6px; }
    .proj-item { white-space: nowrap; }
    .side-add { width: auto; margin-top: 0; white-space: nowrap; }
    .side-foot { flex-direction: row; flex-wrap: wrap; border-top: none; }
    .side-user { margin-top: 0; margin-left: auto; }
    .work { padding: 18px 16px 40px; }
    .work-title { font-size: 22px; }
    .work-body { overflow: visible; flex: none; }
    #pane-board:not(.hidden), #pane-graph:not(.hidden), #pane-chat:not(.hidden) { display: block; height: auto; }
    .board-viewport, .graph-viewport, .pchat { height: 72vh; flex: none; }
}

/* =====================================================================
   Шапки экранов
   ===================================================================== */
.header-container { margin-bottom: 20px; }

.analytic-header,
.tasks-header,
.create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.create-header { display: block; }
.head-titles h2,
.analytic-header h2,
.tasks-header h2,
.create-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text);
}
.head-titles p,
.analytic-header p,
.tasks-header p,
.create-header p {
    margin: 3px 0 0;
    color: var(--text-3);
    font-size: 13.5px;
}

.avatar {
    width: 42px; height: 42px;
    flex: none;
    border-radius: 50%;
    background-color: var(--surface-3);
    background-size: cover;
    background-position: center;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

/* =====================================================================
   Аналитика
   ===================================================================== */
.open_task_pos { margin-bottom: 14px; }

.open_tasks {
    position: relative;
    background:
        radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.open_tasks::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--accent);
}
.open_tasks > p:first-child {
    margin: 0;
    color: var(--text-2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.open_tasks h2 {
    margin: 6px 0 0;
    font-size: 46px;
    line-height: 1;
    color: var(--accent);
    font-weight: 700;
}

.open_close,
.completed_missed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.close_today,
.close_tomorrow,
.completed_tasks,
.missed_deadline {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 108px;
    justify-content: space-between;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.close_today:hover,
.close_tomorrow:hover,
.completed_tasks:hover,
.missed_deadline:hover {
    transform: translateY(-3px);
    border-color: var(--border-2);
    box-shadow: var(--shadow);
}
.open_tasks { transition: transform .18s, box-shadow .18s; }
.open_tasks:hover { transform: translateY(-2px); }
.close_today > p,
.close_tomorrow > p,
.completed_tasks > p,
.missed_deadline > p {
    margin: 0;
    color: var(--text-2);
    font-size: 13px;
}
.close_today     { color: var(--accent); }
.close_tomorrow  { color: var(--blue); }
.completed_tasks { color: var(--green); }
.missed_deadline { color: var(--red); }

.close_today h2,
.close_tomorrow h2,
.completed_tasks h2,
.missed_deadline h2 {
    margin: 0;
    font-size: 27px;
    font-weight: 700;
}
.stat-bottom { display: flex; flex-direction: column; gap: 9px; }
.trend { font-size: 11px; font-weight: 700; }

.bar {
    height: 5px;
    border-radius: 4px;
    background: var(--surface-3);
    overflow: hidden;
}
.bar > i {
    display: block; height: 100%;
    border-radius: 4px;
    background: currentColor;
    transition: width .5s ease;
}
.bar > i.grad { background: linear-gradient(90deg, var(--accent), var(--green)); }

.closed-total {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    color: var(--accent);
}
.ct-row { display: flex; justify-content: space-between; align-items: baseline; }
.ct-row p { margin: 0; color: var(--text-2); font-size: 13px; }
.ct-row h2 { margin: 0; color: var(--text); font-size: 22px; }

/* ---------- Диаграммы ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.chart-wide { margin-bottom: 12px; }
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color .18s, transform .18s;
}
.chart-card:hover { border-color: var(--border-2); }
.chart-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.07em;
    margin-bottom: 16px;
}

/* Кольцевая */
.donut-wrap { position: relative; width: 156px; height: 156px; margin: 0 auto 16px; }
.donut { width: 100%; height: 100%; animation: pop .5s ease; }
.donut-seg { transition: stroke-dasharray .6s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 28px; color: var(--text); font-weight: 700; }
.donut-center span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.legend { display: flex; flex-direction: column; gap: 9px; }
.lg-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.lg-row b { margin-left: auto; color: var(--text); }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* Столбики по дням */
.barchart { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 156px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar-val { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text-2); }
.bar-track { width: 100%; max-width: 28px; flex: 1; display: flex; align-items: flex-end; }
.bar-fill { position: relative; }
.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-radius: 6px 6px 3px 3px;
    transform-origin: bottom;
    animation: growV .6s cubic-bezier(.4, 0, .2, 1);
}
.bar-fill.today { box-shadow: 0 0 0 1px var(--accent-soft); }
.bar-lbl { font-size: 11px; color: var(--text-3); }
@keyframes growV { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Горизонтальные бары (отделы) */
.barchart-h { display: flex; flex-direction: column; gap: 13px; }
.hbar { display: flex; align-items: center; gap: 12px; }
.hbar-lbl { width: 130px; flex: none; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 6px;
    transform-origin: left;
    animation: growH .6s cubic-bezier(.4, 0, .2, 1);
}
.hbar-val { width: 30px; flex: none; text-align: right; font-size: 13px; font-weight: 700; color: var(--text); }
@keyframes growH { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chart-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 14px; }

@media (max-width: 720px) { .charts { grid-template-columns: 1fr; } }

/* =====================================================================
   Задачи
   ===================================================================== */
.filter-buttons {
    position: relative;
    display: flex;
    width: 280px;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}
.filter-buttons::before {
    content: "";
    position: absolute; top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    background: var(--accent);
    border-radius: 9px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.filter-buttons[data-active="created"]::before { transform: translateX(100%); }
.filter-buttons button {
    position: relative; z-index: 1;
    flex: 1;
    border: none;
    border-radius: 9px;
    padding: 9px 0;
    font-size: 13.5px;
    font-weight: 600;
    background: none;
    transition: color .2s;
}
.filter-buttons .task-active-button { color: var(--accent-ink); }
.filter-buttons .task-inactive-button { color: var(--text-3); }

/* Три колонки: Сегодня / Завтра / Позже — на всю ширину */
.tasks-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.tcol { min-width: 0; display: flex; flex-direction: column; }
.tcol-head { display: flex; align-items: center; gap: 9px; padding: 4px 4px 12px; }
.tcol-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tcol-dot.col-red { background: var(--red); } .tcol-dot.col-blue { background: var(--blue); } .tcol-dot.col-amber { background: var(--amber); }
.tcol-name { font-size: 14px; font-weight: 700; color: var(--text); }
.tcol-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; }
.tcol-body { display: flex; flex-direction: column; gap: 12px; }
.tcol-empty { color: var(--text-3); font-size: 13px; padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.card-button { animation: cardIn .32s both cubic-bezier(.2,.7,.3,1); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .tasks-card { grid-template-columns: 1fr; } }

.day-label {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 8px;
}

.card-button {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px 16px;
    transition: border-color .18s, transform .18s, background .18s, box-shadow .18s;
}
.card-button:hover {
    border-color: var(--border-2);
    background: var(--surface-2);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.card-button:active { transform: translateY(-1px) scale(.995); }

.task-card { display: flex; flex-direction: column; gap: 11px; }
.task-card p { margin: 0; }

.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-top h2 { margin: 0; color: var(--text); font-size: 15.5px; line-height: 1.35; font-weight: 600; }

.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.department {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 12px;
}
.assignee { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12.5px; }

.mini-av {
    width: 22px; height: 22px;
    border-radius: 50%;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; font-weight: 700; flex: none;
}

.chip {
    flex: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.chip-red    { background: var(--red-bg);   color: var(--red); }
.chip-orange { background: var(--amber-bg); color: var(--amber); }
.chip-blue   { background: var(--blue-bg);  color: var(--blue); }
.chip-green  { background: var(--green-bg); color: var(--green); }

.task-foot { display: flex; justify-content: space-between; align-items: center; }
.due { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.due svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.acts { display: flex; gap: 8px; }
.icon-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: var(--text-2); stroke-width: 1.6; }
.icon-btn.danger svg { stroke: var(--red); }

.hint {
    display: flex; align-items: center; gap: 9px;
    color: var(--text-3);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    margin-top: 10px;
}
.hint svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }

/* =====================================================================
   Формы (создание / редактирование)
   ===================================================================== */
.form-container form,
#modal-edit { display: flex; flex-direction: column; }

.form-container form p,
#modal-edit p {
    margin: 16px 0 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}
.form-container form p span { color: var(--accent); }
/* Окно редактирования: единый вертикальный ритм, метки прижаты к своим полям */
#modal-edit { gap: 14px; }
#modal-edit p { margin: 2px 0 -6px; }
#modal-edit .cp-row { margin: 0; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], textarea, .pick-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px 13px;
    color: var(--text);
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 92px; resize: vertical; }

/* Отделы — чипы-переключатели */
.dept-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dept {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    transition: all .15s;
}
.dept:hover { border-color: var(--border-2); }
.dept.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.create_button {
    margin-top: 22px;
    border: none;
    border-radius: var(--radius-xs);
    padding: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 15px;
    font-weight: 700;
    transition: background .15s, transform .1s;
}
.create_button:hover { background: var(--accent-2); }
.create_button:active { transform: scale(.99); }

/* Участники */
.people-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.add-user {
    width: 38px; height: 38px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    font-size: 20px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.add-hint { color: var(--text-3); font-size: 13px; }

.people-picker {
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.pick-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pick-add {
    border: none; border-radius: var(--radius-xs);
    padding: 0 16px;
    background: var(--accent); color: var(--accent-ink);
    font-weight: 600; white-space: nowrap;
}
.pick-list { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow-y: auto; }
.pick-row {
    display: flex; align-items: center; gap: 12px;
    width: 100%; border: 1px solid transparent; background: none;
    padding: 9px 10px; border-radius: var(--radius-xs);
    text-align: left; color: var(--text);
    transition: background .12s, border-color .12s;
}
.pick-row:hover { background: var(--surface-2); }
.pick-row.picked { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pick-check { margin-left: auto; color: var(--accent); opacity: 0; font-weight: 700; }
.pick-row.picked .pick-check { opacity: 1; }
.pick-empty { color: var(--text-3); font-size: 13px; padding: 14px 8px; text-align: center; }

.people-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.person-item {
    display: flex; align-items: center; gap: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px 10px;
}
.person-name { font-size: 14px; }
.person-name small { display: block; color: var(--text-3); font-size: 11px; }
.person-remove {
    margin-left: auto;
    border: none; background: none;
    color: var(--text-3); font-size: 15px;
}
.person-remove:hover { color: var(--red); }

.p-av {
    width: 34px; height: 34px;
    flex: none;
    border-radius: 50%;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px;
}

/* =====================================================================
   Настройки
   ===================================================================== */
.settings { display: flex; flex-direction: column; gap: 14px; }

.profile-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.avatar-lg { width: 62px; height: 62px; font-size: 20px; }
#settings-avatar { cursor: pointer; }
.profile-name { color: var(--text); font-size: 18px; font-weight: 650; }
.profile-sub { color: var(--text-3); font-size: 13px; }
.link-btn {
    margin-top: 6px;
    border: none; background: none; padding: 0;
    color: var(--accent); font-size: 13px; font-weight: 600;
}
.link-btn:hover { color: var(--accent-2); }

.settings-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    display: flex; flex-direction: column;
}
.set-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 14px;
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14.5px;
    transition: background .12s;
}
.set-row[data-action], .set-logout { cursor: pointer; }
.set-row[data-action]:hover, .set-logout:hover { background: var(--surface-2); }
.set-row .chev { color: var(--text-3); font-size: 18px; }
.set-logout span:first-child { color: var(--red); }

.set-email { padding: 4px 14px 14px; }
.set-email input { margin-bottom: 8px; }
.set-email small { color: var(--text-3); font-size: 12px; }

#save-settings {
    width: 100%;
    margin: 6px 0 2px;
}

/* Переключатель */
.switch {
    position: relative;
    appearance: none; -webkit-appearance: none;
    width: 46px; height: 26px; flex: none;
    background: var(--surface-3);
    border-radius: 20px;
    transition: background .18s;
    cursor: pointer;
}
.switch::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff; border-radius: 50%;
    transition: left .18s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 23px; }

/* Под-экраны настроек */
.sub-head { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
.sub-head .head-titles { text-align: left; }
.back-btn {
    flex: none;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 50%;
    font-size: 22px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.back-btn:hover { background: var(--surface-2); }

.team-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 8px;
}
.team-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
}
.team-item:last-child { border-bottom: none; }

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.info-card h3 { margin: 0 0 7px; font-size: 15px; color: var(--text); }
.info-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.about-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-2); }
.about-row b { color: var(--text); font-weight: 600; }
.about-row + .about-row { border-top: 1px solid var(--border); }

/* =====================================================================
   Модальное окно задачи
   ===================================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    z-index: 60;
    animation: fade .2s ease;
}
.modal {
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-close {
    border: none; background: none;
    color: var(--text-3); font-size: 18px; line-height: 1;
    padding: 2px;
}
.modal-close:hover { color: var(--text); }

.d-line { margin: 11px 0 0; color: var(--text-2); font-size: 13.5px; }
#d-people { display: flex; align-items: center; gap: 8px; }
#d-people .d-avs { flex: none; }
.d-desc { margin: 15px 0 0; color: var(--text); font-size: 14px; line-height: 1.55; }

.mini-chat {
    margin-top: 18px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.mini-chat-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 10px;
}
.mini-chat-body { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }

.chat-msg {
    align-self: flex-end;
    max-width: 82%;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 8px 11px;
    border-radius: 13px 13px 3px 13px;
    font-size: 13px;
}
.chat-msg .chat-author { display: block; font-size: 11px; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.chat-msg .chat-time { display: block; font-size: 10px; opacity: .7; text-align: right; margin-top: 3px; }
.chat-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 10px; }

.mini-chat-input { display: flex; gap: 8px; }
.mini-chat-input input { flex: 1; }
.mini-chat-input button {
    border: none; border-radius: var(--radius-xs);
    padding: 0 15px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 15px; font-weight: 700;
}

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-edit, .btn-del {
    flex: 1;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-xs);
    padding: 12px;
    font-size: 14px; font-weight: 600;
    background: var(--surface-2);
    color: var(--text);
}
.btn-edit:hover { border-color: var(--accent); color: var(--accent); }
.btn-del { color: var(--red); }
.btn-del:hover { background: var(--red-bg); border-color: var(--red); }

.status-toggle {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px;
    font-size: 14px; color: var(--text);
}

/* =====================================================================
   Экран входа / регистрации
   ===================================================================== */
#auth-screen, #onboarding-screen {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
        radial-gradient(80% 60% at 50% -10%, var(--accent-soft), transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 34px 28px;
    box-shadow: var(--shadow);
}
.auth-logo {
    font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
    text-align: center; color: var(--text);
}
.auth-logo::first-letter { color: var(--accent); }
.auth-sub { margin: 8px 0 24px; text-align: center; color: var(--text-3); font-size: 13.5px; }

.auth-tabs {
    position: relative;
    display: flex;
    background: var(--surface-2);
    border-radius: 12px; padding: 4px;
    margin-bottom: 20px;
}
.auth-tabs::before {
    content: "";
    position: absolute; top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    background: var(--accent);
    border-radius: 9px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.auth-tabs[data-active="register"]::before,
.auth-tabs[data-active="join"]::before { transform: translateX(100%); }
.auth-tab {
    position: relative; z-index: 1;
    flex: 1; border: none; background: none;
    color: var(--text-3);
    padding: 10px;
    font-size: 14px; font-weight: 600;
    transition: color .2s;
}
.auth-tab.active { color: var(--accent-ink); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form:not(.hidden) { animation: authIn .3s ease; }
@keyframes authIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.auth-submit {
    margin-top: 6px;
    border: none; border-radius: var(--radius-xs);
    padding: 14px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 15px; font-weight: 700;
    transition: background .15s;
}
.auth-submit:hover { background: var(--accent-2); }
.auth-error { color: var(--red); font-size: 13px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after { animation: none !important; transition: none !important; }
}

/* ===================== Кастомный календарь ===================== */
.datefield { position: relative; }
.date-trigger {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px 13px;
    color: var(--text);
    font-size: 14.5px; text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.date-trigger:hover { border-color: var(--border-2); }
.date-text.placeholder { color: var(--text-3); }
.date-ico { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 1.6; flex: none; }

.date-pop {
    position: absolute; z-index: 30;
    top: calc(100% + 6px); left: 0;
    width: 300px; max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow);
    animation: fade .18s ease;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dp-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dp-navs { display: flex; gap: 6px; }
.dp-nav {
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    border-radius: 8px; font-size: 16px; line-height: 1;
    transition: border-color .12s, color .12s;
}
.dp-nav:hover { border-color: var(--border-2); color: var(--text); }
.dp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dp-week span { text-align: center; font-size: 11px; color: var(--text-3); font-weight: 600; padding: 4px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-day {
    aspect-ratio: 1;
    border: none; background: none;
    color: var(--text-2); font-size: 13px;
    border-radius: 8px;
    transition: background .12s, color .12s;
}
.dp-day:hover { background: var(--surface-2); color: var(--text); }
.dp-day.today { color: var(--accent); font-weight: 700; }
.dp-day.sel { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.dp-clear, .dp-today { border: none; background: none; font-size: 13px; font-weight: 600; }
.dp-clear { color: var(--text-3); }
.dp-clear:hover { color: var(--red); }
.dp-today { color: var(--accent); }
.dp-today:hover { color: var(--accent-2); }

/* ===================== Тост ===================== */
.toast {
    position: fixed; z-index: 200;
    left: 50%; bottom: 28px;
    transform: translate(-50%, 18px);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { border-left-color: var(--red); }
@media (min-width: 900px) { .toast { left: calc(50% + var(--sidebar-w) / 2); } }

/* ===================== Ф2: карточка — участники, чек-лист ===================== */
.av-stack { display: inline-flex; }
.av-stack .mini-av { margin-left: -6px; border: 2px solid var(--surface); }
.av-stack .mini-av:first-child { margin-left: 0; }
.mini-av.mini-more { background: var(--surface-3); color: var(--text-2); font-size: 9px; }
.cl-badge { margin-left: auto; font-size: 12px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.cl-badge.done { color: var(--green); border-color: rgba(79,183,131,.3); }

/* Чек-лист в окне задачи */
.checklist { margin-top: 16px; }
.cl-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 10px; }
.cl-items { display: flex; flex-direction: column; gap: 6px; }
.cl-item { display: flex; align-items: center; gap: 10px; }
.cl-check { width: 20px; height: 20px; flex: none; border: 1.5px solid var(--border-2); background: none; border-radius: 6px; color: var(--accent-ink); font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.cl-item.done .cl-check { background: var(--accent); border-color: var(--accent); }
.cl-item.done .cl-text { color: var(--text-3); text-decoration: line-through; }
.cl-text { flex: 1; font-size: 14px; }
.cl-del { border: none; background: none; color: var(--text-3); font-size: 13px; opacity: 0; }
.cl-item:hover .cl-del { opacity: 1; }
.cl-del:hover { color: var(--red); }
.cl-empty { color: var(--text-3); font-size: 13px; }
.cl-add { display: flex; gap: 8px; margin-top: 10px; }
.cl-add input { flex: 1; }
.cl-add button { border: none; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); border-radius: 8px; width: 40px; font-size: 18px; }
.cl-add button:hover { border-color: var(--accent); }

/* ===================== Ф3: Miro-доска ===================== */
.board-pane { max-width: none; }
.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.board-hint { color: var(--text-3); font-size: 12px; }
.board-viewport {
    position: relative; overflow: hidden;
    flex: 1; min-height: 320px;
    background: var(--board-bg);
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid var(--border); border-radius: var(--radius);
    touch-action: none; cursor: default;
    user-select: none; -webkit-user-select: none;   /* без выделения текста и попапа переводчика */
}
.board-viewport.grabbing { cursor: grabbing; }
.board-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.ci { position: absolute; width: 180px; cursor: default; }
.ci-content[contenteditable="true"] { user-select: text; -webkit-user-select: text; }
.ci-content { outline: none; word-break: break-word; white-space: pre-wrap; }
.ci-content[contenteditable="true"] { cursor: text; }
.ci-note {
    background: var(--nc, #12B5A6);
    color: #06302B; border-radius: 10px; padding: 12px 14px;
    box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); font-size: 14px; font-weight: 500;
    min-height: 90px;
}
.ci-text { color: var(--text); font-size: 15px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.ci-del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--surface-3); color: var(--text); font-size: 11px; opacity: 0; transition: .12s; }
.ci:hover .ci-del { opacity: 1; }
.ci-del:hover { background: var(--red); }

/* ===================== Ф4: граф ===================== */
.graph-viewport {
    position: relative; overflow: hidden;
    flex: 1; min-height: 320px;
    background: var(--board-bg);
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: default; touch-action: none;
}
.graph-viewport.grabbing { cursor: grabbing; }
.graph-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
#graph-svg { position: absolute; top: 0; left: 0; }
#graph-nodes { position: absolute; top: 0; left: 0; }
.dep-edge { cursor: pointer; }
.dep-edge:hover { stroke: var(--red) !important; }
.gnode {
    position: absolute; width: 190px; height: 66px;
    background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px;
    padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow);
    display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
    transition: border-color .12s, transform .12s;
}
.gnode:hover { border-color: var(--accent); transform: translateY(-1px); }
.gnode.linking { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gnode-title { font-size: 13.5px; font-weight: 600; line-height: 1.25; max-height: 34px; overflow: hidden; }
.gnode-chip { align-self: flex-start; }
#link-mode-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ===================== Ф5: чат проекта ===================== */
.pchat { display: flex; flex-direction: column; flex: 1; min-height: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pchat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.pmsg { display: flex; }
.pmsg.mine { justify-content: flex-end; }
.pmsg-bub { max-width: 70%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; padding: 8px 12px; }
.pmsg.mine .pmsg-bub { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 12px 12px 3px 12px; }
.pmsg-author { display: block; font-size: 11px; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.pmsg.mine .pmsg-author { display: none; }
.pmsg-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.pmsg-time { display: block; font-size: 10px; opacity: .6; text-align: right; margin-top: 3px; }
.pchat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: center; }
.pchat-input input { flex: 1; }
/* Поле ввода сообщения — как поле «Название задачи» */
#pchat-input { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 12px 13px; color: var(--text); font-size: 14.5px; }
#pchat-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ===================== Логотип ===================== */
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.logo { width: 30px; height: 30px; flex: none; display: block; }
.logo svg { width: 100%; height: 100%; display: block; }
.logo-word { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.logo-auth { width: 46px; height: 46px; margin: 0 auto 8px; }

/* ===================== Иконки ===================== */
.ptab { display: inline-flex; align-items: center; gap: 7px; }
.ptab .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.si-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ===================== Герой аналитики — заливка бирюзой ===================== */
.open_tasks { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 55%, transparent); }
.open_tasks::before { display: none; }
.open_tasks > p:first-child { color: rgba(255,255,255,0.85); }
.open_tasks h2 { color: #fff; }

/* Мягкие тени карточек (светлая тема) */
.card-button, .chart-card, .close_today, .close_tomorrow, .completed_tasks, .missed_deadline, .closed-total, .team-list, .info-card, .settings-list, .profile-card {
    box-shadow: 0 4px 16px -10px rgba(16,24,40,0.14);
}
:root[data-theme="dark"] .card-button,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .close_today,
:root[data-theme="dark"] .close_tomorrow,
:root[data-theme="dark"] .completed_tasks,
:root[data-theme="dark"] .missed_deadline,
:root[data-theme="dark"] .closed-total,
:root[data-theme="dark"] .team-list,
:root[data-theme="dark"] .info-card,
:root[data-theme="dark"] .settings-list,
:root[data-theme="dark"] .profile-card { box-shadow: none; }

/* ===================== Верхняя панель (топбар) ===================== */
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.search {
    flex: 1; max-width: 460px;
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 0 14px; height: 44px;
    box-shadow: 0 4px 14px -10px rgba(16,24,40,0.12);
}
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 14.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-btn2 {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px -10px rgba(16,24,40,0.12);
}
.icon-btn2 svg { width: 19px; height: 19px; fill: none; stroke: var(--text-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn2:hover { border-color: var(--border-2); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.top-av { width: 38px; height: 38px; font-size: 13px; }
.top-name { font-size: 14px; font-weight: 600; }

/* ===================== Дашборд-аналитика (полная ширина) ===================== */
.dash { max-width: none; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
    box-shadow: 0 4px 16px -10px rgba(16,24,40,0.14);
    transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card h2 { margin: 6px 0 4px; font-size: 34px; font-weight: 750; }
.stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-cap { color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-sub { color: var(--text-3); font-size: 12px; }
.stat-arrow, .stat-ico { font-size: 15px; opacity: .8; }
.stat-card.accent {
    background: var(--accent); border-color: transparent; color: var(--accent-ink);
    box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--accent) 55%, transparent);
}
.stat-card.accent .stat-cap, .stat-card.accent .stat-sub { color: rgba(255,255,255,0.85); }
.stat-card.accent h2 { color: #fff; }
.c-red { color: var(--red); } .c-blue { color: var(--blue); } .c-amber { color: var(--amber); }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dash-grid .chart-card { margin: 0; }
.dash-main { min-width: 0; }
.dash .barchart { height: 220px; }

/* Шкала прогресса (полукруг) */
.gauge-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge { width: 100%; max-width: 240px; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge-pct { font-size: 30px; font-weight: 750; margin-top: -14px; color: var(--text); }
.gauge-sub { color: var(--text-3); font-size: 13px; margin-top: 8px; text-align: center; }
.gauge-sub b { color: var(--text); }

@media (max-width: 1000px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr; } .top-name { display: none; } }

/* ===================== П2: фильтр справа, высота как у кнопки ===================== */
.list-bar .btn-primary { height: 42px; display: inline-flex; align-items: center; }
.list-bar .seg { margin-left: auto; height: 42px; align-items: center; padding: 4px; }
.list-bar .seg .seg-btn { height: 34px; display: inline-flex; align-items: center; padding: 0 18px; }
.list-count { display: none; }

/* ===================== П3: панель инструментов доски ===================== */
.board-toolbar { flex-wrap: wrap; }
.tool-group { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; box-shadow: 0 4px 14px -10px rgba(16,24,40,.12); }
.tool { width: 38px; height: 38px; border: none; background: none; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); transition: .15s; }
.tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--surface-2); color: var(--text); }
.tool.active { background: var(--accent); color: var(--accent-ink); }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: 0 4px 14px -10px rgba(16,24,40,.12); transition: .15s; }
.tool-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn:hover { color: var(--text); border-color: var(--border-2); }
.tool-colors { display: inline-flex; gap: 6px; align-items: center; padding: 0 4px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 2px var(--accent); }

.board-viewport.pen-mode, .board-viewport.pen-mode .ci { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2312B5A6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19l7-7a2.8 2.8 0 0 0-4-4l-7 7-1.5 5.5L12 19z"/></svg>') 3 20, crosshair; }
.board-draw { position: absolute; top: 0; left: 0; width: 10px; height: 10px; overflow: visible; pointer-events: none; }
.board-items { position: absolute; top: 0; left: 0; }

/* картинки и файлы на доске */
.ci-image { padding: 0; }
.ci-image img { display: block; max-width: 320px; max-height: 320px; border-radius: 10px; box-shadow: 0 10px 26px -12px rgba(0,0,0,.5); }
.ci-image:hover img { outline: 2px solid var(--accent); }
.ci-file { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 26px -14px rgba(0,0,0,.4); max-width: 220px; }
.ci-file svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.ci-file .ci-fname { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* лайтбокс превью */
#lightbox { align-items: center; justify-content: center; }
.lightbox-inner { max-width: 88vw; max-height: 86vh; display: flex; animation: fade .2s ease; }
.lightbox-inner img { max-width: 88vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.lightbox-close { position: fixed; top: 20px; right: 24px; z-index: 210; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 18px; }
.lightbox-close:hover { background: rgba(0,0,0,.7); }

/* немного больше плавности */
.card-button, .stat-card, .chart-card, .proj-item, .nav-btn, .tool, .tool-btn, .btn-primary, .seg-btn, .ptab { transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s; }
.draw-path { animation: drawIn .35s ease both; }
@keyframes drawIn { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   v18 — доработки: доска (выбор/рамка), чат-вложения, иконки, плавность
   ===================================================================== */

/* Форма задачи — единые отступы (метки и описание больше не слипаются) */
#create-form { display: flex; flex-direction: column; gap: 12px; }
#create-form .cp-grid { margin: 0; }
#create-form .people-row { margin-top: 0; }

/* Круглая кнопка «добавить исполнителя» — иконка вместо текстового «+» */
.add-user svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* Выбранные исполнители — компактные чипы прямо в строке (без дубля снизу) */
.people-row { flex-wrap: wrap; }
.chosen-avs { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chosen-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px; padding: 3px 8px 3px 3px; animation: chipIn .2s ease both; }
.chosen-chip .p-av { width: 26px; height: 26px; font-size: 10px; }
.chosen-name { font-size: 13px; color: var(--text); }
.chosen-x { border: none; background: none; color: var(--text-3); font-size: 12px; line-height: 1; padding: 0 2px; }
.chosen-x:hover { color: var(--red); }
@keyframes chipIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* Иконки в меню отделов, настройках, аналитике */
.dm-ic, .set-ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.set-label { display: inline-flex; align-items: center; gap: 10px; }
.stat-ico { width: 20px; height: 20px; opacity: .85; }
.stat-card.accent .stat-ico { color: #fff; }

/* Доска: выбранные элементы + рамка выделения */
.ci { transition: box-shadow .12s ease, outline-color .12s ease; }
.ci.selected { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.ci-note.selected, .ci-text.selected { box-shadow: 0 0 0 2px var(--accent); }
.board-marquee { position: absolute; border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 4px; pointer-events: none; z-index: 5; }

/* Чат: аватар рядом с именем + вложения (фото/файлы) */
.pmsg { align-items: flex-end; gap: 8px; }
.pmsg-av { width: 30px; height: 30px; font-size: 11px; align-self: flex-end; margin-bottom: 2px; }
.pmsg.mine .pmsg-av { display: none; }
.pmsg-img { margin: 2px 0 4px; cursor: zoom-in; }
.pmsg-img img { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; }
.pmsg-file { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 8px 10px; background: rgba(0,0,0,.06); border-radius: 10px; text-decoration: none; color: inherit; }
.pmsg.mine .pmsg-file { background: rgba(255,255,255,.18); }
.pmsg-file svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.pmsg-file span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

/* Чат: несколько вложений (стек фото/файлов), правка и удаление сообщений */
.pmsg-bub { position: relative; }
.pmsg-atts { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 4px; }
.pmsg-atts.multi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pmsg-atts .pmsg-img { margin: 0; }
.pmsg-atts.multi .pmsg-img img { width: 100%; height: 118px; object-fit: cover; max-width: none; max-height: none; }
button.pmsg-file { border: none; cursor: pointer; font: inherit; width: 100%; text-align: left; }
.pmsg-ctrls { position: absolute; top: -12px; right: 6px; gap: 4px; display: none; }
.pmsg:hover .pmsg-ctrls { display: flex; }
.pmsg-ic { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px -6px rgba(0,0,0,.35); transition: color .15s, border-color .15s; }
.pmsg-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pmsg-ic:hover { color: var(--text); border-color: var(--border-2); }
.pmsg-rm:hover { color: var(--red); border-color: var(--red); }
.pmsg-edited { font-size: 10px; opacity: .7; font-style: italic; margin-left: 4px; }
.pmsg-edit-input { display: block; width: 100%; min-width: 220px; margin: 2px 0 4px; background: var(--surface); color: var(--text); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; resize: vertical; box-shadow: var(--ring); }

/* Кнопки-иконки в поле чата */
.pchat-input { align-items: center; }
.pchat-input .pchat-icon { border: none; background: none; width: 42px; height: 42px; flex: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--text-2); transition: background .15s, color .15s, transform .1s; }
.pchat-input .pchat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pchat-input .pchat-icon:hover { background: var(--surface-2); color: var(--text); }
.pchat-input .pchat-icon.send { background: var(--accent); color: var(--accent-ink); }
.pchat-input .pchat-icon.send:hover { background: var(--accent-2); }
.pchat-input .pchat-icon:active { transform: scale(.92); }

/* ===== Более плавные, «дорогие» анимации ===== */
.modal-overlay { animation: overlayIn .22s ease both; }
.modal { animation: modalIn .3s cubic-bezier(.2,.8,.25,1) both; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.tabpane { animation: paneIn .3s cubic-bezier(.2,.8,.25,1); }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-button { animation: cardIn .42s cubic-bezier(.2,.8,.25,1) both; }
.stat-card { animation: cardIn .46s cubic-bezier(.2,.8,.25,1) both; }
.stat-row .stat-card:nth-child(2) { animation-delay: .05s; }
.stat-row .stat-card:nth-child(3) { animation-delay: .1s; }
.stat-row .stat-card:nth-child(4) { animation-delay: .15s; }
.gnode { animation: cardIn .42s cubic-bezier(.2,.8,.25,1) both; }
.chart-card { animation: cardIn .5s cubic-bezier(.2,.8,.25,1) both; }
.btn-primary:active, .create_button:active, .tool-btn:active, .auth-submit:active, .seg-btn:active { transform: scale(.97); }
.proj-item, .side-item, .dm-item, .dm-action { transition: background .18s ease, color .18s ease, transform .12s ease; }
.swatch { transition: transform .14s cubic-bezier(.2,.8,.25,1), box-shadow .14s ease; }

/* =====================================================================
   v21 — единый «дорогой» стиль полей, анимации, выбор рисунков на доске
   ===================================================================== */

/* ---------- Поля ввода: аккуратные, с ховером и мягким фокусом ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="search"], input[type="number"],
textarea, .pick-input {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14.5px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover,
input[type="date"]:hover, textarea:hover, .pick-input:hover,
.date-trigger:hover { border-color: var(--border-2); background: var(--surface-3); }
input:focus, textarea:focus, .pick-input:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.date-trigger { border-radius: var(--radius-sm); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.date-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* Плавные наведения на основные кнопки */
.btn-primary, .auth-submit, .create_button { transition: background .18s ease, box-shadow .2s ease, transform .12s ease; }
.btn-primary:hover, .auth-submit:hover, .create_button:hover { box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 70%, transparent); transform: translateY(-1px); }
.btn-ghost { transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease; }
.btn-ghost:hover { border-color: var(--border-2); transform: translateY(-1px); }

/* Живой сайдбар */
.proj-item:hover, .side-item:hover { transform: translateX(2px); }

/* Мягкое появление элементов списков */
.proj-item { animation: cardIn .34s cubic-bezier(.2,.8,.25,1) both; }
.dm-item, .pick-row { animation: fade .22s ease both; }

/* Аккуратные вложенные поля выбора людей / чата — как на аналитике */
.people-picker, .create-panel { box-shadow: 0 8px 24px -16px rgba(16,24,40,.18); }
:root[data-theme="dark"] .people-picker, :root[data-theme="dark"] .create-panel { box-shadow: none; }

/* ---------- Задача 3: фильтр той же высоты, что и «+ Задача» ---------- */
.list-bar { align-items: stretch; }
.list-bar .btn-primary { height: 44px; padding: 0 20px; display: inline-flex; align-items: center; }
.list-bar .seg { margin-left: auto; height: 44px; align-items: center; padding: 4px; }
.list-bar .seg .seg-btn { height: 36px; display: inline-flex; align-items: center; padding: 0 20px; }

/* ---------- Задача 4: рисунки — выбор, цвет, толщина (как в Miro) ---------- */
.draw-hit { pointer-events: stroke; cursor: grab; }
.draw-path { pointer-events: none; }
.board-viewport.grabbing .draw-hit { cursor: grabbing; }
.draw-g.selected .draw-hit { stroke: var(--accent-soft); }

/* Плавающая панель свойств выделенного */
.board-props {
    display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border-2);
    border-radius: 12px; padding: 5px 8px;
    box-shadow: 0 10px 26px -14px rgba(16,24,40,.28);
    animation: propsIn .2s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes propsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bp-group { display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; border-right: 1px solid var(--border); }
.bp-group:last-of-type { border-right: none; padding-right: 0; }
.bp-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: transform .12s ease; }
.bp-swatch:hover { transform: scale(1.15); }
.bp-swatch.active { box-shadow: 0 0 0 2px var(--accent); }
.bp-w { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; transition: .14s; }
.bp-w:hover { border-color: var(--border-2); }
.bp-w.active { border-color: var(--accent); background: var(--accent-soft); }
.bp-w span { display: block; width: 16px; background: var(--text); border-radius: 6px; }
.bp-w.active span { background: var(--accent); }
.bp-btn { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; font-size: 13px; font-weight: 700; transition: .14s; }
.bp-btn:hover { border-color: var(--border-2); }
.bp-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.bp-bold { font-weight: 900; }
.bp-ital { font-style: italic; }
.bp-del { color: var(--red); border-color: transparent; background: none; }
.bp-del:hover { background: var(--red-bg); }

/* =====================================================================
   v22 — правки по обратной связи: поля, выход, метки колонок, доска
   ===================================================================== */

/* 1. Поля ввода — спокойнее фокус (без «неонового» контура) */
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="date"]:focus, input[type="search"]:focus, input[type="number"]:focus,
textarea:focus, .pick-input:focus, .date-trigger:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-2));
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}
.pchat-input input, #pchat-input { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; height: 44px; }

/* 2. Кнопка «Выйти из аккаунта» — аккуратная красная кнопка */
.set-logout {
    justify-content: center; gap: 8px;
    margin-top: 10px;
    border: 1px solid var(--red);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    background: var(--red-bg);
    font-weight: 700;
    transition: background .15s ease, transform .1s ease;
}
.set-logout:hover { background: color-mix(in srgb, var(--red) 20%, transparent); }
.set-logout:active { transform: scale(.99); }
.set-logout .set-label { color: var(--red); }
.set-logout .set-ic { stroke: var(--red); }
.set-logout .chev { display: none; }

/* 3. Метки колонок «Сегодня/Завтра/Позже» — рамка-квадрат, чтобы не путать с точками задач */
.tcol-dot {
    width: 14px; height: 14px; border-radius: 5px;
    background: transparent !important;
    border: 2.5px solid currentColor;
    box-sizing: border-box;
}
.tcol-dot.col-red { color: var(--red); } .tcol-dot.col-blue { color: var(--blue); } .tcol-dot.col-amber { color: var(--amber); }

/* 5. Акцентная карточка аналитики — выделяется мягче */
.stat-card.accent, .open_tasks {
    box-shadow: 0 8px 22px -16px color-mix(in srgb, var(--accent) 42%, transparent);
}

/* 6. Палитра пера и панель свойств — одна «карточка», без прыжка вправо, с плавным появлением */
.board-toolbar .tool-colors, .board-toolbar .board-props {
    display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 12px; margin: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 4px 14px -10px rgba(16,24,40,.12);
    flex-wrap: nowrap;
}
.board-toolbar .board-props { animation: propsSwap .22s cubic-bezier(.2,.8,.25,1); }
.board-toolbar .tool-colors:not(.hidden) { animation: propsSwap .22s cubic-bezier(.2,.8,.25,1); }
@keyframes propsSwap { from { opacity: 0; } to { opacity: 1; } }
.board-props .bp-group { padding-right: 8px; }
.board-props .bp-swatch, .tool-colors .swatch { transition: transform .14s cubic-bezier(.2,.8,.25,1), box-shadow .14s ease; }

/* 4. Заметка (стикер) — как в Miro: тень, лёгкий загиб уголка */
.ci-note {
    border-radius: 4px 14px 14px 14px;
    padding: 14px 15px;
    min-height: 96px;
    font-weight: 600;
    box-shadow: 0 12px 26px -12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.3);
    position: relative;
}
.ci-note::after {
    content: ""; position: absolute; right: 0; bottom: 0;
    width: 22px; height: 22px;
    background: linear-gradient(135deg, transparent 46%, rgba(0,0,0,.14) 46%);
    border-bottom-right-radius: 14px;
}

/* 4. Точки-якоря для протяжки стрелок (верх/низ/лево/право) */
.ci-anchor {
    position: absolute; width: 13px; height: 13px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--accent);
    box-shadow: 0 1px 5px rgba(0,0,0,.28);
    cursor: crosshair; z-index: 7;
    opacity: 0; transition: opacity .15s ease, transform .12s ease;
}
.ci.selected .ci-anchor { opacity: 1; }
.ci-anchor:hover { transform: scale(1.35); background: var(--accent); }
.a-t { top: -8px;  left: 50%; margin-left: -6.5px; }
.a-b { bottom: -8px; left: 50%; margin-left: -6.5px; }
.a-l { left: -8px; top: 50%; margin-top: -6.5px; }
.a-r { right: -8px; top: 50%; margin-top: -6.5px; }

/* 4. Стрелки-коннекторы */
.arrow-line { pointer-events: none; transition: stroke-width .12s ease; }
.arrow-g .draw-hit { pointer-events: stroke; cursor: pointer; }
.arrow-g.selected .draw-hit { stroke: var(--accent-soft); }
.arrow-g.selected .arrow-line { stroke-width: 3.4; }
#live-arrow { pointer-events: none; }

/* =====================================================================
   v25 — текст без фона, изменение размера, гнутые стрелки, коннекторы при наведении
   ===================================================================== */

/* 4. Элемент «Текст» — просто текст, без серой плашки (как в Miro) */
.ci-text {
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 6px;
}
.ci-text.selected { box-shadow: 0 0 0 2px var(--accent); }
.ci-text:hover { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* 7. Коннекторы (точки) — скрыты, показываются при выделении и при наведении стрелкой */
.ci-anchor { opacity: 0; pointer-events: none; }
.ci.selected .ci-anchor,
.ci.connect-hover .ci-anchor { opacity: 1; pointer-events: auto; }
.ci.connect-hover { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* 6. Ручки изменения размера — по углам выделенного элемента */
.ci-rz {
    position: absolute; width: 12px; height: 12px; z-index: 8;
    background: var(--surface); border: 2px solid var(--accent); border-radius: 3px;
    opacity: 0; transition: opacity .15s ease;
}
.ci.selected .ci-rz { opacity: 1; }
.rz-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.rz-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.rz-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.rz-se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* 7. Гнутые стрелки */
.arrow-line { fill: none; }
.draw-hit { fill: none; }

/* =====================================================================
   v26 — чекбокс задач, модалки, контекст-меню, эмодзи, скроллбары, полировка
   ===================================================================== */

/* 1. Чекбокс «выполнено» на карточке задачи */
.task-check {
    flex: none; width: 22px; height: 22px; margin-top: 1px;
    border: 2px solid var(--border-2); border-radius: 7px;
    background: var(--surface); color: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.task-check:hover { border-color: var(--accent); }
.task-check.done { background: var(--accent); border-color: var(--accent); }
.task-check:active { transform: scale(.9); }
.task-check .check-ic { width: 17px; height: 17px; display: block; color: var(--accent-ink); }
.task-top { align-items: flex-start; }
.card-button.task-done { opacity: .62; }
.card-button.task-done h2 { text-decoration: line-through; color: var(--text-3); }

/* 3/9. Цвета: колонки уже заданы в JS; низкий приоритет — синий */
.prio-low { background: var(--blue); }

/* 2. Модалка создания задачи — как окно редактирования */
.create-modal { max-width: 480px; }
.create-modal #create-form { gap: 12px; }

/* 4/5. Убираем лишние скроллбары (нав-бар вкладок и рабочая область) */
.ptabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { width: 0; height: 0; display: none; }
.work-body, .side-scroll { scrollbar-width: none; }
.work-body::-webkit-scrollbar, .side-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* 8. Кнопка «прикрепить» в чате — как соседние: рамка и фон */
.pchat-input .pchat-icon:not(.send) {
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.pchat-input .pchat-icon:not(.send):hover { border-color: var(--border-2); background: var(--surface-3); }

/* 6. Закрытый проект в сайдбаре */
.proj-item .proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item.closed .proj-name { text-decoration: line-through; color: var(--text-3); }
.proj-item.closed { opacity: .7; }
.proj-closed-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; flex: none; }

/* 6/7. Эмодзи-пикер */
.emoji-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 4px 0 6px; }
.emoji-opt {
    aspect-ratio: 1; border: 1px solid var(--border); background: var(--surface-2);
    border-radius: 10px; font-size: 19px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.emoji-opt:hover { border-color: var(--border-2); transform: translateY(-1px); }
.emoji-opt.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }

/* 6. Контекстное меню */
.ctx-menu {
    position: fixed; z-index: 300; min-width: 190px;
    background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px;
    padding: 6px; box-shadow: var(--shadow);
    animation: ctxIn .16s cubic-bezier(.2,.8,.25,1);
}
@keyframes ctxIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.ctx-item, .ctx-check {
    display: flex; align-items: center; gap: 9px; width: 100%;
    border: none; background: none; color: var(--text);
    padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left; cursor: pointer;
}
.ctx-item:hover, .ctx-check:hover { background: var(--surface-2); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: var(--red-bg); }
.ctx-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* 10. Карточки не обрезаются сверху при наведении + плавнее анимации */
.work-body { padding-top: 8px; }
.card-button:hover, .stat-card:hover,
.close_today:hover, .close_tomorrow:hover, .completed_tasks:hover, .missed_deadline:hover {
    transform: translateY(-2px);
}
.card-button, .stat-card, .chart-card, .proj-item, .side-item, .tool, .tool-btn,
.btn-primary, .btn-ghost, .seg-btn, .ptab, .dm-item, .dm-action, .emoji-opt, .ctx-item {
    transition-duration: .26s !important;
    transition-timing-function: cubic-bezier(.2,.8,.25,1) !important;
}
.tabpane { animation: paneIn .34s cubic-bezier(.2,.8,.25,1); }
.card-button { animation-duration: .5s; }

/* 11. Расстояние между цветами на доске одинаковое (выбор не сдвигает) */
.board-props .bp-group { gap: 8px; }

/* mid-turn: у выделенного элемента прячем «✕» (удаление — в панели/Delete), рамка мягче */
.ci.selected .ci-del { display: none; }
/* Выделение — минималистичное, как обводка при наведении */
.ci.selected { outline: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 12px; }
.ci.connect-hover { outline: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 12px; }
.ci-note.selected, .ci-text.selected { box-shadow: none; }
.ci-note.selected { outline-offset: 4px; }
/* тонкие, аккуратные ручки и точки */
.ci-rz { width: 9px; height: 9px; border-width: 1.5px; }
.ci-anchor { width: 10px; height: 10px; border-width: 1.5px; }

/* Заставка при загрузке — чтобы не мигал экран входа */
#splash { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; background: var(--bg); }
#splash.hidden { display: none !important; }
.splash-logo { width: 54px; height: 54px; animation: splashPulse 1.1s ease-in-out infinite; }
.splash-logo svg { width: 100%; height: 100%; display: block; }
@keyframes splashPulse { 0%, 100% { opacity: .5; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }

/* Выбранные исполнители — максимум 3 аватарки внахлёст */
.chosen-avs { gap: 0; }
.chosen-avs .chosen-chip { margin-left: -9px; }
.chosen-avs .chosen-chip:first-child { margin-left: 0; }
.chosen-avs .chosen-av { border: 2px solid var(--surface); box-sizing: border-box; }

/* Кнопка скачивания на файле доски — слева от крестика */
.ci-dl { position: absolute; top: -8px; right: 20px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--surface-3); color: var(--text); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s, background .12s; z-index: 9; }
.ci-dl svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ci-file:hover .ci-dl, .ci-file.selected .ci-dl { opacity: 1; }
.ci-file:hover .ci-del, .ci-file.selected .ci-del { display: inline-flex; opacity: 1; }
.ci-dl:hover { background: var(--accent); color: var(--accent-ink); }

/* ===== Уведомления (колокольчик) ===== */
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: 86vw; max-height: 62vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); z-index: 90; padding: 6px; animation: ctxIn .16s cubic-bezier(.2,.8,.25,1); }
.notif-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 6px; }
.notif-list { display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 10px; border-radius: 10px; color: var(--text); transition: background .15s; }
.notif-item[data-ntask] { cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; margin-top: 5px; }
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-item.unread { background: var(--accent-soft); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text { font-size: 13.5px; line-height: 1.35; }
.notif-time { font-size: 11px; color: var(--text-3); }
.notif-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 22px; }

/* ===== Кастомное подтверждение (вместо системного confirm) ===== */
.confirm-modal { max-width: 360px; }
.confirm-msg { font-size: 15px; color: var(--text); padding: 2px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===== Чат: файлы в стиле Telegram + крупные фото ===== */
.pmsg-atts.files { display: flex; flex-direction: column; gap: 6px; }
.pmsg-atts.imgs:not(.grid) .pmsg-img img { max-width: 300px; max-height: 340px; width: auto; height: auto; border-radius: 12px; }
.pmsg-atts.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.pmsg-atts.grid .pmsg-img img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; }
button.pmsg-file { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 230px; border: none; cursor: pointer; background: rgba(0,0,0,.05); border-radius: 12px; padding: 8px 10px; text-align: left; color: inherit; }
.pmsg.mine button.pmsg-file { background: rgba(255,255,255,.16); }
.file-ic { position: relative; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #4C82F7; display: flex; align-items: center; justify-content: center; }
.file-ic > svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.file-ext { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 7.5px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11.5px; opacity: .7; }
.file-dl { flex: none; opacity: .55; }
.file-dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button.pmsg-file:hover .file-dl { opacity: 1; }

/* Убрать рамку-фокус на вкладках/кнопках (активная вкладка и так подчёркнута) */
.ptab:focus, .ptab:focus-visible { outline: none; box-shadow: none; }
.tool:focus-visible, .tool-btn:focus-visible, .icon-btn2:focus-visible, .seg-btn:focus-visible, .ptab:focus-visible { outline: none; }

/* Эмодзи в уведомлениях */
.notif-emoji { flex: none; font-size: 16px; line-height: 1.3; }

/* =====================================================================
   v27 — раскладка карточки задачи: название/статус сверху, чекбокс+исполнители снизу, теги под ними
   ===================================================================== */
.task-top { align-items: flex-start; }
.task-top h2 { flex: 1; min-width: 0; }
.card-button { position: relative; }
.task-bottom { display: flex; align-items: center; gap: 10px; padding-right: 40px; }
.task-bottom .av-stack:empty { display: none; }
.task-bottom .cl-badge { margin-left: auto; }
/* плашка прогресса чек-листа — квадратная галочка */
.cl-badge { display: inline-flex; align-items: center; gap: 5px; }
.cl-badge .check-ic { width: 13px; height: 13px; display: block; }
.task-card .tag-row { margin-top: 2px; padding-right: 40px; }
/* чекбокс — в правом нижнем углу карточки */
.task-check {
    position: absolute; right: 14px; bottom: 14px; margin: 0;
    width: 28px; height: 28px; border-radius: 9px; font-size: 16px;
}

/* Модалка отдела: «Удалить» слева, «Сохранить» справа на одном уровне */
.depe-actions { display: flex; align-items: center; gap: 10px; }
.depe-actions #depe-save { margin-top: 0; flex: 1; }
.depe-actions .btn-danger { flex: none; }
.btn-danger {
    border: 1px solid var(--red); background: var(--red-bg); color: var(--red);
    border-radius: var(--radius-xs); padding: 13px 18px; font-size: 15px; font-weight: 700;
    transition: background .15s ease, transform .1s ease;
}
.btn-danger:hover { background: color-mix(in srgb, var(--red) 20%, transparent); }
.btn-danger:active { transform: scale(.99); }
.btn-danger.armed { background: var(--red); color: #fff; }

/* Заголовок проекта — на одном уровне с колокольчиком уведомлений */
.topbar { align-items: center; margin-bottom: 16px; }
.topbar .work-title { margin: 0; flex: 1; min-width: 0; }

/* Кнопки доски «Заметка/Текст/Файл» — фон как у А−/А+ (surface-2) */
.tool-btn { background: var(--surface-2); box-shadow: none; }
.tool-btn:hover { background: var(--surface-3); border-color: var(--border-2); }

/* Меню проекта: «Проект закрыт» — текст слева, чекбокс справа (в стиле задач) */
.ctx-toggle { justify-content: space-between; }
.ctx-box {
    flex: none; width: 22px; height: 22px;
    border: 2px solid var(--border-2); border-radius: 7px;
    background: var(--surface); color: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .18s ease, border-color .18s ease;
}
.ctx-box.done { background: var(--accent); border-color: var(--accent); }
.ctx-box .check-ic { width: 15px; height: 15px; display: block; }

/* Скрыть скроллбары везде (прокрутка колесом остаётся) */
* { scrollbar-width: none !important; -ms-overflow-style: none !important; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }

/* Время в чужих сообщениях — слева */
.pmsg:not(.mine) .pmsg-time { text-align: left; }

/* Календарь — во всю ширину карточки + фон как у полей ввода */
.modal .date-pop { width: 100%; background: var(--surface-2); }
.modal .date-pop .dp-day:hover { background: var(--surface-3); }
.modal .date-pop .dp-nav { background: var(--surface-3); }

/* Галочка выбора в пикере — квадратная, как везде */
.pick-check { display: inline-flex; align-items: center; }
.pick-check .check-ic { width: 16px; height: 16px; color: var(--accent); }

/* Выбранные исполнители — компактные аватарки (без имени), с крестиком по наведению */
.chosen-avs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chosen-chip { position: relative; background: none; border: none; padding: 0; border-radius: 50%; }
.chosen-chip .chosen-av { width: 30px; height: 30px; font-size: 11px; }
.chosen-chip .chosen-x {
    position: absolute; top: -5px; right: -5px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
    font-size: 9px; line-height: 1; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .12s ease;
}
.chosen-chip:hover .chosen-x { opacity: 1; }
.chosen-chip .chosen-x:hover { color: var(--red); }

/* Карточка задачи — три ровных ряда */
.task-card { display: flex; flex-direction: column; gap: 12px; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-mid { display: flex; align-items: center; gap: 10px; }
.task-mid .cl-badge { margin-left: auto; }
.task-foot2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-foot2 .tag-row { flex: 1; }
.task-foot2 .task-check { position: static; margin: 0; }

/* Исполнители на карточке — крупнее, вровень с плашкой подзадач */
.task-mid .av-stack .mini-av { width: 26px; height: 26px; font-size: 10px; }
.mini-av { font-size: 8px; }
.p-av { font-size: 11px; }

/* Окно задачи: исполнители — только аватарки, с отступом от двоеточия */
.d-people { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.d-people-label { color: var(--text-2); }
.d-avs { display: inline-flex; align-items: center; }
.d-avs .mini-av { margin-left: -6px; border: 2px solid var(--surface); }
.d-avs .mini-av:first-child { margin-left: 0; }

/* Редактирование: меньше отступ между «Задача выполнена» и «Сохранить» */
#modal-edit .create_button { margin-top: 0; }
#modal-edit .modal-actions { margin-top: 12px; }

/* Настройки: единые отступы между всеми элементами (как между «Описание» и кнопками) */
#settings-overlay .modal { display: flex; flex-direction: column; gap: 8px; }
#settings-overlay .modal-head { margin-bottom: 4px; }
#settings-overlay .set-row:not(.set-logout) { padding: 0; margin-top: 12px; }  /* большой: карточка → тумблер */
.set-email { padding: 0; }                                                     /* маленький: тумблер → почта */
.set-email input { margin-bottom: 0; width: 100%; }
#settings-overlay .modal-actions { margin-top: 12px; }                         /* большой: почта/тумблер → Сохранить */
#save-settings { width: 100%; margin: 0; }
#logout-row { width: 100%; box-sizing: border-box; margin: 0; }                /* маленький: Сохранить → Выйти */

/* Ссылка-приглашение — как обычное поле ввода (у #invite-link нет type) */
#invite-link {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-size: 14px; font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#invite-link:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border-2)); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }

/* Чекбокс пунктов чек-листа — в стиле чекбокса задач */
.cl-check { width: 22px; height: 22px; border: 2px solid var(--border-2); border-radius: 7px; }
.cl-item.done .cl-check { background: var(--accent); border-color: var(--accent); }
.cl-check .check-ic { width: 15px; height: 15px; display: block; color: var(--accent-ink); }

/* Поле «Добавить пункт…» чек-листа — как обычное поле ввода (у #cl-input нет type, поэтому стилим явно) */
.cl-add { align-items: center; gap: 8px; }
.cl-add input {
    flex: 1; height: 44px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-size: 14.5px; font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cl-add input::placeholder { color: var(--text-3); }
.cl-add input:hover { border-color: var(--border-2); }
.cl-add input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-2));
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}
.cl-add button {
    width: 44px; height: 44px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; line-height: 1;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--accent);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.cl-add button:hover { border-color: var(--accent); background: var(--surface-3); }
.cl-add button:active { transform: scale(.94); }

/* 4 колонки задач: Сегодня / Завтра / Позже / Выполненные */
.tasks-card { grid-template-columns: repeat(4, 1fr); }
.tcol-dot.col-green { color: var(--green); }
@media (max-width: 1100px) { .tasks-card { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .tasks-card { grid-template-columns: 1fr; } }

/* Модалка создания: исполнители слева, приоритет справа — на одном уровне */
.cp-row { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; justify-content: space-between; }
.cp-row .people-row { flex: 0 1 auto; min-width: 0; margin: 0; }
.cp-row .prio-seg { flex: none; }
#create-form .datefield .date-trigger { width: 100%; }
