:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --border: #d9dce1;
  --accent: #2563eb;
  --ok-bg: #e6f6ea;
  --ok-text: #146c2e;
  --mismatch-bg: #fdecec;
  --mismatch-text: #a3241c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card-bg: #1e2126;
    --text: #e8e9ec;
    --border: #33373d;
    --ok-bg: #16351f;
    --ok-text: #7fd99a;
    --mismatch-bg: #3a1c1a;
    --mismatch-text: #f4a29c;
  }
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 600; }
.topbar nav a { margin-left: 1rem; color: var(--accent); text-decoration: none; }

.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.row { display: flex; gap: 1rem; }
.row > label { flex: 1; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  font-size: 0.95rem;
}
button:hover { opacity: 0.9; }

.hint { color: #8a8f98; font-size: 0.85rem; }

.flash { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-error { background: var(--mismatch-bg); color: var(--mismatch-text); }
.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-info { background: #eef2ff; color: #1e3a8a; }

table.cmp-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
table.cmp-table th, table.cmp-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.9rem;
}
tr.row-ok { background: var(--ok-bg); color: var(--ok-text); }
tr.row-mismatch { background: var(--mismatch-bg); color: var(--mismatch-text); }

.logbox {
  margin-top: 2rem;
  background: #0d0f12;
  color: #c9d1d9;
  border-radius: 8px;
  padding: 1rem;
}
.logbox pre {
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.8rem;
  margin: 0;
}
