:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --primary-glow: rgba(37,99,235,0.20);
    --accent: #0EA5E9;
    --accent-dark: #0284C7;
    --accent-light: #E0F2FE;
    --danger: #EF4444;
    --warning: #F59E0B;
    --warning-dark: #D97706;
    --success: #10B981;
    --bg: #EEF4FF;
    --bg-2: #F5F9FF;
    --card: #FFFFFF;
    --text: #1E3A5F;
    --text-muted: #5E7A99;
    --border: #CCDAF5;
    --nav-h: 72px;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 2px 8px rgba(30,58,95,0.06), 0 8px 28px rgba(37,99,235,0.10);
    --shadow-lg: 0 6px 16px rgba(30,58,95,0.10), 0 16px 52px rgba(37,99,235,0.18);
    --ease: cubic-bezier(.22,1,.36,1);
  }

  #app.dark {
    --bg: #080F20;
    --bg-2: #0C1730;
    --card: #0F1E38;
    --text: #E2EEFF;
    --text-muted: #7A90B0;
    --border: #1C2F52;
    --shadow: 0 4px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.45);
    --primary-light: rgba(37,99,235,0.18);
    --primary-glow: rgba(37,99,235,0.32);
    --accent-light: rgba(14,165,233,0.18);
  }

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

  body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(155deg, #C8DCFF 0%, #A8C8FF 30%, #D8EAFF 60%, #E8F2FF 100%);
    background-size: 400% 400%;
    animation: bgShift 14s ease infinite;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    overflow: hidden;
  }

  body.dark-body {
    background: linear-gradient(155deg, #04091A 0%, #08112B 50%, #060E22 100%);
    animation: none;
  }

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

  #app {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100svh;
    max-height: 900px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    box-shadow:
      0 32px 100px rgba(30,58,95,0.22),
      0 0 0 1px rgba(255,255,255,0.6),
      0 0 60px rgba(37,99,235,0.15);
    border-radius: 40px;
    transition: background 0.35s ease;
  }
  #app.dark {
    box-shadow:
      0 32px 100px rgba(0,0,0,0.55),
      0 0 0 1px rgba(255,255,255,0.06),
      0 0 60px rgba(37,99,235,0.18);
  }

  #loadingOverlay {
    position: absolute; inset: 0;
    background: rgba(30,58,95,0.38);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: none;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
    border-radius: inherit;
  }
  #app.dark #loadingOverlay { background: rgba(4,8,18,0.55); }
  #loadingOverlay.show { display: flex; animation: fadeIn 0.18s ease; }
  .loading-ring {
    width: 52px; height: 52px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
  }
  .loading-text { font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 600; letter-spacing: 0.3px; }

  .screen {
    position: absolute; inset: 0;
    overflow-y: auto; overflow-x: hidden;
    padding-bottom: var(--nav-h);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(16px);
    -webkit-overflow-scrolling: touch;
  }
  .screen.active {
    opacity: 1; pointer-events: all;
    transform: translateY(0);
  }
  .screen.no-nav { padding-bottom: 0; }

  #splash {
    background: radial-gradient(ellipse at 55% 42%, #C8DCFF 0%, #D8EAFF 28%, #EEF5FF 55%, #F5F9FF 80%, #FAFCFF 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0;
    z-index: 100;
    padding-bottom: 0 !important;
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    overflow: hidden;
  }
  #app.dark #splash {
    background: radial-gradient(ellipse at 55% 42%, #081530 0%, #0B1A38 28%, #0D1F40 55%, #0A1628 80%, #080F20 100%);
  }

  #splash::before {
    content: ''; position: absolute;
    width: 340px; height: 340px; border-radius: 50%;
    border: 1.5px solid rgba(37,99,235,0.14);
    top: 46%; left: 50%; transform: translate(-50%,-50%);
    animation: ringPulse 3.5s ease-in-out infinite;
  }
  #splash::after {
    content: ''; position: absolute;
    width: 240px; height: 240px; border-radius: 50%;
    border: 1.5px solid rgba(37,99,235,0.18);
    top: 46%; left: 50%; transform: translate(-50%,-50%);
    animation: ringPulse 3.5s ease-in-out infinite 0.7s;
  }
  .splash-ring3 {
    position: absolute;
    width: 155px; height: 155px; border-radius: 50%;
    border: 1.5px solid rgba(37,99,235,0.24);
    top: 46%; left: 50%; transform: translate(-50%,-50%);
    animation: ringPulse 3.5s ease-in-out infinite 1.4s;
    pointer-events: none; z-index: 0;
  }
  @keyframes ringPulse {
    0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.85); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(1.18); }
  }

  .splash-worldmap {
    position: absolute;
    top: 20%; right: -8%; width: 72%; height: 56%;
    background-image: radial-gradient(circle, rgba(37,99,235,0.22) 1px, transparent 1px);
    background-size: 11px 11px;
    border-radius: 50%;
    mask-image: radial-gradient(ellipse 80% 80% at 60% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 60% 50%, black 30%, transparent 80%);
    opacity: 0.65;
    pointer-events: none; z-index: 0;
    animation: fadeIn 1.2s 0.4s ease both;
  }
  #app.dark .splash-worldmap {
    background-image: radial-gradient(circle, rgba(37,99,235,0.4) 1px, transparent 1px);
    opacity: 0.55;
  }

  .splash-circuit-tr {
    position: absolute; top: 0; right: 0; width: 180px; height: 180px;
    opacity: 0.55; pointer-events: none; z-index: 0;
  }
  .splash-circuit-bl {
    position: absolute; bottom: 0; left: 0; width: 180px; height: 180px;
    opacity: 0.55; pointer-events: none; z-index: 0;
  }
  .splash-circuit-tl {
    position: absolute; top: 0; left: 0; width: 140px; height: 140px;
    opacity: 0.4; pointer-events: none; z-index: 0;
  }
  .splash-circuit-br {
    position: absolute; bottom: 0; right: 0; width: 140px; height: 140px;
    opacity: 0.4; pointer-events: none; z-index: 0;
  }
  #app.dark .splash-circuit-tr,
  #app.dark .splash-circuit-bl,
  #app.dark .splash-circuit-tl,
  #app.dark .splash-circuit-br { opacity: 0.75; }

  .splash-hex {
    position: absolute; pointer-events: none; z-index: 0;
    opacity: 0;
    animation: hexFade 1.5s ease forwards;
  }
  .splash-hex:nth-child(1)  { top: 4%;  left: 3%;  animation-delay: 0.3s; }
  .splash-hex:nth-child(2)  { top: 6%;  left: 16%; animation-delay: 0.5s; }
  .splash-hex:nth-child(3)  { top: 15%; left: 1%;  animation-delay: 0.7s; }
  .splash-hex:nth-child(4)  { top: 3%;  right: 6%; animation-delay: 0.4s; }
  .splash-hex:nth-child(5)  { top: 14%; right: 2%; animation-delay: 0.6s; }
  .splash-hex:nth-child(6)  { bottom: 6%;  left: 3%;  animation-delay: 0.5s; }
  .splash-hex:nth-child(7)  { bottom: 14%; left: 12%; animation-delay: 0.8s; }
  .splash-hex:nth-child(8)  { bottom: 4%;  right: 4%; animation-delay: 0.6s; }
  .splash-hex:nth-child(9)  { bottom: 14%; right: 2%; animation-delay: 0.9s; }
  .splash-hex:nth-child(10) { top: 50%; left: 2%;  animation-delay: 1.0s; }
  @keyframes hexFade { to { opacity: 1; } }

  .splash-logo {
    width: 132px; height: 132px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: splashBounce 0.9s 0.3s cubic-bezier(.36,.07,.19,.97) both;
    box-shadow: 0 20px 60px rgba(30,58,95,0.18), 0 4px 16px rgba(37,99,235,0.14), 0 0 0 1px rgba(200,220,255,0.6);
    position: relative; z-index: 2;
    margin-bottom: 22px;
    overflow: hidden;
  }
  #app.dark .splash-logo {
    background: #0F1E38;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 16px rgba(37,99,235,0.22), 0 0 0 1px rgba(37,99,235,0.15);
  }
  .splash-logo svg { width: 58px; height: 58px; }

  .splash-title {
    font-size: 40px; font-weight: 900; letter-spacing: -1.5px;
    animation: fadeUp 0.6s 0.7s ease both;
    position: relative; z-index: 1;
    line-height: 1;
    margin-bottom: 12px;
  }
  .splash-omni { color: #1E3A5F; }
  .splash-pay  { color: #2563EB; }
  #app.dark .splash-omni { color: #E2EEFF; }
  #app.dark .splash-pay  { color: #60A5FA; }

  .splash-tagline {
    font-size: 14px; color: #5E7A99;
    text-align: center; max-width: 220px; line-height: 1.8;
    animation: fadeUp 0.6s 0.9s ease both;
    font-weight: 500;
    position: relative; z-index: 1;
    margin-bottom: 0;
  }
  .splash-tagline .tagline-accent { color: #2563EB; font-weight: 700; }
  #app.dark .splash-tagline { color: #7A90B0; }
  #app.dark .splash-tagline .tagline-accent { color: #60A5FA; }

  .splash-loader {
    width: 200px; height: 4px;
    background: rgba(37,99,235,0.12);
    border-radius: 99px; overflow: hidden;
    margin-top: 48px;
    animation: fadeUp 0.5s 1.1s ease both;
    position: relative; z-index: 1;
  }
  .splash-loader-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #2563EB, #0EA5E9, #7DD3FC);
    border-radius: 99px;
    animation: loadBar 2.4s 1.2s ease forwards;
    box-shadow: 0 0 8px rgba(37,99,235,0.5);
  }
  @keyframes splashBounce {
    0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
    60%  { transform: scale(1.08) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes loadBar { to { width: 100%; } }

  #wallet-setup {
    background: linear-gradient(160deg, #0B1628 0%, #111E3A 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0;
    z-index: 90;
    padding: 40px 32px !important;
    padding-bottom: 0 !important;
  }
  .ws-icon {
    width: 84px; height: 84px; border-radius: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; margin-bottom: 24px;
    box-shadow: 0 12px 40px rgba(47,111,237,0.45);
    animation: pulseScale 2s ease-in-out infinite;
  }
  @keyframes pulseScale {
    0%,100% { transform: scale(1); box-shadow: 0 12px 40px rgba(47,111,237,0.45); }
    50%      { transform: scale(1.05); box-shadow: 0 16px 50px rgba(47,111,237,0.6); }
  }
  .ws-title {
    font-size: 23px; font-weight: 800; color: #fff; text-align: center; letter-spacing: -0.5px;
    margin-bottom: 8px;
  }
  .ws-sub {
    font-size: 13px; color: rgba(255,255,255,0.5); text-align: center; line-height: 1.6;
    margin-bottom: 36px;
  }
  .ws-steps { width: 100%; display: flex; flex-direction: column; gap: 12px; }
  .ws-step {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.05); border-radius: 16px;
    padding: 14px 16px; border: 1px solid rgba(255,255,255,0.07);
    transition: all 0.4s ease;
  }
  .ws-step.done   { background: rgba(6,182,212,0.1); border-color: rgba(6,182,212,0.22); }
  .ws-step.active { background: rgba(47,111,237,0.16); border-color: rgba(47,111,237,0.32); }
  .ws-step-icon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    background: rgba(255,255,255,0.07);
  }
  .ws-step.done   .ws-step-icon { background: rgba(6,182,212,0.18); }
  .ws-step.active .ws-step-icon { background: rgba(47,111,237,0.22); }
  .ws-step-info { flex: 1; }
  .ws-step-name { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.9); }
  .ws-step-desc { font-size: 11px; color: rgba(255,255,255,0.42); margin-top: 2px; }
  .ws-step-status { font-size: 18px; }
  .ws-spinner {
    width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.18);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  .ws-wallet-card {
    width: 100%; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px; padding: 18px;
    margin-top: 28px; display: none;
  }
  .ws-wallet-card.show { display: block; animation: fadeUp 0.5s ease both; }
  .ws-wallet-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.42); text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 6px; }
  .ws-wallet-key { font-family: 'Courier New', monospace; font-size: 10px; color: var(--accent); word-break: break-all; line-height: 1.7; }
  .ws-balance-row { display: flex; gap: 10px; margin-top: 14px; }
  .ws-bal {
    flex: 1; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 11px 13px;
    border: 1px solid rgba(255,255,255,0.07);
  }
  .ws-bal-amt { font-size: 16px; font-weight: 800; color: #fff; }
  .ws-bal-lbl { font-size: 10px; color: rgba(255,255,255,0.42); margin-top: 2px; }
  .ws-continue-btn {
    width: 100%; margin-top: 24px; padding: 17px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none; border-radius: 16px;
    font-size: 15px; font-weight: 700; color: #fff;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 8px 28px rgba(47,111,237,0.45);
    display: none; font-family: inherit;
  }
  .ws-continue-btn.show { display: block; animation: fadeUp 0.4s ease both; }
  .ws-continue-btn:active { transform: scale(0.97); }

  .auth-screen {
    background: var(--bg);
    display: flex; flex-direction: column; padding: 0;
  }
  .auth-header {
    background: linear-gradient(150deg, #5B8FFF 0%, #2563EB 50%, #1D4ED8 100%);
    padding: 60px 28px 48px;
    border-radius: 0 0 44px 44px;
    position: relative; overflow: hidden;
    box-shadow: 0 16px 48px rgba(47,111,237,0.3);
  }
  .auth-header::before {
    content: ''; position: absolute;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -70px; right: -50px;
  }
  .auth-header::after {
    content: ''; position: absolute;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(6,182,212,0.14);
    bottom: -24px; left: 24px;
  }
  .auth-header-blob3 {
    position: absolute;
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    top: 30px; left: 50%;
    pointer-events: none;
  }
  .auth-header h1 { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -0.8px; position: relative; z-index: 1; }
  .auth-header p { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 7px; position: relative; z-index: 1; font-weight: 500; }
  .auth-header .auth-icon { font-size: 34px; margin-bottom: 16px; position: relative; z-index: 1; display: block; }
  .auth-body { padding: 32px 24px 28px; display: flex; flex-direction: column; gap: 16px; flex: 1; justify-content: center; }

  .input-group { display: flex; flex-direction: column; gap: 7px; }
  .input-group label {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.7px;
  }
  .input-group input,
  .input-group select {
    padding: 14px 17px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px; color: var(--text);
    background: var(--card);
    outline: none;
    transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
    width: 100%;
    font-family: inherit;
    font-weight: 500;
  }
  .input-group input:hover:not(:focus):not(.error),
  .input-group select:hover:not(:focus) {
    border-color: rgba(37,99,235,0.4);
  }
  .input-group input:focus,
  .input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    background: var(--card);
  }
  #app.dark .input-group input,
  #app.dark .input-group select {
    background: var(--card);
    color: var(--text);
    border-color: var(--border);
  }
  #app.dark .input-group input:focus,
  #app.dark .input-group select:focus {
    background: #0D1A2E;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
  }
  .input-group input.error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,71,87,0.1); }
  .input-wrapper { position: relative; }
  .input-wrapper input { padding-right: 52px; }
  .input-toggle {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: var(--text-muted); font-size: 18px;
    background: none; border: none; padding: 4px;
    transition: color 0.2s;
  }
  .input-toggle:hover { color: var(--primary); }
  #regPin {
    letter-spacing: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
  }
  #regPin::placeholder { letter-spacing: normal; font-family: inherit; font-weight: 400; }

  .btn {
    padding: 15px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700;
    border: none; cursor: pointer;
    transition: box-shadow 0.28s var(--ease), transform 0.28s var(--ease), opacity 0.2s;
    letter-spacing: 0.2px;
    font-family: inherit;
  }
  .btn:active { transform: scale(0.96) !important; }
  .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
  .btn-primary {
    background: linear-gradient(135deg, #4C8DFF 0%, #2F6FED 50%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(47,111,237,0.38), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .btn-primary:hover:not(:disabled) { box-shadow: 0 10px 32px rgba(47,111,237,0.52), inset 0 1px 0 rgba(255,255,255,0.25); transform: translateY(-2px); }
  .btn-outline {
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
  }
  .btn-outline:hover { background: var(--primary-light); }
  .btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(6,182,212,0.34), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .btn-accent:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(6,182,212,0.48); transform: translateY(-2px); }
  .btn-danger { background: var(--danger); color: #fff; box-shadow: 0 5px 16px rgba(255,71,87,0.32); }
  .btn-ghost { background: var(--primary-light); color: var(--primary); }
  .btn-ghost:hover { background: #DCEAFF; }
  .btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 10px; }
  .btn-block { width: 100%; }

  .divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }
  .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

  #scanVideoWrap video { width: 100%; display: block; border-radius: 20px; }
  .auth-header .auth-logo-img { display: block; margin: 0 auto 4px; border-radius: 50%; object-fit: cover; }
  #regStep1, #regStep2 { display: flex; flex-direction: column; gap: 16px; }
  .auth-switch { text-align: center; font-size: 14px; color: var(--text-muted); font-weight: 500; }
  .auth-switch a { color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: none; }
  .auth-switch a:hover { text-decoration: underline; }

  .terms-row {
    display: flex; align-items: flex-start; gap: 11px;
    margin-top: 12px; padding: 12px 14px;
    background: var(--primary-light); border: 1.5px solid var(--border);
    border-radius: 14px; transition: border-color 0.2s;
  }
  .terms-row:has(.terms-checkbox:checked) { border-color: var(--primary); }
  .terms-checkbox {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 20px; height: 20px; min-width: 20px; margin-top: 1px;
    border: 1.75px solid var(--border); border-radius: 6px;
    background: var(--card); cursor: pointer; flex-shrink: 0;
    position: relative; transition: background 0.18s, border-color 0.18s;
  }
  .terms-checkbox:hover { border-color: var(--primary); }
  .terms-checkbox:checked {
    background: var(--primary); border-color: var(--primary);
  }
  .terms-checkbox:checked::after {
    content: ''; position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .terms-checkbox:focus-visible { outline: 3px solid rgba(37,99,235,0.3); outline-offset: 2px; }
  .terms-label {
    font-size: 13px; color: var(--text-muted); line-height: 1.5;
    font-weight: 500; cursor: pointer; padding-top: 1px;
  }
  .terms-label a { color: var(--primary); font-weight: 700; }
  .terms-label a:hover { text-decoration: underline; }

  .bottom-nav {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(24px);
    border-top: 1px solid rgba(200,218,245,0.7);
    display: flex; align-items: center;
    z-index: 50;
    box-shadow: 0 -8px 28px rgba(30,58,95,0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: background 0.3s ease, border-color 0.3s ease;
  }
  #app.dark .bottom-nav {
    background: rgba(8,15,32,0.95);
    border-top: 1px solid rgba(28,47,82,0.8);
    box-shadow: 0 -8px 28px rgba(0,0,0,0.25);
  }
  .nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; padding: 8px 4px;
    transition: all 0.22s;
    position: relative;
  }
  .nav-icon {
    width: 44px; height: 44px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.28s cubic-bezier(.34,1.56,.64,1);
    font-size: 20px;
  }
  .nav-label { font-size: 10px; font-weight: 600; color: var(--text-muted); transition: color 0.2s; }
  .nav-item.active .nav-icon {
    background: linear-gradient(135deg, var(--primary-light), rgba(37,99,235,0.2));
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.2);
  }
  .nav-item.active .nav-label { color: var(--primary); font-weight: 700; }
  .nav-item.active .nav-icon svg { color: var(--primary) !important; }
  .nav-pay-btn {
    width: 56px; height: 56px; border-radius: 18px;
    background: linear-gradient(135deg, #5B8FFF, #1D4ED8);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(37,99,235,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-10px);
    transition: all 0.22s;
  }
  .nav-pay-btn:active { transform: translateY(-7px) scale(0.95); }

  .theme-toggle-btn {
    position: absolute; top: 54px; right: 20px;
    width: 36px; height: 36px; border-radius: 12px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; z-index: 10;
    backdrop-filter: blur(12px);
    transition: all 0.22s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  .theme-toggle-btn:active { transform: scale(0.9); }
  #app.dark .theme-toggle-btn {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
  }

  .page-header {
    padding: 56px 24px 22px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    transition: background 0.3s ease;
  }
  .page-header h2 { font-size: 23px; font-weight: 800; color: var(--text); }
  .page-header-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

  .home-hero {
    background: linear-gradient(150deg, #5B8FFF 0%, #2563EB 50%, #1D4ED8 100%);
    padding: 56px 24px 30px;
    position: relative; overflow: hidden;
  }
  #app.dark .home-hero {
    background: linear-gradient(150deg, #0C1A38 0%, #0F2045 50%, #0A1628 100%);
  }
  .home-hero::before {
    content: ''; position: absolute;
    width: 280px; height: 280px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    top: -100px; right: -70px;
  }
  .home-hero::after {
    content: ''; position: absolute;
    width: 150px; height: 150px; border-radius: 50%;
    background: rgba(6,182,212,0.1);
    bottom: -40px; left: 12px;
  }
  .home-hero-glow {
    position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: 10px; right: 20px; pointer-events: none;
  }
  .hero-greeting { font-size: 14px; color: rgba(255,255,255,0.65); font-weight: 500; position: relative; z-index: 1; }
  .hero-name { font-size: 24px; font-weight: 800; color: #fff; margin-top: 2px; position: relative; z-index: 1; }
  .hero-balance-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 22px; position: relative; z-index: 1; font-weight: 500; letter-spacing: 0.3px; }
  .hero-balance { font-size: 44px; font-weight: 900; color: #fff; letter-spacing: -2px; margin-top: 4px; position: relative; z-index: 1; }
  .hero-balance span { font-size: 24px; font-weight: 600; opacity: 0.75; }
  .hero-conv-row { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 6px; font-weight: 500; letter-spacing: 0.2px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
  .hero-demo-badge { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin-top: 10px; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22); color: rgba(255,255,255,0.88); font-size: 11px; font-weight: 600; line-height: 1.35; letter-spacing: 0.2px; position: relative; z-index: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .hero-demo-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #FFC24D; box-shadow: 0 0 0 3px rgba(255,194,77,0.25); }
  .hero-row { display: flex; gap: 10px; margin-top: 22px; position: relative; z-index: 1; }
  .hero-stat {
    flex: 1; background: rgba(255,255,255,0.12); backdrop-filter: blur(14px);
    border-radius: 16px; padding: 13px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
  .hero-stat-label { font-size: 10px; color: rgba(255,255,255,0.6); font-weight: 600; letter-spacing: 0.3px; }
  .hero-stat-val { font-size: 15px; font-weight: 700; color: #fff; margin-top: 4px; }

  .status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 13px; border-radius: 99px;
    font-size: 12px; font-weight: 600;
    margin-top: 9px; position: relative; z-index: 1;
  }
  .status-badge.online  { background: rgba(46,213,115,0.2); color: #2ED573; }
  .status-badge.offline { background: rgba(255,165,2,0.2);  color: #FFA502; }
  .status-dot { width: 7px; height: 7px; border-radius: 50%; }
  .status-dot.online  { background: #2ED573; animation: pulse 2s infinite; }
  .status-dot.offline { background: #FFA502; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

  .section { padding: 20px 24px; }
  .section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; }

  .quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
  .quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; transition: transform 0.2s;
  }
  .quick-action:active { transform: scale(0.9); }
  .qa-icon {
    width: 56px; height: 56px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.09);
    transition: box-shadow 0.22s, transform 0.22s;
  }
  .qa-icon svg { width: 24px; height: 24px; flex-shrink: 0; }
  #app.dark .qa-icon {
    color: #8DB8FF;
    background: linear-gradient(145deg, rgba(37,99,235,0.32), rgba(37,99,235,0.14));
    border-color: rgba(141,184,255,0.34);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  }
  #app.dark .quick-action:hover .qa-icon { border-color: rgba(141,184,255,0.55); box-shadow: 0 8px 20px rgba(37,99,235,0.28), inset 0 1px 0 rgba(255,255,255,0.1); }
  .quick-action:hover .qa-icon { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.14); }
  .qa-label { font-size: 11px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.3; }

  .card {
    background: var(--card); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  }
  .card + .card { margin-top: 12px; }

  .trust-card {
    background: linear-gradient(135deg, #0F1E38 0%, #16233E 100%);
    color: #fff;
    border: none;
    box-shadow: 0 10px 36px rgba(11,18,32,0.28);
  }
  .trust-card::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }
  .trust-header { display: flex; justify-content: space-between; align-items: flex-start; }
  .trust-label { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
  .trust-score { font-size: 44px; font-weight: 900; margin-top: 4px; letter-spacing: -2px; }
  .trust-tier { padding: 5px 14px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
  .trust-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 99px; margin-top: 16px; overflow: hidden; }
  .trust-fill { height: 100%; border-radius: 99px; transition: width 0.9s cubic-bezier(.34,1.56,.64,1); }
  .trust-stats { display: flex; justify-content: space-between; margin-top: 14px; }
  .trust-stat-item { text-align: center; }
  .trust-stat-item .val { font-size: 15px; font-weight: 700; }
  .trust-stat-item .lbl { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 2px; font-weight: 500; }

  .vault-card { background: linear-gradient(135deg, #06B6D4 0%, #0E7490 100%); color: #fff; border: none; box-shadow: 0 10px 36px rgba(6,182,212,0.3); }
  .vault-card::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); }
  .vault-card .vault-top { display: flex; justify-content: space-between; align-items: center; }
  .vault-card .vault-lbl { font-size: 11px; color: rgba(255,255,255,0.75); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
  .vault-amount { font-size: 30px; font-weight: 900; margin-top: 6px; letter-spacing: -1px; }
  .vault-bar { height: 5px; background: rgba(255,255,255,0.2); border-radius: 99px; margin-top: 14px; overflow: hidden; }
  .vault-fill { height: 100%; background: rgba(255,255,255,0.88); border-radius: 99px; transition: width 0.7s ease; }
  .vault-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: rgba(255,255,255,0.7); font-weight: 500; }

  .tx-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.15s;
  }
  .tx-item:last-child { border-bottom: none; }
  .tx-icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
  }
  .tx-info { flex: 1; min-width: 0; }
  .tx-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tx-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
  .tx-amount { font-size: 15px; font-weight: 700; }
  .tx-amount.credit { color: var(--success); }
  .tx-amount.debit  { color: var(--danger); }
  .tx-status { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin-top: 4px; display: inline-block; }
  .tx-status.pending { background: rgba(255,165,2,0.14);  color: var(--warning); }
  .tx-status.synced  { background: rgba(46,213,115,0.14); color: var(--success); }
  .tx-status.failed  { background: rgba(255,71,87,0.14);  color: var(--danger); }
  .tx-status.offline { background: rgba(47,111,237,0.1);  color: var(--primary); }

  .pay-tabs { display: flex; gap: 8px; padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border); }
  .pay-tab {
    flex: 1; padding: 11px 8px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 700; text-align: center;
    cursor: pointer; transition: all 0.22s;
    background: var(--bg); color: var(--text-muted); border: none;
    font-family: inherit;
  }
  .pay-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 4px 14px rgba(47,111,237,0.38);
    transform: translateY(-1px);
  }

  .pay-panel { display: none; padding: 24px; }
  .pay-panel.active { display: block; }

  .qr-frame {
    width: 200px; height: 200px; margin: 0 auto 24px;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    border: 2px solid var(--border);
  }
  .qr-corners::before, .qr-corners::after {
    content: ''; position: absolute;
    width: 28px; height: 28px;
    border-color: var(--primary);
    border-style: solid;
  }
  .qr-corners::before { top: 10px; left: 10px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
  .qr-corners::after  { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
  .scan-line {
    position: absolute; left: 10px; right: 10px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanMove 2s linear infinite;
    top: 0;
    box-shadow: 0 0 8px var(--primary);
  }
  @keyframes scanMove { 0% { top: 10px; } 100% { top: calc(100% - 10px); } }

  .amount-input-big {
    font-size: 44px; font-weight: 800; color: var(--text);
    border: none; background: none; outline: none;
    text-align: center; width: 100%; letter-spacing: -2px;
    padding: 10px 0; font-family: inherit;
  }
  .amount-currency { text-align: center; font-size: 17px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }

  .vault-hero {
    background: linear-gradient(150deg, #22D3EE 0%, #06B6D4 40%, #0E7490 100%);
    padding: 56px 24px 30px;
    position: relative; overflow: hidden;
  }
  .vault-hero::before {
    content: ''; position: absolute;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -60px; right: -40px;
  }
  .vault-hero h2 { font-size: 23px; font-weight: 800; color: #fff; position: relative; z-index: 1; }
  .vault-hero p { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 5px; position: relative; z-index: 1; font-weight: 500; }
  .vault-balance-big { font-size: 48px; font-weight: 900; color: #fff; margin-top: 18px; letter-spacing: -2px; position: relative; z-index: 1; }
  .vault-uses-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
  .vault-use-chip {
    padding: 6px 14px; border-radius: 99px;
    font-size: 12px; font-weight: 700;
    background: rgba(255,255,255,0.2); color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
  }
  .vault-use-chip.used { background: rgba(255,71,87,0.3); border-color: rgba(255,71,87,0.4); }

  .offline-session {
    background: linear-gradient(135deg, #FFF8ED, #FFEFD4);
    border: 1.5px solid #F5A623;
    border-radius: var(--radius);
    padding: 16px;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 4px;
  }
  .offline-icon { font-size: 32px; }
  .offline-info h4 { font-size: 14px; font-weight: 700; color: var(--text); }
  .offline-info p  { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

  .profile-hero {
    background: linear-gradient(150deg, #5B8FFF 0%, #2563EB 50%, #1D4ED8 100%);
    padding: 56px 24px 32px;
    text-align: center; position: relative; overflow: hidden;
  }
  .profile-hero::before {
    content: ''; position: absolute;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -60px; right: -50px;
  }
  .profile-hero::after {
    content: ''; position: absolute;
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(6,182,212,0.1);
    bottom: -20px; left: 20px;
  }
  .avatar {
    width: 88px; height: 88px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; margin: 0 auto 16px;
    border: 3px solid rgba(255,255,255,0.45);
    position: relative; z-index: 1;
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  }
  .profile-name  { font-size: 23px; font-weight: 800; color: #fff; position: relative; z-index: 1; }
  .profile-phone { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 5px; position: relative; z-index: 1; font-weight: 500; }
  .profile-verified { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: rgba(255,255,255,0.82); position: relative; z-index: 1; font-weight: 600; }

  .settings-tabs {
    display: flex; gap: 6px; padding: 16px 24px 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .settings-tabs::-webkit-scrollbar { height: 0; }
  .settings-tab-btn {
    padding: 10px 14px; border-radius: 12px 12px 0 0;
    font-size: 12px; font-weight: 700; text-align: center;
    cursor: pointer; transition: all 0.22s;
    background: var(--bg); color: var(--text-muted); border: none;
    font-family: inherit; white-space: nowrap;
    border-bottom: 3px solid transparent;
  }
  .settings-tab-btn.active {
    background: var(--card);
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
  }
  .settings-panel { display: none; }
  .settings-panel.active { display: block; }

  .settings-list { padding: 0 24px 24px; }
  .settings-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .settings-item:active { opacity: 0.65; }
  .settings-item:last-child { border-bottom: none; }
  .settings-icon {
    width: 42px; height: 42px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .settings-info { flex: 1; }
  .settings-info h4 { font-size: 14px; font-weight: 600; color: var(--text); }
  .settings-info p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
  .settings-arrow { color: var(--text-muted); font-size: 18px; }

  .toggle-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .toggle {
    width: 50px; height: 28px; border-radius: 99px;
    background: var(--border); position: relative;
    cursor: pointer; transition: background 0.3s; flex-shrink: 0;
  }
  .toggle.on { background: var(--primary); }
  .toggle::after {
    content: ''; position: absolute;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; top: 3px; left: 3px;
    transition: left 0.3s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .toggle.on::after { left: 25px; }

  .modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
    z-index: 200; display: none; align-items: flex-end;
  }
  .modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
  .modal {
    width: 100%; background: var(--card);
    border-radius: 30px 30px 0 0;
    padding: 12px 24px 48px;
    animation: slideUp 0.32s cubic-bezier(.34,1.56,.64,1);
    max-height: 90%;
    overflow-y: auto;
    transition: background 0.3s ease;
    box-shadow: 0 -12px 40px rgba(30,58,95,0.14);
  }
  .modal-card {
    width: 100%; background: var(--card);
    border-radius: 30px 30px 0 0;
    padding: 12px 24px 40px;
    animation: slideUp 0.32s cubic-bezier(.34,1.56,.64,1);
    max-height: 90%;
    overflow-y: auto;
    transition: background 0.3s ease;
  }
  .modal-handle { width: 42px; height: 5px; background: var(--border); border-radius: 99px; margin: 0 auto 22px; }
  .modal h3 { font-size: 21px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
  .modal p.sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; font-weight: 500; }
  @keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .wallet-item {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 15px 16px;
    margin-bottom: 12px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease, background 0.22s ease;
  }
  .wallet-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .wallet-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 18px rgba(37,99,235,0.16);
  }
  .wallet-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .wallet-item-label {
    font-size: 13px; font-weight: 800; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  }
  .wallet-item-badge {
    flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary);
    padding: 4px 12px; border-radius: 20px; white-space: nowrap;
  }
  .wallet-setactive-btn {
    flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--card);
    border: 1.5px solid var(--primary); padding: 5px 12px; border-radius: 20px; cursor: pointer;
    white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  }
  .wallet-setactive-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
  .wallet-item-key {
    font-family: 'Courier New', monospace; font-size: 11px; color: var(--text-muted);
    word-break: break-all; line-height: 1.5; margin-bottom: 12px;
  }
  .wallet-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .wallet-item-balance { font-size: 15px; font-weight: 800; color: var(--text); }
  .wallet-item.active .wallet-item-balance { color: var(--primary); }
  .wallet-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .wallet-action-btn {
    font-size: 11px; font-weight: 600; background: var(--card); border: 1.5px solid var(--border);
    padding: 5px 10px; border-radius: 10px; cursor: pointer; color: var(--text-muted);
    white-space: nowrap; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .wallet-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .wallet-action-btn.danger { border-color: rgba(239,68,68,0.4); color: var(--danger); }
  .wallet-action-btn.danger:hover { background: rgba(239,68,68,0.12); border-color: var(--danger); }
  .wallet-item-explorer {
    display: inline-block; margin-top: 10px; font-size: 11px; color: var(--primary);
    text-decoration: none; font-weight: 700; transition: opacity 0.2s ease;
  }
  .wallet-item-explorer:hover { text-decoration: underline; opacity: 0.85; }

  .alert-banner {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 15px 20px;
    display: flex; align-items: center; gap: 10px;
    z-index: 300; font-size: 13px; font-weight: 600;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  .alert-banner.show { transform: translateY(0); }
  .alert-banner.yellow { background: #FFFCE6; color: #92700A; border-bottom: 1px solid #FFE680; }
  .alert-banner.orange { background: #FFF0E0; color: #8A4200; border-bottom: 1px solid #FFD0A0; }
  .alert-banner.red    { background: #FFF0F0; color: #8B0000; border-bottom: 1px solid #FFBBBB; }
  .alert-banner.success{ background: #E8FDED; color: #0B6636; border-bottom: 1px solid #A0EEC4; }
  #app.dark .alert-banner.yellow { background: #1A1500; color: #FFD04D; border-bottom-color: #3A3000; }
  #app.dark .alert-banner.orange { background: #1A0E00; color: #FFB070; border-bottom-color: #3A2000; }
  #app.dark .alert-banner.red    { background: #1A0000; color: #FF8080; border-bottom-color: #3A0000; }
  #app.dark .alert-banner.success{ background: #001A0E; color: #4ADEA8; border-bottom-color: #003A1E; }

  .badge {
    display: inline-block; padding: 3px 11px;
    border-radius: 99px; font-size: 11px; font-weight: 700;
  }
  .badge-green  { background: rgba(46,213,115,0.15);  color: var(--success); }
  .badge-yellow { background: rgba(255,165,2,0.15);   color: var(--warning); }
  .badge-red    { background: rgba(255,71,87,0.15);   color: var(--danger); }
  .badge-purple { background: var(--primary-light);   color: var(--primary); }
  .badge-blue   { background: rgba(6,182,212,0.12);   color: var(--accent-dark); }

  .row { display: flex; align-items: center; justify-content: space-between; }
  .mt-8  { margin-top: 8px; }
  .mt-12 { margin-top: 12px; }
  .mt-16 { margin-top: 16px; }
  .mt-20 { margin-top: 20px; }
  .gap-12 { gap: 12px; }
  .flex { display: flex; align-items: center; }
  .text-muted { color: var(--text-muted); font-size: 13px; }
  .text-sm { font-size: 12px; }
  .font-bold { font-weight: 700; }

  .sync-btn {
    background: linear-gradient(135deg, #2ED573, #10B981);
    color: #fff; font-weight: 700; font-size: 13px;
    border: none; border-radius: 99px;
    padding: 8px 18px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all 0.2s; box-shadow: 0 6px 18px rgba(46,213,115,0.38);
    font-family: inherit;
  }
  .sync-btn:active { transform: scale(0.96); }
  .sync-icon { animation: spin 1.5s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .empty-state {
    text-align: center; padding: 48px 24px;
    color: var(--text-muted);
  }
  .empty-icon { font-size: 50px; margin-bottom: 12px; }
  .empty-state h4 { font-size: 16px; font-weight: 700; color: var(--text); }
  .empty-state p  { font-size: 13px; margin-top: 6px; font-weight: 500; }

  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  .info-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .info-row:last-child { border-bottom: none; }
  .info-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
  .info-val   { font-size: 13px; font-weight: 600; color: var(--text); }

  .progress-steps { display: flex; align-items: center; gap: 4px; margin: 16px 0; }
  .step { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
  .step.done   { background: var(--primary); }
  .step.active { background: linear-gradient(90deg, var(--primary), #A09AFF); }

  .nonce-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .nonce-chip {
    padding: 6px 12px; border-radius: 9px;
    font-size: 11px; font-weight: 700; font-family: 'Courier New', monospace;
    background: var(--primary-light); color: var(--primary);
    border: 1px solid rgba(37,99,235,0.18);
  }
  .nonce-chip.used { background: rgba(255,71,87,0.1); color: var(--danger); border-color: rgba(255,71,87,0.2); text-decoration: line-through; }

  .pay-success { text-align: center; padding: 28px 24px; }
  .success-icon {
    width: 88px; height: 88px; border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #10B981);
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; margin: 0 auto 22px;
    animation: bounceIn 0.5s cubic-bezier(.36,.07,.19,.97);
    box-shadow: 0 12px 36px rgba(46,213,115,0.45);
    color: white;
  }
  @keyframes bounceIn {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
  }
  .success-amount   { font-size: 40px; font-weight: 900; color: var(--text); letter-spacing: -2px; }
  .success-merchant { font-size: 15px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
  .success-proof {
    background: var(--bg); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-top: 20px; text-align: left;
    border: 1px solid var(--border);
  }
  .proof-label { font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
  .proof-code  { font-family: 'Courier New', monospace; font-size: 10px; color: var(--primary); word-break: break-all; line-height: 1.7; }

  .merchant-trust {
    background: var(--bg); border-radius: var(--radius-sm);
    padding: 14px; display: flex; align-items: center; gap: 12px; margin-top: 12px;
    border: 1px solid var(--border);
  }
  .mt-score {
    width: 46px; height: 46px; border-radius: 13px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }

  .freighter-card {
    background: linear-gradient(135deg, #0B1220 0%, #16233E 100%);
    border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
    border: none; color: #fff;
    box-shadow: 0 10px 32px rgba(11,18,32,0.25);
  }
  .freighter-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .freighter-logo { display: flex; align-items: center; gap: 8px; }
  .freighter-logo span { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.7px; }
  .freighter-badge { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: rgba(6,182,212,0.2); color: var(--accent); border: 1px solid rgba(6,182,212,0.3); }
  .freighter-xlm { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
  .freighter-xlm-lbl { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; font-weight: 500; }
  .freighter-key { font-family: 'Courier New', monospace; font-size: 10px; color: rgba(255,255,255,0.42); margin-top: 10px; background: rgba(255,255,255,0.04); padding: 9px 11px; border-radius: 9px; word-break: break-all; line-height: 1.6; }

  .filter-row { display: flex; gap: 8px; padding: 12px 24px; overflow-x: auto; background: var(--card); }
  .filter-row::-webkit-scrollbar { height: 0; }
  .filter-chip { padding: 7px 14px; border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); transition: all 0.2s; }
  .filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 3px 10px rgba(37,99,235,0.32); }

  .screen::-webkit-scrollbar { width: 0; }

  .map-visual {
    position: relative; width: 100%; height: 210px;
    border-radius: var(--radius); overflow: hidden;
    background-color: #EAF0FF;
    background-image:
      repeating-linear-gradient(0deg, rgba(47,111,237,0.12) 0 1px, transparent 1px 42px),
      repeating-linear-gradient(90deg, rgba(47,111,237,0.12) 0 1px, transparent 1px 42px);
    border: 1.5px solid var(--border);
    margin-bottom: 16px;
  }
  .map-visual::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(6,182,212,0.10), transparent 55%),
                radial-gradient(circle at 75% 70%, rgba(47,111,237,0.10), transparent 55%);
  }
  .map-pin {
    position: absolute; transform: translate(-50%,-100%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 2;
  }
  .map-pin-dot {
    width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    transform: rotate(45deg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(47,111,237,0.5);
    border: 2px solid #fff;
  }
  .map-pin-dot span { transform: rotate(-45deg); font-size: 13px; }
  .map-pin-label {
    margin-top: 4px; font-size: 9px; font-weight: 700; color: var(--text);
    background: rgba(255,255,255,0.92); padding: 2px 7px; border-radius: 99px;
    white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  }
  .omnicore-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
  }
  .omnicore-item:last-child { border-bottom: none; }
  .omnicore-icon {
    width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 19px;
    background: var(--primary-light);
  }
  .omnicore-info { flex: 1; min-width: 0; }
  .omnicore-info h4 { font-size: 13px; font-weight: 700; color: var(--text); }
  .omnicore-info p  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
  .omnicore-dist { font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap; text-align: right; }

  .fb-status {
    font-size: 10px; text-align: center; color: var(--text-muted);
    padding: 4px 0 0; font-weight: 500; letter-spacing: 0.2px;
  }
  .fb-status.connected { color: var(--success); }
  .fb-status.error     { color: var(--danger); }

  .profile-edit-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
  .profile-edit-form .input-group input { padding: 12px 15px; font-size: 14px; }

  .freighter-live-xlm { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; }
  .freighter-live-xlm.live { color: var(--accent); }
  .freighter-live-xlm.idle { color: rgba(255,255,255,0.38); font-style: italic; }
  .freighter-connect-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
  .fq-btn { padding: 9px 16px; border-radius: 11px; font-size: 12px; font-weight: 700; border: none; cursor: pointer; font-family: inherit; transition: all 0.22s; white-space: nowrap; }
  .fq-btn:active { transform: scale(0.96); }
  .fq-btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .fq-btn-connect    { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 4px 14px rgba(47,111,237,0.38); }
  .fq-btn-disconnect { background: rgba(255,71,87,0.18); color: #FF8080; border: 1px solid rgba(255,71,87,0.28); }
  .fq-btn-refresh    { background: rgba(6,182,212,0.18); color: var(--accent); border: 1px solid rgba(6,182,212,0.28); }
  .freighter-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 14px 0; }
  .freighter-fallback-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
  .xlm-tx-result { display: none; border-radius: var(--radius-sm); padding: 16px; border: 1.5px solid transparent; margin-top: 16px; }
  .xlm-result-icon  { font-size: 36px; text-align: center; margin-bottom: 8px; }
  .xlm-result-title { font-size: 15px; font-weight: 800; text-align: center; margin-bottom: 12px; }
  .xlm-hash-box { background: rgba(0,0,0,0.06); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
  .xlm-error-msg  { font-size: 12px; font-weight: 500; color: var(--danger); font-family: 'Courier New', monospace; word-break: break-all; line-height: 1.6; margin-top: 6px; }
  .xlm-explorer-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--primary); font-weight: 600; text-decoration: none; }
  .hero-xlm-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(6,182,212,0.18); border: 1px solid rgba(6,182,212,0.32); border-radius: 99px; padding: 5px 14px; font-size: 12px; font-weight: 700; color: #fff; margin-top: 10px; position: relative; z-index: 1; }

  input:not([type="checkbox"]):not([type="radio"]), select, button, textarea { -webkit-appearance: none; }
  button, input, select, textarea { touch-action: manipulation; }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(14,165,233,0.35);
    outline-offset: 2px;
  }
  .input-group input::placeholder { color: var(--text-muted); opacity: 0.72; }
  .amount-input-big::placeholder { color: var(--text-muted); opacity: 0.5; }
  .pay-panel { padding-bottom: 30px; }

  @media (max-width: 430px) {
    body {
      align-items: stretch;
      background: var(--bg);
      animation: none;
    }
    #app {
      width: 100%;
      max-width: none;
      max-height: none;
      min-height: 100vh;
      min-height: 100svh;
      border-radius: 0;
      box-shadow: none;
    }
    .auth-header { padding-top: 48px; }
    .page-header, .home-hero, .vault-hero, .profile-hero { padding-left: 20px; padding-right: 20px; }
    .section, .pay-panel { padding-left: 20px; padding-right: 20px; }
    .pay-tabs, .filter-row, .settings-tabs { padding-left: 20px; padding-right: 20px; }
    .quick-actions { gap: 6px !important; }
    .qa-icon { width: 48px; height: 48px; font-size: 21px; }
    .qa-icon svg { width: 21px; height: 21px; }
    .qa-label { font-size: 10px; }
    .hero-balance { font-size: clamp(34px, 11vw, 44px); }
    .hero-row { gap: 7px; }
    .hero-stat { padding: 11px 8px; }
    .hero-stat-label { font-size: 9px; }
    .hero-stat-val { font-size: 12px; }
    .grid-2 { grid-template-columns: 1fr; }
    .info-row { gap: 12px; }
    .info-label { min-width: 0; }
    .info-val { text-align: right; word-break: break-word; }
    .modal, .modal-card { padding-left: 20px; padding-right: 20px; }
  }

  @media (max-height: 680px) {
    .auth-header { padding-top: 34px; padding-bottom: 30px; }
    .auth-body { padding-top: 22px; padding-bottom: 22px; }
    .home-hero, .vault-hero, .profile-hero, .page-header { padding-top: 42px; }
  }

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

  /* Responsive polish */
  html { min-height: 100%; background: var(--bg); }
  body { padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }
  #app { min-height: 100svh; }
  .alert-banner { max-width: 100%; line-height: 1.35; }
  .alert-banner #alertMsg { min-width: 0; overflow-wrap: anywhere; }
  .input-group input, .input-group select, .input-group textarea { min-height: 48px; }
  .btn, .pay-tab, .nav-item, .quick-action, .settings-item { min-height: 44px; }
  .amount-input-big { min-height: 68px; }
  .modal, .modal-card { overscroll-behavior: contain; }

  @media (max-width: 360px) {
    .hero-row { display: grid; grid-template-columns: 1fr 1fr; }
    .hero-stat:last-child { grid-column: 1 / -1; }
    .quick-actions { grid-template-columns: repeat(3, 1fr) !important; row-gap: 14px; }
    .splash-title { font-size: 34px; }
    .splash-logo { width: 112px; height: 112px; }
    .splash-logo img, .splash-logo div { width: 112px !important; height: 112px !important; }
  }

  @media (min-width: 431px) {
    body { padding: 18px; }
    #app { height: min(900px, calc(100svh - 36px)); min-height: 0; }
  }

  /* Final responsive and interaction polish */
  html { scroll-behavior: smooth; }
  body, button, input, select, textarea { -webkit-font-smoothing: antialiased; }
  button, a, .quick-action, .settings-item, .filter-chip, .nav-item { user-select: none; }
  .btn, .pay-tab, .settings-tab-btn, .filter-chip, .wallet-action-btn,
  .wallet-setactive-btn, .input-toggle, .theme-toggle-btn {
    -webkit-touch-callout: none;
  }
  .screen { scrollbar-width: thin; scrollbar-color: rgba(37,99,235,.22) transparent; }
  .screen:focus-visible { outline: none; }
  .modal-overlay { padding-bottom: env(safe-area-inset-bottom, 0); }
  .modal, .modal-card { padding-bottom: max(40px, env(safe-area-inset-bottom, 40px)); }
  .tx-item:hover { background: var(--primary-light); border-radius: 12px; padding-left: 8px; padding-right: 8px; }
  .input-group input:invalid:not(:placeholder-shown),
  .input-group select:invalid { border-color: var(--danger); }
  .btn:focus-visible, .pay-tab:focus-visible, .filter-chip:focus-visible,
  .settings-tab-btn:focus-visible, .theme-toggle-btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(14,165,233,.24);
  }

  @media (max-width: 380px) {
    .auth-header h1 { font-size: 28px; }
    .auth-body { padding-left: 18px; padding-right: 18px; }
    .hero-balance { letter-spacing: -1.5px; }
    .modal, .modal-card { padding-left: 18px; padding-right: 18px; }
  }

  /* Visual refinement */
  :root {
    --surface-glass: rgba(255,255,255,0.72);
    --text-strong: #122B4A;
  }

  body {
    color: var(--text);
    text-rendering: optimizeLegibility;
  }

  #app {
    isolation: isolate;
  }

  .screen {
    scroll-padding-top: 18px;
  }

  .home-hero,
  .vault-hero,
  .profile-hero {
    isolation: isolate;
  }

  .home-hero::before,
  .vault-hero::before,
  .profile-hero::before {
    filter: blur(1px);
  }

  .section-title {
    color: color-mix(in srgb, var(--text-muted) 84%, var(--primary));
  }

  .card {
    box-shadow: 0 2px 5px rgba(30,58,95,0.04), 0 12px 30px rgba(37,99,235,0.07);
  }

  .card:hover {
    box-shadow: 0 4px 10px rgba(30,58,95,0.06), 0 16px 36px rgba(37,99,235,0.11);
  }

  .input-group input:hover,
  .input-group select:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  }

  .input-group input[readonly] {
    background: var(--bg-2);
    color: var(--text-muted);
    cursor: not-allowed;
  }

  .btn,
  .pay-tab,
  .quick-action,
  .settings-item,
  .filter-chip,
  .wallet-action-btn,
  .wallet-setactive-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .btn:not(:disabled):hover,
  .pay-tab:not(.active):hover,
  .filter-chip:not(.active):hover {
    filter: saturate(1.08);
  }

  .quick-action {
    min-width: 0;
  }

  .qa-icon {
    border: 1px solid rgba(37,99,235,0.08);
  }

  .tx-item {
    border-radius: 14px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .modal-overlay {
    background: rgba(7,18,38,0.58);
  }

  .modal,
  .modal-card {
    border: 1px solid rgba(204,218,245,0.72);
  }

  #app.dark .modal,
  #app.dark .modal-card {
    border-color: rgba(122,144,176,0.16);
  }

  @supports not (color: color-mix(in srgb, white, black)) {
    .section-title { color: var(--text-muted); }
    .input-group input:hover,
    .input-group select:hover { border-color: var(--primary); }
  }

  @media (min-width: 431px) {
    #app {
      border-radius: 34px;
    }
  }

  @media (max-width: 430px) {
    .auth-header {
      padding-top: max(42px, env(safe-area-inset-top));
    }

    .home-hero,
    .vault-hero,
    .profile-hero,
    .omnicard-page-header,
    .page-header {
      padding-top: max(42px, calc(env(safe-area-inset-top) + 28px));
    }

    .bottom-nav {
      height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    }

    .screen {
      padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    }

    .screen.no-nav {
      padding-bottom: 0;
    }
  }

  /* Transaction list polish */
  .tx-item {
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    transition: background 0.18s ease, transform 0.18s ease;
  }

  .tx-item:hover {
    transform: translateY(-1px);
  }

  .tx-content {
    min-width: 0;
    padding-top: 1px;
  }

  .tx-name {
    font-weight: 750;
  }

  .tx-sub {
    overflow-wrap: anywhere;
  }

  .tx-amount-wrap {
    flex: 0 0 auto;
    min-width: 92px;
    padding-top: 2px;
    text-align: right;
  }

  .tx-amount {
    white-space: nowrap;
  }

  @media (max-width: 380px) {
    .tx-item {
      gap: 9px;
    }

    .tx-icon {
      width: 40px;
      height: 40px;
      font-size: 18px;
    }

    .tx-amount-wrap {
      min-width: 78px;
    }

    .tx-amount {
      font-size: 13px;
    }
  }

  /* OmniCard authentication prototype */
  .home-omnicard-card {
    width: 100%;
    border: 0;
    border-radius: 22px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #13264f 0%, #1b3d79 56%, #0e7490 100%);
    box-shadow: 0 14px 30px rgba(21, 58, 116, .22);
    transition: transform .2s ease, box-shadow .2s ease;
    font-family: inherit;
  }

  .home-omnicard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(21, 58, 116, .28);
  }

  .home-omnicard-card:active {
    transform: scale(.985);
  }

  .home-omnicard-glow {
    position: absolute;
    width: 170px;
    height: 170px;
    right: -48px;
    top: -82px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(255, 255, 255, .035), 0 0 0 36px rgba(255, 255, 255, .025);
  }

  .home-omnicard-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
  }

  .home-omnicard-kicker {
    color: #8dd9ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
  }

  .home-omnicard-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.2px;
  }

  .home-omnicard-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
  }

  .home-omnicard-status .status-dot {
    width: 7px;
    height: 7px;
    background: #8dd9ff;
  }

  .home-omnicard-arrow {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 25px;
    font-weight: 400;
  }

  .omnicard-page-header {
    padding: 54px 24px 25px;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
      radial-gradient(circle at 86% 10%, rgba(119, 225, 255, .27), transparent 28%),
      linear-gradient(150deg, #152c60 0%, #1e4f9b 57%, #087e9d 100%);
  }

  .omnicard-page-header::before {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    right: -120px;
    bottom: -154px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(255,255,255,.04), 0 0 0 38px rgba(255,255,255,.03);
  }

  .omnicard-header-orbit {
    position: absolute;
    width: 105px;
    height: 105px;
    right: 26px;
    top: 52px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    transform: rotate(32deg) skewX(-16deg);
  }

  .omnicard-header-orbit::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    right: 8px;
    top: 14px;
    border-radius: 50%;
    background: #8dd9ff;
    box-shadow: 0 0 16px #8dd9ff;
  }

  .omnicard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

  .eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #85e8bd;
    box-shadow: 0 0 12px rgba(133,232,189,.8);
  }

  .omnicard-page-header h2 {
    position: relative;
    z-index: 1;
    margin-top: 11px;
    color: #fff;
    font-size: 25px;
    font-weight: 850;
    letter-spacing: -.7px;
  }

  .omnicard-page-header p {
    position: relative;
    z-index: 1;
    max-width: 315px;
    margin-top: 8px;
    color: rgba(255,255,255,.68);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
  }

  .omnicard-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
    margin-top: 17px;
  }

  .prototype-pill,
  .omnilink-mini,
  .demo-badge,
  .architecture-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 99px;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2px;
  }

  .prototype-pill {
    color: #103b70;
    background: #c9f5ff;
  }

  .omnilink-mini {
    color: rgba(255,255,255,.83);
    border: 1px solid rgba(255,255,255,.26);
    background: rgba(255,255,255,.1);
  }

  .omnicard-section {
    padding-top: 18px;
    padding-bottom: 0;
  }

  .omnicard-status-card {
    padding: 19px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  .omnicard-status-card::after {
    content: '';
    position: absolute;
    width: 145px;
    height: 145px;
    right: -86px;
    top: -85px;
    border: 1px solid rgba(37,99,235,.1);
    border-radius: 50%;
    box-shadow: 0 0 0 15px rgba(37,99,235,.035), 0 0 0 30px rgba(37,99,235,.025);
  }

  .omnicard-status-top {
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    z-index: 1;
  }

  .omnicard-device-mark {
    width: 49px;
    height: 58px;
    flex: 0 0 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(37,99,235,.16);
    border-radius: 15px;
    background: linear-gradient(145deg, var(--primary-light), var(--accent-light));
  }

  .device-chip {
    width: 23px;
    height: 18px;
    display: block;
    position: relative;
    border: 2px solid var(--primary);
    border-radius: 5px;
    background: linear-gradient(90deg, transparent 43%, var(--primary) 44% 56%, transparent 57%), linear-gradient(0deg, transparent 43%, var(--primary) 44% 56%, transparent 57%);
  }

  .device-signal {
    width: 7px;
    height: 7px;
    position: absolute;
    right: 8px;
    top: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16,185,129,.12);
  }

  .omnicard-status-copy {
    flex: 1;
    min-width: 0;
  }

  .omnicard-status-copy .section-title {
    margin-bottom: 4px;
  }

  .omnicard-status-value {
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.3px;
  }

  .omnicard-status-helper {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
  }

  .status-label {
    flex: 0 0 auto;
    align-self: flex-start;
    border-radius: 99px;
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 800;
  }

  .status-label-neutral {
    color: var(--text-muted);
    background: var(--bg);
  }

  .omnicard-status-card[data-status="paired"] .status-label {
    color: var(--primary);
    background: var(--primary-light);
  }

  .omnicard-status-card[data-status="ready"] .status-label {
    color: #087a60;
    background: #d8faee;
  }

  .omnicard-status-card[data-status="ready"] .device-signal {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16,185,129,.16), 0 0 16px rgba(16,185,129,.5);
  }

  .omnicard-status-line {
    height: 4px;
    margin: 17px 0 16px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--bg);
  }

  .omnicard-status-line span {
    display: block;
    width: 18%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .45s ease;
  }

  .omnicard-status-card[data-status="paired"] .omnicard-status-line span { width: 58%; }
  .omnicard-status-card[data-status="ready"] .omnicard-status-line span { width: 100%; background: linear-gradient(90deg, var(--success), #5eead4); }

  .omnicard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .omnicard-detail-card {
    min-width: 0;
    padding: 16px;
  }

  .detail-card-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
  }

  .detail-icon {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 16px;
  }

  .detail-icon.blue { color: var(--primary); background: var(--primary-light); }
  .detail-icon.violet { color: #7c3aed; background: #f0eaff; }

  .omnicard-detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-top: 17px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
  }

  .omnicard-detail-row strong {
    max-width: 62%;
    overflow: hidden;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 800;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .omnicard-detail-row.compact {
    margin-top: 11px;
  }

  .omnicard-last-auth {
    min-height: 29px;
    margin-top: 15px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
  }

  .verification-pending { color: var(--warning) !important; font-family: inherit !important; }
  .verification-success { color: var(--success) !important; font-family: inherit !important; }

  .text-action {
    padding: 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
  }

  .text-action:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: .55;
  }

  .omnicard-detail-card .text-action {
    margin-top: 15px;
  }

  .section-heading-row,
  .omnilink-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .section-heading {
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -.2px;
  }

  .demo-badge {
    color: #7c3aed;
    background: #f0eaff;
  }

  .auth-demo-card {
    margin-top: 12px;
    padding: 16px;
  }

  .challenge-preview {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 17px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
  }

  .challenge-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 18px;
    font-weight: 900;
  }

  .challenge-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
  }

  .challenge-value {
    margin-top: 3px;
    overflow: hidden;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .omnicard-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 11px;
  }

  .auth-demo-card .input-group {
    gap: 6px;
    margin-bottom: 16px;
  }

  .auth-demo-card .input-group label {
    font-size: 10px;
  }

  .auth-demo-card .input-group input {
    padding: 12px 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .verification-result {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 12px;
    color: var(--text-muted);
    background: var(--bg);
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
  }

  .verification-result-icon {
    flex: 0 0 auto;
    color: var(--warning);
    font-size: 16px;
    line-height: 14px;
  }

  .verification-result[data-state="checking"] {
    color: var(--primary);
    background: var(--primary-light);
  }

  .verification-result[data-state="checking"] .verification-result-icon {
    color: var(--primary);
    animation: pulse 1s infinite;
  }

  .verification-result[data-state="success"] {
    color: #087a60;
    background: #e5fbf2;
  }

  .verification-result[data-state="success"] .verification-result-icon {
    color: var(--success);
    font-weight: 900;
  }

  .omnilink-card {
    padding: 18px;
    border: 1px solid #cfe0ff;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-light), #f1fbff);
  }

  #app.dark .omnilink-card {
    border-color: #25477e;
    background: linear-gradient(135deg, rgba(37,99,235,.18), rgba(14,165,233,.11));
  }

  .architecture-badge {
    color: var(--primary);
    background: rgba(255,255,255,.75);
  }

  .omnilink-card p {
    margin-top: 11px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
    font-weight: 500;
  }

  .architecture-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin: 15px 0;
  }

  .architecture-flow span {
    flex: 1;
    padding: 8px 5px;
    border: 1px solid rgba(37,99,235,.16);
    border-radius: 10px;
    color: var(--primary);
    background: rgba(255,255,255,.74);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
  }

  #app.dark .architecture-flow span {
    border-color: rgba(125,211,252,.2);
    background: rgba(7,21,48,.45);
  }

  .architecture-flow i {
    color: var(--accent-dark);
    font-size: 14px;
    font-style: normal;
    font-weight: 800;
  }

  .omnilink-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .prototype-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid #f1d998;
    border-radius: 15px;
    color: #805b13;
    background: #fff9e9;
  }

  #app.dark .prototype-note {
    border-color: #765d28;
    color: #f3cf7a;
    background: rgba(107,75,13,.18);
  }

  .prototype-note-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 19px;
  }

  .prototype-note strong {
    display: block;
    font-size: 12px;
    font-weight: 850;
  }

  .prototype-note p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 500;
  }

  @media (max-width: 380px) {
    .omnicard-page-header {
      padding-left: 20px;
      padding-right: 20px;
    }

    .omnicard-section {
      padding-left: 20px;
      padding-right: 20px;
    }

    .omnicard-status-top {
      gap: 9px;
    }

    .omnicard-device-mark {
      width: 43px;
      flex-basis: 43px;
    }

    .status-label {
      padding-left: 7px;
      padding-right: 7px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .home-omnicard-card,
    .omnicard-status-line span,
    .verification-result[data-state="checking"] .verification-result-icon {
      transition: none;
      animation: none;
    }
  }
  /* ---------------------------------------------------------------------
     Polish pass: subtle refinements layered on top of the existing design.
     Additive only — nothing above is overridden or removed.
     --------------------------------------------------------------------- */

  html { scroll-behavior: smooth; }

  /* Slightly stronger, more visible focus ring on form fields for easier
     keyboard/accessibility use, on top of the existing focus-visible rules. */
  .input-group input:focus,
  .input-group select:focus,
  .input-group textarea:focus {
    box-shadow: 0 0 0 3px var(--primary-glow);
  }

  /* Gentle lift + shadow on hover for tappable list rows (transactions,
     settings items, wallet rows) so the UI feels more responsive on
     desktop/trackpad use without affecting touch devices. */
  @media (hover: hover) and (pointer: fine) {
    .tx-item:hover,
    .settings-item:hover,
    .wallet-row:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow);
    }
  }

  /* Smoother, consistent transitions on interactive surfaces that didn't
     already declare one. */
  .card, .tx-item, .settings-item, .wallet-row, .btn, .pay-tab {
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  }

  /* Comfortable reading width on larger screens: the app card already caps
     at 430px and stays centered, so widen the ambient background slightly
     so the phone-frame presentation feels intentional rather than empty. */
  @media (min-width: 900px) {
    body { padding: 32px; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .tx-item, .settings-item, .wallet-row, .btn, .pay-tab { transition: none; }
  }

  .recipient-search { position: relative; }
  .input-group .recipient-search input { padding-left: 44px; padding-right: 17px; }
  .recipient-search-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 15px; opacity: 0.7; pointer-events: none;
  }
  .recipient-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
  .recipient-results {
    margin-top: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    box-shadow: var(--shadow);
    max-height: 252px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .recipient-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 58px;
    padding: 10px 14px;
    background: none; border: none; border-bottom: 1px solid var(--border);
    text-align: left; cursor: pointer;
    font-family: inherit; color: var(--text);
    transition: background 0.18s;
  }
  .recipient-item:last-child { border-bottom: none; }
  .recipient-item:hover,
  .recipient-item:focus-visible { background: var(--primary-light); outline: none; }
  .recipient-avatar {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
  }
  .recipient-info { min-width: 0; flex: 1; }
  .recipient-name {
    font-size: 14px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .recipient-sub {
    font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .recipient-empty {
    padding: 14px 16px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); text-align: center; line-height: 1.5;
  }
  .recipient-chip {
    align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--success);
    border-radius: var(--radius-sm);
    background: var(--card);
  }
  .recipient-change {
    flex: 0 0 auto;
    background: none; border: 1.5px solid var(--border);
    color: var(--primary); font-size: 12px; font-weight: 700;
    padding: 8px 14px; border-radius: 99px; cursor: pointer;
    font-family: inherit; transition: border-color 0.2s, background 0.2s;
  }
  .recipient-change:hover { border-color: var(--primary); background: var(--primary-light); }

  .privacy-row { cursor: default; transition: opacity 0.2s; }
  .privacy-row:active { opacity: 1; }
  .privacy-row.is-disabled { opacity: 0.45; pointer-events: none; }
  .privacy-row .toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

  .recipient-save {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1.5px solid var(--border); color: var(--warning);
    font-size: 17px; line-height: 1; cursor: pointer; font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
  }
  .recipient-save:hover, .recipient-save.saved { border-color: var(--warning); background: rgba(245,158,11,0.14); }
  .recipient-save-link {
    margin-top: 8px; padding: 6px 2px; background: none; border: none;
    color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .contacts-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 12px; }
  .contacts-filter { flex: 1 1 160px; min-width: 0; margin: 0; }
  .contacts-add-btn {
    flex: 0 0 auto; padding: 13px 16px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
    font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap;
    box-shadow: 0 4px 14px var(--primary-glow);
  }
  .contacts-add-box {
    margin-bottom: 14px; padding: 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  }
  .contacts-count { margin: 4px 2px 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
  .contact-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
  .contact-row:last-child { border-bottom: none; }
  .contact-main {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 62px;
    padding: 10px 0; background: none; border: none; text-align: left; cursor: pointer;
    font-family: inherit; color: var(--text);
  }
  .contact-main:focus-visible, .contact-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
  .contact-edit {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1.5px solid var(--border); font-size: 15px; cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
  }
  .contact-edit:hover { border-color: var(--primary); background: var(--primary-light); }
  .contact-empty { padding: 28px 12px; text-align: center; font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--text-muted); }
