/* ─── DRAG & DROP PHYSICS ────────────────────────────────── */
/* 1. ELEVATION — chip lifts off the canvas when grabbed */
.txn-chip.dragging {
  opacity: 0.92;
  transform: scale(1.06) rotate(1.5deg);
  box-shadow:
    0 16px 36px rgba(26,26,24,0.16),
    0 4px 12px rgba(26,26,24,0.10),
    inset 0 1px 0 rgba(255,255,255,0.9);
  cursor: grabbing;
  z-index: var(--z-chip);
}

/* 2. MAGNETISM — drop target subtly hollows to welcome the chip */
.row.drag-over {
  background: rgba(107,86,232,0.06);
  border-radius: var(--r-md);
  outline: 1.5px dashed var(--accent-mid);
  outline-offset: -1px;
  transform: scaleY(0.97);
  transition: transform 0.18s cubic-bezier(0.4,0,0.2,1),
              background 0.18s ease,
              outline-color 0.18s ease;
}
.drag-target-highlight {
  background: rgba(94,92,230,0.04);
  border-radius: var(--r-md);
  outline: 1.5px dashed var(--accent-mid);
  outline-offset: -2px;
  transition: background var(--dur-fast, 0.15s) ease, outline-color var(--dur-fast, 0.15s) ease;
}

/* 3. THE SNAP — bouncy landing pop when dropped */
@keyframes dropSnap {
  0%   { transform: scale(1.06) rotate(1.5deg); box-shadow: 0 12px 28px rgba(26,26,24,0.14); }
  55%  { transform: scale(0.965); box-shadow: 0 2px 6px rgba(26,26,24,0.06); }
  80%  { transform: scale(1.015); box-shadow: var(--shadow-xs); }
  100% { transform: scale(1) rotate(0deg); box-shadow: var(--shadow-xs); }
}
.txn-chip.dropped {
  animation: dropSnap 0.38s cubic-bezier(0.25,1,0.5,1) forwards;
}

/* ─── ADDITIONAL UTILITIES & MISC ────────────────────────── */
#txnMoveDate {
  color: var(--text-secondary);
}

/* No-spend day visual reward */
.no-spend-day {
  position: relative;
  overflow: hidden;
}
.no-spend-day .day-header .date {
  color: #D97706;
}
.no-spend-day .divider {
  background: linear-gradient(90deg, #F59E0B, #FCD34D);
}
.no-spend-day::after {
  content: '👑';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 14px;
  pointer-events: none;
  animation: crownPop var(--dur-slow, 0.4s) var(--ease-spring, cubic-bezier(0.32,0.72,0,1));
  z-index: 1; 
}
@keyframes crownPop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.txn-income.txn-confirmed {
  border-left: 3px solid var(--income-amount);
}

/* Freelance / Pending Chips */
.txn-pending {
  background: var(--pending-bg) !important;
  border: 1.5px dashed var(--pending-border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), var(--shadow-xs) !important;
  animation: pendingPulse 2.5s ease-in-out infinite;
}
.txn-pending:hover {
  background: var(--pending-bg-hover) !important;
}
@keyframes pendingPulse {
  0%, 100% { border-color: var(--pending-border); }
  50% { border-color: var(--pending-border-alt); box-shadow: 0 0 0 3px rgba(245,158,11,0.12), var(--shadow-xs); }
}
.txn-pending .chip-amount {
  background: var(--pending-amount-bg) !important;
  color: var(--pending-amount-color) !important;
}
.pending-badge {
  font-size: 10px;
  background: #FEF3C7;
  color: #D97706;
  border-radius: 6px;
  padding: 1px 5px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid #FCD34D;
}
.confirm-paid-btn {
  font-size: 10px !important;
  padding: 2px 7px !important;
  background: #FEF3C7 !important;
  color: #D97706 !important;
  border: 1px solid #FCD34D !important;
  border-radius: 6px !important;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 600 !important;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.confirm-paid-btn:hover {
  background: #D97706 !important;
  color: #fff !important;
  border-color: #D97706 !important;
}
.week-stat-pending {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pending-split {
  font-size: 10.5px;
  color: #D97706;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  background: #FFFBEB;
  border-radius: 6px;
  border: 1px solid #FCD34D;
}

#storageQuotaBanner {
  background: var(--error-bg) !important;
  border: 1.5px solid var(--error-border) !important;
  color: var(--error) !important;
}
#storageQuotaBanner .recovery-text {
  color: #DC2626 !important;
}
#storageQuotaBanner .recovery-dismiss {
  color: var(--error) !important;
}

