/* ── Reset & Base ─────────────────────────────────────────────────────────── */
/* Токены дизайна — в static/tokens.css (подключается перед этим файлом). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: var(--bg-decor);   /* тёмная: золотая аура сверху (эталон .ai) */
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--label);
  min-height: 100vh;
}

/* ── Auth Layout ──────────────────────────────────────────────────────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--elev-2);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--accent); }

.logo-text {
  font-family: var(--font-brand);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--label);
}
.logo-text span { color: var(--accent); }
.logo-text .br { color: var(--label4); font-weight: 400; }

.logo-sub {
  font-family: var(--font-brand);
  font-size: 13px;
  color: var(--label3);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 6px;
}
.logo-sub .gold { color: var(--accent); }
.logo-sub .br { color: var(--label4); font-weight: 400; }

.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.auth-desc {
  font-size: 15px;
  color: var(--label3);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ── Sent State ───────────────────────────────────────────────────────────── */
.sent-state { text-align: center; }
.sent-icon { display: flex; justify-content: center; margin-bottom: 16px; color: var(--accent); }
.sent-state h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.sent-state p { font-size: 15px; color: var(--label3); line-height: 1.5; margin-bottom: 8px; }
.sent-state .note { font-size: 13px; color: var(--label4); margin-bottom: 24px; }

/* ── Error Banner ─────────────────────────────────────────────────────────── */
.error-banner {
  background: var(--c-danger-bg);
  border: 1px solid var(--c-danger-line);
  border-radius: var(--radius-sm);   /* панель-уведомление — канон sm (не терминальный бейдж) */
  padding: 12px 14px;
  font-size: 14px;
  color: var(--c-danger);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.error-icon { flex-shrink: 0; display: inline-flex; }

/* ── Иконки (набор Lucide, наследуют цвет текста) ─────────────────────────── */
.ic  { width: 18px; height: 18px; display: inline-block; vertical-align: -0.18em; flex: none; }
.ic-sm { width: 14px; height: 14px; display: inline-block; vertical-align: -0.15em; flex: none; }
.ic-lg { width: 40px; height: 40px; display: block; flex: none; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-fields { display: flex; flex-direction: column; gap: 14px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }

/* только МЕТКА поля (прямой ребёнок) — НЕ label.preset-card внутри сетки пресетов */
.input-group > label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--label2);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.optional { font-weight: 400; color: var(--label4); }

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--separator);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--label);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input-group input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.input-group input::placeholder { color: var(--label4); }

/* ── Buttons — фирменный CTA: капс, резкие углы, светлая=бронза+белый,
     тёмная=золото+обсидиан (канон CTA light v2 / dark) ─────────────────────── */
.btn-primary {
  width: 100%;
  min-height: 48px;              /* touch-таргет ≥48 (канон mobile) */
  padding: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--c-gold-contrast);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);   /* главный CTA — канон ui-kit sm (4px), капс-моно сохранён */
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: .10em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) {
  /* Канон Макса: яркий золотой CTA на hover СВЕТЛЕЕТ (не темнеет) — заливка идёт
     в яркий стоп #EBC554, тёмный текст (--c-gold-contrast) остаётся читаемым
     (~10:1). Прежний уход в тёмную бронзу давал тёмный-на-тёмном. */
  background: var(--c-gold-mid);
  border-color: var(--c-gold-mid);
  color: var(--c-gold-contrast);
  box-shadow: var(--elev-2), 0 0 18px rgba(153,128,24,.22);
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg);
  color: var(--label);
  border: 1.5px solid var(--separator);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--separator); }

/* Хедер — общий для всех экранов: .app-topbar в components.css. */

/* ── Main Content ──────────────────────────────────────────────────────────
   Десктоп: широкая рабочая карточка (пресеты 4 в ряд) — главный экран влезает
   в фолд ноутбука без вертикального скролла (канон Fold-first 1440×800). */
