.sidebar-conversations {flex:1; min-height:0; overflow-y:auto;}
.ws-sidebar .sidebar-conversations .threads-list {flex:initial; overflow:visible;}
.sidebar-conversations > .team-list-heading,
.threads-sheet-body > .team-list-heading {margin:12px 20px;}
.team-thread-list:not([hidden]) + .team-list-heading {padding-top:20px; border-top:1px solid var(--kilby-border);}
.team-thread-list {padding: 0 12px 12px;}
.team-thread-list[hidden], .team-chat[hidden] {display:none;}
.viewing-team-chat .delete-thread-btn,
.viewing-team-chat [onclick="_kebabAction('delete')"],
.viewing-team-chat [onclick="_kebabAction('share')"] {display:none;}
.viewing-team-chat #threadsList .thread-item.active {background:transparent;}
.team-list-heading {font-size:16px; line-height:1.4; font-weight:700; color:var(--kilby-white); margin:18px 8px 12px;}
.threads-sheet-body .team-thread-list {padding:0 0 12px;}
.threads-sheet-body .team-list-heading {margin-left:14px; margin-right:14px;}
.team-thread-list .thread-item {position:relative; display:block; width:100%; text-align:left; padding:10px;}
.team-thread-list .title, .team-thread-list .meta {display:block; padding-right:25px;}
/* Every count badge is one shape (owner, 2026-10-07: "those 2 pills and the click and drag messages counter should
   each be pefect circles of the same blue color"): a 20px circle for 1 to 9, widening only for 10 and up. */
