/* 對話紀錄 rows under 新任務. Load order matters: later files override earlier ones. */
/* ==========================================================================
   對話紀錄 (chat-history.js): text-only rows under 新任務, ⋯ overflow menu, search box.
   ========================================================================== */
.layout .sidebar nav .chat-history { margin:4px 0 14px; padding:0 0 0 6px; }
.chat-history .history-head { display:flex; align-items:center; justify-content:space-between; padding:6px 10px 4px 22px; }
.chat-history .history-label { font-size:12px; font-weight:600; letter-spacing:.02em; color:var(--fg-muted); }
.chat-history .history-search { display:block; margin:2px 0 6px 18px; font-size:12px; }
.chat-history .history-search input { width:100%; min-height:30px; padding:4px 10px; font-size:13px; border:1px solid var(--fg-line); border-radius:8px; background:var(--fg-surface); color:var(--fg-text); }
.chat-history .history-body { max-height:min(36vh, 320px); overflow-y:auto; overscroll-behavior:contain; }
.chat-history .history-list { list-style:none; margin:0; padding:0 0 0 12px; }
.chat-history .history-row { position:relative; display:flex; align-items:center; gap:2px; border-radius:8px; }
.chat-history .history-row:hover, .chat-history .history-row.active, .chat-history .history-row:focus-within { background:var(--fg-soft); }
.layout .sidebar nav .chat-history .history-open { flex:1 1 auto; display:block; width:auto; min-width:0; margin:0; padding:6px 4px 6px 10px; font-size:13px; line-height:1.35; color:var(--fg-text); background:transparent; border:0; border-radius:8px; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.layout .sidebar nav .chat-history .history-open:hover { background:transparent; }
.layout .sidebar nav .chat-history .history-row.active .history-open { font-weight:600; }
.layout .sidebar nav .chat-history .history-more { flex:none; display:grid; place-items:center; width:28px; height:28px; margin:0 2px 0 0; padding:0; font-size:16px; line-height:1; color:var(--fg-muted); background:transparent; border:0; border-radius:6px; opacity:1; }
.chat-history .history-row:hover .history-more, .chat-history .history-row:focus-within .history-more, .chat-history .history-row.active .history-more, .chat-history .history-more:focus-visible, .chat-history .history-more[aria-expanded="true"] { color:var(--fg-text); }
.layout .sidebar nav .chat-history .history-more:hover { color:var(--fg-text); background:var(--fg-line); }
.chat-history .history-pop { top:calc(100% - 2px); right:0; min-width:140px; padding:6px; border-radius:12px; }
.chat-history .history-pop.up { top:auto; bottom:calc(100% - 2px); }
.layout .sidebar nav .chat-history .history-pop .pop-item { display:flex; margin:0; padding:8px 10px; font-size:13px; }
.layout .sidebar nav .chat-history .history-pop .pop-item.danger { color:var(--fg-danger); }
.chat-history .history-empty, .chat-history .history-note { margin:4px 10px 6px 22px; font-size:12px; color:var(--fg-muted); }
.layout .sidebar nav .chat-history .history-retry, .layout .sidebar nav .chat-history .history-more-list { display:block; width:auto; margin:2px 0 6px 22px; padding:4px 8px; font-size:12px; color:var(--cf-cyan-dark, #007d99); background:transparent; border:0; }
body.dark .layout .sidebar nav .chat-history .history-retry, body.dark .layout .sidebar nav .chat-history .history-more-list { color:var(--fg-accent); }
.history-home-note { margin:10px 4px 0; font-size:12.5px; }
.settings-sub { margin:20px 0 4px; font-size:15px; }
@media (max-width: 700px) {
  .chat-history .history-body { max-height:none; overflow:visible; }
  .layout .sidebar nav .chat-history .history-open { flex:1 1 0; padding:9px 4px 9px 10px; font-size:14px; }
  .layout .sidebar nav .chat-history .history-more { width:36px; height:36px; }
}

