/* ===== Дизайн-токены (в стиле референса «treker») ===== */
:root {
    --bg0: #0a0d13;
    --bg1: #0f131c;
    --surface: #141a26;
    --surface2: #1a2231;
    --line: rgba(255,255,255,.08);
    --text: #eef1f8;
    --muted: #8a93a8;
    --faint: #5b6478;
    --accent: #ffb454;
    --accent-hi: #ffc873;
    --accent-ink: #221403;
    --danger: #ff5d6c;
    --teal: #4fd1c5;
    /* Цвета индикации дедлайнов (левая полоса карточки) */
    --deadline-far: #00a550;      /* более 4 дней / ровно 4 дня */
    --deadline-close: #4cbb17;    /* ровно 2 дня */
    --deadline-soon: #F1C40F;     /* ровно 1 день */
    --deadline-day: #ced23a;      /* день дедлайна, до 12:00 */
    --deadline-red: #E74C3C;      /* день дедлайна, >= 17:00 */
    --deadline-burgundy: #8B0000; /* прошло более 1 дня */
    --deadline-none: #64748b;     /* дедлайн не задан */
}
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg0);
    color: var(--text);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Фоновая сетка с радиальной маской */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.031) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.031) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 78%);
            mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 78%);
}

.orb { position: fixed; border-radius: 50%; filter: blur(95px); pointer-events: none; z-index: 0; }
.orb-a { width: 440px; height: 440px; background: rgba(255,157,63,.14); top: -150px; right: -120px; animation: drift 16s ease-in-out infinite alternate; }
.orb-b { width: 400px; height: 400px; background: rgba(79,209,197,.10); bottom: -170px; left: -140px; animation: drift 21s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate3d(45px, 35px, 0) scale(1.09); } }

::selection { background: rgba(255,180,84,.35); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

button { font-family: inherit; }

#app {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== LOGIN ===== */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 2.5rem 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 18px 44px rgba(0,0,0,.45);
}

.login-container h1 {
    font-family: 'Unbounded', 'Golos Text', sans-serif;
    font-weight: 600;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface2);
    color: var(--text);
    color-scheme: dark;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--faint);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,180,84,.15);
    background: #1d2637;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s, border-color .2s, color .2s;
    text-align: center;
    background: var(--surface2);
    color: var(--text);
}

.btn.primary {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-ink);
    box-shadow: 0 8px 20px rgba(255,180,84,.25);
}
.btn.primary:hover {
    background: var(--accent-hi);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255,180,84,.38);
}
.btn.secondary {
    background: var(--surface2);
    color: var(--text);
}
.btn.secondary:hover {
    background: #232c3d;
    border-color: rgba(255,255,255,.16);
}
.btn.outline {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}
.btn.outline:hover {
    color: var(--text);
    border-color: rgba(255,255,255,.2);
    background: rgba(255,255,255,.04);
}
.btn:active {
    transform: scale(0.96);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    border-radius: 0.6rem;
}

.btn-open, .btn-settings {
    background: none;
    border: none;
    font-size: 0.9rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}
.btn-open:hover {
    background: rgba(255,180,84,.12);
}
.btn-settings:hover {
    background: rgba(255,255,255,.06);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}
.hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--faint);
    margin-top: 1rem;
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0 1rem 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-img {
    flex: none;
    width: auto;
    height: 46px;
    filter: drop-shadow(0 4px 10px rgba(255,157,63,.25));
}

.head-text {
    min-width: 0;
}

.head-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.header-left h2 {
    font-family: 'Unbounded', 'Golos Text', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.head-sub {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    min-width: 0;
}

.head-sub b {
    color: var(--accent);
    font-weight: 500;
}

.head-sub .head-now,
.head-sub .head-date {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.role-badge {
    background: rgba(255,180,84,.13);
    color: var(--accent-hi);
    border: 1px solid rgba(255,180,84,.3);
    padding: 0.2rem 0.8rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
}

.btn-logout-inline {
    flex: none;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted);
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.12s;
}
.btn-logout-inline:hover {
    background: rgba(255,93,108,.08);
    color: var(--danger);
}
.btn-logout-inline:active {
    transform: scale(0.92);
}

/* ===== КОЛЬЦО СТАТИСТИКИ ===== */
.ring {
    --p: 0;
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--p)*1%), rgba(255,255,255,.07) 0);
    display: grid;
    place-items: center;
    transition: --p 0.7s cubic-bezier(.22,1,.36,1);
}

