:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #0f172a;
  --border: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --safe: #10b981;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(circle at top right, #111c33 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(9, 13, 22, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

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

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  color: var(--muted);
  font-size: 0.82rem;
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.hero {
  padding: 36px 0 20px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 1.02rem;
}

.workbench {
  margin-top: 20px;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.preset-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #052e16;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ecfdf5;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: #334155;
}

.btn-chip {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-chip.active,
.btn-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.alert-error {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.editor-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.panel-header h2,
.panel-header label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-neutral {
  background: #1e293b;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 260px;
  background: #060a12;
  color: #e2e8f0;
  border: 0;
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

textarea:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.risk-pill,
.stat-pill {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.risk-high {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.risk-medium {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.risk-low {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.stat-breaking {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

.stat-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.stat-safe {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.table-wrap {
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.diff-table th,
.diff-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.diff-table th {
  color: var(--muted);
  font-weight: 600;
  background: #0b1120;
  position: sticky;
  top: 0;
}

.path-cell {
  font-family: var(--mono);
  color: #bae6fd;
  word-break: break-word;
}

.sev-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sev-BREAKING {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
}

.sev-WARNING {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.sev-SAFE {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: #1e293b;
  color: var(--text);
  border-color: var(--accent);
}

.code-block {
  margin: 0;
  padding: 14px;
  background: #060a12;
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  min-height: 290px;
  max-height: 360px;
  overflow: auto;
  flex: 1;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.copy-feedback {
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: auto;
}

.pro-section {
  margin: 28px 0 42px;
}

.pro-card {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  background: linear-gradient(145deg, #111827 0%, #0b1220 100%);
  border: 1px solid #26354d;
  border-radius: 16px;
  padding: 26px;
}

.pro-info h2 {
  margin: 0 0 10px;
  font-size: 1.65rem;
}

.pro-desc {
  color: var(--muted);
  margin: 0 0 16px;
}

.pro-features {
  margin: 0 0 20px;
  padding-left: 18px;
  color: #cbd5e1;
}

.pro-features li {
  margin-bottom: 8px;
}

.pro-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.guarantee-note {
  font-size: 0.82rem;
  color: var(--muted);
}

.pro-form-box {
  background: #060a12;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.pro-form-box h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.form-sub {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.lead-form input,
.lead-form select {
  width: 100%;
  background: #0f172a;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.lead-status {
  margin: 4px 0 0;
  font-size: 0.84rem;
  min-height: 20px;
}

.lead-status.ok {
  color: var(--accent);
}

.lead-status.err {
  color: #fda4af;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  .editor-grid,
  .results-grid,
  .pro-card {
    grid-template-columns: 1fr;
  }

  .brand-tag {
    display: none;
  }
}
