/* DFN Casefile - Detective Interactive Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* DFN Brand Colors - Darker Theme */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --fg-0: #f0e6d2;
  --fg-1: #c8bfa9;
  --accent: #ffd447;
  --border: #222;
  --dfn-bg: #000000;
  --dfn-card: #0a0a0a;
  --dfn-radius: 14px;
  
  /* Detective Colors */
  --detective-red: #dc2626;
  --detective-blue: #1d4ed8;
  --detective-green: #059669;
  --detective-yellow: #d97706;
  --detective-purple: #7c3aed;
  
  /* Modern Gradients */
  --gradient-primary: linear-gradient(135deg, #ffd447 0%, #ffb347 100%);
  --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-dark: linear-gradient(135deg, #000000 0%, #111111 50%, #000000 100%);
  --gradient-glass: rgba(10, 10, 10, 0.8);
  --gradient-card: linear-gradient(180deg, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.9));
  
  /* Typography */
  --font-primary: "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(255, 212, 71, 0.3);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s ease;
  --transition-slow: 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.55;
  color: var(--fg-0);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  opacity: 0;
  animation: fadeInFromDark 2s ease-out forwards;
  position: relative;
}

/* Detective Background with SVG Elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 212, 71, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(200, 191, 169, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 107, 53, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 60% 60%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
    var(--bg-0);
  animation: backgroundShift 25s ease-in-out infinite;
  z-index: -1;
}

/* Modern SVG Graphics */
.modern-graphics {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.graphic-element {
  position: absolute;
  opacity: 0.06;
  animation: graphicFloat 10s ease-in-out infinite;
}

.graphic-element:nth-child(1) { top: 8%; left: 8%; animation-delay: 0s; }
.graphic-element:nth-child(2) { top: 15%; right: 12%; animation-delay: 1s; }
.graphic-element:nth-child(3) { top: 25%; left: 15%; animation-delay: 2s; }
.graphic-element:nth-child(4) { top: 35%; right: 8%; animation-delay: 3s; }
.graphic-element:nth-child(5) { top: 45%; left: 10%; animation-delay: 4s; }
.graphic-element:nth-child(6) { top: 55%; right: 15%; animation-delay: 5s; }
.graphic-element:nth-child(7) { top: 65%; left: 12%; animation-delay: 6s; }
.graphic-element:nth-child(8) { top: 75%; right: 10%; animation-delay: 7s; }
.graphic-element:nth-child(9) { top: 85%; left: 8%; animation-delay: 8s; }
.graphic-element:nth-child(10) { top: 95%; right: 12%; animation-delay: 9s; }
.graphic-element:nth-child(11) { top: 12%; left: 25%; animation-delay: 10s; }
.graphic-element:nth-child(12) { top: 22%; right: 25%; animation-delay: 11s; }
.graphic-element:nth-child(13) { top: 32%; left: 30%; animation-delay: 12s; }
.graphic-element:nth-child(14) { top: 42%; right: 30%; animation-delay: 13s; }
.graphic-element:nth-child(15) { top: 52%; left: 35%; animation-delay: 14s; }
.graphic-element:nth-child(16) { top: 62%; right: 35%; animation-delay: 15s; }
.graphic-element:nth-child(17) { top: 72%; left: 40%; animation-delay: 16s; }
.graphic-element:nth-child(18) { top: 82%; right: 40%; animation-delay: 17s; }
.graphic-element:nth-child(19) { top: 92%; left: 45%; animation-delay: 18s; }
.graphic-element:nth-child(20) { top: 18%; left: 50%; animation-delay: 19s; }

/* Detective & Investigation Icons */
.magnifying-glass {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 12px rgba(255, 212, 71, 0.5));
}

.fingerprint {
  width: 45px;
  height: 45px;
  fill: var(--detective-blue);
  opacity: 0.6;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.5));
}

.evidence-tag {
  width: 40px;
  height: 40px;
  fill: var(--detective-red);
  opacity: 0.5;
  filter: drop-shadow(0 0 7px rgba(220, 38, 38, 0.5));
}

.detective-hat {
  width: 55px;
  height: 55px;
  fill: var(--detective-purple);
  opacity: 0.4;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.5));
}

.handcuffs {
  width: 42px;
  height: 42px;
  fill: var(--detective-green);
  opacity: 0.5;
  filter: drop-shadow(0 0 9px rgba(5, 150, 105, 0.5));
}

/* Finance & Money Icons */
.money-bag {
  width: 48px;
  height: 48px;
  fill: var(--accent);
  opacity: 0.4;
  filter: drop-shadow(0 0 8px rgba(255, 212, 71, 0.4));
}

.chart-line {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: var(--detective-green);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 6px rgba(5, 150, 105, 0.4));
}

