




.rail-item.asst-rail { margin-top: auto; position: sticky; bottom: 14px; color: var(--muted); background: var(--surface); }
.rail-item.asst-rail:hover, .rail-item.asst-rail.active { color: var(--ink); background: var(--raised); }
.rail-item.asst-rail.waiting { color: var(--ink); }



.asst-mark { position: relative; display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); vertical-align: middle; }
.asst-mark::before, .asst-mark::after {
  content: ''; position: absolute; top: 7px; width: 3px; height: 5px; border-radius: 2px; background: var(--accent-ink);
  animation: asst-blink 11s infinite; transform-origin: center;
}
.asst-mark::before { left: 5px; } .asst-mark::after { right: 5px; }
.asst-rail.waiting .asst-mark::before, .asst-rail.waiting .asst-mark::after { top: 5px; }
@keyframes asst-blink { 0%, 96.5%, 100% { transform: scaleY(1); } 98% { transform: scaleY(.15); } }

.asst-panel {
  position: fixed; left: 212px; bottom: 14px; width: 372px; z-index: 35;
  max-height: min(560px, calc(100vh - 84px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
  display: flex; flex-direction: column;
}
.asst-panel.hidden { display: none; }
.asst-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.asst-title { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.asst-list { flex: 1; min-height: 132px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.asst-empty { margin: auto 0; color: var(--faint); font-size: 12.5px; text-align: center; padding: 18px 8px; }
.asst-msg { max-width: 88%; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--r-md); padding: 8px 11px; }
.asst-msg.me { align-self: flex-end; background: rgba(var(--accent-rgb), .16); color: var(--ink); }
.asst-msg.it { align-self: flex-start; background: var(--raised); color: var(--ink); }
.asst-msg.it.fault { color: var(--muted); }
.asst-wait { display: inline-flex; gap: 4px; padding: 5px 0 3px; }
.asst-wait i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: asst-wait 1.2s infinite ease-in-out; }
.asst-wait i:nth-child(2) { animation-delay: .15s; } .asst-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes asst-wait { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

 
.asst-draft { align-self: stretch; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.asst-draft-kind { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.asst-draft-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.asst-draft-text {
  width: 100%; resize: none; min-height: 44px; max-height: 220px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; padding: 7px 9px;
}
.asst-draft-text:focus { outline: none; border-color: var(--blue); }
.asst-draft-foot { display: flex; align-items: center; gap: 10px; }
.asst-draft-foot .btn-primary.sm, .asst-draft-foot .btn-quiet.sm { padding: 7px 16px; font-size: 12.5px; }
.asst-draft-said { font-size: 12px; color: var(--muted); }
.asst-draft-said.fault { color: var(--coral); }

.asst-foot { display: flex; align-items: flex-end; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.asst-text {
  flex: 1; resize: none; min-height: 38px; max-height: 120px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; padding: 8px 10px;
}
.asst-text:focus { outline: none; border-color: var(--blue); }
.asst-foot .btn-primary.sm { padding: 8px 16px; font-size: 13px; }



.asst-peek {
  position: fixed; left: 212px; bottom: 16px; max-width: 320px; z-index: 34;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 8px 26px rgba(0,0,0,.38); padding: 9px 12px; font-size: 13px; line-height: 1.45; color: var(--ink);
  text-align: left; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  animation: asst-arrive .28s ease-out;
}
.asst-peek.hidden { display: none; }
@keyframes asst-arrive { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.asst-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

 
.shell.script-open .asst-panel, .shell.desk-on .asst-panel, .shell.script-open .asst-peek, .shell.desk-on .asst-peek { left: 68px; }
@media (max-width: 900px) { .asst-panel, .asst-peek { left: 72px; } }
@media (max-width: 720px) { body:has(> .newbuild) .asst-panel, body:has(> .newbuild) .asst-peek { bottom: 76px; } }
@media (max-width: 460px) {
  .shell .asst-panel, .shell.script-open .asst-panel, .shell.desk-on .asst-panel { left: 12px; right: 12px; width: auto; bottom: 12px; max-height: calc(100vh - 76px); }
  .shell .asst-peek, .shell.script-open .asst-peek, .shell.desk-on .asst-peek { left: 12px; right: 12px; max-width: none; bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .asst-mark::before, .asst-mark::after, .asst-wait i, .asst-peek { animation: none; }
  .asst-wait i { opacity: .7; }
}