/* Wishlist / Parking Lot Dock */
.wishlist-dock {
  margin-top: 32px;
  border-top: 1px solid var(--divider);
  padding-top: 20px;
}
.wishlist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.wishlist-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.wishlist-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 300;
  flex: 1;
}
.wishlist-add-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--divider-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wishlist-add-btn:hover { background: var(--bg); border-color: var(--accent-mid); color: var(--accent); }
.wishlist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  background: rgba(248,248,246,0.6);
  border-radius: var(--r-md);
  border: 1.5px dashed var(--divider-strong);
}
.wishlist-chips:empty::before {
  content: 'Tempted by something? Park it here for 48h before deciding. 💭';
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  text-align: center;
}
.wishlist-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 220px;
}
.wishlist-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.wishlist-chip-amount {
  font-weight: 700;
  color: #D97706;
  font-size: 12px;
  background: #FEF3C7;
  padding: 1px 6px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.wishlist-chip-label {
  color: var(--text-secondary);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.wishlist-chip-countdown {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.wishlist-chip-countdown.ready {
  color: #16A34A;
  font-weight: 600;
}
.wishlist-chip-actions {
  display: none;
  align-items: center;
  gap: 4px;
}
.wishlist-chip:hover .wishlist-chip-actions { display: flex; }
.wishlist-chip-commit {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid #16A34A;
  background: #DCFCE7;
  color: #16A34A;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}
.wishlist-chip-commit:hover { background: #16A34A; color: #fff; }
.wishlist-chip-del {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--error-border); 
  background: var(--error-bg);
  color: var(--error);
  border-radius: 5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}
.wishlist-chip-del:hover { background: var(--error); color: #fff; } 

/* Billing Date Tooltip */
.billing-tooltip {
  position: fixed;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 8px 12px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: var(--z-toast);
  max-width: 220px;
  line-height: 1.5;
  animation: tooltipFade 0.15s ease;
  white-space: normal;
}
@keyframes tooltipFade {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--divider-strong); border-radius: 2px; }

/* Undo Snackbar */
#undoSnackbar {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
#undoSnackbar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
#undoSnackbar strong { font-weight: 600; }
#undoSnackbar button {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s ease;
}
#undoSnackbar button:hover { background: rgba(255,255,255,0.15); }

/* Pro Welcome Toast */
#proWelcomeToast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--text-primary);
  color: #fff;
  padding: 16px 20px;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.12);
  z-index: var(--z-toast);
  min-width: 300px;
  max-width: 420px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.4,0.64,1);
  pointer-events: none;
}
#proWelcomeToast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.pro-toast-crown {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
  color: #F7C948;
}
.pro-toast-body {
  flex: 1;
}
.pro-toast-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}
.pro-toast-sub {
  font-size: 12px;
  opacity: 0.65;
  font-weight: 400;
  line-height: 1.4;
}
.pro-toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.pro-toast-close:hover { color: #fff; }

/* Milestone Confetti Toast */
.milestone-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 14px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.milestone-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Week Coach / Next Card */
.week-coach-card,
.week-next-card {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-soft, rgba(108,99,255,0.06));
  border: 1px solid var(--accent-mid, rgba(108,99,255,0.18));
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.week-coach-card .coach-title,
.week-next-card .next-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
  margin-bottom: 4px;
}
.week-next-card .next-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.week-next-card .next-item:last-child { border-bottom: none; }
.week-next-card .next-item .next-icon { flex-shrink: 0; font-size: 13px; }

/* Category Rules Engine */
.rules-hint {
  font-size: 11px;
  color: var(--accent);
  padding: 4px 8px;
  background: var(--accent-soft, rgba(108,99,255,0.06));
  border-radius: 6px;
  margin-top: -6px;
  cursor: pointer;
  display: inline-block;
  transition: background 0.15s;
}
.rules-hint:hover { background: var(--accent-mid, rgba(108,99,255,0.14)); }

/* Mobile Tooltip */
.mobile-tooltip {
  position: fixed;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: var(--z-tooltip);
  white-space: nowrap;
  width: max-content;
  max-width: calc(100vw - 16px);
  animation: tooltipFade 0.15s ease;
}
.row-nudge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 100px;
  pointer-events: none;
  white-space: nowrap;
  animation: nudgePulse 2s ease-in-out infinite;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.mobile-only { display: none; }
.settings-item[data-mobile-overflow] { display: none; }

