:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --card: #fff;
  --field: #f5f5f7;
  --accent: #1d1d1f;
  --on-accent: #fff;
  --link: #0066cc;
  --ok: #e8f6ee;
  --danger: #fdecea;
  --tile: #1d1d1f;
  --on-tile: #fff;
  --hover: rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000;
    --ink: #f5f5f7;
    --muted: #98989d;
    --line: rgba(255, 255, 255, 0.12);
    --card: #1c1c1e;
    --field: #2c2c2e;
    --accent: #f5f5f7;
    --on-accent: #1d1d1f;
    --link: #2997ff;
    --ok: #14301f;
    --danger: #3a221e;
    --tile: #f5f5f7;
    --on-tile: #1d1d1f;
    --hover: rgba(255, 255, 255, 0.06);
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.47 system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  min-height: 48px;
  padding: 4px max(22px, env(safe-area-inset-right)) 4px max(22px, env(safe-area-inset-left));
  padding-top: max(4px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: inherit;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
}
nav { display: flex; flex-wrap: wrap; gap: 2px 18px; align-items: center; }
nav a, button.link {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
nav a:hover, button.link:hover { color: var(--ink); }
nav form { margin: 0; }
main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
h1 {
  font-size: clamp(34px, 6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 28px 6px 10px;
}
p.lead { color: var(--muted); margin: 4px 0 0; font-size: 17px; }
.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 8px;
}
.monogram {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  background: radial-gradient(circle at 30% 20%, #8faf9f, #1d4a38 58%, #10261d);
}
form.stack, .table-scroll, .secret {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
form.stack {
  display: grid;
  gap: 14px;
  width: min(100%, 28rem);
  margin-top: 12px;
  padding: 18px;
}
label { display: grid; gap: 6px; font-size: 13px; font-weight: 560; color: var(--muted); }
input, select {
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--field);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--link) 20%, transparent);
}
button.primary, a.button {
  font: inherit;
  font-weight: 500;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  width: fit-content;
  max-width: 100%;
  text-decoration: none;
  cursor: pointer;
}
form.stack button.primary { width: 100%; }
.resources {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.resources li + li { border-top: 1px solid var(--line); }
.resources form { margin: 0; }
.resources .row {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.resources .row:hover { background: var(--hover); }
.tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--tile);
  color: var(--on-tile);
  font-size: 15px;
  font-weight: 600;
}
.copy { min-width: 0; }
.resources .name { display: block; font-weight: 600; letter-spacing: -0.01em; }
.resources .role { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.chevron {
  width: 8px;
  height: 8px;
  margin-left: auto;
  flex: none;
  border-right: 1.6px solid #aeaeb2;
  border-top: 1.6px solid #aeaeb2;
  transform: rotate(45deg);
}
.flash { padding: 12px 14px; border-radius: 14px; margin: 0 0 16px; }
.flash.ok { background: var(--ok); }
.flash.danger { background: var(--danger); }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
table.data tr:last-child td { border-bottom: 0; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }
.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px;
}
.row { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 16px; font-weight: 400; }
.check input { width: auto; min-height: 0; }
.muted { color: var(--muted); }
.app { border-top: 1px solid var(--line); padding: 14px 0; }
.app select { margin-top: 8px; }
form:has(.app) {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 6px 16px 16px;
  width: 100%;
  max-width: none;
}
main a { color: var(--link); }
body.gate main {
  width: min(420px, 100%);
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding-top: 24px;
  padding-bottom: 48px;
}
body.gate h1, body.gate .lead, body.gate .muted, body.gate main > p { text-align: center; }
body.gate h1 { font-size: clamp(32px, 8vw, 40px); }
body.gate .lead { margin: 8px 0 18px; font-size: 15px; }
body.gate form.stack { width: 100%; }
@media (max-width: 640px) {
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: 8px 16px 12px; border-bottom: 1px solid var(--line); }
  table.data tr:last-child { border-bottom: 0; }
  table.data td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 34%) 1fr;
    gap: 8px;
    border: 0;
    padding: 6px 0;
  }
  table.data td::before { content: attr(data-label); color: var(--muted); }
}
@media (prefers-reduced-motion: no-preference) {
  .resources .row { transition: background 160ms ease; }
}
