:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7686;
  --line: #e3e6ea;
  --accent: #2f6f6a;
  --accent-ink: #ffffff;
  --staff-bubble: #eef3f3;
  --owner-bubble: #2f6f6a;
  --owner-ink: #ffffff;
  --danger: #b3402f;
  --code-bg: #eef3f3;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(20, 30, 45, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --card: #1a2028;
    --ink: #eaeef2;
    --muted: #9aa6b2;
    --line: #2a323c;
    --accent: #48a79c;
    --accent-ink: #08201e;
    --staff-bubble: #232c34;
    --owner-bubble: #48a79c;
    --owner-ink: #06201d;
    --danger: #e08574;
    --code-bg: #232c34;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
}

h1 {
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.lead {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 15.5px;
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 6px;
}

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
  resize: vertical;
}
textarea { min-height: 130px; }
textarea:focus, input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.note svg { flex: 0 0 auto; margin-top: 1px; }

.hr { height: 1px; background: var(--line); border: 0; margin: 24px 0; }

.small-link {
  background: none; border: 0; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0; text-decoration: underline;
}

.code-box {
  text-align: center;
  padding: 22px;
  background: var(--code-bg);
  border-radius: 14px;
  margin: 8px 0 4px;
}
.code-box .code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

.msg { max-width: 84%; padding: 11px 14px; border-radius: 14px; margin: 8px 0; white-space: pre-wrap; word-wrap: break-word; }
.msg.staff { background: var(--staff-bubble); border-bottom-left-radius: 4px; margin-right: auto; }
.msg.owner { background: var(--owner-bubble); color: var(--owner-ink); border-bottom-right-radius: 4px; margin-left: auto; }
.msg .time { display: block; font-size: 11px; opacity: 0.65; margin-top: 4px; }

.error { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 18px; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }
