:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #5d00b7;
  --primary-dark: #49008f;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(93, 0, 183, .08), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(93, 0, 183, .05), transparent 25%),
    var(--bg);
}

button, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 28px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8200ff);
  box-shadow: 0 12px 28px rgba(93, 0, 183, .25);
  font: 800 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(15,23,42,.04);
  backdrop-filter: blur(12px);
}

.toolbar-group { display: flex; align-items: center; gap: 8px; }

.btn {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: .2s ease;
}

.btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15,23,42,.07);
}

.btn-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); }

.indent-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  min-height: 42px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}

select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(93,0,183,.1); }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.panel-header, .panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
}

.panel-header { border-bottom: 1px solid var(--border); }
.panel-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }

.panel-title { font-size: 13px; font-weight: 800; }
.file-badge {
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--primary);
  background: rgba(93,0,183,.08);
  font: 700 10px ui-monospace, monospace;
}

.sample-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.sample-btn:hover { text-decoration: underline; }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: #94a3b8;
  vertical-align: middle;
}

.status-dot.valid { background: var(--success); }
.status-dot.invalid { background: var(--danger); }
.status-text { color: var(--muted); font-size: 11px; }

.editor-wrap { position: relative; height: 580px; background: #0b1020; }

textarea, pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px;
  border: 0;
  outline: 0;
  resize: none;
  overflow: auto;
  color: #dbeafe;
  background: #0b1020;
  font: 13px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 2;
}

textarea::placeholder { color: #64748b; }
pre { white-space: pre; }

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px;
  color: #64748b;
  text-align: center;
  pointer-events: none;
}

.empty-state strong { color: #cbd5e1; font-size: 14px; }
.empty-state span { font-size: 12px; }
.empty-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border: 1px solid #27324a;
  border-radius: 12px;
  color: #94a3b8;
  font: 700 14px ui-monospace, monospace;
}

.message {
  min-height: 22px;
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.message.success { color: var(--success); }
.message.error { color: var(--danger); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  color: #94a3b8;
  font-size: 11px;
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .editor-wrap { height: 430px; }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 1400px); padding-top: 30px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { flex-wrap: wrap; }
  .toolbar-right { justify-content: flex-start; }
  .indent-control { margin-right: auto; }
}

@media (max-width: 480px) {
  .hero { align-items: flex-start; }
  .brand-mark { width: 50px; height: 50px; flex-basis: 50px; border-radius: 13px; }
  .subtitle { font-size: 13px; }
  .toolbar-group { width: 100%; }
  .btn { flex: 1; }
  .indent-control { width: 100%; justify-content: space-between; }
  .indent-control select { flex: 1; }
  .panel-header { padding: 12px; }
  textarea, pre { padding: 16px; font-size: 12px; }
  .footer { flex-direction: column; gap: 5px; }
}
