/* QRCoin Design System
   =====================
   Dual Theme: Gold & Platinum
   Elegant & Sensual Edition
*/

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --list-text-size: 16px;
  --list-text-weight: 300;
  --dark-section-bg: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(96, 128, 176, 0.18) 0%, transparent 52%), radial-gradient(ellipse 60% 50% at 0% 100%, rgba(96, 128, 176, 0.12) 0%, transparent 42%), linear-gradient(145deg, #2d3542 0%, #121923 52%, #0c1118 100%);
  
  /* Rich gold palette — warm, elegant, premium (default) */
  --gold-50: #FEFDFB;
  --gold-100: #FBF7F0;
  --gold-200: #F5EBD9;
  --gold-300: #E8D5B0;
  --gold-400: #C9A227;
  --gold-500: #A68521;
  --gold-600: #8B6F1C;
  --gold-700: #6B5516;
  --gold-800: #4A3B10;
  --gold-900: #2D240A;

  /* Metallic gold for special elements */
  --gold-metallic: linear-gradient(135deg, #C9A227 0%, #F5EBD9 25%, #A68521 50%, #8B6F1C 100%);
  --gold-shine: linear-gradient(135deg, #A68521 0%, #C9A227 30%, #E8D5B0 50%, #C9A227 70%, #8B6F1C 100%);
  --gold-glow: 0 0 20px rgba(166, 133, 33, 0.2);
  --gold-glow-soft: 0 0 12px rgba(166, 133, 33, 0.1);
  
  /* Sexy accent colors — subtle rose undertones */
  --rose-glow: rgba(255, 182, 193, 0.15);
  --rose-accent: #E8A4B0;
  --champagne: #F7E7CE;
  
  /* Premium accent */
  --accent: #A68521;
  --accent-soft: rgba(166, 133, 33, 0.08);

  /* Light palette — refined ivory with warm undertones */
  --bg-primary: #FEFDFB;
  --bg-secondary: #FAF8F5;
  --bg-tertiary: #F3EFE9;
  --bg-elevated: #FFFFFF;
  --bg-glass: rgba(254, 253, 251, 0.85);
  --bg-glass-strong: rgba(254, 253, 251, 0.95);

  /* Gradient backgrounds — layered premium atmosphere */
  --bg-gradient:
    radial-gradient(ellipse 138% 72% at 50% -16%, color-mix(in srgb, var(--gold-400) 24%, transparent) 0%, color-mix(in srgb, var(--gold-500) 10%, transparent) 42%, transparent 64%),
    radial-gradient(ellipse 98% 58% at -10% 30%, color-mix(in srgb, var(--gold-500) 16%, transparent) 0%, transparent 52%),
    radial-gradient(ellipse 92% 52% at 108% 72%, color-mix(in srgb, var(--gold-600) 14%, transparent) 0%, transparent 48%),
    radial-gradient(ellipse 74% 46% at 82% 92%, color-mix(in srgb, var(--rose-accent) 13%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 46%, var(--bg-tertiary) 100%);
  --bg-gradient-card: linear-gradient(145deg, #FFFFFF 0%, #FEFDFB 100%);
  
  /* Sexy gradient overlays */
  --gradient-sensual: linear-gradient(135deg, rgba(201, 162, 39, 0.08) 0%, rgba(232, 164, 176, 0.06) 50%, rgba(166, 133, 33, 0.08) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(201, 162, 39, 0.15) 0%, transparent 70%);

  /* Text — warm neutrals with strong contrast */
  --text-primary: #14120D;
  --text-secondary: #4A453B;
  --text-muted: #7A7368;
  --text-inverse: #FEFDFB;
  --text-gold: #7A5F16;

  /* Semantic colors */
  --success: #1cb786;
  --success-muted: rgba(5, 150, 105, 0.08);
  --warning: #D97706;
  --warning-muted: rgba(217, 119, 6, 0.08);
  --error: #f55e5e;
  --error-muted: rgba(220, 38, 38, 0.08);

  /* RGB values for dynamic transparency */
  --gold-500-rgb: 166, 133, 33;
  --gold-400-rgb: 201, 162, 39;
  --gold: var(--gold-400);
  --success-rgb: 5, 150, 105;
  --warning-rgb: 217, 119, 6;
  --error-rgb: 245, 94, 94;

  /* Alias tokens used by newer components */
  --surface-primary: var(--bg-elevated);
  --surface-secondary: var(--bg-secondary);
  --surface-tertiary: var(--bg-tertiary);
  --border-primary: var(--border-default);
  --border-secondary: var(--border-gold);

  /* Borders — refined with strong visibility */
  --border-subtle: rgba(20, 18, 13, 0.08);
  --border-default: rgba(20, 18, 13, 0.12);
  --border-gold: rgba(122, 95, 22, 0.25);
  --border-gold-strong: rgba(122, 95, 22, 0.4);
  --list-divider-color: var(--border-subtle);
  --list-divider-line: linear-gradient(
    90deg,
    rgba(122, 133, 154, 0) 0%,
    rgba(122, 133, 154, 0.10) 40%,
    rgba(122, 133, 154, 0.10) 60%,
    rgba(122, 133, 154, 0) 100%
  );
  --list-filter-line-top: linear-gradient(
    to right,
    rgba(207, 218, 236, 0),
    rgba(207, 218, 236, 0.24) 18%,
    rgba(207, 218, 236, 0.28) 82%,
    rgba(207, 218, 236, 0)
  );
  --list-filter-line-bottom: rgba(222, 229, 242, 0.3);
  --list-filter-tab-inactive-opacity: 0.72;
  --list-search-bg: var(--gold-200);
  --list-search-border: #d8dde7;
  --list-search-text: #596273;
  --list-search-text-focus: #2e3644;
  --list-search-placeholder: #9ca6b6;
  --list-search-icon: #a7b0be;
  --list-search-focus-border: #c3cada;
  --list-search-focus-ring: rgba(197, 205, 220, 0.24);

  /* Shadows — soft and elegant with depth */
  --shadow-sm: 0 1px 2px rgba(28, 24, 16, 0.03), 0 2px 6px rgba(28, 24, 16, 0.04);
  --shadow-md: 0 2px 4px rgba(28, 24, 16, 0.03), 0 4px 12px rgba(28, 24, 16, 0.06), 0 8px 24px rgba(28, 24, 16, 0.04);
  --shadow-lg: 0 4px 8px rgba(28, 24, 16, 0.04), 0 8px 24px rgba(28, 24, 16, 0.08), 0 16px 48px rgba(28, 24, 16, 0.06);
  --shadow-xl: 0 8px 16px rgba(28, 24, 16, 0.06), 0 16px 48px rgba(28, 24, 16, 0.1), 0 24px 64px rgba(28, 24, 16, 0.08);
  --shadow-gold: 0 4px 16px rgba(166, 133, 33, 0.15), 0 8px 32px rgba(166, 133, 33, 0.08);
  --shadow-gold-lg: 0 8px 32px rgba(166, 133, 33, 0.2), 0 16px 64px rgba(166, 133, 33, 0.12);
  --shadow-glow: 0 0 40px rgba(166, 133, 33, 0.12);
  --shadow-lift: 0 20px 40px rgba(28, 24, 16, 0.12), 0 8px 16px rgba(28, 24, 16, 0.08);

  /* Shared coin texture layers */
  --coin-bg-image: url('/app/icons/coin-bg.png');
  --coin-bg-fade-50: linear-gradient(rgba(88, 88, 88, 0.75), rgba(255, 255, 255, 0.75));
  --coin-bg-faded-stack: var(--coin-bg-fade-50), var(--coin-bg-image);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-2xl: 34px;
  --radius-full: 9999px;

  /* Border widths */
  --border-width: 1px;
  --border-width-thin: 1px;

  /* Motion — buttery smooth */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-sensual: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-sensual: 600ms;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   Platinum Theme Override — Sleek & Modern
   ============================================ */
[data-theme="platinum"] {
  /* Platinum palette — refined slate, modern and minimal */
  --gold-50: #FAFBFC;
  --gold-100: #F4F6F8;
  --gold-200: #E8ECF0;
  --gold-300: #D1D9E0;
  --gold-400: #5C6B7A;
  --gold-500: #465362;
  --gold-600: #374151;
  --gold-700: #252F3A;
  --gold-800: #161C24;
  --gold-900: #0B0F14;

  /* RGB value for dynamic transparency */
  --gold-500-rgb: 70, 83, 98;
  --gold-400-rgb: 92, 107, 122;
  --gold: var(--gold-400);
  --success-rgb: 5, 150, 105;
  --warning-rgb: 217, 119, 6;
  --error-rgb: 245, 127, 127;

  /* Alias tokens used by newer components */
  --surface-primary: var(--bg-elevated);
  --surface-secondary: var(--bg-secondary);
  --surface-tertiary: var(--bg-tertiary);
  --border-primary: var(--border-default);
  --border-secondary: var(--border-gold);

  /* Metallic platinum for special elements */
  --gold-metallic: linear-gradient(135deg, #D1D9E0 0%, #FAFBFC 25%, #5C6B7A 50%, #465362 100%);
  --gold-shine: linear-gradient(135deg, #465362 0%, #5C6B7A 30%, #D1D9E0 50%, #5C6B7A 70%, #374151 100%);
  --gold-glow: 0 0 20px rgba(70, 83, 98, 0.2);
  --gold-glow-soft: 0 0 12px rgba(70, 83, 98, 0.1);
  
  /* Sexy accent - cool slate with hint of blue */
  --rose-glow: rgba(147, 197, 253, 0.12);
  --rose-accent: #93C5FD;
  --champagne: #E2E8F0;
  
  /* Premium accent - refined slate */
  --accent: #465362;
  --accent-soft: rgba(70, 83, 98, 0.08);

  /* Light palette — clean, modern white */
  --bg-primary: #FAFBFC;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #E2E8F0;
  --bg-elevated: #FFFFFF;
  --bg-glass: rgba(250, 251, 252, 0.85);
  --bg-glass-strong: rgba(255, 255, 255, 0.92);

  /* Gradient backgrounds — layered premium atmosphere */
  --bg-gradient:
    radial-gradient(ellipse 138% 72% at 50% -16%, color-mix(in srgb, var(--gold-400) 24%, transparent) 0%, color-mix(in srgb, var(--gold-500) 10%, transparent) 42%, transparent 64%),
    radial-gradient(ellipse 98% 58% at -10% 30%, color-mix(in srgb, var(--gold-500) 16%, transparent) 0%, transparent 52%),
    radial-gradient(ellipse 92% 52% at 108% 72%, color-mix(in srgb, var(--gold-600) 14%, transparent) 0%, transparent 48%),
    radial-gradient(ellipse 74% 46% at 82% 92%, color-mix(in srgb, var(--rose-accent) 13%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 46%, var(--bg-tertiary) 100%);
  --bg-gradient-card: linear-gradient(145deg, #FFFFFF 0%, #FAFBFC 100%);
  
  /* Sexy gradient overlays - cool blue tint */
  --gradient-sensual: linear-gradient(135deg, rgba(70, 83, 98, 0.06) 0%, rgba(147, 197, 253, 0.04) 50%, rgba(70, 83, 98, 0.06) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(70, 83, 98, 0.1) 0%, transparent 70%);

  /* Text — strong contrast */
  --text-primary: #0D1117;
  --text-secondary: #3D4654;
  --text-muted: #6B7685;
  --text-inverse: #FAFBFC;
  --text-gold: #2D3642;

  /* Semantic colors */
  --success: #1dc38e;
  --success-muted: rgba(5, 150, 105, 0.08);
  --warning: #D97706;
  --warning-muted: rgba(217, 119, 6, 0.08);
  --error: #f57f7f;
  --error-muted: rgba(220, 38, 38, 0.08);

  /* Borders — clean with strong visibility */
  --border-subtle: rgba(13, 17, 23, 0.08);
  --border-default: rgba(13, 17, 23, 0.12);
  --border-gold: rgba(45, 54, 66, 0.2);
  --border-gold-strong: rgba(45, 54, 66, 0.32);
  --list-divider-color: var(--border-subtle);
  --list-divider-line: linear-gradient(
    90deg,
    rgba(122, 133, 154, 0) 0%,
    rgba(122, 133, 154, 0.10) 40%,
    rgba(122, 133, 154, 0.10) 60%,
    rgba(122, 133, 154, 0) 100%
  );
  --list-filter-line-top: linear-gradient(
    to right,
    rgba(207, 218, 236, 0),
    rgba(207, 218, 236, 0.24) 18%,
    rgba(207, 218, 236, 0.28) 82%,
    rgba(207, 218, 236, 0)
  );
  --list-filter-line-bottom: rgba(222, 229, 242, 0.3);
  --list-filter-tab-inactive-opacity: 0.72;
  --list-search-bg: var(--gold-200);
  --list-search-border: #d8dde7;
  --list-search-text: #596273;
  --list-search-text-focus: #2e3644;
  --list-search-placeholder: #9ca6b6;
  --list-search-icon: #a7b0be;
  --list-search-focus-border: #c3cada;
  --list-search-focus-ring: rgba(197, 205, 220, 0.24);

  /* Shadows — soft and elegant */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 48px rgba(0, 0, 0, 0.1), 0 24px 64px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 4px 16px rgba(70, 83, 98, 0.12), 0 8px 32px rgba(70, 83, 98, 0.06);
  --shadow-gold-lg: 0 8px 32px rgba(70, 83, 98, 0.16), 0 16px 64px rgba(70, 83, 98, 0.1);
  --shadow-glow: 0 0 40px rgba(70, 83, 98, 0.1);
  --shadow-lift: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
}

/* Platinum floating orbs */
[data-theme="platinum"] body::after {
  background: 
    radial-gradient(circle 300px at 20% 80%, rgba(70, 83, 98, 0.05) 0%, transparent 50%),
    radial-gradient(circle 200px at 85% 20%, rgba(147, 197, 253, 0.04) 0%, transparent 50%);
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg-primary);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  _background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.name-input-container {
  flex-direction: column;
  display: flex;
  gap: 4px;
}

.name-hint {
  font-size: 12px;
  padding-top: var(--space-1);
}

/* Animated floating orbs for visual interest */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: -1;
  background: 
    radial-gradient(circle 300px at 20% 80%, rgba(201, 162, 39, 0.06) 0%, transparent 50%),
    radial-gradient(circle 200px at 85% 20%, rgba(232, 164, 176, 0.05) 0%, transparent 50%);
  pointer-events: none;
  animation: floatingOrbs 20s ease-in-out infinite;
}

@keyframes floatingOrbs {
  0%, 100% {
    background-position: 0% 0%;
    opacity: 1;
  }
  33% {
    background-position: 5% 3%;
    opacity: 0.8;
  }
  66% {
    background-position: -3% -2%;
    opacity: 1;
  }
}

/* App Container */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: visible;
}

@media (min-width: 768px) {
  .app {
    max-width: 1200px;
    padding: 0 var(--space-8);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-8);
    overflow: visible;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .app.app-no-nav {
    grid-template-columns: 1fr;
    max-width: 900px;
  }

  .app.app-no-nav .view {
    grid-column: 1;
  }
}

/* ============================================
   Loading Screen — Premium Entry
   ============================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  z-index: 9999;
  transition: opacity var(--duration-sensual) var(--ease-sensual);
}

.loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 40%, rgba(166, 133, 33, 0.08) 0%, transparent 60%);
  animation: loadingPulse 2s ease-in-out infinite;
}

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

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 8px;
  background: linear-gradient(135deg, var(--gold-600) 0%, var(--gold-400) 25%, var(--gold-300) 50%, var(--gold-400) 75%, var(--gold-600) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes logoShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--gold-400);
  border-right-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 20px rgba(166, 133, 33, 0.2);
}

.loading-status {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  min-height: 22px;
  text-align: center;
  position: relative;
  z-index: 1;
}

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

/* ============================================
   3D Flip Transition — Overlay for main tab switches
   ============================================ */
/* The overlay is full-screen, solid background so the real view doesn't bleed through */
.flip-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: var(--bg-primary);
  overflow: hidden;
}

.flip-overlay .flip-stage {
  width: 100%;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  position: relative;
  /* No perspective property here — each face carries its own via transform function.
     This avoids iOS Safari's broken preserve-3d chain through position:fixed. */
}

@media (min-width: 768px) {
  .flip-overlay .flip-stage {
    max-width: none;
  }
}

.flip-overlay .flip-card {
  width: 100%;
  height: 100%;
  position: relative;
}

.flip-overlay .flip-face {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
}

.flip-overlay .flip-front {
  z-index: 2;
}

/* Kill all child animations inside flip faces so reparented elements
   don't replay entrance animations (list-animate-item, stagger, etc.) */
.flip-overlay .flip-face .list-animate-item {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.flip-overlay .flip-face .stagger > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.flip-overlay .flip-face .view {
  animation: none !important;
}

/* Back face starts hidden (direction class applied immediately) */
.flip-overlay.forward .flip-back,
.flip-overlay.reverse .flip-back {
  opacity: 0;
}

/* --- Opacity keyframes: snap at 50%, uses linear timing so it's frame-accurate --- */
@-webkit-keyframes flipHide {
  0%, 49.99%  { opacity: 1; }
  50%, 100%   { opacity: 0; }
}
@keyframes flipHide {
  0%, 49.99%  { opacity: 1; }
  50%, 100%   { opacity: 0; }
}
@-webkit-keyframes flipShow {
  0%, 49.99%  { opacity: 0; }
  50%, 100%   { opacity: 1; }
}
@keyframes flipShow {
  0%, 49.99%  { opacity: 0; }
  50%, 100%   { opacity: 1; }
}

/* --- Rotation keyframes: simple from/to, uses ease-in-out for smooth motion --- */
@-webkit-keyframes flipRotateOutFwd {
  from { -webkit-transform: perspective(800px) rotateY(0deg); }
  to   { -webkit-transform: perspective(800px) rotateY(-180deg); }
}
@keyframes flipRotateOutFwd {
  from { transform: perspective(800px) rotateY(0deg); }
  to   { transform: perspective(800px) rotateY(-180deg); }
}
@-webkit-keyframes flipRotateInFwd {
  from { -webkit-transform: perspective(800px) rotateY(180deg); }
  to   { -webkit-transform: perspective(800px) rotateY(0deg); }
}
@keyframes flipRotateInFwd {
  from { transform: perspective(800px) rotateY(180deg); }
  to   { transform: perspective(800px) rotateY(0deg); }
}
@-webkit-keyframes flipRotateOutRev {
  from { -webkit-transform: perspective(800px) rotateY(0deg); }
  to   { -webkit-transform: perspective(800px) rotateY(180deg); }
}
@keyframes flipRotateOutRev {
  from { transform: perspective(800px) rotateY(0deg); }
  to   { transform: perspective(800px) rotateY(180deg); }
}
@-webkit-keyframes flipRotateInRev {
  from { -webkit-transform: perspective(800px) rotateY(-180deg); }
  to   { -webkit-transform: perspective(800px) rotateY(0deg); }
}
@keyframes flipRotateInRev {
  from { transform: perspective(800px) rotateY(-180deg); }
  to   { transform: perspective(800px) rotateY(0deg); }
}

/* --- Forward: combined animations (rotation + opacity with separate timing) --- */
.flip-overlay.forward.animate .flip-front {
  -webkit-animation:
    flipRotateOutFwd var(--flip-duration, 0.5s) ease-in-out forwards,
    flipHide var(--flip-duration, 0.5s) linear forwards;
  animation:
    flipRotateOutFwd var(--flip-duration, 0.5s) ease-in-out forwards,
    flipHide var(--flip-duration, 0.5s) linear forwards;
}
.flip-overlay.forward.animate .flip-back {
  -webkit-animation:
    flipRotateInFwd var(--flip-duration, 0.5s) ease-in-out forwards,
    flipShow var(--flip-duration, 0.5s) linear forwards;
  animation:
    flipRotateInFwd var(--flip-duration, 0.5s) ease-in-out forwards,
    flipShow var(--flip-duration, 0.5s) linear forwards;
}

/* --- Reverse: combined animations --- */
.flip-overlay.reverse.animate .flip-front {
  -webkit-animation:
    flipRotateOutRev var(--flip-duration, 0.5s) ease-in-out forwards,
    flipHide var(--flip-duration, 0.5s) linear forwards;
  animation:
    flipRotateOutRev var(--flip-duration, 0.5s) ease-in-out forwards,
    flipHide var(--flip-duration, 0.5s) linear forwards;
}
.flip-overlay.reverse.animate .flip-back {
  -webkit-animation:
    flipRotateInRev var(--flip-duration, 0.5s) ease-in-out forwards,
    flipShow var(--flip-duration, 0.5s) linear forwards;
  animation:
    flipRotateInRev var(--flip-duration, 0.5s) ease-in-out forwards,
    flipShow var(--flip-duration, 0.5s) linear forwards;
}

/* ============================================
   Views
   ============================================ */
.view {
  /* Normal document flow - no positioning */
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-6);
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-6));
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-6));
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-6));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 140px);
  display: none;
}

