:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --fg: #171a1f;
  --muted: #657083;
  --panel: #ffffff;
  --border: #cbd3df;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --fg: #f2f4f7;
    --muted: #a5adba;
    --panel: #1b1f26;
    --border: #3a4351;
    --accent: #2dd4bf;
    --accent-dark: #14b8a6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.shell {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 2rem; }
h2 { font-size: 1.1rem; }
p, footer { color: var(--muted); }

.health {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

input[readonly], textarea[readonly] {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

button, .fileButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover, .fileButton:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.fileButton input { display: none; }

.final {
  justify-content: flex-end;
}

footer {
  padding-top: 8px;
  font-size: 0.85rem;
}

.errorText {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 700px) {
  .grid.two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions.final { justify-content: stretch; }
  .actions.final button { width: 100%; }
}

