.chatting #conversation,.chatting #entry,.chatting #promo { width:100%;max-width:810px }
.chatting #conversation { padding:0 0 16px }
@media (min-width:901px) {
  .chatting main { padding-inline:max(50px,calc((100vw - var(--sidebar-width) - 810px)/2)) }
  .collapsed.chatting main { padding-inline:max(50px,calc((100vw - var(--rail-width) - 810px)/2)) }
}
.chatting .chat-heading,.chatting .message.assistant { padding-inline:20px }
.chatting .message.user { width:100%;max-width:none;margin:16px 0 38px;position:relative;padding:13px 20px }
.chatting .user-actions { position:absolute;right:12px;top:calc(100% + 4px) }
.chatting .actions [data-action="second"] { order:0 }
.chatting .actions [data-copy] { order:1 }
.chatting .actions [aria-label="Share"] { order:2 }
.chatting .actions [aria-label="Export chat"] { order:3 }
.chatting .actions [aria-label="More actions"] { order:4 }
.chatting .actions [data-vote="up"] { order:5;margin-left:auto }
.chatting .actions [data-vote="down"] { order:6 }
.composer-delete {
  display:grid;place-items:center;position:absolute;left:-48px;bottom:29px;
  width:36px;height:36px;padding:0;border:0;border-radius:50%;background:rgb(255 255 255 / 12%);
  color:inherit;opacity:0;visibility:hidden;transform:scale(0);
  transition:opacity .25s ease-in-out,transform .25s ease-in-out,visibility .25s allow-discrete,background-color .15s cubic-bezier(.4,0,.2,1)
}
.chatting .composer-delete { opacity:1;visibility:visible;transform:scale(1) }
.chatting .composer-delete:not(:disabled):hover { background:rgb(255 255 255 / 18%) }
.light .composer-delete { background:rgb(0 0 0 / 8%) }
.light.chatting .composer-delete:not(:disabled):hover { background:rgb(0 0 0 / 13%) }
.chat-composer-busy button:disabled { opacity:.42;cursor:default }
.search-mode-chip[hidden],.sidebar-chat-search[hidden],#promo[hidden] { display:none }
#promo.chat-promo-leaving {
  max-height:0;opacity:0;padding-block:0;margin-block:0;transform:translateY(9px);
  border-width:0;pointer-events:none
}
.pending-reply .label,.pending-reply .message-extras { display:none }
.reply-status { display:flex;align-items:center;gap:9px;min-height:26px;color:var(--muted);font-size:14px }
.reply-status .ui-icon { width:17px;height:17px;flex:none }
.reply-status .search-query { overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
.reply-dots { display:inline-flex;gap:3px;align-items:center;height:16px }
.reply-dots i { width:4px;height:4px;border-radius:50%;background:currentColor;animation:reply-pulse .9s ease-in-out infinite alternate }
.reply-dots i:nth-child(2) { animation-delay:.14s }
.reply-dots i:nth-child(3) { animation-delay:.28s }
@keyframes reply-pulse { from { opacity:.3;transform:translateY(2px) } to { opacity:1;transform:translateY(-2px) } }
.image-skeleton,.chat-image-button { width:min(100%,482px);border-radius:24px;margin:10px 0 0 }
.image-skeleton {
  aspect-ratio:1;background:linear-gradient(120deg,var(--panel) 10%,var(--line) 45%,var(--panel) 80%);
  background-size:240% 100%;animation:image-shimmer 2s ease-in-out infinite
}
@keyframes image-shimmer { from { background-position:100% 0 } to { background-position:0 0 } }
.chat-image-button { display:block;padding:0;border:0;background:none;overflow:hidden;animation:sample-image-reveal .28s ease-out }
.chat-image-button img { display:block;width:100%;height:auto }
@keyframes sample-image-reveal { from { opacity:0;transform:scale(.985) } }
.image-actions { max-width:482px }
.source-citation {
  display:inline-flex;align-items:center;margin:0 0 6px;padding:1px 8px;font-size:11px;
  border-radius:12px;background:var(--composer);color:inherit;text-decoration:none
}
.sources-heading { margin:12px 0 8px;font-size:14px }
.source-card {
  width:min(100%,280px);display:flex;align-items:center;gap:10px;padding:10px 12px;
  border:1px solid var(--line);border-radius:12px;color:inherit;text-decoration:none;font-size:13px
}
.source-card:hover,.source-citation:hover { background:var(--line) }
.source-card small { display:block;color:var(--muted);margin-top:3px }
#sidebar .chat-list-heading { display:flex;align-items:center;gap:2px;width:auto;height:36px;padding:0 4px 0 12px;margin:0 0 2px;font-size:13px }
.chat-list-heading strong { margin-right:auto }
#history .chat-list-row { display:flex;align-items:center;position:relative;border-radius:9px;min-height:36px }
#history .chat-list-row:hover,#history .chat-list-row:focus-within,#history .chat-list-row.current { background:var(--composer) }
#history button.chat-list-title {
  display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;min-width:0;
  min-height:36px;padding:7px 12px;background:none;border:0;text-align:left
}
.chat-list-title span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
.chat-list-title time { flex:none;color:var(--muted);font-size:12px }
#history .chat-list-row:has(>.icon):hover .chat-list-title,#history .chat-list-row:has(>.icon):focus-within .chat-list-title { padding-right:66px }
#history .chat-list-heading .icon,#history .chat-list-row .icon,.sidebar-chat-search .icon {
  display:grid;place-items:center;padding:0;width:28px;height:28px;border-radius:50%;color:var(--muted)
}
#history .chat-list-row .icon { position:absolute;right:38px;width:16px;height:16px;opacity:0;pointer-events:none;overflow:visible }
#history .chat-list-row .icon:last-child { right:8px }
#history .chat-list-row:hover .icon,#history .chat-list-row:focus-within .icon { opacity:1;pointer-events:auto }
#history .chat-list-heading .icon,.sidebar-chat-search .icon,.chat-selection-bar .icon {
  transition:background-color .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1)
}
#history .chat-list-heading .icon:hover,.sidebar-chat-search .icon:hover,.chat-selection-bar .icon:not(:disabled):hover { background:var(--line) }
#history .chat-list-row .icon:hover { background:transparent;color:inherit }
.history-glyph { stroke:none }
#history .icon .history-glyph,.sidebar-chat-search .history-glyph,.composer-delete .history-glyph,.chat-selection-bar .history-glyph {
  display:block;flex:none;width:16px;height:16px;overflow:visible;animation:none
}
#history .icon svg,.sidebar-chat-search svg { width:16px;height:16px }
#sidebar.searching-chats>header,#sidebar.searching-chats>nav,#sidebar.searching-chats>footer { display:none }
.sidebar-chat-search { display:flex;gap:4px;align-items:center;margin:12px 6px 4px }
.sidebar-chat-search label {
  flex:1;min-width:0;display:flex;align-items:center;gap:7px;background:var(--panel);
  border:1px solid var(--line);border-radius:24px;height:42px;padding:0 13px;color:var(--muted)
}
.sidebar-chat-search .icon { width:36px;height:36px }
.sidebar-chat-search input { width:100%;min-width:0;background:none;border:0;color:inherit;font:inherit;font-size:14px;outline:none }
.sidebar-chat-search input::-webkit-search-cancel-button { display:none }
.selecting-chats > footer { display:none }
#history .selectable-chat { gap:12px;padding:0 12px;margin-bottom:2px;cursor:pointer;font-size:13px }
#history .selectable-chat.chat-checked { color:#83c1ff;background:rgb(255 255 255 / 8%) }
.light #history .selectable-chat.chat-checked { color:#175c96;background:rgb(0 0 0 / 7%) }
.selectable-chat input {
  appearance:none;display:grid;place-content:center;flex:none;width:16px;height:16px;
  margin:0;border:1px solid #8faec9;border-radius:4px;background:transparent;cursor:pointer
}
.selectable-chat input:checked { background:#79b6e5;border-color:#79b6e5 }
.selectable-chat input:checked::before {
  content:"";width:7px;height:4px;border:solid white;border-width:0 0 1.5px 1.5px;transform:translateY(-1px) rotate(-45deg)
}
.selectable-chat span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
.chat-selection-bar {
  position:absolute;bottom:6px;left:6px;right:6px;display:flex;align-items:center;justify-content:space-between;
  height:52px;padding:0 8px 0 16px;border-radius:999px;background:var(--composer);
  font-size:13px;font-weight:600;animation:selection-bar-in .25s cubic-bezier(0,0,.2,1) both
}
.chat-selection-bar[hidden] { display:none }
.chat-selection-bar div { display:flex;gap:4px }
.chat-selection-bar .icon { display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:50% }
.chat-selection-bar .icon:disabled { opacity:.4;cursor:default }
.selecting-chats #history { padding-bottom:62px }
@keyframes selection-bar-in { from { opacity:0;transform:translateY(100%) } }
.bulk-chat-delete div { display:flex;gap:8px;justify-content:flex-end }
.no-chats { color:var(--muted);padding:8px 12px;font-size:13px }
#dialog[data-panel="image-viewer"],#overlay.dialog-out #dialog[data-panel="image-viewer"] {
  animation:none;width:max-content;max-width:calc(100vw - 28px);padding:0;overflow:visible;
  border:0;background:transparent;box-shadow:none
}
.chat-image-viewer img { display:block;width:auto;height:auto;max-width:calc(100vw - 28px);max-height:88dvh;border-radius:24px }
#dialog[data-panel="image-viewer"] [data-action="close"] { z-index:1;top:8px;right:8px;border-radius:50%;background:#1c1c1cdd;color:white }
@media (max-width:900px) {
  .composer-delete { left:0;bottom:calc(100% + 6px);width:30px;height:30px;z-index:1 }
  .chatting .chat-heading,.chatting .message.assistant { padding-inline:8px }
}
@media (max-width:590px) and (prefers-reduced-motion:no-preference) {
  #history .chat-list-heading .icon:active,.sidebar-chat-search .icon:active,.chat-selection-bar .icon:not(:disabled):active,.chatting .composer-delete:not(:disabled):active { transform:scale(.95) }
}
@media (prefers-reduced-motion:reduce) {
  .reply-dots i,.image-skeleton,.chat-image-button,.chat-selection-bar { animation:none }
  #promo.chat-promo-leaving,.composer-delete,#history .chat-list-heading .icon,.sidebar-chat-search .icon,.chat-selection-bar .icon { transition:none }
}

