/* LVTD — hand-written CSS, no build step. Light/dark via data-theme. */
:root {
  --bg: #ffffff;
  --bg-soft: #fafaf9;
  --fg: #1c1917;
  --fg-muted: #78716c;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --accent: #b7410e;
  --accent-fg: #ffffff;
  --accent-soft: #fdf1ea;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --radius: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0a09;
  --bg-soft: #141211;
  --fg: #f5f5f4;
  --fg-muted: #a8a29e;
  --border: #292524;
  --border-strong: #3f3a37;
  --accent: #e8794a;
  --accent-fg: #0c0a09;
  --accent-soft: #2a1a12;
  --card: #141211;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 13px; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--fg-muted); }
.small { font-size: 13px; }
.icon { width: 1em; height: 1em; vertical-align: -0.15em; flex: none; }

/* Admin accounts */
.admin-page .page-head { margin-bottom: 32px; }
.admin-description { margin: 12px 0 20px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.admin-table caption { text-align: left; padding: 14px 16px; font-weight: 600; }
.admin-table th, .admin-table td { padding: 12px 16px; border-top: 1px solid var(--border); }
.admin-table thead { background: var(--bg-soft); }
.admin-table tbody th { font-weight: 500; white-space: nowrap; }
.admin-table td { white-space: nowrap; }
.admin-pagination { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 20px; height: 20px; color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-actions form { display: contents; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; background: var(--card); color: var(--fg); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--bg-soft); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }

/* Homepage: one idea per screen, like posts in a feed */
.screen { min-height: calc(100svh - 57px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 72px 0; }
.screen + .screen { border-top: 1px solid var(--border); }
.screen-title, .hero h1 { font-size: clamp(40px, 8vw, 88px); font-weight: 650; line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.screen-title-soft { color: var(--fg-muted); }
.screen-sub { max-width: 560px; margin-top: 24px; font-size: 19px; line-height: 1.5; text-wrap: pretty; }

/* Hero */
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; background-position: center; -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%); }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 500; color: var(--fg-muted); border: 1px solid var(--border); background: var(--card); padding: 3px 10px; border-radius: 999px; margin-bottom: 18px; font-family: var(--mono); }
.hero .lede { font-size: 19px; margin-top: 24px; }
.lede { font-size: 17px; color: var(--fg-muted); max-width: 620px; margin: 16px auto 0; }
.lede strong { color: var(--fg); font-weight: 600; }
.cta { display: flex; gap: 10px; justify-content: center; margin-top: 28px; }

/* Generic pages & forms */
.page { padding: 56px 0 72px; }
.page h1 { font-size: 32px; font-weight: 600; }
.page .lede { margin-left: 0; }
.narrow { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.form input { font: inherit; font-size: 14px; font-weight: 400; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--card); color: var(--fg); width: 100%; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form .btn { align-self: flex-start; }
.alert { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-top: 20px; }
.switch { margin-top: 20px; }
.switch a { text-decoration: underline; text-underline-offset: 3px; }
.page > .btn { margin-top: 24px; }
.panel { margin-top: 28px; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--card); max-width: 560px; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14px; }
.panel dt { color: var(--fg-muted); }
.panel dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; }
.legal { max-width: 720px; }
.legal-updated { margin: 8px 0 32px; }

@media (max-width: 800px) {
  .screen { padding: 56px 0; }
  .screen-sub { font-size: 17px; }
  .cta { flex-direction: column; align-items: center; }
}

