/* Вход, кабинет, голоса, текст. Цвета и кнопки берутся из style.css. */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { display: grid; gap: 16px; width: min(400px, 100%); padding: 32px 28px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); }
.login-card h1 { margin: 0; font-size: 26px; }
.login-card p { margin: 0; }
.login-card form, .account-form { display: grid; gap: 14px; }
.login-card label, .account-form label { display: grid; gap: 6px; font-size: 14px; }
.login-card input, .account-form input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); font: inherit; }
#login-error, .account-error { color: #FFB4A6; min-height: 1.3em; }
.account { display: grid; gap: 20px; max-width: 920px; }
.account-block { display: grid; gap: 14px; padding: 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.account-block > .primary { justify-self: start; }
.account-block h2 { margin: 0; font-size: 20px; }
.account-block p { margin: 0; }
.account-head { grid-template-columns: auto 1fr auto; align-items: center; }
.account-balance { display: grid; justify-items: end; font-size: 22px; }
.account-balance .muted { font-size: 13px; }
.account-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.account-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.account-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.account-tools button { border-radius: 999px; }
.account-table { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.account-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.account-table th, .account-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.account-table td:last-child, .account-table th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.account-table .plus { color: #8FE3B0; }
.account-secret { margin: 0; padding: 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; user-select: all; }
.voices { display: grid; gap: 8px; }
.voices input[type=search] { width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line-strong); font: inherit; }
.voice-list { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; padding: 2px; }
.voice { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 8px; align-items: center; padding: 6px; border-radius: 14px; border: 1px solid transparent; }
.voice[data-chosen=true] { border-color: #EF5F18; background: rgba(239, 95, 24, .07); }
.voice span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.voice button { border-radius: 999px; min-height: 36px; }
.voice .voice-play { grid-row: span 2; }
.voice .voice-pick { grid-column: 2; justify-self: start; min-height: 32px; padding: 2px 14px; font-size: 13px; border: 1px solid var(--line-strong); }
.voice .voice-pick:disabled { opacity: .45; cursor: default; }
.text-job { display: grid; gap: 12px; padding: 20px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.text-job .question { font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.text-job .answer { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin: 0; }
.thread-note { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; grid-column: 1 / -1; }
@media (max-width: 600px) {
  .account-head { grid-template-columns: auto 1fr; }
  .account-balance { grid-column: 1 / -1; justify-items: start; }
}

.text-link { padding: 0; min-height: 0; border: 0; background: none; color: #FFB48C; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; text-align: left; }
.text-job .answer.folded { max-height: 360px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.text-job { align-content: start; }
#settings #provider-run:disabled { opacity: .6; cursor: default; }
main[data-layout="gen"] #settings { position: static; max-height: none; overflow: visible; }
main[data-layout="gen"] .feed { max-width: none; }
main[data-layout="gen"] #provider-jobs > .card { align-content: start; }
main[data-layout="gen"] .empty-state:not(.video-slot) { align-content: center; }

.material-label:has(.tile-tools > :nth-child(2)) { padding-right: 74px; }
.tile-tools { position: absolute; right: 4px; top: 6px; display: flex; gap: 2px; }
.material-label .tile-tools .icon-button { position: relative; right: auto; top: auto; }
.project-cell { position: relative; display: grid; min-width: 0; }
.project-cell .project-more { position: absolute; top: 8px; right: 8px; }
.trash { display: grid; gap: 18px; }
.trash .tile .outline { margin-top: 8px; width: 100%; }

.history-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.history-bar select, .history-bar input { width: auto; min-height: 40px; }
.history-totals { font-weight: 600; }
.history-body { display: grid; gap: 12px; min-width: 0; }
.history-body h3 { margin: 6px 0 0; font-size: 16px; }
.account-table td { vertical-align: top; }
@media (max-width: 600px) {
  .history-body thead { display: none; }
  .history-body table, .history-body tbody { display: block; }
  .history-body tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .history-body td { padding: 0; border: 0; grid-column: 1 / -1; }
  .history-body td:first-child { grid-column: 1; grid-row: 1; color: var(--muted); }
  .history-body td:last-child { grid-column: 2; grid-row: 1; font-weight: 600; }
}

/* Один индикатор фокуса: только с клавиатуры, без второй рамки внутри поля. */
#settings :is(.prompt-box, .pick) :is(input, textarea, select):focus, #settings :is(.prompt-box, .pick) :is(input, textarea, select):focus-visible { outline: 0; }
#settings .prompt-box:focus-within, #settings .pick:focus-within { outline: 0; }
html[data-nav="keys"] #settings .prompt-box:has(textarea:focus), html[data-nav="keys"] #settings .pick:has(> :is(input, select, textarea):focus) { outline: 2px solid var(--white); outline-offset: 1px; }
html[data-nav="keys"] #settings .voices input[type=search]:focus { outline: 2px solid var(--white); outline-offset: 1px; }
/* Карточка изображения */
.player-image { aspect-ratio: 16 / 9; display: grid; place-items: center; }
.player-image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.player-image .image-more { display: none; position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(24,16,41,.6); }
.image-retry { position: absolute; }
@media (hover: none) {
  .player-image .media-actions { display: none; }
  .player-image .image-more { display: grid; place-items: center; }
}
/* Зоны загрузки */
html[data-drag] .drop-zone { outline: 2px dashed #FF995F; outline-offset: 2px; border-radius: 12px; }
.drop-zone.drop-over { background: rgba(255, 153, 95, .2); }
.copy-id { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.copy-id code { font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }
.copy-id .icon-button { width: 28px; height: 28px; flex: none; }
.copy-id .icon { width: 14px; height: 14px; }
.qr { justify-self: center; width: min(220px, 70vw); border-radius: 12px; overflow: hidden; }
.qr svg { display: block; width: 100%; height: auto; }
.appeal-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.account-form textarea, .account-form select { width: 100%; }
