/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080809;
  --bg2: #111113;
  --bg3: #18181b;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --text: #f4f4f5;
  --text-muted: #71717a;
  --text-faint: #3f3f46;
  --accent: #7c3aed;
  --accent-light: #8b5cf6;
  --accent-glow: rgba(124,58,237,0.25);
  --danger: #ef4444;
  --danger-light: #fca5a5;
  --danger-bg: rgba(239,68,68,0.08);
  --success: #10b981;
  --success-bg: rgba(16,185,129,0.08);
  --warn: #f59e0b;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  font-size: 15px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }
pre { font-family: 'SF Mono', 'Fira Code', monospace; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(8,8,9,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo:hover { color: var(--accent-light); }

.logo-mark {
  color: var(--accent-light);
  font-size: 10px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 0 20px var(--accent-glow); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg3); }

.btn-xs { padding: 4px 10px; font-size: 12px; }

/* ── Main layout ── */
main { flex: 1; }

/* ── Hero ── */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 24px 80px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 28px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: pulse 2s ease-in-out infinite;
}

.hero-headline {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.headline-accent {
  background: linear-gradient(135deg, #f87171 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

/* ── Hero form ── */
.hero-form-wrap { max-width: 520px; margin: 0 auto 40px; }

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 14px;
  color: var(--danger-light);
  margin-bottom: 12px;
  text-align: left;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-icon {
  flex-shrink: 0;
  margin-left: 14px;
}

.url-input {
  flex: 1;
  padding: 14px 12px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  min-width: 0;
}
.url-input::placeholder { color: var(--text-faint); }

.btn-submit {
  border-radius: 0;
  border-left: 1px solid var(--border);
  padding: 12px 20px;
  flex-shrink: 0;
}

.form-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Stats ── */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 130px;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── How it works ── */
.how-it-works {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 56px;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 260px;
  text-align: left;
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-arrow {
  font-size: 22px;
  color: var(--text-faint);
  padding: 0 8px;
  align-self: center;
  flex-shrink: 0;
}

/* ── Pain section ── */
.pain-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.pain-card {
  padding: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
}

.pain-icon { font-size: 24px; margin-bottom: 16px; }

.pain-quote {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  quotes: '\201C' '\201D';
  margin-bottom: 16px;
}
.pain-quote::before { content: open-quote; }
.pain-quote::after { content: close-quote; }

.pain-cite {
  font-size: 13px;
  color: var(--text-muted);
  font-style: normal;
}

/* ── CTA section ── */
.cta-section {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 24px 100px;
  text-align: center;
}

.cta-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}

.cta-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.cta-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-form .url-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cta-form .url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.cta-form .url-input::placeholder { color: var(--text-faint); }

/* ── Page header ── */
.page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.breadcrumb-link { color: var(--text-muted); }
.breadcrumb-link:hover { color: var(--text); }
.breadcrumb-sep { color: var(--text-faint); }
.breadcrumb-cur { color: var(--text); font-weight: 500; }

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-url {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}
.site-url:hover { color: var(--accent-light); }

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Alert banner ── */
.alert-banner {
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--danger-light);
}

/* ── Site grid layout ── */
.site-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) {
  .site-grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg3);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.card-count-danger {
  background: var(--danger-bg);
  color: var(--danger-light);
}

.card-info { padding-bottom: 4px; }
.card-info .card-title { padding: 18px 20px 12px; border: none; display: block; }

/* ── Checks list ── */
.checks-list { padding: 8px 0; }

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: var(--bg3); }

.check-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.check-status-ok .check-status-dot { background: var(--success); }
.check-status-failing .check-status-dot { background: var(--danger); animation: pulse 1.5s ease-in-out infinite; }
.check-status-unknown .check-status-dot { background: var(--text-faint); }

.check-info { flex: 1; min-width: 0; }
.check-name { display: block; font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-type { font-size: 12px; color: var(--text-muted); }

.check-status-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.check-status-ok .check-status-label { color: var(--success); }
.check-status-failing .check-status-label { color: var(--danger); }
.check-status-unknown .check-status-label { color: var(--text-faint); }

/* ── Empty states ── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
}
.empty-state-sm { padding: 32px 20px; }

.empty-icon { font-size: 28px; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; max-width: 260px; margin: 0 auto; }

/* ── Alerts list ── */
.alerts-list { padding: 4px 0; }

.alert-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }

.alert-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.alert-flow-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger-light);
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.18);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-time { font-size: 11px; color: var(--text-faint); }
.alert-message {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  margin-top: 2px;
  margin-bottom: 10px;
}

