/* ============================================================
   FRESH STYLE — FX layer (loaded after app.css)
   3D icons · header · popups/toasts · motion · push/PWA/transactions UI
   Everything animates transform/opacity only, so it stays smooth on low-end phones.
   ============================================================ */
:root {
  --fx-ease: cubic-bezier(.2, .8, .2, 1);
  --fx-spring: cubic-bezier(.34, 1.56, .64, 1);
  --fx-glass: rgba(255, 255, 255, .92);
  --fx-scrim: rgba(17, 24, 39, .48);
  --fx-shadow-pop: 0 24px 70px rgba(17, 24, 39, .28);
}
[data-theme="dark"] {
  --fx-glass: rgba(13, 38, 50, .94);
  --fx-scrim: rgba(2, 8, 12, .66);
  --fx-shadow-pop: 0 24px 70px rgba(0, 0, 0, .6);
}

/* ---------- 3D icons (replace every emoji) ---------- */
.i3d { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.3em; flex: none; line-height: 0; transition: transform .25s var(--fx-spring); }
.i3d svg { width: 100%; height: 100%; display: block; overflow: visible; }
.i3d-xs { width: 14px; height: 14px; vertical-align: -2px; }
.i3d-sm { width: 20px; height: 20px; vertical-align: -5px; }
.i3d-lg { width: 28px; height: 28px; vertical-align: -8px; }
.i3d-xl { width: 44px; height: 44px; vertical-align: middle; }
a:hover > .i3d, button:hover > .i3d, .entity-row:hover .i3d, .nav-icon:hover .i3d { transform: translateY(-2px) scale(1.08) rotate(-3deg); }

/* icon holders that used to be tinted circles for emoji: let the 3D tile speak for itself */
.nav-icon, .entity-row-icon, .notif-icon, .feature-icon, .campaign-card-banner-icon, .wf-icon, .wf-callout-icon {
  background: none !important; display: inline-flex; align-items: center; justify-content: center;
}
.sidebar nav a .nav-icon { width: 24px; font-size: inherit; opacity: 1; }
.sidebar nav a .nav-icon .i3d { width: 22px; height: 22px; vertical-align: 0; }
.entity-row-icon { width: 40px; height: 40px; }
.entity-row-icon .i3d { width: 34px; height: 34px; }
.notif-icon { width: 42px; height: 42px; border-radius: 0; }
.notif-icon .i3d { width: 38px; height: 38px; }
.feature-icon .i3d { width: 40px; height: 40px; }
.empty-state .empty-icon { opacity: 1; font-size: inherit; }
.empty-state .empty-icon .i3d { width: 56px; height: 56px; animation: fxFloat 3.2s ease-in-out infinite; }
.campaign-card-banner-icon .i3d { width: 44px; height: 44px; }
.bottom-nav .icon { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.bottom-nav .icon .i3d { width: 24px; height: 24px; vertical-align: 0; }
.bottom-nav a.active .icon .i3d { transform: translateY(-2px) scale(1.12); }
.brand-mark .flame { display: inline-flex; filter: none; }
.brand-mark .flame .i3d { width: 28px; height: 28px; vertical-align: 0; animation: fxFloat 4s ease-in-out infinite; }
.wf-icon .i3d { width: 28px; height: 28px; }
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.star { display: inline-flex; color: inherit; }
.star .i3d { width: 16px; height: 16px; vertical-align: 0; }
.leaderboard-medal .i3d, .rank-medal .i3d { width: 30px; height: 30px; }

/* ---------- Header ---------- */
/* Header spacing: compact in a normal browser tab (no extra gap under the address bar);
   the device safe-area inset is only added when installed as a PWA / fullscreen. */
.topbar { padding-top: 12px; padding-bottom: 12px; backdrop-filter: none; }
@media (max-width: 900px) { .topbar { padding-top: 8px; padding-bottom: 8px; } }
@media (display-mode: standalone), (display-mode: fullscreen) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .marketing-header { padding-top: env(safe-area-inset-top, 0px); }
}
.topbar-site-name {
  font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.topbar-site-name:hover { color: var(--primary); }
.topbar-right { gap: 8px; }

.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  transition: transform .2s var(--fx-spring), border-color .2s, box-shadow .2s;
}
.notif-bell:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.notif-bell:active { transform: scale(.94); }
.notif-bell .i3d { width: 28px; height: 28px; vertical-align: 0; }
.notif-bell.is-ringing .i3d { animation: fxRing .9s ease-in-out; transform-origin: 50% 12%; }
.notif-bell-count {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  border: 2px solid var(--surface); animation: fxBadgePop .45s var(--fx-spring) both;
}
.notif-bell-count[hidden] { display: none; }

