/* TaskManager Online — Client: мобильный интерфейс (Android 13+, фирменная
   тема TaskFlow). Тёмная IDE-тема: фон #0d1117, циановый акцент #22d3ee,
   safe-area, тач-цели ≥48px, bottom sheets, нижняя навигация. */

:root {
        color-scheme: dark;
        --tmc-bg: #0d1117;
        --tmc-surface: #161b22;
        --tmc-surface-2: #21262d;
        --tmc-border: #30363d;
        --tmc-text: #e6edf3;
        --tmc-muted: #8b949e;
        --tmc-accent: #22d3ee;
        --tmc-accent-strong: #0ea5c9;
        --tmc-accent-tint: rgba(34, 211, 238, .14);
        --tmc-danger: #ff7a7a;
        --tmc-ok: #34d399;
        --tmc-warn: #fbbf24;
        --tmc-radius: 16px;
        --tmc-nav-h: 64px;
        --tmc-safe-b: env(safe-area-inset-bottom, 0px);
        --tmc-safe-t: env(safe-area-inset-top, 0px);
}

/* страница приложения приводим к полноэкранному тёмному виду */
body:has(#tmc-app) { background: var(--tmc-bg) !important; }

.tmc-root {
        min-height: 100vh;
        min-height: 100dvh;
        background: var(--tmc-bg);
        color: var(--tmc-text);
        font-family: Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
        font-size: 16px;
        line-height: 1.45;
        -webkit-tap-highlight-color: transparent;
        -webkit-font-smoothing: antialiased;
        padding-top: var(--tmc-safe-t);
}

.tmc-root * { box-sizing: border-box; }
.tmc-root button { font: inherit; touch-action: manipulation; }
.tmc-root svg { width: 22px; height: 22px; fill: currentColor; }

/* ------------------------------------------------------------------ */
/* Загрузка                                                            */
/* ------------------------------------------------------------------ */

.tmc-boot {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        min-height: 100dvh; gap: 14px;
}
/* Фирменный логотип — циановый скруглённый квадрат с буквой «T» (стиль TaskFlow) */
.tmc-boot-logo-sq, .tmc-logo-sq {
        width: 52px; height: 52px; border-radius: 14px; flex: none;
        background: var(--tmc-accent); color: #0d1117;
        display: flex; align-items: center; justify-content: center;
        font-weight: 800; font-size: 28px; line-height: 1;
        box-shadow: 0 0 26px rgba(34, 211, 238, .28);
        user-select: none; -webkit-user-select: none;
}
.tmc-boot .tmc-boot-logo-sq { animation: tmc-boot-pulse 1.4s ease-in-out infinite; }
@keyframes tmc-boot-pulse {
        0%, 100% { opacity: 1; box-shadow: 0 0 26px rgba(34, 211, 238, .28); }
        50% { opacity: .55; box-shadow: 0 0 10px rgba(34, 211, 238, .12); }
}
.tmc-boot-title { color: var(--tmc-muted); letter-spacing: .4px; }

.tmc-noscript { text-align: center; color: var(--tmc-muted); padding: 24px; }

/* ------------------------------------------------------------------ */
/* Вход                                                                */
/* ------------------------------------------------------------------ */

.tmc-login {
        display: flex; flex-direction: column; justify-content: center;
        min-height: calc(100dvh - var(--tmc-safe-t));
        padding: 24px 20px calc(24px + var(--tmc-safe-b));
        max-width: 440px; margin: 0 auto;
}
/* Брендовая строка экрана входа: [T] TaskManager */
.tmc-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.tmc-brand-name { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.tmc-login-title { font-size: 27px; font-weight: 800; margin: 0 0 6px; letter-spacing: .3px; }
.tmc-login-sub { color: var(--tmc-muted); margin-bottom: 26px; font-size: 14px; }

.tmc-login-form { display: flex; flex-direction: column; gap: 14px; }

.tmc-field { display: flex; flex-direction: column; gap: 6px; }
.tmc-field > span { font-size: 13px; color: var(--tmc-muted); padding-left: 4px; }
.tmc-root input[type="text"],
.tmc-root input[type="password"],
.tmc-root input[type="date"],
.tmc-root input[type="search"],
.tmc-root input[type="number"],
.tmc-root select,
.tmc-root textarea {
        appearance: none; width: 100%;
        background: var(--tmc-surface);
        border: 1.5px solid var(--tmc-border);
        color: var(--tmc-text);
        border-radius: 12px;
        padding: 13px 14px;
        font-size: 16px; /* iOS zoom guard */
        font-family: inherit;
        min-height: 48px;
        transition: border-color .15s, box-shadow .15s;
}
.tmc-root ::placeholder { color: #6e7681; opacity: 1; }
.tmc-root input:focus, .tmc-root select:focus, .tmc-root textarea:focus {
        outline: none;
        border-color: var(--tmc-accent);
        box-shadow: 0 0 0 3px rgba(34, 211, 238, .16);
}
.tmc-root input[type="date"] { color-scheme: dark; }
.tmc-root textarea { resize: vertical; }

.tmc-alert {
        background: rgba(255, 122, 122, .12);
        border: 1px solid rgba(255, 122, 122, .4);
        color: var(--tmc-danger);
        border-radius: 12px;
        padding: 10px 14px;
        font-size: 14px;
}

.tmc-btn {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        min-height: 48px; padding: 0 20px;
        border-radius: 10px; border: 1.5px solid var(--tmc-border);
        background: var(--tmc-surface); color: var(--tmc-text);
        font-weight: 600; font-size: 15px; cursor: pointer;
        transition: transform .1s, background .15s, border-color .15s;
}
.tmc-btn:active { transform: scale(.97); background: var(--tmc-surface-2); }
/* Основная кнопка — циановая с тёмным текстом (контраст ≥ 9:1, как в TaskFlow) */
.tmc-btn-primary { background: var(--tmc-accent); border-color: var(--tmc-accent); color: #0d1117; font-weight: 700; }
.tmc-btn-primary:active { background: var(--tmc-accent-strong); border-color: var(--tmc-accent-strong); }
.tmc-btn-danger { background: transparent; border-color: rgba(255, 122, 122, .5); color: var(--tmc-danger); }
.tmc-btn-danger:active { background: rgba(255, 122, 122, .12); }
.tmc-btn-block { width: 100%; }
.tmc-btn[disabled] { opacity: .55; pointer-events: none; }

.tmc-login-footer {
        margin-top: 26px; text-align: center;
        color: var(--tmc-muted); font-size: 13px;
        display: flex; align-items: center; justify-content: center; gap: 8px;
        flex-wrap: wrap; row-gap: 4px; line-height: 1.4;
}
.tmc-foot-main { min-width: 0; }
.tmc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tmc-dot-ok { background: var(--tmc-ok); box-shadow: 0 0 8px var(--tmc-ok); }
.tmc-dot-bad { background: var(--tmc-danger); }
.tmc-login-footer .tmc-foot-err { color: var(--tmc-danger); line-height: 1.4; }
.tmc-login-footer .tmc-foot-retry { color: var(--tmc-accent); text-decoration: underline; flex: 0 0 auto; }
.tmc-login-footer .tmc-foot-enc { color: var(--tmc-muted); font-size: 12px; opacity: .85; }
.tmc-login-footer .tmc-foot-ver { margin-left: auto; color: var(--tmc-muted); font-size: 11px; opacity: .7; flex: 0 0 auto; }

/* ------------------------------------------------------------------ */
/* Каркас                                                              */
/* ------------------------------------------------------------------ */

.tmc-header {
        position: sticky; top: 0; z-index: 20;
        display: flex; align-items: center; justify-content: space-between;
        padding: 12px 16px;
        background: rgba(13, 17, 23, .86);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--tmc-border);
}
.tmc-header-title { font-weight: 700; font-size: 18px; letter-spacing: .3px; }

.tmc-main {
        padding: 14px 14px calc(var(--tmc-nav-h) + var(--tmc-safe-b) + 28px);
        max-width: 760px; margin: 0 auto;
}

.tmc-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        display: flex; align-items: center; justify-content: space-around;
        height: calc(var(--tmc-nav-h) + var(--tmc-safe-b));
        padding: 0 16px var(--tmc-safe-b);
        background: rgba(22, 27, 34, .96);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--tmc-border);
}
.tmc-nav-btn {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        background: none; border: 0; color: var(--tmc-muted);
        font-size: 11px; font-weight: 600;
        padding: 8px 22px; border-radius: 14px; cursor: pointer;
        min-height: 48px; min-width: 76px;
}
.tmc-nav-btn.is-active { color: var(--tmc-accent); }
.tmc-nav-btn:active { background: rgba(34, 211, 238, .12); }

.tmc-fab {
        position: absolute; left: 50%; top: -26px; transform: translateX(-50%);
        width: 56px; height: 56px; border-radius: 16px;
        background: var(--tmc-accent); color: #0d1117;
        border: 0; font-size: 30px; font-weight: 400; line-height: 1;
        cursor: pointer; box-shadow: 0 8px 22px rgba(34, 211, 238, .35);
        transition: transform .12s;
}
.tmc-fab:active { transform: translateX(-50%) scale(.92); }

.tmc-avatar {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; border-radius: 50%;
        background: var(--tmc-accent); color: #0d1117;
        font-style: normal; font-weight: 700; font-size: 14px;
        border: 0; cursor: pointer; flex: none;
}
.tmc-avatar-sm { width: 24px; height: 24px; font-size: 10px; cursor: default; }
.tmc-avatar-lg { width: 56px; height: 56px; font-size: 20px; cursor: default; }

/* ------------------------------------------------------------------ */
/* Доска                                                               */
/* ------------------------------------------------------------------ */

.tmc-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.tmc-search { flex: 1; }
.tmc-chip {
        flex: none; min-height: 48px; padding: 0 16px;
        border-radius: 10px; border: 1.5px solid var(--tmc-border);
        background: var(--tmc-surface); color: var(--tmc-muted);
        font-size: 13px; font-weight: 600; cursor: pointer;
}
.tmc-chip.is-on { background: var(--tmc-accent-tint); border-color: var(--tmc-accent); color: var(--tmc-accent); }

.tmc-columns { display: flex; flex-direction: column; gap: 14px; }

.tmc-column {
        background: var(--tmc-surface);
        border: 1px solid var(--tmc-border);
        border-radius: var(--tmc-radius);
        padding: 12px;
        transition: border-color .15s, box-shadow .15s;
}
.tmc-column-over { border-color: var(--tmc-accent); box-shadow: 0 0 0 2px rgba(34, 211, 238, .3); }

.tmc-column-head {
        display: flex; align-items: center; gap: 8px;
        font-weight: 700; font-size: 14px; letter-spacing: .3px;
        margin-bottom: 10px; text-transform: uppercase;
}
.tmc-column-dot { width: 9px; height: 9px; border-radius: 50%; }
.tmc-dot-col0 { background: var(--tmc-warn); }
.tmc-dot-col1 { background: var(--tmc-accent); }
.tmc-dot-col2 { background: var(--tmc-ok); }
.tmc-count {
        margin-left: auto; min-width: 26px; height: 26px;
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--tmc-surface-2); border-radius: 13px;
        font-size: 12px; color: var(--tmc-muted);
}