.fix-prompt {
  margin-top: 2px;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fix-prompt.fp-copied {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.fix-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 7px 12px;
  border-bottom: 1px solid rgba(124,58,237,0.15);
  gap: 8px;
}

.fix-prompt-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.fix-prompt-text {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  max-height: 180px;
  overflow-y: auto;
}
.fix-prompt-text::-webkit-scrollbar { width: 4px; }
.fix-prompt-text::-webkit-scrollbar-track { background: transparent; }
.fix-prompt-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.btn-accent {
  background: rgba(124,58,237,0.18);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.28);
  flex-shrink: 0;
}
.btn-accent:hover {
  background: rgba(124,58,237,0.28);
  color: #c4b5fd;
}
.btn-accent.btn-copied {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border-color: rgba(16,185,129,0.25);
}

.copy-btn { flex-shrink: 0; }

.alert-resolve-form { margin-top: 10px; }
.resolve-btn {
  color: var(--text-faint);
  border-color: var(--border);
  font-size: 11px;
}
.resolve-btn:hover {
  color: var(--success);
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.06);
}

.empty-icon-svg { display: flex; justify-content: center; margin-bottom: 12px; }

/* ── Next steps ── */
.next-steps {
  list-style: none;
  padding: 0 20px 16px;
}

.next-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.next-step:last-child { border-bottom: none; }
.next-step.done { color: var(--success); }

.step-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-num-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-free { background: var(--bg3); color: var(--text-muted); border: 1px solid var(--border); }
.badge-paid { background: rgba(124,58,237,0.15); color: var(--accent-light); border: 1px solid rgba(124,58,237,0.25); }

/* ── Dashboard sites grid ── */
.sites-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.site-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.site-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.site-card-danger { border-color: rgba(239,68,68,0.25); }
.site-card-danger:hover { border-color: rgba(239,68,68,0.45); }

.site-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.site-card-domain {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card-url {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.site-card-alert-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  flex-shrink: 0;
}

.site-card-ok {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  flex-shrink: 0;
}

.site-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-card-stat { font-size: 12px; color: var(--text-muted); }

.site-card-flows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  overflow: hidden;
  max-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flow-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.flow-pill-ok .flow-pill-dot { background: var(--success); }
.flow-pill-failing .flow-pill-dot { background: var(--danger); }
.flow-pill-unknown .flow-pill-dot { background: var(--text-faint); }

.flow-pill-more {
  font-size: 11px;
  color: var(--text-faint);
  padding: 3px 6px;
}

/* ── Empty page ── */
.empty-page {
  max-width: 480px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.empty-page-icon { font-size: 48px; margin-bottom: 20px; }
.empty-page-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.empty-page-desc { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.6; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}
.footer-copy { font-size: 13px; color: var(--text-faint); }

/* ── Scanning / loading state ── */
@keyframes spin { to { transform: rotate(360deg); } }

.scanning-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.04em;
}

.scanning-state {
  padding: 48px 24px;
  text-align: center;
}

.scan-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 16px;
}

