:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #111d31;
  --glass: rgba(13, 20, 35, 0.42);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --text: #f1f7ff;
  --muted: #a3b5d4;
  --accent: #86e5ff;
  --accent-strong: #55d7ff;
  --shadow: 0 28px 90px rgba(2, 8, 23, 0.44);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Avenir Next", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(86, 208, 255, 0.24), transparent 34%),
    radial-gradient(circle at right 20%, rgba(167, 139, 250, 0.16), transparent 28%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 0 64px;
}

.hero {
  max-width: 720px;
  margin-bottom: 28px;
  animation: rise 560ms ease-out both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(160%);
  position: relative;
  animation: rise 700ms 120ms ease-out both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-xl) - 1px);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.target-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  color: #dbe7ff;
  font-weight: 600;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.target-location {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  white-space: nowrap;
}

input {
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 12, 24, 0.54);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #6f82a5;
}

input:focus {
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

button {
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, var(--accent-strong), #0ea5e9);
  color: #04111f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.92rem;
  backdrop-filter: blur(18px);
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
}

.status.loading {
  color: #dbeafe;
  border-color: rgba(86, 208, 255, 0.22);
  background: rgba(86, 208, 255, 0.12);
}

.status.success {
  color: #dcfce7;
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(16, 185, 129, 0.12);
}

.status.error {
  color: #ffe4e6;
  border-color: rgba(251, 113, 133, 0.22);
  background: rgba(244, 63, 94, 0.12);
}

.result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.result-label {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
}

.result h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.badge.success {
  background: rgba(16, 185, 129, 0.16);
  color: #86efac;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.badge.error {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.metric span,
.detail-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

.details {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.details p {
  margin: 7px 0 0;
  line-height: 1.6;
  color: #eff6ff;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .shell {
    width: min(100vw - 20px, 1080px);
    padding-top: 30px;
  }

  .panel {
    padding: 20px;
    border-radius: 24px;
  }

  .input-row,
  .metrics {
    grid-template-columns: 1fr;
  }

  .target-location {
    white-space: normal;
  }

  .result-header {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
