/* Голосовое интервью с Верой. Стиль экранов приложения «плоский тёмный» на палитре бренда:
   ореховый фон, панели на ступень светлее, без рамок и теней; главная кнопка — обращением (светлая с тёмной надписью),
   бежевый — только на данных (прогресс разговора). */

:root {
  --ground: #2b2216;
  --surface: #382d1e;
  --raised: #4a3c2c;
  --control: #6a5a46;
  --rule: #403322;
  --text: #e4e2da;
  --muted: #b3aa9b;
  --primary: #e4e2da;
  --primary-ink: #1c150d;
  --accent: #bda38b;
  --positive: #5cb685;
  --attention: #d9a441;
  --negative: #e86b55;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Oswald", "Arial Narrow", sans-serif;
  --radius-card: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Шапка: знак продукта, прогресс разговора, звук */
.top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}
.top-home {
  color: var(--text);
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.top-progress { flex: 1; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
#progress { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.4s ease; }
.tool {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms ease, transform 140ms var(--ease-out);
}
.tool:active { transform: scale(0.94); }
@media (hover: hover) { .tool:hover { background: var(--raised); } }

/* Разговор */
.chat { flex: 1; overflow-y: auto; padding: 24px 16px 8px; }
.chat > .msg { max-width: 720px; margin-left: auto; margin-right: auto; }
.msg { display: flex; gap: 12px; margin-bottom: 14px; animation: rise 0.25s ease-out; }
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--primary-ink);
  font-family: var(--font-brand);
  font-weight: 700;
}
.bubble { padding: 11px 15px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.vera .bubble { background: var(--surface); border-radius: 4px 18px 18px 18px; }
.msg.user { flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--raised); border-radius: 18px 4px 18px 18px; }
.msg.interim .bubble { color: var(--muted); font-style: italic; }
.understood { margin-top: 4px; font-size: 14px; color: var(--muted); }
.msg.card { padding-left: 48px; display: block; }

/* Сводки-примеры: фрагменты настоящего интерфейса */
.sum {
  max-width: 440px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 15px;
}
.sum-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sum .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--positive); }
.sum.attention .dot { background: var(--attention); }
.sum-meta { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.sum ul { margin: 0 0 10px; padding-left: 18px; }
.sum-sub { font-weight: 600; font-size: 14px; }
.sum p { margin: 4px 0; }

.review {
  max-width: 520px;
  margin: 0;
  padding: 6px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 15px;
}
.review-row {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.review-row:last-child { border-bottom: 0; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }
.link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link:disabled { visibility: hidden; }

/* Панель ответа */
.dock { flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); }
.dock-inner { max-width: 720px; margin: 0 auto; }
.status { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 10px; font-size: 15px; color: var(--muted); }
.status-icon { display: inline-flex; gap: 2px; align-items: center; height: 14px; }
.status-icon i { display: block; width: 3px; height: 6px; border-radius: 2px; background: var(--muted); }
[data-mode="speaking"] .status-icon i { background: var(--accent); animation: bars 0.9s ease-in-out infinite; }
[data-mode="speaking"] .status-icon i:nth-child(2) { animation-delay: 0.15s; }
[data-mode="speaking"] .status-icon i:nth-child(3) { animation-delay: 0.3s; }
[data-mode="listening"] .status-icon i { width: 8px; height: 8px; border-radius: 50%; background: var(--negative); animation: blink 1s infinite; }
[data-mode="listening"] .status-icon i + i { display: none; }

.controls.busy { opacity: 0.55; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 22px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
@media (hover: hover) { .chip:hover { background: var(--control); } }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row:first-child { margin-top: 0; }
.input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--control);
  border-radius: 24px;
  background: var(--ground);
  color: var(--text);
  font: inherit;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 24px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 140ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: var(--raised); color: var(--text); }
@media (hover: hover) {
  .btn.primary:hover { background: #ffffff; }
  .btn.ghost:hover { background: var(--control); }
}
.btn.wide { flex: 1; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 28px; }
.btn:disabled { background: var(--raised); color: var(--muted); cursor: not-allowed; }
.mic {
  flex: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-ink);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.mic:active { transform: scale(0.94); }
.mic.listening { background: var(--negative); color: #ffffff; animation: blink 1.2s infinite; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; margin-bottom: 4px; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); }
.trial { display: grid; gap: 10px; }
.error { margin: 8px 0 0; color: var(--negative); font-size: 15px; font-weight: 600; }
.finish { flex-wrap: wrap; }
.finish .btn { flex: 1 1 200px; }

/* Начало: что это и как отвечать */
.start {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--ground);
}
.start[hidden] { display: none; }
.start-card { width: 100%; max-width: 560px; }
.vera-hero {
  width: 64px;
  height: 64px;
  margin: 0 0 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--primary-ink);
  font-family: var(--font-brand);
  font-size: 30px;
  font-weight: 700;
}
.start h1 {
  margin: 0 0 16px;
  font-family: var(--font-brand);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}
.lead { margin: 0 0 20px; }
.points { list-style: none; padding: 20px; margin: 0 0 24px; display: grid; gap: 10px; font-size: 16px; border-radius: var(--radius-card); background: var(--surface); }
.points li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: baseline; }
.points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.note { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-card); background: var(--raised); font-size: 15px; }
.start-actions { display: grid; gap: 10px; }
.resume { margin-top: 10px; display: grid; }
.fine { margin-top: 20px; color: var(--muted); font-size: 14px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bars { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes blink { 50% { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
  .msg.card { padding-left: 0; }
  .review-row { grid-template-columns: 1fr auto; }
  .review dt { grid-column: 1 / -1; font-size: 14px; }
  .start h1 { font-size: 28px; }
}
