:root {
  --bg: #12141a;
  --panel: #1b1e26;
  --panel-2: #232733;
  --line: #2e3342;
  --text: #f2f4f8;
  --muted: #9aa2b4;
  --accent: #ffb300;
  --accent-2: #4dd0a0;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app { height: 100%; }

.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

input, select, textarea, button {
  font: inherit;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--accent); }

select { appearance: none; background-image: none; }

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--panel-2);
  cursor: pointer;
}

button.primary { background: var(--accent); color: #241a00; font-weight: 700; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row.tight > * { flex: 0 0 auto; }
.grow { flex: 1; }
.mt { margin-top: 18px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* Комната */
.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.head .title { font-size: 18px; font-weight: 700; }
.head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chip {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.chip.on { color: var(--accent-2); border-color: #2f6b57; }

.tape {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.msg.mine { background: #1d2530; border-color: #2b3a4b; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; }
.msg .main { font-size: 20px; }
.msg .orig { font-size: 13px; color: var(--muted); margin-top: 6px; }
.msg .tools { margin-top: 8px; }
.msg .tools button { padding: 6px 12px; font-size: 13px; background: transparent; border: 1px solid var(--line); color: var(--muted); }

.composer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.talk {
  width: 100%;
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  background: var(--accent);
  color: #241a00;
}
.talk.recording { background: var(--danger); color: #fff; }

.status { font-size: 13px; color: var(--muted); min-height: 18px; }
.status.bad { color: var(--danger); }

.invite code {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
  word-break: break-all;
}
