* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wrap {
  width: 100%;
  max-width: 480px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}
h1 { font-size: 1.4rem; margin: 0; }
p.hint { color: #94a3b8; font-size: 0.9rem; margin: 0; }
button {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: #334155; }
input[type=text] {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
}
a { color: #60a5fa; word-break: break-all; }
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr { text-align: center; }
.qr img { max-width: 260px; border-radius: 8px; background: white; padding: 8px; }
.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 2px;
}
.msg {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.3;
}
.msg.mine { align-self: flex-end; background: #3b82f6; color: white; }
.msg.theirs { align-self: flex-start; background: #334155; }
.composer { display: flex; gap: 8px; }
.composer input { flex: 1; }
.status { font-size: 0.8rem; color: #94a3b8; text-align: center; }
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.modal-overlay.visible { display: flex; }
.modal-card {
  background: #1e293b;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.modal-card h2 { margin: 0; font-size: 1.15rem; }
.modal-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }
.modal-actions button { flex: 1; }
input[type=email], input[type=tel], input[type=password] {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
}
.hp { position: absolute; left: -9999px; }
.error { color: #f87171; font-size: 0.9rem; margin: 0; min-height: 0; }
.error:empty { display: none; }
form.card { display: flex; }
.admin-wrap { max-width: 720px; }
.admin-bar { display: flex; gap: 8px; }
.admin-bar input { flex: 1; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item { flex-direction: row; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.admin-item.is-disabled { opacity: 0.55; }
.admin-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.admin-actions { display: flex; gap: 8px; align-items: center; }
.admin-actions button { padding: 8px 12px; font-size: 0.9rem; }
button.danger { background: #b91c1c; }
h2 { font-size: 1.1rem; margin: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
a.plain { color: inherit; text-decoration: none; }
.lead { font-size: 1.5rem; font-weight: 600; margin: 8px 0 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: #cbd5e1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; }
button.small { padding: 6px 12px; font-size: 0.85rem; }
a.button { display: block; text-align: center; background: #3b82f6; color: white; text-decoration: none; border-radius: 8px; padding: 12px 16px; }
a.button.secondary { background: #334155; }
.sticker-item { text-align: left; color: inherit; width: 100%; gap: 4px; }
.sticker-item.is-disabled { opacity: 0.6; }
.thread-head { display: flex; align-items: center; gap: 12px; }
.thread-actions { display: flex; gap: 8px; }
#threadView { display: flex; flex-direction: column; gap: 12px; flex: 1; }
#threadView .messages { min-height: 40vh; }
