@font-face {
  font-family: "Golos Text";
  src: url("/static/GolosText.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #f6f3ee;
  --paper: #ffffff;
  --ink: #23201c;
  --muted: #6f675d;
  --line: #e2dcd2;
  --accent: #7a2e2a;
  --accent-ink: #ffffff;
  --mine: #efe7db;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 "Golos Text", system-ui, sans-serif;
}
[hidden] { display: none !important; }

.login {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 0 16px;
}
.login h1 { font-size: 28px; margin: 0 0 4px; }
.login p { color: var(--muted); margin: 0 0 32px; }
.login label { display: block; font-weight: 600; margin-bottom: 6px; }
.login input {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  margin-bottom: 16px;
}
.login button { width: 100%; }
.err { color: #a3261f; margin-top: 12px; min-height: 1.5em; }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 820px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.msg { margin: 0 0 18px; max-width: 92%; }
.msg .who { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.msg .body {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.mama { margin-left: auto; }
.msg.mama .who { text-align: right; }
.msg.mama .body { background: var(--mine); border-color: var(--mine); }
.files { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.files a { color: var(--accent); font-weight: 600; }
.files audio { width: 100%; max-width: 360px; }
.empty { color: var(--muted); }
.mark { font-size: 13px; }
.live {
  color: var(--muted);
  font-size: 16px;
  padding: 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  opacity: .25;
  animation: dot 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }

footer {
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
}
textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  resize: vertical;
  min-height: 56px;
  max-height: 40vh;
}
.row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.row #send { margin-left: auto; }
#pending { font-size: 15px; color: var(--muted); margin-bottom: 8px; }

button, .btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  display: inline-block;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.rec { background: #a3261f; border-color: #a3261f; color: #fff; }
button:disabled { opacity: .5; cursor: default; }
button.link {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 4px;
  font-weight: 400;
  text-decoration: underline;
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .row .btn { flex: 1; text-align: center; }
  .row #send { flex-basis: 100%; margin-left: 0; }
}
