.chat-list-controls { padding: 0 12px 10px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.chats-sidebar .chat-list-controls { display: grid; gap: 8px; flex-shrink: 0; max-height: 48%; overflow-y: auto; }
.chat-list-views { display: flex; flex-wrap: wrap; gap: 6px; margin-inline: -2px; padding: 2px; }
.chat-list-views::-webkit-scrollbar { display: none; }
.chat-list-view { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.chat-list-view[hidden] { display: none; }
.chat-list-view .icon { width: 13px; height: 13px; }
.chat-list-view:hover { background: var(--row-hover); border-color: var(--border-hover); }
.chat-list-view[aria-pressed="true"] { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-text); }
.chat-list-view-count { flex: none; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 11px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.chat-list-view[aria-pressed="true"] .chat-list-view-count { background: var(--accent); color: #fff; }
.chat-list-view[data-chat-list-view="secret"] { color: var(--success); }
.chat-list-off { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.chat-list-off[hidden] { display: none; }
.chat-list-off > .icon { flex: none; width: 16px; height: 16px; color: var(--warning); }
.chat-list-off > span { flex: 1; min-width: 0; font-weight: 600; }
.chat-list-off > button { flex: none; min-height: 30px; }
.chats-sidebar-head { position: relative; }
.chats-sidebar-head #chats-manage { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: var(--accent); color: #fff; }
.chats-sidebar-head #chats-manage[hidden] { display: none; }
.chats-sidebar-head #chats-manage:hover { background: var(--accent-hover); }
.chats-sidebar-head #chats-manage[aria-expanded="true"] .icon { transform: rotate(45deg); }
.chats-sidebar-head #chats-manage .icon { width: 18px; height: 18px; transition: transform .15s; }
.chat-add-menu { position: absolute; inset-block-start: calc(100% - 4px); inset-inline-end: 12px; z-index: 40; display: grid; gap: 2px; min-width: 240px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.chat-add-menu[hidden] { display: none; }
.chat-add-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 14px; text-align: start; }
.chat-add-item .icon { flex: none; width: 18px; height: 18px; color: var(--muted); }
.chat-add-item:hover, .chat-add-item:focus-visible { background: var(--row-hover); outline: none; }
.chat-add-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.chats-sidebar .chat-open:not([open]) { display: none; }
.chats-sidebar .chat-open[open] { border-top: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chats-none { display: grid; justify-items: start; gap: 10px; padding: 16px; }
.chats-none.fresh { justify-items: center; padding: 40px 20px; text-align: center; }
.chats-none-mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.chats-none-mark .icon { width: 26px; height: 26px; }
.chats-none .hint { margin: 0; }
.chats-sidebar .chat-item.secret .chat-item-title { color: var(--success); }
.chat-item-lock { flex: none; width: 13px; height: 13px; margin-inline-end: 4px; vertical-align: -1px; }
.chat-choice .avatar.secret-face { background: var(--success-soft); color: var(--success); }
.chat-choice .avatar.secret-face .icon { width: 18px; height: 18px; }
.chats-sidebar .chat-item.secret.active .chat-item-title { color: #fff; }
.chat-list-active-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.chat-list-filter-chip { min-width: 0; max-width: 100%; min-height: 28px; padding: 3px 8px; border: 1px solid var(--accent-border); border-radius: var(--radius-small); background: var(--accent-soft); color: var(--accent-text); font-size: 11px; line-height: 16px; overflow-wrap: anywhere; text-align: start; }
.chat-list-results { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; color: var(--muted); font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums; }
.chat-list-results .text-link { min-height: 28px; padding: 0; font-size: inherit; }
.chat-list-more { display: block; width: calc(100% - 16px); min-height: 40px; margin: 8px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-2); color: var(--accent-text); font-size: 12px; }
.chat-list-more:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.chat-list-view:focus-visible, .chat-list-filter-chip:focus-visible, .chat-list-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat-list-active-filters[hidden], .chat-list-results[hidden] { display: none; }
.chat-list-sort { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.chat-list-sort select { min-width: 0; flex: 1; width: auto; min-height: 34px; font-size: 12px; }
.chat-list-filters summary { display: flex; align-items: center; gap: 6px; min-height: 32px; font-size: 12px; cursor: pointer; }
@media (max-width: 767px) { .chats-sidebar .chat-list-filters > summary { min-height: 40px; } }
.chat-list-filters summary .icon { width: 14px; height: 14px; }
.chat-list-filters summary.filtered { color: var(--accent-text); }
.chat-filter-count { min-width: 20px; padding-inline: 4px; border-radius: 10px; background: var(--accent-soft); text-align: center; }
.chat-list-filter-fields { display: grid; gap: 8px; padding: 4px 0; }
.chat-list-filter-fields label { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.chat-list-filter-fields select { min-height: 34px; min-width: 0; font-size: 12px; }
.chats-sidebar .chat-item { position: relative; padding: 0; gap: 0; align-items: stretch; }
.chat-choice { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; padding: 12px 8px; border: 0; background: none; color: inherit; text-align: start; }
.chat-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: inherit; }
.chat-choice-static { cursor: default; }
.chat-priority { flex: 0 0 28px; width: 28px; min-height: 36px; align-self: center; padding: 4px; margin-inline-end: 4px; border: 0; background: none; color: var(--muted); }
.chat-priority .icon { width: 15px; height: 15px; }
.chat-priority.on { color: var(--accent-text); }
.chat-priority.on .icon { fill: currentColor; }
.chat-item:has(.chat-priority) .chat-item-priority { display: none; }
.chat-auto { display: inline-flex; align-items: center; color: var(--muted); }
.chat-auto .icon, .chat-item-badges .pill .icon { width: 12px; height: 12px; }
.chat-item-badges .pill { gap: 4px; font-variant-numeric: tabular-nums; }
.chats-sidebar .chat-item-top { align-items: baseline; }
.chats-sidebar .chat-item-time { font-size: 12px; }
.chats-sidebar .chat-item-time:empty { display: none; }
.chats-sidebar .chat-item-bottom { align-items: center; }
.chats-sidebar .chat-item-preview { flex: 1; min-width: 0; }
.chats-sidebar .chat-item-badges { flex: none; flex-wrap: nowrap; gap: 2px; }
.chat-item-badges .pill-deleted { color: var(--danger); }
.chat-item-badges .pill-edited { color: var(--accent-text); }
.chat-item-badges .pill-missing { color: var(--warning); }
.chat-item-badges .pill.pill-state { padding: 0 6px; border: 1px solid var(--border-strong); font-size: 11px; }
.chat-item-status .pill.pill-blocked { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }
.chat-list-wait { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--warning-border); background: var(--warning-soft); color: var(--warning); font-size: 12px; }
.chat-item-status { display: flex; flex-wrap: wrap; gap: 3px 6px; margin-top: 4px; font-size: 11px; color: var(--text-2); }
.chat-item-status .pill { white-space: normal; overflow-wrap: anywhere; gap: 3px; }
.chat-item-status .icon { width: 12px; height: 12px; }
.chats-sidebar .chat-item.active .chat-item-status { color: #fff; }
.chat-item-priority { flex: none; width: 12px; height: 12px; margin-inline-end: auto; color: var(--accent-text); fill: currentColor; align-self: center; }
.chats-sidebar .chat-priority { position: absolute; inset-inline-end: 6px; top: 6px; min-height: 28px; height: 28px; margin: 0; border-radius: 8px; background: var(--surface-2); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .15s; }
.chats-sidebar .chat-item:hover .chat-priority, .chats-sidebar .chat-priority:focus-visible { opacity: 1; }
.chats-sidebar .chat-item:is(:hover, :focus-within) .chat-item-time { margin-inline-end: 32px; }
.workspace .chats-sidebar .chat-item.active, .workspace .chats-sidebar .chat-item.active:hover { background: var(--accent); border-color: var(--accent); }
.chats-sidebar .chat-item.active :is(.chat-item-title, .chat-item-preview, .chat-item-time, .chat-item-badges .pill, .chat-item-priority) { color: #fff; }
.chats-sidebar .chat-item.active :is(.chat-item-preview, .chat-item-time) { opacity: .92; }
.chats-sidebar .chat-item.active .chat-item-badges .pill.pill-state { border-color: rgba(255, 255, 255, .6); }
@media (hover: none) {
  .chats-sidebar .chat-item:is(:hover, :focus-within) .chat-item-time { margin-inline-end: 0; }
  .chats-sidebar .chat-priority { position: static; flex-basis: 44px; width: 44px; height: auto; min-height: 44px; background: none; box-shadow: none; opacity: 1; margin-inline-end: 0; }
  .chats-sidebar .chat-item.active .chat-priority { color: #fff; }
}
.chat-list-section { margin: 14px 12px 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.chat-list-searching { margin: 6px 12px; }
.chats-sidebar .chat-item-new .chat-watch { flex: none; align-self: center; height: 32px; min-height: 32px; margin-inline-end: 10px; padding: 0 14px; border-radius: 999px; font-size: 13px; }
.chats-sidebar .chat-item-global { flex-wrap: wrap; }
.chats-sidebar .chat-item-global .chat-choice { flex: 1 1 100%; padding-bottom: 6px; }
.chats-sidebar .chat-item-global :is(.chat-item-title, .chat-item-preview) { white-space: normal; overflow-wrap: anywhere; }
.chats-sidebar .chat-item-global .chat-watch { --indent: clamp(10px, calc(100% - 230px), 54px); align-self: flex-start; max-width: calc(100% - 10px - var(--indent)); height: auto; min-height: 30px; margin-block: 0 10px; margin-inline: var(--indent) 10px; padding: 5px 14px; line-height: 1.2; white-space: normal; overflow-wrap: break-word; text-align: start; }
.chat-search-link { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); min-height: 44px; margin: 8px; padding: 8px 12px; border: 1px dashed var(--accent-border); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; text-align: start; overflow-wrap: anywhere; }
.chat-search-link .icon { flex: none; width: 18px; height: 18px; }
.chat-search-link:focus-visible, .chat-item-new .chat-watch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat-picker-dialog { width: min(460px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: min(620px, calc(100dvh - 24px)); padding: 0; overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-large); }
.chat-picker-dialog[open] { display: flex; flex-direction: column; }
.chat-picker-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.chat-picker-head h2 { margin: 0; margin-inline-end: auto; font: var(--type-section); }
.chat-picker-dialog > input[type="search"] { margin: 0 16px 8px; width: auto; }
.chat-picker-status { margin: 4px 16px; }
.chat-picker-status:empty { display: none; }
.chat-picker-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
.chat-picker-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; text-align: start; }
.chat-picker-item:hover, .chat-picker-item:focus-visible { background: var(--row-hover); outline: none; }
.chat-picker-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.chat-picker-body { display: grid; min-width: 0; gap: 2px; }
.chat-picker-title { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chat-picker-kind { color: var(--muted); font-size: 12px; }
.forward-destination { display: grid; gap: 6px; }
.forward-destination[hidden] { display: none; }
.forward-choose { width: 100%; justify-content: flex-start; overflow: hidden; text-align: start; text-overflow: ellipsis; white-space: nowrap; }
.forward-choose.chosen { font-weight: 600; }
