@import url("https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #04060c;
  --surface: rgba(14, 20, 36, 0.72);
  --surface2: #121a2e;
  --border: rgba(120, 150, 220, 0.18);
  --text: #f0f4fc;
  --muted: #8b9dc9;
  --accent: #5b9dff;
  --accent2: #a855f7;
  --accent-glow: rgba(91, 157, 255, 0.45);
  --low: #34d399;
  --medium: #fbbf24;
  --high: #f87171;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

/* Animated background */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: floatOrb 18s ease-in-out infinite;
}

.orb-1 {
  width: 420px; height: 420px;
  background: #3b82f6;
  top: -120px; left: -80px;
}

.orb-2 {
  width: 360px; height: 360px;
  background: #8b5cf6;
  bottom: -80px; right: -60px;
  animation-delay: -6s;
}

.orb-3 {
  width: 280px; height: 280px;
  background: #06b6d4;
  top: 40%; left: 50%;
  animation-delay: -12s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 25px) scale(0.95); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 157, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 157, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 0.9rem; }

.logo-mark {
  width: 50px; height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 32px var(--accent-glow);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 24px var(--accent-glow); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.5); }
}

.logo-mark svg { width: 26px; height: 26px; color: white; }

.logo h1 {
  font-family: "Syne", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #94b8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline { color: var(--muted); font-size: 0.86rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.1);
  border: 1px solid rgba(91, 157, 255, 0.3);
  color: #a8c8ff;
}

.pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.5s ease-in-out infinite;
}

.status-pill.ready .pill-dot {
  background: var(--low);
  animation: none;
  box-shadow: 0 0 8px var(--low);
}

.status-pill.ready {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--low);
}

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

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .stats-strip { grid-template-columns: 1fr; }
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, border-color 0.2s;
}

.stat-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 157, 255, 0.35);
}

.stat-chip strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-chip > span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Flow steps */
.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
}

.flow-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  transition: all 0.3s;
}

.step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.flow-steps .step.active {
  color: var(--text);
  background: rgba(91, 157, 255, 0.12);
  border: 1px solid rgba(91, 157, 255, 0.35);
}

.flow-steps .step.active .step-num {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: white;
}

.flow-steps .step.done {
  color: var(--low);
}

.flow-steps .step.done .step-num {
  background: rgba(52, 211, 153, 0.2);
  border-color: var(--low);
  color: var(--low);
}

.step-line {
  width: 20px;
  height: 1px;
  background: var(--border);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(91, 157, 255, 0.35), rgba(168, 85, 247, 0.15), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(91, 157, 255, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(91, 157, 255, 0.25);
  margin-bottom: 0.65rem;
}

.hero-top h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 1.25rem;
  max-width: 54ch;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.search-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-row input {
  flex: 1;
  min-width: 200px;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 50%, var(--accent2) 100%);
  background-size: 200% 200%;
  color: white;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background-position 0.4s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 36px var(--accent-glow);
  background-position: 100% 50%;
}

.btn-primary:disabled { opacity: 0.65; cursor: wait; }

.btn-clear {
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.btn-clear:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary.loading .btn-text::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* Quick wallets */
.quick-wallets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.quick-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.wallet-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.wallet-chip:hover {
  border-color: var(--accent);
  background: rgba(91, 157, 255, 0.12);
  color: #93c5fd;
  transform: translateY(-1px);
}

.wallet-help {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.wallet-help a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.wallet-help a:hover { text-decoration: underline; }

/* Advanced */
.advanced-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.advanced-panel summary {
  padding: 0.65rem 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker { display: none; }

.advanced-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

.advanced-body input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.advanced-body input:focus {
  outline: none;
  border-color: var(--accent);
}

.train-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn-secondary {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.model-status { font-size: 0.76rem; color: var(--muted); }

.status-bar {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
}

.status-bar.info {
  background: rgba(91, 157, 255, 0.12);
  border: 1px solid rgba(91, 157, 255, 0.3);
  color: #b8d4ff;
}

.status-bar.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.hidden { display: none !important; }

/* Loader */
.analyze-loader {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.loader-orbit {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  position: relative;
  animation: spin 2s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  top: 0; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent);
}

.orbit-dot:nth-child(2) {
  top: auto; bottom: 0;
  background: var(--accent2);
  box-shadow: 0 0 12px var(--accent2);
}

.orbit-dot:nth-child(3) {
  top: 50%; left: 0;
  transform: translateY(-50%);
  background: #22d3ee;
}

.loader-title {
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.loader-step {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 1rem;
  min-height: 1.25em;
}

.loader-progress {
  max-width: 300px;
  height: 6px;
  margin: 0 auto 1rem;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 999px;
  transition: width 0.35s ease-out;
}

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

.loader-steps-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.ldot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.ldot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.2);
}

/* Results */
.results { animation: fadeUp 0.5s ease-out; }

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

.reveal-card {
  animation: fadeUp 0.5s ease-out backwards;
}

.reveal-card:nth-child(1) { animation-delay: 0.05s; }
.reveal-card:nth-child(2) { animation-delay: 0.1s; }
.reveal-card:nth-child(3) { animation-delay: 0.15s; }

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.wallet-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.wallet-display {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  word-break: break-all;
  flex: 1;
}

.btn-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--accent);
  background: rgba(91, 157, 255, 0.12);
}

.header-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.tx-count-badge, .demo-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.demo-badge {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--medium);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid > .score-card,
.grid > .model-card {
  min-width: 0;
}

@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.score-card {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.score-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 0.25rem;
  width: 100%;
}

.score-card.risk-high {
  box-shadow: 0 0 40px rgba(248, 113, 113, 0.15);
}

.score-card.risk-medium {
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.1);
}

