/* ─── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:           #fafbfc;
  --surface:      #ffffff;
  --ink:          #0f172a;
  --muted:        #64748b;
  --brand:        #4f46e5;
  --brand-dark:   #4338ca;
  --brand-soft:   #eef2ff;
  --border:       #e2e8f0;
  --green:        #10b981;
  --red:          #ef4444;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 20px 50px -20px rgba(15,23,42,.15);
  --shadow-sm:    0 1px 3px rgba(15,23,42,.08);
}

/* ─── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.section    { padding: 80px 0; }

/* ─── Navigation ───────────────────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}
.logo {
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--brand);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
  font-weight: 700;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-link {
  font-size: 14px;
  color: var(--muted);
  transition: color .15s;
}
.nav-link:hover { color: var(--ink); }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: background .15s;
  line-height: 1;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f1f5f9; border-color: #c7d2e8; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-full { display: block; text-align: center; width: 100%; }

/* ─── Badges / pills ───────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}
.badge-pro  { background: var(--brand-soft); color: var(--brand); }
.badge-free { background: #f1f5f9; color: var(--muted); }

/* ─── Section headings ─────────────────────────────────────────────────────── */
.section-header { text-align: center; }
.section-header .pill { margin-bottom: 16px; }
.section-header h2 { font-size: 36px; font-weight: 800; letter-spacing: -.025em; }
.section-header .sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 480px;
  margin: 12px auto 0;
  line-height: 1.65;
}

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.hero { padding: 96px 0 72px; text-align: center; }
.hero h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin-top: 20px;
}
.hero h1 span { color: var(--brand); }
.hero .sub {
  color: var(--muted);
  font-size: 18px;
  max-width: 560px;
  margin: 22px auto 40px;
  line-height: 1.65;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── How it works ─────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 56px;
}
.step { text-align: center; }
.step-num {
  width: 44px;
  height: 44px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  margin: 0 auto 18px;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p   { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ─── Demo window ──────────────────────────────────────────────────────────── */
.demo-wrap { max-width: 800px; margin: 56px auto 0; }
.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.window-body { padding: 24px 28px; }
.window-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.window-head h3 { font-size: 17px; font-weight: 700; }

/* ─── Feed rows ────────────────────────────────────────────────────────────── */
.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
}
.feed-left { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.feed-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-detail { font-size: 12px; color: var(--muted); }
.feed-url { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Status dots ──────────────────────────────────────────────────────────── */
.status {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status--ok::before  { background: var(--green); }
.status--ok          { color: var(--green); }
.status--error::before { background: var(--red); }
.status--error       { color: var(--red); }

/* ─── Merged feed callout ──────────────────────────────────────────────────── */
.merged-feed {
  margin-top: 20px;
  background: var(--brand-soft);
  border: 1px dashed var(--brand);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.merged-feed-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 5px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.merged-feed code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: var(--brand);
  word-break: break-all;
}

/* ─── Pricing ──────────────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 56px auto 0;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
}
.pricing-card--featured { border-color: var(--brand); border-width: 2px; }
.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 99px;
  white-space: nowrap;
}
.plan-name  { font-size: 18px; font-weight: 700; }
.plan-price { margin: 14px 0 28px; }
.plan-price .amount { font-size: 42px; font-weight: 800; letter-spacing: -.03em; }
.plan-price .period { font-size: 14px; color: var(--muted); margin-left: 4px; }
.plan-features {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.plan-features li {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-features li::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}
.feature-yes::before {
  background-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.feature-no::before {
  background-color: var(--border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2l-6 6' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.feature-no { color: var(--muted); }

/* ─── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-list {
  max-width: 680px;
  margin: 56px auto 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item .faq-body {
  padding: 16px 20px 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
}

/* ─── Cards (generic) ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ─── Form elements ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.field-error { font-size: 13px; color: var(--red); margin-top: 5px; }
.field-hint  { font-size: 13px; color: var(--muted); margin-top: 5px; }

/* ─── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 20px;
}
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-error   { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-info    { background: var(--brand-soft); border-color: #a5b4fc; color: #312e81; }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 24px; }
.footer-link { font-size: 14px; color: var(--muted); transition: color .15s; }
.footer-link:hover { color: var(--ink); }
.footer-copy { font-size: 13px; color: var(--muted); }

/* ─── Divider ──────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ─── Back link ────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
  transition: color .15s;
}
.back-link:hover { color: var(--ink); }

/* ─── Calendar editor ──────────────────────────────────────────────────────── */
.editor-container {
  padding-top: 40px;
  padding-bottom: 80px;
  max-width: 780px;
}
.editor-section { margin-bottom: 20px; }
.editor-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--ink);
}

/* ─── Source rows ──────────────────────────────────────────────────────────── */
.source-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--surface);
  overflow: hidden;
}
.source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 12px;
}