.tmc-column-body { display: flex; flex-direction: column; gap: 10px; min-height: 52px; }

.tmc-empty {
        border: 1.5px dashed var(--tmc-border); border-radius: 14px;
        color: var(--tmc-muted); font-size: 13px;
        display: flex; align-items: center; justify-content: center;
        min-height: 48px;
}

.tmc-card {
        background: var(--tmc-surface-2);
        border: 1px solid var(--tmc-border);
        border-radius: 16px;
        padding: 12px 14px;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
        touch-action: pan-y;
}
.tmc-card:active { cursor: grabbing; }
.tmc-card-dragging { opacity: .35; border-style: dashed; }
.tmc-ghost {
        position: fixed; z-index: 100;
        pointer-events: none;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
        transform: rotate(2deg) scale(1.03);
        opacity: .95;
        cursor: grabbing;
}
body.tmc-drag-active { overflow: hidden; user-select: none; }

.tmc-card-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }

.tmc-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }

.tmc-prio {
        padding: 3px 9px; border-radius: 8px; font-weight: 700; font-size: 11px;
        text-transform: uppercase; letter-spacing: .4px;
}
.tmc-prio-low    { background: rgba(139, 148, 158, .18); color: var(--tmc-muted); }
.tmc-prio-medium { background: rgba(34, 211, 238, .16); color: var(--tmc-accent); }
.tmc-prio-high   { background: rgba(251, 191, 36, .16); color: var(--tmc-warn); }
.tmc-prio-urgent { background: rgba(255, 122, 122, .16); color: var(--tmc-danger); }