.coins {
  width: 46px;
  height: 46px;
  fill: var(--accent);
  opacity: 0.3;
  filter: drop-shadow(0 0 7px rgba(255, 212, 71, 0.4));
}

.bank {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: var(--detective-blue);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.4));
}

/* Court & Law Icons */
.scales {
  width: 54px;
  height: 54px;
  fill: var(--detective-purple);
  opacity: 0.3;
  filter: drop-shadow(0 0 9px rgba(124, 58, 237, 0.4));
}

.gavel {
  width: 44px;
  height: 44px;
  fill: var(--detective-red);
  opacity: 0.4;
  filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.4));
}

.document {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--fg-1);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 7px rgba(200, 191, 169, 0.4));
}

.court {
  width: 52px;
  height: 52px;
  fill: var(--detective-blue);
  opacity: 0.3;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.4));
}

/* Technology & Security Icons */
.shield {
  width: 56px;
  height: 56px;
  fill: var(--detective-green);
  opacity: 0.3;
  filter: drop-shadow(0 0 10px rgba(5, 150, 105, 0.4));
}

.lock {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 6px rgba(255, 212, 71, 0.4));
}

.camera {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: var(--detective-blue);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.4));
}

.radar {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: var(--detective-purple);
  stroke-width: 1.5;
  opacity: 0.3;
  filter: drop-shadow(0 0 9px rgba(124, 58, 237, 0.4));
}

/* Investigation Tools Icons */
.flashlight {
  width: 46px;
  height: 46px;
  fill: var(--accent);
  opacity: 0.4;
  filter: drop-shadow(0 0 7px rgba(255, 212, 71, 0.4));
}

.binoculars {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: var(--detective-green);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 8px rgba(5, 150, 105, 0.4));
}

.telescope {
  width: 48px;
  height: 48px;
  fill: var(--detective-blue);
  opacity: 0.3;
  filter: drop-shadow(0 0 7px rgba(29, 78, 216, 0.4));
}

.microscope {
  width: 50px;
  height: 50px;
  fill: none;
  stroke: var(--detective-red);
  stroke-width: 1.5;
  opacity: 0.4;
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4));
}

/* Detective Animations */
@keyframes graphicFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg) scale(1); 
    opacity: 0.06;
  }
  25% { 
    transform: translateY(-30px) rotate(12deg) scale(1.1); 
    opacity: 0.12;
  }
  50% { 
    transform: translateY(-20px) rotate(-8deg) scale(1.15); 
    opacity: 0.18;
  }
  75% { 
    transform: translateY(-25px) rotate(5deg) scale(1.1); 
    opacity: 0.12;
  }
}

@keyframes logoGlow {
  0%, 100% { 
    filter: drop-shadow(0 0 30px rgba(255, 212, 71, 0.6)) drop-shadow(0 0 60px rgba(255, 212, 71, 0.3));
  }
  50% { 
    filter: drop-shadow(0 0 40px rgba(255, 212, 71, 0.8)) drop-shadow(0 0 80px rgba(255, 212, 71, 0.5));
  }
}

@keyframes titlePulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(255, 212, 71, 0.3));
  }
  50% { 
    transform: scale(1.02);
    filter: drop-shadow(0 0 20px rgba(255, 212, 71, 0.6));
  }
}

@keyframes magnifyFloat {
  0%, 100% { 
    transform: translateX(-50%) translateY(0px) rotate(0deg) scale(1); 
  }
  25% { 
    transform: translateX(-50%) translateY(-15px) rotate(5deg) scale(1.1); 
  }
  50% { 
    transform: translateX(-50%) translateY(-10px) rotate(-3deg) scale(1.15); 
  }
  75% { 
    transform: translateX(-50%) translateY(-12px) rotate(2deg) scale(1.1); 
  }
}

@keyframes backgroundShift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-10px, -10px) scale(1.05); }
  50% { transform: translate(10px, -5px) scale(1.02); }
  75% { transform: translate(-5px, 10px) scale(1.03); }
}

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

