/* Live Boom AI: thread layout, history panel, answers, attachments, mic, Instant Triage */
#view-thread.ai-on.on { display: grid; grid-template-columns: 248px minmax(0, 1fr); overflow: hidden; }
.ai-main { overflow-y: auto; height: 100%; min-width: 0; }
.ai-hist { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg2); }
.ai-hh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 12px 10px; }
.ai-hh b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); font-weight: 500; }
.ai-hh .btn svg { width: 14px; height: 14px; }
.ai-hl { flex: 1; overflow-y: auto; padding: 0 6px 8px; }
.ai-hl .fine { padding: 8px 6px; }
.ai-hr { display: block; padding: 8px 8px; border-radius: var(--r); color: var(--text2); }
.ai-hr:hover { background: var(--hover); }
.ai-hr.on { background: var(--hover2); color: var(--text); box-shadow: inset 2px 0 0 var(--amber); }
.ai-hr b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hr small { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hall { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--amber-ink); }
.ai-htog { display: none !important; }
#view-thread.ai-on .follow { left: calc(50% + 36px + 124px); width: min(712px, calc(100% - 400px)); }
.app.wide #view-thread.ai-on .follow { left: calc(50% + 124px + 124px); }
@media (max-width: 1000px) {
  #view-thread.ai-on.on { grid-template-columns: minmax(0, 1fr); }
  .ai-hist { display: none; position: absolute; z-index: 20; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); box-shadow: var(--shadow-3); }
  .ai-hist.open { display: flex; }
  .ai-htog { display: grid !important; }
  #view-thread.ai-on .follow, .app.wide #view-thread.ai-on .follow { left: calc(50% + 36px); width: min(712px, calc(100% - 120px)); }
}
@media (max-width: 760px) { #view-thread.ai-on .follow, .app.wide #view-thread.ai-on .follow { left: 50%; width: calc(100% - 24px); } }

/* thread */
.ai-head { gap: 8px; align-items: center; }
.ai-head .spin { flex: none; }
.ai-head .t-acts { margin-left: auto; display: inline-flex; gap: 6px; }
.ai-head .t-open { color: var(--amber-ink); font-weight: 600; }
.ai-q2 { font-size: 22px !important; }
.ai-a .ans { animation: none; }
.ai-u.turn2 { margin-top: 36px; }
.ai-uatt, .ai-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ai-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 240px; padding: 0 6px 0 6px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--bg2); font-size: 12.5px; color: var(--text2); }
.ai-chip img { width: 20px; height: 20px; object-fit: cover; border-radius: var(--r-xs); }
.ai-chip svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ai-chip em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chip small { color: var(--faint); font-size: 11px; }
.ai-chip button { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ai-chip button:hover { color: var(--text); }
.ai-steps .src { cursor: default; }
.ai-steps .src.ai-run { opacity: .7; border-color: rgba(var(--amber-a),.45); }
.ai-steps .src.ai-bad { border-color: rgba(var(--danger-a),.5); }
.ai-steps .src.ai-bad small { color: var(--danger); }
.steps .ai-stop { margin-left: 6px; }
.ai-md h4 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; }
.ai-md p + p, .ai-md p + ul, .ai-md ul + p, .ai-md p + ol, .ai-md ol + p { margin-top: 10px; }
.ai-md ul, .ai-md ol { margin: 8px 0 8px 22px; }
.ai-md ul { list-style: disc; } .ai-md ol { list-style: decimal; }
.ai-md li + li { margin-top: 4px; }
.ai-md b { font-weight: 700; color: var(--text); }
.ai-md a { color: var(--amber-ink); text-decoration: underline; text-underline-offset: 2px; }
.ai-md code { font-family: var(--mono); font-size: .86em; padding: 1px 5px; border-radius: var(--r-xs); background: var(--panel2); }
.ai-md pre { margin: 10px 0; padding: 12px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); overflow-x: auto; }
.ai-md pre code { padding: 0; background: none; font-size: 13px; }
.ai-md blockquote { margin: 10px 0; padding-left: 12px; border-left: 2px solid var(--line2); color: var(--muted); }
.ai-md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.ai-tw { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r); }
.ai-md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ai-md th, .ai-md td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ai-md th { font-weight: 600; color: var(--muted); background: var(--bg2); }
.ai-md tr:last-child td { border-bottom: 0; }
.ai-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); font-size: 13.5px; font-weight: 600; text-align: left; }
.ai-file:hover { border-color: rgba(var(--amber-a),.5); }
.ai-file svg { width: 16px; height: 16px; color: var(--amber-ink); flex: none; }
.ai-file small { color: var(--faint); font-weight: 500; font-size: 12px; }
.ai-file:disabled { opacity: .55; cursor: not-allowed; }
.ai-need { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r); border: 1px solid rgba(var(--amber-a),.35); background: rgba(var(--amber-a),.07); font-size: 14px; }
.ai-need > svg { width: 18px; height: 18px; color: var(--amber-ink); flex: none; }
.ai-need span { flex: 1; min-width: 180px; }
.ai-err { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r); border: 1px solid rgba(var(--danger-a),.4); background: rgba(var(--danger-a),.08); color: var(--text); font-size: 14px; }
.ai-err svg, .ai-warn svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--danger); }
.ai-warn { display: flex; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ai-warn svg { color: var(--amber-ink); }
.acts .btn svg { width: 15px; height: 15px; }
.ai-foot { display: flex; gap: 6px; margin-top: 10px; }
.ai-copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: var(--r); border: 1px solid transparent; color: var(--muted); font-size: 12.5px; }
.ai-copy:hover { color: var(--text); border-color: var(--line2); background: var(--hover); }
.ai-copy svg { width: 14px; height: 14px; }
.ai-empty { margin-top: 22px; padding: 18px; border-radius: var(--r); border: 1px dashed var(--line2); }
.ai-empty p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.ai-old { margin-top: 24px; }
.ai-fatt { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: var(--r); color: var(--muted); margin-left: -10px; }
.ai-fatt:hover { color: var(--text); background: var(--hover); }
.ai-fatt svg { width: 16px; height: 16px; }
.ai-fchips { position: absolute; left: 0; bottom: calc(100% + 6px); display: flex !important; flex-wrap: wrap; gap: 6px; }
#attached .ai-chip { height: 28px; }