.tmc-due { color: var(--tmc-muted); }
.tmc-due-over { color: var(--tmc-danger); font-weight: 700; }

.tmc-assignee { display: inline-flex; align-items: center; gap: 6px; color: var(--tmc-muted); margin-left: auto; }
.tmc-assignee-none { font-style: italic; opacity: .7; }

/* ------------------------------------------------------------------ */
/* Bottom sheet                                                        */
/* ------------------------------------------------------------------ */

.tmc-sheet-overlay {
        position: fixed; inset: 0; z-index: 60;
        background: rgba(1, 4, 9, .7);
        backdrop-filter: blur(2px);
        display: flex; align-items: flex-end; justify-content: center;
        opacity: 0; transition: opacity .18s;
}
.tmc-sheet-overlay.is-open { opacity: 1; }

.tmc-sheet {
        width: 100%; max-width: 560px;
        max-height: calc(100dvh - 48px);
        display: flex; flex-direction: column;
        background: var(--tmc-surface);
        border-radius: 24px 24px 0 0;
        border: 1px solid var(--tmc-border); border-bottom: 0;
        transform: translateY(40px); transition: transform .22s cubic-bezier(.2, .8, .3, 1);
        padding-bottom: var(--tmc-safe-b);
}
.tmc-sheet-overlay.is-open .tmc-sheet { transform: translateY(0); }