.view.active {
  display: block;
  animation: viewEnter 0.5s var(--ease-sensual) forwards;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Skip animation when restoring from cache (e.g. during flip transition) */
.view.active.no-animate {
  animation: none;
}
.view.active.no-animate .list-animate-item {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.view.active.no-animate .stagger > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@media (min-width: 768px) {
  .view {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    padding: var(--space-6);
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
    grid-column: 2;
    height: 100vh;
    height: 100dvh;
  }
  
  .view.active {
    display: block;
    transform: none;
  }
}

/* ============================================
   Bottom Navigation — Premium Glass
   ============================================ */
.bottom-nav {
  position: fixed !important;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(250, 248, 245, 0.95) 100%);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 -8px 32px rgba(28, 24, 16, 0.08), 0 -2px 8px rgba(28, 24, 16, 0.04);
  padding: var(--space-2) var(--space-4);
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--space-4));
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--space-4));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-2));
  display: flex;
  justify-content: space-around;
  z-index: 1000;
}

@media (min-width: 768px) {
  .bottom-nav {
    position: sticky;
    top: 0;
    left: 0;
    transform: none;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: var(--space-10) 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    border-right: 1px solid var(--border-subtle);
    gap: var(--space-2);
  }

  .bottom-nav::before {
    content: 'QRCOIN';
    display: block;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    background: var(--gold-shine);
  background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-10);
    padding-left: var(--space-8);
  }
}