.user-menu-dropdown { display: block; visibility: hidden; opacity: 0; transform: translateY(-8px) scale(.96); transform-origin: top right; pointer-events: none;
  transition: opacity .18s ease, transform .22s var(--fx-spring), visibility 0s linear .22s; min-width: 230px; }
.user-menu-dropdown.is-open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
.user-menu-dropdown a, .user-menu-dropdown button { display: flex; align-items: center; gap: 10px; transition: background .15s, transform .15s; }
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { transform: translateX(2px); }
.user-menu-dropdown .nav-badge { margin-left: auto; }
.user-menu-dropdown form { margin: 0; }
.user-menu-dropdown [hidden] { display: none !important; }

.menu-theme-row { justify-content: flex-start; }
.menu-theme-icons { display: inline-flex; width: 20px; height: 20px; }
.menu-theme-icons .icon-dark { display: none; }
[data-theme="dark"] .menu-theme-icons .icon-light { display: none; }
[data-theme="dark"] .menu-theme-icons .icon-dark { display: inline-flex; }
.menu-theme-label { flex: 1; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border); flex: none; transition: background .25s; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .3s var(--fx-spring); }
[aria-checked="true"] > .switch, .switch.is-on { background: var(--primary); }
[aria-checked="true"] > .switch .switch-knob, .switch.is-on .switch-knob { transform: translateX(16px); }

.guest-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
@media (display-mode: standalone), (display-mode: fullscreen) { .guest-header { padding-top: max(10px, env(safe-area-inset-top, 0px)); } }
.guest-header .theme-toggle { position: static; }
body.has-guest-header .guest-wrap { margin-top: 64px; }
body.has-guest-header.guest-body { padding-top: 0; }
@media (display-mode: standalone), (display-mode: fullscreen) { body.has-guest-header .guest-wrap { margin-top: calc(64px + env(safe-area-inset-top, 0px)); } }
.theme-toggle .i3d { width: 24px; height: 24px; vertical-align: 0; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; transition: transform .25s var(--fx-spring), border-color .2s; }
.theme-toggle:hover { transform: rotate(18deg) scale(1.06); }

