/* assistant.css — Elpis chat component (thread, parts, composer). Same component on Home and in projects. */

.elpis { display: flex; flex-direction: column; min-height: 0; height: 100%; position: relative; }
.elpis-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 12px; scroll-behavior: smooth; }
.elpis-thread-inner { max-width: 760px; margin: 0 auto; }
.elpis[data-variant="project"] .elpis-thread-inner { max-width: none; }
.elpis-dock { padding: 8px 18px calc(var(--footer-h) + 10px); position: relative; }
.elpis[data-variant="home"] .elpis-dock { width: min(760px, 100%); margin: 0 auto; padding: 8px 24px calc(var(--footer-h) + 14px); background: linear-gradient(0deg, var(--bg) 70%, rgba(226,230,225,0)); }
.elpis[data-variant="project"] .elpis-dock { background: var(--surface); }

/* ---- messages ---- */
.msg { margin: 0 0 18px; }
.msg.anim { animation: rise .34s var(--ease) both; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; }
.msg-user .ubub { background: var(--soft); border-radius: 19px 19px 6px 19px; padding: 11px 16px; max-width: 86%; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.elpis[data-variant="project"] .msg-user .ubub { background: #423C35; color: #fff; border-radius: 15px 15px 5px 15px; }
.msg-user .meta { font-family: var(--mono); font-size: 10.5px; color: var(--mut2); margin-top: 4px; }
.msg-user.queued .ubub { opacity: .6; border: 1.5px dashed var(--line2); background: transparent; color: var(--ink); }

.msg-bot .who2 { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.msg-bot .who2 .mono { font-weight: 500; color: var(--mut2); font-size: 10.5px; }
.elpis-av { width: 22px; height: 22px; border-radius: 50%; background: var(--ai-t); color: var(--ai); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.elpis-av svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.modelchip { display: inline-flex; align-items: center; gap: 4px; font: 500 10.5px var(--mono); color: var(--mut2); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; }
.modelchip .prov-mark { width: 10px; height: 10px; }
.msg-bot .body { font-size: 14.5px; line-height: 1.55; }
.elpis[data-variant="project"] .msg-bot .body { border: 1.6px solid var(--blue-2); border-radius: 15px; border-bottom-left-radius: 5px; padding: 11px 15px; background: var(--surface); }
.msg-bot .body > * + * { margin-top: 10px; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; } .md li { margin: 2px 0; }
.md .md-h { font-size: 14px; font-weight: 800; margin: 8px 0 4px; }
.caret::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--ai); opacity: .7; animation: blink 1s infinite; }

.thinking { display: inline-flex; gap: 5px; padding: 6px 2px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--mut2); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .2s; } .thinking i:nth-child(3) { animation-delay: .4s; }

/* trace lines: "Reading Hive · checking ARK…" */
.trace { display: flex; flex-direction: column; gap: 3px; font: 500 11.5px var(--mono); color: var(--mut2); }
.trace .tl { display: flex; align-items: center; gap: 7px; }
.trace .tl .spin { width: 10px; height: 10px; border: 1.6px solid var(--line2); border-top-color: var(--ai); border-radius: 50%; animation: spin .8s linear infinite; }
.trace .tl svg { width: 11px; height: 11px; color: var(--bblue); }

/* structured cards in chat */
.pcard { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.pcard.anim { animation: rise .34s var(--ease) both; }
.pcard-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 8px; }
.pcard-hd .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.pcard-title { padding: 0 16px 8px; font-size: 16px; font-weight: 800; }
.pcard-bd { padding: 0 16px 12px; font-size: 14px; }
.pcard-ft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--soft2); }
.pcard-ft .note { margin-left: auto; border: 0; padding: 0; font-size: 12px; }

/* read-back rows */
.rb-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 16px; border-top: 1px solid var(--line); }
.pcard.anim .rb-row, .pcard.anim .lane { animation: rise .3s var(--ease) both; }
.rb-row .k { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut2); font-weight: 600; }
.rb-row .v { font-size: 15px; font-weight: 600; }
.rb-row .v small { font-weight: 400; color: var(--mut); font-size: 13px; }
.rb-row .cite { font-size: 11.5px; background: var(--pink-t); color: var(--red-d); border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.rb-row.is-provisional { background: var(--pink-t); }
.rb-row.is-provisional .cite { background: var(--surface); }
.rb-flag { grid-column: 1 / -1; font-size: 12.5px; color: var(--red-d); font-weight: 600; }
.rb-scope { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.rb-scope .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emph); }
.rb-scope.ok .dot { background: var(--teal-d); }

