:root {
  --site-bg: #09090b;
  --site-fg: #ededef;
  --site-accent: #ece7dd;
  --site-on-accent: #0b0b0d;
  --site-surface: #101013;
  --site-muted: #8b8b94;
  --site-border: rgba(255, 255, 255, 0.08);
  --site-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --site-radius: 26px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -10%, #1c1c22 0%, transparent 60%),
    var(--site-bg);
  color: var(--site-fg);
  font: 15px/1.5 var(--site-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px * var(--site-space, 1)) calc(16px * var(--site-space, 1)) calc(36px * var(--site-space, 1));
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 {
  font-size: calc(22px * var(--site-type, 1));
}

h2 {
  font-size: calc(18px * var(--site-type, 1));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.card {
  width: min(430px, 100%);
  background: color-mix(in srgb, var(--site-surface) 90%, transparent);
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  padding: calc(34px * var(--site-space, 1)) calc(24px * var(--site-space, 1)) calc(26px * var(--site-space, 1));
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: rise calc(500ms * var(--site-motion, 1)) ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto calc(18px * var(--site-space, 1));
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 calc(36px * var(--site-type, 1))/1 Georgia, "Times New Roman", serif;
  color: var(--site-accent);
  background: radial-gradient(120% 120% at 30% 20%, #24242b, #101014 70%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.sub {
  margin: 8px 0 calc(24px * var(--site-space, 1));
  color: var(--site-muted);
  font-size: 14px;
}

form {
  margin: 0;
}

textarea,
input[type="password"] {
  width: 100%;
  background: var(--site-bg);
  border: 1px solid var(--site-border);
  border-radius: calc(var(--site-radius) * 0.6);
  padding: 14px 16px;
  color: var(--site-fg);
  font: inherit;
  transition: border-color calc(200ms * var(--site-motion, 1)) ease;
}

textarea {
  min-height: 128px;
  resize: none;
}

textarea::placeholder,
input::placeholder {
  color: var(--site-muted);
  opacity: 0.65;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: rgba(236, 231, 221, 0.35);
}

.counter {
  text-align: right;
  color: var(--site-muted);
  font-size: 11px;
  margin: 6px 4px 14px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  transition: transform calc(120ms * var(--site-motion, 1)) ease, opacity calc(200ms * var(--site-motion, 1)) ease, background calc(200ms * var(--site-motion, 1)) ease;
}

form button[type="submit"],
#login {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--site-accent);
  color: var(--site-on-accent);
  font-size: 15px;
}

form button[type="submit"]:hover,
#login:hover {
  filter: brightness(1.05);
}

button:active {
  transform: scale(0.985);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.ghost {
  background: transparent;
  color: var(--site-fg);
  border: 1px solid var(--site-border);
  border-radius: 12px;
  padding: 10px 16px;
}

.ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.small {
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.note {
  margin: 14px 0 0;
  color: var(--site-muted);
  font-size: 12px;
  opacity: 0.75;
}

.note.error {
  color: var(--danger);
  opacity: 1;
}

.done {
  padding: 10px 0 6px;
  animation: rise calc(400ms * var(--site-motion, 1)) ease both;
}

.check {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--site-on-accent);
  background: var(--site-accent);
}

.done-title {
  margin: 0 0 6px;
  font-size: calc(17px * var(--site-type, 1));
  font-weight: 600;
}

.done-text {
  margin: 0 0 22px;
  color: var(--site-muted);
  font-size: 14px;
}

footer {
  margin-top: 22px;
  color: var(--site-muted);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  opacity: 0.6;
}

/* admin */

.admin-body {
  justify-content: flex-start;
}

.admin {
  width: min(640px, 100%);
  padding-top: 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar .sub {
  margin: 4px 0 0;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gate {
  text-align: left;
  margin-top: 40px;
}

.gate h2,
.gate .sub {
  text-align: center;
}

.gate input {
  margin-bottom: 12px;
}

.status {
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}

.tg {
  border: 1px solid var(--site-border);
  border-radius: calc(var(--site-radius) * 0.7);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tg-info {
  min-width: 0;
}

.tg-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.tg-text {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--site-muted);
}

.tg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--danger);
  vertical-align: 1px;
}

.tg-dot.on {
  background: #4ade80;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  background: color-mix(in srgb, var(--site-surface) 90%, transparent);
  border: 1px solid var(--site-border);
  border-radius: calc(var(--site-radius) * 0.7);
  padding: 14px 16px;
  position: relative;
}

.msg.unread {
  border-color: rgba(236, 231, 221, 0.28);
}

.msg.unread::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--site-accent);
}

.msg time {
  display: block;
  color: var(--site-muted);
  font-size: 11.5px;
  margin-bottom: 6px;
  padding-right: 18px;
  opacity: 0.8;
}

.msg-text {
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
}

.msg-actions {
  display: flex;
  gap: 8px;
}

.msg-actions button {
  background: transparent;
  border: 1px solid var(--site-border);
  color: var(--site-muted);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

.msg-actions button:hover {
  color: var(--site-fg);
  border-color: rgba(255, 255, 255, 0.22);
}

.msg-actions .danger:hover {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.4);
}

.empty {
  text-align: center;
  color: var(--site-muted);
  padding: 60px 0;
}

.empty-mark {
  font-size: 28px;
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
