/*
 * The chat: one agent conversation and its message box, the same wherever Basecamp shows one
 * (Rangers, the curator's page and bubble). Drawn by /js/chat/chat.js; classes are ch-*.
 */
:root { --ch-t: .45s var(--ease); --ch-col: 820px; }
.ch-empty { padding: 24px 10px; color: var(--muted); text-align: center; }
.ch { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-column { width: 100%; max-width: var(--ch-col); margin: 0 auto; }
.ch-timeline { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable both-edges; padding: 28px 32px 24px; }
.ch-timeline > .ch-column { display: grid; gap: 18px; align-content: start; }
.ch-msg small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.ch-msg.is-agent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.ch-msg.is-you { justify-self: end; max-width: 78%; text-align: right; }
.ch-msg.is-you .ch-md { text-align: left; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px 12px 4px 12px; padding: 10px 14px; color: var(--text); }
.ch-md { display: grid; gap: 8px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.ch-md b, .ch-md h4 { color: var(--text); }
.ch-md h4 { font-size: 14px; font-weight: 600; margin-top: 4px; }
.ch-md ul, .ch-md ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ch-md code { font: 12.5px var(--mono); background: var(--code); padding: 1px 5px; border-radius: 4px; }
.ch-md hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.ch-md blockquote { display: grid; gap: 6px; margin: 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-2); color: var(--text-2); }
.ch-md table { border-collapse: collapse; font-size: 13px; width: fit-content; max-width: 100%; }
.ch-md th, .ch-md td { text-align: left; padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ch-md th { color: var(--muted); font-weight: 600; font-size: 12px; }
.ch-tools, .ch-changes { margin-left: 36px; }
.ch-tools { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ch-tools summary { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; color: var(--muted); font-size: 12.5px; cursor: pointer; list-style: none; transition: color var(--ch-t); }
.ch-tools summary::-webkit-details-marker { display: none; }
.ch-tools summary:hover { color: var(--text); }
.ch-tools summary .ico { width: 15px; height: 15px; }
.ch-tools summary .ico:last-child { margin-left: auto; transition: transform var(--ch-t); }
.ch-tools[open] summary .ico:last-child { transform: rotate(180deg); }
.ch-tools > div { display: grid; gap: 4px; padding: 0 12px 10px; }
.ch-tools p { display: flex; gap: 10px; font-size: 12px; color: var(--muted); min-width: 0; }
.ch-tools p b { color: var(--text-2); font-weight: 600; flex: none; }
.ch-tools p .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-change { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; text-align: left; transition: border-color var(--ch-t), background-color var(--ch-t); }
.ch-change:hover { border-color: var(--line-3); background: var(--panel-2); }
.ch-change > .ico { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.ch-change > .ico:last-child { color: var(--muted); }
.ch-change-what { color: var(--muted); font-weight: 600; flex: none; }
.ch-change-path { flex: 1; min-width: 0; display: flex; font: 12.5px var(--mono); white-space: nowrap; overflow: hidden; }
.ch-change-path i { font-style: normal; color: var(--muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-change-path b { font-weight: 600; color: var(--text); flex: none; }
.ch-diff { display: inline-flex; gap: 6px; font: 600 12px var(--mono); flex: none; }
.ch-diff .is-add { font-style: normal; color: var(--ok); }
.ch-diff .is-del { font-style: normal; color: var(--danger); }
.ch-compacted { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.ch-compacted::before, .ch-compacted::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.ch-compacted span { display: inline-flex; align-items: center; gap: 6px; }
.ch-compacted .ico { width: 14px; height: 14px; }
.ch-compacted.is-lost { color: var(--warn); }
.ch-compacted.is-lost::before, .ch-compacted.is-lost::after { background: color-mix(in srgb, var(--warn) 35%, transparent); }
.ch-earlier { display: flex; align-items: center; gap: 8px; justify-self: center; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; transition: color var(--ch-t), border-color var(--ch-t); }
.ch-earlier:hover { color: var(--text); border-color: var(--line-3); }
.ch-earlier .ico { width: 15px; height: 15px; }
.ch-composer { flex: none; position: relative; padding: 12px 32px 20px; border-top: 1px solid var(--line); }
.ch-newpill { position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 5; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--menu); color: var(--text); font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); transform: translateX(-50%); animation: ch-pill-in .2s cubic-bezier(.2,.7,.2,1); transition: background-color var(--ch-t), border-color var(--ch-t); }
.ch-newpill:hover { border-color: var(--accent); background: var(--accent-soft); }
.ch-newpill .ico { width: 15px; height: 15px; color: var(--accent-text); }
.ch-newpill[hidden] { display: none; }
@keyframes ch-pill-in { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .ch-newpill { animation: none; } }
.ch-input { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--input); transition: border-color var(--ch-t); }
.ch-input:focus-within { border-color: var(--accent); }
.ch-input textarea { flex: 1; resize: none; border: 0; background: none; outline: none; padding: 7px 0; min-height: 36px; max-height: 160px; line-height: 22px; }
.ch-send { width: 36px; height: 36px; background: var(--primary); color: var(--on-primary); transition: background-color var(--ch-t), opacity var(--ch-t), transform .1s; }
.ch-send:hover { background: var(--primary-hover); color: var(--on-primary); }
.ch-send:disabled, .ch-input textarea:disabled { opacity: .45; cursor: default; }
.ch-files { display: grid; gap: 8px; }
@media (max-width: 760px) { .ch-timeline { padding: 20px 16px 16px; } .ch-msg.is-you { max-width: 88%; } .ch-tools, .ch-changes { margin-left: 0; } .ch-change-what { display: none; } .ch-composer { padding: 10px 12px 16px; } }
.ch-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: 320px; max-height: 360px; overflow-y: auto; padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--menu); box-shadow: var(--shadow); display: grid; gap: 10px; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.ch-pop-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.ch-pop-head .ico { width: 16px; height: 16px; color: var(--accent-text); }
.ch-pop .btn { justify-self: start; }
@media (max-width: 760px) { .ch-pop { position: fixed; left: 12px; right: 12px; bottom: 90px; width: auto; } }
.ch-timeline > .ch-column > *, .ch-msg.is-agent > div, .ch-changes, .ch-tools { min-width: 0; }
.ch-md table { display: block; overflow-x: auto; }
.ch-pre { margin: 8px 0; max-width: 100%; overflow-x: auto; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--code); font: 12.5px/1.6 var(--mono); white-space: pre; }
.ch-menu-none { padding: 6px 10px; color: var(--muted); font-size: 12.5px; }
.ch-input textarea::placeholder { color: var(--muted); }
.ch-timeline > .ch-column { min-height: 100%; align-content: end; }
.ch-skel { display: grid; gap: 18px; }
.ch-skel .ch-msg.is-you > div { display: grid; justify-items: end; }
.ch-input { flex-wrap: wrap; align-items: flex-end; }
.ch-input textarea { max-height: 40vh; overflow-y: hidden; }
.ch-files { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.ch-files:empty { display: none; }
.ch-fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 30px; padding: 0 2px 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; }
.ch-fchip > .ico, .ch-fchip > .spinner { flex: none; width: 15px; height: 15px; color: var(--muted); }
.ch-fchip > span:not(.spinner) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-fchip small { flex: none; color: var(--muted); font-size: 11.5px; }
.ch-fchip .icon-btn { width: 24px; height: 24px; }
.ch-fchip.is-error { border-color: rgba(248, 113, 113, .5); color: #f8a5a5; }
.ch-attach { width: 36px; height: 36px; color: var(--muted); }
.ch-attach:hover { color: var(--text); }
.ch { position: relative; }
.ch-dropzone { position: absolute; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 8px; outline: 2px dashed var(--accent); outline-offset: -12px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); color: var(--text); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.ch-dropzone .ico { width: 30px; height: 30px; color: var(--accent-text); }
.ch-dropzone small { color: var(--muted); }
.ch.is-drop .ch-dropzone { opacity: 1; }
.ch-pasted { margin-top: 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); max-width: min(520px, 100%); }
.ch-pasted summary { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; color: var(--muted); font-size: 12.5px; cursor: pointer; list-style: none; transition: color var(--ch-t); }
.ch-pasted summary::-webkit-details-marker { display: none; }
.ch-pasted summary:hover { color: var(--text); }
.ch-pasted summary .ico { width: 15px; height: 15px; flex: none; }
.ch-pasted summary .ico:last-child { margin-left: auto; transition: transform var(--ch-t); }
.ch-pasted[open] summary .ico:last-child { transform: rotate(180deg); }
.ch-pasted pre { margin: 0; padding: 8px 12px 10px; border-top: 1px solid var(--line); max-height: 260px; overflow: auto; font: 12px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-sent-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.ch-sent-files .ch-fchip { padding-right: 10px; }
.ch-ahead { display: flex; align-items: center; gap: 12px; margin-bottom: -6px; }
.ch-ahead small { color: var(--muted); font-size: 12px; }
.ch-said { margin-left: 36px; min-width: 0; }
.ch-liveturn { display: grid; gap: 12px; }
.ch-live-in { display: grid; gap: 12px; margin-left: 36px; min-width: 0; }
.ch-live-in:empty, [data-ch-work]:empty, [data-ch-seg]:empty { display: none; }
[data-ch-work] { margin-left: 36px; }
[data-ch-seg] { display: contents; }
.ch-live-in .ch-tools, .ch-live-in .ch-said, .ch-live-in .ch-changes { margin-left: 0; }
.ch-think { border-left: 2px solid var(--line-2); padding-left: 12px; }
.ch-think summary, .ch-think.is-hidden { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; cursor: pointer; list-style: none; transition: color var(--ch-t); }
.ch-think.is-hidden { cursor: default; }
.ch-think summary::-webkit-details-marker { display: none; }
.ch-think summary:hover { color: var(--text); }
.ch-think .ico { width: 15px; height: 15px; }
.ch-think summary .ico:last-child { transition: transform var(--ch-t); }
.ch-think[open] summary .ico:last-child { transform: rotate(180deg); }
.ch-think-body { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; display: grid; gap: 6px; }
/* A thought that is only headings (Codex's) is a short list: tight under its line, a small indent, no browser margins */
.ch-think-body > ul { margin: 0; padding-left: 14px; display: grid; gap: 1px; }
.ch-think-body > ul li::marker { color: var(--line-3); }
.ch-think:has(.ch-think-body > ul:only-child) .ch-think-body { margin-top: 4px; }
.ch-livesteps { display: grid; gap: 6px; }
.ch-livesteps p { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.ch-livesteps p .ico { width: 15px; height: 15px; flex: none; }
.ch-livesteps p .spinner { flex: none; }
.ch-livesteps p b { color: var(--text-2); font-weight: 500; }
.ch-livesteps p .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-livesteps p.is-now b { color: var(--text); }
.ch-working { display: flex; align-items: center; gap: 10px; min-height: 28px; color: var(--muted); font-size: 12.5px; }
.ch-dots { display: inline-flex; gap: 4px; }
.ch-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: ch-dot 1.2s ease-in-out infinite; }
.ch-dots i:nth-child(2) { animation-delay: .15s; }
.ch-dots i:nth-child(3) { animation-delay: .3s; }
.ch-secs { font-variant-numeric: tabular-nums; min-width: 2.5ch; }
.ch-working-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-working .btn { margin-left: auto; flex: none; }
@media (prefers-reduced-motion: reduce) { .ch-dots i, .ch-livesteps p { animation: none; } .ch-dots i { opacity: .7; } }
.ch-fchip.is-thumb img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; flex: none; }
a.ch-fchip { color: inherit; text-decoration: none; }
.ch-sent-files .ch-fchip.is-thumb { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px; height: auto; max-width: 200px; }
.ch-sent-files .ch-fchip.is-thumb img { width: 186px; height: auto; max-height: 140px; object-fit: contain; border-radius: 6px; background: var(--panel-2); }
.ch-sent-files .ch-fchip.is-thumb > span { max-width: 186px; font-size: 12px; color: var(--muted); }
.ch-tools summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-tools summary > span b { color: var(--text-2); font-weight: 500; margin-right: 4px; }
.ch-md h4 { margin: 10px 0 0; }
.ch-md > h4:first-child { margin-top: 0; }
.ch-md hr { margin: 8px 0; }
.ch-timeline > .ch-column { gap: 14px; }
.ch-msg.is-you { margin-top: 12px; }
.ch-msg.is-you:first-child { margin-top: 0; }
.ch-ahead { margin-top: 6px; margin-bottom: -2px; }
.ch-changes + .ch-changes, .ch-tools + .ch-changes, .ch-changes + .ch-tools, .ch-tools + .ch-tools { margin-top: -6px; }
.ch-changes .ch-change { min-height: 42px; }
.ch-tools > div { gap: 10px; padding: 2px 12px 12px; }
.ch-call { display: grid; gap: 6px; min-width: 0; }
.ch-call p { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.ch-call p b { color: var(--text-2); font-weight: 500; flex: none; }
.ch-call code { display: block; font: 12px/1.5 var(--mono); color: var(--text-2); background: var(--code); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.ch-enter { animation: ch-rise .26s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .ch-enter { animation: none; } }
.ch[data-ch-tools="compact"] .ch-think-split, .ch:not([data-ch-tools="compact"]) .ch-think-merged { display: none; }
.ch-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 36px; }
.ch-live-in .ch-shots { margin-left: 0; }
.ch-shots .ch-fchip.is-thumb { height: auto; padding: 4px; flex-direction: column; align-items: stretch; gap: 4px; }
.ch-shots .ch-fchip.is-thumb img { width: 180px; height: 112px; object-fit: cover; object-position: top; border-radius: 5px; }
.ch-shots .ch-fchip.is-thumb span { padding: 0 2px; font-size: 11.5px; }
.ch-new { animation: ch-word .16s ease-out both; }
.ch-working.is-new { animation: ch-fade .3s ease-out; }
.ch-dots { width: 26px; height: 14px; align-items: center; flex: none; transition: opacity .3s ease, width .35s var(--ease), margin .35s var(--ease); }
.ch-dots i { animation: ch-wave 1.15s ease-in-out infinite; }
.ch-working.is-done .ch-dots { width: 0; opacity: 0; margin-right: -10px; }
.ch-timeline > .ch-column > .ch-working { margin: -4px 0 0 36px; min-height: 20px; }
@media (prefers-reduced-motion: reduce) { .ch-dots i { animation: ch-dim 1.6s ease-in-out infinite; } .ch-working.is-new, .ch-new { animation: none; } }
.ch-cmd { justify-self: end; max-width: min(560px, 85%); }
.ch-cmd p, .ch-cmd summary { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12.5px; list-style: none; }
.ch-cmd summary { cursor: pointer; transition: color var(--ch-t); }
.ch-cmd summary::-webkit-details-marker { display: none; }
.ch-cmd summary:hover { color: var(--text); }
.ch-cmd .ico { width: 15px; height: 15px; flex: none; }
.ch-cmd code { font: 500 12.5px var(--mono); color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cmd small { margin-left: auto; padding-left: 8px; font-size: 11.5px; }
.ch-cmd summary .ico:last-child { transition: transform var(--ch-t); }
.ch-cmd details[open] summary .ico:last-child { transform: rotate(180deg); }
.ch-cmd pre { margin-top: 6px; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--input); font: 12px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; }
.ch-cmdlist { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 30; max-height: min(320px, 46vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--menu); box-shadow: var(--shadow); animation: ch-pop-in .16s cubic-bezier(.2,.7,.2,1); }
.ch-cmd-group { padding: 6px 8px 4px; color: var(--muted); font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.ch-cmdopt { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 7px 10px; border-radius: 7px; text-align: left; transition: background-color .12s; }
.ch-cmdopt:hover, .ch-cmdopt.is-on { background: var(--hover); }
.ch-cmdopt.is-on code { color: var(--accent-text); }
.ch-cmdopt code { flex: none; font: 600 12.5px var(--mono); color: var(--text); }
.ch-cmdopt small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.ch-cmd-note { display: flex; gap: 8px; margin-top: 4px; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
.ch-cmd-note .ico { flex: none; width: 15px; height: 15px; margin-top: 1px; }
@media (max-width: 640px) { .ch-cmdopt { flex-direction: column; gap: 2px; } .ch-cmdopt small { white-space: normal; } }
.ch-msg.is-you { display: flex; flex-direction: column; align-items: flex-end; }
.ch-msg.is-you .ch-md { max-width: 100%; }
.ch-tools summary { height: auto; min-height: 36px; padding: 8px 12px; align-items: center; }
.ch-tools summary > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
.ch-tools summary > span b, .ch-call p b, .ch-livestep p b { color: var(--text-2); font-weight: 600; margin-right: 8px; }
.ch-call p, .ch-livestep p { display: flex; align-items: baseline; gap: 0; font-size: 12.5px; color: var(--muted); min-width: 0; line-height: 1.5; }
.ch-call p span, .ch-livestep p span { min-width: 0; overflow-wrap: anywhere; }
.ch-livesteps { display: grid; gap: 6px; }
.ch-livestep { display: grid; gap: 4px; }
.ch-livestep p .ico, .ch-livestep p .spinner { flex: none; width: 15px; height: 15px; margin: calc( ( 1.5em - 15px ) / 2 ) 8px 0 0; align-self: flex-start; }
.ch-livestep.is-now p b { color: var(--text); }
.ch-livestep code { display: block; margin-left: 23px; font: 12px/1.5 var(--mono); color: var(--text-2); background: var(--code); border-radius: 6px; padding: 6px 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; }
.sh-cmd { color: #c4a7ff; font-weight: 600; }
.sh-flag { color: #7dd3fc; }
.sh-str { color: #86efac; }
.sh-path { color: #fcd34d; }
.sh-op { color: #f9a8d4; }
.sh-var { color: #fda4af; }
.ch[data-ch-tools="compact"] :is(.ch-tools, .ch-changes, .ch-livesteps) { display: none; }
.ch[data-ch-tools="tools"] :is(.ch-call code, .ch-livestep code) { display: none; }
.ch-chatcog { flex: none; }
.ch-sent-files .ch-fchip.is-thumb { align-items: center; }
.ch-sent-files .ch-fchip.is-thumb img { display: block; margin: 0 auto; object-position: center; height: 120px; }
a.ch-fchip.is-thumb { cursor: zoom-in; }
.ch-fchip.is-loading img { background: var(--hover-strong); animation: pulse 1.4s ease-in-out infinite; }
.ch-sent-files .ch-fchip.is-loading img, .ch-shots .ch-fchip.is-loading img { min-height: 112px; min-width: 180px; }
.ch-fchip.is-failed img { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .ch-fchip.is-loading img { animation: none; } }
.ch-viewer { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; padding: 0; border: 0; background: rgb(0 0 0 / .86); display: grid; place-items: center; }
.ch-viewer:not([open]) { display: none; }
.ch-viewer img { max-width: min(92vw, 1600px); max-height: 82vh; object-fit: contain; border-radius: 8px; box-shadow: 0 16px 48px rgb(0 0 0 / .5); cursor: default; }
.ch-viewer p { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #e5e7eb; font-size: 13px; }
.ch-viewer [data-ch-viewer-close] { position: absolute; top: 14px; right: 14px; color: #e5e7eb; }
.ch-viewer .ch-viewer-prev, .ch-viewer .ch-viewer-next { position: absolute; top: 50%; transform: translateY(-50%); color: #e5e7eb; width: 42px; height: 42px; }
.ch-viewer .ch-viewer-prev { left: 16px; }
.ch-viewer .ch-viewer-next { right: 16px; }
.ch-viewer::backdrop { background: transparent; }
.ch-composer { container-type: inline-size; }
@container (min-width: 1040px) { .ch-side { position: absolute; right: calc(100% + 10px); bottom: 0; } }
.ch-inputrow { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.ch-side { display: flex; align-items: center; gap: 6px; flex: none; }
.ch-side .icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--input); color: var(--muted); transition: color var(--ch-t), border-color var(--ch-t), background-color var(--ch-t); }
.ch-side .icon-btn:hover, .ch-side .icon-btn.is-open { color: var(--text); border-color: color-mix(in srgb, var(--text) 22%, var(--line-2)); }
.ch-side .icon-btn .ico { width: 18px; height: 18px; }
.ch-inputrow .ch-input { flex: 1; min-width: 0; cursor: text; padding: 3px 3px 3px 14px; gap: 6px; }
.ch-inputrow .ch-input textarea { min-height: 36px; padding: 7px 0; }
.ch-input .ch-files { width: 100%; }
.ch-set-wrap { position: relative; display: inline-flex; }
.ch-setpop { opacity: 1; transform: none; pointer-events: auto; animation: ch-pop-in .18s cubic-bezier(.2,.7,.2,1); }
.ch-setpop { width: 340px; display: grid; gap: 14px; left: -4px; }
.ch-setline { display: grid; gap: 8px; }
.ch-setline > b { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.ch-setline > b span { color: var(--text); font-variant-numeric: tabular-nums; }
.ch-toolseg { width: 100%; padding: 3px; }
.ch-toolseg button { flex: 1; justify-content: center; height: 26px; padding: 0 8px; font-size: 12.5px; }
.ch-toolseg .seg-marker { top: 3px; height: 26px; }
.ch-zoom { --thumb: 16px; width: 100%; height: 20px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.ch-zoom::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--f, 0)), var(--line-2) 0); }
.ch-zoom::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--f, 0)), var(--line-2) 0); }
.ch-zoom::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -6px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); box-shadow: 0 1px 3px rgb(0 0 0 / .35); transition: transform .15s var(--ease); }
.ch-zoom::-moz-range-thumb { width: var(--thumb); height: var(--thumb); border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); box-shadow: 0 1px 3px rgb(0 0 0 / .35); }
.ch-zoom:hover::-webkit-slider-thumb, .ch-zoom:active::-webkit-slider-thumb { transform: scale(1.12); }
.ch-zoom:focus-visible { outline: none; }
.ch-zoom:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.ch-zoom-ticks { position: relative; height: 16px; margin-top: -2px; }
.ch-zoom-ticks button { position: absolute; left: calc(8px + (100% - 16px) * var(--f)); transform: translateX(-50%); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; transition: color var(--ch-t); }
.ch-zoom-ticks button:hover { color: var(--text); }
.ch-timeline > .ch-column { zoom: var(--ch-zoom, 1); max-width: calc(var(--ch-col) / var(--ch-zoom, 1)); }
.ch-timeline { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }
.ch-link { color: var(--accent-text); text-decoration: none; transition: color .18s; }
.ch-link:hover { color: color-mix(in srgb, var(--accent-text) 62%, #fff); }
.ch-link code { color: inherit; }
.ch-md td.is-short, .ch-md th.is-short { white-space: nowrap; }
.ch-md td:not(.is-short) { min-width: 18ch; }
.ch-viewer { background: rgb(0 0 0 / .86); }
.ch-setpop { width: min(390px, calc(100cqw - 24px)); }
@media (max-width: 640px) { .ch-setpop { left: 0; } }
.ch-toolseg button { white-space: nowrap; }
@keyframes ch-dim { 50% { opacity: .35; } }
@keyframes ch-dot { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes ch-fade { from { opacity: 0; } }
@keyframes ch-pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ch-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ch-wave { 0%, 56%, 100% { transform: translateY(0); opacity: .45; } 28% { transform: translateY(-5px); opacity: 1; } }
@keyframes ch-word { from { opacity: 0; } }

/* A system line and an error between the messages; your message while it is not yet kept */
.ch-sys { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.ch-sys .ico { width: 15px; height: 15px; flex: none; }
.ch-sys small { margin-left: auto; font-size: 11.5px; }
.ch-sys.is-error { color: var(--danger); }
.ch-msg.is-pending { opacity: .55; transition: opacity var(--ch-t); }

/* The working dots wave on one clock, so a redraw never restarts them */
.ch-dots i { animation-delay: var(--t0, 0s); }
.ch-dots i:nth-child(2) { animation-delay: calc(var(--t0, 0s) + .15s); }
.ch-dots i:nth-child(3) { animation-delay: calc(var(--t0, 0s) + .3s); }

/* A smaller Send in the box */
.ch-inputrow .ch-input { padding: 5px 5px 5px 14px; }
.ch-inputrow .ch-input textarea { min-height: 32px; padding: 5px 0; }
.ch-send { width: 32px; height: 32px; border-radius: 8px; }
.ch-send .ico { width: 18px; height: 18px; }

/* The picture sliding out is clipped, so no scroll bar flashes */
.ch-viewer { overflow: hidden; }

/* Messages between agents */
.ch-agentmsg { max-width: min(600px, 100%); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); display: grid; gap: 6px; }
.ch-agentmsg.is-in { border-left: 3px solid #f0a6ca; margin-top: 20px; }
.ch-agentmsg.is-in:first-child { margin-top: 0; }
.ch-agentmsg.is-out { border-left: 3px solid var(--accent); }
.ch-agentmsg-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ch-agentmsg-head .ico { width: 15px; height: 15px; color: var(--accent-text); flex: none; }
.ch-agentmsg-head .avatar.xs { width: 20px; height: 20px; font-size: 9px; flex: none; }
.ch-agentmsg-head .tone-teal { background: #5fd4c4; }
.ch-agentmsg-head small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.ch-agentmsg-head { flex-wrap: wrap; row-gap: 6px; }
.ch-agentmsg.is-rangers { border-style: dashed; border-left-style: solid; }
.ch-who { position: relative; display: inline-flex; flex: none; }
.ch-who-eng { position: absolute; right: -5px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; }
.ch-agentmsg-head .ch-who-eng .ico { width: 9px; height: 9px; color: var(--text-2); }
.ch-road { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ch-agentmsg-head .ch-road .ico { width: 12px; height: 12px; color: var(--text-2); }
.ch-road.is-rangers { background: var(--accent-soft); border-color: rgba(143, 108, 245, .4); color: var(--accent-text); }
.ch-agentmsg-head .ch-road.is-rangers .ico { color: var(--accent-text); }
.ch-road-hop { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; padding-left: 6px; border-left: 1px solid rgba(143, 108, 245, .4); }
.ch-agentmsg-head .ch-road-hop .ico { width: 11px; height: 11px; }
.ch-agentmsg-text.is-folded { max-height: 4.65em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.ch-agentmsg.is-open .ch-agentmsg-text.is-folded { max-height: none; -webkit-mask-image: none; mask-image: none; }
.ch-agentmsg-more { justify-self: start; color: var(--accent-text); font-size: 12.5px; font-weight: 600; }
