:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --ink: #17222b;
  --muted: #5a6a76;
  --rule: #d6dee4;
  --accent: #0e6b66;
  --accent-ink: #0a5450;
  --accent-soft: #dfefec;
  --warn: #9e3a2a;
  --warn-soft: #f7e5e0;
  --notice: #f5ead1;
  --notice-ink: #6a4706;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-inline: 20px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.9rem; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 0.6rem; }
p { margin: 0 0 0.9rem; max-width: 70ch; }
code { font-family: ui-monospace, Consolas, "SFMono-Regular", Menlo, monospace; font-size: 0.9em; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.error { color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 0.5rem 0.75rem; }

.site-header {
  max-width: 960px;
  margin: 0 auto;
  padding-block: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: 0.01em; }
.brand span { font-weight: 400; color: var(--muted); }
.session { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.92rem; }
.signed-in { color: var(--muted); }

.content { max-width: 960px; margin: 0 auto; padding-block: 28px 48px; }

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding-block: 18px 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.card.narrow { max-width: 520px; }

.stack { display: flex; flex-direction: column; gap: 0.6rem; max-width: 420px; }
label { font-weight: 600; font-size: 0.92rem; }
input[type="email"], input[type="text"], input:not([type]), select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

button, .button {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
button.primary, .button.primary { background: var(--accent); }
button.secondary, .button.secondary { background: var(--surface); color: var(--accent-ink); }
button.small, .button.small { padding: 0.4rem 0.8rem; font-size: 0.88rem; }
button.linklike {
  background: none;
  border: none;
  color: var(--accent-ink);
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(0.96); }

.notice {
  background: var(--notice);
  color: var(--notice-ink);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}
.notice p { margin: 0; max-width: none; }
.notice a { color: inherit; font-weight: 600; }

.entity { margin-bottom: 2rem; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.action { text-align: right; white-space: nowrap; }
table.admin { font-size: 0.88rem; }
table.admin td.details { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 0.78rem; word-break: break-all; max-width: 32ch; }
tr.revoked td { color: var(--muted); }
tr.pending td:first-child { border-left: 3px solid var(--warn); }

.consent-terms { list-style: none; padding-left: 0; max-width: 76ch; }
.consent-terms li { margin-bottom: 0.7rem; }
.entities { font-size: 1.02rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }

.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.25rem; font-size: 0.95rem; }
.subnav a[aria-current="page"] { font-weight: 700; color: var(--ink); text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 0.9rem 1rem; display: flex; flex-direction: column; }
.stat .n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 0.85rem; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.9rem; margin: 0.75rem 0 1rem; }
.filters label { display: block; }
.filters input, .filters select { width: auto; min-width: 12rem; }

@media (max-width: 600px) {
  .card { padding: 1.1rem 1.1rem; }
  th, td { padding: 0.55rem 0.6rem; }
}