.scanning-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.scanning-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Remove flow button ── */
.btn-danger-ghost {
  background: transparent;
  color: var(--text-faint);
  border: none;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger-ghost:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ── Checks footer hint ── */
.checks-footer {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
}
.checks-footer-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Card header actions (count + run button grouped) ── */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-now-btn {
  gap: 5px;
}

/* ── Check meta row (type + last-run time) ── */
.check-meta {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.check-last-run {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Run history dots ── */
.run-history {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.run-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.run-dot-ok      { background: var(--success); opacity: 0.85; }
.run-dot-failing { background: var(--danger);  opacity: 0.9;  }
.run-dot-error   { background: var(--warn);    opacity: 0.75; }
.run-dot-unknown { background: var(--text-faint); }

/* ── Error status for check items ── */
.check-status-error .check-status-dot  { background: var(--warn); }
.check-status-error .check-status-label { color: var(--warn); }

/* ── Step spin indicator ── */
.step-spin-sm {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}

/* ── Notification card ── */
.badge-notif-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}

.notif-feedback {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.notif-feedback-success { color: var(--success); background: var(--success-bg); }
.notif-feedback-error   { color: #fca5a5; background: var(--danger-bg); }

.notif-form {
  padding: 16px 20px 4px;
  display: flex;
  flex-direction: column;
}

.notif-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.notif-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.notif-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.notif-input::placeholder { color: var(--text-faint); }

.notif-hint {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}

.notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 16px;
}

.notif-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.notif-test-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.4;
}

.notif-log {
  border-top: 1px solid var(--border);
  padding: 12px 20px 4px;
}

.notif-log-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.notif-log-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  overflow: hidden;
}
.notif-log-item:last-child { border-bottom: none; }

.notif-log-channel {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 48px;
}

.notif-log-status { font-weight: 700; flex-shrink: 0; }
.notif-log-ok    { color: var(--success); }
.notif-log-error { color: var(--danger); }

.notif-log-err {
  color: var(--text-faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.notif-log-time {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Check-name link in site detail flow list ── */
.check-name-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.check-name-link:hover { color: var(--accent-light); }

/* ── Dashboard: new site card structure ── */
.site-card {
  /* override original padding/gap — inner link area and flow-list handle spacing */
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.site-card-link-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.site-card-link-area:hover { background: rgba(255,255,255,0.02); }

.site-card-badge { flex-shrink: 0; }

/* ── Dashboard: per-flow list ── */
.flow-list {
  border-top: 1px solid var(--border);
}

.flow-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  transition: background 0.1s;
}
.flow-list-row:last-child { border-bottom: none; }
.flow-list-row:hover { background: rgba(255,255,255,0.03); color: var(--text); }

.flow-list-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.flow-list-dot-ok      { background: var(--success); }
.flow-list-dot-failing { background: var(--danger); animation: pulse 1.5s ease-in-out infinite; }
.flow-list-dot-unknown { background: var(--text-faint); }
.flow-list-dot-error   { background: var(--warn); }

.flow-list-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.flow-list-uptime {
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

.flow-list-timeline {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.flow-list-more {
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-faint);
}

.site-card-scanning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

.scan-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.site-card-no-flows {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ── Uptime color classes ── */
.uptime-great { color: var(--success); }
.uptime-ok    { color: var(--warn); }
.uptime-bad   { color: var(--danger); }
.uptime-none  { color: var(--text-faint); }
.stat-danger  { color: var(--danger); }

/* ── Check detail page ── */
.check-stats-row {
  max-width: 1100px;
  margin: 0 auto 28px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.check-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}

.check-stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.check-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 500;
}

/* ── Timeline section ── */
.timeline-section {
  max-width: 1100px;
  margin: 0 auto 28px;
  padding: 0 24px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.timeline-hint {
  font-size: 12px;
  color: var(--text-faint);
}

.timeline-strip-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
}
.timeline-strip-wrap::-webkit-scrollbar { height: 4px; }
.timeline-strip-wrap::-webkit-scrollbar-track { background: transparent; }
.timeline-strip-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.timeline-strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 28px;
}

.run-bar {
  width: 10px;
  height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: transform 0.1s, opacity 0.1s;
  cursor: default;
}
.run-bar:hover { transform: scaleY(1.15); opacity: 1 !important; }
.run-bar-ok      { background: var(--success); opacity: 0.75; }
.run-bar-failing { background: var(--danger);  opacity: 0.9; }
.run-bar-error   { background: var(--warn);    opacity: 0.65; }
.run-bar-unknown { background: var(--text-faint); opacity: 0.5; }

.timeline-empty {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-faint);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: #c4b5fd; }

/* ── Check detail two-column grid ── */
.check-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) {
  .check-grid { grid-template-columns: 1fr; }
}
.check-main { display: flex; flex-direction: column; gap: 16px; }
.check-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* ── Run history table ── */
.run-table { padding: 4px 0; }

.run-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.run-row:last-child { border-bottom: none; }

.run-row-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.run-row-ok      .run-row-dot { background: var(--success); }
.run-row-failing .run-row-dot { background: var(--danger); }
.run-row-error   .run-row-dot { background: var(--warn); }
.run-row-unknown .run-row-dot { background: var(--text-faint); }

.run-row-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.run-row-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.run-row-ok      .run-row-status { color: var(--success); }
.run-row-failing .run-row-status { color: var(--danger); }
.run-row-error   .run-row-status { color: var(--warn); }
.run-row-unknown .run-row-status { color: var(--text-faint); }

.run-row-http {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.run-row-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.run-row-regression {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--danger-bg);
  color: var(--danger-light);
  border: 1px solid rgba(239,68,68,0.18);
  white-space: nowrap;
}

.run-row-note {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}

/* ── Alert resolved style ── */
.alert-item-resolved {
  opacity: 0.6;
}

.alert-pill-resolved {
  background: var(--bg3) !important;
  color: var(--text-faint) !important;
  border-color: var(--border) !important;
}

/* ── Check status badge in page header ── */
.check-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid;
}
.check-status-badge-ok {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(16,185,129,0.25);
}
.check-status-badge-failing {
  background: var(--danger-bg);
  color: var(--danger-light);
  border-color: rgba(239,68,68,0.25);
}
.check-status-badge-unknown, .check-status-badge-error {
  background: var(--bg3);
  color: var(--text-faint);
  border-color: var(--border);
}

.check-status-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.check-status-badge-failing .check-status-badge-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── Check status text (in flow details card) ── */
.check-status-text-ok      { color: var(--success); font-weight: 600; }
.check-status-text-failing { color: var(--danger);  font-weight: 600; }
.check-status-text-unknown { color: var(--text-faint); }
.check-status-text-error   { color: var(--warn); font-weight: 600; }

/* ── Flow detail info card ── */
.flow-detail-list { padding: 4px 20px 16px; }

.flow-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.flow-detail-row:last-child { border-bottom: none; }

.flow-detail-key {
  color: var(--text-faint);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 56px;
}

.flow-detail-val {
  color: var(--text);
  word-break: break-all;
}

.flow-detail-url {
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 220px;
}
.flow-detail-url:hover { color: var(--accent-light); }

/* ── Responsive: check stats row ── */
@media (max-width: 600px) {
  .check-stats-row { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); }
  .stats-row { gap: 16px 0; }
  .stat-divider { display: none; }
  .stat { padding: 0 16px; }
  .hero { padding: 64px 16px 56px; }
  .input-group { flex-direction: column; border-radius: var(--radius-sm); }
  .url-input { width: 100%; }
  .btn-submit { border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-left: none; border-top: 1px solid var(--border); width: 100%; justify-content: center; }
}

/* ── Locked flow styles (free plan paywall) ── */
.check-status-locked {
  opacity: 0.65;
}
.locked-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.check-name-locked {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-accent-outline {
  background: transparent;
  color: var(--accent-light);
  border: 1px solid rgba(124,58,237,0.35);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-accent-outline:hover {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.55);
}

/* ── Upgrade nudge banner ── */
.upgrade-nudge {
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: var(--radius);
  font-size: 14px;
  flex-wrap: wrap;
}
.upgrade-nudge-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c4b5fd;
}
.upgrade-nudge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Success alert banner variant ── */
.alert-banner-success {
  background: var(--success-bg);
  border-color: rgba(16,185,129,0.25);
  color: #6ee7b7;
}

/* ── Upgrade page ── */
.upgrade-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.upgrade-hero {
  text-align: center;
  margin-bottom: 56px;
}
.upgrade-headline {
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 18px;
}
.upgrade-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}
.plan-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 64px;
}
@media (max-width: 640px) {
  .plan-compare { grid-template-columns: 1fr; }
}
.plan-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.plan-card-paid {
  border-color: rgba(124,58,237,0.4);
  background: linear-gradient(160deg, rgba(124,58,237,0.07) 0%, var(--bg2) 60%);
}
.plan-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.plan-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.plan-price {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.plan-period {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}
.plan-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-feat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.plan-feat-ok { color: var(--text); }
.plan-feat-muted { color: var(--text-faint); }
.btn-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.15s;
}
.plan-note {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}
.upgrade-pain {
  margin-top: 16px;
}
.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.pain-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.pain-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════════════
   Feature #8 — Production polish layer
   Additive only: keyboard focus, reduced-motion, selection, scrollbars,
   entrance motion. Layered on top of the existing token system.
   ════════════════════════════════════════════════════════════════════ */

/* ── Branded keyboard focus (mouse clicks stay clean via :focus-visible) ── */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.link-btn:focus-visible,
.btn-danger-ghost:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

input:focus-visible,
.url-input:focus-visible,
.notif-input:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
}

/* Keep the input wrapper's existing glow, and add it on direct-focused inputs */
.url-input:focus-visible,
.notif-input:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Text selection ── */
::selection {
  background: rgba(124, 58, 237, 0.32);
  color: #fff;
}

/* ── Page-level custom scrollbar (Chrome/Safari + Firefox) ── */
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: var(--border-hover) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border: 2px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Subtle content entrance ── */
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
main { animation: fade-rise 0.22s ease-out both; }

/* ── Respect reduced-motion: freeze the infinite loops + cut transitions ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
