/* ---- Agent Assistant: side panel that runs the whole suite from one prompt ---- */
.asst-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 290; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 10px; border-radius: 22px; background: #141414; color: #fff; font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 10px 28px -10px rgba(0,0,0,.45); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, opacity .15s; }
/* The launcher carries the Cognitive mark, never a generic spark or bolt. */
.asst-fab-mark { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #fff; color: #141414; }
.asst-fab .asst-fab-mark svg { width: 15px; height: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .asst-fab { background: #F4F4F2; color: #141414; border-color: rgba(0,0,0,.06); } :root:not([data-theme="light"]) .asst-fab-mark { background: #141414; color: #fff; } }
:root[data-theme="dark"] .asst-fab { background: #F4F4F2; color: #141414; border-color: rgba(0,0,0,.06); } :root[data-theme="dark"] .asst-fab-mark { background: #141414; color: #fff; }
.asst-fab:hover { transform: translateY(-1px); }
.asst-fab svg { width: 18px; height: 18px; }
.asst-fab kbd { font: 500 11px var(--mono); opacity: .75; }
body.asst-open .asst-fab { opacity: 0; pointer-events: none; }
.asst-top { display: none; }
.asst-top svg { width: 17px; height: 17px; }

.asst { position: fixed; top: 0; right: 0; bottom: 0; z-index: 300; width: 440px; max-width: 100vw; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .2s ease, width .2s ease; }
body.asst-open .asst { transform: none; }
.asst.wide { width: min(760px, 100vw); }
.asst-h { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); min-height: 52px; }
.asst-h .mark { width: 24px; height: 24px; border-radius: 7px; }
.asst-title { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 8px; font-weight: 600; font-size: 14px; text-align: left; }
.asst-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-title:hover { background: var(--hover); }
.asst-title svg { flex-shrink: 0; color: var(--text3); }

.asst-b { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.asst-b > * { flex-shrink: 0; }
.asst-empty { margin: auto 0; text-align: center; padding: 12px 4px; }
.asst-eyebrow { margin-top: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.asst-empty .asst-eyebrow + h3 { margin-top: 4px; }
.asst-empty h3 { font-size: 18px; margin: 10px 0 6px; }
.asst-empty p { color: var(--text2); font-size: 13px; margin-bottom: 14px; }
.asst-empty .mark { width: 40px; height: 40px; border-radius: 11px; }
.asst-sugs { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.asst-sug { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; color: var(--text2); text-align: left; }
.asst-sug:hover { background: var(--hover); color: var(--text); }

.asst-u { align-self: flex-end; max-width: 86%; background: var(--hover); border-radius: 16px; padding: 10px 14px; white-space: pre-wrap; word-break: break-word; }
.asst-say { font-size: 14px; }
.asst-meta { font-size: 12.5px; color: var(--text3); display: flex; align-items: center; gap: 6px; }
.asst-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: asstPulse 1.2s infinite; }
@keyframes asstPulse { 50% { opacity: .3; } }

.asst-card { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.asst-card.ask { border-color: var(--accent); }
.asst-card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-weight: 600; }
.asst-card-h svg { width: 17px; height: 17px; color: var(--text2); }
.asst-card-sub { padding: 0 14px 8px; font-size: 13px; color: var(--text2); }
.asst-steps { display: flex; flex-direction: column; }
.asst-step { border-top: 1px solid var(--border); padding: 10px 14px; }
.asst-step:first-child { border-top: 0; }
.asst-step-h { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; }
.asst-step-h .grow { flex: 1; min-width: 0; }
.asst-step-t { font-weight: 600; }
.asst-step-who { font-size: 12px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 1px; }
.asst-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.asst-st { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; font-weight: 700; }
.asst-st.queued { border: 1.5px solid var(--border2); }
.asst-st.running { border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: asstSpin .8s linear infinite; }
.asst-st.done { background: var(--ok-soft); color: var(--ok); }
.asst-st.failed, .asst-st.stopped { background: var(--bad-soft); color: var(--bad); }
.asst-st.waiting { background: var(--warn-soft); color: var(--warn); }
.asst-st.skipped { background: var(--hover); color: var(--text3); }
@keyframes asstSpin { to { transform: rotate(360deg); } }
.asst-out { margin: 8px 0 0 27px; font-size: 13px; max-height: 220px; overflow: hidden; position: relative; }
.asst-out.open { max-height: none; }
.asst-out:not(.open)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(transparent, var(--panel)); }
.asst-out.short::after { display: none; }
.asst-more { margin: 4px 0 0 27px; font-size: 12.5px; color: var(--accent-text); font-weight: 600; }
.asst-gate { margin: 10px 0 2px 27px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.asst-gate b { display: block; margin-bottom: 2px; }
.asst-gate .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asst-gate.warn { background: var(--warn-soft); }
.asst-cost { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); font-size: 13.5px; }
.asst-cost svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--text2); }
.asst-cost small { display: block; color: var(--text3); font-size: 12px; margin-top: 2px; }
.asst-acts { display: flex; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
.asst-acts .btn, .asst-gate .btn { height: 32px; font-size: 13px; padding: 0 12px; }
.asst-done { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; }
.asst-done > b { display: block; margin-bottom: 4px; color: var(--ok); }
.asst-err { border: 1px solid var(--bad); background: var(--bad-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.asst-err .btn { margin-top: 8px; height: 30px; font-size: 12.5px; }

.asst-f { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.asst-comp { border: 1px solid var(--border2); border-radius: 16px; background: var(--panel); padding: 8px 8px 8px 12px; display: flex; align-items: flex-end; gap: 8px; }
.asst-comp:focus-within { border-color: var(--accent); }
.asst-comp textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.45; max-height: 180px; min-height: 22px; padding: 4px 0; }
.asst-send { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--bg); flex-shrink: 0; }
.asst-send:disabled { opacity: .35; cursor: default; }
.asst-foot { font-size: 11.5px; color: var(--text3); text-align: center; margin-top: 6px; }

@media (max-width: 760px) {
  .asst-fab { display: none; }
  .asst-top { display: inline-flex; }
  .asst, .asst.wide { width: 100vw; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .asst, .asst-fab { transition: none; } .asst-st.running, .asst-meta .dot { animation: none; } }
.asst-out.short + .asst-more { display: none; }
