:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #16213e;
  --muted: #5a6a85;
  --line: #e2e8f2;
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --green: #16a34a;
  --green-bg: #eafaf0;
  --red: #dc2626;
  --red-bg: #fdecec;
  --amber: #b45309;
  --amber-bg: #fef7e6;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(22, 33, 62, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 10% -5%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(500px 300px at 95% 5%, rgba(22, 163, 74, 0.08), transparent 60%);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── Header ─────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0b6bcb;
  white-space: nowrap;
  border: 1px solid #d6e9ff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e6ebf7;
  color: var(--muted);
  white-space: nowrap;
}

.badge.live {
  background: var(--green-bg);
  color: var(--green);
}

.badge.demo {
  background: var(--amber-bg);
  color: var(--amber);
}

/* ── Card & form ────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.label em.opt {
  font-style: italic;
  font-weight: 400;
  color: #94a3b8;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border 0.15s, box-shadow 0.15s;
}

/* ── Combobox (searchable) ───────────────────── */
.cbx {
  position: relative;
}

.cbx-input {
  width: 100%;
  padding: 12px 32px 12px 14px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border 0.15s, box-shadow 0.15s;
}

.cbx::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 13px;
}

.cbx-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cbx-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 4px;
}

.cbx-list li {
  padding: 9px 10px;
  font-size: 13.5px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cbx-list li.active,
.cbx-list li:hover {
  background: #eef2fb;
}

.cbx-list li.cbx-empty {
  color: #94a3b8;
  cursor: default;
  background: transparent;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hint {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 180px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-ink);
}

.btn-ghost {
  background: #eef2fb;
  color: var(--brand-ink);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: #e3e9f8;
}

/* ── Result ─────────────────────────────── */
.result {
  margin-top: 20px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfcff;
  animation: pop 0.18s ease;
}

.result h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 16px;
}

.result h3 svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.result-detail {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  background: #f3f6fc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checks li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
}

.checks svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.checks svg.ok {
  color: var(--green);
}

.checks svg.bad {
  color: var(--red);
}

.result.valid {
  border-color: #bbe6cd;
  background: var(--green-bg);
}

.result.valid h3 {
  color: var(--green);
}

.result.invalid {
  border-color: #f5c2c2;
  background: var(--red-bg);
}

.result.invalid h3 {
  color: var(--red);
}

.result.unknown {
  border-color: #f0d9a8;
  background: var(--amber-bg);
}

.result.unknown h3 {
  color: var(--amber);
}

.notice {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 8px 10px;
}

.score {
  font-weight: 700;
}

/* ── Footer ─────────────────────────────── */
footer {
  margin-top: 30px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
