:root {
  --bg: #07111f;
  --panel: rgba(12, 22, 39, 0.82);
  --text: #ebf3ff;
  --muted: #92a4bf;
  --line: rgba(146, 164, 191, 0.16);
  --accent: #73e0ff;
  --accent-2: #7c8cff;
  --danger: #ff8ca1;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #10284a 0%, var(--bg) 40%, #030712 100%);
}
body {
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
textarea, button, select, input { font: inherit; }
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black, transparent 85%);
  pointer-events: none;
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.55;
}
.orb-a {
  width: 280px;
  height: 280px;
  top: 8%;
  left: 8%;
  background: rgba(115,224,255,0.16);
}
.orb-b {
  width: 340px;
  height: 340px;
  right: 4%;
  top: 20%;
  background: rgba(124,140,255,0.18);
}
.shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.back, .badge {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
  padding: 10px 14px;
}
.badge {
  letter-spacing: 0.14em;
  color: var(--accent);
  font-size: 12px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero {
  padding: 32px;
  margin-bottom: 18px;
}
.eyebrow {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}
h1 {
  margin: 14px 0 16px;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 1;
}
.subtitle {
  color: var(--muted);
  max-width: 860px;
  line-height: 1.8;
  font-size: 17px;
}
.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 18px;
}
.editor-card, .preview-card {
  padding: 24px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2, .theme-head h3 {
  margin: 0;
}
.head-actions, .theme-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mini-btn, .back {
  transition: transform .2s ease, border-color .2s ease;
}
.mini-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.mini-btn:hover, .back:hover {
  transform: translateY(-1px);
  border-color: rgba(115,224,255,0.35);
}
textarea {
  width: 100%;
  min-height: 620px;
  resize: vertical;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.72);
  color: var(--text);
  padding: 18px;
  line-height: 1.7;
  font-family: "SFMono-Regular", "Consolas", monospace;
  font-size: 14px;
}
textarea::placeholder {
  color: #7890b1;
}
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.theme-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.02);
}
.theme-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.theme-mode-label, .theme-grid label {
  color: var(--muted);
  font-size: 14px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.theme-grid label {
  display: grid;
  gap: 8px;
}
select, input[type="color"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 10, 20, 0.72);
  color: var(--text);
  min-height: 42px;
  padding: 8px 10px;
}
input[type="color"] {
  padding: 4px;
}
.error-box {
  border: 1px solid rgba(255, 140, 161, 0.26);
  color: #ffd8df;
  background: rgba(255, 140, 161, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.preview-area {
  min-height: 620px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.72);
  padding: 18px;
  overflow: auto;
}
.empty-state {
  min-height: 580px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.preview-area svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  textarea, .preview-area {
    min-height: 420px;
  }
  .empty-state {
    min-height: 380px;
  }
}
@media (max-width: 640px) {
  body {
    padding: 16px;
  }
  .topbar, .theme-head, .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero, .editor-card, .preview-card {
    padding: 20px;
  }
  .theme-grid {
    grid-template-columns: 1fr;
  }
}