.bottom-nav[hidden] {
  display: none;
}

/* ============================================
   Documents View - aplyio Style
   ============================================ */

/* Upload Form */
.documents-view .document-upload-form {
  display: grid;
  gap: var(--space-4);
}

.document-upload__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.document-upload__dropzone svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.document-upload__dropzone:hover,
.document-upload__dropzone--active {
  border-color: var(--gold-400);
  background: rgba(var(--gold-500-rgb), 0.05);
}

.document-upload__dropzone--active svg {
  opacity: 0.8;
}

.document-upload__dropzone .link {
  color: var(--gold-400);
  text-decoration: underline;
  cursor: pointer;
}

.document-upload__filename {
  display: none;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* File List (upload queue) */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.file-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.file-list__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.file-list__size {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.file-list__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 var(--space-1);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast);
}

.file-list__remove:hover {
  opacity: 1;
  color: var(--error);
}

.file-list__summary {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
}

/* Upload progress states */
.file-list__status {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.file-list__error {
  font-size: 0.7rem;
  color: var(--error);
}

.file-status--done .file-list__name {
  color: var(--success);
}

.file-status--done .file-list__status {
  color: var(--success);
}

.file-status--skipped {
  opacity: 0.6;
}

.file-status--skipped .file-list__status {
  color: var(--warning);
}

.file-status--failed .file-list__name {
  color: var(--error);
}

.file-status--failed .file-list__status {
  color: var(--error);
}

.file-status--uploading .file-list__name {
  color: var(--gold-400);
}

/* Small inline spinner for upload progress */
.upload-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Search Bar */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
}

.search-bar__icon {
  position: absolute;
  left: var(--space-3);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-10);
  background: var(--surface-secondary);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(var(--gold-400-rgb), 0.1);
}

.search-bar__clear {
  position: absolute;
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.search-bar__clear:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.search-bar__clear svg {
  width: 16px;
  height: 16px;
}

/* Document Summary Card */
.document-summary-card {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: linear-gradient(145deg, rgba(var(--gold-500-rgb), 0.1), rgba(28, 25, 23, 0.9));
  border: var(--border-width) solid var(--gold-400);
  transition: all 0.3s var(--ease-out);
}

.document-summary__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
}

.document-summary-card:not(.collapsed) .document-summary__header {
  margin-bottom: var(--space-4);
}

.document-summary__title-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.document-summary__title-area .section-title {
  margin: 0;
}

.document-summary-card .collapse-icon {
  width: 16px;
  height: 16px;
  color: var(--gold-400);
  transition: transform 0.3s var(--ease-out);
  transform: rotate(180deg);
}

.document-summary-card.collapsed .collapse-icon {
  transform: rotate(0deg);
}

.document-summary__collapsible {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out), opacity 0.3s ease;
  opacity: 1;
}

.document-summary-card.collapsed .document-summary__collapsible {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.document-summary__text {
  flex: 1;
  line-height: 1.4;
  margin-bottom: var(--space-4);
}

.summary-refresh-btn {
  width: 32px;
  height: 32px;
  opacity: 0.5;
  transition: opacity var(--duration-fast), transform var(--duration-fast);
}

.summary-refresh-btn:hover {
  opacity: 1;
}

.summary-refresh-btn.loading svg {
  display: none;
}

.summary-refresh-btn.loading .btn-spinner {
  display: block;
  width: 16px;
  height: 16px;
}

.document-summary__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.summary-chip:hover {
  border-color: var(--gold-400);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  color: var(--text-primary);
}

.summary-chip:active {
  transform: translateY(0);
}

.summary-chip__icon {
  font-size: 1rem;
}

/* Global List Styles to prevent cropping */
.contacts-list,
.transaction-list,
.activity-list,
.document-list,
.recipient-list,
.recent-list {
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

.activity-list {
  margin-right: var(--space-3);
  margin-top: var(--space-4);
}

/* Document List */
.document-list {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 1024px) {
  .document-list {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-4);
  }
}

/* Document Card */
.document-card {
  padding: var(--space-4);
}

.document-card__row {
  display: flex;
  gap: var(--space-3);
}

.document-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.document-card__icon svg {
  width: 20px;
  height: 20px;
}

.document-card__icon--id {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--surface-primary);
}

.document-card__icon--large {
  width: 64px;
  height: 64px;
}

.document-card__icon--large svg {
  width: 32px;
  height: 32px;
}

.document-card__main {
  flex: 1;
  min-width: 0;
}

.document-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.document-title {
  font-weight: 600;
  line-height: 1.3;
}

.document-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.document-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  font-size: 0.85rem;
}

.document-card__detail {
  color: var(--text-secondary);
}

.document-card__detail .text-muted {
  color: var(--text-muted);
}

/* Extracted Fields */
.document-card__fields-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.document-card__fields-toggle:hover {
  color: var(--text-secondary);
}

.document-card__fields-toggle svg {
  transition: transform var(--duration-fast);
}

.document-card__fields-toggle.expanded svg {
  transform: rotate(180deg);
}

