/* ✨ AI helper of the creator panel (web/ai-assist.js, web/ai-batch.js): a quiet button under a text field,
   its actions, the review dialog and the batch of effect titles. Graphite tones of style.css, no new colours. */
.ai-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin: 6px 0 2px; }
/* The helper sits right after its field: a hidden field (e.g. the other language of a RU/EN switch) hides it too. */
[hidden] + .ai-tools { display: none; }
.ai-trigger { min-width: 0; min-height: 36px; gap: 6px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.ai-trigger:hover, .ai-trigger[aria-expanded="true"] { background: var(--panel-2); color: var(--text); }
.ai-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; width: 100%; }
.ai-menu .small { min-height: 40px; padding: 0 12px; font-size: 13px; }
.ai-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-md); color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-hint .small { min-height: 36px; font-size: 13px; }

.ai-dialog { width: min(640px, calc(100vw - 24px)); }
.ai-dialog h2 { margin-bottom: 4px; }
.ai-dialog h3 { margin: 14px 0 4px; font-size: 14px; font-weight: 650; }
.ai-options { display: grid; gap: 8px; margin: 10px 0 4px; }
.ai-option { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; width: 100%; min-height: 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--bg-deep); color: var(--text); font-weight: 500; line-height: 1.5; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-option:hover { background: var(--panel-2); }
.ai-option.is-selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--panel-2); }
.ai-length { align-self: flex-end; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ai-text, .ai-diff { max-height: 40vh; overflow: auto; margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-deep); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-diff del { margin-right: 3px; background: rgb(242 122 111 / .1); color: var(--danger); text-decoration: line-through; }
.ai-diff ins { background: rgb(90 196 143 / .12); color: var(--ok); text-decoration: none; }
.ai-length-row { margin: 0; text-align: right; }
.ai-dialog .ai-changes { margin: 4px 0 8px; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.ai-notice { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid rgb(228 174 79 / .45); border-radius: var(--radius-md); background: rgb(228 174 79 / .08); font-size: 13px; }
.ai-notice p, dialog .ai-notice p { margin: 0; color: var(--text); }
.ai-loading { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-2); }
.ai-spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--text); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spinner { animation: none; } }
.ai-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.ai-meta .field-hint { margin: 0; }
.ai-meta .ghost.small { min-height: 36px; font-size: 13px; }
.ai-model { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.ai-model select { max-width: min(260px, 60vw); min-height: 40px; }

#dialog:has(.ai-batch) { width: min(820px, calc(100vw - 24px)); }
.ai-batch-names { margin: 6px 0 12px; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.ai-batch-list { display: grid; gap: 10px; margin: 10px 0; }
.ai-batch-row { padding: 8px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-deep); }
.ai-batch-row.is-saved { opacity: .72; }
.ai-batch-row .check-row { margin: 0; padding: 6px 0 0; border: 0; background: transparent; }
.ai-batch-row .check-row small { font-family: var(--font-mono); font-size: 12px; }
.ai-batch-row .form-field label { margin: 8px 0 6px; color: var(--muted); font-size: 12px; }
.ai-batch-row .field-hint { margin-top: 6px; }
.ai-batch-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
@media (min-width: 640px) { .ai-batch-row .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* «✨ Translate all effects»: the review before saving (web/effects-localize.js) — one row per language, phone first. */
.effects-loc-tools { align-items: center; gap: 6px 10px; margin: 6px 0; }
.effects-loc-tools > .muted { flex: 1 1 auto; font-size: 13px; }
.effects-loc-tools-buttons { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.effects-loc-tools .small, .effects-loc-head .small, .effects-loc-confirm .small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.effects-loc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.effects-loc-name { min-width: 0; margin: 6px 0 0; overflow-wrap: anywhere; }
.effects-loc-name small { font-family: var(--font-mono); font-size: 12px; }
.effects-loc-effect.is-locked .effects-loc-langs { opacity: .6; }
.effects-loc-result { margin: 6px 0 0; font-size: 13px; }
.effects-loc-langs { display: grid; gap: 12px; margin-top: 10px; }
@media (min-width: 720px) { .effects-loc-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.effects-loc-lang { display: grid; gap: 4px; min-width: 0; }
.effects-loc-lang.is-saved { opacity: .72; }
.effects-loc-lang-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.effects-loc-check { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.effects-loc-check span { overflow-wrap: anywhere; }
.effects-loc-lang input[type="text"] { width: 100%; min-width: 0; }
.effects-loc-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.effects-loc-notes { display: grid; gap: 2px; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.effects-loc-meta .i18n-count { flex: none; }
.effects-loc-confirm { margin: 0 0 12px; }
.effects-loc-confirm p { margin: 0 0 8px; color: var(--text); }
