/* ==========================================================================
   PainHook AI — Modern Obsidian Dark SaaS Stylesheet
   Strict-CSP friendly (zero inline styles required), 0px overflow 390px–1440px
   ========================================================================== */

:root {
  --bg-obsidian: #080d1a;
  --bg-surface: rgba(15, 23, 42, 0.76);
  --bg-surface-solid: #0f172a;
  --bg-elevated: rgba(20, 30, 54, 0.88);
  --bg-input: rgba(8, 13, 26, 0.84);

  --border-subtle: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-emerald: rgba(16, 185, 129, 0.45);
  --border-indigo: rgba(99, 102, 241, 0.48);

  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-dark: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.14);

  --indigo: #6366f1;
  --indigo-bright: #818cf8;
  --indigo-soft: rgba(99, 102, 241, 0.16);

  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-display: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-card: 0 20px 50px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-glow-emerald: 0 0 28px rgba(16, 185, 129, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
  background-color: var(--bg-obsidian);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
}

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

.inline-link {
  color: var(--emerald-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: #6ee7b7;
}

/* Ambient Background */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.48;
}

.orb-emerald {
  width: 540px;
  height: 540px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.36) 0%, rgba(16, 185, 129, 0) 70%);
}

.orb-indigo {
  width: 600px;
  height: 600px;
  top: -120px;
  right: -160px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.36) 0%, rgba(99, 102, 241, 0) 70%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 100%);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 24px;
}

.container-narrow {
  max-width: 880px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 13, 26, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald), var(--indigo));
  color: #041016;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.32);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-accent {
  color: var(--emerald-bright);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 160ms ease;
}

.nav-link:hover {
  color: var(--emerald-bright);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.status-pill.is-online .status-dot {
  background: var(--emerald-bright);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.status-pill.is-offline .status-dot {
  background: var(--rose);
}

.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(99, 102, 241, 0.22));
  border: 1px solid var(--border-emerald);
  color: var(--text-primary);
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn-header:hover {
  transform: translateY(-1px);
  border-color: var(--emerald-bright);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.2);
}

/* Hero Section */
.hero-section {
  padding: 36px 0 64px;
}

.hero-intro {
  max-width: 820px;
  margin: 0 auto 28px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: var(--emerald-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-bright);
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.1vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.text-gradient {
  background: linear-gradient(95deg, var(--emerald-bright) 0%, #6ee7b7 42%, var(--indigo-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto;
  max-width: 700px;
  font-size: 16px;
  color: var(--text-secondary);
}

/* Glass Cards */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel-input,
.panel-output {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-caption {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.quota-pill {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-bright);
  font-size: 11.5px;
  font-weight: 600;
}

.quota-pill.is-pro {
  background: var(--indigo-soft);
  border-color: var(--border-indigo);
  color: #c7d2fe;
}

.quota-pill.is-low {
  background: var(--amber-soft);
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--amber);
}

/* Mode Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid var(--border-subtle);
}

.mode-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}

.mode-tab:hover {
  color: var(--text-primary);
}

.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(99, 102, 241, 0.22));
  border-color: rgba(16, 185, 129, 0.42);
  color: var(--text-primary);
}

/* 1-Click Sample Bar */
.sample-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.28);
}

.sample-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald-bright);
  letter-spacing: 0.01em;
}

.sample-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-sample {
  flex: 1 1 180px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.36);
  background: rgba(16, 185, 129, 0.12);
  color: #d1fae5;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 140ms ease, border-color 150ms ease;
}

.btn-sample:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--emerald-bright);
  transform: translateY(-1px);
}

.btn-sample-indigo {
  border-color: rgba(99, 102, 241, 0.44);
  background: rgba(99, 102, 241, 0.16);
  color: #e0e7ff;
}

.btn-sample-indigo:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: var(--indigo-bright);
}

