:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #1d1b18;
  --ink-2: #57524b;
  --muted: #8b857c;
  --line: #e3dfd8;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --danger: #b4412f;
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --panel: #1d1d1a;
    --ink: #ecebe6;
    --ink-2: #bcb8b0;
    --muted: #8c887f;
    --line: #2f2e2a;
    --accent: #7fb8a4;
    --accent-ink: #10201a;
    --danger: #e3826f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Sign-in, no access, sign out */
.auth {
  width: min(100%, 400px);
  margin: 0 auto;
  padding: calc(14vh + env(safe-area-inset-top)) 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.site { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.auth h1, .home h1 { margin: 0 0 4px; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.msg { margin: 0; color: var(--ink-2); }
.msg.err { color: var(--danger); font-weight: 500; }
#step-email, #code-form, #email-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 17px; /* 16px+ so iOS doesn't zoom in */
}
#code-form .field input { font-size: 26px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-quiet { background: transparent; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn:focus-visible, .link:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.or { display: flex; align-items: center; gap: 12px; margin: 2px 0; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.link { padding: 6px 0; border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.link.danger { color: var(--danger); }

/* Launcher */
.home { width: min(100%, 720px); margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 16px 48px; }
.home-head { margin-bottom: 22px; }
.who { margin: 0; color: var(--muted); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card-name { font-size: 19px; font-weight: 650; }
.card-desc { color: var(--ink-2); font-size: 15px; }
.card-host { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* People admin */
.admin .msg { margin-bottom: 16px; }
.people { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.person {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.person h2 { margin: 0; font-size: 18px; }
.person-head { display: flex; flex-direction: column; }
.person-name { font-weight: 650; }
.person-meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.sites { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; border: 0; }
.sites legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Privacy page */
.prose { max-width: 620px; }
.prose h2 { margin: 26px 0 6px; font-size: 19px; }
.prose p { margin: 0 0 10px; color: var(--ink-2); }
