/* Diligence: the shared look after the older application (research report 65, sections 5 and 6): the sheet, the top
   banner, section labels, the pulsing dot, the activity bar, empty states, the Markdown of answers, citation marks, the
   source viewer, the log, Ask, the memo's writing view and adding documents. Our own colours and fonts; the older
   application's structure, sizes and restraint. Hairlines, not boxes; status is a word; one filled button a screen; no
   coloured side-stripes anywhere (selection is a background fill). */

:root {
  --hl: rgba(255, 219, 89, .45); --hl-strong: rgba(255, 219, 89, .62);
  --sep: rgba(27, 23, 20, .10); --subtle: rgba(27, 23, 20, .035); --card-stroke: rgba(27, 23, 20, .14);
  --cite-bg: rgba(59, 63, 134, .13); --cite-bg-h: rgba(59, 63, 134, .22); --cite-ink: #3B3F86;
  --k-pdf: #9E473D; --k-word: #3D669E; --k-sheet: #337854;
  --veil: rgba(27, 23, 20, .28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hl: rgba(184, 148, 31, .55); --hl-strong: rgba(184, 148, 31, .75); --sep: rgba(243, 236, 220, .10); --subtle: rgba(243, 236, 220, .035);
    --card-stroke: rgba(243, 236, 220, .14); --cite-bg: rgba(174, 178, 242, .16); --cite-bg-h: rgba(174, 178, 242, .26); --cite-ink: #AEB2F2;
    --k-pdf: #E0897D; --k-word: #8FB0E3; --k-sheet: #8CC9A6; --veil: rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  --hl: rgba(184, 148, 31, .55); --hl-strong: rgba(184, 148, 31, .75); --sep: rgba(243, 236, 220, .10); --subtle: rgba(243, 236, 220, .035);
  --card-stroke: rgba(243, 236, 220, .14); --cite-bg: rgba(174, 178, 242, .16); --cite-bg-h: rgba(174, 178, 242, .26); --cite-ink: #AEB2F2;
  --k-pdf: #E0897D; --k-word: #8FB0E3; --k-sheet: #8CC9A6; --veil: rgba(0, 0, 0, .45);
}

/* ---------- small parts ---------- */
.lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lbl .n { color: var(--faint); letter-spacing: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
:root[data-theme="dark"] .pulse { background: var(--link); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ring 1.3s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: .6; } to { transform: scale(1.9); opacity: 0; } }
.actbar { height: 2px; border-radius: 1px; overflow: hidden; background: transparent; position: relative; }
.actbar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 1.2s ease-in-out infinite alternate; }
@keyframes sweep { from { left: -35%; } to { left: 100%; } }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid var(--rule); border-top-color: var(--accent); display: inline-block; animation: spin .9s linear infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { .pulse::after, .actbar::after, .spin { animation: none; } }
.good-w { color: var(--t-good); } .warn-w { color: var(--t-warn); } .bad-w { color: var(--t-bad); }
.card { background: var(--card); border: 1px solid var(--card-stroke); border-radius: 10px; }
.hrows > * + * { border-top: 1px solid var(--sep); }
.btn.link { border: 0; background: none; color: var(--link); padding: 2px 4px; }
.btn.link:hover { text-decoration: underline; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 24px; height: 100%; min-height: 240px; }
.empty > svg { width: 38px; height: 38px; color: var(--faint); stroke-width: 1.2; }
.empty .e-title { font-size: 17px; font-weight: 600; color: var(--text); }
.empty .e-sub { color: var(--muted); max-width: 440px; font-size: 13.5px; }
.empty .btn { margin-top: 6px; }

/* ---------- the banner (toast) at the top centre ---------- */
.toasts { left: 50%; right: auto; top: 8px; bottom: auto; transform: translateX(-50%); justify-items: center; width: min(620px, calc(100vw - 32px)); }
.toast { width: auto; max-width: 620px; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--text); backdrop-filter: blur(14px);
  border: .5px solid color-mix(in srgb, var(--t-info) 35%, transparent); box-shadow: 0 4px 12px rgba(0, 0, 0, .12); padding: 9px 10px 9px 12px; gap: 10px; align-items: flex-start; animation: toastdown .3s ease-out; }
