/* «ИИ-аватары» (web/admin-avatars.js, web/admin-avatars-chat.js, web/admin-avatars-erofy.js): the list, the editor with its hints and pictures, the test chat. */
.avt-try-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.avt-try-row select { flex: 1 1 260px; min-width: 0; }
.avt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.avt-how ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.avt-warn { border-color: var(--warn); }
.avt-warn p { margin: 4px 0; color: var(--warn); }
.avt-settings summary { cursor: pointer; font-weight: 600; }
.avt-settings form { display: grid; gap: 6px; margin-top: 12px; max-width: 520px; }
.avt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 16px; }
.avt-card { display: grid; gap: 8px; padding: 10px; }
.avt-card-open { display: block; padding: 0; border: 0; background: none; cursor: pointer; aspect-ratio: 3 / 4; border-radius: var(--radius-md); overflow: hidden; }
.avt-card-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avt-card-empty { display: grid; place-items: center; height: 100%; background: var(--panel-2); color: var(--muted); font-size: 13px; }
.avt-card-text h3 { margin: 0; font-size: 16px; }
.avt-card-text p { margin: 4px 0 0; }
.avt-card .pill.ok, .avt-publish .pill.ok, .avt-slot .pill.ok, .avt-loop-card .pill.ok { background: rgb(90 196 143 / .12); color: var(--ok); }
.avt-card .pill.warn, .avt-slot .pill.warn, .avt-loop-card .pill.warn { background: rgb(228 174 79 / .12); color: var(--warn); }