/* ---------- Popups (alerts / confirmations / warnings) ---------- */
.fx-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--fx-scrim); opacity: 0; transition: opacity .25s ease; -webkit-tap-highlight-color: transparent;
}
.fx-overlay.is-open { opacity: 1; }
.fx-modal {
  position: relative; width: 100%; max-width: 400px; background: var(--fx-glass); color: var(--text); text-align: center;
  border: 1px solid var(--border); border-radius: 24px; padding: 30px 24px 22px; box-shadow: var(--fx-shadow-pop); overflow: hidden;
  transform: translateY(26px) scale(.86); opacity: 0; transition: transform .45s var(--fx-spring), opacity .25s ease;
}
.fx-overlay.is-open .fx-modal { transform: none; opacity: 1; }
.fx-overlay.is-closing { opacity: 0; }
.fx-overlay.is-closing .fx-modal { transform: translateY(12px) scale(.94); opacity: 0; transition-duration: .2s; }
.fx-modal::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--fx-accent, var(--primary)); }
.fx-modal[data-type="success"] { --fx-accent: var(--success); }
.fx-modal[data-type="error"] { --fx-accent: var(--danger); }
.fx-modal[data-type="warning"], .fx-modal[data-type="confirm"] { --fx-accent: var(--warning); }
.fx-modal[data-type="info"] { --fx-accent: #38bdf8; }
.fx-badge {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--fx-accent, var(--primary)) 16%, transparent); position: relative;
}
.fx-badge::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--fx-accent, var(--primary)); opacity: 0; animation: fxRipple 1.6s ease-out .3s 2; }
.fx-badge svg { width: 46px; height: 46px; overflow: visible; }
.fx-badge .fx-stroke { fill: none; stroke: var(--fx-accent, var(--primary)); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.fx-overlay.is-open .fx-badge .fx-stroke { animation: fxDraw .55s ease-out .25s forwards; }
.fx-overlay.is-open .fx-badge .fx-stroke.s2 { animation-delay: .45s; }
.fx-modal[data-type="success"] .fx-badge { animation: fxPop .6s var(--fx-spring) .1s both; }
.fx-modal[data-type="error"] .fx-badge { animation: fxShake .6s ease .25s both; }
.fx-modal[data-type="warning"] .fx-badge, .fx-modal[data-type="confirm"] .fx-badge { animation: fxWobble 1.2s ease .3s 1 both; }
.fx-modal[data-type="info"] .fx-badge { animation: fxPop .6s var(--fx-spring) .1s both; }
.fx-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.fx-text { font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 20px; word-break: break-word; }
.fx-text a { color: var(--primary); text-decoration: underline; }
.fx-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fx-actions .btn { flex: 1 1 120px; justify-content: center; min-height: 44px; }
.fx-modal[data-type="error"] .fx-actions .btn-primary { background: var(--danger); }
.fx-modal[data-type="success"] .fx-actions .btn-primary { background: var(--success); }
.fx-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--fx-accent, var(--primary)); transform-origin: left; opacity: .85; }
.fx-modal.is-timed .fx-timer { animation: fxTimer var(--fx-ms, 3000ms) linear forwards; }
.fx-modal.is-paused .fx-timer { animation-play-state: paused; }
.fx-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); font-size: 20px; cursor: pointer; transition: background .15s, transform .2s var(--fx-spring); }
.fx-close:hover { background: var(--surface-soft); transform: rotate(90deg); }
.fx-notice-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 16px; font-family: inherit;
  transition: transform .2s var(--fx-spring), border-color .2s;
}
.fx-notice-pill:hover { transform: translateY(-1px); border-color: var(--primary); }
.fx-notice-pill[data-type="error"] { border-color: var(--danger); }
.fx-notice-pill[data-type="warning"] { border-color: var(--warning); }
.fx-notice-pill[data-type="success"] { border-color: var(--success); }

