/* §310 The ✨ assistant's panel: beside the screen on a computer, the whole screen on a phone. Colours only through the
   platform's tokens, so the dark theme follows. */
.assistant-button { font-size: 1.05rem; }
.as-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 3700; width: min(440px, 100vw); display: flex; flex-direction: column;   /* above the floating buttons (3600) */
  background: var(--card); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(105%); visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s; }
.as-panel.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
body.as-is-open #msg-fab { display: none; }   /* the 💬 chat's button would sit on Send */
@media (prefers-reduced-motion: reduce) { .as-panel { transition: none; } }
.as-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.as-name { color: var(--ink); font-size: 1rem; }
.as-head-actions { display: flex; align-items: center; gap: 6px; }
.as-menu { position: absolute; top: calc(100% + 4px); right: 10px; left: 10px; z-index: 2; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.as-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.as-empty p { margin: 0 0 12px; color: var(--ink); line-height: 1.5; }
.as-examples { display: grid; gap: 8px; }
.as-example { text-align: left; white-space: normal; height: auto; min-height: 40px; line-height: 1.35; padding: 8px 12px; }
.as-msg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.as-user { align-items: flex-end; }
.as-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px 14px 4px 14px; background: var(--green-soft); color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.as-text { color: var(--ink); line-height: 1.5; overflow-wrap: anywhere; }
.as-text p { margin: 0 0 8px; }
.as-text p:last-child { margin-bottom: 0; }
.as-text ul, .as-text ol { margin: 0 0 8px; padding-left: 1.2em; }
.as-text code { font-size: .88em; padding: 1px 4px; border-radius: 4px; background: var(--canvas); }
.as-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.as-step { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; color: var(--muted); }
.as-step-icon { flex: none; width: 1.1em; text-align: center; font-weight: 700; }
.as-step-done .as-step-icon { color: var(--green); }
.as-step-refused .as-step-icon, .as-step-refused b { color: var(--danger); }
.as-step-running .as-step-icon { color: var(--brand-orange); }
.as-step-text { min-width: 0; overflow-wrap: anywhere; }
.as-step-text b { color: var(--ink); font-weight: 600; }
.as-step-text small { color: var(--muted); }
.as-card { border: 1px solid var(--brand-orange); border-radius: 12px; padding: 10px 12px; background: var(--peach-soft); display: grid; gap: 8px; }
.as-card.is-answered { border-color: var(--line); background: var(--canvas); }
.as-card-title { color: var(--ink); line-height: 1.35; }
.as-args { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.as-arg { display: grid; gap: 2px; font-size: .85rem; min-width: 0; }
.as-arg span { color: var(--muted); text-transform: capitalize; }
.as-arg b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.as-arg-id { font-size: .75rem; }
.as-arg-id code { color: var(--muted); overflow-wrap: anywhere; }
.as-arg pre { margin: 0; padding: 6px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-soft); color: var(--ink); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow-y: auto; }
.as-card-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.as-error { margin: 0; color: var(--danger); font-weight: 600; }
.as-working { margin: 0; color: var(--muted); font-size: .9rem; }
.as-convs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.as-convs li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.as-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.as-conv b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-conv small { color: var(--muted); }
.as-foot { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; background: var(--card); }
.as-input { width: 100%; resize: vertical; min-height: 56px; max-height: 40vh; }
.as-foot-row { display: flex; align-items: center; gap: 8px; }
.as-note { flex: 1; min-width: 0; color: var(--muted); font-size: .75rem; line-height: 1.3; }
@media (max-width: 560px) {
  .as-panel { width: 100vw; border-left: 0; }
  .as-head-actions .text-button { font-size: .85rem; }
}

/* §315 Practice: the label beside the name, and the note on the empty panel */
.as-practice { margin-left: 6px; }
.as-practice-note { margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--canvas); color: var(--ink); font-size: .9rem; line-height: 1.5; }

/* §323 files for the next message: the chips above the box, the paperclip, the drop zone */
.as-attach { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.as-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--canvas); color: var(--ink); font-size: .8rem; text-decoration: none; }
.as-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.as-chip small { color: var(--muted); white-space: nowrap; }
.as-chip.is-error { border-color: var(--danger); color: var(--danger); }
.as-chip-wait { width: 1em; height: 1em; }
.as-chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 2px; line-height: 1; }
.as-chip-x:hover { color: var(--danger); }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.as-chip-sent { background: var(--card); }
.as-attach-note { flex-basis: 100%; color: var(--muted); font-size: .72rem; }
.as-attach-hint { margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--canvas); color: var(--ink); font-size: .9rem; line-height: 1.5; }
.as-clip { flex: none; font-size: 1.05rem; }
.as-panel.is-drop::after { content: "Drop the file here"; position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink); font-weight: 700; pointer-events: none; }
