/* Keep the chat stationary. Animate only the control that changes. */
.sidebar .chat-item.active {
  box-shadow: inset 3px 0 var(--accent);
}
.sidebar .chat-item.active .title { font-weight: 650; }
.sidebar[data-searching] .chat-folder-section { display: none !important; }
.sidebar[data-searching] #chatSearchStatus {
  padding-block: 0 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sidebar[data-searching] .chat-item .workflow-chat-copy > :is(.title,.workflow-search-preview) {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: normal; overflow: hidden; overflow-wrap: anywhere; line-height: 1.45;
}
.sidebar[data-searching] .workflow-search-preview { font-size: 12px; }
.sidebar[data-searching] .chat-item mark {
  background: color-mix(in srgb, var(--accent) 19%, transparent);
  color: inherit; font-weight: 700; border-radius: 2px;
}
.sidebar[data-searching] .chat-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
@media (pointer:coarse) {
  .workflow-search #chatSearchInput { min-height: 44px; padding-inline-end: 46px; }
  .workflow-search #chatSearchClear { inset-block-start: 0; width: 44px; height: 44px; }
}
.message-tools-menu {
  max-height: min(60dvh, 27rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 7px 26px rgb(0 0 0 / .14);
}
.sidebar-chat-menu button { min-height: 40px; padding-block: 8px; }
.composer:focus-within {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.composer-actions :is(#clearCtxBtn,#clearBtn,#sendBtn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  font-size: 0;
  line-height: 0;
}
.composer-actions :is(#clearCtxBtn,#clearBtn,#sendBtn)::before {
  content: '';
  /* Do not let the retained text glyph create a second grid/flex item. */
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px; height: 20px;
  background: currentColor;
  -webkit-mask: var(--tool-icon) center/contain no-repeat;
  mask: var(--tool-icon) center/contain no-repeat;
}
#clearCtxBtn { --tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='m8.2 8.2 12 12M8.2 15.8l12-12'/%3E%3C/svg%3E"); }
#clearBtn { --tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 10v7m4-7v7'/%3E%3C/svg%3E"); }
#sendBtn { --tool-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m-6 6 6-6 6 6'/%3E%3C/svg%3E"); }
.composer-actions #sendBtn.stop-btn::before {
  width: 12px; height: 12px; border-radius: 3px; mask: none; -webkit-mask: none;
}
@media (hover:hover) {
  .composer-actions #clearBtn:hover { color: var(--danger); }
}
.composer-actions button:disabled { opacity: .52; cursor: default; }
/* A software keyboard already defines the usable bottom edge. Welcome-page
   centering and the home-indicator reserve must not leave a second blank area. */
html[data-keyboard-open=true] #chatView.libre-welcome {
  justify-content: flex-start;
  overflow: hidden;
}
html[data-keyboard-open=true] #chatView.libre-welcome .messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
html[data-keyboard-open=true] #chatView .composer-wrap {
  margin-bottom: 0;
  padding-bottom: 4px;
}
#attachmentPreview:has(.pdf-page-sheet) {
  width: min(960px, 96vw); box-sizing: border-box; padding: 0;
  overflow: hidden; border-radius: 16px;
}
#attachmentPreview:has(.pdf-page-sheet)[open] { display:flex; flex-direction:column; }
#attachmentPreview:has(.pdf-page-sheet) header { flex:none; margin:0; padding:12px 16px; border-bottom:1px solid var(--border); }
#attachmentPreview:has(.pdf-page-sheet) h2 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px; }
#attachmentPreviewBody:has(.pdf-page-sheet) { min-height:0; display:flex; flex-direction:column; }
.pdf-page-tools { display:flex; flex:none; align-items:center; gap:4px; padding:4px 10px; background:var(--bg); }
.pdf-page-tools button,.pdf-page-tools a {
  display:inline-grid; place-items:center; box-sizing:border-box; min-height:40px; min-width:40px;
  background:transparent; color:var(--fg); border:0; border-radius:8px; cursor:pointer;
}
.pdf-page-tools button { font:24px/1 system-ui; }
.pdf-page-tools button:disabled { opacity:.32; cursor:default; }
.pdf-page-tools span { min-width:5ch; text-align:center; color:var(--fg-2); font-size:13px; font-variant-numeric:tabular-nums; }
.pdf-page-tools a { margin-inline-start:auto; padding-inline:10px; font-size:14px; text-decoration:none; }
.pdf-page-tools :is(button:not(:disabled),a):hover { background:var(--bg-2); }
.pdf-page-sheet { min-height:0; overflow:auto; overscroll-behavior:contain; padding:clamp(8px,2vw,24px); background:var(--bg-3); }
.pdf-page-sheet canvas { display:block; max-width:100%; height:auto; margin:auto; box-shadow:0 2px 10px rgb(0 0 0 / .14); }
@media (pointer:coarse) {
  .composer-actions :is(.icon-btn,#sendBtn), .pdf-page-tools :is(button,a), .sidebar-chat-menu button { min-height:44px; }
  .composer-actions :is(.icon-btn,#sendBtn), .pdf-page-tools button { min-width:44px; }
}
@keyframes lixon-menu-in { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:none; } }
@keyframes lixon-control-in { from { opacity:.4; } to { opacity:1; } }
@media (prefers-reduced-motion:no-preference) {
  html[data-reduce-motion=false] .message-tools-menu { animation:lixon-menu-in 130ms ease-out; }
  html[data-reduce-motion=false] .pdf-page-sheet canvas, html[data-reduce-motion=false] #attachmentPreview[open]::backdrop { animation:lixon-control-in 140ms ease-out; }
  html[data-reduce-motion=false] .composer-resize-handle>span:first-child { transition:transform 150ms ease-out; }
  html[data-reduce-motion=false] .composer-resize-handle:is(:focus-visible,.dragging)>span:first-child { transform:scaleX(1.35); }
}
