:root {
  --bg: #070b10;
  --bg-2: #0b0f14;
  --panel: rgba(13, 18, 24, 0.85);
  --panel-border: rgba(52, 216, 196, 0.18);
  --accent: #34d8c4;
  --accent-dim: #1f8a7d;
  --neon: #ff3d7f;
  --warn: #ffb454;
  --text: #d7e6e6;
  --text-muted: #6f8a93;
  --row-hover: rgba(52, 216, 196, 0.06);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: 80px; }
html, body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.55; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(52, 216, 196, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 61, 127, 0.06), transparent 60%),
    var(--bg);
}

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(7, 11, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand-text h1 { font-size: 1.05rem; letter-spacing: 0.04em; font-weight: 700; }
.brand-text .tagline { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }
.back-link { margin-left: auto; color: var(--text-muted); text-decoration: none; font-size: 0.8rem; font-family: var(--mono); }
.back-link:hover { color: var(--accent); }
.status { font-size: 0.75rem; font-family: var(--mono); color: var(--accent); padding: 4px 10px; border: 1px solid var(--panel-border); border-radius: 999px; white-space: nowrap; }
.status.busy { color: var(--warn); border-color: rgba(255, 180, 84, 0.4); }
.status.error { color: var(--neon); border-color: rgba(255, 61, 127, 0.4); }

/* layout */
.layout {
  max-width: 1320px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start;
}
@media (max-width: 920px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 18px;
}
.panel-title { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; font-family: var(--mono); }
.hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.footnote { font-size: 0.72rem; color: var(--text-muted); margin-top: 12px; }
.footnote.small { margin-top: 14px; }

textarea {
  width: 100%; min-height: 150px; resize: vertical;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 12px; font-family: var(--mono); font-size: 0.85rem;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52, 216, 196, 0.12); }

.input-actions { display: flex; gap: 8px; margin-top: 10px; }
.run-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.conc { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); font-family: var(--mono); }
.conc select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 8px; padding: 6px 8px; font-family: var(--mono); font-size: 0.8rem;
}
.run-row .btn.primary { margin-left: auto; }

.btn {
  cursor: pointer; border: 1px solid var(--panel-border); border-radius: 9px;
  background: transparent; color: var(--text); padding: 9px 16px; font-size: 0.82rem;
  font-family: var(--sans); transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #04151a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #4deedb; color: #04151a; }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; font-size: 0.74rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.badge {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.03em;
  padding: 3px 7px; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap;
}
.badge.b-ok { color: var(--accent); }
.badge.b-nx { color: var(--neon); }
.badge.b-park { color: var(--warn); }
.badge.b-tls { color: var(--warn); }
.badge.b-redir { color: #6aa9ff; }
.badge.b-ip { color: #c98bff; }
.badge.b-err { color: var(--neon); }

/* results */
.results-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.progress-wrap { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--panel-border); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 0.25s; }
.progress-text { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.export-actions { display: flex; gap: 8px; }

.table-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--panel-border); }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 1080px; }
.results-table th, .results-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(52, 216, 196, 0.08); }
.results-table th { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); background: rgba(11, 15, 20, 0.6); position: sticky; top: 0; }
/* 列幅の目安 */
.results-table th:nth-child(1), .results-table td:nth-child(1) { min-width: 150px; width: 150px; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 116px; min-width: 100px; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { min-width: 190px; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { min-width: 190px; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { min-width: 160px; }
.results-table th:nth-child(6), .results-table td:nth-child(6) { min-width: 170px; }
.results-table th:nth-child(7), .results-table td:nth-child(7) { width: 130px; min-width: 110px; }
.results-table th:nth-child(8), .results-table td:nth-child(8) { width: 64px; min-width: 56px; }
.results-table tbody tr:hover { background: var(--row-hover); }
.results-table tbody tr.empty-row td { text-align: center; color: var(--text-muted); padding: 28px; }
.results-table tbody tr.new td { animation: flash 0.6s ease; }
@keyframes flash { from { background: rgba(52, 216, 196, 0.16); } to { background: transparent; } }

.cell-domain { font-family: var(--mono); font-weight: 600; color: var(--accent); overflow-wrap: anywhere; word-break: normal; }
.cell-mono { font-family: var(--mono); font-size: 0.74rem; color: var(--text-muted); overflow-wrap: anywhere; word-break: normal; }
.cell-muted { color: var(--text-muted); font-size: 0.76rem; }
.row-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ms { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
a.ext { color: #6aa9ff; text-decoration: none; }
a.ext:hover { text-decoration: underline; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: 10px; font-size: 0.82rem; font-family: var(--mono);
  opacity: 0; transition: all 0.25s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