/* toasts (live notifications, quick confirmations) */
.fx-toasts { position: fixed; top: max(14px, env(safe-area-inset-top, 0px)); right: 14px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.fx-toast {
  position: relative; pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 16px; overflow: hidden;
  background: var(--fx-glass); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(120%); opacity: 0; transition: transform .5s var(--fx-spring), opacity .3s; cursor: pointer;
}
.fx-toast.is-in { transform: none; opacity: 1; }
.fx-toast.is-out { transform: translateX(120%); opacity: 0; transition-duration: .3s; }
.fx-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--fx-accent, var(--primary)); }
.fx-toast[data-type="success"] { --fx-accent: var(--success); }
.fx-toast[data-type="error"] { --fx-accent: var(--danger); }
.fx-toast[data-type="warning"] { --fx-accent: var(--warning); }
.fx-toast[data-type="info"] { --fx-accent: #38bdf8; }
.fx-toast .i3d { width: 34px; height: 34px; vertical-align: 0; }
.fx-toast-body { flex: 1; min-width: 0; }
.fx-toast-title { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.fx-toast-text { font-size: 13px; color: var(--text-secondary); margin: 0; word-break: break-word; }
.fx-toast .fx-timer { height: 2.5px; }
@media (max-width: 600px) { .fx-toasts { right: 14px; left: 14px; width: auto; } }

/* top progress bar while navigating */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0; pointer-events: none; }
.fx-progress.is-run { opacity: 1; transform: scaleX(.82); transition: transform 8s cubic-bezier(.1, .8, .2, 1); }
.fx-progress.is-done { opacity: 0; transform: scaleX(1); transition: transform .2s, opacity .4s .2s; }

/* ---------- Motion ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fxFadeOut .16s ease both; }
::view-transition-new(root) { animation: fxFadeIn .28s ease both; }

.content-inner > * { animation: fxRise .5s var(--fx-ease) both; }
.content-inner > *:nth-child(2) { animation-delay: .04s; }
.content-inner > *:nth-child(3) { animation-delay: .08s; }
.content-inner > *:nth-child(4) { animation-delay: .12s; }
.content-inner > *:nth-child(5) { animation-delay: .16s; }
.content-inner > *:nth-child(6) { animation-delay: .2s; }
.content-inner > *:nth-child(n+7) { animation-delay: .24s; }
.guest-wrap > .card, .guest-wrap > * { animation: fxRise .55s var(--fx-ease) both; }
.marketing-header { animation: fxDrop .5s var(--fx-ease) both; }
.hero, .marketing-hero { animation: fxFadeIn .7s ease both; }

/* scroll reveal: JS marks items with .fx-pre (hidden) then .fx-in (visible) */
.fx-js .fx-pre { opacity: 0; transform: translateY(18px); }
.fx-js .fx-pre.fx-in { opacity: 1; transform: none; transition: opacity .5s ease var(--fx-d, 0s), transform .6s var(--fx-ease) var(--fx-d, 0s); }

.card, .campaign-card, .entity-row, .notif-item, .plan-card, .stat-card, .list-row, .feature-card { transition: transform .25s var(--fx-ease), box-shadow .25s ease, border-color .2s ease, background-color .2s; }
@media (hover: hover) {
  .card:hover, .campaign-card:hover, .plan-card:hover, .feature-card:hover, .notif-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .list-row:hover { transform: translateX(3px); }
}
.btn { transition: transform .18s var(--fx-spring), box-shadow .2s, background-color .2s, border-color .2s, color .2s; position: relative; overflow: hidden; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } .btn-primary:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 35%, transparent); } }
.btn:active { transform: scale(.96); }
.fx-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: fxRippleBtn .6s ease-out forwards; pointer-events: none; }
.btn-secondary .fx-ripple, .btn-outline .fx-ripple { background: color-mix(in srgb, var(--primary) 25%, transparent); }
input, select, textarea { transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.sidebar nav a { transition: background .2s, color .2s, transform .2s var(--fx-ease); }
.sidebar nav a:hover { transform: translateX(3px); }
.nav-badge, .badge { animation: fxBadgePop .4s var(--fx-spring) both; }
.wallet-balance-card { animation: fxRise .6s var(--fx-ease) both; }
.notif-item.is-unread .notif-dot { animation: fxPulse 1.8s ease-in-out infinite; }
.transaction-row { animation: fxRise .45s var(--fx-ease) both; }

@keyframes fxRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fxDrop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes fxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxFadeOut { to { opacity: 0; } }
@keyframes fxFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fxPop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fxShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes fxWobble { 0% { transform: scale(.5) rotate(-12deg); opacity: 0; } 50% { transform: scale(1.1) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes fxDraw { to { stroke-dashoffset: 0; } }
@keyframes fxRipple { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes fxTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes fxRing { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
@keyframes fxBadgePop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes fxPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
@keyframes fxRippleBtn { to { transform: scale(4); opacity: 0; } }
@keyframes fxSlideUp { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fxSplashLogo { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .fx-js .fx-pre { opacity: 1; transform: none; }
}

/* ---------- Transactions page ---------- */
.txn-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.txn-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.txn-stat .label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.txn-stat .value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.txn-stat.is-in .value { color: var(--success); }
.txn-stat.is-out .value { color: var(--danger); }
.txn-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.txn-filters label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; display: block; }
.txn-filters .btn { width: 100%; justify-content: center; }
.txn-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.txn-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: all .2s var(--fx-spring); }
.txn-tab:hover { border-color: var(--primary); color: var(--primary); }
.txn-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.txn-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.txn-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); transition: background .2s, transform .2s var(--fx-ease); }
.txn-row:last-child { border-bottom: none; }
.txn-row:hover { background: var(--surface-soft); }
.txn-row .i3d { width: 36px; height: 36px; vertical-align: 0; }
.txn-main { flex: 1; min-width: 0; }
.txn-main strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-main .small { display: block; margin-top: 2px; }
.txn-amt { text-align: right; flex: none; }
.txn-amt .v { display: block; font-weight: 800; font-size: 15px; }
.txn-amt .v.is-in { color: var(--success); }
.txn-amt .v.is-out { color: var(--danger); }
.txn-amt .b { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.pager .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Push / PWA UI ---------- */
.push-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); margin: 16px 0; flex-wrap: wrap; }
.push-card .i3d { width: 46px; height: 46px; vertical-align: 0; }
.push-card-main { flex: 1; min-width: 200px; }
.push-card-main strong { display: block; font-size: 15px; }
.push-card-main .small { display: block; margin-top: 2px; }
.push-toggle { display: inline-flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; font-family: inherit; color: var(--text); font-size: 14px; font-weight: 600; padding: 4px; }
.push-toggle[disabled] { opacity: .55; cursor: not-allowed; }
.push-toggle .switch { width: 48px; height: 28px; }
.push-toggle .switch-knob { width: 22px; height: 22px; top: 3px; left: 3px; }
.push-toggle[aria-checked="true"] .switch .switch-knob { transform: translateX(20px); }
.push-status { font-size: 12px; margin-top: 6px; color: var(--text-muted); }
.push-status.is-ok { color: var(--success); }
.push-status.is-bad { color: var(--danger); }

.pwa-install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 900; max-width: 460px; margin: 0 auto;
  display: flex; gap: 12px; align-items: center; background: var(--fx-glass); border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); animation: fxSlideUp .55s var(--fx-spring) both;
}
@media (max-width: 900px) { .pwa-install-banner { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
.pwa-install-banner img { width: 44px; height: 44px; border-radius: 12px; }
.pwa-install-banner .txt { flex: 1; min-width: 0; font-size: 13px; }
.pwa-install-banner .txt strong { display: block; font-size: 14px; }
.pwa-install-banner .x { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; }

.pwa-splash { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--splash-bg, #fff); color: var(--splash-fg, #111); transition: opacity .5s ease, visibility .5s; }
.pwa-splash.is-hiding { opacity: 0; visibility: hidden; }
.pwa-splash img { width: 132px; height: 132px; border-radius: 28px; object-fit: cover; animation: fxSplashLogo .8s var(--fx-spring) both; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.pwa-splash video { max-width: min(86vw, 520px); max-height: 60vh; border-radius: 20px; background: #000; }
.pwa-splash .name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; animation: fxRise .7s var(--fx-ease) .2s both; }
.pwa-splash .bar { width: 120px; height: 4px; border-radius: 4px; background: rgba(127,127,127,.25); overflow: hidden; }
.pwa-splash .bar::after { content: ""; display: block; height: 100%; width: 100%; background: currentColor; transform-origin: left; animation: fxTimer var(--splash-ms, 1800ms) linear reverse forwards; }
.pwa-splash .skip { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: 16px; background: rgba(127,127,127,.2); color: inherit; border: none; border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; }

/* admin control pages */
.ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ctl-row:last-child { border-bottom: none; }
.ctl-row .ctl-label strong { display: block; font-size: 14px; }
.ctl-row .ctl-label .small { display: block; margin-top: 2px; }
.ctl-check { position: relative; width: 48px; height: 28px; flex: none; }
.ctl-check input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.ctl-check .switch { position: absolute; inset: 0; width: 48px; height: 28px; }
.ctl-check .switch-knob { width: 22px; height: 22px; top: 3px; left: 3px; }
.ctl-check input:checked + .switch { background: var(--primary); }
.ctl-check input:checked + .switch .switch-knob { transform: translateX(20px); }
.ctl-check input:focus-visible + .switch { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--text-muted); }
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 22%, transparent); }
.preview-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-soft); }
.preview-box img, .preview-box video { max-width: 96px; max-height: 96px; border-radius: 14px; }
.push-preview { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--border); max-width: 420px; }
.push-preview img.icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.push-preview .pv-title { font-weight: 700; font-size: 14px; }
.push-preview .pv-body { font-size: 13px; color: var(--text-secondary); }
.push-preview img.big { width: 100%; border-radius: 10px; margin-top: 8px; max-height: 160px; object-fit: cover; }
.table-wrap { overflow-x: auto; }