/* ─── Source settings (collapsible) ────────────────────────────────────────── */
.source-settings > summary {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-top: 1px solid var(--border);
  list-style: none;
  display: flex;
  align-items: center;
  user-select: none;
  background: #f8fafc;
  transition: color .15s;
}
.source-settings > summary::-webkit-details-marker { display: none; }
.source-settings > summary::before {
  content: '▶';
  font-size: 9px;
  margin-right: 6px;
  transition: transform .15s;
}
.source-settings[open] > summary::before { content: '▼'; }
.source-settings > summary:hover { color: var(--ink); }

.source-settings-form {
  padding: 16px 14px 14px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ─── Danger zone ──────────────────────────────────────────────────────────── */
.danger-zone { border-color: #fca5a5; }
.danger-title { color: var(--red); }
.btn-danger-ghost {
  color: var(--red) !important;
  border-color: #fca5a5 !important;
}
.btn-danger-ghost:hover {
  background: #fef2f2 !important;
  border-color: var(--red) !important;
}

/* ─── Prose (guide articles) ───────────────────────────────────────────────── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 64px;
  padding-bottom: 96px;
}
.prose h1 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); margin: 20px 0 16px; }
.prose h2 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); margin: 56px 0 16px; }
.prose h3 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 36px 0 12px; }
.prose p  { font-size: 16px; color: var(--muted); line-height: 1.8; margin-bottom: 24px; }
.prose ul, .prose ol { margin: 0 0 28px 28px; }
.prose li { font-size: 16px; color: var(--muted); line-height: 1.8; margin-bottom: 12px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--brand-soft); color: var(--brand); padding: 2px 6px; border-radius: 4px; }
.prose a { color: var(--brand); }
.prose a:hover { text-decoration: underline; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }
.prose .meta { font-size: 14px; color: var(--muted); margin-bottom: 40px; line-height: 1.6; }
.prose .cta-box { background: var(--brand-soft); border: 1px solid #a5b4fc; border-radius: var(--radius); padding: 32px 36px; margin: 56px 0; text-align: center; }
.prose .cta-box h3 { margin: 0 0 12px; color: var(--ink); font-size: 20px; }
.prose .cta-box p { margin-bottom: 24px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 28px; font-size: 15px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; color: var(--ink); background: #f8fafc; }
.prose td { color: var(--muted); }

/* ─── Guide cards (hub) ────────────────────────────────────────────────────── */
.guide-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; display: block; transition: border-color .15s, box-shadow .15s; }
.guide-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.guide-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 5px; color: var(--ink); }
.guide-card p { font-size: 14px; color: var(--muted); line-height: 1.65; margin: 0; }
.guide-tag { font-size: 12px; color: var(--brand); font-weight: 600; margin-bottom: 6px; display: block; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: 38px; }
  .hero .sub { font-size: 16px; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .nav-link { display: none; }
  .section { padding: 56px 0; }
  .section-header h2 { font-size: 28px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .editor-container { max-width: 100%; }
  .source-settings-form > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .merged-feed { flex-direction: column; gap: 12px; }
  .merged-feed > div:last-child { align-self: flex-start; }
}
