
:root {
  color-scheme: light;
  --bg: #f4f5f8; --surface: #ffffff; --fg: #0f1115; --muted: #6b7180; --line: #e2e5eb;
  --accent: #2563eb; --accent-fg: #ffffff;
  --warn-bg: #fff4d6; --warn-fg: #5c4400; --danger: #c2272d;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
/* Light unless the person picks dark with the switch in the footer (theme.js keeps the choice). */
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #0e1013; --surface: #171a1f; --fg: #eceef2; --muted: #9aa1ad; --line: #2a2e36;
  --accent: #4c9dff; --accent-fg: #06121f;
  --warn-bg: #3a2f0b; --warn-fg: #ffe08a; --danger: #e5484d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
:root { --ring: color-mix(in srgb, var(--accent) 28%, transparent); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The frame: brand and support on top, the page, a quiet footer. */
.frame { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { width: 100%; max-width: 66rem; margin: 0 auto; padding: 28px 24px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 22%; }
main { width: 100%; max-width: 66rem; margin: 0 auto; padding: 0 24px; flex: 1; }
main.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding-top: 24px; padding-bottom: 14vh; }
main.page { max-width: 52rem; padding-top: 16px; padding-bottom: 48px; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; padding: 32px 16px 40px;
  color: var(--muted); font-size: 0.85rem; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--fg); }
.theme-switch { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  margin: -5px 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.theme-switch:hover { color: var(--fg); background: var(--line); }
.theme-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.theme-switch svg { width: 16px; height: 16px; }
.theme-switch .moon, :root[data-theme="dark"] .theme-switch .sun { display: none; }
:root[data-theme="dark"] .theme-switch .moon { display: block; }

h1 { font-size: 2rem; line-height: 1.15; font-weight: 750; letter-spacing: -0.025em; margin: 0 0 10px; }
main.center h1 { font-size: clamp(2rem, 6vw, 2.6rem); }
.lead, .facts { color: var(--muted); }
main.center .lead { font-size: 1.02rem; max-width: 34rem; margin: 0 0 40px; }
.fine { color: var(--muted); font-size: 0.88rem; margin-top: 24px; }
.fine a { color: inherit; }
main.center .fine { margin-top: 28px; }

/* Buttons and fields. */
.button { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 0.95rem;
  font-weight: 650; padding: 12px 26px; border-radius: 8px; border: 0; background: var(--accent);
  color: var(--accent-fg); text-decoration: none; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; }
.button:hover { filter: brightness(1.07); }
.button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.button.support { padding: 11px 22px; box-shadow: 0 0 0 4px var(--ring); }
.button.small { padding: 7px 14px; font-size: 0.88rem; }
.button.quiet { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: #fff; }
input { font: inherit; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); box-shadow: var(--shadow); min-width: 0; }
input::placeholder { color: var(--muted); opacity: 0.7; }
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }

/* One field and its button on a line, as on the sign-in page. */
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: 100%; max-width: 35rem; text-align: left;
  margin: 0; }
.inline-form label { grid-column: 1 / -1; font-size: 0.9rem; margin: 0 0 2px 10px; }
.code-input { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 8px; max-width: 24rem; margin: 16px 0; }

.eyebrow { color: var(--muted); font-size: 0.95rem; margin-bottom: 4px; }
.price { font-size: 1.35rem; font-weight: 650; min-height: 2rem; margin-bottom: 4px; }
.banner { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; border-radius: 10px;
  font-size: 0.92rem; margin: 0 auto 28px; max-width: 40rem; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; word-break: break-all; }

/* Signed in. */
.account-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }
.account-bar form { margin: 0; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin: 0 0 20px; background: var(--surface);
  box-shadow: var(--shadow); }
.card h2 { font-size: 1.2rem; margin: 0; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 18px; }
.key-row .key { padding: 6px 10px; }
.card-grid { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 24px; }
.card dl { margin: 0; }
.card dt { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
.card dd { margin: 2px 0 0; }
.card table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.card th, .card td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.card th { color: var(--muted); font-weight: 600; }
.card tr.inactive td { color: var(--muted); }
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .top { padding: 18px 16px; }
  main { padding: 0 16px; }
  .button.support { padding: 8px 14px; font-size: 0.85rem; }
  .inline-form { grid-template-columns: 1fr; }
  .foot { gap: 8px 20px; }
}

.admin main { max-width: 72rem; padding: 24px 16px 64px; }
.admin h1 { font-size: 1.4rem; }
.admin h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.admin form { display: flex; gap: 8px; margin: 12px 0 20px; }
.admin input[type=search] { flex: 1; font: inherit; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.admin table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin th, .admin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { color: var(--muted); font-weight: 600; }
.admin code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.admin .who { color: var(--muted); font-size: 0.9rem; }
.admin .table-wrap { overflow-x: auto; }
