/* Attio-style side conversation, using the ERP's shared fonts and icons. */
.q-launcher { display:flex; align-items:center; gap:6px; width:100%; height:40px; padding:0 4px; font-family:var(--dq-font); }
.q-icon-trigger { display:grid; place-items:center; width:30px; height:32px; flex:none; padding:0; border:0; border-radius:6px; background:transparent; cursor:pointer; }
.q-icon-trigger img { width:30px; height:30px; object-fit:contain; mix-blend-mode:multiply; }
.q-icon-trigger:hover { background:var(--dq-hover); }
body.dq-module .q-launcher .q-icon-trigger { width:30px; height:32px; min-height:32px; padding:0; border:0; background:transparent; box-shadow:none; }
body.dq-module .q-launcher .q-icon-trigger:hover { background:var(--dq-hover); }
.q-entry { display:flex; align-items:center; gap:4px; flex:1; min-width:0; height:36px; margin:0; padding:0 4px 0 12px; border:1px solid var(--dq-line); border-radius:18px; background:#fff; }
.q-entry textarea { display:block; width:100%; min-width:0; height:20px; padding:0; resize:none; overflow:hidden; white-space:nowrap; border:0; outline:none; background:transparent; color:var(--dq-ink); font:13px/20px var(--dq-font); }
.dq-ui .q-entry textarea:focus,.dq-ui .q-entry textarea:focus-visible { outline:none; box-shadow:none; }
.q-entry textarea::placeholder { color:var(--dq-faint); }
.q-composer-tools { display:flex; align-items:center; gap:10px; }
.q-launcher .q-page-chip,.q-launcher .q-compose-mode { display:none; }
.q-send { display:grid; place-items:center; flex:none; width:30px; height:30px; padding:0; border:0; border-radius:9px; background:#5988f5; color:#fff; cursor:pointer; }
.q-send:disabled { background:#abc2f9; color:#fff; cursor:default; }
.q-launcher .q-send { width:26px; height:26px; }
.q-launcher .q-send:disabled { color:var(--dq-faint); background:transparent; }
.q-launcher.is-compact { justify-content:center; width:40px; padding:0; }
.q-launcher.is-open:not(.is-compact) { visibility:hidden; }
.q-assistant { position:fixed; z-index:1250; left:8px; right:auto; bottom:12px; width:260px; max-width:calc(100vw - 16px); height:min(440px,calc(100dvh - 73px)); display:flex; flex-direction:column; padding:0; border:1px solid var(--dq-line); border-radius:18px; background:#fff; color:var(--dq-ink); box-shadow:var(--dq-mid); font:13px/1.6 var(--dq-font); box-sizing:border-box; overflow:hidden; transform-origin:bottom left; }
.q-assistant.is-expanded { --q-expanded-width:min(640px,calc(100vw - 32px),calc((100dvh - 80px) * 1.5)); width:var(--q-expanded-width); height:min(calc(var(--q-expanded-width) / 1.5 + 120px),calc(100dvh - 73px)); aspect-ratio:auto; }
/* The outer window must never scroll on focus; only the conversation scrolls. */
.q-assistant { overflow:clip; }
.q-assistant[hidden],.q-assistant [hidden] { display:none !important; }
.q-assistant *,.q-launcher * { box-sizing:border-box; }
.q-assistant button { font:inherit; cursor:pointer; }
.q-assistant svg,.q-launcher svg { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:var(--dq-icon-stroke,1.5); }
.q-head { position:relative; display:flex; align-items:center; gap:6px; flex:none; height:44px; padding:0 10px 0 12px; border-bottom:1px solid var(--dq-line-soft); }
.q-head h2 { display:flex; align-items:center; gap:6px; margin:0; min-width:0; font-size:13px; line-height:20px; font-weight:550; }
.q-head h2 img { width:20px; height:20px; object-fit:contain; mix-blend-mode:multiply; }
.q-chat-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-window-actions { display:flex; gap:1px; flex:none; margin-left:auto; }
.q-window-actions button { display:grid; place-items:center; width:24px; height:26px; padding:0; border:0; border-radius:6px; color:#74767a; background:transparent; }
.q-window-actions [data-q="expand"][aria-pressed="true"] svg { transform:rotate(180deg); }
.q-assistant.is-expanded .q-window-actions [data-q="close"] { display:none; }
.q-window-actions button:hover { background:var(--dq-hover); color:var(--dq-ink); }
.q-more-menu { position:absolute; z-index:2; top:46px; right:18px; width:190px; padding:5px; border:1px solid var(--dq-line); border-radius:10px; box-shadow:var(--dq-mid); background:#fff; }
.q-more-menu button { display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border:0; border-radius:6px; background:transparent; color:var(--dq-ink2); text-align:left; font-size:13px; }
.q-more-menu button:hover { background:var(--dq-hover); }
.q-conversation { flex:1; min-height:0; overflow:auto; padding:14px 14px 18px; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--dq-g300) transparent; }
.q-empty { margin:48px 0 32px; text-align:left; }
.q-empty strong { display:block; font-size:22px; line-height:30px; font-weight:550; }
.q-empty p { margin:10px 0 0; color:var(--dq-sub); font-size:14px; line-height:24px; }
.q-messages { display:flex; flex-direction:column; gap:18px; }
.q-user-message { align-self:flex-end; max-width:88%; padding:8px 12px; background:#f4f4f4; border-radius:14px; color:var(--dq-ink); white-space:pre-wrap; overflow-wrap:anywhere; }
.q-reply { color:var(--dq-ink); overflow-wrap:anywhere; }
.q-answer-text { font-size:13px; line-height:1.5; }
.q-answer-text p { margin:0 0 8px; }
.q-answer-text p:last-child { margin-bottom:0; }
.q-answer-text strong { font-weight:600; }
.q-answer-text h3 { margin:12px 0 6px; font-size:15px; font-weight:600; }
.q-answer-text ul,.q-answer-text ol { margin:4px 0 6px; padding-left:22px; line-height:1.35; }
.q-answer-text li { margin:1px 0; }
.q-answer-text code { font:13px var(--dq-mono); padding:1px 4px; border-radius:4px; background:var(--dq-g100); }
.q-table-scroll { max-width:100%; margin:8px 0 12px; overflow-x:auto; border:1px solid var(--dq-line); border-radius:8px; scrollbar-width:thin; overscroll-behavior-x:contain; }
.q-table-scroll:focus-visible { outline:2px solid var(--dq-accent); outline-offset:2px; }
.q-table-scroll table { width:100%; min-width:calc(var(--q-table-columns) * 88px); border-collapse:collapse; table-layout:fixed; font-size:12px; line-height:1.45; }
.q-table-scroll th,.q-table-scroll td { padding:7px 8px; vertical-align:top; overflow-wrap:anywhere; border-bottom:1px solid var(--dq-line-soft); }
.q-table-scroll th { background:var(--dq-g50); font-weight:600; }
.q-table-scroll th+th,.q-table-scroll td+td { border-left:1px solid var(--dq-line-soft); }
.q-table-scroll table[data-columns="2"] th:first-child { width:30%; }
.q-table-scroll tbody tr:last-child td { border-bottom:0; }
.q-assistant.is-expanded .q-table-scroll table { font-size:13px; }
.q-reply>button { display:block; margin-top:8px; padding:4px 0; border:0; background:transparent; color:var(--dq-sub); font-size:12px; }
.q-answer-actions { display:flex; align-items:center; gap:6px; margin-top:10px; }
.q-page-links { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.q-page-links button { display:inline-flex; align-items:center; gap:4px; padding:5px 8px; border:1px solid var(--dq-border,#e4e5e7); border-radius:6px; background:transparent; color:var(--dq-ink); font:inherit; font-size:12px; cursor:pointer; }
.q-page-links button:hover { background:var(--dq-hover); }
.q-page-links button svg { width:13px; height:13px; }
.q-navigation-status { flex-basis:100%; margin:0; color:var(--dq-muted,#71737a); font-size:12px; line-height:1.4; }
.q-navigation-status[data-state="error"] { padding:6px 8px; border-radius:6px; color:var(--dq-danger-tx,#ba2525); background:var(--dq-danger-bg,#ffebeb); font-weight:500; }
.q-navigation-status:empty { display:none; }
.q-answer-actions button { display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:6px; color:#7b7d80; background:transparent; }
.q-answer-actions button:hover { background:var(--dq-hover); color:var(--dq-ink); }
.q-pending { color:var(--dq-sub); font-size:13px; }
.q-streaming-note { display:block; margin-top:6px; color:var(--dq-sub); font-size:11px; }
.q-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.q-assistant>.q-entry { display:flex; flex-direction:column; align-items:stretch; flex:none; gap:8px; height:110px; padding:10px 10px 8px; margin:0 10px 10px; border:1px solid #d5d9e1; border-radius:14px; }
.q-assistant>.q-entry:focus-within { border-color:#b9ceff; box-shadow:0 0 0 1px #b9ceff30; }
.q-assistant>.q-entry textarea { flex:1; height:60px; white-space:pre-wrap; overflow:auto; font-size:13px; line-height:20px; }
.q-assistant .q-composer-tools { width:100%; }
.q-page-chip { display:flex; align-items:center; gap:7px; min-width:0; max-width:65%; padding:4px 7px; border:1px solid var(--dq-line-soft); border-radius:8px; background:#f7f7f8; color:#686a6d; font-size:12px; }
.q-page-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.q-page-chip svg { width:15px; height:15px; }
.q-compose-mode { margin-left:auto; color:var(--dq-sub); font-size:12px; }
.q-assistant button:focus-visible,.q-icon-trigger:focus-visible { outline:2px solid var(--dq-accent); outline-offset:2px; }
.q-motion-ghost { pointer-events:none; user-select:none; }
.q-launcher[hidden] { display:none !important; }
.q-launcher.is-standalone { position:fixed; right:12px; bottom:12px; width:220px; z-index:1240; }
.q-assistant.is-standalone { left:auto; right:12px; }
.q-source-content { white-space:pre-wrap; }
.q-reply details { margin:10px 0; font-size:12px; }
.q-reply summary { cursor:pointer; color:var(--dq-sub); }
.q-source-content { margin-top:8px; padding:10px; border-left:2px solid var(--dq-line); color:var(--dq-ink2); background:var(--dq-g50); }
.q-feedback-draft { padding:14px; border:1px solid var(--dq-line); border-radius:10px; background:var(--dq-g50); }
.q-feedback-draft strong { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:550; }
.q-feedback-draft label { display:block; margin-top:10px; font-size:12px; }
.q-feedback-draft textarea { display:block; width:100%; min-height:90px; margin-top:0; padding:8px; border:1px solid var(--dq-line); border-radius:6px; font:inherit; box-sizing:border-box; resize:vertical; }
.q-feedback-draft p { font-size:12px; color:var(--dq-sub); }
.q-feedback-draft button { margin-right:8px; padding:5px 12px; border:1px solid var(--dq-line); border-radius:6px; background:#fff; font-size:12px; }
.q-feedback-draft button[type="submit"] { background:var(--dq-ink); color:#fff; border-color:var(--dq-ink); }
.q-history-popup { position:fixed; z-index:1251; display:flex; flex-direction:column; padding:0; border:1px solid #303237; border-radius:12px; background:#191a1d; color:#f4f4f5; box-shadow:0 6px 24px #0002; font:13px/1.5 var(--dq-font); box-sizing:border-box; overflow:hidden; }
.q-history-popup[hidden],.q-history-popup [hidden] { display:none !important; }
.q-history-popup * { box-sizing:border-box; }
.q-history-popup header { display:flex; align-items:center; justify-content:space-between; flex:none; height:44px; padding:0 12px; border-bottom:1px solid #303237; }
.q-history-popup header strong { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:550; }
.q-history-popup button { border:0; border-radius:6px; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.q-history-popup header button { display:grid; place-items:center; width:24px; height:24px; padding:0; }
.q-history-popup svg { width:16px; height:16px; flex:none; fill:none; stroke:currentColor; stroke-width:var(--dq-icon-stroke,1.5); }
.q-history-status { flex:none; margin:0; padding:12px; color:#c9cbd0; font-size:12px; }
.q-history-status:empty { display:none; }
.q-history-list { flex:1; min-height:0; padding:6px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#55575c transparent; }
.q-history-group { margin-bottom:3px; }
.q-history-thread { display:flex; align-items:flex-start; gap:7px; width:100%; padding:9px 7px; text-align:left; }
.q-history-thread span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.q-history-thread svg { margin-top:2px; color:#bfc1c6; }
.q-history-thread[aria-expanded="true"] { background:#303237; }
.q-history-thread[aria-expanded="true"] svg { transform:rotate(90deg); }
.q-history-questions { margin:6px 0 10px 15px; padding-left:6px; border-left:1px solid #414348; }
.q-history-questions button { display:block; width:100%; padding:7px 8px; color:#dedfe3; font-size:12px; line-height:18px; text-align:left; overflow-wrap:anywhere; }
.q-history-popup button:hover,.q-history-questions button[aria-current="true"] { background:#34363b; color:#fff; }
.q-history-popup button:focus-visible { outline:2px solid #c5d5ff; outline-offset:-2px; }
.q-history-target { box-shadow:0 0 0 2px var(--dq-g300); }
.q-assistant.is-expanded .q-head { padding:0 16px; }
.q-assistant.is-expanded .q-conversation { padding:16px 20px 20px; }
.q-assistant.is-expanded .q-answer-text { font-size:14px; }
.q-assistant.is-expanded>.q-entry { margin:0 14px 12px; }
.q-assistant.is-expanded .q-head h2 { font-size:14px; }
@media(max-height:650px) { .q-empty { margin-top:24px; } }