.document-card__fields {
  display: none;
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.document-card__fields.expanded {
  display: block;
}

.document-card__field {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.document-card__field:last-of-type {
  border-bottom: none;
}

.document-card__field-key {
  color: var(--text-muted);
  cursor: help;
  border-bottom: 1px dotted var(--border-subtle);
}

.document-card__field-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* Field type styling */
.document-card__field[data-type="currency"] .document-card__field-value {
  color: var(--gold-400);
  font-variant-numeric: tabular-nums;
}

.document-card__field[data-type="tin"] .document-card__field-value,
.document-card__field[data-type="account"] .document-card__field-value {
  font-family: var(--font-mono, monospace);
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

.document-card__field[data-type="date"] .document-card__field-value,
.document-card__field[data-type="year"] .document-card__field-value {
  font-variant-numeric: tabular-nums;
}

/* More Fields Toggle - Removed as we now show all fields */
.document-card__more-fields {
  display: none;
}

.document-card__hidden-fields {
  display: none;
}

/* Document Card Footer */
.document-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.document-card__actions {
  display: flex;
  gap: var(--space-2);
}

/* Selectable Document Cards */
.document-card--selectable {
  cursor: pointer;
  position: relative;
  transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
}

.document-card--selectable:hover {
  border-color: var(--border-gold);
}

.document-card--selectable:active {
  transform: scale(0.98);
}

.document-card__checkbox {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary);
  transition: all var(--duration-fast);
  opacity: 0.6;
}

.document-card--selectable:hover .document-card__checkbox {
  opacity: 1;
}

.document-card__checkbox svg {
  width: 16px;
  height: 16px;
  stroke: transparent;
  transition: stroke var(--duration-fast);
}

.document-card--selected {
  border-color: var(--gold-400);
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--gold-400), inset 0 0 20px rgba(var(--gold-500-rgb), 0.1);
}

.document-card--selected .document-card__checkbox {
  background: var(--gold-400);
  border-color: var(--gold-400);
  opacity: 1;
}

.document-card--selected .document-card__checkbox svg {
  stroke: var(--bg-primary);
}

/* Selection Action Bar */
.selection-bar {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
}

.selection-bar[hidden] {
  display: none !important;
}

.selection-bar__info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.selection-bar__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--surface-tertiary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.selection-bar__clear:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
}

.selection-bar__clear svg {
  width: 14px;
  height: 14px;
}

.selection-bar__count {
  font-weight: 600;
  color: var(--gold-400);
}

.selection-bar__actions {
  display: flex;
  gap: var(--space-2);
}

.selection-bar__actions .btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
}

.selection-bar__actions .btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hide text labels on mobile, show only icons */
.selection-bar__actions .btn-text {
  display: none;
}

@media (min-width: 768px) {
  .selection-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    max-width: 500px;
    bottom: var(--space-8);
    padding: var(--space-3) var(--space-5);
  }
  
  .selection-bar__actions .btn-text {
    display: inline;
  }
}

/* Document Gallery Viewer */
.document-gallery {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-gallery__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.document-gallery__container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-4);
  box-shadow: var(--shadow-lg);
}

.document-gallery__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.document-gallery__title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-gallery__counter {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.document-gallery__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.document-gallery__close:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.document-gallery__close svg {
  width: 20px;
  height: 20px;
}

.document-gallery__content {
  flex: 1;
  position: relative;
  background: var(--surface-tertiary);
  min-height: 0;
}

.document-gallery__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.document-gallery__iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.document-gallery__nav {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-secondary);
  border-top: 1px solid var(--border-primary);
}

.document-gallery__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: var(--border-width) solid var(--border-primary);
  background: var(--surface-primary);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.document-gallery__nav-btn:hover:not(:disabled) {
  background: var(--surface-secondary);
  border-color: var(--border-secondary);
}

.document-gallery__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.document-gallery__nav-btn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 767px) {
  .document-gallery__container {
    margin: 0;
    border-radius: 0;
    max-height: 100%;
  }
}

/* ID Document Card - Special Style */
.document-card--id {
  background: linear-gradient(135deg, var(--surface-primary) 0%, rgba(var(--gold-500-rgb), 0.05) 100%);
  border: var(--border-width) solid rgba(var(--gold-500-rgb), 0.2);
}

/* Prompt Card (for ID scan CTA) */
.document-card--prompt {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
}

.document-card__prompt-content {
  flex: 1;
}

.document-card__prompt-content .document-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-1);
}

.document-card__prompt-content p {
  margin-bottom: var(--space-3);
}

/* Freshness Indicators */
.freshness-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.freshness-indicator--fresh {
  color: var(--success);
}

.freshness-indicator--aging {
  color: var(--warning);
}

.freshness-indicator--stale {
  color: var(--warning);
}

.freshness-indicator--expired {
  color: var(--error);
}

/* Status Badges */
.badge-doc-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(var(--success-rgb, 34, 197, 94), 0.15);
  color: var(--success);
  border-radius: var(--radius-full);
}

.badge-doc-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(var(--warning-rgb, 234, 179, 8), 0.15);
  color: var(--warning);
  border-radius: var(--radius-full);
}

.badge-doc-expired {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(var(--error-rgb, 239, 68, 68), 0.15);
  color: var(--error);
  border-radius: var(--radius-full);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-secondary);
  color: var(--text-muted);
  border-radius: var(--radius-full);
}

/* Document Requests (Share List) */
.document-requests {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-2);
}

.document-request {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
}

.document-request__title {
  font-weight: 600;
  font-size: 0.85rem;
}

.document-request__subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   Bottom Sheet Component — Elegant Modal
   ============================================ */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-sensual);
}

.bottom-sheet.visible {
  pointer-events: auto;
  opacity: 1;
}

.bottom-sheet__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.bottom-sheet__content {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-gold);
  border-bottom: none;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform var(--duration-sensual) var(--ease-sensual);
  overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.2), 0 0 40px rgba(166, 133, 33, 0.1);
}

.bottom-sheet__content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.5), transparent);
}

.bottom-sheet.visible .bottom-sheet__content {
  transform: translateY(0);
}

.bottom-sheet__handle {
  width: 48px;
  height: 5px;
  background: linear-gradient(90deg, var(--border-subtle), var(--border-gold), var(--border-subtle));
  border-radius: var(--radius-full);
  margin: var(--space-4) auto var(--space-2);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  opacity: 0.6;
}

.bottom-sheet__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.bottom-sheet__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bottom-sheet__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-sensual);
}

.bottom-sheet__close:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-gold);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.bottom-sheet__close svg {
  width: 18px;
  height: 18px;
}

.bottom-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bottom-sheet__footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--bg-secondary));
  border-top: 1px solid var(--border-subtle);
}

/* Footer with horizontal buttons */
.bottom-sheet__footer--horizontal {
  flex-direction: row;
  gap: var(--space-3);
}

.bottom-sheet__footer--horizontal .btn {
  flex: 1;
}

/* Desktop: centered dialog style */
@media (min-width: 768px) {
  .bottom-sheet {
    justify-content: center;
    align-items: center;
  }
  
  .bottom-sheet__content {
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    border-radius: var(--radius-2xl);
    border-bottom: 1px solid var(--border-gold);
    transform: scale(0.9) translateY(30px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), 0 0 60px rgba(166, 133, 33, 0.15);
  }
  
  .bottom-sheet.visible .bottom-sheet__content {
    transform: scale(1) translateY(0);
  }
  
  .bottom-sheet__handle {
    display: none;
  }
}


/* Radio Group */
.radio-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.radio-option:hover {
  background: var(--surface-tertiary);
}

.radio-option input[type="radio"] {
  accent-color: var(--gold-400);
}

.radio-option input[type="radio"]:checked + span {
  color: var(--gold-400);
  font-weight: 500;
}

/* Collapsible Header improvements */
.collapsible-header__content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.collapsible-header__icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-block {
  width: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-sensual);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400), var(--gold-500));
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal) var(--ease-spring);
  box-shadow: 0 0 12px rgba(var(--gold-500-rgb), 0.4);
}

.nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at center bottom, rgba(var(--gold-500-rgb), 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav-item:hover::after {
  opacity: 0.5;
}

.nav-item.active::after {
  opacity: 1;
}

.nav-item:active {
  transform: scale(0.92);
}

@media (min-width: 768px) {
  .nav-item {
    flex-direction: row;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .nav-item::before {
    left: 0;
    top: 50%;
    bottom: auto;
    width: 4px;
    height: 60%;
    transform: translateY(-50%) scaleY(0);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
  }

  .nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
  }

  .nav-item::after {
    background: radial-gradient(ellipse at left center, rgba(var(--gold-500-rgb), 0.08) 0%, transparent 70%);
  }
  
  .nav-label {
    font-size: 16px;
    text-align: left;
    flex: 1;
  }
}

.nav-icon {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-sensual);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-sensual);
}

.nav-item:hover .nav-icon {
  color: var(--text-secondary);
  transform: translateY(-1px);
}

.nav-item:hover .nav-label {
  color: var(--text-secondary);
}

.nav-item.active {
  background: transparent;
}

.nav-item.active .nav-icon {
  color: var(--gold-500);
  filter: drop-shadow(0 2px 4px rgba(var(--gold-500-rgb), 0.3));
}

.nav-item.active .nav-label {
  color: var(--gold-600);
  font-weight: 700;
}