.tmc-sheet-handle {
        width: 44px; height: 4px; border-radius: 2px;
        background: var(--tmc-border); margin: 10px auto 2px;
        flex: none;
}
.tmc-sheet-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 8px 18px 10px; flex: none;
}
.tmc-sheet-head h2 { margin: 0; font-size: 18px; }
.tmc-icon-btn {
        width: 44px; height: 44px; border-radius: 50%;
        border: 0; background: var(--tmc-surface-2); color: var(--tmc-muted);
        font-size: 16px; cursor: pointer;
}
.tmc-icon-btn:active { background: var(--tmc-border); }

.tmc-sheet-body { overflow-y: auto; padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }

.tmc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tmc-seg-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tmc-seg {
        position: relative; display: flex; align-items: center; justify-content: center;
        min-height: 44px; border-radius: 10px;
        background: var(--tmc-surface-2); border: 1.5px solid var(--tmc-border);
        font-size: 12px; font-weight: 600; color: var(--tmc-muted); cursor: pointer;
}
.tmc-seg input { position: absolute; opacity: 0; pointer-events: none; }
.tmc-seg.is-on { border-color: var(--tmc-accent); color: var(--tmc-accent); background: var(--tmc-accent-tint); }

.tmc-sheet-actions {
        display: flex; align-items: center; gap: 10px;
        padding: 12px 18px; border-top: 1px solid var(--tmc-border); flex: none;
}
.tmc-sheet-spacer { flex: 1; }

