:root {
  --teal: #2bafa8;
  --teal-d: #1f8e88;
  --teal-l: #e6f6f5;
  --coral: #ff8fa0;
  --coral-l: #ffe4e8;
  --coral-d: #e15c75;
  --sun: #f5b800;
  --sun-l: #fff3c8;
  --sun-d: #b8860b;
  --ink: #1f2733;
  --mut: #5b6b80;
  --bg: #fafcfb;
  --card: #fff;
  --line: #e7eee9;
  --maxw: 1040px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(43, 175, 168, 0.09) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- footer myip pill ---------- */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7);
  animation: livepulse 2s infinite;
  flex: 0 0 auto;
  vertical-align: 1px;
  margin-right: 5px;
}
@keyframes livepulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(63, 185, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
  }
}
.myip-foot {
  display: inline-flex;
  align-items: center;
  color: var(--mut);
}
.myip-foot code {
  font-family: var(--mono);
  color: var(--teal-d);
  font-weight: 700;
  margin-left: 4px;
}
@media (max-width: 480px) {
  .brand .lab small {
    display: none;
  }
  .myip-nav {
    font-size: 12px;
  }
}

/* ---------- main layout: Google-style centered, slides up after first run ---------- */
main {
  /* No topbar — main fills viewport above the ~62px footer. */
  min-height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  padding: 40px 0;
}
body[data-state="idle"] main {
  justify-content: center;
  padding-top: 0;
}
body[data-state="active"] main {
  justify-content: flex-start;
  padding-top: 30px;
}

/* Hero logo above the search panel (Google-style). */
.hero-logo {
  text-align: center;
  margin: 0 0 22px;
  overflow: hidden;
  transition:
    max-height 0.45s ease,
    opacity 0.3s ease,
    margin-bottom 0.4s ease;
}
body[data-state="idle"] .hero-logo {
  max-height: 260px;
  opacity: 1;
}
body[data-state="active"] .hero-logo {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.hero-logo .hero-img,
.hero-logo .hero-dove {
  width: clamp(96px, 12vw, 128px);
  height: auto;
  margin: 0 auto;
  color: var(--teal);
}
.hero-logo .hero-img {
  display: none;
  object-fit: contain;
  max-height: 124px;
}
.hero-logo .hero-dove {
  display: block;
}
.hero-logo.has-img .hero-img {
  display: block;
}
.hero-logo.has-img .hero-dove {
  display: none;
}
.hero-title {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(20, 50, 50, 0.05);
}
.tool-panel {
  position: relative;
  z-index: 2;
}
body[data-state="idle"] .tool-panel {
  box-shadow:
    0 14px 40px rgba(20, 50, 50, 0.07),
    0 4px 14px rgba(43, 175, 168, 0.06);
}

@media (max-width: 560px) {
  .panel {
    padding: 16px;
    border-radius: 14px;
  }
  main {
    padding: 14px 0 30px;
  }
  .hero-logo img,
  .hero-logo .hero-dove {
    width: 110px;
  }
  .hero-logo {
    margin-bottom: 20px;
  }
}

/* tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--mut);
  padding: 8px 15px 8px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s,
    transform 0.12s,
    box-shadow 0.18s;
}
.tab .ic {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.tab:hover {
  color: var(--teal-d);
  border-color: var(--teal);
  transform: translateY(-1px);
}
.tab.active {
  background: linear-gradient(135deg, var(--teal) 0%, #37c4bb 100%);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(43, 175, 168, 0.34);
  transform: translateY(-1px);
}

/* form */
.field {
  display: block;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--mut);
  font-weight: 600;
  margin-bottom: 7px;
}
#target {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.3px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.2s;
}
#target::placeholder {
  color: #b5c1cf;
  font-weight: 400;
}
#target:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow:
    0 0 0 3px rgba(43, 175, 168, 0.16),
    0 4px 14px rgba(43, 175, 168, 0.08);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-top: 16px;
}
.options:empty {
  margin-top: 0;
}
.opt {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--mut);
}
.opt input[type="text"],
.opt input[type="number"] {
  padding: 8px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}
.opt input:focus {
  outline: none;
  border-color: var(--teal);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  max-width: 560px;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}