/* Form Controls */
.analyze-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.field-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-control {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-control::placeholder {
  color: var(--text-dim);
}

.input-control:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.select-control {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
  cursor: pointer;
}

.textarea-control {
  resize: vertical;
  min-height: 168px;
  line-height: 1.5;
}

.field-hint {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--rose);
}

/* License Box */
.license-box {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid var(--border-subtle);
}

.license-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.license-tag.is-set {
  background: var(--indigo-soft);
  color: #c7d2fe;
}

.license-input-row {
  display: flex;
  gap: 8px;
}

.btn-subtle {
  flex-shrink: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.btn-subtle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Alert Banners */
.alert-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.alert-error {
  background: rgba(244, 63, 94, 0.13);
  border: 1px solid rgba(251, 113, 133, 0.48);
  color: #fecdd3;
}

.alert-warning {
  margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fef3c7;
}

.alert-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.alert-title {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alert-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.warning-list {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* Primary Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--emerald) 0%, #0d9488 52%, var(--indigo) 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-glow-emerald);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.34);
}

.btn-primary:disabled {
  opacity: 0.72;
  cursor: wait;
}

.btn-analyze {
  width: 100%;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 700ms linear infinite;
}

.btn-analyze.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Output Console: Empty & Loading */
.output-empty {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px;
}

.empty-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--indigo-soft);
  border: 1px solid var(--border-indigo);
  color: #c7d2fe;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.empty-desc {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.preview-card {
  padding: 15px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 26, 0.65);
  border: 1px solid var(--border-subtle);
}

.preview-num {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald-bright);
}

.preview-card h3 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.preview-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Loading Skeleton */
.output-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 4px;
}

.loading-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--emerald-bright);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald-bright);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.skeleton-bar,
.skeleton-block {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 25%, rgba(51, 65, 85, 0.7) 50%, rgba(30, 41, 59, 0.5) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-bar {
  height: 18px;
}

.skeleton-block {
  height: 96px;
}

.w-85 { width: 85%; }
.w-70 { width: 70%; }
.w-95 { width: 95%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Output Results */
.result-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-meta {
  min-width: 0;
}

.result-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.meta-chip-emerald {
  background: var(--emerald-soft);
  border-color: rgba(16, 185, 129, 0.36);
  color: var(--emerald-bright);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-export {
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(30, 41, 59, 0.72);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}

.btn-export:hover {
  border-color: var(--indigo-bright);
  background: rgba(99, 102, 241, 0.18);
}

.btn-export-accent {
  border-color: var(--border-emerald);
  background: var(--emerald-soft);
  color: #d1fae5;
}

.btn-export-accent:hover {
  border-color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.26);
}

/* Pain Severity Radar */
.radar-section {
  margin-bottom: 20px;
}

.section-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mini-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.pain-radar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pain-item {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 26, 0.72);
  border: 1px solid var(--border-subtle);
}

.pain-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pain-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pain-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.severity-badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.severity-high {
  background: var(--rose-soft);
  border: 1px solid rgba(251, 113, 133, 0.42);
  color: #fda4af;
}

.severity-medium {
  background: var(--amber-soft);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.severity-low {
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-bright);
}

.pain-metrics {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.pain-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  margin-bottom: 9px;
}

.pain-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--indigo));
  transition: width 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pain-bar-fill.is-high {
  background: linear-gradient(90deg, #f43f5e, #fb7185, #f59e0b);
}

.pain-quotes {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pain-quote {
  margin: 0;
  padding: 6px 10px;
  border-left: 2px solid rgba(16, 185, 129, 0.5);
  background: rgba(15, 23, 42, 0.58);
  border-radius: 0 7px 7px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-style: italic;
  overflow-wrap: anywhere;
}

/* Output Tabs */
.output-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid var(--border-subtle);
}

.out-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}

.out-tab:hover {
  color: var(--text-primary);
}

.out-tab.is-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(99, 102, 241, 0.22));
  border-color: var(--border-emerald);
  color: var(--text-primary);
}

