:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2430;
  --muted: #98a2b3;
  --text: #eef2f7;
  --accent: #86b7ff;
  --accent-2: #2d6cdf;
  --danger: #ff7a7a;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(68, 110, 199, 0.18), transparent 28%),
    linear-gradient(180deg, #0c0f14 0%, var(--bg) 100%);
  color: var(--text);
}

code {
  font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent-2);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #3b7ef5;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea {
  width: 100%;
  min-height: 62vh;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--text);
  padding: 1rem;
  line-height: 1.5;
  tab-size: 4;
}

.app-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  gap: 16px;
  grid-template-columns: 2fr 1fr;
  align-items: start;
}

.hero h1,
.panel h2,
.panel h3,
.panel p {
  margin-top: 0;
}

.hero-note {
  padding: 16px;
  border-radius: 16px;
  background: rgba(134, 183, 255, 0.08);
  border: 1px solid rgba(134, 183, 255, 0.18);
  color: #dce8ff;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.lede {
  color: var(--muted);
  max-width: 68ch;
}

.controls {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.file-picker input {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.status-badge {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.9rem;
}

.editor-stats {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.meta-list div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.meta-list dt {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.meta-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.validation-block {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.issues-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}

.issues-list li.warn {
  color: #ffd58a;
}

.issues-list li.ok {
  color: #9cffb3;
}

.issues-list li.error {
  color: var(--danger);
}

.xml-preview-wrap {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 14px;
}

.xml-preview-wrap pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #0c0f14;
  border: 1px solid var(--border);
}

.notes ul {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .hero,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 52vh;
  }
}