.team-unread, .drag-bundle .drag-count {box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--kilby-blue); color:white; font-family:'DM Sans', sans-serif; font-size:11px; font-weight:600; line-height:1;}
.team-unread {position:absolute; right:8px; top:12px;}
.team-empty {color:var(--kilby-faint); font-size:12px; margin:8px;}
/* Collapsible sidebar sections (owner, 2026-09-30): the heading is a toggle with an arrow. */
button.section-toggle {display:flex; align-items:center; gap:8px; width:calc(100% - 16px); box-sizing:border-box; padding:6px 8px; margin-left:8px; margin-right:8px; background:none; border:none; border-radius:8px; color:var(--kilby-white); font:inherit; font-size:16px; font-weight:700; text-align:left; cursor:pointer;}
.sidebar-conversations > button.section-toggle, .threads-sheet-body > button.section-toggle {width:calc(100% - 40px); margin-left:20px; margin-right:20px;}
button.section-toggle:hover {background:var(--kilby-panel);}
.section-chevron {width:16px; height:16px; flex:none; color:var(--kilby-secondary); transition:transform .15s;}
button.section-toggle.closed .section-chevron {transform:rotate(-90deg);}
.section-label {flex:1;}
.section-unread {background:var(--kilby-blue); color:var(--kilby-on-accent); border-radius:999px; font-size:11px; font-weight:600; padding:1px 7px;}
.threads-list[hidden] {display:none !important;}
/* Keep the divider above Your Chats as a line, not a border on the button. */
.team-thread-list:not([hidden]) + button.section-toggle {border-top:none; padding-top:6px; margin-top:22px; position:relative;}
.team-thread-list:not([hidden]) + button.section-toggle::before {content:''; position:absolute; left:0; right:0; top:-11px; border-top:1px solid var(--kilby-border);}
@media (prefers-reduced-motion: reduce) {.section-chevron {transition:none;}}
/* Kilby messaging (issue #297): a Messages list above Shared, one row per colleague and team. */
.message-new {display:flex; align-items:center; gap:8px; width:100%; margin:0 0 8px; padding:9px 10px; background:transparent; color:var(--kilby-white); border:1px solid var(--kilby-border); border-radius:10px; font:inherit; font-size:14px; cursor:pointer;}
.message-new:hover {border-color:var(--kilby-border);}
.message-new svg {width:16px; height:16px;}
.team-thread-list .thread-item.message-row {display:flex; align-items:center; gap:10px;}
.message-row .message-who {min-width:0; flex:1;}
.message-row .title, .message-row .meta {white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.message-avatar {width:30px; height:30px; flex:none; border-radius:50%; display:inline-grid; place-items:center; background:#2f5d8a; color:var(--kilby-on-accent); font-size:11px; font-weight:700;}
/* The team tile is gray, not a color, so its initials take the main text color: white in
   dark (as before), near-black in light, where white on the light grey could not be read (#365). */
.message-avatar.team {border-radius:8px; background:var(--kilby-border); color:var(--kilby-white);}
/* A quote from a Kilby response inside a message. */
.message-quote {margin:8px 0 0; padding:10px 12px; border-left:3px solid var(--kilby-link); background:var(--kilby-panel); border-radius:0 10px 10px 0; color:var(--kilby-white);}
.message-quote-text {display:block; white-space:pre-wrap;}
.message-quote-source {display:block; margin-top:6px; color:var(--kilby-link); font-size:12px;}
.message-quote-open {margin-top:6px; padding:0; background:none; border:none; color:var(--kilby-link); font:inherit; font-size:13px; cursor:pointer;}
.message-quote-open:hover {text-decoration:underline;}
.message-quoted-body {max-height:65vh; overflow:auto; margin-top:12px;}
/* The bar beside selected text in a Kilby response: Share excerpt */
.message-selection-bar {position:fixed; z-index:60; display:flex; gap:4px; padding:4px; background:var(--kilby-panel); border:1px solid var(--kilby-border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.5);}
.message-selection-bar[hidden] {display:none;}
.message-selection-bar button {font:inherit; font-size:13px; color:var(--kilby-white); background:none; border:none; padding:6px 10px; border-radius:7px; cursor:pointer;}
.message-selection-bar button:hover {background:var(--kilby-border);}
.message-selection-bar button.primary {background:var(--kilby-blue); color:var(--kilby-on-accent); font-weight:600;}
/* The Send dialog. */
.message-field-label {font-size:13px; color:var(--kilby-secondary); margin:4px 2px 6px;}
.message-to {display:flex; flex-wrap:wrap; gap:6px; align-items:center; border:1px solid var(--kilby-border); border-radius:10px; padding:7px 10px; background:var(--kilby-panel);}
.message-to input {flex:1; min-width:140px; background:none; border:none; color:var(--kilby-white); font:inherit; font-size:14px; outline:none;}
.message-to input[hidden] {display:none;}
.message-to .chip {display:inline-flex; align-items:center; gap:7px; background:var(--kilby-border); border-radius:999px; padding:3px 4px 3px 3px; font-size:13.5px; color:var(--kilby-white);}
.message-to .chip .message-avatar {width:22px; height:22px; font-size:10px;}
.message-to .chip .remove {background:none; border:none; color:var(--kilby-secondary); font-size:16px; cursor:pointer; padding:0 4px;}
.message-to-results {border:1px solid var(--kilby-border); border-radius:10px; margin-top:6px; background:var(--kilby-panel); overflow:hidden;}
.message-to-results[hidden] {display:none;}
.message-to-option {display:flex; align-items:center; gap:10px; width:100%; padding:8px 12px; background:none; border:none; color:var(--kilby-white); font:inherit; font-size:14px; text-align:left; cursor:pointer;}
.message-to-option + .message-to-option {border-top:1px solid var(--kilby-border);}
.message-to-option:hover, .message-to-option:focus {background:var(--kilby-border); outline:none;}
.message-to-option .message-avatar {width:26px; height:26px; font-size:10px;}
.message-to-option .detail {margin-left:auto; color:var(--kilby-faint); font-size:12.5px;}
.message-composer .message-quote {margin:14px 0 0;}
.message-composer .share-note-input {margin-top:14px;}
/* Unread messages on the sidebar button, for a closed sidebar or a phone. */
.threads-btn.has-unread {position:relative;} /* #sidebarToggle is already positioned */
.message-composer button.share-primary {width:100%; background:var(--kilby-blue); color:var(--kilby-on-accent); border:none; border-radius:999px; padding:12px; font-weight:600;}
.message-composer button.share-primary:disabled {background:var(--kilby-border); color:var(--kilby-link);}
#sidebarToggle.has-unread::after, .threads-btn.has-unread::after {content:attr(data-unread); position:absolute; top:-4px; right:-8px; min-width:16px; height:16px; padding:0 4px; box-sizing:border-box; border-radius:999px; background:var(--kilby-blue); color:var(--kilby-on-accent); font-size:10px; font-weight:700; line-height:16px; text-align:center;}
.ws-chat.has-team-chat > :not(.team-chat):not(.composer) {display:none !important;}
.ws-chat.has-team-chat > .composer {order:2; width:100%; max-width:820px; box-sizing:border-box; margin:0 auto; padding:0 24px 12px;}
.has-team-chat .attachment-strip,
.has-team-chat .composer-intent-strip, .has-team-chat .composer-instruction,
.has-team-chat .composer-examples {display:none !important;}
.team-prompt-note {display:none;}
.has-team-chat .team-prompt-note {display:block; color:var(--kilby-secondary); font-size:12px; margin-top:8px;}
.team-upload-strip,.team-prompt-error {display:none;}
.has-team-chat .team-upload-strip {display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px;}
.has-team-chat .team-prompt-error {display:block;color:var(--kilby-red);font-size:13px;margin:8px 0;}
.has-team-chat .team-prompt-error:empty {display:none;}
.team-upload-chip {display:inline-flex;align-items:center;gap:8px;background:var(--kilby-panel);border:1px solid var(--kilby-border);border-radius:8px;padding:6px 10px;font-size:12px;}
.team-upload-chip button {background:none;border:0;color:var(--kilby-white);cursor:pointer;font-size:18px;}
.ws-chat.has-team-chat {justify-content:stretch;}
.team-chat {display:flex; flex:1; min-height:0; width:100%; max-width:820px; margin:0 auto; flex-direction:column; padding:16px 24px; box-sizing:border-box; text-align:left;}
.team-chat-head {padding:8px 0 14px; border-bottom:1px solid var(--kilby-border);}
.team-chat-head h1 {font-size:20px; line-height:1.4; margin:0 0 5px; overflow-wrap:anywhere;}
.team-chat-head p, .team-note {color:var(--kilby-secondary); font-size:12px; line-height:1.5; margin:0;}
.team-add-people {margin-top:10px; font:inherit; font-size:12.5px; color:var(--kilby-white); background:var(--kilby-panel); border:1px solid var(--kilby-border); border-radius:8px; padding:5px 12px; cursor:pointer;}
.team-add-people[hidden] {display:none;}
.team-add-people:hover {background:var(--kilby-panel);}
/* "Jonathan Maietta added Marcus Reid" */
.team-event {text-align:center; color:var(--kilby-secondary); font-size:12px; margin:12px 0;}
.team-documents {display:flex; flex-wrap:wrap; gap:8px; padding:10px 0;}
.team-document {color:var(--kilby-link); font-size:12px; text-decoration:none; border:1px solid var(--kilby-border); border-radius:8px; padding:7px 10px; overflow-wrap:anywhere;}
.team-document-library {flex-shrink:0;max-height:25vh;overflow:auto;}
.team-document-library summary {color:var(--kilby-secondary);font-size:12px;cursor:pointer;padding:10px 0;}
button.team-document {background:var(--kilby-panel);cursor:pointer;text-align:left;font-family:inherit;}
.team-messages {flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding:8px 8px 20px 0;}
.team-message {padding:16px 0; border-bottom:1px solid var(--kilby-border); overflow-wrap:anywhere;}
.team-message.comment, .team-message.message {padding:14px 16px; background:var(--kilby-panel); border:1px solid var(--kilby-border); border-radius:12px; margin:10px 0;}
.team-message-meta {display:flex; flex-wrap:wrap; gap:8px 12px; align-items:baseline; font-size:12px; color:var(--kilby-secondary); margin-bottom:8px;}
.team-message-meta strong {font-size:14px; color:var(--kilby-white);}
.team-message-meta time {font-size:11px; margin-left:auto;}
.team-message-kind {color:var(--kilby-link);}
.team-message-body {font-size:15px; line-height:1.65;}
.team-message-body.msg.bot {width:100%; max-width:100%; box-sizing:border-box; padding:0; margin:0;}
.team-message-body > .kilby-card {max-width:100%; box-sizing:border-box;}
.team-message-body p {margin:0 0 12px;}
.team-message-body p:first-child {margin-top:0;}
.team-message-body p:last-child {margin-bottom:0;}
.team-message-body pre {overflow:auto; max-width:100%;}
.team-sources {display:flex; gap:8px; flex-wrap:wrap; font-size:12px; margin-top:8px;}
.team-sources a, .team-message-body a {color:var(--kilby-link);}
.team-composer {flex-shrink:0; border:1px solid var(--kilby-border); border-radius:16px; padding:12px; background:var(--kilby-panel); margin-top:12px;}
.team-comment-label {display:block; font-size:12px; font-weight:600; margin-bottom:6px; color:var(--kilby-secondary);}
.team-older {font:inherit; font-size:12px; border:1px solid transparent; border-radius:8px; color:var(--kilby-secondary); background:transparent; padding:7px 12px; cursor:pointer;}
.team-composer textarea {display:block; resize:vertical; width:100%; min-height:28px; max-height:100px; border:0; background:transparent; color:var(--kilby-white); font:inherit; font-size:14px; line-height:1.5; box-sizing:border-box; padding:4px;}
.team-composer-footer {display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:10px;}
.team-send {background:var(--kilby-blue); color:var(--kilby-on-accent); border:0; border-radius:9px; padding:10px 16px; font:inherit; font-size:13px; cursor:pointer; flex-shrink:0;}
.team-send:disabled {opacity:.5; cursor:default;}
.team-chat button:focus-visible, .team-chat a:focus-visible, .team-chat textarea:focus-visible {outline:2px solid var(--kilby-blue); outline-offset:3px;}
.share-audience {display:flex; flex-wrap:wrap; gap:5px; border:1px solid var(--kilby-border); border-radius:10px; padding:4px; margin:0 0 18px;}
.share-audience[hidden] {display:none;}
.share-dialog .share-audience button {flex:1; background:transparent; border:0; font-size:14px; padding:9px 10px; color:var(--kilby-secondary);}
.share-dialog .share-audience button[aria-pressed=true] {background:var(--kilby-border); color:var(--kilby-white);}
.share-dialog .share-audience button:focus-visible {outline:2px solid var(--kilby-white); outline-offset:1px;}
/* "Share with": the To label, icons on the three choices, and the team picker. */
.share-audience-label {font-size:13px; font-weight:600; color:var(--kilby-white); margin:0 0 8px 2px;}
.share-audience-label[hidden] {display:none;}
.share-dialog .share-audience button {display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap;}
.share-audience-icon {display:inline-flex; width:16px; height:16px; flex:none;}
.share-audience-icon svg {width:16px; height:16px;}
.share-team-pick {display:block; margin:-6px 0 18px;}
.share-team-pick[hidden] {display:none;}
.share-team-pick span {display:block; font-size:12.5px; color:var(--kilby-faint); margin:0 0 6px 2px;}
.share-team-pick select {width:100%; box-sizing:border-box; background:var(--kilby-panel); color:var(--kilby-white); border:1px solid var(--kilby-border); border-radius:10px; padding:10px 12px; font:inherit; font-size:14px;}
/* Phones: each choice sizes to its text so none wraps onto several lines. */
@media(max-width:600px) {.share-dialog .share-audience {gap:3px;} .share-dialog .share-audience button {flex:1 1 auto; font-size:12.5px; padding:9px 6px; gap:5px;} .share-audience-icon, .share-audience-icon svg {width:14px; height:14px;}}
.share-copy-circle[hidden] {display:none;}
/* One-to-one sharing: the People picker under the audience toggle. */
.share-people {margin:0 0 18px;}
.share-people[hidden] {display:none;}
.share-people-field {display:flex; flex-wrap:wrap; gap:6px; align-items:center; border:1px solid var(--kilby-border); border-radius:10px; padding:7px 9px; background:var(--kilby-panel);}
.share-people-field input {flex:1 1 140px; min-width:0; background:transparent; border:0; color:var(--kilby-white); font:inherit; font-size:14px; padding:4px 2px; outline:none;}
/* A chosen person must stand out from the search field: accent chip, initials. */
.share-person-chip {display:inline-flex; align-items:center; gap:7px; background:rgba(37,99,235,.22); border:1px solid var(--kilby-blue); color:var(--kilby-white); border-radius:999px; padding:2px 3px 2px 3px; font-size:13.5px; font-weight:500;}
.share-dialog .share-person-chip button {background:transparent; border:0; color:var(--kilby-link); padding:0 7px; font-size:15px; line-height:1;}
.share-dialog .share-person-chip button:hover {color:var(--kilby-white);}
.share-person-avatar {display:inline-grid; place-items:center; flex:none; width:28px; height:28px; border-radius:50%; background:var(--kilby-blue); color:var(--kilby-on-accent); font-size:11px; font-weight:700; letter-spacing:.02em;}
.share-person-chip .share-person-avatar {width:22px; height:22px; font-size:10px;}
.share-person-text {display:flex; flex-direction:column; min-width:0;}
.share-person-name {color:var(--kilby-white); font-size:14px;}
.share-person-dept {color:var(--kilby-secondary); font-size:12.5px;}
.share-people-results {margin-top:6px; max-height:196px; overflow:auto; border:1px solid var(--kilby-border); border-radius:10px; background:var(--kilby-panel);}
.share-people-results:empty, .share-people-results[hidden], .share-people-hint[hidden] {display:none;}
.share-dialog .share-people-results button.share-person {display:flex; align-items:center; justify-content:flex-start; gap:11px; width:100%; text-align:left; background:transparent; border:0; border-radius:0; color:var(--kilby-white); font-size:14px; padding:9px 12px;}
.share-dialog .share-people-results button.share-person + button.share-person {border-top:1px solid var(--kilby-border);}
.share-dialog .share-people-results button.share-person:hover, .share-dialog .share-people-results button.share-person:focus-visible {background:var(--kilby-border);}
.share-people-empty {margin:0; padding:10px 12px; font-size:13px; color:var(--kilby-faint);}
.share-people-hint {margin:8px 2px 0; font-size:12.5px; color:var(--kilby-faint);}
@media(max-width:700px) {
  .team-chat {padding:8px 14px max(16px,env(safe-area-inset-bottom));}
  .ws-chat.has-team-chat > .composer {padding:0 14px max(12px,env(safe-area-inset-bottom));}
  .team-chat-head h1 {font-size:17px;}
  .team-composer-footer {align-items:flex-end; gap:8px;}
  .team-note {font-size:11px;}
  .team-message-meta time {width:100%; margin-left:0;}
}
/* The phone Chats sheet (owner, 2026-10-06: "sidebar can use poilishing on mobile"): one left edge
   for the Shared links icon and every heading's arrow, chats aligned under their heading's text, and
   even spacing. Words, fonts and colors unchanged. The sheet only exists on phones. */
.threads-sheet .sidebar-library {padding:0 12px 4px;}
.threads-sheet .sidebar-library button {padding:12px 8px;}
.threads-sheet-body {padding:0 12px 14px;}
.threads-sheet-body .team-thread-list {padding:0;}
.threads-sheet-body button.section-toggle,
.threads-sheet-body > button.section-toggle {width:100%; margin:2px 0; padding:12px 8px;}
.threads-sheet-body .team-thread-list:not([hidden]) + button.section-toggle {margin-top:13px;}
.threads-sheet-body .team-thread-list:not([hidden]) + button.section-toggle::before {top:-7px;}
.threads-sheet-body .thread-item, .threads-sheet-body .team-thread-list .thread-item {padding:10px 8px 10px 32px;}
.threads-sheet-body .message-new {margin-left:24px; width:calc(100% - 24px); box-sizing:border-box;}
/* The chat list (owner, 2026-10-07, for Savant; mockup docs/sidebar-full-mockup/): Shared links as an
   ordinary row, Messages as before, then folders and one list of chats, one line each. On the desktop
   sidebar (260px) every block is inset 10px and every row pads 10px, so each icon, arrow, avatar and
   title starts 20px from the edge, and every row's hover spans the same width. No title above it since
   2026-10-25: New chat and Search are the first rows. */
.ws-sidebar .sidebar-library {padding:10px 10px 0;}
.sidebar-library button {font-size:13px; color:var(--kilby-list-title, var(--kilby-secondary));}
.sidebar-library button svg {width:16px; height:16px; flex:none; color:var(--kilby-secondary);}
.ws-sidebar .sidebar-library button {padding:8px 10px;}
.ws-sidebar .sidebar-conversations > .team-thread-list {padding:0 10px;}
.ws-sidebar .team-thread-list button.section-toggle {width:100%; margin:2px 0; padding:8px 10px;}
/* New message is a plain row like New folder and New chat (owner, 2026-10-25: "Why does "New message" have a big
   wide pill? The design language does not match"). */
.ws-sidebar .team-thread-list .message-new {width:100%; gap:10px; margin:2px 0; padding:8px 10px; border:0; border-radius:8px; box-sizing:border-box; font-size:13px; color:var(--kilby-list-title, var(--kilby-secondary));}
.ws-sidebar .team-thread-list .message-new svg {flex:none; color:var(--kilby-secondary);}
.ws-sidebar .team-thread-list .message-new:hover {background:rgba(var(--kilby-tint),0.04); color:var(--kilby-white);}
.ws-sidebar .team-thread-list .thread-item.message-row {padding:8px 10px;}
.team-thread-list .message-row .team-unread {top:50%; transform:translateY(-50%);}
.sidebar-conversations > .team-thread-list:not([hidden])::before,
.sidebar-conversations > .threads-list::before,
.threads-sheet-body > .team-thread-list:not([hidden])::before,
.threads-sheet-body > .threads-list::before {content:''; display:block; flex:none; border-top:1px solid var(--kilby-border); margin:8px 10px;}
.sidebar-rule {border:0; border-top:1px solid var(--kilby-border); margin:8px 10px; flex:none;}
.sidebar-row {display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; padding:8px 10px; background:none; border:0; border-radius:8px; color:var(--kilby-list-title, var(--kilby-secondary)); font:inherit; font-size:13px; text-align:left; cursor:pointer;}
.sidebar-row svg {flex:none; color:var(--kilby-secondary);}
.sidebar-row .name {flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.sidebar-row:hover {background:rgba(var(--kilby-tint),0.04); color:var(--kilby-white);}
.sidebar-row.drop-target {background:rgba(37,99,235,0.12); color:var(--kilby-white);}
.sidebar-folder.open {color:var(--kilby-white);}
.folder-name-input {display:block; width:100%; box-sizing:border-box; margin:1px 0; padding:7px 10px; border:1px solid var(--kilby-blue); border-radius:8px; background:var(--kilby-surface, var(--kilby-panel)); color:var(--kilby-white); font:inherit; font-size:13px; outline:none;}
/* A folder row's ⋯ (Rename, Delete): shown on hover or keyboard focus, and always where there is no
   pointer to hover with (phones). */
.folder-line {position:relative; display:flex; align-items:center;}
.folder-line .sidebar-row {padding-right:36px;}
.folder-line:hover .sidebar-row {background:rgba(var(--kilby-tint),0.04); color:var(--kilby-white);}
.folder-more {position:absolute; right:4px; top:50%; transform:translateY(-50%); display:none; align-items:center; justify-content:center; width:26px; height:26px; padding:0; border:0; border-radius:6px; background:none; color:var(--kilby-faint); cursor:pointer;}
.folder-more:hover, .folder-more.on {color:var(--kilby-white); background:rgba(var(--kilby-tint),0.08);}
.folder-line:hover .folder-more, .folder-line:focus-within .folder-more, .folder-more.on {display:flex;}
@media (hover: none) { .folder-more {display:flex;} }
.folder-menu {top:calc(100% + 4px); right:0; min-width:160px;}
.sidebar-empty {color:var(--kilby-faint); font-size:12px; padding:6px 10px;}
.thread-row .thread-item.sidebar-chat {flex:1; min-width:0;}
.thread-item.sidebar-chat.nested {padding-left:36px;}
.thread-item.sidebar-chat .thread-snippet {color:var(--kilby-faint); font-size:11px; line-height:1.35; margin-top:2px;}
.thread-shared {position:relative; flex:none; display:flex; align-items:center; padding:0 10px; background:none; border:0; border-radius:8px; color:var(--kilby-secondary); cursor:pointer;}
.thread-shared:hover {color:var(--kilby-white);}
.thread-shared .team-unread {position:absolute; top:2px; right:0; min-width:16px; height:16px; padding:0 4px; border-radius:8px; font-size:10px;}
.ws-sidebar .thread-row {border-radius:8px;}
.ws-sidebar .thread-row:hover {background:rgba(var(--kilby-tint),0.04);}
.ws-sidebar .thread-row .thread-item.sidebar-chat:hover {background:transparent;}
.ws-sidebar .thread-row:has(.thread-item.sidebar-chat.active) {background:rgba(37,99,235,0.12);}
.ws-sidebar .thread-row .thread-item.sidebar-chat.active {background:transparent;}
.ws-sidebar .thread-row.picked {background:rgba(37,99,235,0.18);}
.drag-bundle {position:fixed; top:-200px; left:0; display:flex; align-items:center; gap:10px; max-width:240px; padding:8px 10px; border-radius:8px; background:var(--kilby-panel); color:var(--kilby-white); font-size:13px; border:1px solid var(--kilby-border); box-shadow:4px 4px 0 -1px var(--kilby-panel), 4px 4px 0 0 var(--kilby-border), 8px 8px 0 -1px var(--kilby-panel), 8px 8px 0 0 var(--kilby-border);}
.drag-bundle .drag-title {flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.drag-bundle .drag-count {flex:none;}
/* The phone Chats sheet keeps its own edge (12px inset + 8px): folders and chats line up with the
   Shared links icon and the Messages arrow. */
.threads-sheet-body .threads-list .thread-item.sidebar-chat {padding:10px 8px;}
.threads-sheet-body .threads-list .thread-item.sidebar-chat.nested {padding-left:34px;}
.threads-sheet-body .sidebar-row, .threads-sheet .sidebar-library button {font-size:14px;}
/* Shared links scrolls with the list (owner, 2026-10-07: "I do not want shared links to be sticky"):
   inside the sheet body, which already insets 12px. */
.threads-sheet-body > .sidebar-library {padding:0 0 4px;}
.threads-sheet-body .sidebar-row {padding:12px 8px;}
.threads-sheet-body > .team-thread-list:not([hidden])::before,
.threads-sheet-body > .threads-list::before,
.threads-sheet-body .sidebar-rule {margin:8px 8px;}
/* A scheduled result not yet seen: the Messages badge, same color, on the job's chat row. */
.thread-row > .team-unread.chat-unread {position:static; transform:none; flex:none; align-self:center; margin:0 4px;}
/* Chats, in the Messages heading's style and on its left edge, one line above it and none under it
   (owner, 2026-10-25: "there should be somethig that says "Chats" b/c chats and messages are differnt things"). */
.ws-sidebar .sidebar-conversations > #chatsHeading {width:calc(100% - 20px); margin:14px 10px 2px; padding:8px 10px;}
.ws-sidebar #chatsHeading + .threads-list::before {display:none;}
/* Owner, 2026-10-25: "is this side bar now optimized … Does it violate any UI UX principals?" … "I like the mock-up
   very much!" (docs/sidebar-divider-mockup/; its pinned New chat and Search dropped: "Drop the pinning."): section
   headings quieter than their rows; the line above Chats as long as the one under Shared links; rows in the list as
   close as the rows at the top. */
.ws-sidebar .section-toggle .section-label {font-size:12px; font-weight:600; color:var(--kilby-secondary);}
/* The line above Chats, after Messages or Pinned (a hidden Pinned sits between them). */
.ws-sidebar .team-thread-list:not([hidden]) ~ #chatsHeading,
.ws-sidebar .pinned-chats:not([hidden]) ~ #chatsHeading {position:relative;}
.ws-sidebar .team-thread-list:not([hidden]) ~ #chatsHeading::before,
.ws-sidebar .pinned-chats:not([hidden]) ~ #chatsHeading::before {content:''; position:absolute; left:10px; right:10px; top:-11px; border-top:1px solid var(--kilby-border);}
/* Pinned (owner, 2026-10-25; docs/chat-pin-mockup/): the Messages list's box, heading and line above it. */
.ws-sidebar .pinned-chats {padding:0 10px;}
.ws-sidebar .pinned-chats[hidden] {display:none;}
.ws-sidebar .pinned-chats::before {content:''; display:block; border-top:1px solid var(--kilby-border); margin:8px 10px;}
.ws-sidebar .pinned-chats button.section-toggle {width:100%; margin:2px 0; padding:8px 10px;}
/* A chat's ⋯, after its shared icon: shown on hover, keyboard focus, or while its menu is open. */
.thread-row .chat-more {position:static; transform:none; flex:none; align-self:center; margin-right:4px;}
.ws-sidebar .thread-row:hover .chat-more, .ws-sidebar .thread-row:focus-within .chat-more, .chat-more.on {display:flex;}
/* Marked unread by hand: a dot in the unread badges' blue. */
.chat-marked-unread {flex:none; align-self:center; width:8px; height:8px; margin:0 8px; border-radius:50%; background:var(--kilby-blue);}
/* The sidebar's menus read like the sidebar (owner, 2026-10-25: "the menu needs to match the sidebar, it's common
   sense"): the rows' 13px text and color, their icon gray, 8px padding and hover. The ⋮ menu is unchanged. */
.ws-sidebar .folder-menu, .chat-menu, .chat-menu-list {padding:4px;}
.ws-sidebar .folder-menu .kebab-item, .chat-menu .kebab-item {gap:10px; padding:8px 10px; border-radius:8px; font-size:13px; color:var(--kilby-list-title, var(--kilby-secondary));}
.ws-sidebar .folder-menu .kebab-item svg, .chat-menu .kebab-item svg {opacity:1; color:var(--kilby-secondary);}
.ws-sidebar .folder-menu .kebab-item:hover, .chat-menu .kebab-item:hover {background:rgba(var(--kilby-tint),0.04); color:var(--kilby-white);}
/* A chat's menu floats above the page (no row draws over it, the sidebar never cuts it off); kilby-threads.js places it. */
.chat-menu, .chat-menu-list {position:fixed; right:auto;}
/* Scrolling stops at the last folder rather than moving the list behind it, which would close the menu. On a phone
   (the Chats sheet's breakpoint) the folders may fill the screen's height, less the 8px kilby-threads.js keeps above
   and below (owner, 2026-10-25: "the TSM folder is missing" … "Build it for test."; docs/phone-folder-list-mockup/). */
.chat-menu-list {max-height:320px; overflow-y:auto; overscroll-behavior:contain;}
@media (max-width: 899px) { .chat-menu-list {max-height:calc(100dvh - 16px);} }
.chat-menu-folders svg:last-child {margin-left:auto;}
.chat-menu .folder-name-input {width:calc(100% - 8px); margin:2px 4px;}
.ws-sidebar .sidebar-conversations .threads-list {gap:0;}
/* View all (owner, 2026-10-25; docs/chat-view-all-mockup/): a row like New folder ending the list, lit while its page
   is open, as an open chat's row is. The page covers the chat: the chat column's width, Settings' heading (19px
   semibold: "Yes, change the heading and keep the box open."), Search's box, rows in the sidebar's colors. */
.sidebar-row.sidebar-view-all.on {background:rgba(var(--kilby-tint),0.06); color:var(--kilby-white);}
.all-chats {position:absolute; inset:0; z-index:5; overflow-y:auto; background:var(--kilby-black);}
.all-chats[hidden] {display:none;}
.all-chats-inner {max-width:760px; margin:0 auto; padding:40px 24px 64px; box-sizing:border-box;}
.all-chats h2 {margin:0 0 16px; font-size:19px; font-weight:600; color:var(--kilby-white);}
.all-chats-search {display:flex; align-items:center; gap:10px; padding:11px 14px; border:1px solid var(--kilby-border); border-radius:12px; background:var(--kilby-black);}
.all-chats-search:focus-within {border-color:var(--kilby-blue);}
.all-chats-search > svg {flex:none; color:var(--kilby-faint);}
.all-chats-search input {flex:1; min-width:0; border:0; outline:none; background:transparent; color:var(--kilby-white); font:inherit; font-size:15px;}
.all-chats-search input::placeholder {color:var(--kilby-faint);}
.all-chats-count {min-height:16px; margin:18px 0 6px; padding:0 12px; font-size:13px; color:var(--kilby-faint);}
.all-chats-row {display:flex; align-items:center; border-top:1px solid var(--kilby-border);}
.all-chats-row:first-child {border-top:0;}
.all-chats-row:hover, .all-chats-row:has(.chat-more.on) {background:rgba(var(--kilby-tint),0.04);}
.all-chats-open {flex:1; min-width:0; display:flex; padding:12px; border:0; background:transparent; color:var(--kilby-white); font:inherit; text-align:left; cursor:pointer;}
.all-chats-open:focus-visible {outline:2px solid var(--kilby-blue); outline-offset:-2px;}
.all-chats-text {flex:1; min-width:0; display:flex; flex-direction:column; gap:3px;}
.all-chats-title {font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.all-chats-snippet {font-size:12px; line-height:1.35; color:var(--kilby-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.all-chats-date {font-size:12px; color:var(--kilby-faint);}
/* One width for every folder label, so the icons and names form one column (owner, 2026-11-09: "I like the mock-up.";
   docs/view-all-folder-mockup/). */
.all-chats-folder {flex:none; display:flex; align-items:center; gap:6px; width:120px; margin:0 8px; font-size:12px; color:var(--kilby-secondary);}
.all-chats-folder > span {overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.all-chats-folder > svg {flex:none; width:14px; height:14px;}
.all-chats-row > .team-unread.chat-unread {position:static; transform:none; flex:none; margin:0 4px;}
.all-chats-row .chat-more {position:static; transform:none; flex:none; display:flex; visibility:hidden; margin:0 4px;}
.all-chats-row:hover .chat-more, .all-chats-row:focus-within .chat-more, .all-chats-row .chat-more.on {visibility:visible;}
@media (hover: none) { .all-chats-row .chat-more {visibility:visible;} }
.all-chats-rows > .sidebar-empty {padding:24px 12px;}
@media (max-width: 640px) { .all-chats-inner {padding:24px 16px 48px;} .all-chats-folder {width:96px;} }
/* Search, in the center (owner, 2026-10-25; docs/sidebar-search-mockup/): a lighter backdrop than other dialogs,
   so the page shows behind it; the box in the page color with Kilby's border and the settings panel's corners. */
#chatSearchOverlay.open {align-items:flex-start; padding:18vh 16px 16px; background:rgba(0,0,0,.35);}
.chat-search-box {width:min(640px, 100%); max-height:60vh; display:flex; flex-direction:column; background:var(--kilby-black); border:1px solid var(--kilby-border); border-radius:16px; box-shadow:0 18px 50px rgba(0,0,0,.22); overflow:hidden;}
.chat-search-head {display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--kilby-border);}
.chat-search-head > svg {flex:none; color:var(--kilby-faint);}
.chat-search-head input {flex:1; min-width:0; border:0; outline:none; background:transparent; color:var(--kilby-white); font:inherit; font-size:15px;}
.chat-search-head input::placeholder {color:var(--kilby-faint);}
.chat-search-close {flex:none; display:grid; place-items:center; width:30px; height:30px; border:0; border-radius:8px; background:transparent; color:var(--kilby-secondary); cursor:pointer;}
.chat-search-close:hover {background:var(--kilby-panel);}
.chat-search-results {overflow-y:auto; padding:8px;}
.chat-search-results:empty {display:none;}
.chat-search-group {padding:10px 10px 6px; font-size:12px; color:var(--kilby-faint);}
.chat-search-results .thread-row {gap:0;}
.chat-search-results .thread-item {width:100%; background:transparent; border:0; border-radius:8px; padding:9px 10px; color:var(--kilby-white); text-align:left;}
.chat-search-results .thread-item .title {font-size:14px;}
.chat-search-results .thread-item:hover {background:var(--kilby-panel);}
.chat-search-results .thread-item:focus-visible, .chat-search-close:focus-visible {outline:2px solid var(--kilby-blue); outline-offset:-2px;}
.chat-search-results .message-row {display:flex; align-items:center; gap:10px;}
.chat-search-results .message-who {display:flex; flex-direction:column; min-width:0; flex:1;}
.chat-search-results .message-who .title, .chat-search-results .message-who .meta {white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chat-search-results .message-who .meta {font-size:11px; color:var(--kilby-faint); margin-top:2px;}
.chat-search-results .thread-search-busy {padding:6px 10px !important;}
/* The phone's Chats sheet holds the computer's list (owner, 2026-10-25: "Proposed looks great."; docs/phone-chats-
   mockup/; kilby-threads.js _placeChatList): the list keeps its own .ws-sidebar rules, so its headings, Pinned, ⋯
   menus and View all match the computer's; these lines only fit it to a phone. */
.threads-sheet .threads-sheet-body {padding:0 2px 14px;}
.threads-sheet-body > .ws-sidebar.ws-sidebar-sheet {display:block; width:auto; border:0; overflow:visible; opacity:1;}
.threads-sheet .ws-sidebar-sheet .sidebar-conversations {overflow:visible;}
/* A finger, not a mouse: rows as tall as the phone sheet's were (about 44px). */
.threads-sheet .ws-sidebar-sheet .sidebar-library button,
.threads-sheet .ws-sidebar-sheet .sidebar-row,
.threads-sheet .ws-sidebar-sheet .thread-item.sidebar-chat,
.threads-sheet .ws-sidebar-sheet button.section-toggle {padding-top:12px; padding-bottom:12px;}
/* Pinned chats start where the other chats do (the sheet's own rule indents a chat 32px outside the list). */
.threads-sheet .ws-sidebar-sheet .pinned-chats .thread-item.sidebar-chat {padding-left:8px;}
/* No hover on a phone, so every chat's ⋯ shows, as every folder's does. */
.threads-sheet .ws-sidebar-sheet .thread-row .chat-more {display:flex;}
