/* ==========================================================================
   KAVACH — High-End Forensic Verification Design System
   Visual Identity: DigiLocker Dark Blue & Vivid Purple Gradients · Glass / Backdrop-Blur · Floating Controls
   Inspired by: Apple iOS Floating Islands + Samsung One UI 8.5 + Glassmorphism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@1,9..144,400..700&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ─── DESIGN TOKENS (LIGHT MODE DEFAULT) ────────────────────────────── */
:root {
  /* Brand Accent: DigiLocker Dark Blue (#1a237e) & Purple (#673ab7 / #7c4dff) */
  --brand-orange:       #4527a0;
  --brand-orange-deep:  #1a237e;
  --brand-orange-amber: #7c4dff;
  --brand-orange-peach: #9575cd;
  --brand-orange-subtle:#ede7f6;

  /* Primary Button / Gradient Fills */
  --grad-primary:       linear-gradient(135deg, #7c4dff 0%, #4527a0 50%, #1a237e 100%);
  --grad-primary-hover: linear-gradient(135deg, #9575cd 0%, #512da8 50%, #1a237e 100%);
  --grad-primary-glow:  rgba(124, 77, 255, 0.35);
  --grad-amber-soft:    linear-gradient(135deg, rgba(124,77,255,0.14) 0%, rgba(26,35,126,0.08) 100%);

  /* Surface & Glass (Light) */
  --bg:                 #f8f9fd;
  --bg-gradient:        radial-gradient(at 10% 20%, rgba(124, 77, 255, 0.09) 0px, transparent 50%),
                        radial-gradient(at 90% 10%, rgba(26, 35, 126, 0.08) 0px, transparent 50%),
                        radial-gradient(at 50% 90%, rgba(149, 117, 205, 0.07) 0px, transparent 50%);
  --surface-glass:      rgba(255, 255, 255, 0.78);
  --surface-glass-card: rgba(255, 255, 255, 0.85);
  --surface-floating:   rgba(255, 255, 255, 0.86);
  --surface-solid:      #ffffff;
  --surface-input:      rgba(248, 250, 252, 0.85);

  /* Borders & Dividers */
  --border-glass:       rgba(255, 255, 255, 0.65);
  --border-subtle:      rgba(226, 232, 240, 0.85);
  --border-focus:       #4527a0;
  --border-focus-glow:  rgba(124, 77, 255, 0.28);

  /* Typography Colors */
  --text-main:          #0f172a;
  --text-primary:       #0f172a;
  --text-secondary:     #475569;
  --text-muted:         #64748b;
  --text-subtle:        #94a3b8;
  --text-on-orange:     #ffffff;

  /* Verdict Tones */
  --tone-green:         #10b981;
  --tone-green-glow:    rgba(16, 185, 129, 0.35);
  --tone-green-bg:      rgba(16, 185, 129, 0.09);
  --tone-green-text:    #065f46;

  --tone-yellow:        #f59e0b;
  --tone-yellow-glow:   rgba(245, 158, 11, 0.35);
  --tone-yellow-bg:     rgba(245, 158, 11, 0.09);
  --tone-yellow-text:   #92400e;

  --tone-red:           #ef4444;
  --tone-red-glow:      rgba(239, 68, 68, 0.38);
  --tone-red-bg:        rgba(239, 68, 68, 0.09);
  --tone-red-text:      #991b1b;

  /* Shadows (Soft Glass Elevation) */
  --shadow-float:       0 8px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card:        0 14px 40px rgba(15, 23, 42, 0.07), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-lg:          0 24px 64px rgba(15, 23, 42, 0.12), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-pill:        0 4px 16px rgba(124, 77, 255, 0.28);

  /* Dimensions & Radius */
  --pill:               9999px;
  --card-radius:        26px;
  --panel-radius:       20px;
}

/* ─── DARK THEME OVERRIDES ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:                 #080c14;
  --bg-gradient:        radial-gradient(at 10% 20%, rgba(124, 77, 255, 0.12) 0px, transparent 50%),
                        radial-gradient(at 90% 10%, rgba(92, 107, 192, 0.08) 0px, transparent 50%),
                        radial-gradient(at 50% 90%, rgba(26, 35, 126, 0.1) 0px, transparent 50%);
  --surface-glass:      rgba(15, 23, 42, 0.75);
  --surface-glass-card: rgba(18, 27, 48, 0.82);
  --surface-floating:   rgba(22, 32, 54, 0.86);
  --surface-solid:      #101726;
  --surface-input:      rgba(15, 23, 42, 0.85);

  --border-glass:       rgba(255, 255, 255, 0.12);
  --border-subtle:      rgba(255, 255, 255, 0.08);

  --text-main:          #f8fafc;
  --text-primary:       #f8fafc;
  --text-secondary:     #cbd5e1;
  --text-muted:         #94a3b8;
  --text-subtle:        #64748b;

  --tone-green-text:    #34d399;
  --tone-yellow-text:   #fbbf24;
  --tone-red-text:      #f87171;

  --shadow-float:       0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-card:        0 14px 48px rgba(0, 0, 0, 0.55);
  --shadow-lg:          0 24px 72px rgba(0, 0, 0, 0.65);
}

/* ─── BASE & RESET ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img, video, canvas {
  display: block;
  max-width: 100%;
}

/* ─── AMBIENT BACKGROUND ORBS (SMOOTH MESH MOTION) ─────────────────── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.page-result .ambient-orb {
  opacity: 0.22;
  filter: blur(80px);
}

.ambient-orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.35) 0%, rgba(26, 35, 126, 0.06) 70%, transparent 100%);
  top: -120px;
  left: -100px;
  animation: orb-drift-1 26s infinite alternate ease-in-out;
}

.ambient-orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(26, 35, 126, 0.35) 0%, rgba(149, 117, 205, 0.10) 70%, transparent 100%);
  bottom: -100px;
  right: -80px;
  animation: orb-drift-2 32s infinite alternate ease-in-out;
}

.ambient-orb-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(103, 58, 183, 0.25) 0%, transparent 75%);
  top: 40%;
  left: 60%;
  animation: orb-drift-3 22s infinite alternate ease-in-out;
}

@keyframes orb-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(120px, 80px) scale(1.15); }
  100% { transform: translate(40px, 140px) scale(0.95); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-100px, -70px) scale(1.1); }
  100% { transform: translate(-50px, -120px) scale(0.9); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(0, 0) scale(0.9); }
  50%  { transform: translate(-80px, 60px) scale(1.2); }
  100% { transform: translate(70px, -50px) scale(1); }
}

/* ─── TYPOGRAPHY & WORDMARK ────────────────────────────────────────── */
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.wordmark span.dot { display: none; }

/* ─── FLOATING CHROME (IOS / ONE UI 8.5 STYLE) ─────────────────────── */
.floating-chrome {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 max(20px, env(safe-area-inset-left));
  pointer-events: none;
  z-index: 900;
}

.floating-cluster-left,
.floating-cluster-right {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

/* Base Floating Control */
.float-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-floating);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-float);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              background 0.2s ease,
              border-color 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.float-ctrl:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  border-color: rgba(124, 77, 255, 0.4);
}

