:root {
  color-scheme: light;
  --ink: #1f2523;
  --muted: #64706a;
  --paper: #f7f4ee;
  --surface: #ffffff;
  --line: rgba(31, 37, 35, 0.16);
  --accent: #d9482f;
  --accent-dark: #a83222;
  --ok: #1f7a4d;
  --warn: #9a6a00;
  --bad: #b23a2e;
}

* {
  box-sizing: border-box;
}

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

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
}

.origin-badge {
  font-size: 0.85rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 1.2fr);
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: start;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.panel h1 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.field {
  display: block;
  margin-bottom: 0.85rem;
}

.field > span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--paper);
}

.field textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.checks {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
}

.checks legend {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.3rem;
}

.checks label {
  display: block;
  font-size: 0.85rem;
  margin: 0.35rem 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button.ghost {
  background: transparent;
  color: var(--accent-dark);
}

.log {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 75vh;
  overflow-y: auto;
}

.log .empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.result {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.result-head .diag {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #fff;
}

.diag.ok { background: var(--ok); }
.diag.bad { background: var(--bad); }
.diag.unknown { background: var(--muted); }

.warnings {
  margin: 0;
  padding: 0.5rem 0.8rem;
  list-style: none;
  background: #fff8e8;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.warnings li {
  font-size: 0.82rem;
  color: var(--warn);
  margin: 0.2rem 0;
}

.result-body {
  margin: 0;
  padding: 0.7rem 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--paper);
}