.score-ring-wrap {
  position: relative;
  width: 156px;
  height: 156px;
  min-width: 156px;
  min-height: 156px;
  margin: 0.25rem auto 0.75rem;
  flex-shrink: 0;
}

.score-ring {
  display: block;
  width: 156px;
  height: 156px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 9;
}

.ring-fill {
  fill: none;
  stroke: var(--low);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.9s ease-out, stroke 0.3s;
}

.ring-fill.level-low { stroke: var(--low); }
.ring-fill.level-medium { stroke: var(--medium); }
.ring-fill.level-high { stroke: var(--high); }

.score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.score-value {
  margin: 0;
  padding: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transform: none;
  -webkit-text-fill-color: unset;
  background: none;
}

.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.LOW {
  background: rgba(52, 211, 153, 0.15);
  color: var(--low);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge.MEDIUM {
  background: rgba(251, 191, 36, 0.15);
  color: var(--medium);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.badge.HIGH {
  background: rgba(248, 113, 113, 0.15);
  color: var(--high);
  border: 1px solid rgba(248, 113, 113, 0.35);
  animation: pulseRisk 2s ease-in-out infinite;
}

@keyframes pulseRisk {
  0%, 100% { box-shadow: 0 0 0 rgba(248, 113, 113, 0); }
  50% { box-shadow: 0 0 16px rgba(248, 113, 113, 0.4); }
}

.risk-verdict {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 26ch;
}

.score-card .badge {
  margin-top: 0.15rem;
}

.model-text {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.prob-bars { display: flex; flex-direction: column; gap: 1rem; }

.prob-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 0.4rem;
}

.prob-track {
  height: 10px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.prob-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.prob-fill.rf { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.prob-fill.xgb { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

.alerts-card h3, .features-card h3, .tx-card h3 {
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#alertsList { list-style: none; }

#alertsList li {
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  position: relative;
  animation: fadeUp 0.4s ease-out backwards;
}

#alertsList li::before {
  content: "⚠";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--medium);
}

#alertsList li.none {
  color: var(--muted);
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
}

#alertsList li.none::before { content: "✓"; color: var(--low); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}

.feature-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 0.6rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.4s ease-out backwards;
}

.feature-item:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 157, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.feature-item .val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.feature-item .key {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.3;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }

thead { background: rgba(0, 0, 0, 0.25); }

th {
  padding: 0.7rem 0.75rem;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
}

td {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(91, 157, 255, 0.06); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.65rem 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--low);
  color: var(--low);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s;
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ——— Chat UI ——— */
.chat-page { overflow: hidden; }

.chat-shell {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 0.65rem;
  max-width: 92%;
  animation: fadeUp 0.35s ease-out;
}

.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bot { align-self: flex-start; }

.msg-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.msg-user .msg-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.msg-bot .msg-avatar {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
}

.msg-body {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  border: 1px solid var(--border);
}

.msg-user .msg-body {
  background: linear-gradient(135deg, rgba(91, 157, 255, 0.22), rgba(168, 85, 247, 0.18));
  border-color: rgba(91, 157, 255, 0.35);
  border-bottom-right-radius: 4px;
}

.msg-bot .msg-body {
  background: rgba(14, 20, 36, 0.85);
  border-bottom-left-radius: 4px;
}

.msg-body .inline-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.65rem;
  flex-shrink: 0;
}

.suggestion-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(91, 157, 255, 0.12);
}

.chat-input-row {
  display: flex;
  gap: 0.55rem;
  padding: 0.65rem 1rem 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-row input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.92rem;
}

.chat-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.2);
}

.chat-input-row .btn-primary {
  flex-shrink: 0;
  min-width: 88px;
}

.chat-advanced {
  margin: 0 1rem 0.75rem;
  flex-shrink: 0;
}

.analysis-card {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.analysis-card.risk-low { border-color: rgba(52, 211, 153, 0.35); }
.analysis-card.risk-medium { border-color: rgba(251, 191, 36, 0.35); }
.analysis-card.risk-high { border-color: rgba(248, 113, 113, 0.4); }

.analysis-score-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.analysis-score {
  font-family: "Syne", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
}

.analysis-card.risk-low .analysis-score { color: var(--low); }
.analysis-card.risk-medium .analysis-score { color: var(--medium); }
.analysis-card.risk-high .analysis-score { color: var(--high); }

.demo-badge.inline {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.2rem 0.45rem;
  margin-left: 0.25rem;
}

.analysis-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.analysis-alerts {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
}

.analysis-alerts li {
  font-size: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-alerts li.none { color: var(--low); }

.analysis-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.analysis-features span {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.analysis-tx {
  width: 100%;
  font-size: 0.7rem;
  margin-top: 0.35rem;
}

.analysis-tx th,
.analysis-tx td {
  padding: 0.4rem 0.35rem;
}

@media (max-width: 600px) {
  .chat-shell { padding: 0.75rem 0.5rem; }
  .chat-msg { max-width: 96%; }
}