.nav-icon-wrapper {
  position: relative;
  display: inline-flex;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  background: var(--error);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.nav-badge[hidden] {
  display: none;
}

/* ============================================
   Modals & Sheets (Legacy - kept for compatibility)
   ============================================ */

/* Transaction Detail Modal Styles */
.tx-detail-header {
  text-align: center;
  padding-top: var(--space-2);
  margin-bottom: var(--space-5);
}

.tx-detail-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
}

.tx-detail-icon.received {
  background: var(--success-muted);
}

.tx-detail-icon.received svg {
  stroke: var(--success);
}

.tx-detail-icon.sent {
  background: var(--error-muted);
}

.tx-detail-icon.sent svg {
  stroke: var(--error);
}

.tx-detail-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.tx-detail-amount {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.tx-detail-amount.positive {
  color: var(--success);
}

.tx-detail-type {
  font-size: 14px;
  color: var(--text-muted);
}

.tx-detail-rows {
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-4);
  margin-bottom: var(--space-4);
}

.tx-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--list-divider-color);
}

.tx-detail-row:last-child {
  border-bottom: none;
}

.tx-detail-label {
  font-size: 13px;
  color: var(--text-muted);
}

.tx-detail-value {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.tx-detail-user-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.tx-detail-user-name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tx-detail-id {
  font-size: 11px;
}

.tx-detail-note {
  margin-bottom: var(--space-4);
}

.tx-detail-note-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.tx-detail-note-text {
  font-size: 14px;
}

/* Legacy tx-detail-actions - now handled by bottom-sheet__footer */
.tx-detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ============================================
   Toast — Elegant Notifications
   ============================================ */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 100px);
  left: 50%;
  transform: translateX(-50%) translateY(100px) scale(0.9);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(250, 248, 245, 0.9));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-gold-lg), 0 20px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-sensual) var(--ease-sensual);
  z-index: 2000;
}

.toast::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-400), transparent, var(--gold-500));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.toast-icon {
  width: 22px;
  height: 22px;
  color: var(--gold-500);
  filter: drop-shadow(0 2px 4px rgba(166, 133, 33, 0.3));
}

.toast-message {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ============================================
   Typography
   ============================================ */
.text-display {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.text-heading {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.text-small {
  font-size: 14px;
  line-height: 1.5;
}

.text-caption {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.text-mono {
  font-family: 'JetBrains Mono', monospace;
}

.text-gold {
  color: var(--gold-400);
}

.text-gold-gradient {
  background: var(--gold-shine);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--text-muted);
}

.text-error {
  color: var(--error);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ============================================
   Buttons — Sensual Interactions
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-sensual);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.btn:hover::before {
  opacity: 1;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 50%, var(--gold-600) 100%);
  background-size: 200% 200%;
  background-position: 50% 50%;
  color: var(--text-inverse);
  border: 1px solid var(--gold-500);
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background-position: 0% 0%;
  box-shadow: var(--shadow-gold-lg), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-primary:active {
  background-position: 100% 100%;
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary:active {
  box-shadow: var(--shadow-sm);
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
  border-color: var(--border-subtle);
  backdrop-filter: blur(10px);
}

.btn-outline-gold {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(254, 253, 251, 0.8));
  color: var(--gold-600);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-sm);
}

.btn-outline-gold:hover {
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.1), rgba(166, 133, 33, 0.05));
  border-color: var(--gold-400);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 16px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.02em;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.3);
}

/* Button Loading State */
.btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .btn-spinner {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
}

.btn.loading {
  position: relative;
  pointer-events: none;
}

/* Note: @keyframes spin is defined above for loading-spinner */

/* ============================================
   Cards — Elegant Glassmorphism
   ============================================ */
.card {
  background: var(--gold-100);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-sensual);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  opacity: 0.6;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-gold);
}

.card-gold {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(254, 253, 251, 0.9));
}

.card-gold::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-400) 0%, transparent 40%, transparent 60%, var(--gold-500) 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.card-gold:hover::before {
  opacity: 1;
}

.card-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--duration-sensual) var(--ease-out);
  pointer-events: none;
}

.card-gold:hover::after {
  opacity: 0.5;
}

.card-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  border: none;
}

.card-elevated:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

/* Shared translucent card shell (profile + contact detail) */
.profile-view .push-card,
.profile-view .trust-card,
.profile-view .balance-card,
.contact-view .trust-card,
.contact-view .limits-card,
.tx-detail-rows,
.tx-detail-note {
  background: transparent;
  border: 2px solid var(--gold-300);
  box-shadow: var(--shadow-glow);
}

.profile-view .push-card:hover,
.profile-view .trust-card:hover,
.profile-view .balance-card:hover {
  border-color: #c8d1de;
  box-shadow: var(--shadow-glow);
  transform: none;
}

.profile-view .balance-card,
.contact-view .trust-card,
.contact-view .limits-card,
.tx-detail-rows,
.tx-detail-note {
  border-radius: var(--radius-lg);
}

.profile-view .balance-card,
.contact-view .trust-card,
.contact-view .limits-card,
.tx-detail-note {
  padding: var(--space-4);
}

/* ============================================
   Inputs — Elegant Forms
   ============================================ */
.input {
  width: 100%;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration-normal) var(--ease-sensual);
}

.input:hover {
  border-color: var(--border-gold);
}

.input:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 4px rgba(166, 133, 33, 0.12), var(--shadow-gold);
  background: var(--bg-elevated);
}

.input::placeholder {
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

.input:focus::placeholder {
  color: var(--gold-400);
  opacity: 0.5;
}

.input-lg {
  padding: var(--space-5) var(--space-6);
  font-size: 18px;
  border-radius: var(--radius-xl);
}

/* Contacts add button variant */
.contacts-view .btn-primary-soft {
  background: var(--bg-secondary);
  border: 4px solid var(--gold-500);
  color: var(--gold-500);
  box-shadow: var(--shadow-sm);
}

.contacts-view .btn-primary-soft:hover {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

/* ============================================
   Trust Bar — Elegant Progress
   ============================================ */
.trust-bar {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trust-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500) 0%, var(--gold-400) 50%, var(--gold-500) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-sensual) var(--ease-sensual);
  position: relative;
  box-shadow: 0 0 20px rgba(166, 133, 33, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: trustGradient 3s ease-in-out infinite;
}

@keyframes trustGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.trust-bar-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
  border-radius: inherit;
}

.trust-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Compact trust bars used in list row metadata */
.contacts-view .trust-bar,
.transfer-view .recipient-meta .trust-bar {
  width: 40px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.contacts-view .trust-bar-fill,
.transfer-view .recipient-meta .trust-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
}

/* Trust card-specific palette in profile view */
.profile-view .trust-card .trust-bar {
  background: rgba(122, 139, 168, 0.22);
  box-shadow: inset 0 1px 2px rgba(40, 53, 72, 0.18);
}

.profile-view .trust-card .trust-bar-fill {
  background: linear-gradient(90deg, #5f7698 0%, #7f96b7 50%, #5f7698 100%);
  box-shadow: 0 0 10px rgba(112, 137, 175, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

/* ============================================
   Badges — Elegant Pills
   ============================================ */
.badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--space-1);
  padding: 5px var(--space-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--duration-fast) var(--ease-out);
}

.badge-fresh {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(5, 150, 105, 0.08));
  color: var(--success);
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.15);
}

.badge-verified {
  background: linear-gradient(135deg, rgba(166, 133, 33, 0.15), rgba(166, 133, 33, 0.08));
  color: var(--gold-600);
  box-shadow: 0 0 12px rgba(166, 133, 33, 0.15);
}

.badge-recent {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.08));
  color: #059669;
}

.badge-warm {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(217, 119, 6, 0.08));
  color: var(--warning);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.15);
}

.badge-cool {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0.06));
  color: #DC2626;
}

.badge-dormant {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.08));
  color: var(--error);
}

.badge-gold {
  background: linear-gradient(135deg, rgba(166, 133, 33, 0.2), rgba(201, 162, 39, 0.1));
  color: var(--gold-600);
  box-shadow: 0 0 16px rgba(166, 133, 33, 0.2);
}

.badge-muted {
  background: var(--bg-glass);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-error {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.08));
  color: var(--error);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.1);
}

.badge-level {
  background: var(--bg-glass-strong);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   Avatars — Premium Polish
   ============================================ */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-image:
    var(--coin-bg-faded-stack),
    linear-gradient(145deg, var(--gold-400) 0%, var(--gold-500) 50%, var(--gold-600) 100%);
  background-size: 100% 100%, cover, 100% 100%;
  background-position: center center, center center, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-inverse);
  flex-shrink: 0;
  position: relative;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-sensual);
}

.avatar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
  border-radius: inherit;
}

.avatar::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%);
  transform: rotate(45deg);
  transition: all var(--duration-sensual) var(--ease-out);
}