.out-panel {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* Output Cards */
.kit-card {
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 26, 0.72);
  border: 1px solid var(--border-subtle);
  transition: border-color 150ms ease;
  min-width: 0;
}

.kit-card:hover {
  border-color: rgba(148, 163, 184, 0.3);
}

.kit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.kit-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--indigo-soft);
  color: #c7d2fe;
}

.tag-pill-emerald {
  background: var(--emerald-soft);
  color: var(--emerald-bright);
}

.btn-mini-copy {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-mini-copy:hover {
  border-color: var(--emerald-bright);
  color: var(--emerald-bright);
}

.hook-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* Script Scene Card */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.scene-col {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.scene-col-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald-bright);
}

.scene-col-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* Ad Copy Card */
.copy-headline {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.copy-body {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.copy-cta {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald-bright);
}

/* LP Hero Fix Card */
.lp-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 9px;
}

.lp-box {
  padding: 10px 12px;
  border-radius: 9px;
}

.lp-before {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.lp-after {
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.lp-box-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lp-before .lp-box-label {
  color: #fda4af;
}

.lp-after .lp-box-label {
  color: var(--emerald-bright);
}

.lp-box-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.lp-why {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* Sections */
.section-block {
  padding: 64px 0;
}

.section-head {
  max-width: 680px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--emerald-bright);
}

.section-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-sub {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  padding: 24px;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--emerald-soft);
  border: 1px solid var(--border-emerald);
  color: var(--emerald-bright);
  font-size: 13px;
  font-weight: 700;
}

.step-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.step-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Ecosystem Bridge Banner */
.ecosystem-wrap {
  padding: 20px 0 40px;
}

.ecosystem-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(15, 23, 42, 0.92) 50%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.36);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.55);
}

.ecosystem-copy {
  max-width: 720px;
}

.ecosystem-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-bright);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ecosystem-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ecosystem-desc {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.ecosystem-cta {
  flex-shrink: 0;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 22px;
}

.price-card-featured {
  border-color: var(--border-emerald);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.11) 0%, rgba(15, 23, 42, 0.9) 55%);
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.14), var(--shadow-card);
}

.featured-ribbon {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--indigo));
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.plan-name {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 10px 0 6px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-period {
  font-size: 13.5px;
  color: var(--text-muted);
}

.price-tagline {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--emerald-bright);
  font-weight: 500;
}

.price-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex-grow: 1;
}

.price-features li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.price-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--emerald-bright);
  font-weight: 700;
}

.btn-plan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(30, 41, 59, 0.72);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 150ms ease;
}

.btn-plan:hover {
  border-color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.16);
}

.btn-plan-full {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  padding: 18px 20px;
}

.faq-q {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: '+';
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--emerald-bright);
}

.faq-item[open] .faq-q::after {
  content: '−';
}

.faq-a {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(8, 13, 26, 0.65);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--emerald-bright);
}

.sr-copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  padding: 11px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-emerald);
  color: var(--emerald-bright);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.65);
  max-width: calc(100vw - 32px);
}

/* ==========================================================================
   Responsive Breakpoints (Zero horizontal overflow at 1440px, 768px, 390px)
   ========================================================================== */

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .steps-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ecosystem-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }

  .scene-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .header-inner {
    height: 60px;
    gap: 8px;
  }

  .brand-name {
    font-size: 16px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 10.5px;
    max-width: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-header {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hero-section {
    padding: 24px 0 44px;
  }

  .hero-subtitle {
    font-size: 14.5px;
  }

  .panel-input,
  .panel-output {
    padding: 16px;
  }

  .meta-grid,
  .preview-grid,
  .lp-compare,
  .pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .output-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-block {
    padding: 46px 0;
  }

  .export-actions {
    width: 100%;
  }

  .btn-export {
    flex: 1 1 auto;
    text-align: center;
  }

  .ecosystem-cta,
  .ecosystem-cta .btn-primary {
    width: 100%;
  }
}
