/* ==========================================
   BENEFIQ -- WALLET/CARDS PAGE
   3D Rolodex anchor view, stat row,
   grid toggle, add card modal
   ========================================== */

@layer pages {

  /* ==========================================
     STAT ROW -- compact horizontal stat bar
     ========================================== */
  .wallet-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-8);
    margin-bottom: var(--space-12);
  }

  .wallet-stat-item {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-widget);
    padding: var(--space-4) var(--space-4);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-1);
  }

  .wallet-stat-value {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: var(--text-xl);
    color: var(--color-text);
    line-height: 1;
  }

  .wallet-stat-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  @media (max-width: 640px) {
    .wallet-stats-row {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* ==========================================
     VIEW TOGGLE -- rolodex / grid icon buttons
     ========================================== */
  .wallet-view-toggle {
    display: flex;
    background: var(--color-bg-sunken);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
  }

  .wallet-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: calc(var(--radius-md) - 2px);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
    background: transparent;
    border: none;
  }

  .wallet-view-btn:hover {
    color: var(--color-text);
  }

  .wallet-view-btn.active {
    background: var(--color-bg-elevated);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  /* ==========================================
     3D ROLODEX LAYOUT -- left/right split
     ========================================== */
  .wallet-rolodex-layout {
    display: grid;
    grid-template-columns: auto 42% 1fr;
    gap: var(--space-3);
    min-height: 480px;
    align-items: start;
  }

  /* ---- LEFT: 3D Card Stack ---- */
  .wallet-rolodex-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  .rolodex-container {
    perspective: 1200px;
    width: 100%;
    max-width: 380px;
    height: 480px;
    position: relative;
    cursor: grab;
  }

  .rolodex-container:active {
    cursor: grabbing;
  }

  .rolodex-stack {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
  }

  /* ---- Individual Rolodex Card ---- */
  .rolodex-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 340px;
    height: 214px;
    margin-left: -170px;
    margin-top: -107px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
  }

  .rolodex-card--active {
    cursor: default;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  /* Chip + stripe on rolodex cards (re-use wallet-card-hero styles) */
  .rolodex-card .wallet-card-hero-chip {
    position: absolute;
    top: 22%;
    left: 8%;
    width: 32px;
    height: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 100%);
    border-radius: 3px;
  }

  .rolodex-card .wallet-card-hero-stripe {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.12);
  }

  .rolodex-card-info {
    position: absolute;
    bottom: 14px;
    left: 16px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  
  .rolodex-card-info.light-card {
    color: #1a1a1a !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3) !important;
  }

  .rolodex-card-name {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: inherit;
    line-height: 1.2;
  }

  .rolodex-card-issuer {
    font-size: var(--text-xs);
    color: inherit;
    opacity: 0.7;
    font-weight: var(--weight-medium);
  }

  /* Vertical dot nav (left of rolodex) */
  .rolodex-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 480px;
  }

  .rolodex-nav-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
    background: transparent;
    border: none;
  }

  .rolodex-nav-arrow:hover {
    background: var(--surface-100);
    color: var(--color-text);
  }

  .rolodex-nav-dots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--space-2) 0;
  }

  .rolodex-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface-300);
    cursor: pointer;
    transition: all var(--transition-base);
  }

  .rolodex-dot.active {
    background: var(--brand-500);
    transform: scale(1.3);
  }

  .rolodex-dot:hover:not(.active) {
    background: var(--surface-400);
  }

  /* ---- RIGHT: Detail Panel ---- */
  .wallet-rolodex-right {
    min-width: 0;
    margin-left: var(--space-5);
  }

  .rolodex-detail {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-6) var(--space-6) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

  .rolodex-detail-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .rolodex-detail-name {
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--color-text);
    line-height: 1.2;
  }

  .rolodex-detail-issuer {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
  }

  /* Score ring area */
  .rolodex-detail-score {
    display: flex;
    justify-content: center;
    padding: var(--space-2) 0;
  }

  .wallet-card-ring.rolodex-ring {
    width: 120px;
    height: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .wallet-card-ring.rolodex-ring svg {
    display: block;
    width: 120px;
    height: 120px;
  }

  .wallet-card-ring.rolodex-ring .wallet-card-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .wallet-card-ring.rolodex-ring .wallet-card-ring-value {
    font-size: 1.5rem;
  }

  .wallet-card-ring.rolodex-ring .wallet-card-ring-label {
    font-size: 0.55rem;
  }

  /* Stat cards row */
  .rolodex-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }

  .rolodex-stat-card {
    background: var(--color-bg-sunken);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
  }

  .rolodex-stat-label {
    font-size: 10px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  .rolodex-stat-value {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--color-text);
    line-height: 1;
  }

  /* Rewards section */
  .rolodex-detail-rewards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-1);
  }

  .rolodex-detail-section-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  /* Reward checklist in detail panel — 2-column grid for stable height */
  .rolodex-detail-rewards .wallet-card-checklist {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* Actions row */
  .rolodex-detail-actions {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-3);
    margin-top: auto;
    border-top: 1px solid var(--border);
  }

  /* ==========================================
     ISSUER FILTER -- pill row above grid
     ========================================== */
  .wallet-issuer-filter {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
  }

  /* ==========================================
     WALLET CARDS -- Grid layout
     ========================================== */
  .wallet-section {
    margin-bottom: var(--space-8);
  }

  /* Multi-column card grid */
  .wallet-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
  }

  @media (max-width: 640px) {
    .wallet-card-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ==========================================
     WALLET CARD -- prominent card visual + stats
     ========================================== */
  .wallet-card {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    height: 100%; /* Fill grid cell */
  }
  
  .wallet-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .wallet-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px) scale(1.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .wallet-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  /* ---- HERO: Large credit card visual ---- */
  .wallet-card-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 1.586;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: var(--space-3) var(--space-4);
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: var(--surface-50);
  }

  /* Chip detail -- small golden rectangle */
  .wallet-card-hero-chip {
    position: absolute;
    top: 22%;
    left: 10%;
    width: 28px;
    height: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 100%);
    border-radius: 3px;
  }

  /* Stripe detail -- horizontal line */
  .wallet-card-hero-stripe {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.12);
  }

  /* Card name overlaid on hero */
  .wallet-card-hero-info {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-left: 7px;
  }
  
  .wallet-card-hero-info.light-card {
    color: #1a1a1a !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3) !important;
  }

  .wallet-card-hero-name {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: inherit;
    line-height: 1.2;
  }

  .wallet-card-hero-issuer {
    font-size: var(--text-xs);
    color: inherit;
    font-weight: var(--weight-medium);
    opacity: 0.75;
  }

  /* ---- STATS: Ring + checklist (complementary) ---- */
  .wallet-card-stats {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    min-height: 100px; /* Fixed height for alignment */
  }

  /* Progress ring -- smaller, understated */
  .wallet-card-ring {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
  }

  .wallet-card-ring svg {
    display: block;
  }

  .wallet-card-ring circle:last-child {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .wallet-card-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }

  .wallet-card-ring-value {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: var(--text-sm);
    color: var(--color-text);
    line-height: 1;
  }

  .wallet-card-ring-label {
    font-size: 8px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
  }

  /* Checklist */
  .wallet-card-checklist-wrap {
    flex: 1;
    min-width: 0;
  }

  .wallet-card-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-height: 72px;
    overflow: hidden;
  }

  .wallet-card-check-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
  }

  .wallet-card-rate {
    font-weight: 800;
    font-size: var(--text-base);
    color: var(--brand-500);
    min-width: 28px;
    flex-shrink: 0;
  }

  .wallet-card-portal-note {
    display: block;
    font-size: 10px;
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    line-height: 1.3;
  }

  .wallet-card-no-rewards {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-style: italic;
    display: flex;
    align-items: center;
    height: 100%;
  }

  /* ---- GRID CARD STATS: Anniversary / Fee / Value ---- */
  .wallet-card-grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    margin-top: auto; /* Push to bottom when no banner */
    border-top: 1px solid var(--border);
  }
  
  /* When banner exists, remove top margin/border from stats */
  .wallet-card-deal-banner + .wallet-card-grid-stats {
    margin-top: 0;
    border-top: none;
  }

  .wallet-card-grid-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
  }

  .wallet-card-grid-stat-label {
    font-size: 9px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  .wallet-card-grid-stat-value {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-xs);
    color: var(--color-text);
    line-height: 1;
  }

  /* ---- FOOTER: meta + actions ---- */
  .wallet-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
    gap: var(--space-3);
  }

  .wallet-card-meta-line {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wallet-card-actions {
    display: flex;
    gap: var(--space-1);
    flex-shrink: 0;
  }

  .wallet-card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-base);
  }

  .wallet-card-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  .wallet-card-action-btn.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
  }

  /* ==========================================
     ADD CARD MODAL (search + card list inside overlay)
     ========================================== */

  /* Filter Pills */
  .card-filters {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-4);
    scrollbar-width: none;
  }

  .card-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-base);
  }

  .filter-pill:hover {
    border-color: var(--primary);
  }

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

  /* Card Search */
  .card-search {
    position: relative;
    margin-bottom: var(--space-4);
  }

  .card-search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    color: var(--color-text);
  }

  .card-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
  }

  .card-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
  }

  /* Card List */
  .available-cards {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--surface-300) transparent;
  }

  .available-cards::-webkit-scrollbar {
    width: 4px;
  }

  .available-cards::-webkit-scrollbar-track {
    background: transparent;
  }

  .available-cards::-webkit-scrollbar-thumb {
    background: var(--surface-300);
    border-radius: 4px;
  }

  .available-cards::-webkit-scrollbar-thumb:hover {
    background: var(--surface-400);
  }

  .available-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-base);
  }

  .available-card:last-child {
    border-bottom: none;
  }

  .available-card:hover {
    background: var(--bg-sunken);
  }

  .available-card.in-wallet {
    cursor: pointer;
  }

  .available-card-swatch {
    width: 48px;
    height: 30px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .available-card-info {
    flex: 1;
    min-width: 0;
  }

  .available-card-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
  }

  .available-card-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
  }

  .available-card-action {
    flex-shrink: 0;
  }

  .add-card-btn {
    padding: var(--space-2) var(--space-3);
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    transition: all var(--transition-base);
  }

  .add-card-btn:hover {
    background: var(--primary-hover);
  }

  .added-card-btn {
    padding: var(--space-2) var(--space-3);
    background: var(--success);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    cursor: pointer;
  }

  .available-card.in-wallet:hover .added-card-btn {
    background: var(--error, #dc2626);
    color: var(--text-inverse);
  }

  .available-card.in-wallet:hover .added-card-btn .added-card-label {
    display: none;
  }

  .added-card-remove-label {
    display: none;
  }

  .available-card.in-wallet:hover .added-card-remove-label {
    display: inline;
  }

  .in-wallet-badge {
    font-size: var(--text-xs);
    color: var(--success);
    font-weight: var(--weight-medium);
  }

  /* ==========================================
     EMPTY STATE
     ========================================== */
  .wallet-empty {
    text-align: center;
    padding: var(--space-12) var(--space-5);
    margin-top: var(--space-6);
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
  }

  .wallet-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
  }

  .wallet-empty h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
  }

  .wallet-empty p {
    color: var(--text-muted);
    margin-bottom: var(--space-5);
  }

  /* ==========================================
     ANNIVERSARY MODAL
     ========================================== */
  .anniversary-picker {
    display: flex;
    gap: var(--space-3);
  }

  .anniversary-select {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    color: var(--color-text);
    cursor: pointer;
  }

  .anniversary-select:focus {
    border-color: var(--primary);
    outline: none;
  }

  /* ==========================================
     DEAL HINTS — inline text in card footer
     ========================================== */
  .wallet-card-footer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  .wallet-card-deal-hint {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wallet-card-deal-hint--active {
    color: var(--brand-500);
  }

  .wallet-card-deal-hint--empty {
    color: var(--text-muted);
    font-style: italic;
  }

  /* ==========================================
     DEAL TAG — tiny inline pill on boosted rates
     ========================================== */
  .wallet-card-deal-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(235, 68, 37, 0.1);
    color: var(--brand-500);
    font-size: 0.6875rem;
    font-weight: var(--weight-bold);
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
    position: relative;
    top: -1px;
  }

  /* ==========================================
     DEAL BANNER — persistent alert on card detail
     ========================================== */
  .wallet-card-deal-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: rgba(235, 68, 37, 0.05);
    border-left: 3px solid var(--brand-500);
    border-radius: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .wallet-card-deal-banner-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(235, 68, 37, 0.1);
    color: var(--brand-500);
  }

  .wallet-card-deal-banner-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .wallet-card-deal-banner-text {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wallet-card-deal-banner-sub {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
  }

  .wallet-card-deal-banner-cta {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-3);
    background: var(--brand-500);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition-base);
  }

  .wallet-card-deal-banner-cta:hover {
    background: var(--brand-600);
  }

  .wallet-card-deal-banner-dismiss {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-base), background var(--transition-base), color var(--transition-base);
  }

  .wallet-card-deal-banner:hover .wallet-card-deal-banner-dismiss {
    opacity: 1;
  }

  .wallet-card-deal-banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
  }

  /* Always show on touch devices */
  @media (hover: none) {
    .wallet-card-deal-banner-dismiss {
      opacity: 0.7;
    }
  }

  .cash-plus-modal-copy {
    margin-bottom: var(--space-5);
    color: var(--text-secondary);
    line-height: 1.5;
  }

  .cash-plus-modal-section + .cash-plus-modal-section {
    margin-top: var(--space-5);
  }

  .cash-plus-modal-label {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
  }

  .cash-plus-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .cash-plus-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-lg);
    background: var(--surface-0);
    font-size: var(--text-sm);
    color: var(--color-text);
  }

  .cash-plus-option input {
    accent-color: var(--brand-500);
  }

  @media (max-width: 640px) {
    .cash-plus-option-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ==========================================
     MOBILE RESPONSIVE
     ========================================== */
  @media (max-width: 768px) {
    /* Hide rolodex on mobile; grid is forced in JS */
    .wallet-rolodex-layout {
      display: none;
    }
  }

  @media (max-width: 480px) {
    .wallet-grid {
      grid-template-columns: 1fr;
      gap: var(--space-3);
    }
    .wallet-card-grid-item {
      padding: var(--space-3);
    }
    .wallet-card-actions {
      gap: var(--space-2);
      flex-wrap: wrap;
      justify-content: flex-start;
    }
    .wallet-stats {
      grid-template-columns: repeat(2, 1fr);
      gap: var(--space-3);
    }
    .wallet-card-search input {
      font-size: 16px; /* iOS zoom prevention */
    }
  }

  /* Touch target compliance (44px minimum) */
  @media (pointer: coarse) {
    .wallet-view-btn {
      width: 44px;
      height: 44px;
    }
    .wallet-card-action-btn {
      width: 44px;
      height: 44px;
    }
  }

}