#app:not(.dark) .auth-header .auth-logo-img {
  width: 124px !important;
  height: 124px !important;
  margin-top: -18px !important;
  margin-bottom: -10px !important;
}

@media (max-width: 380px), (max-height: 680px) {
  #app:not(.dark) .auth-header .auth-logo-img {
    width: 108px !important;
    height: 108px !important;
    margin-top: -14px !important;
    margin-bottom: -8px !important;
  }
}

.mon-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.mon-summary:empty { display: none; }
.mon-stat { background: var(--card); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 8px; text-align: center; }
.mon-stat-val { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text); }
.mon-stat-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.mon-stat.settled .mon-stat-val { color: var(--success); }
.mon-stat.pending .mon-stat-val { color: var(--warning-dark); }
.mon-stat.failed .mon-stat-val { color: var(--danger); }

.mon-card { background: var(--card); border: 1.5px solid var(--border); border-left-width: 4px; border-radius: 16px; padding: 14px; margin-bottom: 12px; min-width: 0; }
.mon-card.settled { border-left-color: var(--success); }
.mon-card.pending { border-left-color: var(--warning); }
.mon-card.failed { border-left-color: var(--danger); }
.mon-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mon-head-main { min-width: 0; }
.mon-title { font-size: 15px; font-weight: 800; color: var(--text); }
.mon-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mon-amount { font-size: 15px; font-weight: 800; white-space: nowrap; }
.mon-amount.credit { color: var(--success); }
.mon-amount.debit { color: var(--text); }
.mon-route { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: var(--text); flex-wrap: wrap; }
.mon-party { min-width: 0; overflow-wrap: anywhere; }
.mon-arrow { color: var(--primary); font-weight: 800; }
.mon-rows { margin-top: 8px; border-top: 1px solid var(--border); }
.mon-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.mon-row:last-child { border-bottom: none; }
.mon-label { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.mon-value { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; text-align: right; font-weight: 700; color: var(--text); }
.mon-muted { color: var(--text-muted); font-weight: 600; }
.mon-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.mon-pill.settled { background: rgba(16,185,129,.15); color: var(--success); }
.mon-pill.pending { background: rgba(245,158,11,.16); color: var(--warning-dark); }
.mon-pill.failed { background: rgba(239,68,68,.15); color: var(--danger); }
.mon-state.ok { color: var(--success); }
.mon-state.pending { color: var(--warning-dark); }
.mon-state.failed { color: var(--danger); }
.mon-state.idle { color: var(--text-muted); }
.mon-hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text); }
.mon-link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary-light); color: var(--primary); text-decoration: none; cursor: pointer; font-family: inherit; }
.mon-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mon-stage { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-2); }
.mon-stage.done { color: var(--success); border-color: rgba(16,185,129,.45); background: rgba(16,185,129,.1); }
.mon-stage.failed { color: var(--danger); border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.1); }
@media (max-width: 380px) {
  .mon-card { padding: 12px; }
  .mon-summary { gap: 8px; }
  .mon-stat-val { font-size: 19px; }
}

