:root {
  color-scheme: dark;
  --void: #05080b;
  --deck: #081116;
  --panel: rgba(10, 23, 29, 0.88);
  --panel-solid: #0b171d;
  --panel-soft: #10252c;
  --ink: #e7fbf6;
  --muted: #82a09c;
  --dim: #516c68;
  --line: rgba(124, 255, 226, 0.16);
  --line-strong: rgba(124, 255, 226, 0.32);
  --cyan: #55f7df;
  --cyan-strong: #00d4bc;
  --green: #7dff9f;
  --amber: #ffd166;
  --red: #ff6b7a;
  --blue: #6ab8ff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
  --glow: 0 0 32px rgba(85, 247, 223, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(85, 247, 223, 0.16), transparent 26rem),
    radial-gradient(circle at 86% 4%, rgba(106, 184, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, #071116 0%, #05080b 48%, #030507 100%);
  color: var(--ink);
  letter-spacing: 0;
}

.grid-shell {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(124, 255, 226, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 255, 226, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.58) 46%, transparent 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 30px;
  background: rgba(5, 8, 11, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(85, 247, 223, 0.18), rgba(106, 184, 255, 0.06)),
    #071015;
  box-shadow: var(--glow);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.brand-mark::before {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(85, 247, 223, 0.55);
}

.brand-mark::after {
  width: 2px;
  height: 15px;
  top: 9px;
  left: 50%;
  background: var(--cyan);
  transform: translateX(-50%);
  transform-origin: 50% 15px;
  animation: sweep 2.8s linear infinite;
}

.brand-mark span {
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

@keyframes sweep {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: "Aptos Display", "Segoe UI", sans-serif;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 800;
}

.ai-word {
  color: var(--red);
  font-style: italic;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}

p {
  color: var(--muted);
}

.top-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-chip,
.version,
.premium-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 23, 29, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.metric-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  font-size: 12px;
  text-transform: uppercase;
}

.metric-chip strong {
  color: var(--cyan);
}

.version {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
}

.premium-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 107, 122, 0.18), rgba(255, 209, 102, 0.14)),
    rgba(10, 23, 29, 0.86);
  border-color: rgba(255, 107, 122, 0.26);
  box-shadow: 0 0 0 1px rgba(255, 107, 122, 0.08), 0 12px 28px rgba(0, 0, 0, 0.22);
}

.premium-link::before {
  content: "P";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 107, 122, 0.22);
  color: #ffd9df;
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
}

.premium-link:hover {
  color: #fff5f6;
  border-color: rgba(255, 107, 122, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 107, 122, 0.28), rgba(255, 209, 102, 0.22)),
    rgba(10, 23, 29, 0.92);
}

main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(85, 247, 223, 0.09), transparent 24%, transparent 76%, rgba(106, 184, 255, 0.07));
  opacity: 0.72;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(380px, 1.55fr);
  gap: 18px;
  padding: 18px;
  align-items: stretch;
}

.hero-copy,
.hero-query {
  position: relative;
  display: grid;
  gap: 14px;
}

.hero-copy {
  align-content: start;
}

.hero-query {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(7, 17, 22, 0.86), rgba(3, 8, 10, 0.92));
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.field-note {
  color: var(--muted);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
}

.hero-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(85, 247, 223, 0.07);
}

.hero-query-field {
  gap: 10px;
  font-size: 12px;
}

.hero-query-field input {
  min-height: 60px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-query-note {
  color: var(--dim);
  font-size: 13px;
}

.section-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 0;
}

.panel-code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--cyan);
  background: rgba(85, 247, 223, 0.08);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 12px;
}

form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

label small {
  text-transform: none;
}

input,
select,
button,
.button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: rgba(3, 8, 10, 0.78);
}

select {
  color-scheme: dark;
}

input::placeholder {
  color: var(--dim);
}

input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input:focus,
select:focus,
button:focus-visible,
.button:focus-visible,
.small-link:focus-visible {
  outline: 3px solid rgba(85, 247, 223, 0.28);
  outline-offset: 2px;
  border-color: var(--cyan);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  gap: 8px;
  color: #02100e;
  background: var(--cyan);
  border-color: var(--cyan);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 0 28px rgba(85, 247, 223, 0.18);
}

button:hover,
.button:hover {
  background: #8dffee;
}

.primary-action {
  min-height: 48px;
}

.toggle-field {
  align-self: end;
}

.wide-field {
  grid-column: span 2;
}

.toggle-control {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(3, 8, 10, 0.78);
}

.toggle-control input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--cyan);
}

.toggle-control span {
  font-size: 13px;
  font-weight: 900;
  text-transform: none;
}

.disabled-field {
  opacity: 0.48;
}

.disabled {
  pointer-events: none;
  opacity: 0.38;
}

.button[aria-busy="true"] {
  opacity: 0.82;
  cursor: progress;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 18px;
  gap: 18px;
}

.scan-activity {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 8, 10, 0.62);
}

.scan-activity span {
  position: absolute;
  border: 1px solid rgba(85, 247, 223, 0.28);
  border-radius: 50%;
  opacity: 0.32;
}

.scan-activity span:nth-child(1) {
  width: 14px;
  height: 14px;
  background: var(--dim);
}

.scan-activity span:nth-child(2) {
  width: 30px;
  height: 30px;
}