/* ------------------------------------------------------------------ */
/* Профиль                                                             */
/* ------------------------------------------------------------------ */

.tmc-profile { display: flex; flex-direction: column; gap: 14px; }

.tmc-panel {
        background: var(--tmc-surface);
        border: 1px solid var(--tmc-border);
        border-radius: var(--tmc-radius);
        padding: 16px;
}
.tmc-panel h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--tmc-muted); }

.tmc-panel-user { display: flex; align-items: center; gap: 14px; }
.tmc-panel-name { font-weight: 700; font-size: 18px; }
.tmc-panel-login { color: var(--tmc-muted); font-size: 13px; margin-bottom: 6px; }

.tmc-role {
        display: inline-block; padding: 3px 10px; border-radius: 9px;
        font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.tmc-role-admin     { background: rgba(167, 139, 250, .16); color: #a78bfa; }
.tmc-role-manager   { background: rgba(34, 211, 238, .16); color: var(--tmc-accent); }
.tmc-role-developer { background: rgba(74, 222, 128, .14); color: var(--tmc-ok); }

.tmc-panel-stats {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px;
}
.tmc-panel-stats > div {
        background: var(--tmc-surface-2); border-radius: 14px;
        padding: 10px; text-align: center;
}
.tmc-panel-stats b { display: block; font-size: 20px; }
.tmc-panel-stats span { font-size: 11px; color: var(--tmc-muted); }

.tmc-kv {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 9px 0; border-bottom: 1px dashed var(--tmc-border);
        font-size: 14px;
}
.tmc-kv:last-child { border-bottom: 0; }
.tmc-kv span { color: var(--tmc-muted); }
.tmc-kv b { text-align: right; word-break: break-all; }
.tmc-mono { font-family: ui-monospace, 'Roboto Mono', monospace; letter-spacing: 1px; }
.tmc-loading { color: var(--tmc-muted); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Диагностика подключения (вкладка в приложении)                      */
/* ------------------------------------------------------------------ */

.tmc-login-footer .tmc-foot-diag { color: var(--tmc-accent); text-decoration: underline; flex: 0 0 auto; }
.tmc-diag-sheet { max-height: calc(100dvh - 24px); }
.tmc-diag-intro {
        color: var(--tmc-muted); font-size: 13px; line-height: 1.5;
        background: var(--tmc-surface-2); border: 1px solid var(--tmc-border);
        border-radius: 14px; padding: 10px 12px;
}
.tmc-diag-list { display: flex; flex-direction: column; gap: 8px; }
.tmc-diag-item {
        background: var(--tmc-surface-2);
        border: 1px solid var(--tmc-border);
        border-left-width: 4px;
        border-radius: 14px;
        padding: 10px 12px;
}
.tmc-diag-item-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.tmc-diag-item-head b { font-weight: 600; }
.tmc-diag-ico { font-size: 15px; flex: none; width: 18px; text-align: center; }
.tmc-diag-lines {
        margin: 8px 0 0; padding: 0; white-space: pre-wrap; word-break: break-word;
        font-family: ui-monospace, 'Roboto Mono', monospace;
        font-size: 12px; line-height: 1.5; color: var(--tmc-muted);
}
.tmc-d-ok   { border-left-color: var(--tmc-ok); }
.tmc-d-ok .tmc-diag-ico { color: var(--tmc-ok); }
.tmc-d-warn { border-left-color: var(--tmc-warn); }
.tmc-d-warn .tmc-diag-ico { color: var(--tmc-warn); }
.tmc-d-fail { border-left-color: var(--tmc-danger); }
.tmc-d-fail .tmc-diag-ico { color: var(--tmc-danger); }
.tmc-d-skip { opacity: .6; border-left-color: var(--tmc-border); }
.tmc-diag-item.tmc-d-fail { background: rgba(255, 122, 122, .07); }

/* ------------------------------------------------------------------ */
/* Заметки: вкладка, карточки, редактор, вложения, share-ссылки         */
/* ------------------------------------------------------------------ */

/* резерв места под FAB в навигации из 3 кнопок */
.tmc-nav-gap { width: 34px; flex: none; }

/* фильтры типов заметок: строка чипов с горизонтальной прокруткой */
.tmc-note-filters {
        display: flex; gap: 8px; overflow-x: auto;
        padding-bottom: 4px; margin-bottom: 12px;
        scrollbar-width: none;
}
.tmc-note-filters::-webkit-scrollbar { display: none; }
.tmc-note-filters .tmc-chip { min-height: 42px; padding: 0 14px; }

.tmc-notes-list { display: flex; flex-direction: column; gap: 10px; }

.tmc-note {
        background: var(--tmc-surface-2);
        border: 1px solid var(--tmc-border);
        border-radius: 16px;
        padding: 12px 14px;
        cursor: pointer;
}
.tmc-note:active { border-color: var(--tmc-accent); }

.tmc-note-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tmc-note-type {
        padding: 3px 9px; border-radius: 8px;
        font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.tmc-nt-p  { background: rgba(251, 191, 36, .16); color: var(--tmc-warn); }
.tmc-nt-wp { background: rgba(34, 211, 238, .16); color: var(--tmc-accent); }
.tmc-nt-ws { background: rgba(52, 211, 153, .16); color: var(--tmc-ok); }

.tmc-note-flag {
        margin-left: auto;
        font-size: 11px; color: var(--tmc-muted);
        background: var(--tmc-surface); border: 1px solid var(--tmc-border);
        padding: 2px 8px; border-radius: 8px;
}
.tmc-note-flag + .tmc-note-flag { margin-left: 0; }

.tmc-note-title { font-weight: 600; font-size: 17px; margin-bottom: 4px; word-break: break-word; }
.tmc-note-snip {
        color: var(--tmc-muted); font-size: 13px; line-height: 1.4;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tmc-note-meta {
        display: flex; align-items: center; gap: 8px; margin-top: 8px;
        font-size: 12px; color: var(--tmc-muted); flex-wrap: wrap;
}
.tmc-note-task {
        background: var(--tmc-accent-tint); color: var(--tmc-accent);
        border-radius: 8px; padding: 2px 8px; font-size: 11px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
.tmc-note-when { margin-left: auto; opacity: .8; flex: none; }

/* тип заметки — 3 сегмента (в отличие от 4 у приоритета задачи) */
.tmc-seg-notes { grid-template-columns: repeat(3, 1fr); }

/* заметки внутри карточки задачи (дополнительный слой над задачами) */
.tmc-task-notes { display: flex; flex-direction: column; gap: 8px; }
.tmc-task-note {
        display: flex; align-items: center; gap: 8px; text-align: left;
        background: var(--tmc-surface-2); border: 1px solid var(--tmc-border);
        border-radius: 12px; padding: 10px 12px; color: var(--tmc-text);
        font-size: 13px; cursor: pointer; min-height: 44px;
}
.tmc-task-note:active { border-color: var(--tmc-accent); }
.tmc-task-note-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmc-task-note .tmc-note-flag { margin-left: 0; flex: none; }

/* вложения заметок */
.tmc-files { display: flex; flex-direction: column; gap: 8px; }
.tmc-files-empty {
        color: var(--tmc-muted); font-size: 13px;
        border: 1.5px dashed var(--tmc-border); border-radius: 12px;
        padding: 10px; text-align: center;
}
.tmc-file-row {
        display: flex; align-items: center; gap: 10px;
        background: var(--tmc-surface-2); border: 1px solid var(--tmc-border);
        border-radius: 12px; padding: 8px 10px; min-height: 48px;
}
.tmc-file-row svg { flex: none; color: var(--tmc-muted); }
/* Оверлеи (лист заметки, просмотрщик) создаются вне .tmc-root, поэтому базовое
   правило .tmc-root svg (22px + fill) на них НЕ действует: SVG без явных размеров
   растягивается на всю ширину строки (выглядело как «огромная картинка» при
   прикреплении ссылки). Задаём явные размеры и закраску цветом текста.       */
.tmc-sheet-overlay svg { width: 22px; height: 22px; fill: currentColor; }
.tmc-file-row > svg { width: 18px; height: 18px; }
.tmc-file-btn svg { width: 18px; height: 18px; }
.tmc-copy-btn svg { width: 20px; height: 20px; }
.tmc-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tmc-file-size { flex: none; color: var(--tmc-muted); font-size: 11px; }
.tmc-file-btn {
        width: 40px; height: 40px; flex: none; border-radius: 10px; border: 0;
        background: transparent; color: var(--tmc-accent);
        display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tmc-file-btn:active { background: var(--tmc-accent-tint); }
.tmc-file-btn-del { color: var(--tmc-danger); }
.tmc-file-btn-del:active { background: rgba(255, 122, 122, .12); }
.tmc-file-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tmc-file-actions .tmc-share-hint { flex: 1 1 100%; }

/* share-ссылка: поле + иконка-кнопка «скопировать» */
.tmc-share-row { display: flex; align-items: center; gap: 8px; }
.tmc-share-url { flex: 1; min-width: 0; font-size: 12px; color: var(--tmc-accent); border-color: var(--tmc-accent); }
.tmc-share-url:focus { border-color: var(--tmc-accent); }
.tmc-copy-btn {
        width: 46px; height: 46px; flex: none; border-radius: 12px;
        border: 1.5px solid var(--tmc-accent); background: var(--tmc-accent-tint);
        color: var(--tmc-accent);
        display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tmc-copy-btn:active { background: rgba(34, 211, 238, .3); }
.tmc-share-row2 { display: flex; gap: 8px; }
.tmc-share-row2 .tmc-btn { flex: 1; }
.tmc-share-hint { color: var(--tmc-muted); font-size: 12px; line-height: 1.45; }

/* заметок в профиле — 4-я плитка статистики */
.tmc-panel-stats { grid-template-columns: repeat(2, 1fr); }

/* ------------------------------------------------------------------ */
/* Тосты                                                               */
/* ------------------------------------------------------------------ */

.tmc-toast {
        position: fixed; top: calc(14px + var(--tmc-safe-t)); left: 50%;
        transform: translate(-50%, -16px);
        z-index: 90; max-width: min(92vw, 480px);
        background: #1c2128; color: var(--tmc-text);
        border: 1px solid var(--tmc-border);
        border-left: 4px solid var(--tmc-ok);
        border-radius: 14px; padding: 12px 18px;
        font-size: 14px; font-weight: 500;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
        opacity: 0; transition: opacity .25s, transform .25s;
        pointer-events: none;
}
.tmc-toast-err { border-left-color: var(--tmc-danger); }
.tmc-toast-show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ */
/* Планшет / десктоп                                                   */
/* ------------------------------------------------------------------ */

@media (min-width: 760px) {
        .tmc-columns { flex-direction: row; align-items: flex-start; }
        .tmc-column { flex: 1; }
        .tmc-main { max-width: 1080px; }
}

@media (prefers-reduced-motion: reduce) {
        .tmc-root *, .tmc-sheet, .tmc-sheet-overlay, .tmc-toast { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ */
/* Заметки 1.0.12: тип описания Текст/Список, теги, вложения,           */
/* внутренний просмотрщик                                              */
/* ------------------------------------------------------------------ */

/* сегмент «Тип описания»: Текст | Список */
.tmc-seg-ctype { grid-template-columns: repeat(2, 1fr); }

/* редактор списка */
.tmc-list-rows { display: flex; flex-direction: column; gap: 8px; }
.tmc-li-row {
        display: flex; align-items: center; gap: 8px;
        background: var(--tmc-surface-2); border: 1px solid var(--tmc-border);
        border-radius: 12px; padding: 6px 10px; min-height: 48px;
}
.tmc-li-done { width: 22px; height: 22px; flex: none; accent-color: var(--tmc-accent); cursor: pointer; }
.tmc-li-text {
        flex: 1; min-width: 0; background: transparent !important;
        border: 0 !important; box-shadow: none !important;
        padding: 0 !important; color: var(--tmc-text);
}
.tmc-li-text::placeholder { color: var(--tmc-muted); }
.tmc-li-row.is-done .tmc-li-text { opacity: .55; text-decoration: line-through; }
.tmc-li-del { width: 36px; height: 36px; }
.tmc-list-add { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; }

/* теги: предпросмотр в редакторе и чипы на карточке */
.tmc-tags-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tmc-tags-preview:empty { display: none; }
.tmc-tag {
        display: inline-flex; align-items: center;
        font-size: 12px; padding: 3px 10px; border-radius: 999px;
        background: var(--tmc-accent-tint); color: var(--tmc-accent);
        border: 1px solid var(--tmc-accent);
}
button.tmc-tag { cursor: pointer; touch-action: manipulation; }
button.tmc-tag:active { background: rgba(34, 211, 238, .3); }
.tmc-tag-more { opacity: .75; }
.tmc-note-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
/* Размер шрифта тегов в списке заметок — как у задач-проектов (.tmc-note-task,
   11px), оформление чипов прежнее: цвет, рамка, скругление.                */
.tmc-note-tags .tmc-tag { font-size: 11px; padding: 2px 8px; }

/* кнопки вложений: Ссылка / Картинка / Файл */
.tmc-btn svg { width: 18px; height: 18px; flex: none; }
.tmc-btn-att { display: inline-flex; align-items: center; gap: 7px; }
.tmc-btn-att svg { width: 16px; height: 16px; }

/* форма добавления ссылки */
.tmc-link-form {
        display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
        border: 1.5px dashed var(--tmc-border); border-radius: 12px; padding: 10px;
}

/* домен ссылки под названием вложения */
.tmc-file-domain {
        display: block; font-size: 11px; color: var(--tmc-muted);
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* внутренний просмотрщик вложений — поверх редактора заметки */
.tmc-viewer-overlay { z-index: 70; }
.tmc-viewer { height: 92dvh; max-height: 92dvh; }
.tmc-viewer-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tmc-viewer-loading { color: var(--tmc-muted); text-align: center; padding: 32px 0; }
.tmc-viewer-frame {
        flex: 1; width: 100%; min-height: 320px; border: 0;
        background: #fff; border-radius: 10px;
}
.tmc-viewer-imgwrap {
        flex: 1; min-height: 0; overflow: auto;
        display: flex; align-items: center; justify-content: center;
        background: #0a0e14; border-radius: 10px;
}
.tmc-viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tmc-viewer-pre {
        flex: 1; min-height: 0; overflow: auto; margin: 0;
        white-space: pre-wrap; word-break: break-word;
        background: var(--tmc-surface-2); border: 1px solid var(--tmc-border);
        border-radius: 12px; padding: 12px; font-size: 13px; font-family: inherit;
}
.tmc-viewer-nopreview {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 8px;
        text-align: center; color: var(--tmc-muted);
}
.tmc-viewer-nopreview svg { width: 44px; height: 44px; color: var(--tmc-border); }
.tmc-viewer-linkinfo { padding: 0 0 8px; }
.tmc-viewer-linkinfo .tmc-file-domain { font-size: 13px; color: var(--tmc-accent); }