/* plan card lanes */
.plan-hero { background: var(--brand); color: #fff; padding: 14px 16px; }
.plan-hero .eyebrow { color: rgba(255,255,255,.8); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.plan-hero .t { font-size: 21px; font-weight: 800; margin-top: 4px; }
.plan-hero .s { font-size: 13px; opacity: .9; margin-top: 2px; }
.lane { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); }
.lane .ln { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--teal-d); color: var(--teal-d); display: inline-flex; align-items: center; justify-content: center; font: 700 10px var(--mono); }
.lane b { display: block; font-size: 14px; }
.lane small { color: var(--mut); font-size: 12.5px; }

/* draft card */
.draft-meta { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; padding: 4px 16px 10px; font-size: 13px; }
.draft-meta .k { font-family: var(--mono); font-size: 11px; color: var(--mut2); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.draft-body { margin: 0 16px 12px; background: var(--nested); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.55; }
.draft-edit { display: block; width: calc(100% - 32px); margin: 0 16px 12px; min-height: 160px; }
.draft-sent { color: var(--bblue); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }

/* chips row under a message */
.mchips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchips .chip { font-size: 13px; }

/* error part */
.perr { display: flex; align-items: flex-start; gap: 10px; background: var(--danger-bg); border-radius: var(--r-md); padding: 10px 14px; font-size: 13.5px; color: var(--ink); }
.perr svg { width: 16px; height: 16px; color: var(--danger-fg); margin-top: 2px; }
.perr .btn { margin-left: auto; }

/* ---- composer (the pill) ---- */
.llmrow { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 0 6px 9px; }
.llmrow .left { margin-right: auto; display: flex; gap: 8px; align-items: center; }
.prov { width: 31px; height: 31px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.prov.on { background: var(--ai-t); border-color: #D4E2F0; }
.prov .prov-mark { width: 17px; height: 17px; }
.provmodel { font: 600 12px var(--sans); color: var(--mut); margin: 0 2px; }
.skicon { width: 31px; height: 31px; border: 1px solid var(--line2); border-radius: 9px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--mut); }
.skicon svg { width: 16px; height: 16px; }
.pill { display: flex; align-items: flex-end; gap: 7px; border: 1.6px solid var(--line2); background: #fff; border-radius: var(--r-composer); padding: 7px 7px 7px 8px; box-shadow: var(--shadow); transition: border-color .14s, box-shadow .14s; }
.pill:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(179,18,46,.10); }
.pill .iconbtn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink); transition: background .14s; }
.pill .iconbtn:hover { background: var(--nested); }
.pill .iconbtn.mic { border: 1px solid var(--line); }
.pill .iconbtn svg { width: 18px; height: 18px; }
.pill .send { background: var(--line2); color: #fff; }
.pill .send:hover { background: var(--line2); }
.pill .send.ready { background: var(--red); box-shadow: var(--glow-red); }
.pill .send.ready:hover { background: var(--red-d); }
.pill .stop { background: var(--ink); color: #fff; }
.pill .stop:hover { background: #000; }
.pill .stop svg { width: 14px; height: 14px; fill: currentColor; }
.pill textarea { flex: 1; border: 0; outline: 0; background: transparent; font: 15px/1.5 var(--sans); color: var(--ink); padding: 7px 4px; resize: none; max-height: 150px; min-height: 36px; min-width: 0; }
.pill textarea::placeholder { color: #8F8A84; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill textarea:focus-visible { outline: none; }
.composer-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); margin: 7px 10px 0; }
.composer-note .btn-text { font-size: 12px; padding: 0; }
.composer-flow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); margin: 0 10px 8px; }

/* prompt suggestions (front door) */
.elpis-empty { text-align: center; padding: 70px 0 20px; }
.elpis-empty h1 { font-size: 38px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 12px; }
.elpis-empty p { color: var(--mut); font-size: 16px; max-width: 56ch; margin: 0 auto; line-height: 1.6; }
/* Stopped answer: say so and offer Retry (the guided step waiting on it can then finish) */
.msg-stopped { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
