/* Shared sidebar: required even before the Ask AI view opens. */
/* Recents list, ChatGPT-style sidebar quick-access. James 2026-05-05. */
/* Recents now sits BELOW the section nav, so add a top
   border + breathing room to visually separate it from
   the Reminders nav link above. James 2026-05-06. */
.dt2-recents-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--study-text-tertiary); padding: 10px 18px 6px; margin-top: 10px; }   /* the 6% hairline above Recents was too faint to read as a divider and just looked like a smudge; gone. James 2026-09-11. */
.dt2-recents-list { display: flex; flex-direction: column; gap: 1px; padding: 0 8px 8px; margin-bottom: 0; border-bottom: none; }
.dt2-recents-row { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s, color 0.12s; min-width: 0; }
.dt2-recents-row:hover { background: color-mix(in srgb, var(--study-text, #000) 4%, transparent); }
.dt2-recents-row.active { background: color-mix(in srgb, var(--study-text, #000) 7%, transparent); }
.dt2-recents-row-title { flex: 1; font-size: 13px; color: var(--study-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dt2-recents-row.active .dt2-recents-row-title { font-weight: 600; }
/* Renaming a chat (double-click its name, _startRename in study-deeptutor.js):
   the name turns into a field in place. The ids outrank the light theme's
   dressing of every field as a grey pill with an orange focus ring. */
#navKhioAI .dt2-recents-rename,
#navKhioAI .dt2-recents-rename:focus { flex: 1; min-width: 0; height: 26px; margin: 0 -6px; padding: 0 6px !important; font: inherit !important; font-size: 13px !important; color: var(--study-text) !important; background: var(--study-bg, #fff) !important; border: 1px solid var(--study-border) !important; border-radius: 6px !important; box-shadow: 0 0 0 3px rgba(10, 132, 255, .14) !important; outline: none !important; }
/* The desktop panel's titles are 14.5px (study-rail.css); the field matches. */
body.khio-desktop .study-layout.khio-ai-nav-on:not(.detail-active) #navKhioAI .dt2-recents-rename { font-size: 14.5px !important; }
.dt2-chat-actions { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; flex: 0 0 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--study-text-secondary, #6b6b68); cursor: pointer; transition: background .12s, color .12s; }
/* Rows used to be 46px tall: 7px padding around a 32px actions button. The
   button is now 26px and the padding 4px, so a row is 34px and the list reads
   as a list of chats rather than a stack of pills. James 2026-09-11. */
.dt2-chat-actions:hover, .dt2-chat-actions[aria-expanded="true"] { background: color-mix(in srgb, var(--study-text, #000) 9%, transparent); color: var(--study-text, #1a1a1a); }
.dt2-chat-actions:focus-visible, .dt2-chat-actions-menu button:focus-visible { outline: 2px solid var(--study-accent, #b96a42); outline-offset: 2px; }
/* Sidebar Recents read as plain chat titles: the ⋯ trigger only
   appears once you reach for the row (hover), tab to it, or while
   its menu is open — otherwise every row carries a dot cluster.
   opacity, not display, so the title never reflows on hover, and
   the button stays focusable for keyboard users. Guarded by
   (hover: hover) because a touch device would hide it forever;
   the mobile drawer rows (.dt2-mdrawer-row) are untouched either
   way. James 2026-09-10. */
@media (hover: hover) and (pointer: fine) {
    .dt2-recents-row .dt2-chat-actions { opacity: 0; transition: opacity .12s, background .12s, color .12s; }
    .dt2-recents-row:hover .dt2-chat-actions,
    .dt2-recents-row:focus-within .dt2-chat-actions,
    .dt2-recents-row .dt2-chat-actions[aria-expanded="true"] { opacity: 1; }
}
.dt2-chat-pin { display: inline-flex; align-items: center; color: var(--study-accent, #b96a42); flex: 0 0 auto; }
.dt2-chat-pin svg { width: 14px; height: 14px; }
.dt2-chat-actions-menu { position: fixed; z-index: 1000200; box-sizing: border-box; width: 224px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid rgba(0,0,0,.09); border-radius: 14px; background: #fff; color: #22221f; box-shadow: 0 12px 36px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06); font-family: 'Inter', sans-serif; animation: dt2ChatMenuIn .12s ease-out; }
.dt2-chat-actions-heading { padding: 8px 10px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: #73736e; }
.dt2-chat-actions-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font: 500 14px/1.4 'Inter', sans-serif; cursor: pointer; transition: background .12s; }
.dt2-chat-actions-menu button:hover, .dt2-chat-actions-menu button:focus-visible { background: #f3f3ef; }
.dt2-chat-actions-menu button.is-destructive { color: #b42318; }
.dt2-chat-actions-menu button.is-destructive:hover, .dt2-chat-actions-menu button.is-destructive:focus-visible { background: #fff0ee; }
.dt2-chat-actions-divider { height: 1px; background: rgba(0,0,0,.07); margin: 4px 6px; }
html[data-theme="dark"] .dt2-chat-actions-menu { background: #252523; color: #f2f2ed; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .dt2-chat-actions { color: #b9b9ae; }
html[data-theme="dark"] .dt2-chat-actions:hover, html[data-theme="dark"] .dt2-chat-actions[aria-expanded="true"] { background: rgba(255,255,255,.09); color: #f2f2ed; }
html[data-theme="dark"] .dt2-chat-actions-heading { color: #a8a8a1; }
html[data-theme="dark"] .dt2-chat-actions-menu button:hover, html[data-theme="dark"] .dt2-chat-actions-menu button:focus-visible { background: #363632; }
html[data-theme="dark"] .dt2-chat-actions-menu button.is-destructive { color: #ff9b90; }
html[data-theme="dark"] .dt2-chat-actions-menu button.is-destructive:hover { background: #482d29; }
html[data-theme="dark"] .dt2-chat-actions-divider { background: rgba(255,255,255,.1); }
.dt2-mdrawer-row .dt2-chat-actions { width: 44px; height: 44px; flex-basis: 44px; margin-right: -6px; }
.dt2-mdrawer-row .dt2-chat-pin { margin-left: 8px; }
@keyframes dt2ChatMenuIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .dt2-chat-actions-menu { animation: none; } }
/* Condensed-sidebar mode, only PINNED recents render, as
   icon-only pills (single pin glyph). Unpinned rows hide so
   the rail doesn't stack 5 identical pin icons, and the
   "Recents" header collapses to just a thin divider. The
   full title still shows in the row's title="…" tooltip
   on hover so users can identify each pinned chat.
   James 2026-05-12. */
.study-layout.sidebar-collapsed .dt2-recents-head {
    font-size: 0; padding: 8px 0 0; margin-top: 8px;
}
.study-layout.sidebar-collapsed .dt2-recents-list {
    padding: 4px 6px 8px; gap: 4px; align-items: center;
}
.study-layout.sidebar-collapsed .dt2-recents-row { display: none; }
.study-layout.sidebar-collapsed .dt2-recents-row.is-locked {
    display: flex; justify-content: center; gap: 0;
    padding: 8px 6px; width: 100%;
}
.study-layout.sidebar-collapsed .dt2-recents-row-title,
.study-layout.sidebar-collapsed .dt2-chat-actions {
    display: none !important;
}
