/* Sally Speech — editorial minimal.
   Тёплая «бумага», крупный наборный заголовок, тонкие линейки вместо карточек.
   Акцент один — терракотовый; без градиентов и стекла. */

:root {
  --paper: #faf6f0;
  --ink: #201a15;
  --ink-soft: #6d6157;
  --line: #e4dbcf;
  --line-strong: #c9bcab;
  --accent: #c2571b;
  --accent-ink: #7a3608;
  --accent-soft: #f3e7da;
  --ok: #2f7d4f;
  --danger: #b3352a;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(194, 87, 27, 0.08), transparent 60%),
    var(--paper);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Шапка ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }
.mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px; font-weight: 700; font-style: italic;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.brand-rule { width: 34px; height: 1px; background: var(--line-strong); }
.brand-sub { font-size: 12.5px; color: var(--ink-soft); letter-spacing: 0.01em; }

.health { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.health.ok { color: var(--ok); }
.health.ok .dot { background: var(--ok); }

/* ---------- Каркас ---------- */
.wrap { max-width: 620px; margin: 0 auto; padding: 40px 18px 56px; }

.hero { margin: 0 0 30px; }
.hero-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 8vw, 62px);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.hero-sub { color: var(--ink-soft); font-size: 15px; max-width: 42ch; margin: 0; }

/* ---------- Секции ---------- */
.card {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.card.ghost { border-bottom: none; }

.label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin: 0 0 12px;
}

.res-title { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 600; margin: 0; }

/* ---------- Движки ---------- */
.engines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; }
.engine {
  background: var(--paper);
  border: none; padding: 12px 14px;
  color: var(--ink); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 1px;
  transition: background 0.12s;
}
.engine:hover { background: #fffdf9; }
.engine.active { background: var(--accent-soft); }
.e-name { font-weight: 650; font-size: 14px; }
.e-desc { font-size: 11.5px; color: var(--ink-soft); }
.engine.active .e-desc { color: var(--accent-ink); }

/* ---------- Табы ---------- */
.tabs { display: flex; gap: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab {
  border: none; background: transparent; padding: 8px 0 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.pane { display: none; }
.pane.active { display: block; }

/* ---------- Drop ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: 34px 16px; cursor: pointer;
  text-align: center; transition: border-color 0.12s, background 0.12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-weight: 600; font-size: 14.5px; }
.drop-sub { color: var(--ink-soft); font-size: 12.5px; }

.preview { width: 100%; margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- Запись ---------- */
.rec-row { display: flex; align-items: center; gap: 14px; }
.rec-btn {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); color: var(--ink);
  background: transparent;
  padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.rec-btn:hover { border-color: var(--accent); color: var(--accent); }
.rec-btn.live { border-color: var(--danger); color: var(--danger); }
.rec-btn.live #recIcon { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.rec-timer { font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; }
.rec-note { color: var(--ink-soft); font-size: 13px; margin-top: 10px; }

/* ---------- Кнопка ---------- */
.go {
  width: 100%; margin-top: 18px; padding: 13px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink); background: transparent; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.go:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.go:disabled { opacity: 0.3; cursor: not-allowed; }

.progress { height: 3px; border-radius: 2px; background: var(--line); margin-top: 12px; overflow: hidden; }
.progress .bar {
  height: 100%; width: 35%; border-radius: 2px; background: var(--accent);
  animation: slide 1.1s infinite ease-in-out;
}
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

.status { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.status.err { color: var(--danger); }

/* ---------- Результат ---------- */
.res-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.res-actions { display: flex; gap: 8px; }
.res-actions button, .linkbtn {
  background: transparent;
  border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 12.5px;
}
.res-actions button:hover, .linkbtn:hover { border-color: var(--accent); color: var(--accent); }
.res-actions button:disabled { opacity: 0.35; cursor: not-allowed; }

#result {
  width: 100%; min-height: 150px; resize: vertical;
  background: #fffdf9; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; font-size: 15px; line-height: 1.65; font-family: Georgia, "Times New Roman", serif;
}
#result:focus { outline: 1px solid var(--accent); outline-offset: 0; }
.meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }

/* ---------- История ---------- */
.history { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.history .empty { color: var(--ink-soft); font-size: 13px; }
.hist-item {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
  cursor: pointer; font-size: 13.5px; background: #fffdf9;
}
.hist-item:hover { border-color: var(--accent); }
.hist-item .h-top { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 11.5px; margin-bottom: 3px; }
.hist-item .h-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.foot { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 0 16px 40px; }

@media (max-width: 520px) {
  .engines { grid-template-columns: 1fr; }
  .wrap { padding-top: 28px; }
}