.checks input,
.opt input[type="checkbox"] {
  accent-color: var(--teal);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
#run {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--teal) 0%, #37c4bb 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 26px 12px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s,
    box-shadow 0.2s;
  box-shadow:
    0 10px 24px rgba(43, 175, 168, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#run .ic {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s;
}
#run:hover {
  background: linear-gradient(135deg, var(--teal-d) 0%, var(--teal) 100%);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(43, 175, 168, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#run:hover .ic {
  transform: translateX(2px);
}
#run:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.hint {
  color: var(--mut);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- results ---------- */
.result {
  margin-top: 22px;
}
.result:empty {
  display: none;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(20, 50, 50, 0.06);
  animation: cardin 0.28s ease-out both;
}
@keyframes cardin {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card h3 {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--teal);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.4;
}
.card h4 {
  margin: 16px 0 6px;
  font-size: 12px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.card a {
  color: var(--teal-d);
  text-decoration: none;
  font-weight: 600;
}
.card a:hover {
  text-decoration: underline;
}
pre {
  margin: 0;
  padding: 14px;
  background: #f5faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: #2a3a40;
  white-space: pre-wrap;
  word-break: break-word;
}
table.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.kv td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.kv tr:first-child td {
  color: var(--mut);
  font-weight: 700;
}
table.kv td:first-child {
  color: var(--mut);
  white-space: nowrap;
  width: 1%;
  font-family: var(--mono);
}
table.kv td:last-child {
  font-family: var(--mono);
  word-break: break-word;
}

.records {
  display: grid;
  gap: 2px;
}
.records .rec {
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
}
.badge.ok {
  background: var(--teal-l);
  color: var(--teal-d);
}
.badge.bad {
  background: var(--coral-l);
  color: var(--coral-d);
}
.badge.warn {
  background: var(--sun-l);
  color: var(--sun-d);
}
.badge.neutral {
  background: #eef2f0;
  color: var(--mut);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--teal-l);
  border: 1px solid #d4ece9;
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 92px;
}
.stat .v {
  font-size: 20px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--teal-d);
}
.stat .l {
  font-size: 11px;
  color: var(--mut);
}

.ports {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.port {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: var(--mono);
  font-size: 13px;
}
.port.open {
  border-color: var(--teal);
  background: var(--teal-l);
}
.port .svc {
  color: var(--mut);
  font-size: 12px;
}

.error-box {
  background: var(--coral-l);
  border: 1px solid #ffc7d0;
  color: var(--coral-d);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

details summary {
  cursor: pointer;
  color: var(--teal-d);
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 8px;
}

/* WHOIS structured tables */
.whois-tbl {
  margin-bottom: 6px;
}
.whois-tbl td {
  white-space: normal !important;
}
.whois-tbl td:first-child {
  min-width: 140px;
  max-width: 200px;
}
.whois-summary {
  border: 1px solid var(--teal);
  border-radius: 12px;
  overflow: hidden;
  background: #f5fcfb;
}
table.whois-summary tr td {
  padding: 9px 12px;
}
/* Specificity bump: must beat `table.kv tr:first-child td` from earlier rules. */
table.whois-summary tr td:first-child {
  color: var(--teal-d);
  font-weight: 700;
  background: var(--teal-l);
  font-family: var(--sans);
  border-right: 1px solid #d4ece9;
}
table.whois-summary tr:last-child td {
  border-bottom: none;
}
.whois-multi .whois-line {
  padding: 2px 0;
}
.whois-multi .whois-line + .whois-line {
  border-top: 1px dashed var(--line);
  padding-top: 4px;
  margin-top: 2px;
}

/* DNS table — same teal-summary frame as WHOIS, but with a narrow key column. */
.dns-tbl td:first-child {
  width: 64px;
  min-width: 64px;
  text-align: center;
}

/* Mode selector (used in unified Ports tool) */
.mode-select {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-width: 240px;
}
.mode-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 175, 168, 0.15);
}

/* Subdomain enumeration table */
.subdomain-tbl td {
  vertical-align: middle;
}
.subdomain-tbl td:first-child {
  font-family: var(--mono);
  color: var(--ink);
  font-weight: 600;
}
.subdomain-tbl tr:first-child td {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--mut);
}
.subdomain-tbl tr:hover td {
  background: #f8fcfb;
}

/* Nmap streaming UI */
.stream-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 10px;
}
.stream-status .stream-progress-text {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.stop-btn {
  appearance: none;
  background: var(--coral-l);
  color: var(--coral-d);
  border: 1px solid #ffc7d0;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s;
}
.stop-btn:hover {
  background: #ffd5dc;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal) 0%, #37c4bb 100%);
  transition: width 0.3s ease;
}
.progress-fill.done-abort {
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-d) 100%);
}
.progress-fill.done-error {
  background: linear-gradient(90deg, var(--coral-d) 0%, #c0392b 100%);
}
.nmap-stream-tbl {
  width: 100%;
}
.nmap-stream-tbl td {
  font-family: var(--mono);
  font-size: 13px;
}
.nmap-stream-tbl thead td {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--mut);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.nmap-stream-tbl tr.is-open td {
  background: #f5fcfb;
}
.nmap-stream-tbl tbody tr {
  animation: cardin 0.2s ease-out both;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--mut);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.7);
  padding: 14px 0 22px;
}
footer .foot-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
footer .sep {
  opacity: 0.45;
}
footer .note {
  color: var(--mut);
}
footer .brand-mini {
  color: var(--teal-d);
  font-weight: 700;
  letter-spacing: 0.4px;
}
footer .copyright {
  color: var(--mut);
}
footer .copyright a {
  color: var(--teal-d);
  text-decoration: none;
  font-weight: 600;
}
footer .copyright a:hover {
  text-decoration: underline;
}
code {
  font-family: var(--mono);
}
