:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #6b6f7a;
  --border: #e3e4e8;
  --accent: #3b5bdb;
  --accent-text: #ffffff;
  --danger: #c92a2a;
  --notice: #fff9db;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1d21;
    --text: #e9eaee;
    --muted: #9a9ea8;
    --border: #2c2e33;
    --accent: #748ffc;
    --accent-text: #0b0c0e;
    --danger: #ff6b6b;
    --notice: #3a3420;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 16px; }
h1 { font-size: 1.8rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; overflow-wrap: anywhere; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.site-header nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.site-footer { padding: 16px 24px; color: var(--muted); font-size: .85rem; text-align: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.hero { text-align: center; padding: 48px 0; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; }

label { display: block; margin: 0 0 12px; font-weight: 500; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: baseline; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
input[type=checkbox] { display: inline; width: auto; margin: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 12px; padding: 12px; }

button, .button {
  display: inline-block; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  color: var(--accent-text); background: var(--accent); border: 1px solid var(--accent); border-radius: 8px;
}
button.secondary, .button.secondary { color: var(--accent); background: transparent; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: inherit; }
button.link.danger { color: var(--danger); }
button[disabled] { opacity: .6; cursor: progress; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.muted { color: var(--muted); font-weight: 400; }
.error { color: var(--danger); margin: -6px 0 12px; font-size: .9rem; }
.flash, .notice { background: var(--notice); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.danger-zone { border-color: var(--danger); }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.people li:last-child { border-bottom: 0; }
.people.card { padding-top: 6px; padding-bottom: 6px; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { margin: 0; }
.pager { display: flex; justify-content: space-between; }
.stats { display: flex; gap: 32px; margin: 0; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; }

table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  td { border: 0; padding: 2px 0; }
}
app-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.qr-box { margin: 0 0 12px; }
.qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; border-radius: 8px; }
code.codes { display: block; white-space: pre; font-size: 1rem; line-height: 1.6; }

/* Pictures */
.avatar { border-radius: 50%; object-fit: cover; background: var(--border); vertical-align: middle; }
.avatar.large { width: 72px; height: 72px; }

/* The account menu: a <details>, so it works without JavaScript */
.site-header .user-menu { position: relative; }
.site-header .user-menu summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--muted);
}
.site-header .user-menu summary::-webkit-details-marker { display: none; }
.site-header .user-menu summary:hover, .site-header .user-menu[open] summary { background: var(--border); color: var(--text); }
.site-header .user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px;
  display: flex; flex-direction: column; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.site-header .user-menu .menu a, .site-header .user-menu .menu button.link {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; font: inherit;
}
.site-header .user-menu .menu a:hover, .site-header .user-menu .menu button.link:hover { background: var(--border); }
.site-header .user-menu .menu form { margin: 0; }
