:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d9deea;
  --primary: #5b2d8e;
  --primary-dark: #44206c;
  --accent: #00c8e0;
  --danger: #b42318;
}

* { 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 right, rgba(0, 200, 224, 0.16), transparent 28%), var(--bg);
  color: var(--text);
}
.container { max-width: 1040px; margin: 0 auto; padding: 48px 20px; }
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fff, #f4effa);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(23, 32, 51, 0.08);
}
.eyebrow { margin: 0 0 8px; color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; max-width: 780px; }
.subtitle { color: var(--muted); font-size: 18px; max-width: 680px; }
.dropzone {
  margin-top: 26px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: 28px;
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: .2s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 20px 60px rgba(91, 45, 142, .10); }
.drop-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 22px; background: rgba(91, 45, 142, .10); color: var(--primary); display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.dropzone h2 { margin: 0; font-size: 26px; }
.dropzone p, .dropzone small { color: var(--muted); }
.status-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#status { color: var(--muted); overflow-wrap: anywhere; }
button, .download {
  border: 0;
  border-radius: 15px;
  padding: 13px 18px;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .download:hover { background: var(--primary-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.result {
  margin-top: 24px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 28px;
  overflow: hidden;
}
.result-header { padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.result-header h2 { margin: 0; }
#markdownPreview {
  width: 100%;
  min-height: 520px;
  padding: 22px;
  border: 0;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
  outline: none;
}
.hidden { display: none; }
.error { color: var(--danger) !important; }
@media (max-width: 720px) {
  .status-card, .result-header { flex-direction: column; align-items: stretch; }
  button, .download { width: 100%; text-align: center; }
}