.auth-showcase { display: none; }

@media (min-width: 1024px) {
  body { padding: 0; }
  #app {
    max-width: none; max-height: none;
    width: 100%; height: 100vh; height: 100svh;
    border-radius: 0; box-shadow: none;
  }
  .alert-banner { left: 0; right: 0; margin: 0 auto; max-width: 560px; }
  .modal-overlay { align-items: center; justify-content: center; padding: 24px; }
  .modal,
  .modal-card {
    width: 100%; max-width: 480px;
    max-height: 88%;
    border-radius: 28px;
    padding: 28px 28px 32px;
  }
  .modal-handle { display: none; }

  #app:has(#bottomNav[style*="flex"]) .bottom-nav {
    top: 0; right: auto; bottom: 0;
    width: 248px; height: auto;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 6px; padding: 92px 14px 24px;
    border-top: 0; border-right: 1px solid var(--border);
    box-shadow: 8px 0 28px rgba(30,58,95,0.06);
  }
  #app:has(#bottomNav[style*="flex"]) .bottom-nav::before {
    content: 'OmniPay';
    position: absolute; top: 34px; left: 26px;
    font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
    color: var(--primary);
  }
  #app:has(#bottomNav[style*="flex"]) .nav-item {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 6px 10px; min-height: 52px;
    border-radius: 14px;
  }
  #app:has(#bottomNav[style*="flex"]) .nav-item:hover { background: var(--primary-light); }
  #app:has(#bottomNav[style*="flex"]) .nav-item.active { background: var(--primary-light); }
  #app:has(#bottomNav[style*="flex"]) .nav-icon { width: 40px; height: 40px; }
  #app:has(#bottomNav[style*="flex"]) .nav-item.active .nav-icon {
    background: transparent; transform: none; box-shadow: none;
  }
  #app:has(#bottomNav[style*="flex"]) .nav-label { font-size: 14px; }
  #app:has(#bottomNav[style*="flex"]) .nav-pay-btn {
    width: 40px; height: 40px; border-radius: 13px;
    transform: none;
    box-shadow: 0 4px 12px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  }
  #app:has(#bottomNav[style*="flex"]) .nav-pay-btn:active { transform: scale(0.95); }
  #app:has(#bottomNav[style*="flex"]) .nav-pay-btn svg { width: 20px; height: 20px; }

  #app:has(#bottomNav[style*="flex"]) .screen:not(.no-nav) {
    left: 248px;
    padding: 28px 32px 40px;
  }
  #app:has(#bottomNav[style*="flex"]) .screen:not(.no-nav) > * {
    width: 100%; max-width: 960px;
    margin-left: auto; margin-right: auto;
  }
  #app:has(#bottomNav[style*="flex"]) #pay > * { max-width: 640px; }
  #app:has(#bottomNav[style*="flex"]) #profile > * { max-width: 800px; }

  #app:has(#bottomNav[style*="flex"]) .home-hero,
  #app:has(#bottomNav[style*="flex"]) .vault-hero,
  #app:has(#bottomNav[style*="flex"]) .profile-hero,
  #app:has(#bottomNav[style*="flex"]) .omnicard-page-header { border-radius: 28px; }
  #app:has(#bottomNav[style*="flex"]) .page-header {
    border: 1px solid var(--border);
    border-radius: 24px;
  }
  #app:has(#bottomNav[style*="flex"]) .pay-tabs,
  #app:has(#bottomNav[style*="flex"]) .filter-row {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
  }

  #app:has(#bottomNav[style*="flex"]) #fullTxList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    align-items: start;
  }
  #app:has(#bottomNav[style*="flex"]) #fullTxList > .card { grid-column: 1 / -1; }
  #app:has(#bottomNav[style*="flex"]) .mon-stat { padding: 18px 12px; }
  #app:has(#bottomNav[style*="flex"]) .mon-stat-val { font-size: 28px; }

  #app:has(#bottomNav[style*="flex"]) .alert-banner { left: 248px; }

  #app:not(:has(#bottomNav[style*="flex"])) #splash::before { width: 560px; height: 560px; }
  #app:not(:has(#bottomNav[style*="flex"])) #splash::after { width: 400px; height: 400px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-ring3 { width: 260px; height: 260px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-circuit-tr,
  #app:not(:has(#bottomNav[style*="flex"])) .splash-circuit-bl { width: 300px; height: 300px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-circuit-tl,
  #app:not(:has(#bottomNav[style*="flex"])) .splash-circuit-br { width: 230px; height: 230px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-logo { width: 176px; height: 176px; margin-bottom: 30px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-logo img,
  #app:not(:has(#bottomNav[style*="flex"])) .splash-logo div { width: 176px !important; height: 176px !important; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-title { font-size: 64px; margin-bottom: 18px; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-tagline { font-size: 21px; max-width: 460px; line-height: 1.7; }
  #app:not(:has(#bottomNav[style*="flex"])) .splash-loader { width: 280px; }

  #app:not(:has(#bottomNav[style*="flex"])) .auth-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-header {
    position: sticky; top: 0; align-self: start;
    height: 100vh; height: 100svh;
    padding: 64px clamp(48px, 6vw, 96px);
    border-radius: 0 56px 56px 0;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-header .auth-logo-img {
    width: 96px !important; height: 96px !important;
    margin: 0 0 30px !important;
    padding: 14px;
    background: #fff;
    object-fit: contain !important;
    filter: none !important;
    box-shadow: 0 16px 40px rgba(8,28,92,0.32), 0 0 0 1px rgba(255,255,255,0.5);
  }
  #app.dark:not(:has(#bottomNav[style*="flex"])) .auth-header .auth-logo-img {
    background: #0F1E38;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(37,99,235,0.28);
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-header h1 { font-size: clamp(40px, 4vw, 56px); letter-spacing: -1.5px; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-header p { font-size: 18px; max-width: 460px; line-height: 1.5; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-showcase {
    display: block; position: relative; z-index: 1;
    margin-top: 44px; max-width: 520px;
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-points { list-style: none; display: flex; flex-direction: column; gap: 22px; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-points li { display: flex; align-items: flex-start; gap: 16px; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-point-icon {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-points strong { display: block; font-size: 16px; font-weight: 700; color: #fff; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-points div span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.74); }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-point-icon svg { width: 22px; height: 22px; }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-body {
    align-self: center; width: 100%; max-width: 520px;
    margin: 0 auto; padding: 56px 40px;
    flex: none;
  }

  #app:not(:has(#bottomNav[style*="flex"])) #wallet-setup .ws-steps,
  #app:not(:has(#bottomNav[style*="flex"])) #wallet-setup .ws-wallet-card,
  #app:not(:has(#bottomNav[style*="flex"])) #wallet-setup .ws-continue-btn,
  #app:not(:has(#bottomNav[style*="flex"])) #wallet-setup #wsErrorBox { width: 100%; max-width: 520px; }
}

.auth-brand-row { display: contents; }
.auth-brand-text { display: none; }

@media (min-width: 1024px) {
  #app:not(:has(#bottomNav[style*="flex"])) .auth-brand-row {
    display: flex; align-items: center; gap: 22px;
    margin-bottom: 30px; position: relative; z-index: 1;
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-header .auth-brand-row .auth-logo-img {
    margin: 0 !important; flex: 0 0 auto;
  }
  #app:not(:has(#bottomNav[style*="flex"])) .auth-brand-text { display: block; min-width: 0; }
  .auth-brand-title { font-size: 44px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; margin-bottom: 8px; }
  .auth-brand-omni { color: #fff; }
  .auth-brand-pay { color: #BFE0FF; }
  .auth-brand-tagline { font-size: 14px; font-weight: 500; line-height: 1.5; color: rgba(255,255,255,0.78); }
  .auth-brand-accent { color: #fff; font-weight: 700; }
}

.auth-intro { display: none; }

@media (min-width: 1024px) {
  #app:not(:has(#bottomNav[style*="flex"])) .auth-intro {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 4px 0 12px;
  }
  .auth-intro-icon {
    width: 56px; height: 56px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #5B8FFF 0%, #2563EB 55%, #1D4ED8 100%);
    box-shadow: 0 10px 26px rgba(37,99,235,0.35);
    margin-bottom: 18px;
  }
  .auth-intro-title { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; color: var(--text); }
  .auth-intro-sub { font-size: 15px; font-weight: 500; line-height: 1.55; color: var(--text-muted); margin-top: 8px; max-width: 420px; }
  .auth-intro-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .auth-intro-pills span {
    font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
    color: var(--primary); background: var(--primary-light); border: 1px solid var(--border);
  }
}

.help-row {
  display: flex; align-items: center; gap: 14px; min-height: 56px;
  padding: 12px 14px; margin-bottom: 10px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 16px;
  color: var(--text); text-decoration: none; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.help-row:hover { border-color: var(--primary); background: var(--primary-light); }
.help-row-icon { font-size: 22px; flex: 0 0 auto; }
.help-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-row-info strong { font-size: 14px; font-weight: 700; color: var(--text); }
.help-row-info span { font-size: 12.5px; color: var(--text-muted); font-weight: 500; word-break: break-all; }
.help-faq { margin-top: 18px; }
.help-faq-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.help-faq details { border: 1.5px solid var(--border); border-radius: 14px; padding: 0 14px; margin-bottom: 8px; background: var(--bg); }
.help-faq summary { cursor: pointer; padding: 13px 0; font-size: 14px; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: '+'; color: var(--primary); font-weight: 800; }
.help-faq details[open] summary::after { content: '–'; }
.help-faq details p { font-size: 13px; line-height: 1.6; color: var(--text-muted); font-weight: 500; padding-bottom: 14px; }
.about-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 14px; }
.about-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; filter: drop-shadow(0 4px 12px rgba(37,99,235,0.3)); }
.about-name { font-size: 28px; font-weight: 900; letter-spacing: -1px; color: var(--text); line-height: 1; }
.auth-brand-omni-dyn { color: var(--text); }
.about-tag { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 6px; }
.about-text { font-size: 13.5px; line-height: 1.65; color: var(--text-muted); font-weight: 500; margin-bottom: 16px; text-align: center; }
.legal-body { max-height: 52vh; overflow-y: auto; padding-right: 4px; -webkit-overflow-scrolling: touch; }
.legal-body h4 { font-size: 14px; font-weight: 800; color: var(--text); margin: 16px 0 4px; }
.legal-body h4:first-child { margin-top: 0; }
.legal-body p { font-size: 13px; line-height: 1.65; color: var(--text-muted); font-weight: 500; }

.activity-heading { font-size: 13px; font-weight: 800; color: var(--text); margin: 22px 0 2px; }
.settings-item.activity-row { cursor: default; align-items: flex-start; }
.settings-item.activity-row:active { opacity: 1; }
.activity-row .settings-info { min-width: 0; }
.activity-row .settings-info h4,
.activity-row .settings-info p { overflow-wrap: anywhere; }
.activity-tag {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700; vertical-align: middle;
  background: var(--primary-light); color: var(--primary);
}
.activity-tag.warn { background: rgba(245,158,11,0.16); color: var(--warning-dark); }
.activity-empty { padding: 16px 0; font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.activity-note { margin-top: 20px; font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--text-muted); }
.activity-btn {
  margin-top: 10px; padding: 11px 18px; min-height: 44px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.activity-btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); margin-left: 8px; }
.activity-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.activity-alert {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.35);
}
.activity-alert h4 { font-size: 14px; font-weight: 700; color: var(--text); }
.activity-alert p { margin-top: 4px; font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.activity-alert .activity-btn { margin-top: 12px; }
.settings-tab-btn.has-alert::after {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px;
  border-radius: 50%; background: var(--danger); vertical-align: middle;
}

.send-confirm-text { font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.send-confirm-text strong { font-weight: 800; }
.send-confirm-sub { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); word-break: break-all; }
.send-confirm-sub:empty { display: none; }