.main-content {
  max-width: 820px;   /* шире прежних 680: запас под рост числа пресетов; вровень с .wrap отчёта */
  margin: 0 auto;
  padding: 20px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (min-width: 1100px) {
  .main-content { max-width: 960px; }
}

/* ── Шапка карточки: заголовок слева + статус-плашка справа (экономия фолда) ── */
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.card-head__text { flex: 1 1 520px; min-width: 0; }
.card-head .card-title { margin-bottom: 4px; }
.card-head .card-desc { margin-bottom: 0; }
.card-head .status-bar { flex: none; padding-top: 4px; }
@media (max-width: 700px) {
  .card-head { flex-direction: column; gap: 10px; }
  /* в колонке flex-basis 520px стал бы ВЫСОТОЙ — сбрасываем */
  .card-head__text { flex: 0 0 auto; }
  .card-head .status-bar { padding-top: 0; }
}

/* ── Status Bar — терминальная плашка (канон ai-status-badge эталона .ai) ──── */
.status-bar { display: flex; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 0;   /* капс-моно статус-плашка — терминальный слой, острый край намеренно */
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
}
.status-pill.busy {
  background: var(--c-warn-bg);
  color: var(--c-warn);
  border-color: color-mix(in srgb, var(--c-warn) 35%, transparent);
}
.status-pill.ready {
  background: var(--c-success-bg);
  color: var(--c-success);
  border-color: color-mix(in srgb, var(--c-success) 35%, transparent);
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-warn);
  box-shadow: 0 0 7px var(--c-warn);
  animation: pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.dot-green {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  flex-shrink: 0;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 24px 26px 26px;
  box-shadow: var(--elev-1);
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
/* «?» рядом с ЗАГОЛОВКОМ крупнее строчной help-q — выравниваем к кеглю заголовка */
.card-title .help-q { width: 18px; height: 18px; font-size: 12px; }
.card-desc {
  font-size: 14px;
  color: var(--label3);
  margin-bottom: 24px;
}

/* ── Drop Zone — терминальный приёмник: сетка-фон + угловые скобки бренда.
     Компактная горизонтальная полоса (иконка + тексты) — экономия фолда. ──── */
.drop-zone {
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--radius-md);   /* крупный приёмник — канон md; угловые скобки держат брутал-акцент */
  display: flex;
  align-items: center;
  justify-content: center;           /* группа иконка+текст по центру зоны, а не в углу */
  column-gap: 16px;
  min-height: 112px;
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s;
  margin-bottom: 18px;
  position: relative;
  background-image:
    linear-gradient(to right, rgba(153,128,24,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(153,128,24,.045) 1px, transparent 1px);
  background-size: 24px 24px;
}
:root[data-theme="dark"] .drop-zone {
  background-image:
    linear-gradient(to right, rgba(235,197,84,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(235,197,84,.05) 1px, transparent 1px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .drop-zone {
    background-image:
      linear-gradient(to right, rgba(235,197,84,.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(235,197,84,.05) 1px, transparent 1px);
  }
}
/* угловые маркеры-скобки — square brackets айдентика GOLDJAXE */
.drop-zone::before, .drop-zone::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--c-gold-line);
  transition: border-color 0.2s;
  pointer-events: none;
}
/* Г-образные скобки сдвинуты внутрь на радиус (md 8px) — обнимают скруглённый
   угол, а не висят вне контура. Свой малый радиус повторяет кривизну угла. */
.drop-zone::before { top: 5px; left: 5px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius-xs); }
.drop-zone::after  { bottom: 5px; right: 5px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius-xs); }
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background-color: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--c-gold-line), 0 0 24px rgba(153,128,24,.12);
}
.drop-zone:hover::before, .drop-zone:hover::after,
.drop-zone.drag-over::before, .drop-zone.drag-over::after { border-color: var(--accent); }
.drop-zone.has-file {
  border-color: var(--green);
  background-color: var(--c-success-bg);
  box-shadow: none;
}
.drop-zone.has-file::before, .drop-zone.has-file::after { border-color: var(--green); }

.drop-icon { flex: none; margin: 0; color: var(--label3); display: flex; justify-content: center; }
.drop-icon .ic-lg { width: 34px; height: 34px; }
.drop-zone:hover .drop-icon, .drop-zone.drag-over .drop-icon { color: var(--accent); }
.drop-text { display: flex; flex-direction: column; }   /* заголовок + подпись + инфо о файле — одна колонка */
.drop-title { font-size: 15px; font-weight: 600; color: var(--label); margin-bottom: 3px; }
.drop-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; color: var(--label4); text-transform: uppercase; }

.file-info { margin-top: 8px; }
.file-name { font-size: 14px; font-weight: 600; color: var(--label); }
.file-size { font-size: 12.5px; color: var(--label4); margin-top: 2px; }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap { margin: 12px 0; }
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--label3);
  margin-bottom: 8px;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-gold-strong), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.btn-upload { margin-top: 8px; }

/* ── Result Card ──────────────────────────────────────────────────────────── */
.result-card { text-align: center; padding: 36px 28px; }
.result-icon { margin-bottom: 12px; }
.ios-check {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ios-check svg { width: 100%; height: 100%; }
@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.result-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.result-rows { text-align: left; margin-bottom: 20px; }
.result-note { font-size: 14px; color: var(--label3); }

/* ── Status Page ──────────────────────────────────────────────────────────── */
.job-id-badge {
  display: inline-block;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--label3);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}
.status-rows { display: flex; flex-direction: column; gap: 0; }
.srow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 15px;
}
.srow:last-child { border-bottom: none; }
.slabel { color: var(--label3); }
.sval { font-weight: 500; color: var(--label); text-align: right; max-width: 60%; }