.avt-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 8px 0; background: var(--bg-deep); }
.avt-top [data-action="avt-save"] { margin-left: auto; }
.avt-dirty { color: var(--warn); font-size: 13px; }
.avt-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; }
.avt-main { display: grid; gap: 14px; min-width: 0; }
.avt-side { position: sticky; top: 56px; }
.avt-pair, .avt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; align-items: start; }
.avt-field { display: grid; gap: 4px; margin-top: 10px; min-width: 0; align-content: start; }
.avt-field textarea, .avt-field input, .avt-field select { width: 100%; box-sizing: border-box; }
.avt-label { display: flex; align-items: center; gap: 6px; }
.avt-label label { margin: 0; }
.avt-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.avt-star { padding: 2px 6px; line-height: 1; }
.avt-changed textarea, .avt-changed input { border-color: var(--primary); box-shadow: 0 0 0 2px rgb(120 140 255 / .15); }
.avt-proposal:not(.on) { display: none; }
.avt-proposal { padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.avt-proposal pre { margin: 6px 0; white-space: pre-wrap; font-family: inherit; }
.avt-helper textarea { width: 100%; box-sizing: border-box; }
.avt-review ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 8px; }
.avt-review .link { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }
.avt-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; }
.avt-slot { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.avt-slot h3 { margin: 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avt-slot img, .avt-made img { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg-deep); display: block; }
.avt-slot-empty { display: grid; place-items: center; min-height: 120px; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; }
.avt-upload { cursor: pointer; }
.avt-slot .file-button { margin: 0; }
.avt-job { margin: 0; color: var(--muted); }
.avt-warn-line { color: var(--warn); }
.avt-publish ul { margin: 6px 0; padding-left: 18px; }

.avt-chat { display: grid; gap: 8px; }
.avt-chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.avt-chat-head h2 { margin: 0; font-size: 17px; }
.avt-chat-tools { margin-left: auto; display: flex; gap: 6px; }
.avt-chat-log { display: grid; gap: 8px; align-content: start; height: min(60vh, 560px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-deep); }
.avt-msg { max-width: 88%; padding: 8px 10px; border-radius: 14px; overflow-wrap: anywhere; }
.avt-msg p { margin: 0; }
.avt-msg-user { justify-self: end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.avt-msg-bot { justify-self: start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.avt-msg.failed { opacity: .55; }
.avt-meta { margin-top: 4px !important; font-size: 11px; color: var(--muted); }
.avt-chat-offer { display: grid; gap: 6px; margin-top: 6px; }
.avt-chat-photo { width: 100%; border-radius: 10px; display: block; }
.avt-memory summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.avt-memory p { white-space: pre-wrap; font-size: 13px; }
.avt-chat-form { display: flex; gap: 8px; align-items: end; }
.avt-chat-form textarea { flex: 1; min-width: 0; resize: vertical; }

@media (max-width: 900px) {
  .avt-layout { grid-template-columns: 1fr; }
  .avt-side { position: static; }
  .avt-chat-log { height: 420px; }
}

/* «Живая карточка»: the loop as the site plays it. */
.avt-loop-row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;margin:10px 0}
.avt-loop-video{display:block;width:200px;max-width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:14px;background:#111}
.avt-loop-card .avt-slot-empty{width:200px;aspect-ratio:3/4}
.avt-loop-card .form-actions{justify-content:flex-start;align-items:center}
.avt-loop-card .file-button{margin:0}
.avt-check{display:flex;gap:8px;align-items:center;margin-top:10px;font-size:14px}
video.avt-chat-photo { background: #000; }
/* A circle («кружок»): round, as the sites draw it. */
.avt-chat-circle { display: block; width: min(220px, 100%); aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #000; }
.avt-chat-says { margin: 4px 0; font-style: italic; }
.avt-circle-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.avt-circle-side { display: grid; gap: 8px; align-content: start; }
.avt-circle-side h3 { margin: 0; font-size: 15px; }
.avt-circle-preview { display: block; width: min(220px, 100%); aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #000; }
.avt-circle-empty { display: grid; place-items: center; width: min(220px, 100%); aspect-ratio: 1; padding: 18px; border: 1px dashed var(--line, rgb(127 127 127 / .4)); border-radius: 50%; text-align: center; font-size: 13px; color: var(--muted, #888); }
.avt-circle-says { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.avt-chat-voice, .avt-voice-sample { display: block; width: 100%; max-width: 360px; }
.avt-voice-heard { margin-top: 8px; }
.avt-voice-heard:empty { display: none; }
.avt-chat-motion { font-size: 12px; }
.avt-chat-motion p { margin: 4px 0 0; white-space: pre-wrap; }

/* «Персонаж в ErofyLab» (web/admin-avatars-erofy.js): its state, the actions, the 11 views (five faces, six figures). */
.avt-erofy h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avt-erofy .pill.ok { background: rgb(90 196 143 / .12); color: var(--ok); }
.avt-erofy-status { display: grid; gap: 6px; margin-top: 10px; }
.avt-erofy-status p { margin: 0; }
.avt-erofy-bar { display: block; width: 100%; height: 6px; margin: 0; border: 0; border-radius: 999px; background: var(--panel-2); color: var(--primary); -webkit-appearance: none; appearance: none; overflow: hidden; }
.avt-erofy-bar::-webkit-progress-bar { border-radius: 999px; background: var(--panel-2); }
.avt-erofy-bar::-webkit-progress-value { border-radius: 999px; background: var(--primary); transition: width .4s ease; }
.avt-erofy-bar::-moz-progress-bar { border-radius: 999px; background: var(--primary); }
.avt-erofy .form-actions { justify-content: flex-start; }
/* The pictures' hint after the passport fields (web/admin-avatars.js): apart from the last field's hint. */
.avt-pair + p.muted { margin-top: 14px; }
.avt-erofy-id { font-size: 12px; overflow-wrap: anywhere; }
.avt-erofy-views { display: grid; gap: 10px; margin-top: 12px; }
.avt-erofy-row { display: grid; gap: 8px; }
.avt-erofy-faces { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.avt-erofy-figures { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.avt-erofy-view { display: grid; gap: 4px; align-content: start; margin: 0; min-width: 0; }
.avt-erofy-view a { display: block; }
.avt-erofy-view img, .avt-erofy-none { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg-deep); }
.avt-erofy-figures img, .avt-erofy-figures .avt-erofy-none { aspect-ratio: 2 / 3; }
.avt-erofy-none { display: grid; place-items: center; box-sizing: border-box; border: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.avt-erofy-view figcaption { font-size: 12px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.avt-erofy-view.drawing img { opacity: .45; }
.avt-erofy-view.drawing figcaption { color: var(--warn); }
.avt-erofy-choice { display: grid; gap: 10px; min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.avt-erofy-option { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.avt-erofy-option input { margin-top: 4px; }
.avt-erofy-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; padding-left: 26px; }
.avt-erofy-picks .avt-check { margin-top: 6px; }
@media (max-width: 640px) {
  .avt-erofy-faces, .avt-erofy-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .avt-erofy-picks { padding-left: 0; }
  /* The characters two to a row (one was a whole screen, 343×538). */
  .avt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .avt-card { padding: 8px; gap: 6px; }
  .avt-card-text h3 { font-size: 15px; }
  .avt-card-text p { font-size: 13px; }
  .avt-new-row button { width: 100%; }
}
/* «Новый персонаж» above the folded steps. */
.avt-new-row { display: flex; justify-content: flex-end; margin: var(--space-grid) 0; }

/* «Подарки»: the catalogue's table on the list, a character's themes and dreams, the test chat's presents. */
.avt-presents form { max-width: none; }
.avt-presents form > label, .avt-presents form > input, .avt-presents form > select, .avt-presents form > .field-hint { max-width: 520px; }
.avt-present-levels-title { margin: 10px 0 4px; font-weight: 600; }
.avt-present-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; }
.avt-present-level { display: grid; gap: 4px; font-size: 14px; }
.avt-presents h3 { margin: 18px 0 6px; font-size: 15px; }
.avt-present-scroll { overflow-x: auto; }
.avt-present-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 14px; }
.avt-present-table th { padding: 4px 6px; text-align: left; font-weight: 600; white-space: nowrap; }
.avt-present-table td { padding: 3px 6px; vertical-align: middle; }
.avt-present-table img { display: block; width: 44px; min-width: 44px; max-width: none; height: 44px; border-radius: 8px; object-fit: cover; }
.avt-present-table td:nth-child(2) { width: 56px; }
.avt-present-table td:nth-child(3), .avt-present-table td:nth-child(4) { min-width: 170px; }
.avt-present-table input:not([type="checkbox"]), .avt-present-table select { width: 100%; min-width: 64px; margin: 0; }
.avt-present-table td:nth-child(5) input { max-width: 96px; }
.avt-present-off { opacity: .55; }
.avt-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 2px; }
.avt-chips .avt-chip { margin: 0; padding: 5px 10px; border: 1px solid var(--line, rgba(127, 127, 127, .35)); border-radius: 999px; font-size: 13px; }
.avt-presents-card .avt-label { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; }
.avt-presents-card .avt-label p { margin: 0; }
.avt-chat-presents { margin: 8px 0; }
.avt-chat-give { display: flex; gap: 8px; align-items: center; }
.avt-chat-give select { flex: 1; min-width: 0; margin: 0; }
.avt-chat-wardrobe { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