.ring-core {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px var(--line);
}

.ring-core b {
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1;
    color: var(--text);
}

.ring-core small {
    font-size: 0.46rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

.toolbar-settings-group {
    position: relative;
}

.toolbar-settings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.3rem;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    box-shadow: 0 14px 34px rgba(0,0,0,.5);
    min-width: 180px;
    overflow: hidden;
    z-index: 200;
}

.toolbar-settings-dropdown.active {
    display: block;
}

.toolbar-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
}

.toolbar-dropdown-item:hover {
    background: rgba(255,255,255,.05);
}

/* ===== BOARD ===== */
.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.column {
    background: transparent;
    border-radius: 1rem;
    padding: 1rem;
    min-height: 80px;
}

.column[data-status="urgent"] {
    background: transparent;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

.column-header h3 {
    font-family: 'Unbounded', 'Golos Text', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.column-header .count {
    background: var(--surface2);
    border: 1px solid var(--line);
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-hi);
}

.column-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-add-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(255,180,84,.14);
    color: var(--accent-hi);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.column-add-btn:hover {
    background: rgba(255,180,84,.26);
    transform: scale(1.08);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 50px;
}

/* ===== TASK CARD ===== */
.task-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
    border-left: 4px solid #64748b;
    cursor: grab;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.18s;
    position: relative;
    touch-action: manipulation;
}

.task-card:hover {
    background: #171f2e;
    border-color: rgba(255,255,255,.16);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0,0,0,.42);
}

.task-card .task-delegate-arrow {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.task-card .task-delegate-arrow.arrow-delegated {
    color: var(--accent);
    text-shadow: 0 0 9px rgba(255,180,84,.55);
}

.task-card .task-delegate-arrow.arrow-received {
    color: var(--danger);
    text-shadow: 0 0 9px rgba(255,93,108,.5);
}

.task-card.strip-far { border-left-color: var(--deadline-far); }
.task-card.strip-close { border-left-color: var(--deadline-close); }
.task-card.strip-soon { border-left-color: var(--deadline-soon); }
.task-card.strip-day { border-left-color: var(--deadline-day); }
.task-card.strip-red { border-left-color: var(--deadline-red); }
.task-card.strip-overdue { border-left-color: var(--deadline-burgundy); }
.task-card.strip-none { border-left-color: var(--deadline-none); }
/* Устаревшие классы — оставлены совместимости со старыми значениями */
.task-card.strip-ok { border-left-color: var(--deadline-far); }
.task-card.strip-warn { border-left-color: var(--deadline-close); }
.task-card.strip-orange { border-left-color: var(--deadline-day); }
.task-card.strip-scarlet { border-left-color: var(--deadline-soon); }

.task-card .task-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--text);
}

.task-card .task-meta {
    font-size: 0.78rem;
    color: var(--faint);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
    letter-spacing: 0.02em;
}

.task-card .task-actions-row1,
.task-card .task-actions-row2 {
    display: none;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.task-card .task-actions-row2 {
    justify-content: space-evenly;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255,255,255,.06);
}

@media (hover: hover) {
    .task-card:hover .task-actions-row1,
    .task-card:hover .task-actions-row2 {
        display: flex;
    }
}

@media (hover: none) {
    .task-card.controls-open .task-actions-row1,
    .task-card.controls-open .task-actions-row2 {
        display: flex;
    }
}

.task-card .task-actions-row1 button,
.task-card .task-actions-row2 button {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
}
.task-card .task-actions-row1 button:active,
.task-card .task-actions-row2 button:active {
    transform: scale(0.95);
}

