/* ============================================================
   PANELS (resizable side panels + watch panel)
   (split from style.css, lines 1096-1338)
   ============================================================ */

/* ======================================================
   RESIZABLE SIDE PANELS
   Shared by #task-drawer (editable) and #watch-drawer (read-only
   preview). A slim control bar (width presets + floating ✕) sits
   above each panel's own header, and a thin drag handle runs down
   the left edge — dragging left grows the panel since it's anchored
   to the right of the viewport.
   ====================================================== */
.task-drawer,
.watch-drawer {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), width 0.15s ease;
}
body.drawer-resizing .task-drawer,
body.drawer-resizing .watch-drawer {
    transition: none;
}

.drawer-resize-controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-3);
    flex-shrink: 0;
}
.drawer-width-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.drawer-width-btn {
    background: var(--bg-4);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.drawer-width-btn:hover { border-color: var(--border-hover); color: var(--text-1); }
.drawer-width-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.drawer-float-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.9rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.drawer-float-close:hover { background: var(--danger-dim); color: var(--danger); border-color: var(--danger); }

.drawer-resize-handle {
    position: absolute;
    top: 0; left: -4px; bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 5;
}
.drawer-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 4px; height: 44px;
    border-radius: 99px;
    background: var(--border);
    transition: background var(--transition);
}
.drawer-resize-handle:hover::after,
body.drawer-resizing .drawer-resize-handle::after { background: var(--accent); }

body.drawer-resizing { cursor: ew-resize !important; user-select: none; }
body.drawer-resizing * { cursor: ew-resize !important; }

@media (max-width: 900px) {
    .drawer-width-presets { display: none; }
    .drawer-resize-handle  { display: none; }
}

/* ======================================================
   WATCH PANEL  (read-only preview for linked tasks/projects)
   Deliberately styled as its own overlay layer stacked ABOVE the
   main task drawer, so opening a watched link never disturbs an
   in-progress edit sitting in #task-drawer underneath.
   ====================================================== */
.watch-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    z-index: 210;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.watch-overlay.open { opacity: 1; pointer-events: all; }

.watch-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--custom-drawer-width, min(680px, 100vw));
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    z-index: 211;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    overflow: hidden !important;
    max-height: 100vh;
}
.watch-drawer.open { transform: translateX(0); }

.watch-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.watch-header-main { flex: 1; min-width: 0; }
.watch-back-btn { flex-shrink: 0; margin-top: 2px; }
.watch-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 8px;
    border-radius: 99px;
    margin-bottom: 10px;
}

.watch-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
    overscroll-behavior: contain;
}
.watch-readonly-note {
    font-size: 0.8rem;
    color: var(--text-3);
    background: var(--bg-3);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.watch-task-list { display: flex; flex-direction: column; gap: 8px; }
.watch-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}
.watch-task-row:hover { border-color: var(--border-hover); background: var(--bg-4); }
.watch-task-row-title {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .watch-drawer { width: 100vw !important; }
}

/* ── File list in drawer ─────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}
.file-icon { font-size: 1.2rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-meta { font-size: 0.75rem; color: var(--text-3); }
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition);
}
.file-upload-area:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.file-upload-area.drag-over { border-color: var(--accent); background: var(--accent-dim); }

/* ── History ─────────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-list.collapsed { display: none; }
.activity-log-toggle { cursor: pointer; user-select: none; }
.activity-log-toggle:hover { color: var(--text-2); }
.activity-log-chevron { font-size: 0.65rem; transition: transform 0.15s ease; display: inline-block; }
.activity-log-toggle.open .activity-log-chevron { transform: rotate(90deg); }
.history-item {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
}
.history-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.history-content { flex: 1; }
.history-text { color: var(--text-2); }
.history-time { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