/* launch screen: hide the first paint of an installed app until the splash is up */
html.fs-splash-pending body > *:not(.pwa-splash) { visibility: hidden; }

/* ---------- Verification guide pop-up (one platform at a time) ---------- */

.gm-overlay { position: fixed; inset: 0; z-index: 420; display: none; align-items: center; justify-content: center; padding: 14px; background: rgba(6,10,16,.78); }
.gm-overlay.is-open { display: flex; }
.gm-dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.gm-close { position: absolute; top: 10px; right: 10px; z-index: 6; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(17,24,39,.72); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gm-body { overflow-y: auto; padding: 18px 18px 20px; -webkit-overflow-scrolling: touch; }
.gm-title { margin: 0 44px 12px 0; font-size: 18px; }
.gm-media { position: relative; margin: 0 -18px; }
.gm-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gm-track::-webkit-scrollbar { display: none; }
.gm-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; padding: 0 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gm-frame { width: 100%; background: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 180px; }
.gm-frame img, .gm-frame video { max-width: 100%; max-height: 46vh; width: auto; height: auto; object-fit: contain; display: block; }
.gm-slide figcaption { width: 100%; display: flex; flex-direction: column; gap: 2px; font-size: 14px; text-align: left; }
.gm-slide figcaption span { color: var(--text-secondary); }
.gm-nav { position: absolute; top: 90px; z-index: 4; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(17,24,39,.7); color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gm-nav[hidden] { display: none; }
.gm-prev { left: 24px; }
.gm-next { right: 24px; }
.gm-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.gm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.gm-dot.is-active { background: var(--primary); width: 18px; border-radius: 999px; }
.gm-steps { margin-top: 14px; }
.gm-steps h3 { margin: 0 0 6px; font-size: 15px; }
.gm-steps ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.gm-steps li { margin: 4px 0; }
.gm-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.gm-links .btn { flex: 1 1 140px; text-align: center; justify-content: center; }
.guide-link-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.guide-link-row input { flex: 1 1 160px; margin: 0; }
.guide-link-actions { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 10px; }
#verify-guide-btn { margin: 8px 0 4px; }
#verify-guide-btn[hidden] { display: none; }

/* ---------- Copy boxes (referral link, deposit account details) ---------- */
.copy-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin: 12px 0 4px; }
.copy-box { display: flex; align-items: center; gap: 10px; max-width: 100%; margin: 4px 0; background: var(--surface-soft); border: 1px dashed var(--primary); border-radius: var(--radius); padding: 10px 12px; }
.copy-box input { flex: 1; min-width: 0; margin: 0; background: transparent; border: 0; padding: 4px 0; font-weight: 600; box-shadow: none; }
.copy-box-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.copy-box .btn { flex: none; align-self: flex-start; white-space: nowrap; }

/* ---------- Notifications: compact On/Off row ---------- */
.push-card-compact { gap: 12px; padding: 12px 16px; flex-wrap: nowrap; }
.push-card-compact .i3d { width: 34px; height: 34px; flex: none; }
.push-card-compact .push-card-title { flex: 1; min-width: 0; font-size: 15px; }
.push-card-compact[hidden] { display: none; }
.push-toggle-label { min-width: 26px; text-align: left; font-weight: 700; color: var(--text-muted); }
.push-toggle[aria-checked="true"] .push-toggle-label { color: var(--success); }
.push-check { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.push-check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.push-check-box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.push-check input:checked + .push-check-box { background: var(--primary); border-color: var(--primary); }
.push-check input:checked + .push-check-box::after { content: "\2713"; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; }
.push-check input:focus-visible + .push-check-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.push-check input:disabled + .push-check-box { opacity: .5; }

/* ---------- Deposit / withdrawal: live fee box, history eye + detail pop-up ---------- */
.info-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.calc-box { background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.calc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
.calc-row span { color: var(--text-secondary); }
.calc-row.is-net { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.calc-row.is-net strong { color: var(--success); font-size: 17px; }
.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; }
.history-eye-col { width: 48px; text-align: right; }
.eye-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.eye-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.td-overlay { position: fixed; inset: 0; z-index: 420; display: none; align-items: center; justify-content: center; padding: 14px; background: rgba(6,10,16,.78); }
.td-overlay.is-open { display: flex; }
.td-dialog { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.td-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(17,24,39,.72); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.td-body { overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.td-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-right: 44px; }
.td-head h2 { margin: 0; font-size: 18px; }
.td-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.td-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.td-stat .td-value { overflow-wrap: anywhere; }
.td-stat.is-net { border-color: var(--success); }
.td-stat.is-net .td-value { color: var(--success); font-size: 17px; }
.td-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.td-label { font-size: 12px; color: var(--text-muted); }
.td-label-out { font-weight: 600; }
.td-value { font-size: 14px; }
.td-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.td-box.is-bad { border-color: var(--danger); }
.td-secret { border-style: dashed; border-color: var(--primary); }
.td-secret-value { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; white-space: pre-wrap; user-select: all; }
.td-secret-value.is-masked { letter-spacing: 2px; user-select: none; }
.td-box-actions { display: flex; gap: 6px; flex: none; align-items: center; }
.td-box .btn, .td-toggle { flex: none; white-space: nowrap; }
.td-toggle { display: inline-flex; align-items: center; gap: 6px; }
.td-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.td-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 12px; min-width: 0; }
.td-row + .td-row { border-top: 1px solid var(--border); }
.td-row .td-value { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.td-proof { align-self: flex-start; }
@media (max-width: 420px) { .td-body { padding: 14px; } .td-secret { flex-wrap: wrap; } .td-secret-value { flex-basis: 100%; } .td-box-actions { width: 100%; } .td-box-actions .btn { flex: 1; justify-content: center; } }

/* Transfer confirmation pop-up buttons */
.td-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.td-confirm-actions .btn { flex: 1 1 140px; justify-content: center; }
.td-body > h2 { margin: 0; font-size: 18px; margin-right: 44px; }
.td-body > p.small { margin: 0; color: var(--text-muted); }

/* Admin "Sort by" */
.admin-sort { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.admin-sort label { margin: 0; font-size: 13px; color: var(--text-muted); white-space: nowrap; font-weight: 600; }
.admin-sort-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; }

/* Suspended / banned account pop-up */
.acct-block { max-width: 460px; text-align: center; }
.acct-block-body { align-items: center; text-align: center; gap: 10px; padding: 26px 22px 22px; }
.acct-block-icon { width: 78px; height: 78px; border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: acctPop .5s cubic-bezier(.2,.9,.3,1.3) both; }
.acct-block.is-suspended .acct-block-icon { background: rgba(245,158,11,.15); color: #d97706; }
.acct-block.is-banned .acct-block-icon { background: rgba(239,68,68,.15); color: #dc2626; }
.acct-block-body h2 { margin: 4px 0 0; font-size: 20px; }
.acct-block-text { margin: 0; color: var(--text-muted); line-height: 1.6; font-size: 14.5px; }
.acct-block-actions { justify-content: center; margin-top: 10px; width: 100%; }
@keyframes acctPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .acct-block-icon { animation: none; } }

/* Admin-managed page link buttons */
.page-links { margin: 0 0 18px; }
.page-links-heading { margin: 0 0 10px; font-size: 17px; }
.page-links-row { display: flex; flex-wrap: wrap; gap: 10px; }
.page-links-row .btn { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 480px) { .page-links-row .btn { flex: 1 1 100%; justify-content: center; } }

/* ---------- v22: smoother everywhere ---------- */
a, button, .btn, input, select, textarea, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@keyframes fsPageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main, .auth-card { animation: fsPageIn .28s cubic-bezier(.2,.7,.2,1) both; }
.card, .mini-card, .campaign-card, .btn { transition-property: transform, box-shadow, background-color, border-color, opacity; transition-duration: .2s; transition-timing-function: ease; }
@media (prefers-reduced-motion: reduce) { main, .auth-card { animation: none; } }
