:root {
  --bg: #0b0b11;
  --bg-2: #15151d;
  --bg-3: #1d1d28;
  --line: #2a2a37;
  --text: #f3f3f6;
  --muted: #8b8b99;
  --excerpt: #c4c4cf;
  --red: #E5202E;
  --red-dark: #b81824;
  --link: #f0707c;
  --ok-bg: #11261d; --ok-bd: #1f4435; --ok-fg: #34d399;
  --err-bg: #2a1418; --err-bd: #5c2630; --err-fg: #f0707c;
  --hero-top: #16161f;
}
:root[data-theme="light"] {
  --bg: #f4f4f6;
  --bg-2: #ffffff;
  --bg-3: #f0f0f2;
  --line: #e2e2e6;
  --text: #16161d;
  --muted: #6b7280;
  --excerpt: #374151;
  --link: #b81824;
  --ok-bg: #e7f6ec; --ok-bd: #bfe3cd; --ok-fg: #1c6b3c;
  --err-bg: #fdeceb; --err-bd: #e9c2bf; --err-fg: #b81824;
  --hero-top: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.6 -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ---- app header ---- */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.b-red { color: var(--red); }
.spend-pill {
  margin-left: auto;
  padding: 6px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.spend-pill.over { color: var(--err-fg); border-color: var(--err-bd); }
nav { display: flex; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--text); }
nav a.nav-out { color: var(--muted); opacity: 0.7; }

main { max-width: 780px; margin: 30px auto; padding: 0 20px; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 28px 0 10px; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0;
}
.card.narrow { max-width: 360px; margin: 90px auto; }
.card.post.failed { border-color: var(--err-bd); }
summary { cursor: pointer; font-weight: 600; color: var(--text); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > div { flex: 0 0 auto; }
.row .grow { flex: 1 1 auto; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input, textarea, select {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--red);
}
input[type=datetime-local] { width: auto; }
textarea { resize: vertical; }
select option { background: var(--bg-3); }

button, .button {
  display: inline-block;
  padding: 9px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--red-dark); }
button.secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { background: var(--line); }
button.danger { background: transparent; color: var(--err-fg); border: 1px solid var(--err-bd); }
button.danger:hover { background: var(--err-bg); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.actions form { display: inline; }
form.inline { display: flex; gap: 8px; margin: 12px 0; }
form.inline input { flex: 1; }

.flash { padding: 11px 13px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }
.flash.error { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-bd); }

.muted { color: var(--muted); font-size: 13px; }
.excerpt { color: var(--excerpt); white-space: pre-wrap; }
.draft-text { white-space: pre-wrap; color: var(--excerpt); }
.post-src a { color: var(--link); }
.post-src strong { color: var(--text); }
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 11px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.checkbox { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.checkbox input { width: auto; }

.b-item { margin: 10px 0; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.b-item:last-child { border-bottom: 0; }

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 3px solid var(--red);
}
.batch-bar p { margin: 4px 0 0; }
.batch-bar form { flex: 0 0 auto; }

.bar {
  height: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width 0.4s ease;
}

/* ================= marketing landing ================= */
body.landing { background: var(--bg); }

.m-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.m-nav .brand { color: var(--text); }
.m-nav-right { display: flex; align-items: center; gap: 18px; }
.m-theme { color: var(--muted); text-decoration: none; font-size: 14px; }
.m-theme:hover { color: var(--text); }

.hero {
  background: radial-gradient(ellipse at top, var(--hero-top), var(--bg));
  color: var(--text);
  padding: 96px 24px 84px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.kicker {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 22px;
}
.hero h1 { font-size: 46px; line-height: 1.12; margin: 0 0 18px; }
.hero h1 em { color: var(--red); font-style: normal; }
.lede { font-size: 18px; color: var(--muted); max-width: 600px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.button.big { padding: 13px 26px; font-size: 16px; border-radius: 8px; }
.button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.button.ghost:hover { background: var(--bg-2); }
.trust { font-size: 13px; color: var(--muted); margin-top: 24px; }

.features {
  display: flex;
  gap: 22px;
  max-width: 900px;
  margin: 72px auto;
  padding: 0 24px;
  flex-wrap: wrap;
}
.feature {
  flex: 1 1 320px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.f-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.feature h3 { font-size: 20px; margin: 0 0 10px; color: var(--text); }
.feature p { color: var(--muted); margin: 0; }

.how {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 72px 24px;
  text-align: center;
}
.how h2 { font-size: 28px; margin: 0 0 30px; }
.steps {
  list-style: none;
  max-width: 540px;
  margin: 0 auto 32px;
  padding: 0;
  text-align: left;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.steps li:last-child { border-bottom: 0; }
.steps span {
  flex: 0 0 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.band {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 24px;
}
.band-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.band-inner h2 { font-size: 26px; margin: 0 0 16px; }
.band-inner p { color: var(--muted); font-size: 16px; margin: 0 0 12px; }

.faq { max-width: 680px; margin: 72px auto; padding: 0 24px; }
.faq h2 { font-size: 26px; text-align: center; margin-bottom: 24px; }
.faq .q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq .q:last-child { border-bottom: 0; }
.faq .q h3 { font-size: 16px; margin: 0 0 6px; }
.faq .q p { color: var(--muted); margin: 0; }

.cta-band {
  text-align: center;
  padding: 80px 24px;
  background: radial-gradient(ellipse at bottom, var(--hero-top), var(--bg));
}
.cta-band h2 { font-size: 28px; margin: 0 0 24px; }

.lead-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  max-width: 480px;
  margin: 8px auto 0;
  flex-wrap: wrap;
}
.lead-form input[type=email] {
  flex: 1 1 240px;
  padding: 13px 16px;
  font-size: 16px;
  border-radius: 8px;
}
.lead-form button { padding: 13px 22px; font-size: 16px; border-radius: 8px; }

.m-flash {
  max-width: 720px;
  margin: 20px auto -10px;
}

.pricing { max-width: 980px; margin: 72px auto; padding: 0 24px; text-align: center; }
.pricing h2 { font-size: 26px; margin-bottom: 24px; }
.price-cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.pcard {
  flex: 1 1 260px;
  max-width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  text-align: left;
}
.pcard.featured { border-color: var(--red); }
.pname {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
}
.ppr { font-size: 36px; font-weight: 700; margin: 4px 0 10px; }
.ppr small { font-size: 14px; color: var(--muted); font-weight: 500; }
.pcard p { margin: 0 0 14px; }
.pcard .button { display: inline-block; }

.legal {
  max-width: 680px;
  margin: 56px auto;
  padding: 0 24px 40px;
}
.legal h1 { font-size: 30px; margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--excerpt); }
.legal a { color: var(--link); }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }

.blog-body { font-size: 16px; line-height: 1.75; }
.blog-body h2 { font-size: 20px; margin: 24px 0 10px; color: var(--text); }
.blog-body p { color: var(--excerpt); margin: 0 0 14px; }
.blog-body ul { padding-left: 22px; }
.blog-post h1 { font-size: 34px; line-height: 1.2; margin: 0 0 6px; }
.cta-line { margin-top: 30px; text-align: center; }
.blog-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.blog-item:last-child { border-bottom: 0; }
.blog-item h2 { font-size: 20px; margin: 0 0 4px; }
.blog-item h2 a { color: var(--text); text-decoration: none; }
.blog-item h2 a:hover { color: var(--link); }

.m-foot {
  padding: 28px 40px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.foot-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 12px;
}
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.foot-links a:hover { color: var(--text); }

@media (max-width: 560px) {
  .hero h1 { font-size: 32px; }
  h1 { font-size: 24px; }
  .m-nav, header { padding: 14px 20px; }
  .spend-pill { display: none; }
}