.task-card .btn-done {
    background: rgba(34,197,94,.14);
    color: #4ade80;
}
.task-card .btn-done:hover {
    background: rgba(34,197,94,.26);
}
.task-card .btn-delegate {
    background: rgba(255,180,84,.13);
    color: var(--accent-hi);
}
.task-card .btn-delegate:hover {
    background: rgba(255,180,84,.24);
}
.task-card .btn-restore {
    background: rgba(79,209,197,.12);
    color: #5eead4;
}
.task-card .btn-restore:hover {
    background: rgba(79,209,197,.22);
}
.task-card .btn-delete {
    background: rgba(255,93,108,.12);
    color: #ff8a94;
}
.task-card .btn-delete:hover {
    background: rgba(255,93,108,.24);
}

.task-card .assignee {
    font-weight: 500;
    color: var(--accent-hi);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}


.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    max-width: 90vw;
    width: 100%;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.55);
    animation: modalIn 0.28s cubic-bezier(.22,1,.36,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.modal-content h3 {
    font-family: 'Unbounded', 'Golos Text', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.close-modal {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--faint);
    transition: color 0.2s;
    line-height: 1;
}
.close-modal:hover {
    color: var(--danger);
}

.modal hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 1.25rem 0;
}

/* ===== MOBILE BAR ===== */
.mobile-bar {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .board {
        grid-template-columns: 1fr;
        padding-bottom: 4.5rem;
    }
    .toolbar {
        display: none;
    }
    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(15,19,28,.92);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        padding: 0.5rem 1rem;
        z-index: 100;
    }
    .mobile-bar-btn {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        border: none;
        background: transparent;
        font-size: 1.4rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
    }
    .mobile-bar-btn:hover {
        background: rgba(255,255,255,.07);
    }
    .mobile-bar-btn-main {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--accent);
        color: var(--accent-ink);
        font-size: 1.1rem;
        box-shadow: 0 8px 20px rgba(255,180,84,.35);
    }
    .mobile-bar-btn-main:hover {
        background: var(--accent-hi);
    }
    .mobile-bar-btn-group {
        position: relative;
    }
    .mobile-settings-dropdown {
        display: none;
        position: absolute;
        bottom: 56px;
        right: 0;
        background: var(--surface2);
        border: 1px solid var(--line);
        border-radius: 0.75rem;
        box-shadow: 0 14px 34px rgba(0,0,0,.5);
        min-width: 180px;
        overflow: hidden;
        z-index: 200;
    }
    .mobile-settings-dropdown.active {
        display: block;
    }
    .mobile-dropdown-item {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        border: none;
        background: none;
        font-size: 0.9rem;
        text-align: left;
        cursor: pointer;
        color: var(--text);
        transition: background 0.15s;
    }
    .mobile-dropdown-item:hover {
        background: rgba(255,255,255,.05);
    }
    .app-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    .header-left {
        justify-content: flex-start;
        flex-wrap: nowrap;
        min-width: 0;
        overflow: hidden;
    }
    .header-left h2 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        font-size: 1.05rem;
    }
    .logo-img {
        height: 40px;
    }
    .head-sub {
        font-size: 0.7rem;
    }
    .role-badge {
        display: none;
    }
    .ring {
        width: 54px;
        height: 54px;
    }
    .ring-core {
        width: 42px;
        height: 42px;
    }
    .ring-core b {
        font-size: 0.62rem;
    }
    .ring-core small {
        display: none;
    }
    .header-right {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .login-container {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
    .modal-content {
        padding: 1.5rem;
    }
    .toast-container {
        top: auto;
        bottom: 5rem;
        right: 0.75rem;
        left: 0.75rem;
    }
    .toast {
        max-width: 100%;
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: var(--surface2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 0.8rem 1.2rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 14px 34px rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto;
    animation: toastIn 0.4s ease-out;
    max-width: 350px;
}
.toast.toast-new-task {
    border-left: 4px solid var(--accent);
}
.toast.toast-delegated {
    border-left: 4px solid var(--teal);
}
.toast.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}
.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast-subtitle {
    font-size: 0.75rem;
    color: var(--muted);
}
.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.toast-close:hover {
    color: var(--danger);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ===== UTILITY ===== */
.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.drag-over {
    background: rgba(255,180,84,.09);
    border: 2px dashed var(--accent);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg0);
}
::-webkit-scrollbar-thumb {
    background: #232c3d;
    border-radius: 8px;
    border: 2px solid var(--bg0);
}
::-webkit-scrollbar-thumb:hover {
    background: #2f3a50;
}

/* ===== USER LIST ===== */
.user-row {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}
.user-row-view {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.user-emoji-avatar {
    font-size: 1.3rem;
    flex-shrink: 0;
    cursor: default;
    line-height: 1;
}
.emoji-picker-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.emoji-preview {
    font-size: 1.5rem;
    line-height: 1;
}
.emoji-presets {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
}
.emoji-preset-btn {
    width: 32px;
    height: 32px;
    border-radius: 0.4rem;
    border: 2px solid transparent;
    background: var(--surface2);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, transform 0.1s;
    padding: 0;
}
.emoji-preset-btn:hover {
    border-color: var(--accent);
    transform: scale(1.15);
}
.user-row-view span:not(.user-emoji-avatar) {
    flex: 1;
}
.user-row-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ===== COLOR PICKER ===== */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.color-picker-row input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    cursor: pointer;
    padding: 2px;
    background: var(--surface2);
}
.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    flex-shrink: 0;
}
.color-presets {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.color-preset-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    padding: 0;
}
.color-preset-btn:hover {
    border-color: var(--text);
    transform: scale(1.15);
}

/* ===== ARCHIVE ===== */
.archive-content {
    max-width: 640px !important;
}
.archive-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.archive-tabs {
    display: flex;
    gap: 0.25rem;
}
.archive-tab {
    padding: 0.4rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface2);
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.archive-tab:hover {
    color: var(--text);
    border-color: rgba(255,255,255,.18);
}
.archive-tab.active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
}
#archiveSearch {
    flex: 1;
    min-width: 160px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface2);
    color: var(--text);
    color-scheme: dark;
}
#archiveSearch::placeholder {
    color: var(--faint);
}
#archiveSearch:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,180,84,.15);
}
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 55vh;
    overflow-y: auto;
}
.archive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg1);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
}
.archive-row-main {
    min-width: 0;
}
.archive-row-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.btn-archived {
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-archived:hover {
    background: #232c3d;
    color: var(--text);
    border-color: rgba(255,255,255,.18);
}
.archive-empty {
    color: var(--faint);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}
.task-card .btn-done i,
.task-card .btn-delegate i,
.task-card .btn-restore i,
.task-card .btn-delete i,
.task-card .btn-settings i,
.task-card .btn-open i,
.archive-row .btn-archived i {
    color: inherit;
}
.report-modal {
    max-width: 420px;
}

/* ===== TYPE TOGGLE (Задача | Отчёт) ===== */
.item-type-toggle {
    display: flex;
    background: var(--bg1);
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    padding: 0.25rem;
    gap: 0.25rem;
}
.item-type-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.45rem 0.5rem;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}
.item-type-btn.active {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 4px 14px rgba(255,180,84,.3);
}

/* ===== ARCHIVE DONE ROW ===== */
.archive-row {
    border-left: 4px solid transparent;
}
.archive-row-done {
    background: var(--bg1);
}
.archive-row.strip-far { border-left-color: var(--deadline-far); }
.archive-row.strip-close { border-left-color: var(--deadline-close); }
.archive-row.strip-soon { border-left-color: var(--deadline-soon); }
.archive-row.strip-day { border-left-color: var(--deadline-day); }
.archive-row.strip-red { border-left-color: var(--deadline-red); }
.archive-row.strip-overdue { border-left-color: var(--deadline-burgundy); }
.archive-row.strip-none { border-left-color: var(--deadline-none); }
/* Устаревшие классы — совместимость */
.archive-row.strip-ok { border-left-color: var(--deadline-far); }
.archive-row.strip-warn { border-left-color: var(--deadline-close); }
.archive-row.strip-orange { border-left-color: var(--deadline-day); }
.archive-row.strip-scarlet { border-left-color: var(--deadline-soon); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
