/* =====================================================================
   Содержание — оформление
   Опирается на переменные :root из css/style.css (--primary, --bg-2 и пр.)
   Панель выезжает слева — в отличие от заметок (справа).
===================================================================== */

/* --- затемнение --- */
.tc-scrim {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(30, 41, 59, 0.28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.tc-scrim.is-open { opacity: 1; pointer-events: auto; }

/* --- панель --- */
.tc-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 160;
    width: min(380px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-radius: 0 24px 24px 0;
    box-shadow: 20px 0 60px rgba(30, 41, 59, 0.22);
    padding: 22px 20px 16px;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.tc-drawer.is-open { transform: translateX(0); }

.tc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.tc-title {
    flex: 1;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.tc-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--bg-2);
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.tc-close:hover { background: var(--primary); color: #fff; }

/* --- тело и список --- */
.tc-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
}
.tc-list { display: flex; flex-direction: column; gap: 2px; }

.tc-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font-family: inherit;
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    transition: background 0.13s ease, box-shadow 0.13s ease;
}
.tc-item.is-link { cursor: pointer; }
.tc-item.is-link:hover { background: rgba(99, 102, 241, 0.10); }
.tc-item.is-current {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 3px 0 0 var(--primary);
}

.tc-text {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}
.tc-page {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* --- уровни: чем выше (больше звёздочек), тем крупнее и левее --- */
.tc-l0 { font-size: 16px;   font-weight: 800; margin-top: 14px; letter-spacing: -0.01em; }
.tc-l1 { font-size: 15px;   font-weight: 700; margin-top: 8px; }
.tc-l2 { font-size: 14.5px; font-weight: 600; }
.tc-l3 { font-size: 14px;   font-weight: 500; color: var(--text-muted); }
.tc-list > .tc-item:first-child { margin-top: 0; }

/* --- пусто --- */
.tc-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    padding: 28px 12px;
}

/* =====================================================================
   Мелкие экраны
   Кнопок в панели управления стало больше — разрешаем перенос на две
   строки (правило идемпотентно с css/notes.css). Панель чуть шире.
===================================================================== */
@media (max-width: 600px) {
    #controls {
        flex-wrap: wrap;
        max-width: calc(100vw - 24px);
        justify-content: center;
    }
    .tc-drawer {
        width: 88vw;
        border-radius: 0 20px 20px 0;
        padding: 18px 16px 14px;
    }
    .tc-title { font-size: 18px; }
}
