:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #e5e8f0;
  --text: #1a1f2c;
  --muted: #5e6a87;
  --accent: #3a7bff;
  --accent-2: #1ec7a2;
  --shadow: 0 20px 60px rgba(26, 31, 44, 0.1);
  font-family: "Space Grotesk", "SF Pro Display", "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  padding: 32px clamp(18px, 3vw, 40px) 64px;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.background__gradient {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 20% 20%, rgba(30, 199, 162, 0.2), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(58, 123, 255, 0.22), transparent 32%),
    radial-gradient(circle at 50% 75%, rgba(255, 189, 105, 0.18), transparent 40%);
  filter: blur(60px);
  animation: drift 18s ease-in-out infinite alternate;
}

.background__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 31, 44, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 31, 44, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.45), transparent 65%);
}

.nav {
  max-width: 1100px;
  margin: 0 auto 24px auto;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3a7bff, #1ec7a2);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 12px 30px rgba(58, 123, 255, 0.25);
}

.nav__title {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav__subtitle {
  color: var(--muted);
  font-size: 13px;
}

.nav__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(58, 123, 255, 0.08);
}

.chip--ghost {
  color: var(--muted);
  background: rgba(26, 31, 44, 0.04);
}

.chip--accent {
  background: linear-gradient(120deg, rgba(58, 123, 255, 0.18), rgba(30, 199, 162, 0.2));
  border-color: rgba(58, 123, 255, 0.35);
  color: #0b1a33;
}

.layout {
  max-width: 980px;
  margin: 0 auto;
  display: block;
}

.panel--wide {
  width: 100%;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px 0;
}

.lede {
  margin: 0 0 14px 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hero__meta div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.meta__label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.meta__value {
  font-weight: 700;
}

.panel {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  position: relative;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel__head h2 {
  margin: 4px 0 0 0;
}

.panel__intro {
  margin: 6px 0 12px 0;
}

.pill {
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(120deg, rgba(58, 123, 255, 0.12), rgba(30, 199, 162, 0.14));
  color: #0b1a33;
  border: 1px solid rgba(58, 123, 255, 0.35);
  white-space: nowrap;
}

.panel__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scan-overlay {
  position: absolute;
  inset: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  border: 1px solid rgba(58, 123, 255, 0.25);
  box-shadow: 0 18px 40px rgba(26, 31, 44, 0.1);
}

.scan-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.scan-overlay__bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  filter: blur(0.6px);
}

.bubble {
  position: absolute;
  width: var(--size, 120px);
  height: var(--size, 120px);
  top: var(--top, 10%);
  left: var(--left, 10%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92), var(--accent, rgba(58, 123, 255, 0.18)));
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(26, 31, 44, 0.08);
  opacity: 0.85;
  animation: float 12s ease-in-out infinite;
  transition: transform 3.2s cubic-bezier(0.22, 0.85, 0.25, 1), opacity 3.2s ease, filter 3.2s ease;
}

.bubble--a { top: 10%; left: 15%; animation-delay: 0s; }
.bubble--b { top: 35%; left: 65%; animation-delay: 1s; background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(30, 199, 162, 0.2)); }
.bubble--c { top: 55%; left: 25%; animation-delay: 2s; width: 90px; height: 90px; }
.bubble--d { top: 70%; left: 70%; animation-delay: 2.8s; width: 140px; height: 140px; }
.bubble--e { top: 20%; left: 40%; animation-delay: 1.5s; width: 110px; height: 110px; }
.bubble--f { top: 65%; left: 50%; animation-delay: 0.5s; width: 100px; height: 100px; background: radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(105, 186, 255, 0.2)); }

.scan-overlay__ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(58, 123, 255, 0.6);
  box-shadow: 0 0 40px rgba(58, 123, 255, 0.25);
  background:
    radial-gradient(circle, rgba(58, 123, 255, 0.18), rgba(255, 255, 255, 0.95)),
    conic-gradient(from 0deg, rgba(58, 123, 255, 0.45), rgba(30, 199, 162, 0.35), rgba(58, 123, 255, 0.45));
  animation: spin 1.2s linear infinite;
}