/* Капс-моно бейджи статуса — терминальный слой айдентики: острый край (0) намеренно,
   как .dtable-badge и канон-бейджи ui-kit. Радиусы-токены их не касаются. */
.badge-green {
  background: var(--c-success-bg); color: var(--c-success);
  border: 1px solid color-mix(in srgb, var(--c-success) 35%, transparent);
  padding: 3px 10px; border-radius: 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.badge-orange {
  background: var(--c-warn-bg); color: var(--c-warn);
  border: 1px solid color-mix(in srgb, var(--c-warn) 35%, transparent);
  padding: 3px 10px; border-radius: 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.badge-gray {
  background: var(--c-surface-2); color: var(--label3);
  border: 1px solid var(--c-line);
  padding: 3px 10px; border-radius: 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}

/* ── Result rows ──────────────────────────────────────────────────────────── */
.rrow {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 15px;
}
.rrow:last-child { border-bottom: none; }
.rlabel { color: var(--label3); }
.rval { font-weight: 600; color: var(--label); }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 0; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { color: var(--label3); font-size: 15px; }

/* ── Preset block ─────────────────────────────────────────────────────────── */
.preset-block { margin-top: 8px; }
.preset-block-label {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; color: var(--label2);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}
.preset-sub {
  font-size: 12.5px; color: var(--label3); margin-bottom: 8px;
}

.help-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--separator); background: var(--surface);
  color: var(--label3); font-size: 13px; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.help-btn:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

.preset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 8px; margin-bottom: 8px;
}
.preset-card {
  position: relative; display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border: 1px solid var(--c-line-strong);
  border-radius: var(--radius-md); background: var(--surface);   /* карточка выбора — канон md (8px) */
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
/* брутальный hover — сдвиг + жёсткая золотая тень (мини-версия канона service-card) */
.preset-card:hover {
  border-color: var(--c-gold-line);
  background: var(--accent-bg);
  transform: translate(-2px,-2px);
  box-shadow: 4px 4px 0 rgba(201,163,50,.22), 0 0 18px rgba(153,128,24,.10);
}
:root[data-theme="dark"] .preset-card:hover {
  box-shadow: 4px 4px 0 rgba(235,197,84,.28), 0 0 22px rgba(235,197,84,.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .preset-card:hover {
    box-shadow: 4px 4px 0 rgba(235,197,84,.28), 0 0 22px rgba(235,197,84,.14);
  }
}
.preset-card.is-active {
  border-color: var(--accent); background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.preset-card input[type=radio] {
  position: absolute; opacity: 0; pointer-events: none;
}
.preset-icon { color: var(--label2); display: flex; align-items: center; }
.preset-icon svg { width: 22px; height: 22px; }
.preset-card.is-active .preset-icon { color: var(--accent); }
.preset-body { flex: 1; min-width: 0; }
.preset-name {
  display: flex; align-items: flex-start; gap: 5px;
  font-size: 14px; font-weight: 600; color: var(--label); margin-bottom: 2px;
}
.preset-name-text { flex: 0 1 auto; min-width: 0; line-height: 1.3; }
.preset-short { font-size: 12px; color: var(--label3); line-height: 1.35; }
.preset-skeleton, .preset-error {
  grid-column: 1 / -1; text-align: center; color: var(--label3);
  padding: 16px; font-size: 13px;
}
.preset-error { color: var(--red); }

/* Кнопка предпросмотра состава пресета + поповер «Что внутри» */
.preset-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; margin-top: 1px;
  width: 18px; height: 18px; padding: 0;
  border: none; background: transparent; color: var(--label3);
  border-radius: 50%; cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.preset-info-btn svg { width: 14px; height: 14px; display: block; }
.preset-info-btn:hover,
.preset-info-btn:focus-visible,
.preset-info-btn[aria-expanded="true"] {
  color: var(--accent); background: var(--accent-bg); outline: none;
}
.preset-card.is-active .preset-info-btn { color: var(--accent); }

.preset-popover {
  position: fixed; z-index: 1000; max-width: 300px; width: max-content;
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius-md); box-shadow: var(--elev-2);
  padding: 12px 14px; font-size: 13px; color: var(--label2); line-height: 1.5;
  animation: pp-in 0.12s ease;
}
@keyframes pp-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
.pp-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.pp-ic { display: inline-flex; color: var(--accent); }
.pp-ic svg { width: 16px; height: 16px; display: block; }
.pp-title { font-size: 14px; font-weight: 700; color: var(--label); }
.pp-hint { color: var(--label2); margin-bottom: 10px; }
.pp-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--label3); margin-bottom: 6px;
}
.pp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pp-chip {
  display: inline-block; padding: 3px 9px; font-size: 12px; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  border-radius: 999px; white-space: nowrap;
}
.pp-free { color: var(--label2); }