.float-ctrl:active {
  transform: scale(0.96);
}

/* Pill shape */
.float-pill {
  border-radius: var(--pill);
  padding: 8px 16px;
  height: 42px;
}

/* Circle shape */
.float-circle {
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
}

.float-ctrl svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: currentColor;
}

/* Specific Pill variants */
.brand-pill {
  padding: 8px 18px 8px 14px;
}

.brand-pill .wordmark {
  font-size: 19px;
}

.brand-pill .brand-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-right: 6px;
  filter: drop-shadow(0 2px 6px rgba(124, 77, 255, 0.45));
  transition: transform 0.25s ease;
}

.brand-pill:hover .brand-logo-img {
  transform: scale(1.08) rotate(-4deg);
}

.brand-pill .brand-k-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: url('/static/img/logo_transparent.png') center / contain no-repeat;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(124, 77, 255, 0.45));
  margin-right: 6px;
}

.login-logo-hero {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(124, 77, 255, 0.45));
  animation: logo-float 4s ease-in-out infinite alternate;
}

.landing-logo-hero {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 12px 32px rgba(124, 77, 255, 0.45));
  animation: logo-float 4s ease-in-out infinite alternate;
}

@keyframes logo-float {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.location-chip {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-glass);
}

.location-chip .loc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 8px var(--brand-orange);
  animation: pulse-dot 2.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

/* ─── BUTTONS & PILL CONTROLS ───────────────────────────────────────── */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 26px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              background 0.2s ease,
              filter 0.2s ease;
  white-space: nowrap;
}

.btn-pill:hover {
  transform: translateY(-2px);
}

.btn-pill:active {
  transform: scale(0.97);
}

.btn-primary-orange {
  background: var(--grad-primary);
  color: var(--text-on-orange);
  box-shadow: var(--shadow-pill);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-primary-orange:hover {
  background: var(--grad-primary-hover);
  box-shadow: 0 8px 26px rgba(124, 77, 255, 0.42);
}

.btn-ghost-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border-glass);
  color: var(--text-primary);
  box-shadow: var(--shadow-float);
}

.btn-ghost-glass:hover {
  background: rgba(124, 77, 255, 0.09);
  border-color: rgba(124, 77, 255, 0.35);
  color: var(--brand-orange-deep);
}

.btn-lg {
  padding: 15px 32px;
  font-size: 15.5px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

/* ─── GLASS CARDS & SURFACES ───────────────────────────────────────── */
.glass-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* ─── FORM INPUTS ──────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
  text-align: left;
}

.form-field label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-glass,
input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-input);
  color: var(--text-main, #0f172a) !important;
  -webkit-text-fill-color: var(--text-main, #0f172a) !important;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-glass:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--border-focus);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px var(--border-focus-glow);
  color: var(--text-main, #0f172a) !important;
  -webkit-text-fill-color: var(--text-main, #0f172a) !important;
}

.input-glass::placeholder,
input::placeholder {
  color: var(--text-muted, #64748b) !important;
  -webkit-text-fill-color: var(--text-muted, #64748b) !important;
  opacity: 1;
}

/* Chrome/Safari Autofill color fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
.input-glass:-webkit-autofill {
  -webkit-text-fill-color: #0f172a !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] .input-glass,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"] {
  color: var(--text-main, #f8fafc) !important;
  -webkit-text-fill-color: var(--text-main, #f8fafc) !important;
  background: rgba(15, 23, 42, 0.85);
}

[data-theme="dark"] .input-glass:focus,
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="email"]:focus {
  color: var(--text-main, #f8fafc) !important;
  -webkit-text-fill-color: var(--text-main, #f8fafc) !important;
}

[data-theme="dark"] .input-glass::placeholder,
[data-theme="dark"] input::placeholder {
  color: var(--text-muted, #94a3b8) !important;
  -webkit-text-fill-color: var(--text-muted, #94a3b8) !important;
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] .input-glass:-webkit-autofill {
  -webkit-text-fill-color: #f8fafc !important;
  box-shadow: 0 0 0 1000px #0f172a inset !important;
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
}

.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--tone-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--tone-red-text);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ─── LANDING PAGE ─────────────────────────────────────────────────── */
.landing-shell {
  min-height: 100vh;
  padding: 110px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 72px;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: var(--pill);
  background: var(--grad-amber-soft);
  border: 1px solid rgba(124, 77, 255, 0.25);
  color: var(--brand-orange-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.1);
}

.hero-pill-badge svg {
  width: 14px;
  height: 14px;
}

.hero-title {
  font-size: clamp(40px, 6.5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 22px;
}

.hero-title span.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Feature Grid */
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-bottom: 80px;
}

.feature-card {
  padding: 34px 28px;
  text-align: left;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 77, 255, 0.35);
  box-shadow: var(--shadow-lg);
}

.feature-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--grad-amber-soft);
  border: 1px solid rgba(124, 77, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
  margin-bottom: 22px;
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.12);
}

.feature-icon-badge svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* How It Works Steps */
.how-it-works {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: 32px;
  padding: 56px 40px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.section-head {
  max-width: 560px;
  margin: 0 auto 44px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 15px;
}

.steps-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  position: relative;
}

.step-box {
  background: var(--surface-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 30px 22px;
  text-align: left;
  position: relative;
}

.step-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-orange);
  background: var(--brand-orange-subtle);
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--pill);
  margin-bottom: 14px;
}