.scan-overlay__text {
  color: #0b1a33;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 140px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fbff;
}

.stat__label {
  color: var(--muted);
  margin: 0 0 8px 0;
  font-size: 13px;
}

.stat__value {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
}

.stat__hint {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stat--gauge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge {
  --glow: 0.35;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(58, 123, 255, 0.12), rgba(255, 255, 255, 0.92)),
    conic-gradient(from 120deg, rgba(58, 123, 255, 0.12), rgba(30, 199, 162, 0.08), rgba(58, 123, 255, 0.12));
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(58, 123, 255, 0.25);
  box-shadow: 0 18px 40px rgba(26, 31, 44, 0.12), 0 0 50px rgba(58, 123, 255, var(--glow));
  overflow: hidden;
}

.gauge::after {
  content: "";
  position: absolute;
  inset: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(58, 123, 255, 0.12), rgba(255, 255, 255, 0.92));
  border-radius: 50%;
  border: 1px solid rgba(58, 123, 255, 0.2);
  box-shadow: inset 0 0 30px rgba(26, 31, 44, 0.1);
}

.gauge__fill {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(124, 242, 230, 0.35), transparent 55%);
  filter: blur(22px);
  opacity: 0.35;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gauge__center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
}

.gauge__value {
  font-size: 26px;
  font-weight: 700;
}

.gauge__label {
  color: var(--muted);
  font-size: 13px;
}

.gauge.is-pulse {
  animation: pulse 0.45s ease;
}

.input__label {
  color: var(--muted);
  font-size: 14px;
}

.input__wrap {
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

textarea {
  width: 100%;
  min-height: 160px;
  background: transparent;
  border: none;
  padding: 14px;
  color: var(--text);
  resize: vertical;
  font: inherit;
  outline: none;
}

textarea::placeholder {
  color: rgba(26, 31, 44, 0.35);
}

.input__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(58, 123, 255, 0.08), rgba(30, 199, 162, 0.08));
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.error-bar {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(223, 72, 72, 0.35);
  background: rgba(223, 72, 72, 0.08);
  color: #a22020;
  font-size: 14px;
  font-weight: 600;
  display: none;
}

.error-bar.is-visible {
  display: block;
}

.btn {
  border: 1px solid rgba(58, 123, 255, 0.6);
  background: linear-gradient(120deg, rgba(58, 123, 255, 0.22), rgba(30, 199, 162, 0.28));
  color: #0b1a33;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(58, 123, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(58, 123, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.note__title {
  margin: 0 0 6px 0;
  font-weight: 700;
}

.note__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@keyframes drift {
  from {
    transform: translateY(-10px) translateX(-6px) scale(1);
  }
  to {
    transform: translateY(12px) translateX(8px) scale(1.02);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 18px 40px rgba(26, 31, 44, 0.1), 0 0 50px rgba(58, 123, 255, 0.25);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 24px 60px rgba(26, 31, 44, 0.12), 0 0 70px rgba(58, 123, 255, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 18px 40px rgba(26, 31, 44, 0.1), 0 0 50px rgba(58, 123, 255, 0.25);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  35% { transform: translate(10px, -12px) scale(1.02); opacity: 0.88; }
  70% { transform: translate(-8px, 14px) scale(1.03); opacity: 0.94; }
  100% { transform: translate(9px, -8px) scale(1); opacity: 0.82; }
}

.scan-overlay.is-active .bubble {
  filter: blur(0);
}

.scan-overlay.is-active .bubble.collapsing {
  opacity: 0.35;
  filter: blur(3px);
}

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

  .panel__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .gauge {
    width: 160px;
    height: 160px;
  }
}
