:root {
  --bg: #000000;
  --bg-alt: #131313;
  --panel: #0d0d0d;
  --border: #262626;
  --border-strong: #3d3d3d;
  --text: #f2f2f2;
  --muted: #969696;
  --accent: #ffffff;
  --accent-contrast: #000000;
  --danger: #ff6b5e;
  --ok: #4ade80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 10px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 20px rgba(255, 255, 255, 0.05);
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
nav.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
nav.topnav .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  margin-right: 20px;
  letter-spacing: -0.01em;
}
nav.topnav .brand span { color: var(--muted); font-weight: 400; }
nav.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
nav.topnav a:hover { color: var(--text); background: var(--bg-alt); }
nav.topnav a.active { color: var(--accent-contrast); background: var(--accent); }
header.hero {
  padding: 28px 32px 14px;
  max-width: 960px;
  margin: 0 auto;
}
header.hero h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 700;
}
header.hero h1 span { color: var(--muted); font-weight: 400; }
header.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}
main > .panel + .panel { margin-top: 16px; }
main.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.card h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card p { margin: 0; color: var(--muted); font-size: 13px; }
section.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
section.panel h2 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}
details.panel {
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.panel summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 16px 22px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  align-items: center;
}
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: var(--muted);
  transition: transform .15s;
}
details.panel:hover summary,
details.panel[open] summary { color: var(--text); }
details.panel[open] summary::before { transform: rotate(90deg); }
details.panel[open] summary { border-bottom: 1px solid var(--border); }
details.panel .details-body { padding: 16px 22px 20px; }
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}
.field { flex: 1 1 220px; min-width: 160px; }
input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color .15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-contrast);
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
button:active { transform: translateY(0); opacity: 0.85; }
button:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.result {
  margin-top: 16px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  font-size: 13px;
  font-family: var(--mono);
  white-space: pre-wrap;
}
.result:empty { display: none; }
.match {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.match:last-child { border-bottom: none; }
.match .name { color: var(--text); font-weight: 700; }
.match .conf { color: var(--muted); margin-left: 8px; }
.match .detail { color: var(--muted); display: block; margin-top: 2px; }
.status-ok { color: var(--ok); font-weight: 600; }
.status-bad { color: var(--danger); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}
.copy-btn:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-strong); opacity: 1; }
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
  transition: color .15s;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { color: var(--text); font-weight: 600; }
.history-item .ts { color: var(--muted); white-space: nowrap; }