@keyframes scan {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes stampPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes statusScan {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes fadeInFromDark {
  0% {
    opacity: 0;
    background: #000;
    transform: scale(0.95);
  }
  60% {
    background: #000;
  }
  100% {
    opacity: 1;
    background: var(--bg-0);
    transform: scale(1);
  }
}

/* Staggered content animation */
.wrap {
  opacity: 0;
  animation: slideInUp 0.8s ease-out 0.6s forwards;
}

/* Case container animation when shown */
#case {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

#case.show {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure smooth content appearance */
#case .section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#case.show .section {
  opacity: 1;
  transform: translateY(0);
}

#case.show .section:nth-child(1) { transition-delay: 0.1s; }
#case.show .section:nth-child(2) { transition-delay: 0.2s; }
#case.show .section:nth-child(3) { transition-delay: 0.3s; }
#case.show .section:nth-child(4) { transition-delay: 0.4s; }
#case.show .section:nth-child(5) { transition-delay: 0.5s; }
#case.show .section:nth-child(6) { transition-delay: 0.6s; }

@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header animation */
h1 {
  opacity: 0;
  animation: fadeInTitle 1.0s ease-out 0.4s forwards;
}

@keyframes fadeInTitle {
  0% {
    opacity: 0;
    transform: translateY(-20px);
    letter-spacing: 0.2em;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.05em;
  }
}

@keyframes fadeInContent {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Background Effects */
#bgfx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  opacity: 0;
  animation: fadeInBackground 2.5s ease-out 0.8s forwards;
}

@keyframes fadeInBackground {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.8;
  }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, transparent 0%, rgba(251, 191, 36, 0.02) 50%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

/* DFN Brand Header */
.dfn-header {
  text-align: center;
  position: relative;
  padding: 40px 20px 30px;
  margin-bottom: var(--space-2xl);
}

/* DFN Logo with Glow */
.dfn-logo {
  display: block;
  margin: 0 auto 20px;
  width: 120px;
  height: auto;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(255, 212, 71, 0.6)) drop-shadow(0 0 60px rgba(255, 212, 71, 0.3));
  animation: logoGlow 4s ease-in-out infinite;
}

.dfn-logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* Service Title */
.service-title {
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
  position: relative;
  animation: titlePulse 3s ease-in-out infinite;
}

.service-title::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd447' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  animation: magnifyFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 212, 71, 0.8));
}

.service-title::after {
  content: '🔍';
  position: absolute;
  top: -15px;
  right: 15%;
  font-size: 2rem;
  animation: float 5s ease-in-out infinite;
  animation-delay: 1s;
  filter: drop-shadow(0 0 10px rgba(255, 212, 71, 0.5));
}

/* Service Subtitle */
.service-subtitle {
  color: var(--fg-1);
  font-size: 1.3rem;
  margin: 0;
  opacity: 0.9;
  position: relative;
  font-weight: 500;
}

.service-subtitle::before {
  content: '🕵️';
  position: absolute;
  left: 25%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  animation: float 6s ease-in-out infinite;
  animation-delay: 2s;
  filter: drop-shadow(0 0 8px rgba(255, 212, 71, 0.4));
}

.service-subtitle::after {
  content: '📋';
  position: absolute;
  right: 25%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  animation: float 5s ease-in-out infinite;
  animation-delay: 3s;
  filter: drop-shadow(0 0 8px rgba(255, 212, 71, 0.4));
}
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

.mono {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-variant-ligatures: common-ligatures;
}

/* Layout */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

/* Glassmorphism Card */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--dfn-radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible; /* allow dropdowns (mint suggestions) to overflow */
  transition: all var(--transition-normal);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--dfn-radius) var(--dfn-radius) 0 0;
}

.card:hover::before {
  opacity: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 212, 71, 0.45);
}

/* Detective Card Decoration */
.card::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd447'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  opacity: 0.3;
  animation: pulse 4s ease-in-out infinite;
  animation-delay: 2s;
}

/* Mint input with suggestions */
.mint-wrap {
  position: relative;
  width: 100%;
  z-index: 50; /* place above card chrome */
}

/* give room for clear button inside the input */
.mint-wrap input[type="text"] {
  padding-right: 40px;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.clear-btn::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
}

.clear-btn:hover { color: var(--text-primary); }
.clear-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 2147483647 !important; /* MAXIMUM z-index */
  background: rgba(17, 17, 17, 0.95); /* Slightly transparent background */
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  max-height: 300px;
  overflow: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.suggestions.fixed { position: fixed; }

