/* Nameek — стили по дизайн-прототипу Claude Design (1:1 палитра и компоненты).
   Фон #FAFAF9, акцент #4843E5, границы #ECEAE6/#DDDAD4, текст #1A1A1A. */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #FAFAF9;
  color: #1A1A1A;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

@keyframes nmk-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes nmk-spin { to { transform: rotate(360deg); } }

/* ---------- Шапка (сквозная) ---------- */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 32px; border-bottom: 1px solid #ECEAE6; background: #FAFAF9;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand-tag { font-size: 12px; color: #8A857D; max-width: 46vw; line-height: 1.3; }
.header-right { display: flex; align-items: center; gap: 16px; }
.counter { font-size: 13px; color: #8A857D; }
.lang-switch { display: flex; border: 1px solid #DDDAD4; border-radius: 8px; overflow: hidden; }
.lang-switch button {
  padding: 6px 12px; font-size: 12px; font-weight: 600; border: none; cursor: pointer;
  background: #FFFFFF; color: #6F6B64;
}
.lang-switch button.active { background: #4843E5; color: #FFFFFF; }

main { flex: 1; width: 100%; padding: 0 32px; }

/* ---------- Экран 1: Главная = Параметры ---------- */
.brief-wrap { max-width: 760px; margin: 0 auto; }
.hero { padding: 56px 0 36px; }
.hero h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.hero p { font-size: 16px; line-height: 1.5; color: #6F6B64; max-width: 520px; }

.tier1 { display: flex; flex-direction: column; gap: 32px; }
.field { display: flex; flex-direction: column; gap: 12px; }
.field-label { font-size: 15px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 9px 15px; font-size: 14px; font-weight: 500; cursor: pointer;
  border-radius: 8px; border: 1px solid #DDDAD4; background: #FFFFFF; color: #3A3733;
  transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: #4843E5; }
.chip.active { border-color: #4843E5; background: #4843E5; color: #FFFFFF; }
.chip.multi { border-radius: 999px; }
.chip.chip-with-example {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 8px 15px;
}
.chip-label { font-size: 14px; font-weight: 500; }
.chip-example { font-size: 11px; font-weight: 400; opacity: 0.65; }

.text-input, .textarea {
  animation: nmk-fade .18s ease;
  width: 100%; max-width: 520px; padding: 11px 14px; font-size: 14px;
  border: 1px solid #DDDAD4; border-radius: 8px; background: #FFFFFF; color: #1A1A1A;
  outline: none; font-family: inherit;
}
.textarea { line-height: 1.5; resize: vertical; }
.text-input:focus, .textarea:focus { border-color: #1A1A1A; }
.char-count { font-size: 12px; color: #A5A099; }
.char-count.warn { color: #4843E5; }

/* Tier 2 — свёрнутый блок */
.tier2-box { margin-top: 36px; border: 1px solid #ECEAE6; border-radius: 12px; background: #FFFFFF; overflow: hidden; }
.tier2-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 16px 20px; background: none; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #1A1A1A; text-align: left; font-family: inherit;
}
.tier2-title { display: flex; align-items: baseline; gap: 10px; }
.tier2-optional { font-size: 12px; font-weight: 400; color: #8A857D; }
.tier2-right { display: flex; align-items: center; gap: 10px; }
.tier2-filled { font-size: 12px; font-weight: 500; color: #6F6B64; background: #F2F1ED; border-radius: 999px; padding: 3px 10px; }
.chevron { display: inline-block; transition: transform .15s; font-size: 18px; color: #8A857D; }
.chevron.open { transform: rotate(90deg); }
.tier2-body {
  padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 24px;
  border-top: 1px solid #F2F1ED; animation: nmk-fade .18s ease;
}
.tier2-field { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.tier2-field .field-label { font-size: 14px; }

/* Запуск */
.generate-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 32px 0 64px; }
.btn-primary {
  padding: 12px 22px; font-size: 15px; font-weight: 600; border-radius: 9px;
  border: 1px solid #1A1A1A; background: #1A1A1A; color: #FFFFFF; cursor: pointer; font-family: inherit;
}
.btn-primary:disabled { border-color: #DDDAD4; background: #DDDAD4; color: #FFFFFF; cursor: not-allowed; }
.btn-secondary {
  padding: 12px 22px; font-size: 15px; font-weight: 600; border-radius: 9px;
  border: 1px solid #DDDAD4; background: #FFFFFF; color: #1A1A1A; cursor: pointer; font-family: inherit;
}
.btn-secondary:hover { border-color: #1A1A1A; }
.btn-ghost {
  padding: 12px 22px; font-size: 15px; font-weight: 500; border-radius: 9px;
  border: none; background: none; color: #6F6B64; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { color: #1A1A1A; }
.hint { font-size: 13px; color: #8A857D; }
.form-error { font-size: 13px; color: #4843E5; max-width: 520px; line-height: 1.5; }

/* ---------- Экран 2: Генерация ---------- */
.generating { max-width: 440px; margin: 0 auto; padding: 96px 0; }
.generating h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.generating .note { margin: 0 0 32px; font-size: 14px; color: #8A857D; }
.slow-notice { margin-top: 20px; font-size: 13px; color: #6F6B64; text-align: center; }
.stages { border: 1px solid #ECEAE6; border-radius: 12px; background: #FFFFFF; padding: 8px 0; }
.stage { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.stage-done {
  width: 18px; height: 18px; border-radius: 50%; background: #1A1A1A; color: #FFFFFF;
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none;
}
.stage-spin {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #DDDAD4;
  border-top-color: #1A1A1A; animation: nmk-spin .7s linear infinite; flex: none;
}
.stage-dot { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.stage-dot span { width: 6px; height: 6px; border-radius: 50%; background: #DDDAD4; }
.stage-label { font-size: 14px; color: #A5A099; }
.stage-label.stage-current { color: #1A1A1A; font-weight: 500; }
.stage-label.stage-completed { color: #6F6B64; }

/* ---------- Экран 3: Результаты ---------- */
.results { max-width: 1080px; margin: 0 auto; padding: 48px 0 64px; animation: nmk-fade .25s ease; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.results-head h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.brief-recap { font-size: 13px; color: #8A857D; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { border: 1px solid #ECEAE6; border-radius: 12px; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; }
.plate { display: flex; align-items: center; justify-content: center; padding: 34px 16px; }
.plate-name { font-size: 27px; line-height: 1; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.consensus { display: inline-flex; align-items: center; gap: 7px; background: #F2F1ED; border-radius: 999px; padding: 4px 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: #4843E5; }
.dot.off { background: #DDDAD4; }
.consensus-label { font-size: 12px; font-weight: 500; color: #4A463F; }
.rationale-toggle {
  align-self: flex-start; background: none; border: none; padding: 0; font-size: 13px;
  color: #6F6B64; cursor: pointer; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #CFCBC4;
}
.rationale { display: flex; flex-direction: column; gap: 10px; animation: nmk-fade .18s ease; }
.rationale-block { display: flex; flex-direction: column; gap: 3px; }
.rationale-role { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #8A857D; }
.rationale-text { font-size: 13px; line-height: 1.5; color: #3A3733; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.react-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  border-radius: 8px; border: 1px solid #DDDAD4; background: #FFFFFF; color: #3A3733; font-family: inherit;
  transition: border-color .12s, background .12s, color .12s;
}
.react-btn.liked { border-color: #4843E5; background: #4843E5; color: #FFFFFF; }
.react-btn.disliked { border-color: #8A857D; background: #F2F1ED; color: #6F6B64; }
.logo-dl { font-size: 12px; color: #6F6B64; text-decoration: none; margin-left: auto; align-self: center; }
.logo-dl:hover { color: #1A1A1A; }

.disclaimer {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid #ECEAE6;
  font-size: 13px; line-height: 1.5; color: #8A857D; max-width: 720px;
}

.notice {
  padding: 14px 16px; border-radius: 10px; background: #F2F1ED; border: 1px solid #ECEAE6;
  display: flex; flex-direction: column; gap: 8px; max-width: 720px;
}
.notice p { margin: 0; font-size: 14px; line-height: 1.5; color: #4A463F; }
.notice-list { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.6; color: #8A857D; }

.results-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.refine-box {
  margin-top: 16px; border: 1px solid #ECEAE6; border-radius: 12px; background: #FFFFFF;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  animation: nmk-fade .18s ease; max-width: 640px;
}
.refine-title { font-size: 14px; font-weight: 600; }

/* ---------- Экран 4: Сессия завершена ---------- */
.done { max-width: 520px; margin: 0 auto; padding: 112px 0; animation: nmk-fade .25s ease; }
.done h2 { margin: 0 0 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.done p { margin: 0 0 28px; font-size: 15px; line-height: 1.55; color: #6F6B64; }
.liked-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #8A857D; }
.liked-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 32px; }
.liked-pill { padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; }

/* ---------- Экран 5: Лимит ---------- */
.limit { max-width: 480px; margin: 0 auto; padding: 112px 0; animation: nmk-fade .25s ease; }
.limit-icon {
  width: 44px; height: 44px; border-radius: 12px; background: #F2F1ED;
  display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 20px;
}
.limit h2 { margin: 0 0 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.limit p { margin: 0 0 28px; font-size: 15px; line-height: 1.55; color: #6F6B64; }

/* ---------- Подвал (сквозной) ---------- */
footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 32px; border-top: 1px solid #ECEAE6;
}
.copyright { font-size: 13px; color: #A5A099; }
footer a { font-size: 13px; color: #6F6B64; }

@media (max-width: 640px) {
  header, main, footer { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 32px; }
}

/* --- Избранное (favorites) --- */
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: 1px solid #DDDAD4; border-radius: 8px;
  background: #FFFFFF; color: #6F6B64; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.fav-btn:hover { color: #B0623A; border-color: #B0623A; }
.fav-btn svg { display: block; color: #B0623A; }
.fav-count { font-size: 12px; font-weight: 600; }
.fav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40;
  animation: nmk-fade .2s ease;
}
.fav-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: var(--bg, #faf8f4); z-index: 41; padding: 24px;
  box-shadow: -8px 0 32px rgba(0,0,0,.18); overflow-y: auto;
  animation: fav-slide .25s ease;
}
@keyframes fav-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.fav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.fav-head h3 { margin: 0; font-size: 20px; }
.fav-close { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.fav-list { display: flex; flex-direction: column; gap: 14px; }
.fav-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fav-item .liked-pill { flex: 1; text-align: center; }
.fav-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* --- Описание алгоритма на hero --- */
.hero .how-it-works {
  font-size: 13px; line-height: 1.55; color: #8A857D;
  max-width: 640px; margin-top: 10px;
}


/* --- Режим «Исправить запрос» (дизайн из прототипа) --- */
.edit-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 24px; padding: 12px 18px;
  border: 1px solid #E4D6C8; border-radius: 10px; background: #FBF3EA;
  animation: nmk-fade .25s ease;
}
.edit-banner-text { font-size: 14px; color: #7A5A3C; }
.edit-banner-btn {
  padding: 9px 18px; font-size: 14px; font-weight: 600;
  border-radius: 8px; border: none; cursor: pointer;
  background: #B0623A; color: #FFFFFF;
}
.edit-banner-btn:disabled { background: #E3E0DA; color: #A5A099; cursor: default; }