/* Chat history, actions, and conversation */
#history .chat-list-title span { flex:1;text-align:left }
#history .chat-list-title .chat-line-icon { flex:none }
#history mark { color:inherit;background:transparent;font-weight:700 }
.sidebar-chat-search label { gap:8px;padding-inline:12px }
.sidebar-chat-search label:focus-within { border-color:#69a9e0;box-shadow:inset 0 0 0 1px #69a9e0 }
.sidebar-chat-search input { color:inherit }
.sidebar-chat-search input::placeholder { color:var(--muted) }
#sidebar.searching-chats #history { padding-top:8px }
#sidebar.searching-chats .chat-list-title { font-size:13px }
.no-chats { display:grid;gap:5px;text-align:center;margin-top:14px }
.no-chats strong { color:inherit;font-size:14px }
.no-chats span { font-size:13px }
.chat-line-icon { display:block;width:16px;height:16px;flex:none }
#popover[data-menu="history-actions"] {
  min-width:136px;width:max-content;padding:8px;border:0;border-radius:24px;background:#222;
  gap:8px;box-shadow:0 6px 24px #0004
}
#popover[data-menu="history-actions"] button {
  justify-content:flex-start;gap:8px;min-height:32px;height:32px;padding:4px 12px;border-radius:12px;
  font-size:14px;line-height:16px;font-weight:600;white-space:nowrap
}
#popover[data-menu="history-actions"] svg { width:16px;height:16px }
.rename-chat { padding:12px 0 8px }
.rename-chat input {
  width:100%;height:40px;padding:0 16px;border:1px solid #78b6e5;border-radius:24px;
  background:var(--composer);color:inherit;font:inherit;font-size:14px
}
.rename-chat input:focus { outline:1px solid #78b6e5 }
.rename-chat div { display:flex;justify-content:flex-end;gap:8px;margin-top:8px }
#history .rename-chat button { width:auto;height:32px;padding:0 12px;border-radius:999px;background:var(--line);font-weight:600 }
#history .rename-chat button[type="submit"] { background:#78b6e5;color:#121212 }

#dialog:is([data-panel="history-delete"],[data-panel="history-export"],[data-panel="history-share"]) {
  width:min(400px,calc(100vw - 28px));max-width:none;padding:24px;border:0;border-radius:32px;
  background:#222;box-shadow:none;overflow:auto
}
.light #popover[data-menu="history-actions"],.light #dialog:is([data-panel="history-delete"],[data-panel="history-export"],[data-panel="history-share"]) { background:var(--panel) }
#dialog[data-panel="history-share"] { width:min(448px,calc(100vw - 28px)) }
#dialog:is([data-panel="history-delete"],[data-panel="history-export"],[data-panel="history-share"]) .dialog-close {
  top:24px;right:18px;width:36px;height:36px;border-radius:50%;color:var(--muted)
}
.chat-dialog-emblem { display:grid;place-items:center;width:56px;height:64px;margin:4px 0 6px }
.chat-dialog-emblem svg { width:52px;height:52px }
.chat-sync-emblem { color:#78b6e5 }
.chat-action-dialog h2 { margin:4px 36px 4px 0;font-size:22px;line-height:32px;font-weight:500 }
.chat-action-dialog p { margin:0 0 12px;font-size:14px;line-height:20px }
.chat-dialog-buttons { display:grid;gap:12px }
.chat-action-dialog :is(.chat-dialog-buttons button,.chat-primary) {
  display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:36px;
  padding:0 12px;border:0;border-radius:999px;background:rgb(255 255 255 / 12%);font-size:14px;font-weight:600
}
.light .chat-action-dialog .chat-dialog-buttons button { background:rgb(0 0 0 / 10%) }
.chat-action-dialog .chat-dialog-buttons .chat-danger { background:#e94a53;color:#101010 }
.chat-action-dialog .chat-dialog-buttons .chat-plain { background:transparent }
.chat-action-dialog :is(.chat-dialog-buttons,.share-chat-footer) .chat-primary { background:#78b6e5;color:#11202b }
.chat-action-dialog button:hover { filter:brightness(1.12) }
.share-chat-scroll { overflow:auto;max-height:min(46dvh,310px);margin-top:16px;scrollbar-width:thin }
.share-chat-preview { display:grid;gap:12px;border:1px solid var(--line);border-radius:24px;padding:12px;margin-bottom:14px;font-size:13px }
.share-chat-preview p,.share-chat-preview li { font-size:13px;line-height:20px }
.share-chat-preview img { max-height:160px;object-fit:contain }
.share-user { border-radius:24px;padding:12px 16px;background:var(--composer);overflow-wrap:anywhere }
.share-assistant strong { display:flex;align-items:center;gap:8px;margin:0 0 12px }
.share-assistant strong svg { width:16px;height:16px }
.share-chat-footer { padding-top:12px }
.share-chat-footer fieldset { display:flex;justify-content:space-between;align-items:center;gap:5px;padding:0;margin:0 0 12px;border:0;min-width:0;position:relative }
.share-chat-footer legend { float:left;padding:0;font-size:12px;line-height:36px }
.share-chat-footer label { position:relative;white-space:nowrap;cursor:pointer }
.share-chat-footer label input { position:absolute;inset:0;opacity:0;cursor:pointer }
.share-chat-footer label strong { display:block;padding:8px;border:1px solid var(--line);border-radius:24px;background:var(--composer);font-size:12px }
.share-chat-footer label input:checked + strong,.share-chat-footer label input:focus-visible + strong { border-color:#78b6e5 }
.share-link-result:not([hidden]) { display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12px }
.share-link-result input { flex:1;min-width:0;padding:6px;border:1px solid var(--line);background:var(--composer);color:inherit }
.share-link-result button { white-space:nowrap }

.chatting .chat-heading { padding:0 20px 12px }
.chat-heading .chat-title { margin:0 38px 4px 0;text-align:left;font-size:20px;line-height:28px;font-weight:500 }
.chatting .chat-private { font-size:14px;line-height:20px;align-items:flex-start }
.chat-private svg { flex:none }
.chatting .message.user { border-radius:24px;margin:12px 0 40px;padding:12px 20px }
.chatting .message.user .message-content,.chatting .message-content p,.chatting .message-content li { font-size:16px;line-height:24px }
.chatting .message-content p { margin:0 0 12px }
.chatting .message-content li { padding-left:8px;margin:0 0 8px }
.chatting .message-content ul,.chatting .message-content ol { margin-bottom:12px;padding-left:36px }
.chatting .message.assistant .label { font-size:13px;line-height:16px;gap:10px;margin-bottom:20px }
.chatting .message .actions { gap:4px }
.chatting .message .actions button,.chatting .user-actions button {
  display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:50%;color:var(--muted)
}
.chatting .message .actions button[data-action="second"] {
  display:flex;width:auto;padding:0 12px;border-radius:999px;border:1px solid var(--line);color:inherit;font-size:13px;white-space:nowrap
}
.chatting .user-actions { right:0;top:calc(100% + 4px);gap:0 }
.chatting .actions button:hover,.chatting .user-actions button:hover { background:var(--composer);color:inherit }
.chatting #prompt { font-size:16px;line-height:28px }
@media (max-width:590px) {
  .chatting .chat-heading,.chatting .message.assistant { padding-inline:8px }
  .chatting .message .actions button,.chatting .user-actions button { width:32px;height:32px }
  .chatting .message .actions { gap:0;flex-wrap:wrap }
  .share-chat-footer fieldset { flex-wrap:wrap }
}