.toast.bad { background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--t-bad) 35%, transparent); }
:root[data-theme="dark"] .toast.bad { background: color-mix(in srgb, var(--panel) 90%, transparent); }
.toast.good { border-color: color-mix(in srgb, var(--t-good) 35%, transparent); }
.toast .t-i { width: 16px; height: 16px; margin-top: 1px; color: var(--t-info); }
.toast.bad .t-i { color: var(--t-bad); } .toast.good .t-i { color: var(--t-good); }
.toast.warn { border-color: color-mix(in srgb, var(--t-warn) 35%, transparent); } .toast.warn .t-i { color: var(--t-warn); }
.toast .t-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.toast .t-act { color: var(--link); font-weight: 600; white-space: nowrap; }
.toast .t-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; display: inline-flex; }
.toast .t-x svg { width: 13px; height: 13px; }
@keyframes toastdown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the sheet ---------- */
.sheet-veil { position: fixed; inset: 0; background: var(--veil); z-index: 32; display: flex; align-items: flex-start; justify-content: center; padding: 28px 20px 20px; }
.sheet { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; min-height: 0; max-height: 100%; width: min(900px, 100%); outline: none; animation: sheetin .25s ease-out; }
@keyframes sheetin { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.sh-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px 12px 20px; border-bottom: 1px solid var(--sep); }
.sh-titles { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sh-title { font-size: 17px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-sub:empty { display: none; }
.sh-right { display: flex; align-items: center; gap: 12px; flex: none; }
.sh-body { flex: 1; min-height: 0; overflow: auto; }

/* the dialog of forms: the same sheet look, the title in the sheet's size */
.overlay { background: var(--veil); align-items: flex-start; padding-top: 48px; }
.modal { border-radius: 12px; gap: 12px; padding: 20px 22px 16px; animation: sheetin .25s ease-out; }
.modal-title { font-family: var(--sans); font-size: 17px; font-weight: 600; line-height: 1.25; }
.modal-sub { margin: -4px 0 2px; font-size: 13px; }
.field > span { font-weight: 500; }
.fcap { font-size: 12px; color: var(--muted); margin: 0; }
.hair { height: 1px; background: var(--sep); margin: 2px 0; }

/* ---------- Markdown ---------- */
.md { font-size: 15px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; max-width: 716px; }
.md > * { margin: 0; }
.md > * + * { margin-top: 10px; }
.md p { margin: 0; }
.md strong { font-weight: 600; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--subtle); padding: 0 4px; border-radius: 4px; }
.md .md-h { font-weight: 600; line-height: 1.3; }
.md .md-h1 { font-size: 21px; padding-top: 8px; } .md .md-h2 { font-size: 18px; padding-top: 8px; } .md .md-h3 { font-size: 15.5px; color: var(--soft); padding-top: 2px; }
.md-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.md-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.md-list .md-list { margin-top: 7px; margin-left: 4px; }
.md-dot { color: var(--accent); font-weight: 700; text-align: center; }
:root[data-theme="dark"] .md-dot { color: var(--link); }
.md-n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: .93em; }
.md blockquote { margin: 0; padding: 0 0 0 14px; font-style: italic; color: var(--soft); }
.md-code { font: 11.5px/1.5 var(--mono); background: var(--subtle); border-radius: 6px; padding: 10px; overflow: auto; white-space: pre; }
.md hr { border: 0; height: 1px; background: var(--sep); }
.md-table { border: 1px solid var(--card-stroke); border-radius: 10px; background: var(--card); overflow-x: auto; max-width: 100%; }
.md-table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md-table th { font-size: 13.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--sep); vertical-align: bottom; }
.md-table td { padding: 7px 12px; border-top: 1px solid var(--sep); vertical-align: top; font-variant-numeric: tabular-nums; }
.md-table tr:first-child td { border-top: 0; }
.md-table .fig { white-space: nowrap; }
.md-table td.empty { color: var(--faint); }
.md-link { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }

/* ---------- citation marks ---------- */
.cite { font: 600 max(9px, .74em)/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--cite-ink); background: var(--cite-bg); border: 0; border-radius: 4px;
  padding: 2px .3em; margin: 0 .12em 0 .16em; vertical-align: .18em; cursor: pointer; }
.cite:hover, .cite:focus-visible { background: var(--cite-bg-h); }
.cite.missing { color: var(--muted); background: var(--subtle); }
.cite-group { display: inline-flex; align-items: center; gap: 2px; font: 600 max(9px, .74em)/1 var(--mono); color: var(--muted); background: var(--subtle); border: 0; border-radius: 4px; padding: 2px 4px;
  margin: 0 .12em 0 .16em; vertical-align: .14em; cursor: pointer; }
.cite-group .cg-i { width: 1em; height: 1em; vertical-align: 0; }
.cite-group:hover, .cite-group[aria-expanded="true"], .cite-group:focus-visible { color: var(--cite-ink); background: var(--cite-bg); }
.cnum { display: inline-block; min-width: 20px; text-align: center; font: 600 10.5px/1 var(--mono); color: var(--cite-ink); background: var(--cite-bg); border-radius: 4px; padding: 3px 5px; }
.cite-pop { position: fixed; z-index: 60; width: 380px; max-width: calc(100vw - 16px); max-height: 340px; overflow: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--card-stroke);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 5px; display: grid; gap: 1px; }
.cpop-arrow { position: absolute; top: -6px; width: 10px; height: 10px; background: var(--panel); border-left: 1px solid var(--card-stroke); border-top: 1px solid var(--card-stroke); transform: translateX(-50%) rotate(45deg); }
.cite-pop.above .cpop-arrow { top: auto; bottom: -6px; transform: translateX(-50%) rotate(225deg); }
.cpop-row { display: grid; gap: 3px; text-align: left; border: 0; background: none; border-radius: 6px; padding: 7px 9px; cursor: pointer; color: var(--text); font: inherit; }
.cpop-row:hover, .cpop-row:focus-visible { background: var(--cite-bg); outline: none; }
.cpop-row.missing { cursor: default; color: var(--muted); }
.cpop-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cpop-title { font-size: 12.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpop-place { font-size: 12px; color: var(--muted); flex: none; }
.cpop-quote { font: italic 11.5px/1.4 var(--serif); font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-left: 28px; }

/* ---------- the source viewer ---------- */
.sheet.sv { width: min(1000px, 92vw); height: min(820px, calc(100vh - 48px)); min-height: min(620px, calc(100vh - 48px)); }
.sv-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.sv-kind { flex: none; display: inline-flex; }
.sv-kind svg { width: 20px; height: 20px; }
.sv-kind.k-pdf { color: var(--k-pdf); } .sv-kind.k-word { color: var(--k-word); } .sv-kind.k-sheet { color: var(--k-sheet); } .sv-kind.k-other { color: var(--muted); }
.sv-titles { min-width: 0; display: grid; gap: 2px; }
.sv-title { font-size: 15px; font-weight: 600; }
.sv-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-state.good { color: var(--t-good); } .sv-state.warn { color: var(--t-warn); }
.sheet.sv .sh-body { display: flex; flex-direction: column; overflow: hidden; }
.sv-passage { padding: 12px 20px 14px; border-bottom: 1px solid var(--sep); display: grid; gap: 6px; flex: none; max-height: 30%; overflow: auto; }
.sv-label { font-size: 10px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.sv-quote { font: 15px/1.5 var(--serif); font-size: 16px; max-width: 760px; user-select: text; quotes: "“" "”"; }
.sv-quote:not(.none) { background: var(--hl); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 1px 2px; border-radius: 2px; color: var(--text); }
:root[data-theme="dark"] .sv-quote:not(.none) { color: var(--text); }
.sv-quote.none { color: var(--muted); font-style: italic; background: none; }
.sv-note { font-size: 12px; color: var(--t-warn); }
.sv-content { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.sv-loading { margin: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.sv-fail { margin: auto; display: grid; justify-items: center; gap: 6px; padding: 40px; text-align: center; }
.sv-fail svg.big { width: 34px; height: 34px; color: var(--faint); stroke-width: 1.3; }
.sv-fail-t { font-weight: 600; }
.sv-pages { flex: 1; min-height: 0; }
.sv-pages .pv-scroll { background: color-mix(in srgb, var(--bg) 80%, #777 20%); }
.sv-pages .hlbox { background: rgba(255, 214, 10, .42); outline: none; border-radius: 1px; }
.sv-doc { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.sv-doc.with-list { grid-template-columns: 200px minmax(0, 1fr); }
.sv-list { border-right: 1px solid var(--sep); overflow: auto; padding: 8px 6px; display: grid; align-content: start; gap: 1px; background: var(--panel); }
.sv-li { text-align: left; border: 0; background: none; padding: 6px 9px; border-radius: 6px; font-size: 12.5px; color: var(--soft); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-li:hover { background: var(--hover); }
.sv-li.on { background: var(--sel); color: var(--sel-text); font-weight: 600; }
.sv-text { overflow: auto; padding: 24px 28px 40px; background: var(--card); min-height: 0; }
.sv-plabel { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.sv-prose { font: 14px/1.6 var(--serif); font-size: 15.5px; max-width: 720px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); user-select: text; }
.sv-mark { background: var(--hl-strong); color: inherit; border-radius: 2px; padding: 0 1px; }
.sv-rows { font: 12px/1.65 var(--mono); }
.sv-row { white-space: pre; display: flex; gap: 12px; padding: 0 4px; border-radius: 3px; width: max-content; min-width: 100%; }
.sv-row.head { color: var(--muted); }
.sv-row.on { background: var(--hl); }
.sv-row .sv-mark { background: transparent; padding: 0; }
.sv-rn { color: var(--faint); min-width: 32px; text-align: right; flex: none; user-select: none; }

/* ---------- the log ---------- */
.sheet.lg { width: min(900px, 92vw); height: min(720px, calc(100vh - 48px)); min-height: min(560px, calc(100vh - 48px)); }
.sheet.lg .sh-body { display: flex; flex-direction: column; overflow: hidden; }
.lg-live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12.5px; font-weight: 600; }
:root[data-theme="dark"] .lg-live { color: var(--link); }
.lg-bar { display: flex; align-items: center; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--sep); flex: none; }
.lg-bar:has(> select, > .seg) { padding-top: 10px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 8px; padding: 2px; gap: 2px; }
.seg-b { border: 0; background: none; padding: 4px 11px; border-radius: 6px; font-size: 12.5px; color: var(--soft); cursor: pointer; white-space: nowrap; }
.seg-b.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.lg-pick { max-width: 360px; padding: 5px 8px; font-size: 13px; }
.lg-list { flex: 1; min-height: 0; overflow: auto; padding: 6px 20px 16px; }
.lg-row { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr); gap: 4px 8px; padding: 4px 0; align-items: start; }
.lg-row.detail { border-top: 1px solid var(--sep); padding: 9px 0; }
.lg-t { font: 10.5px/18px var(--mono); color: var(--faint); text-align: right; }
.lg-sign { display: inline-flex; padding-top: 2px; }
.lg-sign svg { width: 14px; height: 14px; }
.s-grey { color: var(--faint); } .s-acc { color: var(--accent); } .s-ink { color: var(--text); } .s-good { color: var(--t-good); } .s-bad { color: var(--t-bad); }
:root[data-theme="dark"] .s-acc { color: var(--link); }
.lg-main { min-width: 0; display: grid; gap: 3px; }
.lg-title { font-size: 12.5px; color: var(--muted); }
.lg-row.detail .lg-title { color: var(--text); font-weight: 600; }
.lg-row.quiet .lg-title { color: var(--faint); }
.lg-mono { font: 11.5px/1.45 var(--mono); color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.lg-result { font: 11px/1.45 var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.lg-result.warn { color: var(--t-warn); }
.lg-body { font: 10.5px/1.5 var(--mono); background: var(--subtle); border-radius: 6px; padding: 8px 10px; margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; color: var(--soft); }
.l-good { color: var(--t-good); } .l-bad { color: var(--t-bad); } .l-acc { color: var(--accent); }
.lg-more { font-size: 12px; margin-top: 3px; }
.lg-empty { color: var(--muted); padding: 40px 0; text-align: center; display: flex; gap: 8px; align-items: center; justify-content: center; }
.lg-foot { display: flex; align-items: center; gap: 14px; padding: 10px 18px 12px 20px; border-top: 1px solid var(--sep); }
.lg-count { font-size: 11.5px; color: var(--muted); }

/* ---------- Ask: the composer ---------- */
.ask { height: 100%; min-height: 0; }
.ask-scroll { height: 100%; overflow: auto; }
.compose { max-width: 820px; margin: 0 auto; padding: 36px 40px 48px; display: grid; gap: 26px; }
.compose-title h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 0; }
.compose-title p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.qbox textarea { width: 100%; display: block; resize: none; font: 15px/1.5 var(--sans); padding: 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--input); color: var(--text); min-height: 76px; max-height: 172px; }
.qbox textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qbox textarea::placeholder { color: var(--faint); }
.qrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.qhint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex: 1; min-width: 200px; }
.qhint svg { width: 14px; height: 14px; color: var(--faint); }
.qrow .btn.primary { padding: 7px 14px; }
.qrow .rs-tick { margin: 0; }
.ask-err { color: var(--t-bad); font-size: 12.5px; }
.ask-err:empty { display: none; }
.try { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.try-card { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--card-stroke); background: var(--card); border-radius: 10px; padding: 12px; min-height: 44px; font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.4; }
.try-card:hover { border-color: var(--faint); }
.try-card svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }
:root[data-theme="dark"] .try-card svg { color: var(--link); }
.recent-card { margin-top: 10px; overflow: hidden; }
.rq { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 12px; cursor: pointer; color: var(--text); font: inherit; border-radius: 0; flex-wrap: nowrap; }
.rq + .rq { border-top: 1px solid var(--sep); }
.rq:hover { background: var(--hover); }
.rq > svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.rq-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.rq-meta { font-size: 12px; color: var(--faint); white-space: nowrap; flex: none; }
.rq.on { background: var(--sel); }
.reading-strip { display: flex; align-items: center; gap: 10px; padding: 9px 20px; border-bottom: 1px solid var(--sep); font-size: 13px; color: var(--soft); background: var(--panel); }
.reading-strip .grow { flex: 1; min-width: 0; }
.wait-box { display: grid; gap: 10px; }
.wait-box .acts { display: flex; gap: 8px; }

/* ---------- Ask: the conversation ---------- */
.conv { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--sep); min-width: 0; }
.conv-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--cite-bg); color: var(--cite-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.conv-ic svg { width: 17px; height: 17px; }
.conv-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.conv-q { font-size: 16px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.conv-st { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-st .clock { color: var(--faint); font-variant-numeric: tabular-nums; }
.conv-st svg { width: 13px; height: 13px; }
.conv-acts { display: flex; gap: 6px; flex: none; }
.conv-body { display: grid; grid-template-columns: clamp(300px, 34%, 400px) minmax(0, 1fr); min-height: 0; }
.conv-body.no-act { grid-template-columns: minmax(0, 1fr); }
.conv-body.no-act .activity { display: none; }
.activity { background: var(--subtle); border-right: 1px solid var(--sep); overflow: auto; padding: 18px; display: grid; align-content: start; gap: 18px; animation: slidein .35s ease-out; }
@keyframes slidein { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.ag-card { background: var(--card); border: 1px solid var(--card-stroke); border-radius: 10px; padding: 12px; display: grid; gap: 8px; cursor: pointer; position: relative; overflow: hidden; }
.ag-card:hover { border-color: var(--accent); }
.ag-card.waiting { opacity: .6; }
.ag-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ag-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--cite-bg); color: var(--cite-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ag-ic svg { width: 14px; height: 14px; }
.ag-name { font-size: 13px; font-weight: 600; }
.ag-desc { font-size: 10.5px; color: var(--faint); }
.ag-phase { margin-left: auto; font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--faint); }
.ag-phase.working { color: var(--accent); font-weight: 600; }
:root[data-theme="dark"] .ag-phase.working { color: var(--link); }
.ag-phase.done { color: var(--t-good); }
.ag-status { font-size: 12px; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ag-calls { display: grid; gap: 5px; }
.ag-call { font: 10.5px/1.4 var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-call .r { display: block; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.ag-call .r.warn { color: var(--t-warn); }
.ag-count { font-size: 10.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ag-card .actbar { position: absolute; left: 0; right: 0; bottom: 0; }
.ag-checked { display: flex; gap: 18px; align-items: baseline; font-size: 12px; color: var(--muted); }
.ag-checked b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ag-checked .good-w b { color: var(--t-good); }
.act-link { justify-self: start; font-size: 11.5px; display: inline-flex; gap: 5px; align-items: center; }
.act-link svg { width: 12px; height: 12px; }
.turns-col { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.turns { overflow: auto; min-height: 0; }
.turns-in { max-width: 780px; padding: 26px 32px 32px; display: grid; gap: 30px; }
.turn { display: grid; gap: 14px; min-width: 0; }
.turn + .turn { border-top: 1px solid var(--sep); padding-top: 30px; }
.turn-q { display: flex; align-items: baseline; gap: 10px; }
.turn-q .q { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.turn-q .q:hover { color: var(--link); }
.turn-q .tag { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.turn-q .tag.acc { color: var(--accent); }
:root[data-theme="dark"] .turn-q .tag.acc { color: var(--link); }
.turn-note { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.turn-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.turn-note.warn { color: var(--t-warn); }
.turn-ans { display: grid; gap: 14px; min-width: 0; }
.turn-ans > div > .lbl + .card { margin-top: 8px; }
.ans-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ans-wait { display: grid; gap: 10px; }
.ans-wait p { margin: 0; font-size: 13px; color: var(--muted); }
.bar { height: 12px; border-radius: 6px; background: var(--sep); }
.ans-none { font-size: 15px; line-height: 1.5; color: var(--soft); margin: 0; max-width: 716px; }
.srcs-card { overflow: hidden; }
.src-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; width: 100%; border: 0; background: none; text-align: left; padding: 9px 12px; cursor: pointer; color: var(--text); font: inherit; }
.src-row + .src-row { border-top: 1px solid var(--sep); }
.src-row:hover { background: var(--hover); }
.src-row .cnum { grid-row: span 2; align-self: start; margin-top: 1px; }
.src-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.src-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.src-place { font-size: 12.5px; color: var(--muted); white-space: nowrap; flex: none; }
.src-place .warn-w { margin-left: 4px; }
.src-q { grid-column: 2; font: italic 13px/1.45 var(--serif); font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.src-open { grid-row: span 2; color: var(--faint); align-self: start; }
.src-open svg { width: 13px; height: 13px; }
.stats { border-top: 1px solid var(--sep); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.stats span { display: inline-flex; gap: 5px; align-items: center; }
.stats svg { width: 12px; height: 12px; color: var(--faint); }
.stats .local { color: var(--t-good); flex-basis: 100%; }
.stats .local svg { color: var(--t-good); }
.followbar { border-top: 1px solid var(--sep); padding: 12px 24px; }
.followbar-in { max-width: 830px; display: flex; gap: 8px; align-items: flex-end; }
.followbar textarea { flex: 1; min-width: 0; resize: none; font: 14px/1.45 var(--sans); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--input); color: var(--text); min-height: 40px; max-height: 110px; }
.followbar textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.followbar textarea:disabled { opacity: .6; }
.send { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 10px; flex: none; }
.send svg { width: 18px; height: 18px; }
.followbar .rs-tick { margin: 6px 0 0; }

/* ---------- adding documents ---------- */
.drop-veil { background: rgba(59, 63, 134, .05); outline: none; }
.drop-veil::before { content: ""; position: absolute; inset: 16px; border: 1.5px dashed var(--accent); border-radius: 14px; }
.drop-veil div { background: transparent; box-shadow: none; padding: 0; display: grid; justify-items: center; gap: 6px; }
.drop-veil svg { width: 40px; height: 40px; color: var(--accent); stroke-width: 1.3; }
.drop-veil .dv-t { font-size: 19px; font-weight: 500; color: var(--text); }
.drop-veil .dv-s { font-size: 13px; color: var(--muted); }
.reading-line { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--soft); }
.reading-line .pbar { width: 220px; max-width: 30vw; height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.reading-line .pbar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.import-note { margin: 10px 18px 0; display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--soft); background: var(--card); border: 1px solid var(--card-stroke); border-radius: 10px; padding: 9px 10px 9px 12px; }
.import-note svg { width: 14px; height: 14px; margin-top: 2px; flex: none; color: var(--accent); }
.import-note .grow { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.import-note .t-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; display: inline-flex; }
.import-note .imp-why summary { cursor: pointer; list-style: none; }
.import-note .imp-why summary::-webkit-details-marker { display: none; }
.import-note .imp-why .lnk { color: var(--accent); text-decoration: underline; }
.import-note .imp-names { margin-top: 2px; color: var(--muted); }
.rstate { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rstate svg { width: 13px; height: 13px; }
.rstate.ready { color: var(--t-good); } .rstate.warn { color: var(--t-warn); } .rstate.bad { color: var(--t-bad); }
.trow.queued { opacity: .6; }
.room-list { overflow: hidden; }
.room-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 10px 14px; cursor: pointer; color: var(--text); font: inherit; }
.room-row + .room-row { border-top: 1px solid var(--sep); }
.room-row:hover { background: var(--hover); }
.room-row > svg:first-child { width: 16px; height: 16px; color: var(--accent); flex: none; }
:root[data-theme="dark"] .room-row > svg:first-child { color: var(--link); }
.room-row .rr-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-row .rr-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.room-row .chev { width: 13px; height: 13px; color: var(--faint); }
.pick-line { display: flex; gap: 10px; align-items: center; min-width: 0; }
.pick-line .path { flex: 1; min-width: 0; font-family: var(--sans); font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.pick-line .path.none { color: var(--faint); }
.add-list { display: grid; max-height: 220px; overflow: auto; }
.add-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; min-width: 0; }
.add-item + .add-item { border-top: 1px solid var(--sep); }
.add-item svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.add-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-drop { border: 1.5px dashed var(--rule); border-radius: 12px; padding: 22px 16px; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 13px; }
.add-drop svg { width: 32px; height: 32px; color: var(--faint); stroke-width: 1.3; }
.add-drop .acts { display: flex; gap: 8px; }

@media (max-width: 1320px) {
  .compose { padding: 28px 28px 40px; }
  .turns-in { padding: 22px 24px 28px; }
  .conv-body { grid-template-columns: clamp(280px, 32%, 360px) minmax(0, 1fr); }
}

.add-item .t-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.add-item .t-x:hover { background: var(--hover); color: var(--text); }
.add-item .t-x svg { width: 12px; height: 12px; }
.turn-q.solo { justify-content: flex-end; }
.ag-step { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-step.warn { color: var(--t-warn); }
.md > ul, .md > ol, .md > .md-table { margin-top: 12px; }
.cite.unproven { color: var(--t-warn); background: var(--t-warn-bg); text-decoration: underline dotted; text-underline-offset: 2px; }
.cite-group.unproven { color: var(--t-warn); }
.cite-group .tnum { font-size: 1em; letter-spacing: .02em; }
.cpop-standing { font-size: 11.5px; color: var(--t-warn); flex: none; }
.lg-live[hidden], .lg-follow[hidden] { display: none; }
.sv-mark.closest { background: var(--t-warn-bg); outline: 1px dashed var(--t-warn); }