.list-item:hover .avatar::after,
.transaction-item:hover .avatar::after {
  transform: rotate(45deg) translateX(100%);
}

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.avatar-photo--coin {
  transform: scale(1.12);
  transform-origin: center;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.avatar-md {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.avatar-lg {
  width: 110px;
  height: 110px;
  font-size: 32px;
  box-shadow: var(--shadow-gold-lg);
}

.avatar-xl {
  width: 256px;
  height: 256px;
  font-size: 36px;
  box-shadow: var(--shadow-gold-lg), 0 0 60px rgba(166, 133, 33, 0.2);
}

/* Entity type colors: silver for people, gunmetal for business */
.avatar-person {
  background-image:
    var(--coin-bg-faded-stack),
    linear-gradient(145deg, #CBD5E1 0%, #94A3B8 50%, #64748B 100%);
  background-size: 100% 100%, cover, 100% 100%;
  background-position: center center, center center, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.avatar-business {
  background-image:
    var(--coin-bg-faded-stack),
    linear-gradient(145deg, #475569 0%, #334155 50%, #1E293B 100%);
  background-size: 100% 100%, cover, 100% 100%;
  background-position: center center, center center, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ============================================
   Money Format
   ============================================ */
.money-format {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1;
}

.money-sign,
.money-whole {
  line-height: 1;
}

.money-cents {
  display: inline-block;
  font-size: 0.56em;
  line-height: 1;
  transform: translateY(-0.26em);
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.02em;
  margin-left: 0.04em;
  opacity: 0.95;
}

/* ============================================
   Shared Top Action Controls (Activity + Profile + Contact)
   ============================================ */
.activity-view .top-action-center,
.profile-view .top-action-center,
.contact-view .top-action-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.activity-view .top-action-btn,
.profile-view .top-action-btn,
.contact-view .top-action-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  padding: 4px;
  cursor: pointer;
  opacity: 0.65;
}

.activity-view .top-action-divider,
.profile-view .top-action-divider,
.contact-view .top-action-divider {
  width: 1px;
  height: 24px;
  align-self: center;
  margin: 0 2px;
  opacity: 0.95;
  background: #c8ced8;
}

.activity-view .top-icon-btn,
.profile-view .top-icon-btn,
.contact-view .top-icon-btn {
  border: none;
  background: transparent;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7cdd7;
  padding: 0;
  cursor: pointer;
}

.activity-view .top-icon-btn svg,
.activity-view .top-icon-static svg,
.profile-view .top-icon-btn svg,
.profile-view .top-icon-static svg,
.contact-view .top-icon-btn svg,
.contact-view .top-icon-static svg {
  width: 26px;
  height: 26px;
}

.activity-view .top-icon-static,
.profile-view .top-icon-static,
.contact-view .top-icon-static {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7cdd7;
}

/* ============================================
   Shared Dark Section Sheen
   ============================================ */
.dark-section-shell,
.activity-view .stat-card-balance {
  position: relative;
  background: #121417;
  background: var(--dark-section-bg);
  border: 1px solid #1f2430;
  overflow: hidden;
  box-shadow:
    0 4px 8px rgba(23, 31, 45, 0.42),
    0 8px 18px rgba(8, 10, 14, 0.08);
}

.dark-section-shell > *,
.activity-view .stat-card-balance > * {
  position: relative;
  z-index: 1;
}

.dark-section-shell::before,
.activity-view .stat-card-balance::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4c5f7a, #b8c6dc, #4c5f7a);
  z-index: 2;
  pointer-events: none;
}

.dark-section-shell::after,
.activity-view .stat-card-balance::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(255, 255, 255, 0) 70%,
    transparent 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 1;
  animation: sectionSheenSweep 4.2s ease-in-out infinite;
}

/* Contacts stats bar layout + typography */
.contacts-view .stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  margin-top: var(--space-4);
  padding: 10px 8px 0;
  border-radius: var(--radius-xl);
}

.contacts-view .stat {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  text-align: center;
}

.contacts-view .stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.contacts-view .stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ensure balance shell wins over generic .stat-card styling */
.activity-view .stat-card.dark-section-shell {
  background: var(--dark-section-bg);
  border: 1px solid #1f2430;
  box-shadow:
    0 4px 8px rgba(23, 31, 45, 0.42),
    0 8px 18px rgba(8, 10, 14, 0.08);
}

/* Activity balance card ownership is centralized here */
.activity-view .activity-summary-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-300);
  position: relative;
  top: 5px;
  opacity: 0.6;
  padding-bottom: var(--space-2);
}

.activity-view .activity-stats {
  display: block;
  margin-bottom: var(--space-6);
}

.activity-view .stat-card {
  background: rgba(255, 255, 255, 0.95);
  border: 0 solid #d8deea;
  border-radius: 24px;
  padding: var(--space-5);
  box-shadow: 0 10px 26px rgba(23, 31, 45, 0.08);
}

.activity-view .stat-card-balance {
  padding: var(--space-6) var(--space-6) 0;
}

.activity-view .stat-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.activity-view .stat-balance-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.activity-view .stat-action-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.activity-view .stat-action-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.activity-view .stat-balance-value {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.activity-view .balance-rollup-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.activity-view .stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #4d5666;
  transition: filter 140ms ease, transform 140ms ease, letter-spacing 140ms ease;
  letter-spacing: -0.005em;
  line-height: 1;
}

.activity-view .stat-month-summary {
  position: relative;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin-top: var(--space-8);
  line-height: 1.35;
}

.activity-view .summary-prefix,
.activity-view .summary-suffix {
  color: rgba(255, 255, 255, 0.78);
  opacity: 0.5;
  font-weight: 500;
}

.activity-view .summary-net {
  font-size: 16px;
  font-weight: 700;
  text-shadow: none;
}

.activity-view .summary-count {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.activity-view .stat-value.is-shuffling {
  filter: blur(1.4px);
  transform: translateY(-1px) scale(1.03);
  letter-spacing: 0.7px;
}

.activity-view .stat-value.positive {
  color: var(--success);
}

.activity-view .stat-value.negative {
  color: var(--error);
}

.activity-view .stat-digit {
  display: inline-block;
  min-width: 0.3em;
}

.activity-view .stat-digit.changed {
  animation: statDigitSettle 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d, 0) * 20ms);
}

@keyframes statDigitSettle {
  0% {
    opacity: 0.15;
    transform: translateY(8px) scale(0.9);
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    transform: translateY(-1px) scale(1.08);
    filter: blur(0) drop-shadow(0 0 8px rgba(251, 191, 36, 0.55));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sectionSheenSweep {
  0%, 58% { left: -100%; opacity: 0; }
  68% { opacity: 1; }
  100% { left: 150%; opacity: 0; }
}

/* ============================================
   Shared Icon Action Buttons
   ============================================ */
.activity-view .activity-user-action-btn,
.contacts-view .contact-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
}

/* ============================================
   Shared Person Rows (Contacts + Transfer)
   ============================================ */
.contacts-view .contact-card,
.transfer-view .recipient-card {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.contacts-view .contact-card {
  padding: var(--space-1) var(--space-3);
  padding-bottom: 0;
}

.transfer-view .recipient-card {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.contacts-view .contact-card::before,
.transfer-view .recipient-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-400) 0%, var(--gold-500) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.contacts-view .contact-card::after,
.transfer-view .recipient-card::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: var(--list-divider-line);
  pointer-events: none;
}

.contacts-view .contact-card:hover::before,
.transfer-view .recipient-card:not(.no-hover):hover::before {
  opacity: 1;
}

.contacts-view .contact-card:hover,
.transfer-view .recipient-card:not(.no-hover):hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(166, 133, 33, 0.08);
  transform: translateX(4px) translateY(-2px);
}

.contacts-view .contact-card:active,
.transfer-view .recipient-card:not(.no-hover):active {
  transform: translateX(2px) scale(0.99);
  box-shadow: var(--shadow-sm);
}

.contacts-view .contact-avatar,
.transfer-view .recipient-avatar {
  position: relative;
}

.contacts-view .contact-avatar .avatar,
.transfer-view .recipient-avatar .avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
  border: 1px solid var(--gold-400);
}

.contacts-view .contact-avatar .avatar.institution,
.transfer-view .recipient-avatar .avatar.institution {
  background-image:
    var(--coin-bg-faded-stack),
    linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  background-size: 100% 100%, cover, 100% 100%;
  background-position: center center, center center, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  font-size: 20px;
}

.contacts-view .contact-avatar .online-indicator,
.transfer-view .recipient-avatar .online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius-full);
  z-index: 5;
}

.contacts-view .contact-info,
.transfer-view .recipient-info {
  flex: 1;
  min-width: 0;
  margin-left: var(--space-2);
}

.contacts-view .contact-name,
.transfer-view .recipient-name {
  font-size: var(--list-text-size);
  font-weight: var(--list-text-weight);
  margin-bottom: 1px;
  line-height: 1.12;
  color: var(--text-primary);
  transition: color var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 1;
}

.contacts-view .contact-card:hover .contact-name,
.transfer-view .recipient-card:not(.no-hover):hover .recipient-name {
  color: var(--gold-700);
}

/* ============================================
   Transaction Item (shared across views)
   ============================================ */
.transaction-item {
  margin-left: 12px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-1);
  padding-bottom: 0;
  background: var(--gold-100);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-sensual);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.transaction-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-400) 0%, var(--gold-500) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.transaction-item:hover::before {
  opacity: 1;
}

.transaction-item:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(166, 133, 33, 0.08);
  transform: translateX(4px) translateY(-2px);
}

.transaction-item:active {
  transform: translateX(2px) scale(0.99);
  box-shadow: var(--shadow-sm);
}