.preset-help, .custom-prompt-help {
  margin-top: 6px; font-size: 13px; color: var(--label3);
}
.preset-help summary, .custom-prompt-help summary {
  cursor: pointer; color: var(--blue); padding: 6px 0; font-size: 13px;
  list-style: none; display: inline-block;
}
.preset-help summary::-webkit-details-marker,
.custom-prompt-help summary::-webkit-details-marker { display: none; }
.preset-help summary::before, .custom-prompt-help summary::before {
  content: "▸ "; transition: transform 0.15s ease;
}
.preset-help[open] summary::before, .custom-prompt-help[open] summary::before { content: "▾ "; }

.preset-help-body { padding: 8px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.preset-help-item {
  padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm);
}
.preset-help-title { font-size: 13px; font-weight: 600; color: var(--label); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px; }
.ph-ic { display: inline-flex; color: var(--label2); }
.preset-help-hint { font-size: 12.5px; color: var(--label2); line-height: 1.5; margin-bottom: 4px; }
.preset-help-sections {
  font-size: 12px; color: var(--label3); margin-top: 4px; font-family: monospace;
}

/* ── Custom prompt ────────────────────────────────────────────────────────── */
.custom-prompt-wrap {
  margin-top: 12px; padding: 14px; border: 1.5px dashed var(--separator);
  border-radius: var(--radius-sm); background: var(--bg);
}
.custom-prompt-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.custom-prompt-header label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; color: var(--label2);
  text-transform: uppercase; letter-spacing: .08em;
}
#customPrompt {
  width: 100%; padding: 12px; border: 1px solid var(--separator);
  border-radius: var(--radius-sm); font-family: var(--font-sans);
  font-size: 14px; line-height: 1.5; resize: vertical; background: var(--surface);
  color: var(--label);
}
#customPrompt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(153, 128, 24, 0.18); }
.custom-prompt-meta {
  font-size: 12px; color: var(--label3); text-align: right; margin-top: 4px;
}
.custom-prompt-meta.over-limit { color: var(--red); }
.custom-prompt-help-body { padding: 8px 0; font-size: 13px; color: var(--label2); }
.custom-prompt-template {
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius-sm); padding: 10px; font-size: 12px;
  white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto;
  font-family: var(--font-mono); line-height: 1.5; margin: 6px 0 12px;
}
.custom-prompt-tips { padding-left: 18px; line-height: 1.6; }
.custom-prompt-tips li { margin-bottom: 4px; }

.btn-secondary {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--separator);
  background: var(--surface); color: var(--label2); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-text {
  background: none; border: none; color: var(--label3); font-size: 12.5px;
  cursor: pointer; padding: 8px 6px; font-weight: 500;
}
.btn-text:hover { color: var(--red); }

/* ── Мои (сохранённые) промты ──────────────────────────────────────────────── */
.preset-card--user { border-style: dashed; }
.preset-card--user .preset-name { color: var(--accent); }
.preset-card--user .preset-icon { color: var(--accent); }
.pc-act svg { display: block; }
.preset-card-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 2px;
  opacity: 0; transition: opacity 0.15s ease;
}
.preset-card--user:hover .preset-card-actions,
.preset-card--user.is-active .preset-card-actions { opacity: 1; }
.pc-act {
  border: none; background: var(--surface); color: var(--label3);
  border-radius: var(--radius-sm); width: 24px; height: 24px; line-height: 1;
  font-size: 12px; cursor: pointer; padding: 0;
}
.pc-act:hover { background: var(--accent-bg); color: var(--accent); }

.save-prompt-box {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--separator);
}
.save-prompt-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.save-prompt-name {
  flex: 1 1 200px; min-width: 0; padding: 9px 12px;
  border: 1px solid var(--separator); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--label);
  font-family: inherit;
}
.save-prompt-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(153, 128, 24, 0.18); }
.save-prompt-type {
  padding: 9px 10px; border: 1px solid var(--separator); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--label2); font-family: inherit; cursor: pointer;
}
.save-prompt-type:focus { outline: none; border-color: var(--accent); }
.save-prompt-hint { margin-top: 8px; font-size: 12px; color: var(--label3); line-height: 1.5; }
@media (max-width: 520px) {
  .save-prompt-name, .save-prompt-type, .save-prompt-row .btn-secondary { flex: 1 1 100%; }
}

/* Узкий экран: капс-CTA ужимается, чтобы влезать в 358-390 без переноса/обрезки */
@media (max-width: 430px) {
  .btn-primary { font-size: 11.5px; letter-spacing: .06em; padding: 14px 8px; }
}
