/* A program's AI assistant (shared/assist.js) – the same look as the MIDI editor's (midi/midi.css, .mi-voice-*) */
.as-box { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 12px; }
.as-top { display: flex; align-items: flex-start; gap: 8px; }
.as-topbtn { flex: none; margin-right: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: 13px var(--font, inherit); color: var(--text-2); padding: 4px 6px 4px 0; cursor: pointer; border-radius: 6px; }
.as-topbtn:hover { color: var(--text); }
.as-topbtn .material-symbols-outlined { font-size: 17px; }
.as-hide { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; background: none; color: var(--text-2); border-radius: 6px; cursor: pointer; }
.as-hide:hover { background: var(--surface-2, rgba(0,0,0,.05)); color: var(--text); }
.as-hide .material-symbols-outlined { font-size: 19px; }
.as-log { flex: 1; min-height: 80px; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.as-empty { margin: 6px 4px auto; color: var(--text-2); font-size: 13px; line-height: 1.5; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.as-empty .as-next { justify-content: center; max-width: 100%; }
.as-msg { display: flex; flex-direction: column; gap: 4px; }
.as-said { align-self: flex-end; max-width: 88%; background: var(--prog-soft, rgba(42,120,214,.12)); color: var(--text); border-radius: 12px 12px 4px 12px; padding: 6px 10px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.as-steps { align-self: flex-start; display: flex; flex-direction: column; gap: 1px; max-width: 92%; padding: 0 4px; }
.as-step { display: flex; align-items: flex-start; gap: 4px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.as-step .material-symbols-outlined { font-size: 15px; color: var(--prog-strong, var(--prog)); flex: none; }
.as-step.bad .material-symbols-outlined { color: #c2410c; }
.as-did { align-self: flex-start; max-width: 92%; background: var(--surface-2, rgba(0,0,0,.04)); border-radius: 12px 12px 12px 4px; padding: 6px 10px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.as-did p { margin: 0; }
.as-did p + p, .as-did p + ul, .as-did ul + p { margin-top: 6px; }
.as-did ul { margin: 4px 0 0; padding-left: 18px; }
.as-did li + li { margin-top: 2px; }
.as-did code { font: 12.5px var(--font-mono, ui-monospace, monospace); background: var(--surface, rgba(255,255,255,.6)); padding: 0 3px; border-radius: 3px; }
.as-err { align-self: flex-start; max-width: 92%; font-size: 13px; color: #c2410c; padding: 0 4px; }
.as-signin { align-self: flex-start; margin-top: 2px; }
.as-answer { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 92%; }
.as-cost { font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.as-work { align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 14px; background: var(--surface-2, rgba(0,0,0,.04)); max-width: 100%; box-sizing: border-box; }
.as-note { font-size: 26px; background: var(--ai-gradient); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: as-hue 2.4s linear infinite; }
.as-work-words { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.as-work-text { font-size: 14px; font-weight: 600; background: var(--ai-gradient); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: as-hue 2.4s linear infinite; }
.as-work-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-cancel { flex: none; font-size: 12px; padding: 2px 10px; }
@keyframes as-hue { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .as-note, .as-work-text { animation: none; color: var(--prog); background: none; } }
.as-foot { flex: none; display: flex; flex-direction: column; gap: 8px; }
.as-in { width: 100%; resize: none; font: inherit; font-size: 14px; line-height: 1.4; padding: 8px 10px; border-radius: 10px; min-height: 0; box-sizing: border-box; overflow-y: hidden; }
/* the suggested replies: buttons above the field (a click sends), the first as ghost text in it – Tab writes it in */
.as-replies { display: flex; flex-wrap: wrap; gap: 6px; }
.as-replies[hidden] { display: none; }
.as-replies .as-reply { border-style: solid; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.as-tabkey { display: none; position: absolute; right: 8px; top: 8px; padding: 0 5px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface); color: var(--muted); font: 600 10.5px var(--font-mono, ui-monospace, monospace); line-height: 16px; pointer-events: none; }
.as-field.as-ghosting .as-tabkey { display: block; }
/* what's sent while it works: waiting above the field, × takes one back */
.as-queue { display: flex; flex-direction: column; gap: 4px; }
.as-queue[hidden] { display: none; }
.as-queued { display: flex; align-items: flex-start; gap: 6px; padding: 5px 4px 5px 8px; border: 1px dashed var(--line); border-radius: var(--radius-l); background: var(--surface-2); font-size: 13px; line-height: 1.4; color: var(--text-2); }
.as-queued > .material-symbols-outlined { flex: none; font-size: 16px; margin-top: 1px; color: var(--muted); }
.as-queued-t { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.as-queued-x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.as-queued-x:hover { background: var(--hover); color: var(--text); }
.as-queued-x .material-symbols-outlined { font-size: 16px; }
/* the send button in the field's corner (o.send) */
.as-field { position: relative; }
.as-field .as-in { display: block; padding-right: 76px; }
.as-field.as-field-nosend .as-in { padding-right: 42px; }
/* pictures: the button beside send, the ones to go above the field, the ones sent in what they said */
.as-attach { position: absolute; right: 41px; bottom: 7px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.as-field-nosend .as-attach { right: 7px; }
.as-attach:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--text); }
.as-attach .material-symbols-outlined { font-size: 20px; }
.as-pics { display: flex; flex-wrap: wrap; gap: 6px; }
.as-pics[hidden] { display: none; }
.as-pic { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.as-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.as-pic-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(24,24,27,.72); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.as-pic-x .material-symbols-outlined { font-size: 14px; }
.as-said-pics { align-self: flex-end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 88%; }
.as-said-pics img { max-width: 120px; max-height: 96px; border-radius: 8px; border: 1px solid var(--line-soft); display: block; }
.as-box.as-dropping { outline: 2px dashed var(--prog); outline-offset: -4px; border-radius: 8px; background: var(--prog-soft, rgba(42,120,214,.06)); }
.as-send { position: absolute; right: 7px; bottom: 7px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--prog); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.as-send:hover { filter: brightness(1.08); }
.as-send:disabled { background: var(--line-soft); color: var(--muted); cursor: default; filter: none; }
.as-send .material-symbols-outlined { font-size: 19px; }
.as-close { margin-left: auto; } /* (the × in its section's header – the Sprite editor) */
.as-lock { align-self: center; border: 0; background: none; color: var(--prog-strong, var(--prog)); font: 600 12.5px var(--font, inherit); cursor: pointer; text-decoration: underline; }
.as-lock[hidden] { display: none; }
.as-next { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 4px; max-width: 96%; margin-top: 2px; }
.as-chip { border: 1px dashed var(--prog); background: transparent; color: var(--prog-strong, var(--prog)); font: 500 12.5px var(--font, inherit); padding: 3px 10px; border-radius: 999px; cursor: pointer; text-align: left; }
.as-chip:hover { background: var(--prog-soft, rgba(42,120,214,.1)); border-style: solid; }
.as-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the assistant hidden: a tab at the right edge brings it back (as in the MIDI editor) */
.as-tab { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 5; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface); color: var(--prog-strong, var(--prog)); font: 600 12px var(--font, inherit); cursor: pointer; box-shadow: -2px 0 10px rgba(0,0,0,.08); }
.as-tab span:last-child { writing-mode: vertical-rl; transform: rotate(180deg); }
.as-tab[hidden] { display: none; }
/* a file added (not a picture): a chip with its name – in the field's tray, and in what was said */
.as-filechip { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; color: var(--text); }
.as-filechip.said { padding-right: 10px; height: 32px; }
.as-filechip .material-symbols-outlined { font-size: 18px; color: var(--prog-strong, var(--accent-strong)); flex: none; }
.as-filechip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-filechip .as-pic-x { top: 50%; transform: translateY(-50%); right: 4px; }
.as-filechip .as-pic-x { background: transparent; color: var(--muted); }
.as-filechip .as-pic-x:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--text); }
.as-filechip .as-pic-x .material-symbols-outlined { font-size: 16px; color: inherit; }
