:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #141824;
  --muted: #5b6275;
  --border: #e2e5ee;
  --primary: #2f5bea;
  --primary-hover: #2449c4;
  --primary-soft: #e8eeff;
  --success: #0f8a5f;
  --success-soft: #e3f6ee;
  --warning: #9a6200;
  --warning-soft: #fff4dc;
  --danger: #c3322b;
  --danger-soft: #fdeceb;
  --code-bg: #0f1424;
  --code-text: #dbe2ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 36, .04), 0 8px 24px rgba(20, 24, 36, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e111a; --surface: #161a26; --surface-2: #1c2130; --text: #eef1f8; --muted: #9aa3b8; --border: #2a3042;
    --primary: #6d8cff; --primary-hover: #8aa2ff; --primary-soft: #1d2747;
    --success: #4cc79a; --success-soft: #12302a; --warning: #f0b44c; --warning-soft: #33280f; --danger: #ff7b73; --danger-soft: #3a1b1a;
    --code-bg: #0a0d16; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); position: relative; }
.brand-mark::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border: 2.5px solid #fff; border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; left: 16px; top: 16px; width: 6px; height: 2.5px; background: #fff; transform: rotate(45deg); border-radius: 2px; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a, .nav button { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav .who { color: var(--muted); font-size: 13px; padding: 0 8px; }

.dev-banner { background: var(--warning-soft); color: var(--warning); text-align: center; font-size: 13px; padding: 7px 16px; border-bottom: 1px solid var(--border); }

main.wrap { padding: 36px 16px 56px; min-height: 60vh; }
.footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; text-align: center; }

h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 0 0 6px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero { text-align: center; margin: 8px auto 30px; }
.hero .lead { margin-left: auto; margin-right: auto; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.stack > * + * { margin-top: 16px; }
.grid-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.plan .price { font-size: 34px; font-weight: 750; letter-spacing: -.02em; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan.custom { border-style: dashed; }
.plan.custom .price { font-size: 28px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 700; }
.plan .spacer { flex: 1; }

.email-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 0 auto; max-width: 560px; }
.email-row label { font-size: 14px; color: var(--muted); }

input[type="email"], input[type="url"], input[type="text"], textarea, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; min-width: 0; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.field { display: grid; gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 240px; }

.btn {
  font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 6px 10px; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger-ghost { background: transparent; color: var(--danger); padding: 6px 10px; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.big { padding: 14px 22px; font-size: 16px; width: 100%; }
.btn.block { width: 100%; }
button.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13px; border: 1px dashed var(--primary); color: var(--primary); background: var(--primary-soft);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip:hover { border-style: solid; }
.chip::before { content: "+"; font-weight: 700; }

.badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; display: inline-block; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }

.sub-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 8px 8px 14px; }
.site code { font-size: 14px; word-break: break-all; }
.site .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 8px; flex: none; }

.section { border-top: 1px solid var(--border); padding-top: 18px; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

pre.code {
  background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 14px 16px; margin: 0;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 5px 10px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 7px; cursor: pointer; }
.code-wrap .copy:hover { background: rgba(255,255,255,.22); }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.notice.info { background: var(--primary-soft); color: var(--primary); }

.center { max-width: 480px; margin: 0 auto; }
.center-wide { max-width: 620px; margin: 0 auto; }
.big-origin { font: 600 18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; background: var(--surface-2); padding: 14px; border-radius: 12px; text-align: center; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 20; }
.mock-card { display: grid; gap: 10px; }
.mock-card .fake { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--muted); font-family: ui-monospace, monospace; }

/* Grid/flex children must be allowed to shrink below their content (long code lines, long origins) — otherwise a
   single <pre> widens the whole card and the page scrolls sideways on phones. */
.two-col > *, .stack > *, .sub-head > * { min-width: 0; }
.chip { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.brand { white-space: nowrap; }
@media (max-width: 640px) {
  .nav { gap: 2px; }
  .nav a, .nav button { padding: 6px 8px; font-size: 13px; }
  .nav .who { display: none; }
  .card { padding: 18px; }
}
