﻿  /* ── Right-pane tabbed file viewer ── */
  .fvr-tabbar { display: flex; flex-direction: row; flex-shrink: 0; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; min-height: 32px; }
  .fvr-tabbar::-webkit-scrollbar { display: none; }
  .fvr-tabbar:empty { display: none; }
  .fvr-tab { display: flex; align-items: center; gap: 5px; padding: 0 10px 0 12px; height: 32px; font-size: 11px; color: var(--text-muted); cursor: pointer; border-right: 1px solid var(--border); border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; user-select: none; transition: background 0.1s, color 0.1s; background: var(--bg); }
  .fvr-tab:hover { background: var(--bg-hover); color: var(--text); }
  .fvr-tab.active { color: var(--text); border-bottom-color: var(--accent); background: var(--bg-card); }
  .fvr-tab-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .fvr-tab-close { font-size: 12px; color: var(--text-muted); opacity: 0.5; padding: 2px; border-radius: 3px; line-height: 1; transition: opacity 0.1s, background 0.1s; }
  .fvr-tab-close:hover { opacity: 1; background: var(--bg-hover); color: var(--error, #ef4444); }
  .fvr-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; min-height: 36px; }
  .fvr-path { flex: 1; font-size: 11px; font-family: var(--font-mono, monospace); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .fvr-lang { font-size: 10px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 4px; flex-shrink: 0; }
  .fvr-mode-tabs { display: flex; gap: 1px; flex-shrink: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 2px; }
  .fvr-mode-btn { padding: 2px 10px; font-size: 11px; font-weight: 500; background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: 3px; transition: background 0.1s, color 0.1s; }
  .fvr-mode-btn:hover { color: var(--text); }
  .fvr-mode-btn.active { background: var(--accent); color: #fff; }
  .fvr-body { flex: 1; overflow: auto; font-family: var(--font-mono, monospace); font-size: 12px; line-height: 1.6; position: relative; min-height: 0; }
  .fvr-back-btn { display: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; color: var(--text); cursor: pointer; flex-shrink: 0; }
  .fvr-back-btn:hover { background: var(--bg-hover); color: var(--accent); }

  /* ── Files View — collapsible sections + split layout ── */
  .fview-section { border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
  .fview-section.open { flex: 1; min-height: 0; }
  .fview-section-hdr { display: flex; align-items: center; gap: 7px; padding: 8px 14px; cursor: pointer; user-select: none; font-size: 12px; font-weight: 600; color: var(--text); background: var(--bg-card); flex-shrink: 0; transition: background 0.1s; }
  .fview-section-hdr:hover { background: var(--bg-hover); }
  .fview-chevron { font-size: 8px; color: var(--text-muted); transition: transform 0.18s; display: inline-block; transform: rotate(-90deg); flex-shrink: 0; }
  .fview-chevron.open { transform: rotate(0deg); }
  .fview-section-body { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }

  /* ── Split layout (left accordion + right panel) ── */
  .fview-split { display: flex; flex-direction: row; flex: 1; overflow: hidden; min-height: 0; }
  .fview-left { width: 220px; min-width: 100px; max-width: 60%; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); }
  .fview-resize { width: 5px; cursor: col-resize; background: transparent; flex-shrink: 0; transition: background 0.15s; }
  .fview-resize:hover, .fview-resize.dragging { background: var(--accent); opacity: 0.5; }
  .fview-right { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
  .fview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 32px 24px; text-align: center; color: var(--text-muted); gap: 10px; }
  .fview-placeholder-icon { font-size: 34px; opacity: 0.25; }
  .fview-placeholder-title { font-size: 13px; font-weight: 500; opacity: 0.5; }
  .fview-placeholder-sub { font-size: 11px; opacity: 0.35; max-width: 190px; line-height: 1.55; }

  /* ── Left accordion items ── */
  .facc-item { flex-shrink: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); overflow: hidden; }
  .facc-item:last-child { border-bottom: none; }
  .facc-item.open { flex: 1; min-height: 0; }
  .facc-hdr { display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-muted); user-select: none; transition: background 0.1s, color 0.1s; flex-shrink: 0; }
  .facc-hdr:hover { background: var(--bg-hover); color: var(--text); }
  .facc-item.open .facc-hdr { color: var(--text); }
  .facc-chevron { font-size: 8px; color: var(--text-muted); transition: transform 0.15s; display: inline-block; transform: rotate(-90deg); flex-shrink: 0; }
  .facc-chevron.open { transform: rotate(0deg); }
  .facc-label { flex: 1; }
  .facc-body { display: flex; flex-direction: column; flex: 1; overflow-y: auto; min-height: 0; }
  .facc-diff-badge { display: flex; gap: 4px; align-items: center; flex-shrink: 0; font-weight: 700; }
  .facc-diff-badge .diff-add { color: #22c55e; font-size: 10px; }
  .facc-diff-badge .diff-del { color: #ef4444; font-size: 10px; }

  /* ── Files Panel ── */
  .files-panel { width: 280px; border-left: 1px solid var(--border); background: var(--bg-card); display: flex; flex-direction: column; flex-shrink: 0; transition: width 0.2s, opacity 0.2s; }
  .files-panel.hidden { width: 0; opacity: 0; border-left: none; pointer-events: none; overflow: hidden; }
  .files-panel-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .files-panel-header h4 { font-size: 12px; font-weight: 600; }
  .files-breadcrumb { padding: 6px 14px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-muted); overflow-x: auto; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
  .files-breadcrumb span { cursor: pointer; transition: color 0.12s; }
  .files-breadcrumb span:hover { color: var(--accent); }
  .files-breadcrumb .sep { cursor: default; color: var(--border); }
  .files-list { flex: 1; overflow-y: auto; padding: 2px 0; }
  .file-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px; cursor: pointer; font-size: 12px; color: var(--text-muted); transition: background 0.1s; text-decoration: none; }
  .file-item:hover { background: var(--bg-hover); color: var(--text); }
  .file-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
  .file-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .file-size { font-size: 10px; color: var(--text-muted); opacity: 0.7; }
  .files-empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 12px; }

  /* ── Files Panel Tabs ── */
  .files-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .files-tab-btn { flex: 1; padding: 7px 0; font-size: 11px; font-weight: 500; background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; color: var(--text-muted); transition: color 0.12s, border-color 0.12s; }
  .files-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
  .files-tab-btn:hover:not(.active) { color: var(--text); }
  /* ── Session file list (tagged) ── */
  .sfile-item { display: flex; align-items: center; gap: 7px; padding: 7px 14px; text-decoration: none; transition: background 0.1s; border-bottom: 1px solid var(--border); }
  .sfile-item:hover { background: var(--bg-hover); }
  .sfile-info { flex: 1; min-width: 0; }
  .sfile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--text); }
  .sfile-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
  .sfile-tag { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
  .tag-generated { background: #6366f120; color: #818cf8; border: 1px solid #6366f130; }
  .tag-attachment { background: #f9731620; color: #fb923c; border: 1px solid #f9731630; }
  .tag-created  { background: #22c55e20; color: #4ade80; border: 1px solid #22c55e30; }
  .tag-modified { background: #f59e0b20; color: #fbbf24; border: 1px solid #f59e0b30; }
  .tag-deleted  { background: #ef444420; color: #f87171; border: 1px solid #ef444430; }

  /* ── Session tab section labels ── */
  .sf-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text-muted); padding: 8px 12px 4px; opacity: 0.7; }
  .sf-section-divider { height: 1px; background: var(--border); margin: 6px 10px; opacity: 0.5; }

  /* ── Output files row (below assistant messages) ── */
  .msg-output-files { margin: 10px 0 4px; padding: 8px 0 2px; border-top: 1px solid var(--border); }
  .output-files-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
  .output-files-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .output-file-card { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; background: #6366f110; border: 1px solid #6366f130; border-radius: 8px; text-decoration: none; color: var(--text); cursor: pointer; transition: border-color 0.12s, background 0.12s; max-width: 260px; }
  .output-file-card:hover { border-color: var(--accent); background: #6366f120; }
  .ofc-icon { font-size: 16px; flex-shrink: 0; }
  .ofc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .ofc-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ofc-size { font-size: 10px; color: var(--text-muted); }
  .ofc-dl { font-size: 13px; color: var(--accent); flex-shrink: 0; opacity: 0.7; }
  .output-file-card:hover .ofc-dl { opacity: 1; }

  /* Image-preview variant of the output card */
  .output-file-card.has-preview { padding: 0; max-width: 280px; flex-direction: column; align-items: stretch; gap: 0; overflow: hidden; }
  .ofc-thumb-wrap { width: 100%; aspect-ratio: 1 / 1; background: #00000020; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .ofc-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ofc-thumb-loading { font-size: 11px; color: var(--text-muted); }
  .output-file-card.has-preview .ofc-info { padding: 6px 10px; flex-direction: row; align-items: center; gap: 6px; }
  .output-file-card.has-preview .ofc-icon { font-size: 13px; }
  .output-file-card.has-preview .ofc-dl { padding-right: 10px; }

  /* Image lightbox overlay */
  .img-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
  .img-lightbox.visible { display: flex; }
  .img-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
  .img-lightbox-close { position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,0.1); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .img-lightbox-close:hover { background: rgba(255,255,255,0.2); }
  .img-lightbox-download { position: absolute; top: 16px; right: 64px; background: rgba(255,255,255,0.1); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .img-lightbox-download:hover { background: var(--accent); color: #000; }

  /* ── Attachment Chips (pending files) ── */
  .attach-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px 0; }
  .attach-chips:empty { display: none; }
  .attach-chip { display: flex; align-items: center; gap: 5px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px 3px 8px; font-size: 12px; color: var(--text); max-width: 200px; }
  .attach-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .attach-chip .chip-rm { cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; padding-left: 2px; flex-shrink: 0; }
  .attach-chip .chip-rm:hover { color: var(--error); }
  .attach-chip.uploading { opacity: 0.6; }
  .attach-chip.error { border-color: var(--error); }
  .attach-chip .attach-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
  .chip-spinner { width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: chip-spin 0.7s linear infinite; flex-shrink: 0; }
  @keyframes chip-spin { to { transform: rotate(360deg); } }
  /* ── Full-screen chat drop overlay ── */
  .chat-drop-overlay { position: absolute; inset: 0; z-index: 500; background: color-mix(in srgb, var(--accent) 10%, var(--bg) 80%); border: 2.5px dashed var(--accent); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; transition: opacity 0.12s; }
  .chat-drop-overlay.hidden { display: none; }
  .chat-drop-overlay svg { opacity: 0.55; }
  .chat-drop-overlay span { font-size: 15px; font-weight: 600; color: var(--accent); opacity: 0.85; letter-spacing: 0.01em; }

  /* ── Permission Request Modal ── */
  .perm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 900; animation: fadeIn 0.15s ease; }

  /* ── Settings Modal ── */
  .settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 950; animation: fadeIn 0.15s ease; }
  .settings-overlay.hidden { display: none; }
  .settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0; max-width: 520px; width: 92%; box-shadow: 0 8px 32px rgba(0,0,0,0.35); max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
  .settings-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
  .settings-card .settings-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
  .settings-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; flex-shrink: 0; }
  .settings-tab-btn { padding: 14px 16px 12px; font-size: 13px; font-weight: 500; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: color .15s, border-color .15s; margin-bottom: -1px; }
  .settings-tab-btn:hover { color: var(--text); }
  .settings-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
  .settings-tab-pane { display: none; flex: 1; overflow-y: auto; padding: 22px 24px; }
  .settings-tab-pane.active { display: block; }
  .settings-section { margin-bottom: 18px; }
  .settings-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
  .settings-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .settings-row label { font-size: 12px; color: var(--text); min-width: 120px; flex-shrink: 0; }
  .settings-row select, .settings-row input[type="number"], .settings-row input[type="text"] { flex: 1; padding: 6px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; font-family: var(--font); outline: none; }
  .settings-row select:focus, .settings-row input:focus { border-color: var(--accent); }
  .settings-row textarea { flex: 1; padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; font-family: var(--font); outline: none; resize: vertical; min-height: 60px; }
  .settings-row textarea:focus { border-color: var(--accent); }
  .settings-toggle { display: flex; align-items: center; gap: 8px; }
  .settings-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
  .settings-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
  .settings-actions button { padding: 7px 20px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
  /* End-node cards */
  .endnode-list { display: flex; flex-direction: column; gap: 10px; }
  .endnode-card { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
  .endnode-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .endnode-card-dot.connected { background: var(--success, #48c78e); }
  .endnode-card-dot.disconnected { background: #8c8c8c; }
  .endnode-card-info { flex: 1; min-width: 0; }
  .endnode-card-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .endnode-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
  .endnode-card-models { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
  .endnode-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 28px 0; }
  .settings-save-btn { border: none; background: var(--accent); color: #fff; }
  .settings-save-btn:hover { opacity: 0.85; }
  .settings-cancel-btn { border: 1px solid var(--border); background: transparent; color: var(--text); }
  .settings-cancel-btn:hover { background: var(--bg-hover); }
  .settings-reset-btn { border: 1px solid var(--border); background: transparent; color: #ef4444; margin-right: auto; }
  .settings-reset-btn:hover { background: #ef444410; }
  .settings-gear { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 4px; line-height: 1; }
  .settings-gear:hover { color: var(--accent); background: var(--bg-hover); }
  /* Skill config items */
  .skill-config-block { margin-bottom: 14px; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; }
  .skill-config-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .skill-config-name { font-size: 13px; font-weight: 600; color: var(--text); }
  .skill-config-version { font-size: 10px; color: var(--text-muted); }
  .skill-config-badge { display: inline-block; font-size: 9px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
  .skill-config-badge.ok { background: #22c55e20; color: #22c55e; }
  .skill-config-badge.missing { background: #ef444420; color: #ef4444; }
  .skill-config-var { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .skill-config-var label { font-size: 11px; color: var(--text-muted); min-width: 100px; flex-shrink: 0; }
  .skill-config-var input { flex: 1; padding: 4px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-size: 11px; font-family: var(--font-mono, monospace); }
  .skill-config-var input:focus { border-color: var(--accent); outline: none; }
  .skill-config-var .required-dot { color: #ef4444; font-size: 14px; line-height: 1; }
  .skill-config-save-btn { padding: 3px 12px; border: none; background: var(--accent); color: #fff; border-radius: 5px; font-size: 11px; cursor: pointer; margin-top: 4px; }
  .skill-config-save-btn:hover { opacity: 0.85; }
  .perm-overlay.hidden { display: none; }
  .perm-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px 28px; max-width: 460px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.35); }
  .perm-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 5px; }
  .perm-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
  .perm-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
  .perm-lbl { font-weight: 500; font-size: 11px; color: var(--text-muted); min-width: 72px; }
  .perm-val { word-break: break-all; }
  .perm-op-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; text-transform: uppercase; font-weight: 700; }
  .pop-write   { background: #ef444420; color: #ef4444; border: 1px solid #ef444440; }
  .pop-read    { background: #22c55e20; color: #22c55e; border: 1px solid #22c55e40; }
  .pop-delete  { background: #f9731620; color: #f97316; border: 1px solid #f9731640; }
  .pop-execute { background: #8b5cf620; color: #8b5cf6; border: 1px solid #8b5cf640; }
  .pop-network { background: #06b6d420; color: #06b6d4; border: 1px solid #06b6d440; }
  .perm-reason-box { margin: 12px 0 0; background: var(--bg-input); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); }
  .perm-actions { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }
  .perm-deny-btn { padding: 7px 20px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text); }
  .perm-deny-btn:hover { background: var(--bg-hover); }
  .perm-approve-btn { padding: 7px 20px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: var(--accent); color: #fff; }
  .perm-approve-btn:hover { opacity: 0.85; }

  /* ── Ask-User Modal ── */
  .askuser-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 920; animation: fadeIn 0.15s ease; }
  .askuser-overlay.hidden { display: none; }
  .askuser-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; max-width: 520px; width: 92%; box-shadow: 0 8px 32px rgba(0,0,0,0.35); max-height: 86vh; display: flex; flex-direction: column; }
  .askuser-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
  .askuser-icon { font-size: 18px; }
  .askuser-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
  .askuser-queue-badge { margin-left: auto; font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
  .askuser-question { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
  .askuser-message { font-size: 12px; color: var(--text-muted); background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; line-height: 1.45; }
  .askuser-options { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
  .askuser-options:empty { display: none; }
  .askuser-option { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s; }
  .askuser-option:hover { background: var(--bg-hover); border-color: var(--accent); }
  .askuser-option.selected { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }
  .askuser-option-marker { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-muted); flex-shrink: 0; margin-top: 2px; position: relative; }
  .askuser-option.multi .askuser-option-marker { border-radius: 3px; }
  .askuser-option.selected .askuser-option-marker { border-color: var(--accent); background: var(--accent); }
  .askuser-option.selected .askuser-option-marker::after { content: ''; position: absolute; inset: 2px; background: #fff; border-radius: inherit; transform: scale(0.7); }
  .askuser-option-body { flex: 1; min-width: 0; }
  .askuser-option-label { font-size: 13px; color: var(--text); font-weight: 500; }
  .askuser-option-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
  .askuser-option-recommended { display: inline-block; font-size: 9px; padding: 1px 6px; border-radius: 8px; font-weight: 700; background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.4px; }
  .askuser-freeform { width: 100%; padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; resize: vertical; margin-bottom: 10px; box-sizing: border-box; }
  .askuser-freeform:focus { border-color: var(--accent); }
  .askuser-actions { display: flex; gap: 8px; justify-content: flex-end; }
  .askuser-cancel-btn { padding: 7px 16px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-muted); }
  .askuser-cancel-btn:hover { background: var(--bg-hover); color: var(--text); }
  .askuser-submit-btn { padding: 7px 20px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: var(--accent); color: #fff; }
  .askuser-submit-btn:hover { opacity: 0.9; }
  .askuser-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ── Project Pills ── */
  .proj-bar { padding: 6px 8px 8px; border-bottom: 1px solid var(--border); }
  .proj-bar-title { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
  .proj-add { background: transparent; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 0 3px; line-height: 1; border-radius: 4px; }
  .proj-add:hover { color: var(--accent); background: var(--bg-hover); }
  .proj-pills { display: flex; flex-wrap: wrap; gap: 4px; }
  .proj-pill { display: flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; font-size: 11px; cursor: pointer; border: 1px solid var(--border); color: var(--text-muted); background: transparent; transition: all 0.12s; user-select: none; white-space: nowrap; }
  .proj-pill:hover { color: var(--text); }
  .proj-pill.drag-over { background: var(--accent-dim) !important; transform: scale(1.04); }
  .proj-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  /* ── Session drag ── */
  .drag-handle { color: var(--text-muted); opacity: 0; cursor: grab; font-size: 12px; padding-right: 3px; flex-shrink: 0; transition: opacity 0.1s; }
  .sidebar-item:hover .drag-handle { opacity: 0.6; }
  .sidebar-item.dragging { opacity: 0.35; }
  .sess-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-left: auto; }
  /* ── Live execution status (running / waiting for user) ── */
  .sess-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 0 currentColor; }
  .sess-status-active { background: #3b82f6; color: #3b82f6; animation: sess-status-pulse 1.6s ease-in-out infinite; }
  .sess-status-waiting { background: #f59e0b; color: #f59e0b; animation: sess-status-pulse 1.2s ease-in-out infinite; }
  @keyframes sess-status-pulse {
    0%   { box-shadow: 0 0 0 0    color-mix(in srgb, currentColor 70%, transparent); }
    70%  { box-shadow: 0 0 0 6px  color-mix(in srgb, currentColor 0%,  transparent); }
    100% { box-shadow: 0 0 0 0    color-mix(in srgb, currentColor 0%,  transparent); }
  }
  /* ── Responsive ── */
  #mobile-drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 101; }
  #mobile-drawer-backdrop.visible { display: block; }

  @media (max-width: 768px) {
    /* Safe area — keep input above Android nav bar */
    .input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

    /* Left sidebar drawer */
    .sidebar {
      display: flex;
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 102;
      transform: translateX(-100%);
      transition: transform 0.22s ease;
      width: min(82vw, 300px);
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 6px 0 30px rgba(0,0,0,0.5); }

    /* Right files-panel drawer */
    .files-panel {
      display: flex;
      position: fixed;
      inset: 0 0 0 auto;
      z-index: 102;
      transform: translateX(100%);
      transition: transform 0.22s ease;
      width: min(88vw, 320px);
    }
    .files-panel.hidden { display: flex; } /* don't let .hidden collapse it on mobile */
    /* Cancel .hidden's width:0/opacity:0 — visibility handled by transform instead */
    .files-panel.hidden { width: min(88vw, 320px); opacity: 1; overflow: auto; pointer-events: auto; border-left: 1px solid var(--border); }
    /* Hide header folder icon — files accessible via toolbar button instead */
    #files-toggle { display: none; }
    .files-panel.mobile-open { transform: translateX(0); box-shadow: -6px 0 30px rgba(0,0,0,0.5); }

    /* Mobile-only header buttons */
    .mob-header-files, .mob-header-sessions { display: inline-flex !important; }

    /* Bigger prompt area: wrap row so textarea spans full width */
    .input-row { flex-wrap: wrap; }
    .input-wrapper { flex: 1 1 100%; order: -1; }
    #msg-input { min-height: 80px; }

    .messages { padding: 12px; }
    .msg { max-width: 95%; }

    /* Files view: split becomes single-pane (list ↔ viewer) */
    .fview-split { flex-direction: column; }
    .fview-left { width: 100% !important; max-width: none; border-right: none; border-bottom: 1px solid var(--border); flex: 1 1 auto; }
    .fview-resize { display: none; }
    .fview-right { display: none; flex: 1 1 auto; }
    .fview-split.mobile-show-viewer .fview-left { display: none; }
    .fview-split.mobile-show-viewer .fview-right { display: flex; }
    .fvr-back-btn { display: inline-flex; }
  }

  /* ── Animations ── */
  .fade-in { animation: fadeIn 0.25s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .thinking-body::-webkit-scrollbar, .tool-args::-webkit-scrollbar, .tool-result-content::-webkit-scrollbar { width: 4px; }
  .thinking-body::-webkit-scrollbar-thumb, .tool-args::-webkit-scrollbar-thumb, .tool-result-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* ── Recent Projects (sidebar) ── */
  .recent-projects { padding: 2px 10px 6px 10px; }
  .recent-proj-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: 6px; cursor: pointer;
    font-size: 12px; color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
  }
  .recent-proj-item:hover { background: var(--bg-hover); color: var(--text); }
  .recent-proj-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
  .recent-proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
  .recent-proj-time { font-size: 10px; opacity: 0.55; white-space: nowrap; }

  /* ── Greeting welcome ── */
  .welcome-greeting { color: var(--accent); font-size: 15px; line-height: 1.5; margin-bottom: 2px; }
  .welcome-stats { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
  .welcome-stats span { margin-right: 12px; }

  /* ── Memory debug panel (overlay) ── */
  .memory-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.55); display: none;
    align-items: center; justify-content: center;
  }
  .memory-overlay.visible { display: flex; }
  .memory-panel {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 12px; width: min(680px, 92vw); max-height: 80vh;
    display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  }
  .memory-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
  }
  .memory-panel-header h3 { margin: 0; font-size: 15px; }
  .memory-panel-header .close-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 18px; padding: 2px 6px; border-radius: 4px;
  }
  .memory-panel-header .close-btn:hover { background: var(--bg-hover); color: var(--text); }
  .memory-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    padding: 0 18px;
  }
  .memory-tab {
    padding: 8px 16px; font-size: 12px; cursor: pointer;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    background: none; border-top: none; border-left: none; border-right: none;
    transition: color 0.15s, border-color 0.15s;
  }
  .memory-tab:hover { color: var(--text); }
  .memory-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .memory-panel-body {
    flex: 1; overflow-y: auto; padding: 14px 18px;
    font-size: 12px;
  }
  .memory-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 6px; margin-bottom: 4px;
    background: var(--bg); border: 1px solid var(--border);
  }
  .memory-item:hover { border-color: var(--accent); }
  .memory-item-content { flex: 1; min-width: 0; }
  .memory-item-key { font-weight: 600; color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
  .memory-item-value { color: var(--text); margin-top: 2px; word-break: break-word; }
  .memory-item-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
  .memory-item-del {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 4px;
    flex-shrink: 0; opacity: 0; transition: opacity 0.15s;
  }
  .memory-item:hover .memory-item-del { opacity: 1; }
  .memory-item-del:hover { color: var(--error, #ef4444); background: rgba(239,68,68,0.1); }
  .memory-empty { text-align: center; color: var(--text-muted); padding: 32px 0; }
  .memory-panel-footer {
    padding: 10px 18px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
  }
  .memory-panel-footer .mem-count { font-size: 11px; color: var(--text-muted); }
  .memory-wipe-btn {
    background: none; border: 1px solid var(--error, #ef4444); color: var(--error, #ef4444);
    padding: 4px 12px; border-radius: 6px; font-size: 11px; cursor: pointer;
    transition: background 0.15s;
  }
  .memory-wipe-btn:hover { background: rgba(239,68,68,0.12); }

  /* Header memory button */
  .btn-memory {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 3px 10px; border-radius: 6px; font-size: 11px; cursor: pointer;
    display: flex; align-items: center; gap: 4px; transition: all 0.15s;
  }
  .btn-memory:hover { border-color: var(--accent); color: var(--accent); }
  .btn-memory .mem-badge {
    background: var(--accent); color: #fff; border-radius: 8px;
    padding: 0 5px; font-size: 9px; font-weight: 700; min-width: 14px;
    text-align: center; line-height: 16px;
  }

  /* ── Workspace Indicator Bar ── */
  .ws-bar { display: flex; align-items: center; gap: 8px; padding: 5px 14px; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; min-height: 28px; }
  .ws-bar:empty { display: none; }
  .ws-bar .ws-icon { font-size: 13px; opacity: 0.7; }
  .ws-bar .ws-path { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text); cursor: pointer; }
  .ws-bar .ws-path:hover { color: var(--accent); }
  .ws-bar .ws-browse-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 2px 8px; border-radius: 4px; font-size: 10px; cursor: pointer; }
  .ws-bar .ws-browse-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* ── File Viewer Overlay ── */
  .file-viewer-overlay { position: fixed; inset: 0; z-index: 2500; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; }
  .file-viewer-overlay.visible { display: flex; }
  .file-viewer {
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    width: min(960px, 94vw); height: min(85vh, 760px);
    display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    overflow: hidden;
  }
  .fv-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
  .fv-header .fv-path { flex: 1; font-size: 12px; font-family: var(--font-mono, monospace); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fv-header .fv-lang { font-size: 10px; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 4px; }
  .fv-header .fv-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 3px 10px; border-radius: 4px; display: flex; align-items: center; gap: 4px; }
  .fv-header .fv-btn:hover { background: var(--bg-hover); color: var(--text); }
  .fv-header .fv-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 4px; }
  .fv-header .fv-close:hover { background: var(--bg-hover); color: var(--text); }
  /* Viewer tabs (Source / Preview) */
  .fv-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
  .fv-tab { padding: 6px 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; }
  .fv-tab:hover { color: var(--text); background: var(--bg-hover); }
  .fv-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .fv-body { flex: 1; overflow: auto; font-family: var(--font-mono, monospace); font-size: 12px; line-height: 1.6; position: relative; }
  .fv-line { display: flex; min-height: 19px; }
  .fv-line:hover { background: var(--bg-hover); }
  .fv-lineno { width: 50px; text-align: right; padding-right: 12px; color: var(--text-muted); opacity: 0.5; flex-shrink: 0; user-select: none; }
  .fv-code { flex: 1; white-space: pre; padding-right: 14px; color: var(--text); }
  .fv-line.added { background: rgba(34,197,94,0.08); color: #22c55e; }
  .fv-line.added .fv-code { color: #22c55e; }
  .fv-line.removed { background: rgba(239,68,68,0.08); color: #ef4444; }
  .fv-line.removed .fv-code { color: #ef4444; }
  /* Preview pane (HTML live preview, Markdown render) */
  .fv-preview { width: 100%; height: 100%; border: none; background: #fff; }
  .fv-md-preview { padding: 20px 28px; font-family: var(--font-sans, system-ui, sans-serif); font-size: 14px; line-height: 1.7; color: var(--text); overflow: auto; height: 100%; }
  .fv-md-preview h1,.fv-md-preview h2,.fv-md-preview h3 { margin: 1.2em 0 0.4em; color: var(--text); }
  .fv-md-preview h1 { font-size: 1.6em; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
  .fv-md-preview h2 { font-size: 1.3em; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
  .fv-md-preview h3 { font-size: 1.1em; }
  .fv-md-preview code { background: var(--bg-secondary); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
  .fv-md-preview pre { background: var(--bg-secondary); padding: 12px 16px; border-radius: 6px; overflow-x: auto; }
  .fv-md-preview pre code { background: none; padding: 0; }
  .fv-md-preview blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding: 4px 16px; color: var(--text-muted); }
  .fv-md-preview a { color: var(--accent); }
  .fv-md-preview table { border-collapse: collapse; width: 100%; margin: 10px 0; }
  .fv-md-preview th,.fv-md-preview td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; font-size: 13px; }
  .fv-md-preview th { background: var(--bg-secondary); font-weight: 600; }
  .fv-md-preview img { max-width: 100%; border-radius: 6px; }
  .fv-md-preview ul,.fv-md-preview ol { padding-left: 24px; }
  .fv-md-preview li { margin: 3px 0; }
  .fv-md-preview hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
  /* JSON tree viewer */
  .fv-json { padding: 14px 18px; font-family: var(--font-mono, monospace); font-size: 12px; line-height: 1.55; overflow: auto; height: 100%; }
  .fv-json .jk { color: #e06c75; } /* key */
  .fv-json .js { color: #98c379; } /* string */
  .fv-json .jn { color: #d19a66; } /* number */
  .fv-json .jb { color: #56b6c2; } /* bool/null */
  .fv-json .jp { color: var(--text-muted); } /* punctuation */
  .fv-json details { margin-left: 16px; }
  .fv-json summary { cursor: pointer; list-style: none; }
  .fv-json summary::-webkit-details-marker { display: none; }
  .fv-json summary::before { content: '▶ '; font-size: 9px; color: var(--text-muted); }
  .fv-json details[open]>summary::before { content: '▼ '; }
  .fv-json .jl { margin-left: 16px; }
  /* Image viewer */
  .fv-img-wrap { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 20px; background: repeating-conic-gradient(rgba(128,128,128,0.12) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px; }
  .fv-img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 4px; box-shadow: 0 2px 20px rgba(0,0,0,0.4); }
  .fv-img-pixel { image-rendering: pixelated; image-rendering: crisp-edges; width: auto; max-width: none; transform: scale(4); transform-origin: top center; margin: 48px auto; }
  /* Media viewer */
  .fv-media-wrap { display: flex; align-items: center; justify-content: center; height: 100%; padding: 20px; }
  .fv-media-wrap audio,.fv-media-wrap video { max-width: 100%; max-height: 100%; border-radius: 8px; }

  /* Highlighted source viewer (two-column layout: line-numbers | code) */
  .fv-source { display: flex; align-items: flex-start; min-height: 100%; overflow: auto; font-family: var(--font-mono, 'Consolas', 'Monaco', monospace); font-size: 12px; line-height: 1.6; }
  .fv-linenos { min-width: 44px; padding: 12px 10px 12px 6px; text-align: right; color: var(--text-muted); border-right: 1px solid var(--border); user-select: none; background: var(--bg); position: sticky; left: 0; margin: 0; white-space: pre; flex-shrink: 0; opacity: 0.6; }
  .fv-code-block { flex: 1; padding: 12px 16px; margin: 0; overflow: visible; white-space: pre; background: transparent !important; }
  .fv-code-block code { background: transparent !important; font-family: inherit; font-size: inherit; line-height: inherit; }
  /* Override hljs background to match our theme */
  .fvr-body .hljs { background: transparent !important; padding: 0; }

  /* Download-prompt for large/unsupported files */
  .fv-download-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; padding: 40px; text-align: center; }
  .fv-dp-icon { font-size: 48px; line-height: 1; }
  .fv-dp-title { font-size: 17px; font-weight: 600; color: var(--text); }
  .fv-dp-sub { color: var(--text-muted); font-size: 13px; max-width: 320px; line-height: 1.5; }
  .fv-dp-btn { margin-top: 8px; padding: 9px 22px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
  .fv-dp-btn:hover { opacity: 0.85; }

  /* Download button in the right-pane header */
  .fvr-dl-btn { padding: 3px 10px; font-size: 11px; font-weight: 500; background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; border-radius: 4px; flex-shrink: 0; transition: background 0.15s, color 0.15s; }
  .fvr-dl-btn:hover { background: var(--bg-hover); color: var(--text); }

  /* ── Changed files tab inside files panel ── */
  .changed-file { display: flex; align-items: center; gap: 8px; padding: 7px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 12px; }
  .changed-file:hover { background: var(--bg-hover); }
  .changed-file .cf-icon { font-size: 12px; flex-shrink: 0; }
  .changed-file .cf-path { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
  .changed-file .cf-stat { font-size: 10px; white-space: nowrap; }
  .cf-add { color: #22c55e; }
  .cf-del { color: #ef4444; }

  /* ── Activity bar (Todos + Files changed — above input) ── */
  .activity-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    margin: 0 4px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .abar-section { border-top: 1px solid var(--border); }
  .abar-section:first-child { border-top: none; }
  .abar-section-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    cursor: pointer;
    user-select: none;
    min-height: 28px;
  }
  .abar-section-header:hover { background: rgba(255,255,255,0.04); }
  .abar-chevron {
    font-size: 9px;
    color: var(--text-muted);
    transition: transform 0.18s;
    flex-shrink: 0;
    width: 10px;
    text-align: center;
  }
  .abar-chevron.collapsed { transform: rotate(-90deg); }
  .abar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .abar-section-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-left: 2px;
  }
  .abar-section-current {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-left: 6px;
    font-style: italic;
  }
  .abar-files-stats {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
  }
  .abar-section-body { overflow: hidden; }

  /* Todo items */
  .todo-list { max-height: 160px; overflow-y: auto; padding: 4px 10px 6px; }
  .todo-list::-webkit-scrollbar { width: 3px; }
  .todo-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .todo-item { display: flex; align-items: flex-start; gap: 7px; padding: 3px 2px; font-size: 12px; color: var(--text); border-radius: 4px; }
  .todo-check {
    width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--border);
    flex-shrink: 0; margin-top: 1px; display: flex; align-items: center;
    justify-content: center; font-size: 8px; font-weight: 700;
  }
  .todo-item.done .todo-check { background: var(--success, #22c55e); border-color: var(--success, #22c55e); color: #fff; }
  .todo-item.done .todo-text { text-decoration: line-through; opacity: 0.45; }
  .todo-item.in-progress .todo-check { border-color: var(--accent); color: var(--accent); font-size: 10px; }
  .todo-item.in-progress .todo-text { color: var(--text); font-weight: 500; }
  .todo-text { flex: 1; line-height: 1.35; }

  /* File items in activity bar */
  .abar-files-list-wrap { max-height: 140px; overflow-y: auto; }
  #abar-files-list { max-height: 140px; overflow-y: auto; padding: 3px 10px 6px; }
  #abar-files-list::-webkit-scrollbar { width: 3px; }
  #abar-files-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .abar-file-item {
    display: flex; align-items: center; gap: 6px; padding: 3px 2px;
    font-size: 12px; border-radius: 4px; cursor: pointer;
  }
  .abar-file-item:hover { background: var(--bg-hover); }
  .abar-file-icon {
    width: 14px; height: 14px; border-radius: 2px;
    font-size: 8px; font-weight: 800; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
  }
  .abar-file-icon.cf-add { background: rgba(34,197,94,0.2); color: #22c55e; }
  .abar-file-icon.cf-mod { background: rgba(var(--accent-rgb, 99,102,241),0.18); color: var(--accent); }
  .abar-file-icon.cf-del { background: rgba(239,68,68,0.18); color: #ef4444; }
  .abar-file-icon.cf-ren { background: rgba(251,191,36,0.18); color: #fbbf24; }
  .abar-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 12px; }
  .abar-file-dir { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .abar-file-action {
    font-size: 10px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; flex-shrink: 0;
  }
  .abar-file-action.cf-add { color: #22c55e; }
  .abar-file-action.cf-mod { color: var(--accent); }
  .abar-file-action.cf-del { color: #ef4444; }
  .abar-file-action.cf-ren { color: #fbbf24; }
  .abar-diff-stats { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; }
  .diff-add { color: #22c55e; font-size: 10px; font-weight: 700; }
  .diff-del { color: #ef4444; font-size: 10px; font-weight: 700; }

  /* ── Floating Todo Panel (legacy — hidden) ── */
  .todo-float { position: fixed; top: 56px; right: 16px; z-index: 1200; width: 280px; background: var(--bg-secondary, #1a1a2e); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.4); font-family: var(--font); overflow: hidden; }
  .todo-float-header { display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; user-select: none; border-bottom: 1px solid transparent; }
  .todo-float-header:hover { background: rgba(255,255,255,0.04); }
  .todo-float-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
  .todo-float-count { font-size: 11px; color: var(--accent); font-weight: 700; }
  .todo-float-chevron { margin-left: auto; font-size: 11px; color: var(--text-muted); transition: transform 0.2s; }
  .todo-float.collapsed .todo-float-chevron { transform: rotate(-90deg); }
  .todo-float.collapsed .todo-float-body { display: none; }
  .todo-float.collapsed .todo-float-header { border-bottom-color: transparent; }
  .todo-float-body { border-top: 1px solid var(--border); max-height: 260px; overflow-y: auto; padding: 6px 8px; }


  .fv-sheet-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
  .fv-sheet-tab { padding: 6px 14px; font-size: 11px; cursor: pointer; border: none; background: none; color: var(--text-muted); border-bottom: 2px solid transparent; }
  .fv-sheet-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--bg); }
  .fv-sheet-wrap { overflow: auto; height: calc(100% - 32px); padding: 10px; }
  .fv-sheet-wrap table { border-collapse: collapse; width: 100%; font-size: 12px; font-family: var(--font-mono, monospace); }
  .fv-sheet-wrap th { background: var(--bg-secondary); font-weight: 600; position: sticky; top: 0; z-index: 1; }
  .fv-sheet-wrap th,.fv-sheet-wrap td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; white-space: nowrap; }
  .fv-sheet-wrap tr:hover td { background: rgba(var(--accent-rgb, 99,102,241), 0.06); }
  /* DOCX viewer */
  .fv-docx-preview { padding: 24px 32px; font-family: var(--font-sans, system-ui, sans-serif); font-size: 14px; line-height: 1.7; color: var(--text); overflow: auto; height: 100%; }
  .fv-docx-preview img { max-width: 100%; }
  .fv-docx-preview table { border-collapse: collapse; width: 100%; margin: 10px 0; }

  /* ── Diff viewer slider ─────────────────────────────────────────── */
  .dv-slider-wrap {
    flex-shrink: 0;
    overflow-x: auto;
    padding: 8px 14px 6px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    scrollbar-width: thin;
  }
  .dv-slider-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: max-content;
    position: relative;
  }
  .dv-slider-track::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--border);
  }
  .dv-slider-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    cursor: pointer;
    position: relative;
    z-index: 1;
  }
  .dv-slider-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    transition: border-color 0.15s, background 0.15s;
  }
  /* dot type colours (inactive) */
  .dv-dot-create .dv-slider-dot  { border-color: #22c55e; }
  .dv-dot-edit .dv-slider-dot    { border-color: var(--accent); }
  .dv-dot-current .dv-slider-dot { border-color: var(--text); }
  /* active state fills the dot */
  .dv-slider-point.active .dv-slider-dot               { background: var(--accent); border-color: var(--accent); }
  .dv-dot-create.active  .dv-slider-dot                { background: #22c55e; border-color: #22c55e; }
  .dv-dot-current.active .dv-slider-dot                { background: var(--text); border-color: var(--text); }
  .dv-slider-point:hover .dv-slider-dot                { opacity: 0.8; }
  .dv-slider-label {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
  }
  /* label colours by type */
  .dv-dot-create  .dv-slider-label { color: #22c55e; }
  .dv-dot-current .dv-slider-label { color: var(--text); font-weight: 600; }
  /* active label */
  .dv-slider-point.active .dv-slider-label { font-weight: 700; }
  .dv-dot-create.active   .dv-slider-label { color: #22c55e; }
  .dv-dot-edit.active     .dv-slider-label { color: var(--accent); }
  .dv-dot-current.active  .dv-slider-label { color: var(--text); }
  /* second line-number column in diff rows */
  .fv-lineno.dv-ln2 { color: var(--text-muted); opacity: 0.7; }
