/* ── Base ──────────────────────────────────────────────── */
:root {
  --bg:         #090909;
  --bg-card:    #0d0d0d;
  --border:     #1c1c1c;
  --border-dim: #141414;
  --green:      #00ff41;
  --text:       #d4d4d4;
  --text-dim:   #555;
  --text-muted: #2d2d2d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* dot grid background */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(0, 255, 65, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: var(--bg); }
::-webkit-scrollbar-thumb      { background: #222; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ── Shell ─────────────────────────────────────────────── */
#app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--border); padding: 11px 24px; }

.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}

.prompt-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}

.dot-live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.7);
}

.prompt-user { color: var(--green); opacity: 0.7; }
.prompt-sep  { color: var(--text-muted); }
.prompt-path { color: var(--text-dim); }
.prompt-cmd  { color: #444; }

.cursor-block {
  display: inline-block; width: 7px; height: 13px;
  background: var(--green); vertical-align: text-bottom; opacity: 0.85;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0; }
}

.topbar-ver { color: var(--text-muted); font-size: 10px; letter-spacing: 0.06em; }

/* ── Main ──────────────────────────────────────────────── */
main {
  flex: 1; max-width: 1100px; margin: 0 auto;
  width: 100%; padding: 52px 24px 40px;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero { margin-bottom: 44px; }

.hero-comment {
  color: var(--text-muted); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; color: var(--green);
  text-shadow: 0 0 40px rgba(0, 255, 65, 0.2); margin-bottom: 12px;
}

.hero-sub  { font-size: 12px; color: var(--text-dim); }
.hero-sub em { font-style: normal; color: var(--green); opacity: 0.5; }

/* ── Section header ────────────────────────────────────── */
.sec-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}

.sec-label {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap;
}

.sec-line { flex: 1; height: 1px; background: var(--border); }
.sec-info { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── Input section ─────────────────────────────────────── */
.input-section { margin-bottom: 44px; }

.form-row {
  display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px;
}

.input-wrap { flex: 1; position: relative; }

.input-prefix {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #3a3a3a; pointer-events: none; user-select: none; font-size: 13px;
}

.domain-input {
  width: 100%;
  background: var(--bg-card); border: 1px solid #252525;
  color: var(--text); font-family: inherit; font-size: 13px;
  padding: 12px 14px 12px 30px; border-radius: 3px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--green);
}

.domain-input::placeholder { color: #2a2a2a; }

.domain-input:focus {
  border-color: rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.06), 0 0 18px rgba(0, 255, 65, 0.07);
}

.query-btn {
  background: transparent; border: 1px solid rgba(0, 255, 65, 0.5);
  color: var(--green); font-family: inherit; font-size: 12px;
  font-weight: 700; padding: 12px 22px; border-radius: 3px;
  cursor: pointer; letter-spacing: 0.07em; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.query-btn:hover {
  background: rgba(0, 255, 65, 0.07);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.12);
}

.query-btn:active   { background: rgba(0, 255, 65, 0.13); }
.query-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* quick examples */
.examples {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11px;
}

.ex-label { color: var(--text-muted); }
.ex-sep   { color: #222; }

.ex-btn {
  background: none; border: none; font-family: inherit;
  font-size: 11px; color: #3d3d3d; cursor: pointer; padding: 0;
  transition: color 0.15s;
}

.ex-btn:hover { color: var(--green); }

/* ── DNS Grid ──────────────────────────────────────────── */
.dns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* hide-empty mode */
.dns-grid.hide-empty .dns-card[data-empty="true"] { display: none; }

/* ── DNS Card ──────────────────────────────────────────── */
.dns-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 3px; padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: slideUp 0.3s ease-out both;
}

.dns-card:hover {
  border-color: #2a2a2a;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

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

.dns-card:nth-child(1)  { animation-delay:   0ms; }
.dns-card:nth-child(2)  { animation-delay:  40ms; }
.dns-card:nth-child(3)  { animation-delay:  80ms; }
.dns-card:nth-child(4)  { animation-delay: 120ms; }
.dns-card:nth-child(5)  { animation-delay: 160ms; }
.dns-card:nth-child(6)  { animation-delay: 200ms; }
.dns-card:nth-child(7)  { animation-delay: 240ms; }
.dns-card:nth-child(8)  { animation-delay: 280ms; }
.dns-card:nth-child(9)  { animation-delay: 320ms; }
.dns-card:nth-child(10) { animation-delay: 360ms; }
.dns-card:nth-child(11) { animation-delay: 400ms; }
.dns-card:nth-child(12) { animation-delay: 440ms; }
.dns-card:nth-child(13) { animation-delay: 480ms; }
.dns-card:nth-child(14) { animation-delay: 520ms; }
.dns-card:nth-child(15) { animation-delay: 560ms; }
.dns-card:nth-child(16) { animation-delay: 600ms; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dim);
}

