:root {
  --bg: #060911;
  --panel: rgba(15, 23, 42, 0.72);
  --border: rgba(148, 163, 184, 0.14);
  --text: #f8fafc;
  --muted: #94a3b8;
  --neon: #10b981;
  --cyan: #06b6d4;
  --slider-pct: 55%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Roboto', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(rgba(16, 185, 129, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 25%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 25%, #000 30%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.glow-top {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.12) 45%, transparent 72%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 11px;
  font-weight: 600;
  color: #6ee7b7;
}

.ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.latency-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2px 4px;
}

.hero h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 5px;
}

.hero p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* Shared Panel */
.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 16px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.7);
}

.is-hidden {
  display: none !important;
}

/* VIEW 1: Slider Panel */
.slider-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.amount-display {
  text-align: center;
  padding: 8px 0 2px;
}

.amount-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.amount-value {
  margin-top: 4px;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ffffff 30%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.amount-value .currency {
  font-size: 20px;
  margin-left: 4px;
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tactile-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    var(--neon) 0%,
    var(--cyan) var(--slider-pct),
    rgba(255, 255, 255, 0.1) var(--slider-pct),
    rgba(255, 255, 255, 0.1) 100%
  );
}

.tactile-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--neon);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.65), 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease;
}

.tactile-slider:active::-webkit-slider-thumb {
  transform: scale(1.14);
}

.tactile-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--neon);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.65);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 4px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.preset-chip:active {
  transform: scale(0.95);
}

.preset-chip.is-active {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--neon);
  color: #ecfdf5;
}

.term-selector {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.term-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.term-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.term-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.term-chip:active {
  transform: scale(0.95);
}

.term-chip.is-active {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--cyan);
  color: #ecfeff;
}

.scan-btn, .cta-btn {
  position: relative;
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 26px -6px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease;
}

.scan-btn:active, .cta-btn:active {
  transform: scale(0.98);
}

.scan-btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: shineSweep 2.6s infinite;
}

@keyframes shineSweep {
  0% { left: -100%; }
  38%, 100% { left: 160%; }
}

/* VIEW 2: Neon AI Radar */
.radar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeSlide 0.35s ease;
}

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

.radar-stage {
  padding: 6px 0;
}

.radar-circle {
  position: relative;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(6, 9, 17, 0.9) 72%);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 36px -6px rgba(16, 185, 129, 0.38), inset 0 0 24px rgba(16, 185, 129, 0.15);
  overflow: hidden;
}

.radar-ring {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(16, 185, 129, 0.28);
}

.r1 { width: 126px; height: 126px; }
.r2 { width: 80px; height: 80px; }
.r3 { width: 38px; height: 38px; border-style: solid; border-color: rgba(6, 182, 212, 0.4); }

.radar-crosshair-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(16, 185, 129, 0.18);
}

.radar-crosshair-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(16, 185, 129, 0.18);
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(16, 185, 129, 0.55) 0deg,
    rgba(6, 182, 212, 0.2) 45deg,
    transparent 85deg,
    transparent 360deg
  );
  animation: radarSpin 1.35s linear infinite;
}

@keyframes radarSpin {
  to { transform: rotate(360deg); }
}

.radar-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  opacity: 0;
  animation: blipPing 1.4s infinite;
}

.b1 { top: 28%; left: 66%; animation-delay: 0.2s; }
.b2 { top: 68%; left: 32%; animation-delay: 0.7s; }
.b3 { top: 38%; left: 26%; animation-delay: 1.1s; }

@keyframes blipPing {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  40% { opacity: 1; transform: scale(1.2); }
}

.radar-center {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(6, 9, 17, 0.88);
  border: 1px solid rgba(16, 185, 129, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #6ee7b7;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

/* Log Items */
.log-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0.35;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.log-item.is-running {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.06);
}

.log-item.is-done {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.08);
}

.log-icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(6, 182, 212, 0.25);
  border-top-color: var(--cyan);
  display: none;
  animation: radarSpin 0.7s linear infinite;
}

.log-item.is-running .spinner {
  display: block;
}

.check {
  width: 17px;
  height: 17px;
  color: #34d399;
  display: none;
}

.log-item.is-done .check {
  display: block;
  animation: popIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.log-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

/* VIEW 3: Verdict Panel */
.verdict-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-color: rgba(16, 185, 129, 0.35);
  animation: fadeSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.verdict-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: 0.03em;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.75);
  animation: liveRing 1.6s infinite;
}

@keyframes liveRing {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.75); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 11px;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}

.verdict-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.verdict-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.verdict-k {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.verdict-sum {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.verdict-rate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.rate-badge {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 800;
}

.rate-sub {
  font-size: 11px;
  color: var(--muted);
}

.verdict-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
}

.verdict-tags span {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
}

.reset-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
  padding: 4px 8px;
}

.trust-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-logos span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.72);
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

/* Footer */
.footer {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.terms div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.terms strong {
  color: var(--text);
}

.legal {
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.72);
  text-align: center;
}
