:root {
  --bg: #15130f;
  --panel: #211d17;
  --panel-2: #2a241d;
  --text: #f4eadc;
  --muted: #c7b9a5;
  --line: #40382d;
  --accent: #e7decc;
  --accent-dark: #746a5a;
  --danger: #d98b72;
  --shadow: 0 18px 60px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #30281f 0, var(--bg) 42%);
  color: var(--text);
}
.topbar, footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}
h1 { margin: 4px 0 8px; font-size: clamp(32px, 5vw, 56px); letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 15px; letter-spacing: .02em; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; font-size: 12px; letter-spacing: .18em; }
.tagline { margin: 0; color: var(--muted); font-size: 16px; }
.brand-card { background: rgba(231,222,204,.08); border: 1px solid var(--line); padding: 16px; border-radius: 20px; min-width: 220px; }
.brand-card strong, .brand-card span { display: block; }
.brand-card span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 0 24px 28px; display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.panel { background: rgba(33,29,23,.92); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.sidebar { padding: 16px; display: flex; flex-direction: column; gap: 18px; height: fit-content; position: sticky; top: 16px; }
.drop-zone { border: 1px dashed var(--accent-dark); border-radius: 18px; padding: 18px; text-align: center; background: rgba(231,222,204,.04); }
.drop-zone.dragover { border-color: var(--accent); background: rgba(231,222,204,.11); }
.drop-zone p { color: var(--muted); margin: 10px 0 0; font-size: 13px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
button, input, textarea { font: inherit; }
button {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  cursor: pointer;
  margin: 4px 0;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #211d17; font-weight: 800; }
button.accent { border-color: var(--accent); }
button.ghost { width: auto; padding: 7px 10px; background: transparent; }
button.small { font-size: 12px; }
input {
  width: 100%; border: 1px solid var(--line); background: #17140f; color: var(--text); padding: 10px 12px; border-radius: 12px;
}
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.split-grid { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: center; }
.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.file-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; word-break: break-word; }
.file-list li.active { color: #211d17; background: var(--accent); border-color: var(--accent); }
.workspace { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.toolbar { padding: 14px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 14px; align-items: end; }
.stats { color: var(--muted); white-space: nowrap; padding-bottom: 10px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; min-height: 56vh; }
.editor-panel, .preview-panel, .output-panel { padding: 16px; }
textarea { width: 100%; height: calc(56vh - 58px); resize: vertical; border: 1px solid var(--line); background: #110f0c; color: var(--text); border-radius: 16px; padding: 16px; line-height: 1.6; }
.preview { height: calc(56vh - 58px); overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #f8f3ea; color: #19140f; line-height: 1.7; }
.preview h1, .preview h2, .preview h3 { letter-spacing: -0.02em; }
.preview code { background: #eee2d1; padding: 2px 5px; border-radius: 5px; }
.preview pre { background: #211d17; color: #f4eadc; padding: 12px; border-radius: 12px; overflow: auto; }
.output-panel pre { white-space: pre-wrap; color: var(--muted); margin: 0; max-height: 220px; overflow: auto; }
footer { color: var(--muted); font-size: 13px; }
@media (max-width: 980px) {
  .topbar, .app-shell { display: block; }
  .brand-card { margin-top: 18px; }
  .sidebar { position: static; margin-bottom: 18px; }
  .toolbar, .editor-grid { grid-template-columns: 1fr; }
  .stats { padding-bottom: 0; }
}
