/* Mobile-first. One stylesheet, no framework. */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16191d;
  --muted: #5f6874;
  --border: #d9dde3;
  --accent: #1f4fd8;
  --accent-text: #ffffff;
  --error: #b3261e;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1c2026;
    --text: #e9ecf1;
    --muted: #9aa4b2;
    --border: #303740;
    --accent: #6f95ff;
    --accent-text: #0d1014;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

/* Our .button and button rules set display, so [hidden] needs to win outright. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; color: inherit; text-decoration: none; }

.card,
.wide {
  margin: 1rem auto;
  padding: 1.25rem;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wide { max-width: 60rem; }

.centered {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

h1 { margin-top: 0; font-size: 1.4rem; }
h2 { font-size: 1.05rem; margin-bottom: 0.25rem; }

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

input {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.25rem;
  font-size: 16px; /* stops iOS from zooming on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

button,
.button {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  font: inherit;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.primary { background: var(--accent); color: var(--accent-text); }
.secondary { background: transparent; color: var(--text); border-color: var(--border); }

.link {
  width: auto;
  margin: 0;
  padding: 0.25rem 0;
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
}

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

.panel { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.muted { color: var(--muted); font-size: 0.9rem; }

.status { min-height: 1.5rem; margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--muted); }
.status.error { color: var(--error); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
