/* Studio > Avatars (13 Nov 2026). Loaded after race.css. Every class here starts with av. */

#main section + section { margin-top: 26px; }
#main section > h2 { margin: 18px 0 2px; }
#main section > .small { color: var(--hb-slate); margin: 0; }
#avMsg { margin-top: 10px; }
#avMsg:empty { display: none; }

/* Cards that keep one width, as many to a row as fit. */
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.avgrid > .empty { grid-column: 1 / -1; }
.avgrid > .empty p { margin: 0; color: var(--hb-slate); }

.avcard { display: flex !important; flex-direction: row !important; gap: 14px !important; padding: 12px !important; min-width: 0; align-items: flex-start; }
.avpic { flex: 0 0 84px; width: 84px; height: 112px; border-radius: 10px; overflow: hidden; background: var(--hb-mist);
  border: 1px solid var(--hb-line); display: grid; place-items: center; }
.avpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avpic svg { width: 40px; height: 40px; fill: none; stroke: var(--hb-slate); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.avbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.avbody b { overflow-wrap: anywhere; }
.avbody .small { color: var(--hb-slate); overflow-wrap: anywhere; }
.avbody .avwho { color: var(--hb-ink); }
.avbody .row { margin-top: 6px; gap: 8px; flex-wrap: wrap; }

/* Try it, in a HoloBox911 (A-142). The cabinet is Maya's page's own (.my-hbx, .my-glass in studio-maya.css). */
#dlg:has(.avtry) { width: min(860px, calc(100vw - 32px)); }
.avtry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; margin: 12px 0; }
.avtry-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.avtry-hbx { width: clamp(170px, 30vh, 250px); }
.avtry-hbx .my-glass { display: grid; place-items: center; background: var(--hb-mist); }
.avtry-hbx .my-glass video, .avtry-hbx .my-glass img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; mix-blend-mode: multiply; display: block; }
.avtry-hbx .my-glass svg { width: 48px; height: 48px; fill: none; stroke: var(--hb-slate); stroke-width: 1.5; }
.avtry-talk { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.avtry-log { border: 1px solid var(--hb-line); border-radius: 12px; padding: 10px 12px; min-height: 180px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.avtry-log:empty::before { content: 'What you say and what it answers appear here.'; color: var(--hb-slate); font-size: 14px; }
.avtry-line { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.avtry-line b { display: block; font-size: 12px; color: var(--hb-slate); }
.avtry-line.you { align-self: flex-end; text-align: right; }
.avtry-hold { min-height: 52px; touch-action: none; user-select: none; }
.avtry-hold.on { outline: 3px solid #EC008C; outline-offset: 2px; }
.avtry-talk .row input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .avtry { grid-template-columns: 1fr; } }

/* The answer in the "Ask" pop-up. */
.avanswer { margin: 10px 0; white-space: pre-wrap; }
#avQ { width: 100%; }
/* An avatar's own page (A-159): the same frame and talk panel as Try it, larger. */
.avpage { margin-top: 12px; }
.avpage .avtry-hbx { width: clamp(220px, 44vh, 340px); }
.avpage .avtry-log { min-height: 260px; max-height: 52vh; }

/* A-174 (UX-18): "Runs on", the cut text with "More", and the live / down dot of a linked page. */
.av-runs { color: var(--hb-slate); }
.av-text { color: var(--hb-slate); overflow-wrap: anywhere; }
.av-text .link { font-size: inherit; }
.av-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--hb-slate); display: inline-block; }
.av-dot.up { background: var(--hb-ok); }
.av-dot.down { background: var(--hb-bad); }
.av-live { white-space: nowrap; }

/* A-224: the card's ⋯ menu, its state lines, and the Configure panel. */
#main .card.av-card { overflow: visible; }
.av-pic { border-radius: 16px 16px 0 0; cursor: pointer; }
.av-pic:focus-visible { outline: 2px solid var(--hb-blue-deep); outline-offset: -2px; }
.av-acts .av-menu { margin-left: auto; }
.av-row .av-acts { margin-top: 0; }
.av-bad { color: var(--hb-bad); }
.av-voice { color: var(--hb-slate); }
#dlg:has(.avc) { width: min(640px, calc(100vw - 32px)); }
.avc { display: grid; gap: 14px; min-width: 0; }
.avc-eff { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--hb-mist); }
.avc-sec { display: grid; gap: 10px; min-width: 0; padding-top: 10px; border-top: 1px solid var(--hb-line); }
.avc-sec h3 { margin: 0; font-size: 16px; }
.avc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; min-width: 0; }
.avc-grid > div { min-width: 0; }
.avc-grid input, .avc-grid select, .avc-keyrow input { width: 100%; min-width: 0; box-sizing: border-box; }
.avc-key { display: grid; gap: 6px; min-width: 0; }
.avc-keyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.avc-keyrow input { flex: 1 1 180px; width: auto; }
.avc-masked { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.avc-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.avc-hold { margin: 0; color: var(--hb-slate); }