.step-box h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-box p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Trust / Cert Bar */
.trust-bar {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--brand-orange);
}

/* ─── LOGIN PAGE ───────────────────────────────────────────────────── */
.page-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 90px 20px 40px;
}

.login-card-wrap {
  width: min(100%, 430px);
  text-align: center;
}

.login-card {
  padding: 44px 36px 36px;
  text-align: left;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-header .wordmark {
  font-size: 46px;
  margin-bottom: 4px;
}

.login-brand-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.login-legal {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-legal svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  color: var(--brand-orange);
}

/* ─── SCAN / CAPTURE VIEW ──────────────────────────────────────────── */
.scan-stage-shell {
  min-height: 100vh;
  padding: 90px 20px 60px;
  max-width: 820px;
  margin: 0 auto;
}

/* Progress HUD Track */
.scan-progress-hud {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--pill);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-float);
}

.hud-step-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-orange-deep);
}

.hud-progress-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all 0.3s ease;
}

.hud-dot.active {
  width: 22px;
  border-radius: var(--pill);
  background: var(--brand-orange);
  box-shadow: 0 0 10px var(--brand-orange);
}

.hud-dot.completed {
  background: var(--tone-green);
}

.hud-next-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Step Title with 3D Cylinder Motion */
.scan-header-card {
  margin-bottom: 24px;
  text-align: left;
}

.scan-title-roll {
  font-size: clamp(28px, 4.8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  perspective: 700px;
  transform-origin: 50% 0;
}

.scan-title-roll.roll-active {
  animation: cylinder-roll 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cylinder-roll {
  0% {
    opacity: 0;
    transform: rotateX(-32deg) translateY(14px);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) translateY(0);
  }
}

.scan-blurb {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Camera / Capture Viewport */
.viewfinder-card {
  padding: 16px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.viewfinder-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.viewfinder-video,
.viewfinder-image-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0;
  border: none;
}

.viewfinder-video.mirror-mode {
  transform: scaleX(-1);
}

/* Corner HUD Brackets */
.hud-bracket {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--brand-orange);
  border-style: solid;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 6px rgba(124, 77, 255, 0.6));
  transition: all 0.3s ease;
}

.hud-bracket.top-left {
  top: 24px;
  left: 24px;
  border-width: 3.5px 0 0 3.5px;
  border-top-left-radius: 8px;
}

.hud-bracket.top-right {
  top: 24px;
  right: 24px;
  border-width: 3.5px 3.5px 0 0;
  border-top-right-radius: 8px;
}

.hud-bracket.bottom-left {
  bottom: 24px;
  left: 24px;
  border-width: 0 0 3.5px 3.5px;
  border-bottom-left-radius: 8px;
}

.hud-bracket.bottom-right {
  bottom: 24px;
  right: 24px;
  border-width: 0 3.5px 3.5px 0;
  border-bottom-right-radius: 8px;
}

/* Face Oval Guide — Centered */
.face-guide-oval {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(220px, 48vw);
  height: min(290px, 64vw);
  border-radius: 50% / 55% 55% 45% 45%;
  border: 2.5px dashed rgba(92, 107, 192, 0.85);
  box-shadow: 0 0 24px rgba(124, 77, 255, 0.25);
  pointer-events: none;
  z-index: 4;
  margin: 0;
  animation: face-guide-pulse 3s infinite ease-in-out;
}

@keyframes face-guide-pulse {
  0%, 100% { border-color: rgba(92, 107, 192, 0.6); box-shadow: 0 0 20px rgba(124, 77, 255, 0.2); }
  50%      { border-color: rgba(124, 77, 255, 0.95); box-shadow: 0 0 34px rgba(124, 77, 255, 0.45); }
}

/* Document Target Guide — Centered */
.doc-guide-rect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 74%;
  border-radius: 14px;
  border: 2px dashed rgba(92, 107, 192, 0.75);
  box-shadow: inset 0 0 20px rgba(124, 77, 255, 0.1);
  pointer-events: none;
  z-index: 4;
  margin: 0;
}

/* Floating Status Tag over Camera */
.camera-status-pill {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: var(--pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.camera-status-pill .cam-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone-green);
  box-shadow: 0 0 8px var(--tone-green);
}

/* Camera Action Bar */
.capture-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.capture-actions-bar .btn-pill.btn-primary-orange {
  flex: 1;
}

@property --glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ─── PROCESSING & RESULT SCREEN ───────────────────────────────────── */
.result-stage-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 100px 20px 60px;
}

/* Squircle Card Container with SUBTLE REVOLVING GLOW */
.orbit-wrapper {
  --orbit-color: #7c4dff;
  --orbit-glow:  #9575cd;
  position: relative;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 0;
  border-radius: 32px;
  overflow: visible;
}

