/* ═══════════════════════════════════════════════════
   PagePulse — Design System
   Stripe / Linear / Vercel aesthetic
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --success: #22c55e;
  --success-bg: #f0fdf4;
  --warning: #eab308;
  --warning-bg: #fefce8;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Consolas, monospace;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font: 600 .875rem/1 var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  min-height: 40px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(99,102,241,.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f9fafb; border-color: var(--border-hover); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ─── Nav ─── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.nav-logo svg { flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-link { font-size: .875rem; font-weight: 500; color: var(--text-secondary); transition: color .15s; }
.nav-link:hover { color: var(--text); }

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 72px 24px 32px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-pill {
  display: inline-flex;
  padding: 5px 14px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: .01em;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ─── Checker Input ─── */
.checker-wrap {
  max-width: 600px;
  margin: 32px auto 0;
  padding: 0 24px;
}
.checker {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px 5px 5px 0;
  transition: border-color .2s, box-shadow .2s;
}
.checker:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}
.checker-icon {
  display: flex;
  align-items: center;
  padding: 0 4px 0 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.checker input {
  flex: 1;
  border: none;
  outline: none;
  font: 400 .9375rem var(--font);
  padding: 12px 12px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.checker input::placeholder { color: var(--text-muted); }
.checker .btn { border-radius: var(--radius); padding: 10px 20px; flex-shrink: 0; }
.checker-error {
  font-size: .8125rem;
  color: var(--error);
  text-align: center;
  margin-top: 8px;
  min-height: 20px;
}
.checker-examples {
  text-align: center;
  margin-top: 12px;
  font-size: .8125rem;
  color: var(--text-muted);
  margin-bottom: 64px;
}
.checker-examples button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: 500 .8125rem var(--font);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .15s;
}
.checker-examples button:hover { background: var(--primary-light); }

/* ─── Results Container ─── */
.results {
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.results:empty { display: none; }
.results-fade { animation: fadeUp .35s ease-out; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Summary Bar ─── */
.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.summary-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}
.summary-url {
  font: 500 .8125rem var(--mono);
  color: var(--text-secondary);
  word-break: break-all;
}
.summary-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
}
.stat-pass { background: var(--success-bg); color: #15803d; }
.stat-warn { background: var(--warning-bg); color: #a16207; }
.stat-fail { background: var(--error-bg); color: #dc2626; }
.stat-info { background: var(--info-bg); color: #2563eb; }
.summary-time {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ─── Score Badge ─── */
.score-badge {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}
.score-excellent { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.score-good      { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.score-ok        { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.score-warn      { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.score-fail      { background: var(--error-bg); color: #b91c1c; border: 1px solid #fecaca; }
.score-num       { font-size: 1.5rem; }
.score-grade     { font-size: .875rem; opacity: .75; }

/* ─── Section Title ─── */
.section-title {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 32px 0 12px;
}

/* ─── Preview Grid ─── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.preview-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.preview-label svg { width: 16px; height: 16px; flex-shrink: 0; }
.preview-body { padding: 16px; }

/* Google Search Preview */
.gp { font-family: arial, sans-serif; }
.gp-url-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.gp-fav {
  width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; color: var(--text-muted); flex-shrink: 0; overflow: hidden;
}
.gp-fav img { width: 18px; height: 18px; border-radius: 50%; }
.gp-domain { font-size: .875rem; color: #202124; line-height: 1.3; }
.gp-breadcrumb { font-size: .75rem; color: #70757a; }
.gp-title {
  font-size: 1.25rem; line-height: 1.3; color: #1a0dab; margin: 4px 0 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer;
}
.gp-title:hover { text-decoration: underline; }
.gp-desc {
  font-size: .875rem; line-height: 1.58; color: #4d5156;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Facebook / LinkedIn OG Preview */
.ogp { border: 1px solid #dadde1; border-radius: var(--radius-sm); overflow: hidden; }
.ogp-img {
  width: 100%; height: 0; padding-bottom: 52.36%;
  background: #f0f2f5; position: relative; overflow: hidden;
}
.ogp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ogp-img .ph {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: .8rem; color: var(--text-muted);
}
.ogp-body { padding: 10px 12px; background: #f2f3f5; }
.ogp-site { font-size: .75rem; color: #65676b; text-transform: uppercase; margin-bottom: 2px; }
.ogp-title {
  font-size: .9375rem; font-weight: 600; color: #1c1e21; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 2px;
}
.ogp-desc {
  font-size: .875rem; color: #606770; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

/* LinkedIn-specific overrides */
.li-ogp .ogp-body { background: #f3f2ef; }
.li-ogp .ogp-title { color: rgba(0,0,0,.9); }
.li-ogp .ogp-desc { color: rgba(0,0,0,.6); }

/* Twitter/X Preview */
.tp { border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; }
.tp-img {
  width: 100%; background: #f7f9f9; position: relative; overflow: hidden;
}
.tp-img.large { height: 0; padding-bottom: 52.36%; }
.tp-img.small { height: 0; padding-bottom: 52.36%; }
.tp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tp-img .ph {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: .8rem; color: #536471;
}
.tp-body { padding: 12px; border-top: 1px solid #eff3f4; }
.tp-title {
  font-size: .9375rem; font-weight: 700; color: #0f1419; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 2px;
}
.tp-desc {
  font-size: .9375rem; color: #536471; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 2px;
}
.tp-domain { font-size: .8125rem; color: #536471; display: flex; align-items: center; gap: 4px; }

/* Twitter summary card (horizontal layout) */
.tp-summary-layout {
  display: flex;
  align-items: stretch;
  min-height: 130px;
}
.tp-body-sm {
  flex: 1;
  padding: 12px;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.tp-thumb-right {
  width: 130px;
  min-width: 130px;
  background: #f7f9f9;
  border-left: 1px solid #eff3f4;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.tp-thumb-right img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slack Preview */
.sp { border-left: 4px solid #1264a3; padding-left: 12px; }
.sp-site-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sp-fav { width: 16px; height: 16px; border-radius: 3px; background: #f1f5f9; flex-shrink: 0; overflow: hidden; }
.sp-fav img { width: 100%; height: 100%; border-radius: 3px; }
.sp-site { font-size: .8125rem; font-weight: 700; color: #1d1c1d; }
.sp-title {
  font-size: .9375rem; font-weight: 700; color: #1264a3; margin-bottom: 4px;
  line-height: 1.4; cursor: pointer;
}
.sp-title:hover { text-decoration: underline; }
.sp-desc {
  font-size: .8125rem; color: #616061; line-height: 1.46;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sp-img { margin-top: 8px; border-radius: 4px; overflow: hidden; }
.sp-img img { width: 100%; display: block; max-height: 200px; object-fit: cover; }

/* Discord Preview */
.dp {
  border-left: 4px solid #5865f2; padding: 8px 16px 12px 12px;
  background: #f2f3f5; border-radius: 4px; max-width: 520px;
}
.dp-site { font-size: .75rem; font-weight: 600; color: #4e5058; margin-bottom: 8px; }
.dp-row { display: flex; gap: 16px; }
.dp-text { flex: 1; min-width: 0; }
.dp-title {
  font-size: .875rem; font-weight: 600; color: #00a8fc; line-height: 1.375;
  margin-bottom: 4px; cursor: pointer;
}
.dp-title:hover { text-decoration: underline; }
.dp-desc {
  font-size: .875rem; color: #4e5058; line-height: 1.375;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dp-thumb {
  width: 80px; height: 80px; border-radius: 4px; overflow: hidden;
  background: #fff; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; color: #b5bac1; font-size: .7rem;
}
.dp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dp-big-img { margin-top: 8px; border-radius: 4px; overflow: hidden; max-width: 400px; }
.dp-big-img img { width: 100%; display: block; max-height: 200px; object-fit: cover; }
.dp-no-img {
  margin-top: 8px;
  font-size: .75rem;
  color: #b5bac1;
  font-style: italic;
}

/* ─── Tag Audit Section ─── */
.audit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.audit-section:hover { border-color: var(--border-hover); }
.audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
  gap: 12px;
}
.audit-header:hover { background: #fafbfc; }
.audit-header-left { display: flex; align-items: center; gap: 10px; }
.audit-header-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.audit-header-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}
.badge-pass { background: var(--success-bg); color: #15803d; }
.badge-warn { background: var(--warning-bg); color: #a16207; }
.badge-fail { background: var(--error-bg); color: #dc2626; }
.audit-arrow {
  color: var(--text-muted);
  transition: transform .2s;
  font-size: .75rem;
  flex-shrink: 0;
}
.audit-arrow.open { transform: rotate(180deg); }
.audit-body {
  border-top: 1px solid var(--border);
  padding: 0;
  display: none;
}
.audit-body.open { display: block; }

/* Tag rows */
.tag-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid #f3f4f6;
  font-size: .8125rem;
  transition: background .1s;
}
.tag-row:last-child { border-bottom: none; }
.tag-row:hover { background: #fafbfc; }
.tag-row:hover .copy-btn { opacity: 1; }
.tag-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .7rem;
  margin-top: 1px;
}
.tag-status.pass { background: var(--success-bg); color: var(--success); }
.tag-status.warn { background: var(--warning-bg); color: #ca8a04; }
.tag-status.fail { background: var(--error-bg); color: var(--error); }
.tag-name {
  min-width: 140px;
  font: 500 .8125rem var(--mono);
  color: var(--text-secondary);
  padding-top: 1px;
  flex-shrink: 0;
}
.tag-val {
  flex: 1;
  font-size: .8125rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}
.tag-val.missing {
  color: var(--error);
  font-style: italic;
}
.tag-val.warning-text {
  color: #a16207;
}
.tag-note {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.copy-btn {
  padding: 3px 8px;
  font: 600 .7rem var(--font);
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .15s;
  flex-shrink: 0;
  margin-top: 1px;
}
.copy-btn:hover { background: var(--primary); color: #fff; }
.copy-btn.copied { background: var(--success); color: #fff; opacity: 1; }

/* ─── Warnings Panel ─── */
.warnings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.warning-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid #f3f4f6;
  font-size: .8125rem;
  line-height: 1.5;
}
.warning-item:last-child { border-bottom: none; }
.warning-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .7rem;
}
.warning-icon.error { background: var(--error-bg); color: var(--error); }
.warning-icon.warn { background: var(--warning-bg); color: #ca8a04; }
.warning-icon.info { background: var(--info-bg); color: var(--info); }
.warning-text { flex: 1; }
.warning-text strong { font-weight: 600; }
.warning-fix {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 4px;
  border-left: 2px solid var(--info);
}

/* ─── Loading Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skeleton-card-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.skeleton-card-body { padding: 16px; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Check Another CTA ─── */
.check-another {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* ─── Features ─── */
.features {
  max-width: 1000px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.features-header {
  text-align: center;
  margin-bottom: 48px;
}
.features-header h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.features-header p { color: var(--text-secondary); font-size: .9375rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: .9375rem; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: .8125rem; color: var(--text-secondary); line-height: 1.6; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
}
.footer p { font-size: .8rem; color: var(--text-muted); }

/* ─── Modal ─── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease-out;
  position: relative;
}
@keyframes modalIn {
  from { transform: scale(.95) translateY(16px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  font-size: 1.5rem; color: var(--text-muted);
  cursor: pointer; line-height: 1;
  padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: #f3f4f6; }
.modal h2 { font-size: 1.125rem; font-weight: 700; margin-bottom: 6px; }
.modal p { color: var(--text-secondary); font-size: .875rem; margin-bottom: 20px; }
.form-field { margin-bottom: 14px; }
.form-field label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px;
}
.form-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: 400 16px var(--font);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-height: 42px;
}
.form-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.form-error {
  color: var(--error);
  font-size: .8rem;
  margin-top: 6px;
  background: var(--error-bg);
  padding: 10px;
  border-radius: var(--radius-sm);
}
.form-error:empty { display: none; }
.auth-switch {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 14px;
}
.auth-switch a { font-weight: 600; }
.modal .btn { margin-top: 6px; }

/* ─── Ad Units ─── */
.ad-wrap {
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 0 24px;
}
.ad-wrap-landing {
  max-width: 600px;
  margin: 0 auto 48px;
  padding: 0 24px;
}
.ad-wrap-results {
  margin-bottom: 24px;
}
.ad-unit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.ad-unit:hover { border-color: var(--border-hover); }
.ad-label {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  pointer-events: none;
}
/* Carbon Ads overrides — match site aesthetic */
#carbonads {
  display: flex;
  width: 100%;
  font-family: var(--font);
}
#carbonads a { text-decoration: none; color: inherit; }
.carbon-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.carbon-img img {
  width: 130px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: block;
}
.carbon-text {
  flex: 1;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--text);
}
.carbon-poweredby {
  display: block;
  margin-top: 6px;
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 500;
}
.carbon-poweredby:hover { color: var(--primary); }
/* Ad placeholder (shown before ad loads / approval pending) */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 90px;
  color: var(--text-muted);
}
.ad-placeholder-text {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.ad-placeholder-sub {
  font-size: .7rem;
  color: #c4c9d4;
}
/* Google AdSense */
.adsbygoogle { display: block; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero { padding: 56px 20px 24px; }
  .preview-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .tag-name { min-width: 110px; font-size: .75rem; }
  .summary-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .score-badge { align-self: flex-start; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  /* Copy button always visible on touch devices */
  .copy-btn { opacity: 1; }
  /* Twitter summary horizontal — slightly smaller thumb */
  .tp-thumb-right { width: 100px; min-width: 100px; }
  /* Ads */
  .carbon-wrap { flex-direction: column; text-align: center; }
  .carbon-img img { width: 100%; height: 120px; }
  .ad-wrap-landing { margin-bottom: 32px; }
}

@media (max-width: 480px) {
  .nav { padding: 12px 16px; }
  .nav-logo { font-size: 1rem; }
  .nav-logo svg { width: 24px; height: 24px; }
  .nav-actions { gap: 12px; }
  .nav-link { font-size: .8rem; }
  .hero { padding: 40px 16px 20px; }
  .hero h1 { font-size: 1.75rem; }
  .hero-sub { font-size: .9375rem; }
  .checker-wrap { padding: 0 16px; }
  .checker {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }
  .checker-icon { display: none; }
  .checker input { font-size: 16px; padding: 12px; width: 100%; }
  .checker .btn { width: 100%; justify-content: center; padding: 12px; }
  .results { padding: 0 16px; }
  .summary-bar { padding: 14px 16px; }
  .score-num { font-size: 1.25rem; }
  .tp-thumb-right { width: 80px; min-width: 80px; }
  .tag-row { padding: 10px 16px; flex-direction: column; gap: 4px; }
  .tag-name { min-width: auto; }
  .audit-header { padding: 12px 16px; }
  .features { padding: 0 16px; }
  .feature-card { padding: 20px 16px; }
  .gp-title { font-size: 1.125rem; }
  .dp { max-width: 100%; }
  .dp-row { flex-direction: column; }
  .dp-thumb { width: 100%; height: 140px; }
}
