:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #5b6478;
  --line: #e2e7f0;
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --pink: #ff4f9a;
  --danger: #c62f3b;
  --code-bg: #f0f3f9;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

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

.hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.hero > div { flex: 1; min-width: 0; }
.hero-icon { flex: none; margin-top: 4px; }

h1 { margin: 0; font-size: 1.9rem; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 1.2rem; }
.lead { margin: 4px 0 0; color: var(--muted); }
.meta { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card.muted { background: #fbfcfe; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2 { margin: 0; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }

code {
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 12px;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

.endpoint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.endpoint > code { font-size: 1rem; background: none; padding: 0; font-weight: 600; }
.method { font-size: 0.75rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; color: var(--accent-ink); }
.method.get { background: var(--accent); }
.method.post { background: var(--pink); }
.scope { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.badge { font-size: 0.75rem; color: var(--ink); background: #fff1c2; border-radius: 999px; padding: 1px 8px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 6px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="password"], input:not([type]) {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
input:focus-visible, button:focus-visible { outline: 3px solid rgba(47, 107, 255, 0.35); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 14px 0; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 18px; height: 18px; }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  min-height: 44px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:hover { filter: brightness(1.06); }
button:disabled { opacity: 0.6; cursor: default; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid #f1c9cd; }

.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 0.85rem; }

.new-token { margin-top: 16px; border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; background: #f5f8ff; }
.new-token .row code { flex: 1; min-width: 0; padding: 8px; background: #fff; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.tokens { list-style: none; margin: 0; padding: 0; }
.tokens li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.tokens li:first-child { border-top: 0; }
.tokens li > div { display: flex; flex-direction: column; min-width: 0; }
.tokens li.revoked { opacity: 0.55; }
.tokens li.empty { color: var(--muted); }

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

@media (max-width: 560px) {
  .page { padding-top: 20px; }
  h1 { font-size: 1.5rem; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .tokens li { flex-direction: column; align-items: stretch; }
  .row { flex-direction: column; align-items: stretch; }
}
