:root {
  --bg: #0b0e14;
  --card: #12161f;
  --card-border: #1f2533;
  --text: #e6e9f0;
  --muted: #8a92a8;
  --accent: #f59e0b;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 42px; line-height: 1; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
}
.input-card { margin-bottom: 20px; }

.input-row {
  display: flex;
  gap: 10px;
}
input#domain {
  flex: 1;
  background: #0b0e14;
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 18px;
  padding: 14px 18px;
  border-radius: 10px;
  outline: none;
}
input#domain:focus { border-color: var(--accent); }
button {
  background: var(--accent);
  color: #111;
  border: none;
  font-weight: 700;
  font-size: 15px;
  padding: 0 26px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .05s ease, opacity .2s;
}
button:hover { opacity: .92; }
button:active { transform: translateY(1px); }

.examples {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.examples .ex {
  background: transparent;
  color: var(--accent);
  border: 1px solid #2a3142;
  font-size: 12px;
  padding: 3px 9px;
  margin-left: 6px;
  border-radius: 999px;
}

#results { margin-top: 10px; }
.hidden { display: none; }

.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.domain-name { font-size: 22px; font-weight: 600; }
.timestamp { font-size: 12px; color: var(--muted); }

.grade-wrap { display: flex; align-items: center; gap: 12px; text-align: right; }
.grade-badge {
  width: 68px; height: 68px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  border: 5px solid #222a38;
}
.grade-badge.A { background: #052e16; color: var(--green); border-color: #166534; }
.grade-badge.B { background: #1a2e05; color: #84cc16; border-color: #4d7c0f; }
.grade-badge.C { background: #3f2a05; color: var(--yellow); border-color: #854d0e; }
.grade-badge.D { background: #3f1f05; color: #fb923c; border-color: #9a3412; }
.grade-badge.F { background: #3f0505; color: var(--red); border-color: #991b1b; }
.score { font-size: 13px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.result-card {
  background: #0f131c;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
}
.result-card h3 { margin: 0 0 10px; font-size: 15px; color: #a3adbf; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.status-pill {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .5px;
}
.status-pill.pass { background: #052e16; color: var(--green); }
.status-pill.warn { background: #3f2a05; color: var(--yellow); }
.status-pill.fail { background: #3f0505; color: var(--red); }

.record {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #0b0e14;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  word-break: break-all;
  color: #c3c9d6;
  min-height: 42px;
  margin: 8px 0;
}
.meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.issues { list-style: none; margin: 0; padding: 0; }
.issues li {
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid #1f2533;
}
.issues li:first-child { border-top: none; }
.issues li.issue { color: #fca5a5; }
.issues li.warn { color: #fde047; }

.mx-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.mx-list li {
  padding: 4px 0;
  font-family: ui-monospace, monospace;
  display: flex;
  gap: 10px;
}
.mx-list .prio { color: var(--muted); width: 32px; flex-shrink: 0; }

.summary {
  margin-top: 18px;
  padding: 14px 16px;
  background: #0f131c;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  font-size: 14px;
}
.summary .label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}
.actions button {
  background: #1f2533;
  color: var(--text);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
}

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .input-row { flex-direction: column; }
  button[type="submit"] { padding: 14px; }
}
