:root {
  --purple: #4a2470;
  --purple-dark: #3a1c58;
  --navy: #1e3f73;
  --ink: #3c3c43;
  --heading: #4a2470;
  --muted: #70707a;
  --line: #e2e2e7;
  --field: #f5f5f7;
  --page: #f1f2f4;
  --ok: #2f6b4f;
  --warn: #8a4b2a;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Roboto, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  padding: 36px 16px 64px;
}

.shell {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.12), 0 6px 20px rgba(20, 20, 30, 0.06);
  overflow: hidden;
}

.shell.narrow { max-width: 680px; }

.logo {
  text-align: center;
  padding: 22px 24px 20px;
}

.logo img {
  height: 44px;
  width: auto;
  display: inline-block;
}

.logo .fallback {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--purple);
  font-style: italic;
}

.rule {
  height: 9px;
  background: var(--navy);
}

.head {
  padding: 26px 34px 0;
}

h1 {
  margin: 0 0 22px;
  font-size: 23px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--heading);
}

h1 .word { font-style: italic; }

.body {
  border-top: 1px solid var(--line);
  padding: 28px 34px;
}

.body p { margin: 0 0 16px; }
.body p:last-child { margin-bottom: 0; }

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 34px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.foot .counter {
  font-size: 15px;
  color: var(--muted);
  margin-right: auto;
}

label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

label .count { float: right; font-weight: 400; color: var(--muted); }

.sublabel {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin: -4px 0 10px;
}

.posting {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 18px;
}

.posting strong { color: var(--ink); }

.tally-sent { font-size: 13px; color: var(--muted); margin-top: 10px; }

input[type=text], input[type=password], textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 14px;
  resize: none;
}

input[type=text]:focus, input[type=password]:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(74, 36, 112, 0.14);
}

textarea { min-height: 150px; line-height: 1.55; }

.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--purple);
  border: 0;
  border-radius: 6px;
  padding: 15px 30px;
  cursor: pointer;
}

.btn:hover { background: var(--purple-dark); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.btn.quiet {
  background: #fff;
  color: var(--purple);
  border: 1px solid var(--purple);
  font-size: 14px;
  padding: 9px 16px;
}

.btn.quiet:hover { background: #f6f3fa; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--purple);
  text-decoration: underline;
  cursor: pointer;
}

.note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.note.ok { color: var(--ok); font-weight: 700; }
.note.bad { color: var(--warn); font-weight: 700; }

.banner {
  background: #fdf6ee;
  border: 1px solid #ead8c3;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--warn);
  margin-bottom: 20px;
}

.joinbox {
  display: flex;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 26px;
}

.joinbox .qr {
  width: 148px;
  height: 148px;
  flex: none;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.joinbox .qr svg { display: block; width: 100%; height: 100%; }
.joinbox .qr svg rect { shape-rendering: crispEdges; }

.qr-fail { font-size: 12px; color: var(--muted); line-height: 1.4; }
.joinbox h2 { margin: 0 0 4px; font-size: 17px; color: var(--heading); }
.joinbox .url {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  margin-top: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.q {
  border: 1px solid var(--line);
  border-left: 4px solid var(--purple);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fff;
}

.q.answered { border-left-color: var(--line); background: #fafafb; }

.q.pinned {
  border-left-width: 4px;
  border-left-color: var(--navy);
  background: #f7f9fc;
}

.q .flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 8px;
}

.q .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.btn.quiet.danger { color: #9a2f2f; border-color: #e0bcbc; }
.btn.quiet.danger:hover { background: #fdf3f3; border-color: #9a2f2f; }
.q.answered .text { color: var(--muted); }
.q .who { font-weight: 700; font-size: 16px; color: var(--ink); }
.q .when { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.q .text { margin: 8px 0 14px; font-size: 16px; line-height: 1.55; }

.strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.strip .grow { margin-right: auto; }
.strip h2 { margin: 0; font-size: 19px; color: var(--heading); }
.strip .tally { font-size: 15px; color: var(--muted); }

.section {
  margin: 26px 0 14px;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.new-in { animation: arrive 1.4s ease; }

@keyframes arrive {
  from { background: #f3edf9; }
  to { background: #fff; }
}

@media (max-width: 640px) {
  body { padding: 18px 12px 48px; }
  h1 { font-size: 20px; }
  .logo img { height: 38px; }
  .head, .body, .foot { padding-left: 20px; padding-right: 20px; }
  .joinbox { flex-direction: column; align-items: flex-start; }
  .foot { flex-direction: column-reverse; align-items: stretch; }
  .foot .btn { width: 100%; }
  .foot .counter { margin-right: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .new-in { animation: none; }
}