/* Desktop suggestions - default positioning */
@media (min-width: 769px) {
  .suggestions {
    position: absolute !important;
    z-index: 2147483647 !important; /* MAXIMUM z-index */
    background: rgba(17, 17, 17, 0.95) !important; /* Slightly transparent background */
    border: 1px solid var(--border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    /* Prevent any unwanted position changes */
    transform: none !important;
    transition: none !important;
  }
}

/* Mobile-specific suggestions positioning */
@media (max-width: 768px) {
  .suggestions {
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    left: 10px !important;
    right: 10px !important;
    max-height: 200px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    background: rgba(17, 17, 17, 0.95) !important; /* Slightly transparent background */
    border: 1px solid var(--border) !important;
    transform: translateY(0) !important;
    transition: opacity 0.2s ease-out !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    /* Force viewport positioning */
    position: fixed !important;
    transform: none !important;
    /* Ensure it's above everything */
    z-index: 2147483647 !important;
  }
  
  .suggestions[style*="display: block"] {
    opacity: 1 !important;
  }
  
  .suggestions .item {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(255, 212, 71, 0.2) !important;
  }
  
  .suggestions .item:last-child {
    border-bottom: none !important;
  }
  
  .suggestions .item:hover,
  .suggestions .item.active {
    background: rgba(255, 212, 71, 0.1) !important;
  }
  
  .suggestions .item:active {
    background: rgba(255, 212, 71, 0.2) !important;
  }
  
  .suggestions .name {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
  }
  
  .suggestions .addr {
    font-size: 0.75rem !important;
    opacity: 0.7 !important;
  }
  
  .suggestions .extra {
    font-size: 0.7rem !important;
    opacity: 0.6 !important;
  }
}

/* Global suggestions styling - ensure visibility */
/* Mobile-specific suggestions positioning */
@media (max-width: 768px) {
  .suggestions {
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    left: 10px !important;
    right: 10px !important;
    max-height: 200px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    background: rgba(17, 17, 17, 0.95) !important; /* Slightly transparent background */
    border: 1px solid var(--border) !important;
    transition: opacity 0.2s ease-out !important;
    z-index: 2147483647 !important;
    opacity: 0 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    /* Force visibility */
    visibility: visible !important;
    display: block !important;
    /* Remove any transforms that might interfere */
    transform: none !important;
    /* Ensure above everything including status line */
    z-index: 2147483647 !important;
  }
  
  .suggestions .item {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(255, 212, 71, 0.2) !important;
  }
  
  .suggestions .item:last-child {
    border-bottom: none !important;
  }
  
  .suggestions .item:hover,
  .suggestions .item.active {
    background: rgba(255, 212, 71, 0.1) !important;
  }
  
  .suggestions .item:active {
    background: rgba(255, 212, 71, 0.2) !important;
  }
  
  .suggestions .name {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
  }
  
  .suggestions .addr {
    font-size: 0.75rem !important;
    opacity: 0.7 !important;
  }
  
  .suggestions .extra {
    font-size: 0.7rem !important;
    opacity: 0.6 !important;
  }
}

/* Force suggestions to be visible when displayed */
.suggestions[style*="display: block"],
.suggestions[style*="display:block"] {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  z-index: 2147483647 !important;
  position: fixed !important;
}

/* CRITICAL: Force suggestions above everything */
#mint-suggest {
  z-index: 2147483647 !important;
  position: absolute !important;
}

#mint-suggest[style*="display: block"],
#mint-suggest[style*="display:block"] {
  z-index: 2147483647 !important;
  position: absolute !important;
  pointer-events: auto !important;
}

/* CRITICAL: Prevent hidden suggestions from blocking clicks */
#mint-suggest[style*="display: none"],
#mint-suggest[style*="display:none"] {
  z-index: auto !important;
  pointer-events: none !important;
  position: absolute !important;
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .suggestions {
    max-height: 30vh !important;
    bottom: 10px !important;
  }
}

.suggestions .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
}

.suggestions .item:last-child {
  border-bottom: none;
}

.suggestions .item:hover,
.suggestions .item.active { 
  background: rgba(255, 212, 71, 0.1); 
}

.suggestions .name { 
  color: var(--text-primary); 
  font-weight: 600; 
  text-align: left;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions .addr { 
  color: var(--text-muted); 
  font-family: 'JetBrains Mono', monospace; 
  font-size: 12px; 
  text-align: right;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions .extra { 
  color: var(--text-secondary); 
  font-size: 12px; 
}

/* Header */
h1 {
  text-align: center;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* Desktop alignment: keep WINDOW label inline with select */
@media (min-width: 769px) {
  .row.row-secondary > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .row.row-secondary > div:first-child > label {
    margin: 0 6px 0 0;
    white-space: nowrap;
  }
}

/* Form Elements */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"], select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  transition: all var(--transition-normal);
  outline: none;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="text"]:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Select dropdown styling */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: var(--font-primary);
  letter-spacing: 0.025em;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  background: var(--accent);
  color: #000;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.06);
}

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

.btn.secondary {
  background: var(--bg-2);
  color: var(--fg-1);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: var(--bg-1);
  border-color: rgba(255, 212, 71, 0.45);
}

/* Detective Button Effects */
.btn[data-action="generate"]::after {
  content: '🔍';
  position: absolute;
  right: 10px;
  font-size: 0.8rem;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
}

.btn[data-action="refresh"]::after {
  content: '🔄';
  position: absolute;
  right: 10px;
  font-size: 0.8rem;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
  animation-delay: 1s;
}

.btn[data-action="share"]::after {
  content: '📤';
  position: absolute;
  right: 10px;
  font-size: 0.8rem;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
  animation-delay: 2s;
}

/* Fast Mode button styling */
#fast-generate {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-color: #ff6b6b;
  color: white;
  font-weight: 600;
}