.transaction-info {
  flex: 1;
  min-width: 0;
  margin-left: var(--space-2);
}

.transaction-name {
  transition: color var(--duration-fast) var(--ease-out);
}

.transaction-item:hover .transaction-name {
  color: var(--gold-700);
}

.transaction-note {
  font-size: 13px;
  opacity: 0.5;
  color: var(--text-muted);
}

.transaction-amount {
  text-align: right;
  flex-shrink: 0;
  line-height: 1.15;
}

.transaction-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.transaction-value.positive {
  color: var(--success);
}

.transaction-time {
  font-size: 11px;
  color: black;
  opacity: 0.6;
}

.transaction-status {
  position: relative;
  top: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================
  Flat transaction rows (shared: activity + profile)
   ============================================ */
.activity-view .transaction-item,
.profile-view .recent-list .transaction-item,
.contact-view .transaction-item {
  margin-left: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 14px;
  transition: background 120ms ease, transform 120ms ease;
}

.activity-view .transaction-item::before,
.profile-view .recent-list .transaction-item::before,
.contact-view .transaction-item::before {
  display: none;
}

.activity-view .transaction-item::after,
.profile-view .recent-list .transaction-item::after,
.contact-view .transaction-item::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: var(--list-divider-line);
  pointer-events: none;
}


.activity-view .transaction-item:hover,
.profile-view .recent-list .transaction-item:hover,
.contact-view .transaction-item:hover {
  border-color: transparent;
  box-shadow: none;
  background: rgba(225, 230, 238, 0.28);
}

.activity-view .transaction-item:active,
.profile-view .recent-list .transaction-item:active,
.contact-view .transaction-item:active {
  transform: scale(0.99);
  background: rgba(214, 220, 231, 0.42);
}

.activity-view .transaction-item .avatar,
.profile-view .recent-list .transaction-item .avatar {
  width: 64px;
  height: 64px;
  border: 1px solid var(--gold-400);
  background-color: #d7dce5;
  color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

.activity-view .transaction-item .transaction-name,
.profile-view .recent-list .transaction-item .transaction-name,
.contact-view .transaction-item .transaction-name {
  font-size: var(--list-text-size);
  font-weight: var(--list-text-weight);
  color: #252d3b;
  line-height: 1.16;
  margin-bottom: 1px;
}

.activity-view .transaction-item .transaction-note,
.profile-view .recent-list .transaction-item .transaction-note,
.contact-view .transaction-item .transaction-note {
  font-size: var(--list-text-size);
  color: #667184;
  line-height: 1.08;
  opacity: 1;
}

.activity-view .transaction-item .transaction-value,
.profile-view .recent-list .transaction-item .transaction-value,
.contact-view .transaction-item .transaction-value {
  font-size: var(--list-text-size);
  font-weight: var(--list-text-weight);
}

.activity-view .transaction-item .transaction-value.positive,
.profile-view .recent-list .transaction-item .transaction-value.positive,
.contact-view .transaction-item .transaction-value.positive {
  color: #18a34a;
}

.activity-view .transaction-item .transaction-value:not(.positive),
.profile-view .recent-list .transaction-item .transaction-value:not(.positive),
.contact-view .transaction-item .transaction-value:not(.positive) {
  color: #e23b45;
}

.activity-view .transaction-item .transaction-time,
.profile-view .recent-list .transaction-item .transaction-time,
.contact-view .transaction-item .transaction-time {
  color: #6c7588;
  margin-top: 0;
  line-height: 1.08;
}

.activity-view .transaction-item .transaction-meta-currency,
.profile-view .recent-list .transaction-item .transaction-meta-currency {
  color: #6c7588;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
}

.activity-view .transaction-item .transaction-status,
.profile-view .recent-list .transaction-item .transaction-status,
.contact-view .transaction-item .transaction-status {
  margin-top: 3px;
  font-size: 11px;
  background: #ecf0f6;
  color: #657083;
  border-radius: 999px;
  padding: 3px 9px;
}

/* Contact history direction icon styles */
.contact-view .tx-direction {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact-view .tx-direction.sent {
  color: #e23b45;
}

.contact-view .tx-direction.received {
  color: #18a34a;
}

.contact-view .tx-direction svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.contact-view .transaction-list .transaction-item:last-child::after {
  display: none;
}

.activity-view .activity-items .transaction-item:last-child::after {
  display: none;
}

/* ============================================
   Verified Badge — Premium Seal
   ============================================ */
.verified-badge {
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-500), var(--gold-600));
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(166, 133, 33, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}

.verified-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
}

.verified-badge svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-inverse);
  stroke-width: 3;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.profile-badge-coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--gold-400);
  box-shadow: 0 1px 4px rgba(166, 133, 33, 0.25);
  display: inline-block;
  vertical-align: middle;
  transform: scale(1.1);
  transform-origin: center;
}

.profile-badge-coin--seal {
  width: 22px;
  height: 22px;
  border-width: 1.5px;
}

/* ============================================
   Page Layout — Elegant Headers
   ============================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
  position: relative;
}

@media (min-width: 768px) {
  .page-header {
    margin-bottom: var(--space-12);
    align-items: flex-end;
  }
  
  .page-title {
    font-size: 48px;
  }
}

.page-title {
  opacity: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  position: relative;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
  border-radius: var(--radius-full);
  opacity: 0.8;
}

/* View-specific page header/title overrides */
.activity-view .page-header {
  display: none;
}

.activity-view .page-title {
  margin: 0;
  line-height: 1;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.contacts-view .page-header {
  min-height: 48px;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contacts-view .page-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.contact-view .page-header {
  margin-bottom: var(--space-4);
}

.profile-view .page-header {
  min-height: 44px;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-view .page-title {
  display: none;
}

.settings-view .page-header {
  margin-bottom: var(--space-6);
}

.settings-view .page-title {
  font-size: 20px;
}

.transfer-view .page-header {
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transfers-view .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

/* ============================================
   Sections
   ============================================ */
.section {
  margin-bottom: var(--space-5);
}

@media (min-width: 1024px) {
  .section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

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

.section-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--gold-400);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.section-action:hover {
  color: var(--gold-300);
}

/* ============================================
   List Items — Elegant Interactions
   ============================================ */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-sensual);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.list-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-sensual);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.list-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left var(--duration-sensual) var(--ease-out);
}

.list-item:hover::after {
  left: 150%;
}

@media (min-width: 768px) {
  .list-item {
    padding: var(--space-6);
  }
  
  .list-item-title {
    font-size: 18px;
  }
}

.list-item:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-3px) scale(1.01);
}

.list-item:hover::before {
  opacity: 1;
}

.list-item:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: var(--shadow-md);
}

.list-item + .list-item {
  margin-top: var(--space-2);
}

.list-item-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.list-item-title {
  font-weight: 600;
  margin-bottom: 2px;
  transition: color var(--duration-fast) var(--ease-out);
}

.list-item:hover .list-item-title {
  color: var(--gold-700);
}

.list-item-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.list-item-value {
  text-align: right;
  position: relative;
  z-index: 1;
}

.list-item-amount {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.list-item-amount.positive {
  color: var(--success);
}

.list-item-amount.negative {
  color: var(--text-primary);
}

.list-item-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Balance Display — Statement Piece
   ============================================ */
.balance-display {
  text-align: center;
  padding: var(--space-8) 0;
  position: relative;
}

@media (min-width: 768px) {
  .balance-display {
    text-align: left;
    padding: var(--space-10) 0;
  }
}

.balance-amount {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold-500) 40%, var(--gold-400) 60%, var(--text-primary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: balanceShimmer 4s ease-in-out infinite;
  position: relative;
}

@keyframes balanceShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.balance-currency {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: var(--space-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================
   Action Buttons Row
   ============================================ */
.action-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .action-buttons {
    justify-content: flex-start;
  }
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  min-width: 80px;
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.action-btn:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg);
}

.action-btn:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-sm);
}

.action-btn-icon {
  width: 32px;
  height: 32px;
  background: var(--gold-500);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
}

.action-btn-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Contact detail action buttons use a denser card variant */
.contact-view .action-btn {
  flex: 1;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 13px;
  border-color: var(--border-subtle);
}

.contact-view .action-btn:hover {
  border-color: var(--border-subtle);
  box-shadow: none;
}

.contact-view .action-btn:active {
  transform: scale(0.96);
}

.contact-view .action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.contact-view .action-btn svg {
  width: 24px;
  height: 24px;
}

.contact-view .action-btn-icon-wrapper {
  position: relative;
  display: inline-flex;
}

.contact-view .action-btn-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  background: var(--error);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.contact-view .action-btn-badge[hidden] {
  display: none;
}

.contact-view .action-btn.primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border-color: var(--gold-400);
  color: var(--text-inverse);
}

/* ============================================
   QR Code Container
   ============================================ */
.qr-container {
  background: white;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  box-shadow: var(--gold-glow);
  position: relative;
}

.qr-container::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-xl) + 3px);
  background: var(--gold-metallic);
  z-index: -1;
  animation: qrPulse 3s ease-in-out infinite;
}

