    :root {
      /* Match index.html color scheme */
      --primary: #0066FF;
      --primary-dark: #0052CC;
      --primary-light: #0066FF;
      --primary-cta: #0066FF;
      --accent: #6A7EA8;
      --background: #FFFFFF;
      --surface: #F2F4F7;
      --text: #1A1C1E;
      --text-secondary: #6A7EA8;
      --border: #D8DBE2;
      --success: #10b981;
      --warning: #F59E0B;
      --error: #ef4444;
      --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
      --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
      --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
      --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
      --sidebar-width: 260px;
      --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
      --transition-fast: 0.18s var(--ease-out);
      --transition-ui: 0.2s var(--ease-out);
      --focus-ring: 0 0 0 3px rgba(0, 102, 255, 0.1);
    }

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

    /* Prevent any stray horizontal overflow from making Android Chrome / Samsung
       Internet re-sample the viewport (the "zoomed in" look on phones).
       overflow-x: clip (not hidden) so we don't create a scroll container that
       would interfere with descendant scroll-snap carousels. */
    html, body {
      max-width: 100%;
      overflow-x: clip;
    }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      background: var(--background);
      color: var(--text);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    /* Custom Scrollbar */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
      background: #CBD5E1;
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #94A3B8;
    }

    /* Glass Effect */
    .glass {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .glass-dark {
      background: rgba(15, 23, 42, 0.8);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Card Styles */
    .card {
      background: white;
      border-radius: 16px;
      padding: 20px;
      box-shadow: var(--shadow);
      transition: box-shadow var(--transition-ui), transform var(--transition-fast), border-color var(--transition-fast);
      border: 1px solid var(--border);
    }

    .card:hover {
      box-shadow: 0 8px 20px -4px rgb(0 0 0 / 0.1), 0 4px 8px -2px rgb(0 0 0 / 0.06);
      transform: translateY(-1px);
    }

    .card-compact {
      padding: 16px;
    }

    /* Button Styles */
    .btn {
      padding: 10px 16px;
      border-radius: 10px;
      font-weight: 600;
      font-size: 14px;
      transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s var(--ease-out), opacity var(--transition-fast);
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-decoration: none;
    }

    .btn-primary {
      background: var(--primary-cta);
      color: white;
      box-shadow: 0 2px 8px rgba(0, 102, 255, 0.22);
    }

    .btn-primary:hover:not(:disabled) {
      background: #0052CC;
      box-shadow: 0 4px 14px rgba(0, 102, 255, 0.28);
    }

    .btn-primary:active:not(:disabled) {
      transform: scale(0.98);
      box-shadow: 0 1px 4px rgba(0, 102, 255, 0.2);
    }

    .btn-secondary {
      background: white;
      color: var(--text);
      border: 2px solid var(--border);
    }

    .btn-secondary:hover:not(:disabled) {
      background: rgba(0, 102, 255, 0.04);
      border-color: var(--border);
      color: var(--primary-cta);
    }

    .btn-secondary:active:not(:disabled) {
      transform: scale(0.98);
    }

    .btn-success {
      background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
      color: white;
      box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    }

    .btn-success:hover:not(:disabled) {
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.32);
      filter: brightness(0.97);
    }

    .btn-success:active:not(:disabled) {
      transform: scale(0.98);
    }

    .btn-danger {
      background: transparent;
      color: var(--error);
      border: 2px solid var(--error);
    }

    .btn-danger:hover:not(:disabled) {
      background: var(--error);
      color: white;
    }

    .btn-danger:active:not(:disabled) {
      transform: scale(0.98);
    }

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

    .btn-ghost:hover:not(:disabled) {
      background: rgba(0, 102, 255, 0.06);
      border-color: var(--border);
      color: var(--text);
    }

    .btn-ghost:active:not(:disabled) {
      transform: scale(0.98);
    }

    .btn-sm {
      padding: 8px 12px;
      font-size: 14px;
    }

    .btn-lg {
      padding: 12px 24px;
      font-size: 16px;
    }

    .btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none !important;
      box-shadow: none !important;
      filter: none !important;
    }

    /* Dashboard Layout - Desktop Sidebar + Mobile Drawer */
    .dashboard-layout {
      display: flex;
      min-height: 100vh;
    }

    .dashboard-sidebar {
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      width: var(--sidebar-width);
      background: white;
      border-right: 1px solid var(--border);
      padding: 20px 0;
      z-index: 100;
      overflow-y: auto;
      transition: transform 0.25s var(--ease-out);
    }

    .dashboard-sidebar-header {
      padding: 0 20px 20px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
      display: block;
    }

    .mobile-drawer-header {
      display: none;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }

    .dashboard-sidebar-logo {
      display: flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      color: var(--primary);
      font-size: 20px;
      font-weight: 700;
      transition: color var(--transition-fast), opacity var(--transition-fast);
    }

    .dashboard-sidebar-logo:hover {
      opacity: 0.92;
    }

    .dashboard-sidebar-logo i {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--primary-cta) 0%, #0052CC 100%);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 18px;
    }

    .dashboard-nav {
      padding: 0 12px;
    }

    .dashboard-nav-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      margin-bottom: 4px;
      border-radius: 10px;
      color: var(--text-secondary);
      text-decoration: none;
      font-weight: 500;
      font-size: 14px;
      transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
      cursor: pointer;
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
      box-shadow: inset 3px 0 0 transparent;
    }

    .dashboard-nav-item:hover {
      background: rgba(0, 102, 255, 0.06);
      color: var(--text);
    }

    .dashboard-nav-item.active {
      background: rgba(0, 102, 255, 0.1);
      color: var(--primary-cta);
      font-weight: 600;
      box-shadow: inset 3px 0 0 var(--primary-cta);
    }

    .dashboard-nav-item i {
      width: 20px;
      text-align: center;
      font-size: 16px;
    }

    .dashboard-main {
      flex: 1;
      margin-left: var(--sidebar-width);
      background: var(--surface);
    }

    .dashboard-header {
      background: white;
      border-bottom: 1px solid var(--border);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      position: sticky;
      top: 0;
      z-index: 50;
    }

    .dashboard-header-title {
      font-size: 24px;
      font-weight: 700;
      color: var(--text);
      margin: 0;
    }

    .dashboard-header-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .header-search-btn {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      cursor: pointer;
      transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    }

    .header-search-btn:hover {
      background: rgba(0, 102, 255, 0.07);
      color: var(--primary-cta);
      border-color: var(--primary-cta);
    }

    .header-search-btn.active {
      background: rgba(0, 102, 255, 0.10);
      color: var(--primary-cta);
      border-color: var(--primary-cta);
    }

    .dashboard-header-user {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 16px;
      border-radius: 10px;
      background: var(--surface);
      color: var(--text);
      font-size: 14px;
      font-weight: 500;
    }

    /* Permanent wallet-update counter shown in the dashboard header.
       Account-scoped (one pool per user, NOT per card). The colour
       reflects how much of the rolling-30-day pool is left:
         green  >= 40 % remaining
         amber  10–40 % remaining
         red    < 10 % remaining or 0
       Hidden until the GET /edit-quota response arrives. */
    .wallet-quota-pill {
      display: none;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      border: 1px solid transparent;
      background: #ecfdf5;
      color: #047857;
      border-color: #a7f3d0;
      transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
      white-space: nowrap;
    }
    .wallet-quota-pill.is-visible { display: inline-flex; }
    .wallet-quota-pill:hover { filter: brightness(0.97); }
    .wallet-quota-pill .wallet-quota-icon {
      font-size: 14px;
      opacity: 0.85;
    }
    .wallet-quota-pill.level-amber {
      background: #fffbeb;
      color: #b45309;
      border-color: #fde68a;
    }
    .wallet-quota-pill.level-red {
      background: #fef2f2;
      color: #b91c1c;
      border-color: #fecaca;
    }
    @media (max-width: 640px) {
      .wallet-quota-pill .wallet-quota-label { display: none; }
      .wallet-quota-pill { padding: 8px 10px; }
    }

    .dashboard-content {
      padding: 20px;
      max-width: 1400px;
      margin: 0 auto;
    }

    /* Mobile Hamburger & Drawer */
    .mobile-hamburger {
      display: none;
      width: 44px;
      height: 44px;
      border: none;
      background: transparent;
      color: var(--text);
      font-size: 20px;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .mobile-hamburger:hover {
      background: rgba(0, 102, 255, 0.06);
    }

    .mobile-hamburger:active {
      transform: scale(0.98);
    }

    .mobile-drawer-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 200;
      animation: fadeIn 0.18s var(--ease-out);
    }

    .mobile-drawer-overlay.show {
      display: block;
    }

    /* .mobile-drawer: no desktop styles; mobile drawer styles are defined in the @media block below */

    .mobile-drawer-close {
      width: 36px;
      height: 36px;
      border: none;
      background: var(--surface);
      color: var(--text);
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: background-color var(--transition-fast), color var(--transition-fast), transform 0.15s var(--ease-out);
    }

    .mobile-drawer-close:hover {
      background: rgba(0, 102, 255, 0.08);
    }

    .mobile-drawer-close:active {
      transform: scale(0.98);
    }

    /* Card List Layout */
    .dashboard-grid {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      gap: 16px;
    }

    .cards-list {
      display: grid;
      gap: 16px;
    }

    .cards-list .card {
      display: flex;
      flex-direction: column;
      gap: 16px;
      animation: cardFadeIn 0.18s var(--ease-out);
      border: 1px solid var(--border);
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s var(--ease-out);
    }

    /* Pagination dots used by the mobile carousel. Hidden on desktop. */
    .cards-dots {
      display: none;
    }
    .cards-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--border);
      transition: background-color var(--transition-fast), transform var(--transition-fast);
      flex-shrink: 0;
    }
    .cards-dot.active {
      background: var(--primary-cta);
      transform: scale(1.15);
    }

    /* Mobile carousel: horizontal scroll-snap when user has more than one card.
       Applied only when JS adds the .cards-list--carousel modifier so a single
       card still renders as a normal block.
       Uses 100vw so each slide is exactly the viewport width regardless of any
       parent padding — avoids all % vs max-width ambiguity that caused the
       "half card on the right" misalignment. */
    @media (max-width: 768px) {
      .cards-list.cards-list--carousel {
        display: flex;
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        /* Escape dashboard-content horizontal padding so the carousel is full-viewport-width.
           Use an explicit negative margin equal to that padding instead of the
           calc((100vw - 100%) / -2) full-bleed identity: on real iOS Safari (with
           viewport-fit=cover) 100vw and % resolve against different bases, so the
           identity collapses to ~0 and the slide overflows by padding-left. The
           literal value matches .dashboard-content's 16px padding for 481–768px;
           the ≤480px override below uses 12px. */
        width: 100vw;
        margin-left: -16px;
        padding: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
      }
      .cards-list.cards-list--carousel::-webkit-scrollbar { display: none; }
      .cards-list.cards-list--carousel > .card {
        flex: 0 0 100vw;
        max-width: 100vw;
        min-width: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        margin: 0;
        box-sizing: border-box;
      }
      .cards-dots.cards-dots--visible {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 12px 0 4px;
      }
    }

    .cards-list .card:hover {
      border-color: var(--primary-cta);
      box-shadow: 0 8px 24px rgba(0, 102, 255, 0.1);
    }

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

    @media (min-width: 1024px) {
      .cards-list .card .flex.flex-col.lg\:flex-row {
        flex-direction: row;
      }
    }

    @media (max-width: 1024px) {
      .cards-list .card {
        gap: 16px;
      }
    }

    /* Exclusive Offers */
    .offers-grid {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .offers-row {
      display: grid;
      gap: 16px;
    }
    .offers-row-full {
      grid-template-columns: 1fr;
    }
    .offers-row-half {
      grid-template-columns: 1fr 1fr;
    }
    .offer-card {
      background: white;
      border-radius: 14px;
      padding: 16px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      transition: box-shadow var(--transition-ui), border-color var(--transition-fast), transform var(--transition-fast);
    }
    .offer-card:hover {
      box-shadow: 0 8px 20px -4px rgb(0 0 0 / 0.1);
      border-color: rgba(0, 102, 255, 0.22);
      transform: translateY(-1px);
    }
    .offer-card-highlight {
      padding: 20px;
      border: 1px solid rgba(0, 102, 255, 0.25);
      background: linear-gradient(135deg, rgba(0, 102, 255, 0.03) 0%, rgba(0, 82, 204, 0.02) 100%);
    }
    .offer-card-header {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 8px;
    }
    .offer-card-logo {
      width: 48px;
      height: 48px;
      object-fit: contain;
      flex-shrink: 0;
    }
    .offer-card-title {
      font-weight: 600;
      font-size: 20px;
      color: var(--text);
      margin-bottom: 4px;
    }
    .offer-card-tagline {
      font-size: 16px;
      color: var(--text);
      margin-bottom: 8px;
      line-height: 1.4;
    }
    .offer-card-desc {
      font-size: 14px;
      color: var(--text);
      line-height: 1.5;
      margin-bottom: 16px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .offer-card-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .offer-coupon-section {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }
    .offer-coupon-section.expanded {
      max-height: 140px;
    }
    .offer-coupon-inner {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid var(--border);
    }
    .offer-coupon-code {
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      padding: 10px 16px;
      background: var(--surface);
      border-radius: 8px;
      color: var(--primary);
    }
    .offer-coupon-helper {
      font-size: 12px;
      color: var(--text-secondary);
      margin-top: 8px;
    }
    .offer-badge {
      display: inline-block;
      font-size: 12px;
      font-weight: 600;
      padding: 4px 8px;
      border-radius: 6px;
      background: linear-gradient(135deg, var(--primary-cta) 0%, #0052CC 100%);
      color: white;
      margin-left: 8px;
    }
    .offer-discount {
      display: inline-block;
      font-size: 12px;
      font-weight: 600;
      color: var(--success);
      margin-left: 8px;
    }
    .offer-free-badge {
      display: inline-block;
      font-size: 16px;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 8px;
      background: rgba(16, 185, 129, 0.2);
      color: var(--success);
      margin-left: 10px;
      letter-spacing: 0.02em;
    }
    .offer-btn-no-shadow {
      box-shadow: none !important;
    }
    .offer-btn-no-shadow:hover {
      box-shadow: none !important;
    }
    .offer-coupon-row {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    @media (max-width: 768px) {
      .offers-row-half {
        grid-template-columns: 1fr;
      }
    }
    @media (min-width: 769px) and (max-width: 1024px) {
      .offers-row-half {
        grid-template-columns: 1fr 1fr;
      }
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
      .dashboard-sidebar {
        /* Make sidebar a drawer on mobile */
        position: fixed;
        width: 280px;
        max-width: 85%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-xl);
        z-index: 201;
      }

      .dashboard-sidebar.show {
        transform: translateX(0);
      }

      .dashboard-sidebar-header {
        display: none;
      }

      .mobile-drawer-header {
        display: flex;
      }

      .dashboard-main {
        margin-left: 0;
      }

      .mobile-hamburger {
        display: flex;
      }

      /* Safe-area aware header padding — prevents content clipping on edge-to-edge iPhones */
      .dashboard-header {
        padding-top: 12px;
        padding-bottom: 12px;
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(28px, env(safe-area-inset-right));
      }

      /* White background removes the gray "shelf" visual gap above the card */
      .dashboard-main { background: white; }

      /* Logout belongs in sidebar/settings on mobile — remove from header */
      #logoutBtn { display: none; }

      .dashboard-header-title {
        font-size: 20px;
      }

      .dashboard-header-user {
        display: none;
      }

      .dashboard-content {
        padding: 16px;
        padding-bottom: 88px; /* Space for bottom nav */
      }

      .btn {
        min-height: 44px;
      }

      .cards-list .card {
        padding: 16px;
      }

      /* ── Native app feel: strip the "webpage card box" from ALL card-list slides ── */
      /* Carousel (multiple cards) */
      .cards-list.cards-list--carousel > .card {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 4px 20px 0;
      }
      /* Single card (no carousel class added by JS) */
      .cards-list:not(.cards-list--carousel) > .card {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 4px 20px 0;
      }
      /* No hover effects on touch */
      .cards-list > .card:hover {
        transform: none;
        box-shadow: none;
        border-color: transparent;
      }

      /* Mobile: hide sidebar drawer, show bottom nav instead */
      .dashboard-sidebar {
        display: none !important;
      }
      .mobile-drawer-overlay {
        display: none !important;
      }
      .mobile-hamburger {
        display: none !important;
      }
    }

    /* Bottom Tab Navigation - Mobile only */
    .bottom-nav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 50;
      background: white;
      border-top: 1px solid var(--border);
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
      height: 64px;
    }
    @media (max-width: 768px) {
      .bottom-nav {
        display: flex;
      }
    }
    .bottom-nav-inner {
      display: flex;
      align-items: center;
      justify-content: space-around;
      width: 100%;
      height: 100%;
      position: relative;
      padding: 0 8px;
    }
    .bottom-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex: 1;
      min-width: 0;
      text-decoration: none;
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 500;
      padding: 8px 4px;
      transition: color var(--transition-fast), transform 0.15s var(--ease-out);
      -webkit-tap-highlight-color: transparent;
    }
    .bottom-nav-item:hover {
      color: var(--primary-cta);
    }
    .bottom-nav-item.active {
      color: var(--primary-cta);
      font-weight: 600;
    }
    .bottom-nav-item:active {
      transform: scale(0.95);
    }
    .bottom-nav-item i {
      font-size: 20px;
      margin-bottom: 2px;
      width: 24px;
      text-align: center;
    }
    .bottom-nav-create-btn {
      width: 52px;
      height: 52px;
      margin-top: 0;
      border-radius: 50%;
      background: var(--primary-cta);
      color: white;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: none;
      cursor: pointer;
      transition: background-color var(--transition-fast), transform 0.15s var(--ease-out);
      -webkit-tap-highlight-color: transparent;
    }
    .bottom-nav-create-btn:hover {
      background: #0052CC;
    }
    .bottom-nav-create-btn:active {
      transform: scale(0.96);
    }
    .bottom-nav-create-btn i {
      font-size: 24px;
    }
    /* Center slot for create button - equal flex space */
    .bottom-nav-create-wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      min-width: 0;
    }
    .cta-badge-btn {
      flex: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 56px;
      padding: 0;
      background: transparent;
      border: none;
      cursor: pointer;
    }
    .cta-badge-btn img {
      height: 56px;
      width: auto;
      display: block;
    }
    /* Mid-range phones (481–768px): scale card preview ~18% to fit without scrolling */
    @media (min-width: 481px) and (max-width: 768px) {
      .success-card-preview              { margin-top: 0; }
      .business-card-preview             { width: 82%; max-width: 308px; margin: 0 auto; }
      .card-preview-label                { font-size: 10px; }
      .card-preview-name                 { font-size: 20px; }
      .card-preview-phone,
      .card-preview-title,
      .card-preview-email,
      .card-preview-company              { font-size: 13px; }
      .card-preview-header               { height: 58px; margin-bottom: 11px; }
      .card-preview-logo-wrapper         { width: 131px; height: 41px; }
      .card-preview-secondary-row        { padding-top: 8px; }
      .card-preview-auxiliary-row        { padding-top: 8px; margin-bottom: 16px; }
      .card-preview-qr-wrapper           { margin-top: 16px; margin-bottom: 23px; padding-top: 13px; }
      .card-preview-qr-placeholder       { width: 108px; height: 108px; }
    }

    @media (max-width: 480px) {
      .cta-badge-btn {
        height: 52px;
      }
      .cta-badge-btn img {
        height: 52px;
      }
      /* Compact card preview for narrow phones (e.g. Samsung large screens).
         Avoids the "zoomed in" feeling and gives the JS text-fitter more headroom.
         Keep padding-bottom: 88px so the bottom nav never covers action buttons. */
      .success-card-preview              { margin-top: 0; width: 100%; }
      .dashboard-content                 { padding: 0 12px 88px; }
      /* Match the 12px .dashboard-content padding at this breakpoint (see carousel note above). */
      .cards-list.cards-list--carousel   { margin-left: -12px; }
      .cards-list .card                  { padding: 12px; }
      .cards-list.cards-list--carousel > .card,
      .cards-list:not(.cards-list--carousel) > .card { padding: 2px 14px 0; background: transparent; border: none; box-shadow: none; border-radius: 0; }
      /* Scale preview container 82% — same approach as mid-range phones */
      .business-card-preview             { width: 82%; max-width: 295px; margin: 0 auto; }
      .business-card-preview-inner       { padding: 0 13px; }
      .card-preview-label                { font-size: 10px; }
      .card-preview-name                 { font-size: 20px; }
      .card-preview-phone,
      .card-preview-title,
      .card-preview-email,
      .card-preview-company              { font-size: 13px; }
      .card-preview-secondary-row        { padding-top: 8px; }
      .card-preview-auxiliary-row        { padding-top: 8px; margin-bottom: 16px; }
      .card-preview-qr-placeholder       { width: 104px; height: 104px; }
      .card-preview-qr-wrapper           { margin-top: 12px; margin-bottom: 16px; padding-top: 10px; }
      .card-preview-header               { height: 56px; margin-bottom: 10px; }
      .card-preview-logo-wrapper         { width: 120px; height: 38px; }
    }

    /* Utility Classes */
    .hidden {
      display: none !important;
    }

    .flex {
      display: flex;
    }

    .items-center {
      align-items: center;
    }

    .items-start {
      align-items: flex-start;
    }

    .justify-center {
      justify-content: center;
    }

    .min-h-screen {
      min-height: 100vh;
    }

    .space-y-2 > * + * {
      margin-top: 8px;
    }

    .space-y-4 > * + * {
      margin-top: 16px;
    }

    .space-y-6 > * + * {
      margin-top: 24px;
    }

    .space-y-8 > * + * {
      margin-top: 32px;
    }

    .grid {
      display: grid;
    }

    .grid-cols-1 {
      grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    @media (min-width: 768px) {
      .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .sm\:flex-row {
        flex-direction: row;
      }
    }

    .flex-col {
      flex-direction: column;
    }

    .justify-between {
      justify-content: space-between;
    }

    .gap-2 {
      gap: 8px;
    }

    .gap-4 {
      gap: 16px;
    }

    .border {
      border: 1px solid var(--border);
    }

    .border-t {
      border-top: 1px solid var(--border);
    }

    .rounded-lg {
      border-radius: 12px;
    }

    .p-4 {
      padding: 16px;
    }

    .pt-4 {
      padding-top: 16px;
    }

    .w-full {
      width: 100%;
    }

    .max-w-md {
      max-width: 448px;
    }

    .mx-auto {
      margin-left: auto;
      margin-right: auto;
    }

    .mb-1 {
      margin-bottom: 4px;
    }

    .mb-3 {
      margin-bottom: 12px;
    }

    .mb-4 {
      margin-bottom: 16px;
    }

    .mb-6 {
      margin-bottom: 24px;
    }

    .mr-1 {
      margin-right: 4px;
    }

    .mr-2 {
      margin-right: 8px;
    }

    .text-2xl {
      font-size: 24px;
      line-height: 1.3;
    }

    .text-xl {
      font-size: 20px;
      line-height: 1.3;
    }

    .text-lg {
      font-size: 18px;
      line-height: 1.4;
    }

    .text-xs {
      font-size: 12px;
      line-height: 1.5;
    }

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

    .font-bold {
      font-weight: 700;
    }

    .font-semibold {
      font-weight: 600;
    }

    .text-gray-900 {
      color: var(--text);
    }

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

    @media (min-width: 640px) {
      .sm\:flex {
        display: flex;
      }

      .sm\:inline {
        display: inline;
      }

      .sm\:flex-row {
        flex-direction: row !important;
      }
    }

    .mt-0\.5 {
      margin-top: 2px;
    }

    .mt-1 {
      margin-top: 4px;
    }

    .mt-5 {
      margin-top: 20px;
    }

    .w-4 {
      width: 16px;
    }

    .block {
      display: block;
    }

    .py-12 {
      padding-top: 48px;
      padding-bottom: 48px;
    }

    .font-medium {
      font-weight: 500;
    }

    .text-gray-400 {
      color: #6a7ea8;
    }

    .text-gray-500 {
      color: #6a7ea8;
    }

    .text-gray-700 {
      color: var(--text);
    }

    select.input {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
      background-position: right 12px center;
      background-repeat: no-repeat;
      background-size: 20px;
      padding-right: 40px;
      appearance: none;
    }

    /* Input Styles */
    .input {
      width: 100%;
      padding: 12px 16px;
      border: 2px solid var(--border);
      border-radius: 10px;
      font-size: 16px;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
      background: white;
      font-family: inherit;
    }

    .input:hover:not(:focus):not(.input-error) {
      border-color: #c5cad6;
    }

    .input:focus {
      outline: none;
      border-color: var(--primary-cta);
      box-shadow: var(--focus-ring);
    }

    .input-error {
      border-color: var(--error);
      background-color: #fffafa;
    }

    .input-error:focus {
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
      border-color: var(--error);
    }

    /* Badge */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
    }

    .badge-primary {
      background: rgba(0, 102, 255, 0.1);
      color: var(--primary);
    }

    .badge-success {
      background: rgba(16, 185, 129, 0.1);
      color: var(--success);
    }

    .badge-warning {
      background: rgba(245, 158, 11, 0.1);
      color: var(--warning);
    }

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

    /* Plan Cards */
    .plan-card {
      position: relative;
      transition: box-shadow var(--transition-ui), transform var(--transition-fast);
      background: white;
      overflow: hidden;
    }

    .plan-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, var(--primary-cta), var(--primary-light));
      opacity: 0;
      transition: opacity 0.2s var(--ease-out);
    }

    .plan-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px -6px rgb(0 0 0 / 0.12);
    }

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

    .plan-current-badge {
      font-size: 12px;
      padding: 4px 10px;
      font-weight: 600;
    }

    .gap-6 {
      gap: 24px;
    }

    .gap-3 {
      gap: 12px;
    }

    .space-y-3 > * + * {
      margin-top: 12px;
    }

    .space-y-5 > * + * {
      margin-top: 24px;
    }

    /* Modern Card Details Section */
    .card-details-section {
      display: flex;
      flex-direction: column;
      gap: 16px;
      height: 100%;
    }

    .card-details-header {
      padding-bottom: 12px;
      border-bottom: 2px solid var(--surface);
    }

    .card-details-extra {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }

    .card-details-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }

    @media (max-width: 768px) {
      .card-details-stats { display: none; }
    }

    .stat-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: var(--surface);
      border-radius: 10px;
      transition: background-color var(--transition-fast);
    }

    .stat-item:hover {
      background: rgba(0, 102, 255, 0.07);
    }

    .stat-item--analytics {
      cursor: pointer;
      border: 1px dashed var(--border);
      transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    }

    .stat-item--analytics:hover {
      background: rgba(0, 102, 255, 0.08);
      border-color: var(--primary-cta);
      transform: translateY(-1px);
    }

    .stat-item--analytics .stat-value {
      font-size: 13px;
      font-weight: 600;
      color: var(--primary-cta);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .stat-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      background: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      box-shadow: var(--shadow-sm);
    }

    .stat-content {
      flex: 1;
    }

    .stat-label {
      font-size: 14px;
      color: var(--text-secondary);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
    }

    .stat-value {
      font-size: 18px;
      font-weight: 600;
      color: var(--text);
    }

    .card-details-actions {
      display: flex;
      gap: 8px;
      margin-top: auto;
      padding-top: 16px;
    }

    .card-details-actions .card-action-btn {
      flex: 0;
    }

    .card-details-actions .card-action-btn-label {
      display: none;
    }

    .card-details-actions .card-action-btn--edit {
      background: #10b981;
      color: white;
      border: 2px solid #10b981;
    }

    .card-details-actions .card-action-btn--edit:hover:not(:disabled) {
      background: #059669;
      border-color: #059669;
      color: white;
    }

    @media (min-width: 769px) {
      .card-details-actions .card-action-btn {
        flex: 1;
        min-width: 0;
      }

      .card-details-actions .card-action-btn-label {
        display: inline;
      }

      .card-details-actions .card-action-btn--analytics-mobile {
        display: none;
      }
    }

    .line-clamp-2 {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .truncate {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .flex-1 {
      flex: 1;
    }

    .lg\:flex-row {
      flex-direction: column;
    }

    .lg\:max-w-md {
      max-width: 100%;
    }

    @media (min-width: 1024px) {
      .lg\:flex-row {
        flex-direction: row;
      }

      .lg\:max-w-md {
        max-width: 448px;
      }
    }

    /* Card Preview */
    .card-preview {
      border-radius: 16px;
      padding: 24px;
      background: linear-gradient(135deg, var(--card-bg, var(--primary-cta)) 0%, var(--card-bg-dark, #0052CC) 100%);
      color: white;
      min-height: 200px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
    }

    /* Live Card Preview Styles - From index.html success section */
    .success-card-preview {
      margin-top: 24px;
      display: flex;
      justify-content: center;
    }
    .business-card-preview {
      width: 100%;
      max-width: 375px;
    }
    .business-card-preview-inner {
      width: 100%;
      max-width: 375px;
      aspect-ratio: 375 / 501.6;
      border-radius: 24px;
      padding: 0 16px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      background-color: #026ce0;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
      box-sizing: border-box;
      position: relative;
    }
    .card-preview-header {
      display: flex;
      align-items: center;
      width: 100%;
      padding-top: 16px;
      height: 70px;
      margin-bottom: 14px;
      text-align: left;
      flex-shrink: 0;
      box-sizing: border-box;
    }
    .card-preview-logo-wrapper {
      width: 160px;
      height: 50px;
      max-width: 160px;
      min-width: 50px;
      border-radius: 8px;
      overflow: hidden;
      margin-right: 10px;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      flex-shrink: 0;
    }
    .card-preview-logo-wrapper:not(.has-logo) {
      width: 0;
      min-width: 0;
      overflow: hidden;
      margin-right: 0;
      padding: 0;
    }
    .card-preview-logo {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: left top;
    }
    .card-preview-main {
      display: flex;
      flex-direction: column;
      width: 100%;
      padding-top: 8px;
      margin-bottom: 14px;
      flex-shrink: 0;
      box-sizing: border-box;
    }
    .card-preview-name-block {
      width: 100%;
      text-align: left;
    }
    .card-preview-label {
      font-size: 12px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      opacity: 0.9;
      color: rgba(255, 255, 255, 0.92);
      margin-bottom: 4px;
      line-height: 1.2;
    }
    .card-preview-name {
      font-size: 24px;
      font-weight: 700;
      color: #ffffff;
      line-height: 1.2;
      text-align: left;
      word-wrap: break-word;
    }
    /* Secondary row: title only — matches pkpass secondaryFields */
    .business-card-preview-inner .card-preview-secondary-block:has(.card-preview-company) {
      display: none !important;
    }
    .card-preview-secondary-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      width: 100%;
      padding-top: 10px;
      gap: clamp(18px, 5vw, 28px);
      flex-shrink: 0;
      box-sizing: border-box;
    }
    .card-preview-secondary-block {
      flex: 1;
      min-width: 0;
      text-align: left;
    }
    /* Right column: stretch so .card-preview-field is full column width (aligned with create.html). */
    .card-preview-secondary-block:last-child {
      flex: 0 0 40%;
      max-width: 40%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: stretch;
    }
    .card-preview-field {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      align-self: stretch;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      text-align: left;
    }
    .card-preview-phone {
      font-size: 16px;
      color: #ffffff;
      line-height: 1.4;
      text-align: left;
      white-space: nowrap;
      overflow: hidden;
      min-width: 0;
      width: 100%;
    }
    .card-preview-title {
      font-size: 16px;
      font-weight: 400;
      color: #ffffff;
      text-align: left;
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      min-width: 0;
      width: 100%;
    }
    .card-preview-auxiliary-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      width: 100%;
      padding-top: 10px;
      margin-bottom: 20px;
      gap: clamp(18px, 5vw, 28px);
      flex-shrink: 0;
      box-sizing: border-box;
    }
    .card-preview-auxiliary-block {
      flex: 1;
      min-width: 0;
      text-align: left;
    }
    .card-preview-auxiliary-block:last-child {
      flex: 0 0 40%;
      max-width: 40%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: stretch;
    }
    .card-preview-email {
      font-size: 16px;
      color: #ffffff;
      line-height: 1.4;
      text-align: left;
      white-space: nowrap;
      overflow: hidden;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      letter-spacing: normal;
    }
    .card-preview-company {
      font-size: 16px;
      font-weight: 400;
      color: #ffffff;
      text-align: left;
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      min-width: 0;
      width: 100%;
    }
    .card-preview-qr-wrapper {
      margin-top: 20px;
      margin-bottom: 28px;
      padding-top: 16px;
      display: flex;
      flex-direction: column;
      align-items: center;
      flex-shrink: 0;
      width: 100%;
      box-sizing: border-box;
    }
    .card-preview-qr-placeholder {
      width: 130px;
      height: 130px;
      border-radius: 8px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 10px;
    }
    .card-preview-qr {
      width: 100%;
      height: 100%;
      object-fit: contain;
      border-radius: 4px;
    }
    .card-preview-qr-caption {
      margin-top: 6px;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.9);
      text-align: center;
    }

    .card-preview::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
      pointer-events: none;
    }

    .card-preview-content {
      position: relative;
      z-index: 1;
    }

    /* Modal */
    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 20px;
      transition: background-color 0.2s var(--ease-out);
    }

    .modal.show {
      display: flex;
      background: rgba(0, 0, 0, 0.5);
      animation: modalBackdropIn 0.2s var(--ease-out) forwards;
    }

    /* Employees management UI */
    .emp-filter-pill {
      padding: 6px 14px; border: 1px solid var(--border); background: #fff;
      border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-secondary);
      cursor: pointer; transition: all 0.15s ease; font-family: inherit;
    }
    .emp-filter-pill:hover { border-color: var(--primary-cta); color: var(--primary-cta); }
    .emp-filter-pill.active { background: var(--primary-cta); border-color: var(--primary-cta); color: #fff; }
    .emp-table th, .emp-table td { padding: 10px 8px; }
    .emp-table tbody tr { border-bottom: 1px solid var(--border); }
    .emp-table tbody tr:hover { background: #f8f9fa; }
    .emp-status-badge {
      display: inline-block; padding: 3px 10px; border-radius: 999px;
      font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
    }
    .emp-status-pending     { background: #f1f3f5; color: #495057; }      /* gray */
    .emp-status-invited     { background: #fff4e6; color: #e8590c; }      /* orange */
    .emp-status-activated   { background: #ebfbee; color: #2b8a3e; }      /* green */
    .emp-status-deactivated { background: #fff5f5; color: #c92a2a; }      /* red */
    .emp-action-btn {
      background: none; border: 1px solid var(--border); border-radius: 8px;
      width: 32px; height: 32px; cursor: pointer; color: var(--text-secondary);
      transition: all 0.15s ease; font-size: 13px;
    }
    .emp-action-btn:hover { border-color: var(--primary-cta); color: var(--primary-cta); }
    .emp-action-btn.danger:hover { border-color: #c92a2a; color: #c92a2a; }
    .emp-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

    /* Add to Home Screen bottom sheet (mobile only) */
    .a2hs-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.4);
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease-out;
    }
    .a2hs-backdrop.show {
      opacity: 1;
      pointer-events: auto;
    }
    .a2hs-sheet {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1001;
      background: #fff;
      border-radius: 16px 16px 0 0;
      transform: translateY(100%);
      transition: transform 0.25s ease-out;
      padding: 20px 20px 24px;
      padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
      box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
      max-height: 85vh;
      overflow-y: auto;
    }
    .a2hs-sheet.show {
      transform: translateY(0);
    }
    .a2hs-sheet-title {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 8px;
    }
    .a2hs-sheet-body {
      font-size: 0.9375rem;
      color: var(--text-secondary);
      margin-bottom: 20px;
      line-height: 1.5;
    }
    .a2hs-sheet-steps {
      list-style: decimal;
      padding-left: 1.25rem;
      margin: 0 0 20px;
      font-size: 0.9375rem;
      color: var(--text);
      line-height: 1.6;
    }
    .a2hs-sheet-steps li {
      margin-bottom: 6px;
    }
    .a2hs-sheet-actions {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .a2hs-sheet-actions .btn {
      width: 100%;
      justify-content: center;
    }
    .a2hs-view {
      display: none;
    }
    .a2hs-view.active {
      display: block;
    }
    .a2hs-dots {
      display: flex;
      gap: 6px;
      justify-content: center;
      margin-bottom: 14px;
    }
    .a2hs-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--border);
      transition: background 0.2s ease-out, width 0.2s ease-out, border-radius 0.2s ease-out;
    }
    .a2hs-dot.active {
      background: var(--primary);
      width: 18px;
      border-radius: 3px;
    }
    .a2hs-steps {
      position: relative;
      overflow: hidden;
    }
    .a2hs-step {
      display: none;
    }
    .a2hs-step.active {
      display: block;
      animation: a2hsStepIn 0.22s ease-out;
    }
    @keyframes a2hsStepIn {
      from { opacity: 0; transform: translateX(12px); }
      to { opacity: 1; transform: translateX(0); }
    }
    .a2hs-step-number {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--primary);
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .a2hs-sketch {
      background: var(--surface);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 200px;
      margin: 12px 0 20px;
    }
    .a2hs-sketch svg {
      width: 100%;
      max-width: 280px;
      height: auto;
      display: block;
    }
    .a2hs-step-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 4px;
      padding: 0 4px;
    }
    .a2hs-link-btn {
      background: none;
      border: none;
      padding: 8px 4px;
      color: var(--text-secondary);
      font-size: 0.9375rem;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
    }
    .a2hs-link-btn:hover {
      color: var(--text);
    }
    .a2hs-link-btn[hidden] {
      visibility: hidden;
      display: inline-block;
    }

    @keyframes modalBackdropIn {
      from { background-color: rgba(0, 0, 0, 0); }
      to { background-color: rgba(0, 0, 0, 0.5); }
    }

    .modal-content {
      background: white;
      border-radius: 20px;
      padding: 24px;
      max-width: 600px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: var(--shadow-xl);
      animation: modalContentIn 0.2s var(--ease-out) forwards;
    }

    @keyframes modalContentIn {
      from {
        opacity: 0;
        transform: scale(0.98);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    /* ── Edit Card — full-page dashboard-style overlay ── */
    .edit-card-fullpage {
      position: fixed;
      inset: 0;
      background: var(--surface);
      z-index: 1000;
      display: none;
      flex-direction: column;
    }
    .edit-card-fullpage.show {
      display: flex;
    }

    /* Sticky top header */
    .ec-header {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 24px;
      background: white;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 10;
    }
    .ec-header-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
    }
    .ec-header-title i {
      color: var(--primary-cta);
    }
    .ec-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Body: sidebar + content */
    /* min-height: 0 is required here — flex items default to min-height: auto which
       prevents children from shrinking, breaking the inner scroll chain. Do not remove. */
    .ec-body {
      display: flex;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }

    /* Left sidebar */
    .ec-sidebar {
      flex-shrink: 0;
      width: 220px;
      background: white;
      border-right: 1px solid var(--border);
      padding: 20px 0;
      overflow-y: auto;
    }
    .ec-nav {
      padding: 0 12px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .ec-nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      border-radius: 10px;
      color: var(--text-secondary);
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
      transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
      box-shadow: inset 3px 0 0 transparent;
    }
    .ec-nav-item:hover {
      background: rgba(0, 102, 255, 0.06);
      color: var(--text);
    }
    .ec-nav-item.active {
      background: rgba(0, 102, 255, 0.1);
      color: var(--primary-cta);
      font-weight: 600;
      box-shadow: inset 3px 0 0 var(--primary-cta);
    }
    .ec-nav-item i {
      width: 18px;
      text-align: center;
      font-size: 15px;
    }

    /* Individual section panels */
    .ec-section {
      display: none;
      max-width: 640px;
    }
    .ec-section.active {
      display: block;
    }
    .ec-section-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Content wrapper (form + sticky footer) */
    /* min-height: 0 is required here — without it this flex child expands to content height,
       destroying .ec-content's bounded scroll container. Do not remove. */
    .ec-content-wrapper {
      flex: 3 1 0;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    /* Sole vertical scroll container for this overlay.
       Do NOT add overflow-y: auto/scroll to any ancestor inside .edit-card-fullpage.
       Any new intermediate wrapper must follow: display:flex, flex-direction:column,
       flex:1, min-height:0, overflow:hidden. */
    .ec-content {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 32px;
    }
    /* Mobile/tablet-only controls (hidden on desktop ≥1280px) */
    .ec-section-menu-btn,
    .ec-mobile-section-title,
    .ec-preview-btn,
    .ec-sheet-backdrop,
    .ec-section-sheet,
    .ec-preview-close-btn {
      display: none;
    }
    .ec-header-title--desktop {
      display: flex;
    }
    .ec-footer-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    /* Close button: hidden on desktop, shown on mobile/tablet via @media */
    .ec-header-close-btn {
      display: none;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: none;
      background: transparent;
      border-radius: 8px;
      color: var(--text-secondary);
      font-size: 18px;
      cursor: pointer;
      flex-shrink: 0;
      transition: background-color 0.15s, color 0.15s;
    }
    .ec-header-close-btn:hover {
      background: rgba(0, 0, 0, 0.06);
      color: var(--text);
    }
    .ec-footer {
      flex-shrink: 0;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 14px 32px;
      background: white;
      border-top: 1px solid var(--border);
    }

    /* Live Preview panel (~40% of body width beside sidebar; form column ~60%) */
    .ec-preview-panel {
      flex: 2 1 0;
      min-width: 0;
      min-height: 0;
      border-left: 1px solid var(--border);
      background: var(--surface);
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .ec-preview-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .ec-preview-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .ec-preview-toggle {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-secondary);
      font-size: 14px;
      padding: 4px;
      border-radius: 4px;
      transition: color 0.15s;
    }
    .ec-preview-toggle:hover { color: var(--text); }
    .ec-preview-card-scale {
      width: 100%;
      max-width: none;
      margin: 0 auto;
      overflow: visible;
    }
    /* Fill the preview column width; inner card is 80% (20% smaller), centered */
    #editCardPreview.business-card-preview,
    #batchCreateSection .ec-preview-panel .business-card-preview {
      max-width: none;
      width: 100%;
      transform: none;
    }
    /* Edit overlay + Batch Create live preview: 20% smaller than full column width, centered */
    #editCardPreview .business-card-preview-inner,
    #enterpriseTemplateCardPreview.business-card-preview-inner {
      max-width: none;
      width: 80%;
      margin-left: auto;
      margin-right: auto;
    }

    /* Country code dropdown */
    .ec-country-select {
      position: relative;
    }
    .ec-country-trigger {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: white;
      cursor: pointer;
      font-size: 14px;
      color: var(--text);
      transition: border-color 0.15s;
    }
    .ec-country-trigger:hover,
    .ec-country-trigger:focus { border-color: var(--primary-cta); outline: none; }
    .ec-country-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.12);
      z-index: 100;
      overflow: hidden;
    }
    .ec-country-search {
      width: 100%;
      padding: 10px 12px;
      border: none;
      border-bottom: 1px solid var(--border);
      font-size: 16px;
      outline: none;
    }
    .ec-country-list {
      max-height: 220px;
      overflow-y: auto;
      list-style: none;
      margin: 0;
      padding: 4px 0;
    }
    .ec-country-option {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      cursor: pointer;
      font-size: 14px;
      color: var(--text);
    }
    .ec-country-option:hover { background: rgba(0,102,255,0.06); }
    .ec-country-option .ec-opt-dial {
      margin-left: auto;
      color: var(--text-secondary);
      font-size: 13px;
      font-family: monospace;
    }

    /* Mobile + tablet: step-based flow (desktop ≥1280px unchanged) */
    @media (max-width: 1279px) {
      .ec-sidebar {
        display: none;
      }
      .ec-header-title--desktop {
        display: none;
      }
      .ec-section-menu-btn,
      .ec-mobile-section-title,
      .ec-preview-btn,
      .ec-header-close-btn,
      .ec-preview-close-btn {
        display: flex;
      }
      .ec-mobile-section-title {
        flex: 1;
        min-width: 0;
        font-size: 17px;
        font-weight: 700;
        color: var(--text);
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 8px;
      }
      .ec-section-menu-btn {
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        color: var(--text);
        font-size: 18px;
        cursor: pointer;
        border-radius: 8px;
        flex-shrink: 0;
        transition: background-color 0.15s;
      }
      .ec-section-menu-btn:hover,
      .ec-section-menu-btn:active {
        background: rgba(0, 102, 255, 0.08);
      }
      .ec-header {
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        padding-bottom: 12px;
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
      }
      .ec-content-wrapper {
        flex: 1 1 0;
      }
      .ec-content {
        padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
        -webkit-overflow-scrolling: touch;
        -webkit-tap-highlight-color: transparent;
      }
      .ec-content input,
      .ec-content select,
      .ec-content textarea {
        scroll-margin-bottom: 120px;
      }

      /* Shrink edit overlay above keyboard so Save/Cancel stays visible */
      body.keyboard-open .edit-card-fullpage {
        bottom: var(--keyboard-inset, 0px);
      }

      body.keyboard-open .dashboard-header {
        position: static;
      }

      .ec-section {
        max-width: none;
      }
      .ec-section-title {
        display: none;
      }
      .ec-footer {
        flex-direction: column;
        gap: 10px;
        padding-top: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
      }
      .ec-preview-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
      }
      .ec-footer-actions {
        display: flex;
        gap: 10px;
        width: 100%;
      }
      .ec-footer-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
      }
      /* Inline preview hidden; shown as fullscreen overlay when .ec-preview-open */
      .ec-preview-panel {
        display: none;
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 30;
        border-left: none;
        padding: 0;
        background: var(--surface);
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-panel-header {
        flex-shrink: 0;
        padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
        background: white;
        border-bottom: 1px solid var(--border);
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-label {
        font-size: 17px;
        font-weight: 700;
        text-transform: none;
        letter-spacing: normal;
        color: var(--text);
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-toggle {
        display: none;
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-close-btn {
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
        border-radius: 8px;
        margin-left: auto;
      }
      .edit-card-fullpage.ec-preview-open .ec-preview-card-scale {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        -webkit-overflow-scrolling: touch;
      }
      .edit-card-fullpage.ec-preview-open #editCardPreview.business-card-preview {
        max-width: 420px;
        margin: 0 auto;
      }
      .edit-card-fullpage.ec-preview-open #editCardPreview .business-card-preview-inner {
        width: 100%;
      }
      /* Section picker bottom sheet */
      .ec-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 25;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease-out;
      }
      .ec-sheet-backdrop.show {
        opacity: 1;
        pointer-events: auto;
      }
      .ec-section-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 26;
        background: #fff;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.25s ease-out;
        padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
        max-height: 70vh;
        overflow-y: auto;
      }
      .ec-section-sheet.show {
        transform: translateY(0);
      }
      .ec-section-sheet-handle {
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 0 auto 16px;
      }
      .ec-section-sheet-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 12px;
        padding: 0 4px;
      }
      .ec-sheet-nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .ec-sheet-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-radius: 12px;
        color: var(--text);
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        border: none;
        background: transparent;
        width: 100%;
        text-align: left;
        transition: background-color 0.15s;
      }
      .ec-sheet-nav-item:hover,
      .ec-sheet-nav-item:active {
        background: rgba(0, 102, 255, 0.06);
      }
      .ec-sheet-nav-item.active {
        background: rgba(0, 102, 255, 0.1);
        color: var(--primary-cta);
        font-weight: 600;
      }
      .ec-sheet-nav-item i:first-child {
        width: 20px;
        text-align: center;
        font-size: 16px;
        color: var(--primary-cta);
      }
      .ec-sheet-nav-item .ec-sheet-check {
        margin-left: auto;
        font-size: 14px;
        color: var(--primary-cta);
        opacity: 0;
      }
      .ec-sheet-nav-item.active .ec-sheet-check {
        opacity: 1;
      }
    }

    /* Batch Create — fullpage overlay (reuses .edit-card-fullpage + .ec-* layout) */
    #batchCreateSection .bc-section { display: none; }
    #batchCreateSection .bc-section.active { display: block; }
    /* Always show the header close button (no save/cancel footer like Edit Card) */
    #batchCreateSection .ec-header-close-btn {
      display: flex;
    }
    #batchCreateSection .bc-mobile-footer {
      display: none;
      flex-shrink: 0;
      padding: 14px 32px;
      background: white;
      border-top: 1px solid var(--border);
    }
    @media (min-width: 1280px) {
      #batchCreateSection .bc-mobile-footer { display: none !important; }
      #batchCreateSection .ec-preview-close-btn { display: none; }
    }
    @media (max-width: 1279px) {
      #navBatchCreateCardsBtn,
      #settingsEnterpriseItems {
        display: none !important;
      }
      #batchCreateSection .bc-mobile-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
      }
      #batchCreateSection .bc-mobile-footer .ec-preview-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
      }
      #batchCreateSection .ec-content input,
      #batchCreateSection .ec-content select,
      #batchCreateSection .ec-content textarea {
        scroll-margin-bottom: 120px;
      }
      #batchCreateSection .ec-section-sheet {
        z-index: 61;
        padding-bottom: calc(20px + 64px + env(safe-area-inset-bottom, 0px));
      }
      #batchCreateSection .ec-sheet-backdrop { z-index: 60; }
      #batchCreateSection.bc-preview-open .ec-preview-panel {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 70;
        border-left: none;
        padding: 0;
        background: var(--surface);
      }
      #batchCreateSection.bc-preview-open .ec-preview-panel-header {
        flex-shrink: 0;
        padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
        background: white;
        border-bottom: 1px solid var(--border);
      }
      #batchCreateSection.bc-preview-open .ec-preview-label {
        font-size: 17px;
        font-weight: 700;
        text-transform: none;
        letter-spacing: normal;
        color: var(--text);
      }
      #batchCreateSection.bc-preview-open .ec-preview-toggle { display: none; }
      #batchCreateSection.bc-preview-open .ec-preview-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
        border-radius: 8px;
        margin-left: auto;
      }
      #batchCreateSection.bc-preview-open .ec-preview-card-scale {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        -webkit-overflow-scrolling: touch;
      }
      #batchCreateSection.bc-preview-open .ec-preview-panel .business-card-preview {
        max-width: 420px;
        margin: 0 auto;
      }
      #batchCreateSection.bc-preview-open #enterpriseTemplateCardPreview.business-card-preview-inner {
        width: 100%;
      }
    }
    .bc-section-header {
      margin-bottom: 20px;
    }
    .bc-section-header-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
      display: inline;
    }
    .bc-section-header-desc {
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 8px;
      line-height: 1.5;
    }
    .bc-badge {
      display: inline-block;
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 9999px;
      background: rgba(0, 102, 255, 0.08);
      color: var(--primary-cta);
      margin-left: 8px;
      vertical-align: middle;
    }
    .bc-control-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
    }
    .bc-control-card + .bc-control-card {
      margin-top: 16px;
    }
    .bc-control-card-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 4px;
    }
    .bc-control-card-desc {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 16px;
      line-height: 1.45;
    }
    .bc-upload-dropzone {
      min-height: 140px;
      padding: 28px 20px;
      border: 2px dashed var(--border);
      border-radius: 12px;
      background: white;
      text-align: center;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s;
    }
    .bc-upload-dropzone:hover {
      border-color: var(--primary-cta);
      background: rgba(0, 102, 255, 0.04);
    }
    .bc-upload-dropzone.has-logo {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .bc-logo-dropzone-img {
      max-width: 200px;
      max-height: 72px;
      object-fit: contain;
      display: block;
      pointer-events: none;
    }
    .bc-logo-remove-link {
      display: block;
      margin-top: 10px;
      font-size: 13px;
      color: var(--text-secondary);
      background: none;
      border: none;
      cursor: pointer;
      text-decoration: underline;
      padding: 0;
      text-align: center;
      width: 100%;
    }
    .bc-logo-remove-link:hover {
      color: var(--text);
    }
    .bc-color-field {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .bc-color-field + .bc-color-field {
      margin-top: 16px;
    }
    .bc-color-field label {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }
    .bc-color-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .bc-color-row input[type="color"] {
      width: 48px;
      height: 36px;
      border-radius: 8px;
      cursor: pointer;
      border: 1px solid var(--border);
      padding: 2px;
    }
    .bc-color-hex {
      font-size: 13px;
      font-family: ui-monospace, monospace;
      color: var(--text-secondary);
    }
    .bc-file-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: white;
    }
    .bc-file-card-icon {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: rgba(16, 185, 129, 0.12);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--success);
      font-size: 18px;
    }
    .bc-last-file-card {
      padding: 16px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: var(--surface);
      margin-bottom: 20px;
    }

    @media (max-width: 639px) {
      #batchCreateSection .bc-upload-actions .btn {
        width: 100%;
      }
    }

    .share-option-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border: 1px solid var(--border);
      border-radius: 12px;
      text-decoration: none;
      color: var(--text);
      font-size: 16px;
      font-weight: 500;
      transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }
    .share-option-row:hover {
      background: rgba(0, 102, 255, 0.04);
      border-color: #c5cad6;
    }
    .share-option-row span {
      flex: 1;
    }

    /* Spinner */
    .spinner {
      border: 3px solid rgba(0, 102, 255, 0.12);
      border-top: 3px solid var(--primary-cta);
      border-radius: 50%;
      width: 24px;
      height: 24px;
      animation: spin 1s linear infinite;
      display: inline-block;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .spinner-lg {
      width: 40px;
      height: 40px;
      border-width: 4px;
    }

    /* Alert */
    .alert {
      padding: 16px 20px;
      border-radius: 12px;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      font-weight: 500;
      animation: slideDown 0.2s var(--ease-out);
    }

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

    .alert-error {
      background: #FEF2F2;
      color: #991B1B;
      border: 2px solid #FECACA;
    }

    .alert-success {
      background: #F0FDF4;
      color: #166534;
      border: 2px solid #BBF7D0;
    }

    .alert-warning {
      background: #FFFBEB;
      color: #92400E;
      border: 2px solid #FDE68A;
    }

    .alert-info {
      background: #EFF6FF;
      color: #1E40AF;
      border: 2px solid #BFDBFE;
    }

    /* Tab Navigation */
    .tab-button {
      padding: 10px 16px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-weight: 600;
      cursor: pointer;
      border-bottom: 3px solid transparent;
      transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
      font-size: 14px;
    }

    .tab-button.active {
      color: var(--primary-cta);
      border-bottom-color: var(--primary-cta);
    }

    .tab-button:hover:not(.active) {
      color: var(--text);
    }

    /* Stats Card */
    .stat-card {
      background: white;
      border-radius: 16px;
      padding: 24px;
      border: 1px solid var(--border);
      transition: box-shadow var(--transition-ui), transform var(--transition-fast);
      position: relative;
      overflow: hidden;
    }

    .stat-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: linear-gradient(to bottom, var(--stat-color, var(--primary-cta)), transparent);
    }

    .stat-card:hover {
      box-shadow: 0 8px 20px -4px rgb(0 0 0 / 0.1);
      transform: translateY(-1px);
    }

    .stat-card .stat-icon {
      width: 56px;
      height: 56px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      margin-bottom: 16px;
    }

    /* Header */
    .header {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    /* Empty State */
    .empty-state {
      text-align: center;
      padding: 48px 20px;
    }

    .empty-state-icon {
      font-size: 24px;
      margin-bottom: 24px;
      opacity: 0.3;
    }

    /* Mobile: balance the no-cards empty state in the viewport */
    @media (max-width: 768px) {
      #emptyState:not(.hidden) {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: calc(100dvh - 152px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        padding: clamp(48px, 12vh, 96px) 0 clamp(32px, 6vh, 64px);
        box-sizing: border-box;
      }

      #emptyState:not(.hidden) .empty-state {
        width: 100%;
      }
    }

    /* Skeleton Loading */
    .skeleton {
      background: linear-gradient(90deg, #f0f0f0 25%, #e8e8ea 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: loading 2s ease-in-out infinite;
      border-radius: 8px;
    }

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

    /* Tooltip */
    .tooltip {
      position: relative;
      display: inline-block;
    }

    .tooltip .tooltiptext {
      visibility: hidden;
      background-color: #333;
      color: #fff;
      text-align: center;
      border-radius: 6px;
      padding: 8px 12px;
      position: absolute;
      z-index: 1;
      bottom: 125%;
      left: 50%;
      transform: translateX(-50%);
      opacity: 0;
      transition: opacity 0.3s;
      font-size: 12px;
      white-space: nowrap;
    }

    .tooltip:hover .tooltiptext {
      visibility: visible;
      opacity: 1;
    }

    /* Responsive */
    @media (max-width: 768px) {
      .card {
        padding: 16px;
      }

      .modal-content {
        padding: 24px;
      }

      .stat-card {
        padding: 20px;
      }

      .btn {
        padding: 10px 16px;
        font-size: 14px;
      }
    }

    /* Gradient Text */
    .gradient-text {
      background: linear-gradient(135deg, #1a1c1e 0%, var(--primary-cta) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    /* Card list — typography (titles, metadata, stats) */
    .card-details-header .text-sm.text-gray-600.mb-3 {
      font-size: 16px;
      color: var(--text);
      font-style: normal;
      margin-bottom: 8px !important;
    }
    .card-details-header .flex.items-center.gap-2.text-sm {
      font-size: 16px;
      color: var(--text);
    }
    .card-details-header .flex.items-start.gap-2.text-sm {
      font-size: 14px;
      color: var(--text-secondary);
    }

    /* Mobile: hide extra fields in card-details-section, keep actions only */
    @media (max-width: 767px) {
      .card-details-extra {
        display: none !important;
      }
      .card-details-header .text-sm.text-gray-600.mb-3,
      .card-details-header .flex.items-center.gap-2.text-gray-600,
      .card-details-header .flex.items-start.gap-2.text-gray-600 {
        display: none !important;
      }
      /* Header has no visible content on mobile — remove its padding/border ghost space */
      .card-details-header {
        padding-bottom: 0;
        border-bottom: none;
        display: none;
      }
      /* Tighten the flex gap between section children */
      .card-details-section {
        gap: 8px;
      }
    }

    .input-mono {
      background: var(--surface);
      font-family: inherit;
    }

    /* ===== Card Search Modal (slide-from-top) ===== */
    .card-search-overlay {
      position: fixed;
      inset: 0;
      z-index: 600;
      pointer-events: none;
    }

    .card-search-overlay.open {
      pointer-events: all;
    }

    .card-search-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0);
      transition: background 0.25s ease;
    }

    .card-search-overlay.open .card-search-backdrop {
      background: rgba(0, 0, 0, 0.32);
    }

    .card-search-panel {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      background: var(--background);
      border-bottom: 2px solid var(--primary-cta);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
      padding: 14px 20px;
      transform: translateY(-110%);
      transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
      z-index: 1;
    }

    .card-search-overlay.open .card-search-panel {
      transform: translateY(0);
    }

    .card-search-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .card-search-input-wrap {
      position: relative;
      flex: 1;
    }

    .card-search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-secondary);
      font-size: 14px;
      pointer-events: none;
    }

    .card-search-input {
      width: 100%;
      padding: 12px 40px 12px 42px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      font-size: 16px;
      color: var(--text);
      font-family: inherit;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
      outline: none;
    }

    .card-search-input:focus {
      border-color: var(--primary-cta);
      box-shadow: var(--focus-ring);
      background: var(--background);
    }

    .card-search-clear {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 4px 6px;
      border-radius: 6px;
      font-size: 13px;
      transition: color var(--transition-fast);
    }

    .card-search-clear:hover { color: var(--text); }

    .card-search-sort-wrap {
      flex-shrink: 0;
    }

    .card-search-sort-select {
      padding: 10px 14px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      font-size: 16px;
      color: var(--text);
      font-family: inherit;
      cursor: pointer;
      outline: none;
      transition: border-color var(--transition-fast);
    }

    .card-search-sort-select:focus {
      border-color: var(--primary-cta);
    }

    .card-search-done-btn {
      flex-shrink: 0;
      padding: 10px 18px;
      border-radius: 12px;
      background: var(--primary-cta);
      color: white;
      border: none;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: opacity var(--transition-fast);
    }

    .card-search-done-btn:hover { opacity: 0.88; }

    @media (max-width: 480px) {
      .card-search-sort-wrap { display: none; }
      .card-search-done-btn { padding: 10px 14px; font-size: 13px; }
    }

    /* Search Bar */
    .search-bar {
      position: relative;
    }

    .search-bar input {
      padding-left: 44px;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    }

    .search-bar input:focus {
      outline: none;
      border-color: var(--primary-cta);
      box-shadow: var(--focus-ring);
    }

    .search-bar input:hover:not(:focus) {
      border-color: #c5cad6;
    }

    .search-bar i {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-secondary);
    }

    /* ===== Analytics Modal ===== */
    @keyframes analyticsSlideUp {
      from { opacity: 0; transform: translateY(28px) scale(0.97); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    #analyticsModal .analytics-modal-content {
      background: var(--surface);
      border-radius: 20px;
      width: 100%;
      max-width: 520px;
      margin: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,0.20);
      overflow: hidden;
      animation: analyticsSlideUp 0.3s ease;
    }

    .analytics-modal-header {
      background: linear-gradient(135deg, #0052CC 0%, var(--primary-cta) 100%);
      padding: 22px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: white;
    }

    .analytics-modal-header-text {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .analytics-modal-icon-wrap {
      width: 44px;
      height: 44px;
      background: rgba(255,255,255,0.18);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }

    .analytics-modal-title {
      font-size: 19px;
      font-weight: 700;
      color: white;
      margin: 0;
    }

    .analytics-modal-subtitle {
      font-size: 13px;
      color: rgba(255,255,255,0.75);
      margin: 3px 0 0;
    }

    .analytics-close-btn {
      background: rgba(255,255,255,0.15);
      border: none;
      color: white;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      transition: background var(--transition-fast);
      flex-shrink: 0;
    }

    .analytics-close-btn:hover { background: rgba(255,255,255,0.28); }

    .analytics-overview-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      padding: 20px 20px 0;
    }

    @media (max-width: 480px) {
      .analytics-overview-grid { grid-template-columns: 1fr; gap: 10px; }
    }

    .analytics-metric-card {
      background: var(--background);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px 12px;
      display: flex;
      align-items: center;
      gap: 11px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    }

    .analytics-metric-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0,0,0,0.09);
    }

    .analytics-metric-card.am-highlight {
      border-color: var(--primary-cta);
      background: rgba(0,102,255,0.04);
    }

    .metric-icon {
      width: 36px;
      height: 36px;
      background: rgba(0,102,255,0.10);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary-cta);
      font-size: 15px;
      flex-shrink: 0;
    }

    .metric-label {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin-bottom: 3px;
    }

    .metric-value {
      font-size: 22px;
      font-weight: 800;
      color: var(--text);
      line-height: 1.2;
    }

    .analytics-last-activity {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 14px 20px 0;
      padding: 10px 14px;
      font-size: 13px;
      color: var(--text-secondary);
      background: var(--background);
      border: 1px solid var(--border);
      border-radius: 10px;
    }

    .analytics-chart-section { padding: 18px 20px 20px; }

    .analytics-chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
    }

    .analytics-chart-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }

    .analytics-chart-badge {
      font-size: 11px;
      font-weight: 600;
      background: rgba(0,102,255,0.08);
      color: var(--primary-cta);
      padding: 3px 10px;
      border-radius: 20px;
    }

    .analytics-empty-state {
      text-align: center;
      padding: 30px 16px;
      color: var(--text-secondary);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }

    .analytics-empty-state i { font-size: 32px; opacity: 0.3; }

    .analytics-empty-state p {
      font-size: 13px;
      max-width: 260px;
      line-height: 1.6;
    }

    /* ===== Analytics Upgrade Modal ===== */
    .analytics-upgrade-content {
      background: var(--surface);
      border-radius: 20px;
      width: 100%;
      max-width: 400px;
      margin: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,0.20);
      overflow: hidden;
      animation: analyticsSlideUp 0.3s ease;
    }

    .analytics-upgrade-accent {
      height: 5px;
      background: linear-gradient(90deg, #0052CC 0%, var(--primary-cta) 100%);
    }

    .analytics-upgrade-body {
      padding: 32px 28px;
      text-align: center;
    }

    .analytics-upgrade-icon {
      width: 64px;
      height: 64px;
      background: linear-gradient(135deg, #0052CC 0%, var(--primary-cta) 100%);
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 20px;
      font-size: 26px;
      color: white;
      box-shadow: 0 8px 24px rgba(0,102,255,0.30);
    }

    .analytics-upgrade-content h2 {
      font-size: 22px;
      font-weight: 800;
      color: var(--text);
      margin-bottom: 10px;
    }

    .analytics-upgrade-content > .analytics-upgrade-body > p {
      font-size: 14px;
      color: var(--text-secondary);
      line-height: 1.65;
      margin-bottom: 20px;
    }

    .analytics-upgrade-features {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 24px;
      text-align: left;
    }

    .analytics-upgrade-feature {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 14px;
      color: var(--text);
      font-weight: 500;
    }

    .analytics-upgrade-feature i {
      color: var(--primary-cta);
      font-size: 13px;
      width: 16px;
      flex-shrink: 0;
    }

    .analytics-upgrade-cta {
      width: 100%;
      padding: 14px;
      font-size: 15px;
      font-weight: 700;
      border-radius: 12px;
      margin-bottom: 10px;
    }

    .analytics-upgrade-later {
      width: 100%;
      font-size: 14px;
      color: var(--text-secondary);
    }

    /* Filter Pills */
    .filter-pill {
      padding: 8px 16px;
      border-radius: 20px;
      border: 2px solid var(--border);
      background: white;
      color: var(--text);
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }

    .filter-pill:hover {
      border-color: var(--primary-cta);
      color: var(--primary-cta);
      background: rgba(0, 102, 255, 0.04);
    }

    .filter-pill.active {
      background: var(--primary-cta);
      color: white;
      border-color: var(--primary-cta);
    }

    /* Action Menu */
    .action-menu {
      position: relative;
    }

    .action-menu-content {
      display: none;
      position: absolute;
      right: 0;
      top: 100%;
      margin-top: 8px;
      background: white;
      border-radius: 12px;
      box-shadow: var(--shadow-lg);
      min-width: 200px;
      z-index: 100;
      overflow: hidden;
      border: 1px solid var(--border);
    }

    .action-menu-content.show {
      display: block;
      animation: slideDown 0.2s ease;
    }

    .action-menu-item {
      padding: 12px 16px;
      cursor: pointer;
      transition: background-color var(--transition-fast);
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      color: var(--text);
    }

    .action-menu-item:hover {
      background: rgba(0, 102, 255, 0.06);
    }

    .action-menu-item i {
      width: 20px;
      text-align: center;
    }

    /* Progress Bar */
    .progress-bar {
      width: 100%;
      height: 6px;
      background: var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--primary-cta) 0%, var(--primary-light) 100%);
      border-radius: 10px;
      transition: width 0.3s ease;
    }

    /* Auth / Login screen */
    .auth-screen { min-height: 100vh; min-height: 100dvh; background: var(--background); }
    .auth-screen-layout { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
    .auth-split-left { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; max-width: 480px; width: 100%; margin: 0 auto; }
    .auth-split-right { display: none; }
    .auth-brand-logo-wrap { margin-bottom: 32px; max-width: 100%; }
    .auth-brand-logo { display: block; width: min(260px, 72vw); max-width: 100%; height: auto; object-fit: contain; }
    .auth-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.28em; font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; margin-bottom: 32px; line-height: 1.2; }
    .auth-heading span { display: block; }
    .auth-heading-accent { color: var(--primary-cta); }
    .auth-heading-wordmark { height: 0.9em; width: auto; display: block; padding-bottom: 2px; }
    .auth-subheading { font-size: 15px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.5; }
    .auth-subheading a { color: var(--primary-cta); font-weight: 600; text-decoration: none; }
    .auth-subheading a:hover { text-decoration: underline; }
    .auth-social-btn { width: 100%; min-height: 52px; padding: 14px 20px; border-radius: 9999px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s var(--ease-out), opacity var(--transition-fast); }
    .auth-social-btn:active:not(:disabled) { transform: scale(0.98); }
    .auth-social-btn:disabled { opacity: 0.6; cursor: not-allowed; }
    .auth-social-btn-google { background: #fff; color: var(--text); border: 1.5px solid var(--border); margin-bottom: 12px; }
    .auth-social-btn-google:hover:not(:disabled) { border-color: #c5cad6; box-shadow: var(--shadow-sm); }
    .auth-social-btn-apple { background: #000; color: #fff; border: 1.5px solid #000; }
    .auth-social-btn-apple:hover:not(:disabled) { background: #1a1a1a; }
    .auth-social-btn-apple.hidden { display: none; }
    .auth-divider { position: relative; text-align: center; margin: 24px 0; }
    .auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
    .auth-divider span { position: relative; background: var(--background); padding: 0 14px; color: var(--text-secondary); font-size: 13px; font-weight: 500; text-transform: lowercase; }
    .auth-field-group { margin-bottom: 16px; }
    .auth-field-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
    .auth-input { width: 100%; padding: 16px 20px; border: 1.5px solid var(--border); border-radius: 9999px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--background); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
    .auth-input:hover:not(:focus):not(.input-error) { border-color: #c5cad6; }
    .auth-input:focus { outline: none; border-color: var(--primary-cta); box-shadow: var(--focus-ring); }
    .auth-input.input-error { border-color: var(--error); background-color: #fffafa; }
    .auth-password-wrap { position: relative; }
    .auth-password-wrap .auth-input { padding-right: 52px; }
    .auth-password-toggle { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 6px; line-height: 0; border-radius: 8px; }
    .auth-password-toggle:hover { color: var(--primary-cta); }
    .auth-field-error { font-size: 12px; color: var(--error); margin-top: 6px; padding-left: 20px; }
    .auth-field-error.hidden { display: none; }
    .auth-submit-btn { width: 100%; min-height: 52px; margin-top: 8px; padding: 14px 20px; border-radius: 9999px; font-size: 16px; font-weight: 600; font-family: inherit; border: none; cursor: pointer; background: var(--primary-cta); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 8px rgba(0, 102, 255, 0.22); transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s var(--ease-out), opacity var(--transition-fast); }
    .auth-submit-btn:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(0, 102, 255, 0.28); }
    .auth-submit-btn:active:not(:disabled) { transform: scale(0.98); }
    .auth-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }
    .auth-terms-text { margin-top: 20px; font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.5; }
    .auth-terms-text a { color: var(--primary-cta); text-decoration: underline; }
    #authScreen .alert { margin-bottom: 20px; border-radius: 12px; }
    .auth-promo-panel { text-align: center; color: #fff; max-width: 600px; width: 100%; padding: 0 56px; }
    .auth-promo-rotator { position: relative; display: grid; min-height: 4.2em; place-items: center; }
    .auth-promo-headline {
      grid-area: 1 / 1;
      font-size: clamp(34px, 3.4vw, 52px);
      font-weight: 700;
      line-height: 1.18;
      letter-spacing: -0.03em;
      text-wrap: balance;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.9s var(--ease-out, ease), transform 0.9s var(--ease-out, ease);
      pointer-events: none;
    }
    .auth-promo-headline.is-active { opacity: 1; transform: translateY(0); }
    @media (min-width: 1024px) {
      .auth-screen-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
      .auth-split-left { max-width: none; margin: 0; padding: 48px 64px; }
      .auth-split-right {
        display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
        background: linear-gradient(135deg, #001f66 0%, #0039a6 28%, #0066FF 60%, #3d8bff 100%);
        background-size: 220% 220%;
        animation: authPromoGradient 18s ease-in-out infinite;
      }
      .auth-split-right::before {
        content: ''; position: absolute; width: 90%; padding-bottom: 90%; border-radius: 50%;
        bottom: -28%; left: -18%;
        background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 70%);
        animation: authPromoFloat 16s ease-in-out infinite;
      }
      .auth-split-right::after {
        content: ''; position: absolute; width: 70%; padding-bottom: 70%; border-radius: 50%;
        top: -20%; right: -16%;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
        animation: authPromoFloat 20s ease-in-out infinite reverse;
      }
      .auth-promo-panel { position: relative; z-index: 1; }
      .auth-heading { font-size: 32px; }
    }
    @keyframes authPromoGradient {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }
    @keyframes authPromoFloat {
      0% { transform: translate(0, 0); }
      50% { transform: translate(3%, -4%); }
      100% { transform: translate(0, 0); }
    }
    @media (prefers-reduced-motion: reduce) {
      .auth-split-right, .auth-split-right::before, .auth-split-right::after { animation: none; }
      .auth-promo-headline { transition: opacity 0.3s ease; transform: none; }
      .auth-promo-headline.is-active { transform: none; }
    }

    /* Forgot Password link under the login password field */
    .auth-forgot-row { display: flex; justify-content: flex-end; margin-top: 8px; }
    .auth-forgot-link {
      background: none; border: 0; padding: 0; cursor: pointer;
      font-family: inherit; font-size: 13px; font-weight: 600;
      color: var(--primary-cta);
    }
    .auth-forgot-link:hover { text-decoration: underline; }
    .auth-forgot-link:focus-visible { outline: 2px solid var(--primary-cta); outline-offset: 3px; border-radius: 4px; }

    /* Reset Password modal — close button + success state */
    #forgotPasswordModal .modal-content { position: relative; }
    .forgot-close-btn {
      position: absolute; top: 16px; right: 16px;
      width: 36px; height: 36px;
      display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: 0; border-radius: 50%;
      color: var(--text-secondary); cursor: pointer;
      transition: background-color var(--transition-fast), color var(--transition-fast);
    }
    .forgot-close-btn:hover { background: var(--surface); color: var(--text); }
    .forgot-success-state { display: none; text-align: center; padding: 8px 0 4px; }
    .forgot-success-state.show { display: block; }
    .forgot-success-icon {
      width: 64px; height: 64px; border-radius: 50%;
      background: #ecfdf5; color: var(--success);
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 28px; margin-bottom: 16px;
    }

    .share-link-input {
      font-size: 16px;
      font-family: inherit;
      /* Allow the input to shrink inside the flex row and truncate long links
         so the link + Copy button always fit inside the modal. */
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Hide the native up/down number spinners on the Enterprise seat input;
       the minus / plus buttons handle seat changes instead. */
    #enterpriseSeatsInput {
      -moz-appearance: textfield;
      appearance: textfield;
    }
    #enterpriseSeatsInput::-webkit-outer-spin-button,
    #enterpriseSeatsInput::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    /* iOS Safari: prevent auto-zoom on input focus (computed font-size must be >= 16px) */
    @supports (-webkit-touch-callout: none) {
      html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="image"]):not([type="hidden"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
      html body textarea,
      html body select {
        font-size: 16px !important;
      }
    }
