:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-header {
  padding: 28px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.app-header p { margin: 0; color: var(--muted); }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) 300px;
  gap: 20px;
  padding: 20px;
}

.controls, .reader-section, .metadata {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.control-group { margin-bottom: 14px; }

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}

select, button {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: white;
  color: var(--text);
  font-size: 14px;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 700;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.reader {
  max-width: 840px;
  line-height: 1.65;
}

.reader h1 { font-size: 30px; margin-top: 0; }
.reader h2 { margin-top: 28px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.reader code { background: #f1f5f9; padding: 2px 5px; border-radius: 5px; }
.reader pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
}
.reader blockquote {
  margin: 18px 0;
  padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: #eff6ff;
}
.empty-state { color: var(--muted); }

.metadata h2 { margin-top: 0; font-size: 20px; }
.metadata dt { font-weight: 700; margin-top: 14px; }
.metadata dd { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
}