#fast-generate:hover {
  background: linear-gradient(135deg, #ff5252, #e74c3c);
  border-color: #ff5252;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Layout Grid */
.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center; /* desktop: vertically center-align all items */
}

.row > * {
  flex: 1 1 200px;
}

.opts {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.opts label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.opts input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent-primary);
}

/* Case Grid */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

/* Sections */
.section {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--dfn-radius);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  animation: slideIn 0.6s ease-out;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }
.section:nth-child(6) { animation-delay: 0.6s; }

.section:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--dfn-radius) var(--dfn-radius) 0 0;
}

.section:hover::before {
  opacity: 0;
}

/* Detective Section Icons */
.section[data-type="token"]::after {
  content: '🪪';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
}

.section[data-type="poi"]::after {
  content: '👥';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: 1s;
}

.section[data-type="timeline"]::after {
  content: '⏰';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: 2s;
}

.section[data-type="evidence"]::after {
  content: '🔍';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: 3s;
}

.section[data-type="red-flags"]::after {
  content: '🚨';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: 4s;
}

.section[data-type="alibis"]::after {
  content: '✅';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: 5s;
}

/* Token card */
.token-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.token-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #111318; border: 1px solid var(--border-primary); }

.token-header { display: flex; align-items: center; gap: 10px; }

.token-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.token-title { font-weight: 700; }
.token-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.token-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.token-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin-top: 6px; min-width: 0; }
.token-stat { background: rgba(255,255,255,0.03); border: 1px solid var(--border-primary); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.token-stat .label { color: var(--text-muted); font-size: 12px; }
.token-stat .value { font-family: 'JetBrains Mono', monospace; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Paper Effect */
.paper {
  position: relative;
}

.paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1px, transparent 0);
  background-size: 20px 20px;
  opacity: 0.1;
  pointer-events: none;
  border-radius: inherit;
}