/* composer pickers */
.ai-src-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 14px; }
.ai-src-row svg { width: 15px; height: 15px; color: var(--ok); flex: none; }
.ai-menu { z-index: 80; }

/* threads list */
.ai-find { width: 100%; margin-bottom: 8px; }
.ai-trow { gap: 10px; }
.ai-trow > a { min-width: 0; }
.ai-trow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-trow .ic svg { width: 16px; height: 16px; }
.mt { margin-top: 16px; }

/* mic: inside the focused box only */
.ai-mic-f { padding-right: 38px !important; }
.ai-mic { position: fixed; z-index: 1000; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r); color: var(--muted); background: var(--panel2); border: 1px solid var(--line2); }
.ai-mic[hidden] { display: none; }
.ai-mic:hover { color: var(--text); border-color: rgba(var(--amber-a),.5); }
.ai-mic svg { width: 15px; height: 15px; }
.ai-mic.rec { color: #fff; background: var(--danger); border-color: var(--danger); animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-mic.rec svg { fill: currentColor; }
.ai-mic .spin { width: 12px; height: 12px; }
@keyframes ai-pulse { 50% { box-shadow: 0 0 0 4px rgba(var(--danger-a),.25); } }
@media (prefers-reduced-motion: reduce) { .ai-mic.rec { animation: none; } }
.ai-micp { position: fixed; z-index: 1001; width: 252px; padding: 8px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow-3); font-size: 13px; }
.ai-micp[hidden] { display: none; }
.ai-micp p { color: var(--text2); padding: 2px 4px 4px; }
.ai-micp button { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: var(--r-xs); font-size: 13px; }
.ai-micp button:hover { background: var(--hover); }

/* Instant Triage */
.tri-req { margin-bottom: 14px; }
.tri-k { font-family: var(--mono); font-size: 11px !important; text-transform: uppercase; letter-spacing: .06em; }
.chip.on { border-color: var(--amber); color: var(--text); background: rgba(var(--amber-a),.12); }
.chip:disabled { opacity: .6; cursor: not-allowed; }
.tri-in { display: flex; gap: 10px; align-items: flex-end; }
.tri-in textarea { flex: 1; min-height: 64px; }
.tri-in .btn { height: 42px; flex: none; }
.tri-lanes { margin-top: 0; }
.tri-lh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tri-lh .chips { margin: 0; }
.tri-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tri-stats small { display: block; font-family: var(--mono); font-size: 10px !important; text-transform: uppercase; letter-spacing: .06em; color: var(--faint) !important; }
.tri-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tri-dl { display: grid; gap: 6px; margin-top: 10px; font-size: 13.5px; }
.tri-r { display: flex; justify-content: space-between; gap: 10px; }
.tri-r dt { color: var(--muted); }
.tri-r dd { text-align: right; font-weight: 600; }
.tri-r em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 4px; }
.tri-u0 { color: var(--muted); } .tri-u1 { color: var(--info); } .tri-u2 { color: var(--amber-ink); } .tri-u3 { color: var(--danger); }
.tri-bad { color: var(--danger); } .tri-ok { color: var(--ok); }
.tri-pts, .tri-wo, .tri-mo { margin-top: 14px; }
.tri-wo .tri-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.tri-bar { display: grid; grid-template-columns: 170px 1fr 230px; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.tri-bar i { height: 8px; border-radius: var(--r-xs); background: var(--panel2); overflow: hidden; }
.tri-bar s { display: block; height: 100%; background: var(--line2); }
.tri-bar.hi s { background: var(--amber); }
.tri-bar.hi span:first-child { font-weight: 700; }
@media (max-width: 760px) { .tri-in { flex-direction: column; align-items: stretch; } .tri-bar { grid-template-columns: 1fr; } .tri-wo .tri-dl { grid-template-columns: 1fr; } }
