/* Matches www.agent37.com/qm: same tokens, sizes and spacing. */
:root {
  --page: #faf9f6;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #737373;
  --line: #e5e5e5;
  --primary: #171717;
  --primary-fg: #fafafa;
  --danger: #dc2626;
  --overlay: rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  :root { --page: #0a0a0a; --bg: #0a0a0a; --fg: #fafafa; --muted: #a3a3a3; --line: #262626; --primary: #fafafa; --primary-fg: #171717; --danger: #f87171; --overlay: rgba(0, 0, 0, .7); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--fg); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
[hidden] { display: none !important; }

/* Top bar */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 95%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nav-inner { max-width: 1152px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { display: block; }
.brand span { font-size: 16px; font-weight: 500; letter-spacing: -0.025em; }
.links { display: none; align-items: center; gap: 24px; }
.links a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); text-decoration: none; transition: color .15s; }
.links a:hover { color: var(--fg); }
.dash { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 8px; background: var(--primary); color: var(--primary-fg); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.dash:hover { opacity: .9; }
@media (min-width: 1024px) { .links { display: flex; } .nav-inner { height: auto; padding-top: 12px; padding-bottom: 12px; } }

/* Hero */
main { max-width: 576px; margin: 0 auto; padding: 96px 20px 64px; }
@media (min-width: 640px) { main { padding: 128px 24px 64px; } }
.hero { text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--muted); text-decoration: none; transition: color .15s; }
.badge:hover { color: var(--fg); }
.badge-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--primary); }
.badge-icon span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-fg); }
h1 { margin: 12px 0 0; font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.055em; }
.lede { margin: 16px auto 0; max-width: 448px; font-size: 16px; line-height: 24px; color: var(--muted); text-wrap: balance; }
@media (min-width: 640px) { h1 { font-size: 48px; line-height: 1; } .lede { font-size: 18px; line-height: 28px; } }

.app { margin-top: 32px; }
.center { display: flex; justify-content: center; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 14px; color: var(--muted); }
.waiting.left { justify-content: flex-start; }
.spinner { flex-shrink: 0; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons (shadcn sizes) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; background: var(--primary); color: var(--primary-fg); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: opacity .15s, background .15s; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lg { height: 40px; padding: 0 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
.btn.sm { height: 32px; padding: 0 12px; gap: 6px; border-radius: 8px; }
.btn.tall { height: 48px; }
.btn.outline { background: var(--bg); color: var(--fg); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn.outline:hover { opacity: 1; background: color-mix(in srgb, var(--fg) 5%, var(--bg)); }
.btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Card */
.card { max-width: 448px; margin: 0 auto; padding: 20px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 16px; background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
@media (min-width: 640px) { .card { padding: 24px; } }
.card > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.card-head .label { font-size: 14px; color: var(--muted); }
.account { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.account .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.linkbtn:hover { color: var(--fg); }
.box { padding: 16px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 10px; text-align: left; }
.box-title { margin: 0; font-size: 14px; font-weight: 500; }
.box-text { margin: 4px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.box .btn { margin-top: 12px; }
.done { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.done svg { width: 14px; height: 14px; }
.note { margin: 12px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 8px 0; text-align: center; }
.error { margin: 0; font-size: 14px; color: var(--danger); text-align: center; }
.text { margin: 0; font-size: 14px; }
.muted { margin: 0; font-size: 14px; color: var(--muted); }
label.field { display: block; font-size: 14px; font-weight: 500; }
input { display: block; width: 100%; height: 36px; margin-top: 8px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--fg); font: inherit; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
input:focus { outline: none; border-color: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 25%, transparent); }
input.code { text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--fg); }
code.token { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--fg) 6%, transparent); font-size: 12px; overflow-wrap: anywhere; }
.fine { max-width: 448px; margin: 32px auto 0; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.fine a:hover { color: var(--fg); }

/* Sign-in modal (same as the site AuthModal) */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); }
.dialog { width: 100%; max-width: 448px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.dialog h2 { margin: 0; font-size: 18px; line-height: 1; font-weight: 600; text-align: center; }
.dialog .sub { margin: 8px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.dialog form, .dialog .opts { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.dialog .terms { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.dialog .terms a:hover { color: var(--fg); }
.dialog .toggle { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.dialog .toggle button { padding: 0; border: 0; background: none; color: var(--fg); font-size: 14px; font-weight: 600; cursor: pointer; }
.dialog .toggle button:hover { text-decoration: underline; }
.dialog .back { align-self: center; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.dialog .back:hover { color: var(--fg); text-decoration: underline; }
.dialog .error { text-align: left; }
.stack .note { margin: 0; }

/* What you get */
.features { max-width: 448px; margin: 48px auto 0; }
.features h2 { margin: 0; font-size: 14px; font-weight: 600; text-align: center; }
.features ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.features li { font-size: 14px; line-height: 20px; color: var(--muted); }
.features li strong { color: var(--fg); font-weight: 500; }
.features-note { margin: 16px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.features-note a:hover { color: var(--fg); }

/* Dot characters (from the OpenDots repo, MIT) */
.dots { display: flex; justify-content: center; gap: 4px; margin: 0 auto 20px; }
.dots img { width: 72px; height: 72px; object-fit: contain; }
@media (min-width: 640px) { .dots { gap: 12px; } .dots img { width: 112px; height: 112px; } }

.places-left { color: var(--fg); font-weight: 500; }
