:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #121821;
  --border: #263241;
  --text: #e6edf3;
  --muted: #9fb0c0;
  --accent: #7aa2f7;
  --danger: #f7768e;
  --warning-bg: #332b18;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

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

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page {
  width: min(960px, calc(100vw - 2rem));
  margin: 2rem auto;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.card.narrow {
  width: min(420px, 100%);
  margin: 4rem auto;
  text-align: center;
}

h1 {
  margin-top: 0;
}

p {
  color: var(--muted);
}

.flash {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.flash.alert {
  border-color: var(--danger);
}

.token-callout {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #b88a2a;
  border-radius: 10px;
  background: var(--warning-bg);
}

code {
  display: block;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg);
}

.token-form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.token-form > div {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

button,
input[type="submit"] {
  cursor: pointer;
}

.primary-button,
.danger-button,
.link-button {
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 8px;
  color: #061018;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
}

.danger-button {
  background: var(--danger);
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 400;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

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

@media (max-width: 640px) {
  .topbar,
  .token-form {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    align-items: start;
    flex-direction: column;
  }
}