.card-meta  { display: flex; align-items: center; gap: 8px; }
.card-type  { font-size: 13px; font-weight: 700; letter-spacing: 0.05em; }
.card-desc  { font-size: 10px; color: #2e2e2e; }
.card-badge { font-size: 10px; padding: 2px 8px; border-radius: 2px; letter-spacing: 0.04em; }

/* ── Records table ─────────────────────────────────────── */
.rec-table { width: 100%; border-collapse: collapse; font-size: 11px; }

.rec-table th {
  text-align: left; font-weight: 400; font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase; color: #2c2c2c;
  padding: 0 0 6px; border-bottom: 1px solid #181818;
}

.rec-table th:last-child { text-align: right; }

.rec-table td {
  padding: 7px 14px 7px 0; vertical-align: top;
  border-bottom: 1px solid rgba(28, 28, 28, 0.5); color: #999;
}

.rec-table td:last-child {
  padding-right: 0; text-align: right;
  color: #404040; white-space: nowrap;
}

.rec-table tr:last-child td { border-bottom: none; }
.rec-table tr:hover td { background: rgba(255, 255, 255, 0.008); }
.rec-data { word-break: break-all; line-height: 1.55; }

/* inline field labels (MX, SRV, CAA, etc.) */
.fl { color: #383838; font-size: 10px; margin-right: 1px; }

/* SOA key-value grid */
.soa-kv {
  display: grid; grid-template-columns: auto 1fr;
  gap: 3px 10px; font-size: 10px; line-height: 1.5;
}

.kv-k { color: #333; white-space: nowrap; }
.kv-v { color: #888; word-break: break-all; }

/* no record */
.no-rec {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; color: #2d2d2d; font-size: 11px;
}

/* ── Results meta ──────────────────────────────────────── */
.res-domain  { font-size: 11px; color: var(--green); }
.res-summary { font-size: 10px; color: var(--text-muted); margin-left: 6px; }
.res-time    { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

.toggle-btn {
  background: none; border: none; font-family: inherit; font-size: 10px;
  color: var(--text-muted); cursor: pointer; padding: 0;
  margin-left: auto; letter-spacing: 0.04em; transition: color 0.15s;
}

.toggle-btn:hover { color: var(--green); }

/* ── Loading ───────────────────────────────────────────── */
.loading-bar-wrap {
  height: 1px; background: #1a1a1a; border-radius: 1px;
  overflow: hidden; margin-bottom: 20px;
}

.loading-bar {
  height: 100%; width: 25%; background: var(--green);
  border-radius: 1px; box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  animation: sweep 1.8s ease-in-out infinite;
}

@keyframes sweep {
  0%   { transform: translateX(-100%); width: 25%; }
  50%  { width: 55%; }
  100% { transform: translateX(450%); width: 25%; }
}

.loading-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
}

.ld-dots { display: flex; gap: 4px; }

.ld-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--green);
}

.ld-dot:nth-child(1) { animation: dotf 1.2s ease-in-out 0s   infinite; }
.ld-dot:nth-child(2) { animation: dotf 1.2s ease-in-out 0.2s infinite; }
.ld-dot:nth-child(3) { animation: dotf 1.2s ease-in-out 0.4s infinite; }

@keyframes dotf {
  0%, 80%, 100% { opacity: 0.15; transform: scale(0.75); }
  40%           { opacity: 1;    transform: scale(1.15); }
}

.ld-msg { font-size: 11px; color: #3d3d3d; transition: opacity 0.25s; }

/* ── Skeleton cards ────────────────────────────────────── */
.sk-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 3px; padding: 16px;
}

.sk-line {
  border-radius: 2px;
  background: linear-gradient(90deg, #111 25%, #181818 50%, #111 75%);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

.sk-row { display: flex; justify-content: space-between; gap: 8px; }

/* ── Empty / initial state ─────────────────────────────── */
.empty-state { text-align: center; padding: 72px 0; }

.empty-comment {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px;
}

.empty-text { font-size: 12px; color: #252525; }

/* ── Footer ────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 14px 24px; }

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--text-muted);
}

/* ── Toast ─────────────────────────────────────────────── */
#toast-zone {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 15px; border-radius: 3px;
  font-family: inherit; font-size: 11px; max-width: 340px;
  animation: toastIn 0.22s ease-out both;
}

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

.toast-err {
  background: #0f0808; border: 1px solid rgba(255, 68, 68, 0.5);
  color: #ff5c5c; box-shadow: 0 0 20px rgba(255, 68, 68, 0.1);
}

.toast-ok {
  background: #080f09; border: 1px solid rgba(0, 255, 65, 0.3);
  color: var(--green); box-shadow: 0 0 20px rgba(0, 255, 65, 0.08);
}

.toast-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  opacity: 0.55; white-space: nowrap; padding-top: 1px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  main          { padding: 36px 16px 32px; }
  .topbar       { padding: 11px 16px; }
  footer        { padding: 12px 16px; }
  .form-row     { flex-direction: column; }
  .query-btn    { padding: 12px; }
  .dns-grid     { grid-template-columns: 1fr; }
  .footer-right { display: none; }
}
