:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f0f4f9;
  --viewport: #0d131f;
  --border: #d8e1ec;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0f62fe;
  --accent-hover: #0043ce;
  --accent-soft: #e8f0fe;
  --good: #0f766e;
  --good-bg: #e6f7f5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #be123c;
  --bad-bg: #ffe4e6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header & Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0f62fe, #06b6d4);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
.nav a:hover, .nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.nav a.pro-pill {
  background: var(--text);
  color: #fff;
  font-weight: 600;
}
.nav a.pro-pill:hover {
  background: var(--accent);
}

/* Layout */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* Hero Compact Strip */
.hero-compact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-compact h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.hero-sub {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  font-size: 14.5px;
}
.trust-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.badge.good { background: var(--good-bg); border-color: #99f6e4; color: var(--good); }
.badge.warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.badge.bad { background: var(--bad-bg); border-color: #fecdd3; color: var(--bad); }

/* Workbench Grid */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .workbench { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Viewport & Dropzone */
.viewport-shell {
  position: relative;
  background: var(--viewport);
  min-height: 460px;
  display: flex;
  flex-direction: column;
}
.viewport-canvas {
  width: 100%;
  height: 460px;
  display: block;
}
.svg-preview-box {
  display: none;
  width: 100%;
  height: 460px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.svg-preview-box.active { display: flex; }
.svg-preview-box svg { max-width: 100%; max-height: 100%; }

.drop-overlay {
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  border-radius: 10px;
  background: rgba(13, 19, 31, 0.88);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.drop-overlay.hidden { display: none; }
.drop-overlay.dragover {
  border-color: #38bdf8;
  background: rgba(15, 98, 254, 0.2);
}
.drop-title { font-size: 18px; font-weight: 700; color: #fff; margin: 0; }
.drop-hint { font-size: 13.5px; color: #94a3b8; margin: 0; max-width: 440px; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.viewport-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 13px;
}
.file-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat-cell {
  background: var(--surface);
  padding: 10px 12px;
}
.stat-k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-v { font-family: var(--mono); font-size: 13.5px; font-weight: 700; margin-top: 2px; color: var(--text); }

/* Controls Panel */
.panel { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.panel-section h2 {
  margin: 0 0 10px;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.one { grid-template-columns: 1fr; }
label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font: 13.5px var(--mono);
  color: var(--text);
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin: 6px 0;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: 600 13.5px var(--font);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); border-color: #94a3b8; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.btn.dark:hover { background: #1e293b; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.full { width: 100%; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.status-banner {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.status-banner.good { background: var(--good-bg); border-color: #99f6e4; color: var(--good); }
.status-banner.warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.status-banner.bad { background: var(--bad-bg); border-color: #fecdd3; color: var(--bad); }

/* Pro Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 760px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  max-height: 92vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 720px) {
  .pricing-grid { grid-template-columns: 1fr; }
}
.plan {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}
.plan.featured {
  border: 2px solid var(--accent);
  background: #f8fbff;
}
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.plan-price span { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan ul { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; color: var(--muted); }
.plan li { margin: 4px 0; }

/* Editorial SEO Content Sections */
.editorial {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.doc-card h2 {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.doc-card h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}
.doc-card p, .doc-card li { color: #334155; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.spec-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
}
.faq-list details {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.faq-list p { margin: 8px 0 0; font-size: 14px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