/* Blog */
.nav-link { font-size: 14px; font-weight: 500; }
.footer-inner nav { display: flex; gap: 20px; }
.blog { max-width: 720px; margin: 0 auto; }
.blog-heading { margin-bottom: 40px; }
.blog-heading h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.blog-heading .lede { max-width: none; line-height: 1.65; }
.blog-feed, .blog-read, .blog-back { display: inline-block; color: var(--accent); font-size: 14px; }
.blog-feed { margin-top: 20px; }
.blog-back { margin-bottom: 32px; }
.blog-entry { padding: 28px 0; border-top: 1px solid var(--border); }
.blog-entry h2 { font-size: 26px; line-height: 1.25; margin-bottom: 12px; }
.blog-entry > p { line-height: 1.7; }
.blog-meta { color: var(--fg-muted); font-size: 13px; margin-bottom: 14px; }
.blog-read { margin-top: 16px; }
.prose { font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 22px; }
.prose h2 { font-size: 26px; line-height: 1.3; margin-top: 44px; }
.prose h3 { font-size: 21px; line-height: 1.4; margin-top: 32px; }
.prose a, .blog-end a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 12px; }
.prose code { font-size: .85em; padding: 2px 5px; border-radius: 4px; background: var(--bg-soft); }
.prose pre { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); overflow-x: auto; line-height: 1.65; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--fg-muted); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { padding: 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.blog-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); margin-top: 48px; padding-top: 24px; font-size: 14px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 480px) {
  .header-inner { height: auto; min-height: 56px; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .header-actions { flex-wrap: wrap; gap: 8px; }
  .header-actions .btn { padding: 0 10px; }
  .blog { padding-top: 36px; }
  .footer-inner { flex-wrap: wrap; gap: 16px; }
}

/* Documentation */
.docs-layout { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 64px; align-items: start; }
.docs-nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 88px; max-height: calc(100dvh - 112px); overflow-y: auto; font-size: 14px; }
.docs-nav a { padding: 10px 12px; border-radius: 6px; color: var(--fg-muted); }
.docs-nav .docs-home { color: var(--fg); font-weight: 600; margin-bottom: 8px; }
.docs-nav a[aria-current="page"], .docs-nav a:hover { color: var(--accent); background: var(--bg-soft); }
.docs-content { min-width: 0; }
.docs-content .eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.docs-nav .docs-nav-heading { margin: 20px 12px 4px; color: var(--fg); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 760px) {
  .docs-layout { grid-template-columns: 1fr; gap: 28px; }
  .docs-nav { position: static; max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .docs-nav .docs-home, .docs-nav .docs-nav-heading { grid-column: 1 / -1; }
}

/* Account settings */
.settings { max-width: 640px; margin: 0 auto; }
.settings .panel { max-width: none; }
.settings .panel h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.settings .hint { font-size: 12px; font-weight: 400; color: var(--fg-muted); }
.settings .panel > p { line-height: 1.65; }
.settings-upgrade { margin-top: 20px; }
.settings-danger details { margin-top: 20px; }
.settings-danger summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.settings .admin-table-wrap { margin-top: 16px; }
.settings .admin-table form { margin: 0; }
.settings .admin-table .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.api-key-reveal { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.api-key-reveal pre { margin-top: 10px; user-select: all; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-key-reveal p + p { margin-top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Signed-in navigation */
.resource-nav { display: flex; align-items: center; gap: 10px; }
.primary-nav { display: flex; align-items: center; gap: 6px; }
.nav-item { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; font-size: 14px; font-weight: 500; border-radius: 7px; color: var(--fg-muted); }
.nav-item:hover { color: var(--fg); background: var(--bg-soft); text-decoration: none; }
.nav-item[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-account .header-inner { height: 64px; gap: 32px; }
.nav-account .header-actions { gap: 20px; }
.nav-account .resource-nav { gap: 20px; color: var(--fg-muted); }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; border-radius: 8px; padding: 4px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: var(--bg-soft); }
.account-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
img.account-avatar { object-fit: cover; }
.avatar-editor { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.avatar-preview { flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--bg-soft); }
.avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.avatar-forms { flex: 1 1 260px; }
.avatar-forms form + form { margin-top: 12px; }
.form input[type="file"] { padding: 7px 10px; cursor: pointer; }
.account-chevron { width: 14px; height: 14px; color: var(--fg-muted); }
.account-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: min(260px, calc(100vw - 40px)); padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.09); }
.account-identity { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 14px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.account-identity span { font-size: 11px; color: var(--fg-muted); }
.account-identity strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 9px 12px; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.account-dropdown a:hover, .account-dropdown button:hover, .account-dropdown a[aria-current="page"] { background: var(--bg-soft); text-decoration: none; }
@media (max-width: 640px) {
  .nav-account .header-inner { flex-wrap: wrap; height: auto; min-height: 64px; gap: 12px 16px; padding-top: 12px; padding-bottom: 12px; }
  .nav-account .primary-nav { order: 3; width: 100%; border-top: 1px solid var(--border); padding-top: 8px; }
  .nav-account .header-actions { gap: 10px; flex-wrap: nowrap; }
  .nav-account .resource-nav { gap: 12px; }
}

/* Appearance settings */
.theme-choices { display: flex; gap: 3px; padding: 3px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; }
.theme-choices button { display: flex; align-items: center; justify-content: center; flex: 1; gap: 5px; padding: 7px 8px; width: auto; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 11px; cursor: pointer; }
.theme-choices .icon { display: block; width: 14px; height: 14px; }
.theme-choices button:hover { color: var(--fg); }
.theme-choices button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.theme-choices button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.appearance-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.appearance-panel .theme-choices { flex: none; }
@media (max-width: 640px) {
  .appearance-panel { align-items: flex-start; flex-direction: column; gap: 16px; }
  .appearance-panel .theme-choices { width: 100%; }
}


.btn-danger { color: #b91c1c; border-color: #b91c1c; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.auth-head a { color: var(--accent); font-weight: 500; }
.verification button:disabled { opacity: .55; cursor: not-allowed; }
.verification #code { text-transform: uppercase; letter-spacing: .18em; font-size: 22px; }

/* Passkeys */
.passkey-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); }
.passkey-list li p { margin: 2px 0 0; }
.passkey-list form { flex: none; }
.two-factor .qr { width: 208px; height: 208px; margin: 16px 0; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.two-factor .qr svg { display: block; width: 100%; height: 100%; }
.two-factor details { margin-top: 8px; }
.two-factor summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.two-factor .manual-key { margin-top: 10px; letter-spacing: .08em; user-select: all; overflow-wrap: anywhere; }
.two-factor #code { letter-spacing: .18em; font-size: 22px; }
.recovery-codes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.recovery-codes code { font-size: 15px; letter-spacing: .05em; user-select: all; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }

/* Google's pre-approved button asset preserves its branding and typography. */

/* Sign in and sign up: one card, email first, other methods below a divider */
.auth-page { max-width: 420px; margin: 0 auto; padding-top: 64px; }
.auth-card { padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 16px 40px -20px rgba(0,0,0,.18); }
:root[data-theme="dark"] .auth-card { box-shadow: none; }
.auth-head { text-align: center; }
.auth-page .auth-head h1 { font-size: 26px; }
.auth-head p { margin-top: 8px; font-size: 14px; }
.auth-form { margin-top: 24px; }
.btn-block { width: 100%; height: 40px; justify-content: center; }
.oauth-access { margin-top: 20px; padding-left: 20px; font-size: 14px; color: var(--muted); }
.oauth-access li + li { margin-top: 6px; }
.oauth-consent .auth-form .btn + .btn { margin-top: 8px; }
.form .btn-block { align-self: stretch; margin-top: 4px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--fg-muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-alt { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.auth-alt[hidden] { display: none; }
.auth-alt + .auth-alt { margin-top: 10px; }
.auth-alt .hint { text-align: center; }
.auth-alt .hint:empty { display: none; }
.auth-alt .btn { gap: 10px; }
.google-logo, .github-logo { width: 18px; height: 18px; flex: none; }
.auth-switch { margin-top: 20px; text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 500; }
@media (max-width: 480px) {
  .auth-page { padding-top: 32px; }
  .auth-card { padding: 24px 20px; }
}

/* Account settings: grouped panels with a table of contents */
.settings-page { max-width: 1000px; }
.settings-header .lede { margin-top: 10px; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 36px; }
.settings-toc { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; font-size: 14px; }
.settings-toc-title { margin-bottom: 6px; padding: 0 10px; color: var(--fg-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.settings-toc ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.settings-toc a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--fg-muted); }
.settings-toc a:hover { background: var(--bg-soft); color: var(--fg); text-decoration: none; }
.settings-toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-sections { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.settings-group-title { padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 18px; font-weight: 600; }
.settings-page .settings-group .panel { margin-top: 16px; scroll-margin-top: 88px; }
.panel-head { margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; font-weight: 600; }
.panel-head p { margin-top: 4px; line-height: 1.5; }
.panel-head + .form { margin-top: 0; }
.appearance-panel .panel-head { margin-bottom: 0; }
.settings-page .panel:target { border-color: var(--accent); }
.settings-page .settings-danger { border-color: color-mix(in srgb, #b91c1c 35%, var(--border)); }
.settings-group:last-child .settings-group-title { color: #b91c1c; }
:root[data-theme="dark"] .settings-group:last-child .settings-group-title { color: #f87171; }
@media (max-width: 800px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 24px; }
  .settings-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings-toc-group { display: contents; }
  .settings-toc-title { display: none; }
  .settings-toc ul { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings-toc a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
}
