:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d2330;
  --muted: #6b7280;
  --line: #dfe3ea;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

.page {
  max-width: 560px;
  margin: 32px auto;
  padding: 0 16px;
}

h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}

input:focus { outline: 2px solid rgba(47, 111, 237, 0.25); border-color: var(--accent); }

button {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  cursor: pointer;
}

button.secondary { background: #e8ebf1; color: var(--ink); }

.inline { display: inline; }
.link-button {
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 14px;
  text-decoration: underline;
}

.notice {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 14px;
}
.notice.error { background: #fdecea; color: var(--danger); }
.notice.ok { background: #e7f6ee; color: var(--ok); }

.muted { color: var(--muted); font-size: 14px; }

.identities { list-style: none; margin: 0; padding: 0; }
.identities li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.identities li:last-child { border-bottom: 0; }

.badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eef2fb;
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
}

.badge.warn { background: #fff4e5; color: #b54708; }

textarea { resize: vertical; font: inherit; }

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.table th { color: var(--muted); font-weight: 600; }

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
}

.danger-link { color: var(--danger); text-decoration: none; margin-left: 8px; }
.danger-link:hover { text-decoration: underline; }

.secret {
  display: block;
  padding: 10px 12px;
  background: #f3f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mail-body {
  margin: 0;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 14px/1.5 Consolas, "Courier New", monospace;
}

.balance {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.package-form { margin: 0; }
.package-form button { width: 100%; }