.scan-activity span:nth-child(3) {
  width: 46px;
  height: 46px;
}

body[data-scan-state="starting"] .scan-activity,
body[data-scan-state="pending"] .scan-activity,
body[data-scan-state="running"] .scan-activity,
body[data-scan-state="stopping"] .scan-activity,
body[data-scan-state="cancel_requested"] .scan-activity {
  border-color: rgba(85, 247, 223, 0.52);
  box-shadow: 0 0 34px rgba(85, 247, 223, 0.2);
}

body[data-scan-state="starting"] .scan-activity span,
body[data-scan-state="pending"] .scan-activity span,
body[data-scan-state="running"] .scan-activity span,
body[data-scan-state="stopping"] .scan-activity span,
body[data-scan-state="cancel_requested"] .scan-activity span {
  opacity: 1;
  animation: ping 1.45s ease-out infinite;
}

body[data-scan-state="starting"] .scan-activity span:nth-child(1),
body[data-scan-state="pending"] .scan-activity span:nth-child(1),
body[data-scan-state="running"] .scan-activity span:nth-child(1),
body[data-scan-state="stopping"] .scan-activity span:nth-child(1),
body[data-scan-state="cancel_requested"] .scan-activity span:nth-child(1) {
  background: var(--green);
  box-shadow: 0 0 18px rgba(125, 255, 159, 0.8);
}

body[data-scan-state="stopping"] .scan-activity span,
body[data-scan-state="cancel_requested"] .scan-activity span {
  border-color: rgba(255, 209, 102, 0.56);
}

body[data-scan-state="completed"] .scan-activity {
  border-color: rgba(125, 255, 159, 0.52);
  box-shadow: 0 0 28px rgba(125, 255, 159, 0.18);
}

body[data-scan-state="completed"] .scan-activity span:nth-child(1) {
  background: var(--green);
  box-shadow: 0 0 14px rgba(125, 255, 159, 0.56);
  opacity: 0.82;
}

body[data-scan-state="completed"] .progress-meta strong {
  color: var(--green);
}

body[data-scan-state="error"] .progress-meta strong,
body[data-scan-state="cancelled"] .progress-meta strong {
  color: #ffd166;
}

.progress-panel {
  position: relative;
  display: grid;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 13px;
}

.progress-meta strong {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: rgba(3, 8, 10, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(125, 255, 159, 0.42);
  transition: width 220ms ease;
}

body[data-scan-state="starting"] .progress-bar,
body[data-scan-state="pending"] .progress-bar {
  width: 36%;
  animation: scanning-stripe 1.1s ease-in-out infinite alternate;
}

.status-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stop-action {
  color: #1a0307;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 22px rgba(255, 107, 122, 0.18);
}

.stop-action:hover {
  background: #ff9aa5;
}

.secondary-action {
  color: var(--ink);
  background: rgba(12, 25, 31, 0.94);
  border-color: var(--line-strong);
  box-shadow: none;
}

.secondary-action:hover {
  background: rgba(22, 42, 51, 0.98);
}

@keyframes ping {
  0% {
    transform: scale(0.86);
    opacity: 0.34;
  }
  100% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes scanning-stripe {
  from {
    transform: translateX(-16%);
  }
  to {
    transform: translateX(178%);
  }
}

.result-filters {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  box-shadow: none;
}

.filter-title {
  position: relative;
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.table-wrap {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.results-meta,
.results-pager span {
  color: var(--dim);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 12px;
  font-weight: 900;
}

.results-pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-pager button {
  min-width: 110px;
  min-height: 34px;
  padding: 0 12px;
}

.results-pager button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.table-scroll {
  overflow: auto;
  max-height: min(68vh, 980px);
}

.table-caption {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 8, 10, 0.36);
}

.table-caption span {
  padding: 10px 12px;
  color: var(--dim);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

table {
  position: relative;
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(124, 255, 226, 0.11);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #071116;
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr {
  background: rgba(8, 17, 22, 0.54);
}

tbody tr:hover {
  background: rgba(85, 247, 223, 0.055);
}

.domain {
  color: var(--ink);
  font-weight: 900;
}

.score-cell {
  color: var(--green);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.price-cell {
  color: var(--amber);
  white-space: nowrap;
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.actions button,
.small-link {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.actions button {
  color: var(--cyan);
  background: rgba(85, 247, 223, 0.08);
  box-shadow: none;
}

.small-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(106, 184, 255, 0.12);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 900;
}

.available {
  color: var(--green);
  background: rgba(125, 255, 159, 0.1);
}

.taken {
  color: var(--red);
  background: rgba(255, 107, 122, 0.1);
}

.unknown,
.error {
  color: var(--blue);
  background: rgba(106, 184, 255, 0.1);
}

@media (max-width: 1080px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-metrics {
    flex-wrap: wrap;
  }

  .hero-search,
  form,
  .result-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-title {
    grid-column: 1 / -1;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .results-pager {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .topbar,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .scan-activity {
    width: 100%;
  }

  h1 {
    font-size: 21px;
  }

  .hero-search,
  form,
  .result-filters,
  .table-caption {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .button,
  button,
  .status-actions {
    width: 100%;
  }

  .status-actions {
    flex-direction: column;
  }
}
