*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafafa;
  --surface: #fff;
  --border: #d0d0d0;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --success: #1a7f37;
  --error: #cf222e;
  --warn: #9a6700;
  --radius: 6px;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --success: #3fb950;
    --error: #f85149;
    --warn: #d29922;
  }
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .editor {
    grid-template-columns: 1fr;
  }
}

.panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

textarea {
  width: 100%;
  height: 28rem;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  tab-size: 2;
}

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

button {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  transition: background 0.1s;
}

button:hover:not(:disabled) {
  background: var(--bg);
}

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

#upgrade {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#upgrade:hover:not(:disabled) {
  background: var(--accent-hover);
}

.status {
  margin-top: 1rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  line-height: 1.7;
}

.status .ok { color: var(--success); }
.status .err { color: var(--error); }
.status .skip { color: var(--warn); }
.status .summary { margin-bottom: 0.375rem; font-weight: 600; }

footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
}