/* Stamp */
.stamp {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--accent-warning);
  border-radius: var(--radius-md);
  color: var(--accent-warning);
  background: rgba(251, 191, 36, 0.1);
  transform: rotate(-2deg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.stamp::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.stamp.stamp-in {
  animation: stampIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stamp.stamp-in::before {
  transform: translateX(100%);
}

@keyframes stampIn {
  0% { 
    transform: scale(0.8) rotate(-8deg);
    opacity: 0;
    filter: blur(4px);
  }
  60% { 
    transform: scale(1.1) rotate(-1deg);
    opacity: 1;
    filter: blur(0);
  }
  100% { 
    transform: scale(1) rotate(-2deg);
  }
}

/* Evidence section - shorter with scroll */
.section:has(#evidence) {
  max-height: 50vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section:has(#evidence) .muted {
  flex-shrink: 0;
}

.section:has(#evidence) #evidenceFilter {
  flex-shrink: 0;
}

.section:has(#evidence) #evidence {
  flex: 1;
  overflow-y: auto;
  max-height: none;
  margin: 0.5rem 0 0;
  padding-left: 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section:has(#evidence) #evidence::-webkit-scrollbar {
  display: none;
}

/* Lists */
.list {
  margin: 1rem 0 0;
  padding-left: 1.5rem;
}

.list li {
  line-height: 1.5;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border-secondary);
  word-break: break-word;
  transition: all var(--transition-fast);
}

.list li:hover {
  background: rgba(59, 130, 246, 0.05);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  border-radius: var(--radius-sm);
}

.list li:last-child {
  border-bottom: none;
}

/* Links - Detective Style */
a.link {
  color: var(--text-primary);
  text-decoration: none;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  display: inline-block;
}

a.link:hover {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(139, 92, 246, 0.2));
  border-color: var(--text-accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

a.link::before {
  content: '🔍';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

a.link:hover::before {
  opacity: 1;
}

/* Confidence Line - Minimalist */
.confidence-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confidence-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
}

.confidence-label {
  color: var(--text-muted);
  font-weight: 500;
}

.confidence-value {
  color: var(--text-primary);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.confidence-status {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  margin-left: auto;
}

.confidence-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.confidence-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    #d14a49 0%, 
    #f1b916 50%, 
    #49d17b 100%
  );
  border-radius: 2px;
  transition: width 1s ease-out;
}

/* Confidence levels - subtle variations */
.confidence-line[data-level="low"] .confidence-fill {
  background: #d14a49;
}

.confidence-line[data-level="medium"] .confidence-fill {
  background: linear-gradient(90deg, #d14a49 0%, #f1b916 100%);
}

.confidence-line[data-level="high"] .confidence-fill {
  background: linear-gradient(90deg, #d14a49 0%, #f1b916 50%, #49d17b 100%);
}

.confidence-line[data-level="low"] .confidence-value {
  color: #ff6b6b;
}

.confidence-line[data-level="medium"] .confidence-value {
  color: #ffd93d;
}

.confidence-line[data-level="high"] .confidence-value {
  color: #5dd68a;
}

/* Trust reasons list */
.trust-reasons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
}

.trust-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}

.trust-reason .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.trust-reason .label {
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.trust-reason .delta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* Cluster details */
/* Cluster details */
.cluster-details {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}

.cluster-details .rowx {
  gap: 8px;
  flex-wrap: wrap;
}

.cluster-details .meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.cluster-toggle {
  color: var(--accent);
  cursor: pointer;
  margin-left: 6px;
  font-size: 0.85rem;
  background: rgba(255, 212, 71, 0.1);
  border: 1px solid rgba(255, 212, 71, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  transition: all var(--transition-fast);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

.cluster-toggle:hover {
  background: rgba(255, 212, 71, 0.2);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 212, 71, 0.2);
}

.cluster-toggle::before {
  content: '🔍';
  margin-right: 4px;
  font-size: 0.75rem;
  opacity: 0.8;
}

.cluster-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Status line */
.status-line {
  margin: 16px 0 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 0 !important; /* MINIMUM z-index to stay below suggestions */
}

.status-line:not(:empty) {
  opacity: 1;
}

.status-line:empty {
  opacity: 0;
  margin: 0;
  padding: 0;
  height: 0;
}

/* Status states */
.status-line.ready {
  border-color: rgba(73, 209, 123, 0.3);
  background: rgba(73, 209, 123, 0.05);
  color: #5dd68a;
}

.status-line.generating {
  border-color: rgba(241, 185, 22, 0.3);
  background: rgba(241, 185, 22, 0.05);
  color: #ffd93d;
}

.status-line.error {
  border-color: rgba(209, 74, 73, 0.3);
  background: rgba(209, 74, 73, 0.05);
  color: #ff6b6b;
}

/* Generating animation */
.status-line.generating::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(241, 185, 22, 0.1), transparent);
  animation: statusScan 2s ease-in-out infinite;
}

@keyframes statusScan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Scanning animation */
@keyframes scan {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

.barcode-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.3) 50%,
    transparent 100%
  );
  animation: scan 2s ease-in-out infinite;
  pointer-events: none;
}

.barcode-container {
  position: relative;
}

/* Utility Classes */
.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rowx {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Status */
#status {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  transition: all var(--transition-normal);
}

#status:not(:empty) {
  background: var(--bg-glass);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .wrap {
    padding: 1.5rem 1rem;
  }
}