/* 1. Ambient Revolving Aura — A true circular soft diffused halo (no rotating slabs!) */
.orbit-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 124%;
  height: 124%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    color-mix(in srgb, var(--orbit-color, #7c4dff) 50%, transparent) 45deg,
    color-mix(in srgb, var(--orbit-glow, #9575cd) 65%, transparent) 85deg,
    transparent 135deg,
    transparent 210deg,
    color-mix(in srgb, var(--orbit-color, #7c4dff) 40%, transparent) 260deg,
    color-mix(in srgb, var(--orbit-glow, #9575cd) 55%, transparent) 300deg,
    transparent 350deg,
    transparent 360deg
  );
  filter: blur(46px);
  opacity: 0.55;
  animation: aura-revolve 12s linear infinite;
}

@keyframes aura-revolve {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 2. Static Card Perimeter Beam — Elegant light shimmer tracing the squircle border */
.orbit-border {
  position: absolute;
  inset: -1.5px;
  border-radius: 31px;
  z-index: 0;
  pointer-events: none;
  background: conic-gradient(
    from var(--glow-angle, 0deg) at 50% 50%,
    transparent 0deg,
    var(--orbit-color, #7c4dff) 40deg,
    var(--orbit-glow, #9575cd) 80deg,
    rgba(255, 255, 255, 0.75) 100deg,
    var(--orbit-color, #7c4dff) 120deg,
    transparent 165deg,
    transparent 220deg,
    var(--orbit-color, #7c4dff) 260deg,
    var(--orbit-glow, #9575cd) 300deg,
    transparent 345deg,
    transparent 360deg
  );
  animation: border-beam-sweep 6s linear infinite;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1.5px;
  opacity: 0.9;
}

@keyframes border-beam-sweep {
  from { --glow-angle: 0deg; }
  to   { --glow-angle: 360deg; }
}

/* Result Squircle Card Surface */
.result-squircle-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  padding: 56px 44px 44px;
  box-shadow: 0 32px 64px -16px rgba(26, 35, 126, 0.14), 0 0 0 1px rgba(124, 77, 255, 0.08);
  overflow: visible;
  transition: background 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

/* Tone Fills on Squircle Card — PROMINENT RESULT HIGHLIGHT */
.result-squircle-card.tone-green {
  --orbit-color: #10b981;
  --orbit-glow:  #6ee7b7;
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(175deg, #ecfdf5 0%, #d1fae5 30%, #a7f3d0 60%, #6ee7b7 100%);
  box-shadow: 0 28px 72px -18px rgba(5, 150, 105, 0.52), 0 0 0 1.5px rgba(16, 185, 129, 0.55);
}

.result-squircle-card.tone-green .verdict-title-text {
  color: #064e3b;
  text-shadow: 0 1px 12px rgba(16, 185, 129, 0.2);
}

.result-squircle-card.tone-green .verdict-score-box {
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.result-squircle-card.tone-green .score-digit {
  color: #047857;
  text-shadow: 0 0 28px rgba(16, 185, 129, 0.35);
}

.result-squircle-card.tone-green .officer-checklist-box {
  border-top-color: rgba(16, 185, 129, 0.3);
}

.result-squircle-card.tone-green .checklist-item {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(16, 185, 129, 0.25);
  color: #064e3b;
}

.result-squircle-card.tone-green .checklist-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(16, 185, 129, 0.55);
}

.result-squircle-card.tone-green .verdict-why-paragraph,
.result-squircle-card.tone-green .score-meta-label,
.result-squircle-card.tone-green .score-meta-sub,
.result-squircle-card.tone-green .checklist-head h3 { color: #065f46; }

.result-squircle-card.tone-yellow {
  --orbit-color: #f59e0b;
  --orbit-glow:  #fcd34d;
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(175deg, #fffbeb 0%, #fef3c7 30%, #fde68a 60%, #fcd34d 100%);
  box-shadow: 0 28px 72px -18px rgba(217, 119, 6, 0.48), 0 0 0 1.5px rgba(245, 158, 11, 0.6);
}

.result-squircle-card.tone-yellow .verdict-title-text {
  color: #78350f;
  text-shadow: 0 1px 12px rgba(245, 158, 11, 0.2);
}

.result-squircle-card.tone-yellow .verdict-score-box {
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.result-squircle-card.tone-yellow .score-digit {
  color: #b45309;
  text-shadow: 0 0 28px rgba(245, 158, 11, 0.35);
}

.result-squircle-card.tone-yellow .officer-checklist-box {
  border-top-color: rgba(245, 158, 11, 0.3);
}

.result-squircle-card.tone-yellow .checklist-item {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(245, 158, 11, 0.25);
  color: #78350f;
}

.result-squircle-card.tone-yellow .checklist-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(245, 158, 11, 0.55);
}

.result-squircle-card.tone-yellow .verdict-why-paragraph,
.result-squircle-card.tone-yellow .score-meta-label,
.result-squircle-card.tone-yellow .score-meta-sub,
.result-squircle-card.tone-yellow .checklist-head h3 { color: #92400e; }

.result-squircle-card.tone-red {
  --orbit-color: #ef4444;
  --orbit-glow:  #fca5a5;
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(175deg, #fef2f2 0%, #fee2e2 30%, #fecaca 60%, #fca5a5 100%);
  box-shadow: 0 28px 72px -18px rgba(220, 38, 38, 0.52), 0 0 0 1.5px rgba(239, 68, 68, 0.6);
}

.result-squircle-card.tone-red .verdict-title-text {
  color: #7f1d1d;
  text-shadow: 0 1px 12px rgba(239, 68, 68, 0.2);
}

.result-squircle-card.tone-red .verdict-score-box {
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(239, 68, 68, 0.55);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.result-squircle-card.tone-red .score-digit {
  color: #dc2626;
  text-shadow: 0 0 28px rgba(239, 68, 68, 0.35);
}

.result-squircle-card.tone-red .officer-checklist-box {
  border-top-color: rgba(239, 68, 68, 0.3);
}

.result-squircle-card.tone-red .checklist-item {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(239, 68, 68, 0.25);
  color: #7f1d1d;
}

.result-squircle-card.tone-red .checklist-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(239, 68, 68, 0.55);
}

.result-squircle-card.tone-red .verdict-why-paragraph,
.result-squircle-card.tone-red .score-meta-label,
.result-squircle-card.tone-red .score-meta-sub,
.result-squircle-card.tone-red .checklist-head h3 { color: #991b1b; }

/* Dark mode tones */
[data-theme="dark"] .result-squircle-card.tone-green {
  background: linear-gradient(175deg, #052e16 0%, #064e3b 40%, #065f46 100%);
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 28px 72px -18px rgba(5, 150, 105, 0.65), 0 0 0 1.5px rgba(16, 185, 129, 0.7);
}
[data-theme="dark"] .result-squircle-card.tone-green .verdict-title-text { color: #34d399; }
[data-theme="dark"] .result-squircle-card.tone-green .score-digit { color: #6ee7b7; }
[data-theme="dark"] .result-squircle-card.tone-green .checklist-item { color: #d1fae5; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .result-squircle-card.tone-green .verdict-why-paragraph,
[data-theme="dark"] .result-squircle-card.tone-green .score-meta-label,
[data-theme="dark"] .result-squircle-card.tone-green .score-meta-sub,
[data-theme="dark"] .result-squircle-card.tone-green .checklist-head h3 { color: #a7f3d0; }

[data-theme="dark"] .result-squircle-card.tone-yellow {
  background: linear-gradient(175deg, #2d1a06 0%, #451a03 40%, #78350f 100%);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 28px 72px -18px rgba(217, 119, 6, 0.65), 0 0 0 1.5px rgba(245, 158, 11, 0.7);
}
[data-theme="dark"] .result-squircle-card.tone-yellow .verdict-title-text { color: #fbbf24; }
[data-theme="dark"] .result-squircle-card.tone-yellow .score-digit { color: #fcd34d; }
[data-theme="dark"] .result-squircle-card.tone-yellow .checklist-item { color: #fef3c7; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .result-squircle-card.tone-yellow .verdict-why-paragraph,
[data-theme="dark"] .result-squircle-card.tone-yellow .score-meta-label,
[data-theme="dark"] .result-squircle-card.tone-yellow .score-meta-sub,
[data-theme="dark"] .result-squircle-card.tone-yellow .checklist-head h3 { color: #fde68a; }

[data-theme="dark"] .result-squircle-card.tone-red {
  background: linear-gradient(175deg, #1c0404 0%, #450a0a 40%, #7f1d1d 100%);
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 28px 72px -18px rgba(220, 38, 38, 0.65), 0 0 0 1.5px rgba(239, 68, 68, 0.7);
}
[data-theme="dark"] .result-squircle-card.tone-red .verdict-title-text { color: #f87171; }
[data-theme="dark"] .result-squircle-card.tone-red .score-digit { color: #fca5a5; }
[data-theme="dark"] .result-squircle-card.tone-red .checklist-item { color: #fee2e2; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .result-squircle-card.tone-red .verdict-why-paragraph,
[data-theme="dark"] .result-squircle-card.tone-red .score-meta-label,
[data-theme="dark"] .result-squircle-card.tone-red .score-meta-sub,
[data-theme="dark"] .result-squircle-card.tone-red .checklist-head h3 { color: #fecaca; }

/* Orbit aura flare behind card */
.orbit-wrapper.tone-green .orbit-aura {
  opacity: 0.85;
  filter: blur(52px);
}
.orbit-wrapper.tone-yellow .orbit-aura {
  opacity: 0.90;
  filter: blur(52px);
}
.orbit-wrapper.tone-red .orbit-aura {
  opacity: 0.90;
  filter: blur(52px);
}

/* Centered Top Edge Badge (Clean Circular Badge) */
.edge-verdict-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface-solid, #ffffff);
  border: 3.5px solid var(--surface-solid, #ffffff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.edge-verdict-badge svg {
  width: 28px;
  height: 28px;
}

.edge-verdict-badge.tone-green {
  background: var(--tone-green, #10b981);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.edge-verdict-badge.tone-yellow {
  background: var(--tone-yellow, #f59e0b);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

.edge-verdict-badge.tone-red {
  background: var(--tone-red, #ef4444);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

.edge-verdict-badge.tone-purple,
.edge-verdict-badge.tone-orange {
  background: var(--brand-orange, #7c4dff);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(124, 77, 255, 0.4);
}

/* Phase A: Processing list */
.phase-processing-head {
  text-align: center;
  margin-bottom: 28px;
}

.phase-processing-head h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.phase-processing-head p {
  color: var(--text-muted);
  font-size: 14px;
}

.detector-stream {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.detector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.detector-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.detector-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--border-subtle);
  color: var(--text-muted);
}

.detector-row.running {
  border-color: var(--brand-orange);
  background: var(--brand-orange-subtle);
}

.detector-row.running .detector-tag {
  background: var(--brand-orange);
  color: #fff;
}

.detector-row.done {
  border-color: rgba(16, 185, 129, 0.35);
}

.detector-row.done .detector-tag {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
  font-size: 13px;
  font-weight: 800;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
}

.detector-row.issue {
  border-color: rgba(245, 158, 11, 0.45);
}

.detector-row.issue .detector-tag {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

/* Waiting state — detector not yet started */
.detector-row.waiting .detector-tag {
  color: var(--text-muted);
  opacity: 0.65;
}
/* Phase B: Final Verdict */
.phase-verdict {
  animation: verdict-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes verdict-fade-in {
  0%   { opacity: 0; transform: translateY(12px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.verdict-header {
  text-align: center;
  margin-bottom: 28px;
}

.verdict-title-text {
  font-size: clamp(24px, 4.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.verdict-score-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px auto 18px;
  padding: 12px 26px;
  border-radius: var(--pill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.3s ease;
}

.score-digit {
  font-size: clamp(54px, 11vw, 84px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.score-meta {
  text-align: left;
  line-height: 1.25;
}

.score-meta-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-meta-sub {
  font-size: 12px;
  color: var(--text-subtle);
}

.verdict-why-paragraph {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

/* Officer Checklist */
.officer-checklist-box {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
}

.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.checklist-head h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.checklist-items {
  list-style: none;
  display: grid;
  gap: 9px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checklist-item:hover {
  background: var(--surface-solid);
  border-color: rgba(124, 77, 255, 0.3);
}

.checklist-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  margin-top: 2px;
  accent-color: var(--brand-orange);
  cursor: pointer;
}

.verdict-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.verdict-actions-row .btn-pill {
  flex: 1;
}

/* ─── CASE LOGS PAGE ───────────────────────────────────────────────── */
.cases-shell {
  min-height: 100vh;
  padding: 100px 20px 80px;
  max-width: 960px;
  margin: 0 auto;
}

.gate-stage-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
}

.gate-card {
  width: min(100%, 420px);
  padding: 44px 34px 34px;
  text-align: center;
}

.gate-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--grad-amber-soft);
  border: 1.5px solid rgba(124, 77, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
  margin: 0 auto 20px;
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.15);
}

.gate-icon-badge svg {
  width: 26px;
  height: 26px;
}

.gate-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.gate-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
  line-height: 1.55;
}

/* Unlocked Case List Header */
.cases-top-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.cases-top-header h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.cases-top-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.cases-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 22px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-field {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: var(--pill);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-glass);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-field:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--border-focus-glow);
  background: var(--surface-solid);
}

.sort-dropdown {
  padding: 10px 18px;
  border-radius: var(--pill);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-glass);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.case-card-list {
  display: grid;
  gap: 10px;
}

.case-card-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 18px;
  background: var(--surface-glass-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
  user-select: none;
}

.case-card-item:hover {
  transform: translateX(4px);
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-float);
}

.case-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.case-status-indicator.tone-green  { background: var(--tone-green); box-shadow: 0 0 10px var(--tone-green); }
.case-status-indicator.tone-yellow { background: var(--tone-yellow); box-shadow: 0 0 10px var(--tone-yellow); }
.case-status-indicator.tone-red    { background: var(--tone-red); box-shadow: 0 0 10px var(--tone-red); }

.case-details-col {
  flex: 1;
  min-width: 0;
}

.case-name-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-meta-line {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-score-pill {
  padding: 5px 12px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.case-score-pill.tone-green {
  background: var(--tone-green-bg);
  color: var(--tone-green-text);
}

.case-score-pill.tone-yellow {
  background: var(--tone-yellow-bg);
  color: var(--tone-yellow-text);
}

.case-score-pill.tone-red {
  background: var(--tone-red-bg);
  color: var(--tone-red-text);
}

.case-chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

/* ─── CASE DETAIL MODAL SHEET ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-squircle-sheet {
  width: min(100%, 580px);
  background: var(--surface-solid);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 34px;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-squircle-sheet {
  transform: translateY(0) scale(1);
}

.modal-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-title-text {
  font-size: 21px;
  font-weight: 800;
}

.modal-close-btn {
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.modal-rows {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.modal-data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}

.modal-data-row:last-child {
  border-bottom: none;
}

.modal-data-row .label {
  color: var(--text-muted);
  font-weight: 600;
}

.modal-data-row .val {
  font-weight: 700;
  text-align: right;
}

/* ─── SETTINGS VIEW & FLOATING DRAWER ──────────────────────────────── */
.settings-shell {
  min-height: 100vh;
  padding: 100px 20px 80px;
  max-width: 680px;
  margin: 0 auto;
}

.settings-card {
  padding: 38px 32px;
}

.settings-section-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-orange-deep);
  margin-bottom: 14px;
  margin-top: 28px;
}

.settings-section-title:first-of-type {
  margin-top: 0;
}

/* Location Segmented Selector */
.location-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.loc-option-btn {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-input);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.loc-option-btn:hover {
  border-color: rgba(124, 77, 255, 0.4);
  color: var(--text-primary);
}

.loc-option-btn.active {
  background: var(--brand-orange-subtle);
  border-color: var(--brand-orange);
  color: var(--brand-orange-deep);
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.15);
}

/* Toggle Switch Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.toggle-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.toggle-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modern iOS / One UI Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-subtle);
  transition: 0.3s;
  border-radius: var(--pill);
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background: var(--grad-primary);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* Account Info Card inside Settings */
.account-badge-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.account-avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--grad-primary-glow);
}

.account-texts {
  flex: 1;
}

.account-email-text {
  font-size: 15px;
  font-weight: 700;
}

.account-role-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-orange-deep);
  margin-top: 2px;
}

/* ─── SLIDE-IN SETTINGS DRAWER ─────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 420px);
  background: var(--surface-solid);
  border-left: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 28px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drawer-backdrop.open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.drawer-header h3 {
  font-size: 20px;
  font-weight: 800;
}

/* ─── RESPONSIVE RULES ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  .floating-chrome {
    padding: 0 14px;
  }
  .float-pill {
    padding: 8px 12px;
    height: 38px;
    font-size: 12px;
  }
  .float-circle {
    width: 38px;
    height: 38px;
  }
  .location-chip span.text {
    display: none;
  }
  .result-squircle-card {
    padding: 48px 22px 32px;
  }
  .steps-track {
    grid-template-columns: 1fr;
  }
  .landing-hero {
    margin-bottom: 48px;
  }
  .score-digit {
    font-size: clamp(48px, 14vw, 68px);
  }
}

#imagePreviewContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ─── KIOSK WORKFLOW CAROUSEL ──────────────────────────────────────── */
.kiosk-workflow-carousel-section {
  max-width: 980px;
  margin: 0 auto 76px;
  text-align: center;
}

.carousel-section-head {
  margin-bottom: 22px;
}

.carousel-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--pill);
  background: var(--brand-orange-subtle);
  border: 1px solid rgba(124, 77, 255, 0.25);
  color: var(--brand-orange);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.carousel-pill-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 8px var(--brand-orange-amber);
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.carousel-title {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.carousel-container {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1.5px solid var(--border-glass);
  border-radius: 28px;
  padding: 16px 16px 20px;
  box-shadow: 0 20px 50px -15px rgba(26, 35, 126, 0.12), 0 0 0 1px rgba(124, 77, 255, 0.08);
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.carousel-container:focus-visible {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.35);
}

.carousel-track-viewport {
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.02);
  cursor: grab;
}

.carousel-track-viewport.is-dragging {
  cursor: grabbing;
}

[data-theme="dark"] .carousel-track-viewport {
  background: rgba(255, 255, 255, 0.03);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  width: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
}

.carousel-slide .slide-card {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .carousel-slide .slide-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

.slide-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 570;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Floating Navigation Arrows */
.carousel-arrow {
  position: absolute;
  top: 46%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-floating);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-float);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.carousel-arrow:hover {
  background: #ffffff;
  color: var(--brand-orange);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 10px 24px rgba(124, 77, 255, 0.22);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.94);
}

.carousel-arrow-prev {
  left: 24px;
}

.carousel-arrow-prev:hover svg {
  transform: translateX(-2px);
}

.carousel-arrow-next {
  right: 24px;
}

.carousel-arrow-next:hover svg {
  transform: translateX(2px);
}

/* Bottom Controls Bar */
.carousel-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 8px;
}

.carousel-step-counter {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--border-subtle);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.carousel-dot:hover {
  background: var(--brand-orange-peach);
}

.carousel-dot.active {
  width: 24px;
  background: var(--grad-primary);
  box-shadow: 0 2px 8px var(--grad-primary-glow);
}

@media (max-width: 640px) {
  .carousel-arrow {
    width: 36px;
    height: 36px;
  }
  .carousel-arrow-prev { left: 14px; }
  .carousel-arrow-next { right: 14px; }
  .carousel-container {
    padding: 10px 10px 14px;
    border-radius: 22px;
  }
}

/* ==========================================================================
   MODE DROPDOWN & CONTEXT MENU (AIRPORT / BORDER / CUSTOMS)
   ========================================================================== */
.mode-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.mode-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 8px 14px 8px 12px;
  border-radius: var(--pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.22s ease;
  user-select: none;
}

.mode-chip-btn:hover {
  background: var(--surface-glass-card);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.mode-chevron {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-muted);
}

.mode-dropdown-wrapper.open .mode-chevron {
  transform: rotate(180deg);
  color: var(--brand-orange);
}

.mode-context-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 270px;
  background: var(--surface-solid, #ffffff);
  border: 1px solid var(--border-glass, rgba(0,0,0,0.1));
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(124, 77, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-dropdown-wrapper.open .mode-context-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mode-menu-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.mode-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
  width: 100%;
}

.mode-menu-item:hover {
  background: var(--surface-input, rgba(124, 77, 255, 0.08));
}

.mode-menu-item.active {
  background: var(--brand-orange-subtle, #ede7f6);
  color: var(--brand-orange, #4527a0);
}

.mode-menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--brand-orange);
}

.mode-menu-texts {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mode-menu-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.mode-menu-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.25;
  margin-top: 2px;
}

.mode-menu-item.active .mode-menu-subtitle {
  color: var(--brand-orange);
  opacity: 0.85;
}

.mode-menu-check {
  width: 16px;
  height: 16px;
  color: var(--brand-orange);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mode-menu-item.active .mode-menu-check {
  opacity: 1;
}

/* ==========================================================================
   FULLSCREEN SETTINGS MODAL POPUP (CENTERED, DARK BLURRED BACKDROP)
   ========================================================================== */
.kavach-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 30, 0.62);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.kavach-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.kavach-modal-card {
  position: relative;
  width: min(100%, 620px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-solid, #ffffff);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.2));
  border-radius: 32px;
  padding: 36px 38px 32px;
  box-shadow: 0 40px 100px -20px rgba(10, 15, 35, 0.5), 0 0 0 1px rgba(124, 77, 255, 0.12);
  transform: scale(0.92) translateY(16px);
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kavach-modal-backdrop.open .kavach-modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input, #f3f4f6);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--surface-glass-card);
  color: var(--text-main);
  transform: scale(1.08);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding-right: 40px;
}

.modal-header-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--brand-orange-subtle, #ede7f6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.modal-header-texts h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
  color: var(--text-main);
}

.modal-header-texts p {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Mode options in modal */
.mode-modal-grid {
  display: grid;
  gap: 10px;
}

.modal-mode-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-input, rgba(0,0,0,0.02));
  cursor: pointer;
  font-family: inherit;
  transition: all 0.22s ease;
  width: 100%;
  text-align: left;
}

.modal-mode-option:hover {
  border-color: var(--brand-orange-peach, #9575cd);
  background: var(--surface-glass);
}

.modal-mode-option.active {
  border-color: var(--brand-orange, #4527a0);
  background: var(--brand-orange-subtle, #ede7f6);
}

.mode-option-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mode-opt-icon {
  width: 22px;
  height: 22px;
  color: var(--brand-orange, #4527a0);
  flex-shrink: 0;
}

.mode-opt-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.mode-opt-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mode-opt-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-mode-option.active .mode-opt-radio {
  border-color: var(--brand-orange, #4527a0);
  background: var(--brand-orange, #4527a0);
  box-shadow: inset 0 0 0 3px #ffffff;
}

/* Modal Toggles */
.modal-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input, rgba(0,0,0,0.02));
  margin-bottom: 10px;
}

.modal-toggle-row h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-main);
}

.modal-toggle-row p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Account card */
.modal-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input, rgba(0,0,0,0.02));
}

.modal-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 4px 14px rgba(69, 39, 160, 0.3);
}

.modal-account-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-account-badge {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* About card */
.modal-about-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input, rgba(0,0,0,0.02));
}

.modal-about-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-version-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--pill);
  background: var(--brand-orange-subtle);
  color: var(--brand-orange);
}

.modal-about-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Modal Footer / Logout */
.modal-footer-section {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0;
}

.btn-modal-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--pill);
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s ease;
}

.btn-modal-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

/* Dark mode overrides for modal and dropdown */
[data-theme="dark"] .mode-context-menu,
[data-theme="dark"] .kavach-modal-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(124, 77, 255, 0.25);
}

[data-theme="dark"] .modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

[data-theme="dark"] .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

[data-theme="dark"] .modal-mode-option,
[data-theme="dark"] .modal-toggle-row,
[data-theme="dark"] .modal-account-card,
[data-theme="dark"] .modal-about-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .modal-mode-option.active {
  background: rgba(124, 77, 255, 0.18);
  border-color: #7c4dff;
}

[data-theme="dark"] .modal-mode-option.active .mode-opt-radio {
  border-color: #7c4dff;
  background: #7c4dff;
  box-shadow: inset 0 0 0 3px #0f172a;
}

/* ==========================================================================
   DUAL-PANE SETTINGS MODAL & THEME/ACCENT PICKERS
   ========================================================================== */
.settings-dual-pane-modal {
  width: min(100%, 820px) !important;
  max-width: 820px !important;
  height: 580px !important;
  max-height: 88vh !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 28px !important;
}

.settings-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-glass);
}

.settings-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-modal-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.settings-modal-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.settings-modal-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

.settings-modal-topbar .modal-close-btn {
  position: static;
  width: 32px;
  height: 32px;
}

.settings-split-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Sidebar Navigation */
.settings-nav-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--surface-input, rgba(0, 0, 0, 0.02));
  border-right: 1px solid var(--border-subtle);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
}

.settings-nav-tab:hover {
  background: var(--surface-glass);
  color: var(--text-main);
}

.settings-nav-tab.active {
  background: var(--brand-orange-subtle, #ede7f6);
  color: var(--brand-orange, #4527a0);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.settings-sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-sidebar-logout:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Right Content Pane */
.settings-content-pane {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  background: var(--surface-solid, #ffffff);
}

.settings-tab-panel {
  display: none;
  animation: fadeInPanel 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-tab-panel.active {
  display: block;
}

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

.pane-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.pane-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── VISUAL THEME PREVIEW CARDS (LIGHT VS DARK) ── */
.theme-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.theme-card-option {
  border: 2px solid var(--border-subtle);
  border-radius: 18px;
  background: var(--surface-input, rgba(0, 0, 0, 0.02));
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.22s ease;
  font-family: inherit;
}

.theme-card-option:hover {
  border-color: var(--brand-orange-peach, #9575cd);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.theme-card-option.active {
  border-color: var(--brand-orange, #4527a0);
  background: var(--brand-orange-subtle, #ede7f6);
  box-shadow: 0 0 0 1px var(--brand-orange, #4527a0), 0 8px 24px rgba(69, 39, 160, 0.12);
}

.theme-card-preview {
  height: 72px;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.theme-card-preview.preview-light {
  background: #f8fafc;
}

.theme-card-preview.preview-light .mockup-header {
  height: 12px;
  border-radius: 6px;
  background: #e2e8f0;
  width: 50%;
}

.theme-card-preview.preview-light .mockup-line {
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  margin-bottom: 6px;
}

.theme-card-preview.preview-light .mockup-box {
  height: 24px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.theme-card-preview.preview-dark {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-card-preview.preview-dark .mockup-header {
  height: 12px;
  border-radius: 6px;
  background: #334155;
  width: 50%;
}

.theme-card-preview.preview-dark .mockup-line {
  height: 6px;
  border-radius: 3px;
  background: #475569;
  margin-bottom: 6px;
}

.theme-card-preview.preview-dark .mockup-box {
  height: 24px;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #334155;
}

.theme-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.theme-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.theme-card-check {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-orange);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.theme-card-option.active .theme-card-check {
  opacity: 1;
}

/* ── ACCENT COLOR CHOOSER ── */
.accent-section {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input, rgba(0, 0, 0, 0.02));
  margin-bottom: 14px;
}

.accent-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.active-accent-name {
  font-size: 12px;
  color: var(--brand-orange);
  font-weight: 600;
}

.accent-swatches-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.accent-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: linear-gradient(135deg, var(--swatch-color), var(--swatch-deep));
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
}

.accent-swatch:hover {
  transform: scale(1.16);
}

.accent-swatch.active {
  transform: scale(1.14);
  box-shadow: 0 0 0 3px var(--surface-solid, #fff), 0 0 0 5px var(--swatch-color);
}

/* Dark mode dual pane overrides */
[data-theme="dark"] .settings-content-pane {
  background: #0b1120;
}

[data-theme="dark"] .settings-nav-sidebar {
  background: #070d18;
}

[data-theme="dark"] .settings-modal-topbar {
  background: #0b1120;
}

[data-theme="dark"] .theme-card-option {
  background: #0f172a;
}

[data-theme="dark"] .theme-card-option.active {
  background: rgba(124, 77, 255, 0.16);
  border-color: #7c4dff;
}

[data-theme="dark"] .accent-section {
  background: #0f172a;
}

[data-theme="dark"] .accent-swatch.active {
  box-shadow: 0 0 0 3px #0f172a, 0 0 0 5px var(--swatch-color);
}

/* High-Contrast Settings Text Assurance */
.settings-dual-pane-modal,
.settings-content-pane,
.settings-split-body,
.kavach-modal-card {
  color: var(--text-main, #0f172a);
}

.pane-heading,
.settings-modal-title,
.theme-card-title,
.accent-label,
.modal-account-name,
.mode-opt-title,
.mode-menu-title,
.modal-toggle-row h4,
.settings-section-title,
.modal-about-meta strong {
  color: var(--text-main, #0f172a) !important;
}

.pane-sub,
.settings-modal-sub,
.modal-toggle-row p,
.modal-account-badge,
.modal-about-desc,
.mode-opt-sub,
.mode-menu-subtitle {
  color: var(--text-muted, #64748b) !important;
}

[data-theme="dark"] .settings-dual-pane-modal,
[data-theme="dark"] .settings-content-pane,
[data-theme="dark"] .settings-split-body,
[data-theme="dark"] .kavach-modal-card {
  color: var(--text-main, #f8fafc);
}

[data-theme="dark"] .pane-heading,
[data-theme="dark"] .settings-modal-title,
[data-theme="dark"] .theme-card-title,
[data-theme="dark"] .accent-label,
[data-theme="dark"] .modal-account-name,
[data-theme="dark"] .mode-opt-title,
[data-theme="dark"] .mode-menu-title,
[data-theme="dark"] .modal-toggle-row h4,
[data-theme="dark"] .settings-section-title,
[data-theme="dark"] .modal-about-meta strong {
  color: var(--text-main, #f8fafc) !important;
}

[data-theme="dark"] .pane-sub,
[data-theme="dark"] .settings-modal-sub,
[data-theme="dark"] .modal-toggle-row p,
[data-theme="dark"] .modal-account-badge,
[data-theme="dark"] .modal-about-desc,
[data-theme="dark"] .mode-opt-sub,
[data-theme="dark"] .mode-menu-subtitle {
  color: var(--text-muted, #94a3b8) !important;
}