@keyframes qrPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ============================================
   Utilities
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* List item entry animation - apply to any list item */
.list-animate-item {
  opacity: 0;
  animation: listItemIn 0.35s ease-out forwards;
  animation-delay: var(--anim-delay, 0ms);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes goldPulse {
  0%, 100% {
    box-shadow: var(--gold-glow-soft);
  }
  50% {
    box-shadow: var(--gold-glow);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out) forwards;
}

.animate-slide-up {
  animation: slideUp var(--duration-normal) var(--ease-out) forwards;
}

.animate-scale-in {
  animation: scaleIn var(--duration-normal) var(--ease-spring) forwards;
}

.animate-gold-pulse {
  animation: goldPulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Stagger children — Elegant Cascade */
.stagger > * {
  opacity: 0;
  animation: staggerIn var(--duration-sensual) var(--ease-sensual) forwards;
}

@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }
.stagger > *:nth-child(7) { animation-delay: 300ms; }
.stagger > *:nth-child(8) { animation-delay: 350ms; }
.stagger > *:nth-child(9) { animation-delay: 400ms; }
.stagger > *:nth-child(10) { animation-delay: 450ms; }

/* ============================================
   Success Animation — Celebration
   ============================================ */
.success-check {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, var(--gold-400), var(--gold-500), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPop 0.6s var(--ease-spring);
  box-shadow: var(--shadow-gold-lg), 0 0 60px rgba(166, 133, 33, 0.3);
  position: relative;
}

.success-check::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold-300), transparent, var(--gold-400));
  z-index: -1;
  animation: successRing 1s var(--ease-sensual) forwards;
  opacity: 0;
}

@keyframes successRing {
  0% { transform: scale(0.8); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

.success-check::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
}

.success-check svg {
  width: 44px;
  height: 44px;
  stroke: var(--text-inverse);
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck 0.5s ease-out 0.3s forwards;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes successPop {
  0% { transform: scale(0) rotate(-10deg); }
  60% { transform: scale(1.15) rotate(3deg); }
  80% { transform: scale(0.95) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

/* ============================================
   Divider
   ============================================ */
.divider {
  height: 1px;
  background: var(--list-divider-line);
  margin: var(--space-6) 0;
}

.divider-gold {
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

/* ============================================
   Page Transitions (keep original behavior)
   ============================================ */
/* Note: .view base styles are defined earlier in the file */

/* ============================================
   Enhanced Toast (overrides base toast)
   ============================================ */
.toast.toast-success {
  border-color: var(--success);
}

.toast.toast-error {
  border-color: var(--error);
}

/* ============================================
   Pull to Refresh
   ============================================ */
.pull-indicator {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-gold);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.pull-indicator.visible {
  opacity: 1;
}

.pull-indicator.refreshing {
  animation: spin 1s linear infinite;
}

.pull-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold-400);
}

/* ============================================
   Tap Highlight (native feel)
   ============================================ */
.tap-highlight {
  position: relative;
  overflow: hidden;
}

.tap-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--tap-x, 50%) var(--tap-y, 50%), 
    var(--accent-soft) 0%, 
    transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.tap-highlight:active::after {
  opacity: 1;
}

/* ============================================
   ID Scan View
   ============================================ */
.id-scan-view {
  padding-bottom: var(--space-6);
}

.id-scan-view .page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.id-scan-view .page-title {
  font-size: 1.5rem;
  margin: 0;
}

.id-scan-view .scan-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.id-scan-view .scan-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.id-scan-view .scan-actions .btn {
  flex: 1;
  max-width: 180px;
}

/* QR Scanner (Html5Qrcode) styles */
.scanner-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  min-height: 300px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: #111;
}

#qr-reader,
#qr-reader-profile,
#qr-reader-scanner {
  width: 100% !important;
  min-height: 300px !important;
  border: none !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

/* Force video to be visible */
#qr-reader video,
#qr-reader-profile video,
#qr-reader-scanner video {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 300px !important;
  object-fit: cover !important;
  position: relative !important;
  z-index: 1 !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Hide all Html5Qrcode overlays and UI */
#qr-reader__dashboard,
#qr-reader-profile__dashboard,
#qr-reader-scanner__dashboard,
#qr-reader__scan_region img,
#qr-reader-profile__scan_region img,
#qr-reader-scanner__scan_region img,
#qr-reader__scan_region canvas,
#qr-reader-profile__scan_region canvas,
#qr-reader-scanner__scan_region canvas {
  display: none !important;
}

/* Make the shaded region transparent */
#qr-reader__scan_region,
#qr-reader-profile__scan_region,
#qr-reader-scanner__scan_region {
  background: transparent !important;
  box-shadow: none !important;
}

.scanner-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: var(--space-4);
}

.scanner-status {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.scanner-status.scanning {
  color: var(--text-muted);
}

.scanner-status.success {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.scanner-status.error {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Full-screen scanner overlay (BlinkID) */
.scanner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
}

.scanner-overlay.active {
  display: block;
}

.scanner-overlay .blinkid-host {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* Scanner loading indicator */
.scanner-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: white;
  z-index: 10;
  gap: var(--space-4);
}

.scanner-loading.hidden {
  display: none;
}

.scanner-loading p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.scanner-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.scanner-overlay .blinkid-host > *,
.scanner-overlay .blinkid-host > * > * {
  width: 100% !important;
  height: 100% !important;
}

.scanner-overlay video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.scanner-exit-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-4));
  right: calc(env(safe-area-inset-right, 0px) + var(--space-4));
  z-index: 100000;
  display: none;
}

.scanner-overlay.active ~ .scanner-exit-btn {
  display: inline-flex;
}

/* Coin portrait intro splash shown on app load */
.coin-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  animation: coinIntroOverlayFade 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.coin-intro-glow {
  position: absolute;
  width: min(86vw, 560px);
  height: min(86vw, 560px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.34) 42%,
    rgba(255, 255, 255, 0.08) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  filter: blur(6px);
  animation: coinIntroGlowPulse 700ms ease-out forwards;
}

.coin-intro-image {
  position: relative;
  width: min(64vw, 360px);
  height: min(64vw, 360px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65),
    0 0 30px rgba(255, 255, 255, 0.9),
    0 0 76px rgba(255, 255, 255, 0.5);
  animation: coinIntroImagePop 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes coinIntroOverlayFade {
  0% { opacity: 0; }
  12% { opacity: 1; }
  62% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes coinIntroImagePop {
  0% {
    opacity: 0;
    transform: scale(0.84);
    filter: blur(2px) brightness(1.15);
  }
  20% {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(0) brightness(1.06);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
    filter: blur(0.6px) brightness(1.03);
  }
}

@keyframes coinIntroGlowPulse {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }
  26% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

/* Upload panel */
.id-scan-view .upload-card {
  display: none;
}

.id-scan-view .upload-card.visible {
  display: block;
}

.id-scan-view .upload-grid {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.id-scan-view .upload-panel {
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--border-subtle);
  background: var(--bg-glass);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
  cursor: pointer;
}

.id-scan-view .upload-panel.hidden {
  display: none;
}

.id-scan-view .upload-panel input[type="file"] {
  width: 100%;
  font-size: 0.9rem;
}

.id-scan-view .upload-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
  text-align: center;
}

/* Results card */
.id-scan-view .results-card {
  margin-top: var(--space-2);
}

.id-scan-view .scan-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.id-scan-view .scan-results .result-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.id-scan-view .scan-results dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-scan-view .scan-results dd {
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.id-scan-view .face-preview {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.id-scan-view .face-frame {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.id-scan-view .face-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.id-scan-view .face-placeholder {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 8px;
}

.id-scan-view .face-frame.has-image img {
  display: block;
}

.id-scan-view .face-frame.has-image .face-placeholder {
  display: none;
}

.id-scan-view .status-message {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.5em;
}

.id-scan-view .status-message:empty {
  display: none;
}

/* ============================================
   Collapsible Card
   ============================================ */
.collapsible-card {
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  text-align: left;
}

.collapsible-header:hover {
  background: var(--bg-tertiary);
}

.collapsible-header .section-title {
  margin: 0;
}

.collapse-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  transition: transform 0.2s ease;
}

.collapsible-card.expanded .collapse-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 var(--space-4);
}

.collapsible-card.expanded .collapsible-content {
  max-height: 500px; /* Fallback for content height */
  padding-bottom: var(--space-4);
}


/* ==============================================
   Recovery Codes Shared Styles
   ============================================== */
.recovery-warning-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--warning-muted);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.recovery-warning-box.with-icon {
  flex-direction: row;
  gap: var(--space-3);
}

.recovery-warning-box svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke: var(--warning);
}

.recovery-warning-box strong {
  display: block;
  color: var(--warning);
  margin-bottom: var(--space-1);
}

.recovery-warning-box p {
  font-size: 13px;
  color: var(--warning);
  margin: 0;
}

.recovery-codes-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.recovery-codes-display.with-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.recovery-codes-display .code {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-align: center;
  user-select: all;
}

/* ============================================
   BlinkID Camera - Hidden during preload
   ============================================ */
#camera-manager-mount-point.preload-hidden {
  display: none !important;
}

/* ============================================
   Pagination Controls (shared)
   ============================================ */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-8);
}

.pagination-container.hidden {
  display: none;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pagination-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--gold-400);
}

.pagination-btn:hover:not(:disabled) svg {
  stroke: var(--gold-400);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
  min-width: 100px;
  text-align: center;
}

