@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --фон: #f4f3f0;
  --карточка: #ffffff;
  --текст: #22201d;
  --текст-приглушённый: #6b6660;
  --линия: #e8e5e0;
  --акцент: #8a5a3b;
  --акцент-тёмный: #6e4730;
  --акцент-мягкий: #f3e9e1;
  --успех: #3f7a5c;
  --успех-фон: #e9f4ee;
  --ошибка: #b3432f;
  --ошибка-фон: #fbeae6;
  --радиус: 14px;
  --тень: 0 1px 2px rgba(30, 25, 20, 0.04), 0 8px 24px rgba(30, 25, 20, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --фон: #171513;
    --карточка: #211e1b;
    --текст: #ede9e4;
    --текст-приглушённый: #a39c93;
    --линия: #37322c;
    --акцент: #d99a6c;
    --акцент-тёмный: #e8b48a;
    --акцент-мягкий: #362a20;
    --успех: #7cc4a0;
    --успех-фон: #1c2e24;
    --ошибка: #e08a76;
    --ошибка-фон: #33211c;
    --тень: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--фон);
  color: var(--текст);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.обёртка {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header.шапка {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 28px;
}

header.шапка .лого {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.лого-блок {
  display: flex;
  align-items: center;
  gap: 10px;
}

.аватар-кружок {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--акцент-мягкий);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 1.5px solid var(--линия);
  transition: border-color 0.15s;
}
.аватар-кружок:hover { border-color: var(--акцент); }
.аватар-кружок img { width: 100%; height: 100%; object-fit: cover; }
.аватар-кружок .аватар-плейсхолдер { color: var(--акцент-тёмный); font-size: 1.1rem; font-weight: 600; }
#аватар-input { display: none; }

nav.меню {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav.меню a {
  color: var(--текст-приглушённый);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

nav.меню a:hover { background: var(--акцент-мягкий); color: var(--акцент-тёмный); }
nav.меню a.активна { background: var(--акцент); color: #fff; }

.карточка {
  background: var(--карточка);
  border-radius: var(--радиус);
  box-shadow: var(--тень);
  padding: 28px;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.подзаголовок {
  color: var(--текст-приглушённый);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.вопрос-текст {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.55;
  margin: 4px 0 26px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--текст-приглушённый);
  margin-bottom: 6px;
  margin-top: 18px;
}
label:first-of-type { margin-top: 0; }

input[type=text], input[type=password], textarea, select {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--текст);
  background: var(--фон);
  border: 1.5px solid var(--линия);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}

input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
  border-color: var(--акцент);
}

textarea { resize: vertical; min-height: 80px; }

input[type=file] {
  width: 100%;
  font-size: 0.88rem;
  color: var(--текст-приглушённый);
}

button, .кнопка {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  background: var(--акцент);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button:hover { background: var(--акцент-тёмный); }
button:active { transform: scale(0.98); }
button.второстепенная { background: transparent; color: var(--текст-приглушённый); border: 1.5px solid var(--линия); }
button.второстепенная:hover { background: var(--акцент-мягкий); color: var(--акцент-тёмный); border-color: transparent; }

button.кнопка-записи {
  width: 100%;
  padding: 18px;
  font-size: 1.05rem;
  background: var(--акцент);
  position: relative;
}

button.кнопка-записи .точка {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
}

button.кнопка-записи.идёт {
  background: var(--ошибка);
  animation: пульс 1.6s ease-in-out infinite;
}

button.кнопка-записи.идёт .точка {
  animation: мигание 1s ease-in-out infinite;
}

@keyframes пульс {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 67, 47, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(179, 67, 47, 0); }
}

@keyframes мигание {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

audio { width: 100%; margin-top: 14px; border-radius: 10px; }

.статус-строка {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--текст-приглушённый);
  min-height: 1.3em;
}

.разделитель {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 4px;
  color: var(--текст-приглушённый);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.разделитель::before, .разделитель::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--линия);
}

.флэш {
  background: var(--акцент-мягкий);
  color: var(--акцент-тёмный);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.дропзона {
  border: 2px dashed var(--линия);
  border-radius: var(--радиус);
  padding: 32px 20px;
  text-align: center;
  color: var(--текст-приглушённый);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.дропзона.наведена { border-color: var(--акцент); background: var(--акцент-мягкий); }
.дропзона input { display: none; }

ul.список-файлов {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
ul.список-файлов li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--фон);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
}
ul.список-файлов button.убрать {
  background: none;
  color: var(--текст-приглушённый);
  padding: 2px 8px;
  font-size: 1rem;
  line-height: 1;
}
ul.список-файлов button.убрать:hover { color: var(--ошибка); background: none; }

table.таблица {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.таблица th {
  text-align: left;
  color: var(--текст-приглушённый);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--линия);
}
table.таблица td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--линия);
  vertical-align: top;
}
table.таблица tr:last-child td { border-bottom: none; }

.метка {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.метка.готово { background: var(--успех-фон); color: var(--успех); }
.метка.ошибка { background: var(--ошибка-фон); color: var(--ошибка); }
.метка.выполняется { background: var(--акцент-мягкий); color: var(--акцент-тёмный); }
.метка.открыт { background: var(--акцент-мягкий); color: var(--акцент-тёмный); }
.метка.отвечен { background: var(--успех-фон); color: var(--успех); }
.метка.нужно-сформулировать { background: var(--фон); color: var(--текст-приглушённый); border: 1px solid var(--линия); }

.пусто {
  text-align: center;
  color: var(--текст-приглушённый);
  padding: 36px 16px;
  font-size: 0.95rem;
}

.мелкий-текст { font-size: 0.85rem; color: var(--текст-приглушённый); }

.образ-текст { font-size: 0.95rem; line-height: 1.65; }
.образ-текст h1, .образ-текст h2, .образ-текст h3 {
  margin: 24px 0 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.образ-текст h1:first-child, .образ-текст h2:first-child, .образ-текст h3:first-child { margin-top: 0; }
.образ-текст h1 { font-size: 1.2rem; }
.образ-текст h2 { font-size: 1.08rem; }
.образ-текст h3 { font-size: 1rem; color: var(--текст-приглушённый); }
.образ-текст p { margin: 0 0 12px; }
.образ-текст ul, .образ-текст ol { margin: 0 0 12px; padding-left: 22px; }
.образ-текст li { margin-bottom: 4px; }
.образ-текст code {
  background: var(--фон);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}
.образ-текст blockquote {
  margin: 0 0 12px;
  padding: 4px 14px;
  border-left: 3px solid var(--линия);
  color: var(--текст-приглушённый);
}
.образ-текст table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.9rem; }
.образ-текст th, .образ-текст td { padding: 8px 10px; border-bottom: 1px solid var(--линия); text-align: left; }
.образ-текст hr { border: none; border-top: 1px solid var(--линия); margin: 22px 0; }

@media (max-width: 480px) {
  .карточка { padding: 20px; border-radius: 10px; }
  .обёртка { padding: 16px 14px 48px; }
}