/* Ripple Effect Animation */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .modern-graphics {
    display: block; /* Show SVG graphics on mobile */
    opacity: 0.8; /* Slightly reduce opacity for better performance */
  }
  
  .graphic-element {
    opacity: 0.04; /* Reduce opacity on mobile for better performance */
    animation-duration: 15s; /* Slower animation on mobile */
  }
  
  /* Ensure background animation works on mobile */
  body::before {
    animation-duration: 30s; /* Slower background animation on mobile */
  }
  
  /* Safari iOS specific optimizations */
  @supports (-webkit-touch-callout: none) {
    .modern-graphics {
      will-change: transform; /* Optimize for Safari */
    }
    
    .graphic-element {
      will-change: transform, opacity; /* Optimize animations for Safari */
    }
    
    body::before {
      will-change: transform; /* Optimize background animation for Safari */
    }
  }
  
  .dfn-header {
    padding: 20px 10px 15px;
  }
  
  .dfn-logo {
    width: 80px;
  }
  
  .service-title {
    font-size: 2.5rem;
    position: relative; /* Ensure proper positioning for pseudo-elements */
  }
  
  .service-subtitle {
    font-size: 1rem;
    position: relative; /* Ensure proper positioning for pseudo-elements */
  }
  
  .service-subtitle::before,
  .service-subtitle::after {
    display: block; /* Show floating emojis on mobile */
    opacity: 0.7; /* Slightly reduce opacity for better performance */
    animation-duration: 8s; /* Slower animation on mobile */
    position: absolute; /* Ensure proper positioning */
  }
  
  .service-subtitle::before {
    left: -2%; /* Position detective emoji slightly outside the screen left */
    top: 50%;
    transform: translateY(-50%);
  }
  
  .service-subtitle::after {
    right: -2%; /* Position clipboard emoji slightly outside the screen right */
    top: 50%;
    transform: translateY(-50%);
  }
  
  .service-title::before,
  .service-title::after {
    display: block; /* Show floating elements on mobile */
    opacity: 0.7; /* Slightly reduce opacity for better performance */
    animation-duration: 8s; /* Slower animation on mobile */
    position: absolute; /* Ensure proper positioning */
  }
  
  .service-title::before {
    top: -30px; /* Position magnifying glass above title */
    left: -5%; /* Position slightly outside the screen left */
    transform: translateX(-50%);
  }
  
  .service-title::after {
    top: -20px; /* Position emoji above title */
    right: -5%; /* Position slightly outside the screen right */
  }
  
  .share-buttons {
    display: none !important;
  }
  
  .share-buttons.show {
    display: block !important;
  }
  
  .input-group {
    margin-bottom: 1rem;
  }
  
  .input-group input {
    margin-bottom: 0.5rem;
  }
  
  .section {
    padding: var(--space-md);
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  .btn {
    min-height: 48px; /* Larger touch targets on mobile */
  }
  
  /* Disable hover effects on mobile */
  .card:hover,
  .section:hover,
  .btn:hover {
    transform: none;
  }
  
  .wrap {
    padding: 1rem;
  }
  
  /* ===== УЛЬТРА-КОМПАКТНАЯ КАРТОЧКА TOKEN MINT ===== */
  .card {
    padding: 6px !important;
    margin-bottom: 4px !important;
    border-radius: 8px !important;
  }
  
  /* ВСЕ СТРОКИ ВЕРТИКАЛЬНО С МИНИМАЛЬНЫМИ ОТСТУПАМИ */
  .row {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 2px !important;
    align-items: stretch !important;
  }
  
  /* ВТОРАЯ СТРОКА БЕЗ ОТСТУПА СВЕРХУ */
  .row-secondary {
    margin-top: 2px !important;
  }
  
  /* МИНИМАЛЬНЫЕ ЛЕЙБЛЫ */
  .card label,
  label {
    margin: 0 !important;
    margin-bottom: 1px !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }
  
  /* OPTS ВЕРТИКАЛЬНО БЕЗ ОТСТУПОВ */
  .opts {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 1px !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  
  /* ЧЕКБОКС ЛЕЙБЛЫ МИНИМАЛЬНЫЕ */
  .opts label.rowx {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    line-height: 1.1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    text-transform: none !important;
  }
  
  /* КНОПКИ ВЕРТИКАЛЬНО БЕЗ ОТСТУПОВ */
  .button-group {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  
  .share-buttons {
    display: none !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  
  .share-buttons.show {
    display: block !important;
  }
  
  .action-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin-left: 0 !important;
  }
  
  /* УЛЬТРА-КОМПАКТНЫЕ ИНПУТЫ */
  input[type="text"], 
  select {
    padding: 3px 5px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 13px !important;
    border-radius: 3px !important;
    line-height: 1.1 !important;
    margin: 0 !important;
  }
  
  /* УЛЬТРА-КОМПАКТНЫЕ КНОПКИ */
  .btn {
    padding: 4px 6px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    font-size: 0.7rem !important;
    border-radius: 3px !important;
    line-height: 1.1 !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: center !important;
  }
  
  /* Отступ между полем ввода и кнопками */
  .row-secondary {
    margin-top: 16px !important;
  }
  
  /* УБИРАЕМ ВСЕ ДОЧЕРНИЕ ОТСТУПЫ */
  .row > div {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .row > div:first-child {
    margin-bottom: 8px !important;
  }
  
  .card > * {
    margin-bottom: 8px !important;
  }
  
  .card > *:last-child {
    margin-bottom: 0 !important;
  }
  
  /* ЧЕКБОКСЫ КОМПАКТНЫЕ */
  input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    margin-right: 3px !important;
  }
  
  /* Confidence adjustments */
  .confidence-header {
    gap: 8px;
    font-size: 0.8rem;
  }
  
  .confidence-value {
    font-size: 0.85rem;
  }
  
  .confidence-status {
    font-size: 0.7rem;
  }
  
  /* Footer mobile styles */
  .footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
    /* Ensure no background on mobile */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .disclaimer {
    font-size: 0.8rem;
    padding: 0 var(--space-sm);
    /* Ensure no background on mobile */
    background: transparent !important;
    border: none !important;
  }
}

/* Desktop styles for new classes */
.row-secondary {
  margin-top: 10px;
}

.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* ===== ПРИНУДИТЕЛЬНОЕ ОБНОВЛЕНИЕ КЭША v3.14 ===== */
/* КРИТИЧЕСКИЙ МОБИЛЬНЫЙ OVERRIDE - МАКСИМАЛЬНАЯ СПЕЦИФИЧНОСТЬ */
@media screen and (max-width: 768px) and (orientation: portrait),
       screen and (max-width: 768px) and (orientation: landscape) {
  
  /* FORCE CACHE REFRESH - v3.14 */
  
  /* ПРОФЕССИОНАЛЬНАЯ МОБИЛЬНАЯ КАРТОЧКА */
  body .wrap .card {
    padding: 12px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
  }
  
  /* ОРГАНИЧНЫЕ ОТСТУПЫ МЕЖДУ СЕКЦИЯМИ */
  body .wrap .card .row,
  body .wrap .card .row.row-secondary {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  
  /* Отступ между первой и второй строкой */
  body .wrap .card .row-secondary {
    margin-top: 8px !important;
  }
  
  /* ПРОФЕССИОНАЛЬНЫЕ ОТСТУПЫ МЕЖДУ ЭЛЕМЕНТАМИ */
  body .wrap .card .row > div,
  body .wrap .card .row-secondary > div {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Отступы между секциями: Window → Чекбоксы → Кнопки */
  body .wrap .card .row-secondary > div:nth-child(1) {
    margin-bottom: 6px !important;
  }
  
  body .wrap .card .row-secondary > div:nth-child(2) {
    margin-bottom: 8px !important;
  }
  
  body .wrap .card .row-secondary > div:nth-child(3) {
    margin-bottom: 0 !important;
  }
  
  /* ПРОФЕССИОНАЛЬНЫЕ ЛЕЙБЛЫ */
  body .wrap .card label {
    margin: 0 !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    font-weight: 500 !important;
  }
  
  /* ОПЦИИ С ПРАВИЛЬНЫМИ ОТСТУПАМИ */
  body .wrap .card .opts {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    align-items: flex-start !important;
  }
  
  body .wrap .card .opts label.rowx {
    margin: 0 !important;
    padding: 4px 0 !important;
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    gap: 6px !important;
    display: flex !important;
    align-items: center !important;
  }
  
  /* КНОПКИ С ПРОФЕССИОНАЛЬНЫМИ ОТСТУПАМИ */
  body .wrap .card .button-group {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }
  
  /* УДОБНЫЕ РАЗМЕРЫ ИНПУТОВ */
  body .wrap .card input[type="text"],
  body .wrap .card select {
    padding: 8px 10px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  
  /* УДОБНЫЕ КНОПКИ */
  body .wrap .card .btn {
    padding: 10px 12px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
    width: 100% !important;
    margin: 0 !important;
    font-weight: 600 !important;
  }
  
  /* УДОБНЫЕ ЧЕКБОКСЫ */
  body .wrap .card input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    margin-right: 6px !important;
  }
  
  /* FLEX КОНТРОЛЬ */
  body .wrap .card .row > *,
  body .wrap .card .row-secondary > * {
    flex: none !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
  }
  
  /* ГЛАВНЫЙ ЛЕЙБЛ TOKEN MINT */
  body .wrap .card > label:first-child {
    margin-bottom: 4px !important;
  }
  
  /* УБИРАЕМ КОНФЛИКТУЮЩИЕ СТИЛИ ИЗ ОБЫЧНЫХ МЕДИА-ЗАПРОСОВ */
  body .wrap .card .row > div:first-child {
    margin-bottom: 0 !important;
  }
}



/* Touch and Focus States */
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover,
  .link:hover {
    transform: none;
    box-shadow: none;
  }
  
  /* Enhanced touch feedback */
  .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  input[type="text"]:focus,
  select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }
  
  /* Larger touch targets for checkboxes */
  input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
  
  label.rowx {
    padding: 8px 0;
    cursor: pointer;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp borders on high DPI */
  .btn,
  .card,
  .section,
  input,
  select {
    border-width: 0.5px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Footer with Disclaimer */
.footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  /* Remove background and borders - make it transparent */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.footer.show {
  opacity: 1;
  transform: translateY(0);
}

.footer.show {
  opacity: 1;
  transform: translateY(0);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  text-align: center;
  /* Remove any background elements */
  background: transparent !important;
  border: none !important;
}

.disclaimer {
  color: var(--fg-1);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.8;
  font-weight: 400;
  max-width: 800px;
  margin: 0 auto;
  /* Remove any background elements */
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.disclaimer::before {
  content: '⚠️';
  display: block;
  font-size: 1.2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
}

/* Print view */
@media print {
  body { background: #fff; color: #000; }
  #bgfx, body::before { display: none !important; }
  .btn { display: none !important; }
  .section, .card { box-shadow: none; border-color: #ddd; background: #fff; }
  .wrap { max-width: 100%; padding: 0; }
}

/* iOS Safari focus-zoom fix: ensure controls have >=16px font-size */
@supports (-webkit-touch-callout: none) {
  input[type="text"],
  select,
  textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }
}