/* ==========================================================================
   POLISH LAYER — app-feel refinements
   Loaded LAST (after every other stylesheet) so plain selectors win.
   Pure CSS: no markup or JS requirements except the toast classes
   (.toast-icon / .toast-progress / .toast-out) produced by toastSystem.js
   and the .ripple span produced by js/ui/uiPolish.js.
   ========================================================================== */

/* ================== MOTION TOKENS ================== */
:root {
  /* expo-out: fast start, soft landing — the "iOS" curve */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* gentle overshoot for playful elements (toasts, knobs, modals) */
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 340ms;
  /* accent tints derived from the active theme */
  --accent-soft: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent-primary) 35%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

/* ================== GLOBAL RENDERING ================== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* Keyboard focus — one consistent ring everywhere */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none; /* inputs get the box-shadow ring below instead */
}

/* ================== APP-WIDE SCROLLBARS ================== */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ================== HEADER ================== */
.app-header {
  /* follow the active theme instead of the hardcoded navy */
  background: color-mix(in srgb, var(--bg-primary) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
}

.header-title {
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.header-title.title-swap {
  animation: title-swap var(--dur-base) var(--ease-out);
}
@keyframes title-swap {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.icon-btn {
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--bg-tertiary);
}
.icon-btn:active {
  background: var(--bg-elevated);
  transform: scale(0.92);
}

/* Connection dot breathes while online */
.connection-status .status-dot {
  transition: background-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.connection-status .status-dot.online {
  animation: dot-breathe 2.4s ease-in-out infinite;
}
@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 55%, transparent); }
  50%      { box-shadow: 0 0 0 5px transparent; }
}

/* Notification bell badge pops when it appears/changes */
.badge {
  animation: badge-pop var(--dur-slow) var(--ease-spring);
}
@keyframes badge-pop {
  0%   { transform: scale(0.4); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ================== SIDEBAR & NAV ================== */
.sidebar {
  transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) ease;
  border-right: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
}
.sidebar.open {
  box-shadow: 24px 0 64px rgba(0, 0, 0, 0.5);
}

.sidebar-overlay {
  background: rgba(2, 6, 12, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity var(--dur-slow) ease, visibility var(--dur-slow) ease;
}

/* Staggered nav entrance when the drawer opens */
.sidebar.open .nav-item {
  animation: nav-in var(--dur-slow) var(--ease-out) backwards;
}
.sidebar.open .nav-item:nth-child(1) { animation-delay: 30ms; }
.sidebar.open .nav-item:nth-child(2) { animation-delay: 60ms; }
.sidebar.open .nav-item:nth-child(3) { animation-delay: 90ms; }
.sidebar.open .nav-item:nth-child(4) { animation-delay: 120ms; }
.sidebar.open .nav-item:nth-child(5) { animation-delay: 150ms; }
.sidebar.open .nav-item:nth-child(6) { animation-delay: 180ms; }
@keyframes nav-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nav-item {
  position: relative;
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out);
}
.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-item:hover .icon-sm {
  transform: translateX(2px);
}
.nav-item .icon-sm {
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-item:active {
  transform: scale(0.98);
}

/* Active item: soft tint + accent rail instead of a solid block */
.nav-item.active,
.nav-item.active:hover {
  background: var(--accent-soft);
  color: var(--accent-secondary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 60%;
  border-radius: 3px;
  background: var(--accent-primary);
  animation: rail-in var(--dur-slow) var(--ease-spring);
}
@keyframes rail-in {
  from { height: 0; opacity: 0; }
  to   { height: 60%; opacity: 1; }
}

.user-info {
  transition: background-color var(--dur-fast) ease;
}

/* ================== PAGE TRANSITIONS ================== */
.page-entering {
  animation: page-in 280ms var(--ease-out);
}
.page-entering-back {
  animation: page-in-back 280ms var(--ease-out);
}
.page-leaving {
  animation: page-out 180ms ease forwards;
}
@keyframes page-in {
  from { opacity: 0; transform: translateX(16px) scale(0.995); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes page-in-back {
  from { opacity: 0; transform: translateX(-16px) scale(0.995); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes page-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ================== BUTTONS ================== */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-warning,
.btn-success,
.btn-all {
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease,
              background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              opacity var(--dur-fast) ease,
              filter var(--dur-fast) ease;
}

/* Primary: soft top light + hover glow, press sink */
.btn-primary,
.btn.btn-primary {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-primary) 88%, #ffffff 12%) 0%,
    var(--accent-primary) 55%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover,
.btn.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:active,
.btn.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-secondary:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
}
.btn-secondary:active {
  transform: scale(0.97);
}

.btn-danger:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-danger) 30%, transparent);
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  transform: none;
  box-shadow: none;
}

/* Action cards on account detail */
.action-card {
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease,
              background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease;
}
.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.action-card:active {
  transform: scale(0.96);
}
.action-card .action-icon {
  transition: transform var(--dur-base) var(--ease-spring), color var(--dur-fast) ease;
}
.action-card:hover .action-icon {
  transform: scale(1.12);
  color: var(--accent-secondary);
}
.action-card.danger:hover .action-icon {
  color: var(--accent-danger);
}

/* Filter pills */
.filter-btn {
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease;
}
.filter-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}
.filter-btn:active {
  transform: scale(0.95);
}
.filter-btn.active {
  box-shadow: 0 4px 14px var(--accent-glow);
}

.chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  transform: translateY(-1px);
}
.chip:active {
  transform: scale(0.94);
}

.list-item {
  transition: background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out);
}
.list-item:hover {
  background: var(--bg-elevated);
}
.list-item:active {
  transform: scale(0.985);
}

.theme-swatch {
  transition: transform var(--dur-base) var(--ease-spring),
              border-color var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}

/* ================== CARDS ================== */
.stat-card {
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) ease,
              background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease;
}
.stat-card.clickable:hover {
  border-color: var(--border-light);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.settings-card,
.killswitch-card,
.tournament-info-card,
.account-detail-card,
.bulk-summary-card {
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.settings-card:hover {
  border-color: var(--border-light);
}

/* Account rows: smooth hover lift without fighting swipe/selection */
.account-card {
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease,
              background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              opacity var(--dur-fast) ease;
}
@media (hover: hover) {
  .account-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  }
}

/* ================== INPUTS ================== */
.input-group input,
.input-field,
.form-input,
.setting-input,
.amount-input-lg,
.t-form-input,
.t-form-select,
.context-dropdown,
.page-size-select,
.notif-date-select,
.search-input-container {
  transition: border-color var(--dur-fast) ease,
              background-color var(--dur-fast) ease,
              box-shadow var(--dur-base) ease;
}

.input-group input:focus,
.input-field:focus,
.form-input:focus,
.setting-input:focus,
.amount-input-lg:focus,
.t-form-input:focus,
.t-form-select:focus,
.context-dropdown:focus,
.notif-date-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Toggle knobs get a springy travel */
.toggle-slider,
.toggle-slider::before,
.switch .slider,
.switch .slider::before {
  transition: background-color var(--dur-base) ease,
              transform var(--dur-slow) var(--ease-spring),
              box-shadow var(--dur-base) ease,
              left var(--dur-slow) var(--ease-spring);
}

/* ================== MODALS ================== */
.modal-overlay {
  background: rgba(3, 7, 13, 0.62);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  transition: opacity var(--dur-base) ease, visibility var(--dur-base) ease;
}

.modal-card {
  transform: scale(0.94) translateY(24px);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-spring),
              opacity var(--dur-base) ease;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Exit: fade the veil, settle the card down */
.modal-overlay.modal-closing {
  opacity: 0;
  visibility: hidden;
}
.modal-overlay.modal-closing .modal-card {
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition-duration: var(--dur-base);
}

/* Legacy .modal sheets (modal-confirm, modal-password, …): when closed they
   kept a 16px strip peeking at the screen bottom (translateY(100%) from a
   bottom:16px anchor) and, centered on desktop, an invisible opacity:0 box
   that could swallow clicks. Fully retire them while closed — the delayed
   visibility flip preserves the close animation. */
.modal {
  visibility: hidden;
  pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-out),
              opacity var(--dur-base) ease,
              visibility 0s linear var(--dur-slow);
}
.modal.active {
  visibility: visible;
  pointer-events: auto;
  transition: transform var(--dur-slow) var(--ease-out),
              opacity var(--dur-base) ease,
              visibility 0s;
}

/* Bottom-sheet behaviour on phones */
@media (max-width: 640px) {
  #modal-root .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #modal-root .modal-card {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding-bottom: var(--safe-bottom);
    transform: translateY(40px);
    max-height: 88dvh;
  }
  #modal-root .modal-overlay.active .modal-card {
    transform: translateY(0);
  }
  #modal-root .modal-overlay.modal-closing .modal-card {
    transform: translateY(100%);
  }
  /* grab handle */
  #modal-root .modal-card::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-light);
    margin: 10px auto 0;
    flex-shrink: 0;
  }
}

/* ================== TOASTS (markup from toastSystem.js) ================== */
.toast-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Desktop: dock toasts top-right under the header instead of full-width */
@media (min-width: 768px) {
  .toast-container {
    top: calc(var(--header-height) + 12px + var(--safe-top));
    left: auto;
    right: 20px;
    width: auto;
    max-width: 420px;
    align-items: flex-end;
  }
  .toast {
    width: max-content;
    min-width: 280px;
  }
}

.toast {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: toast-in var(--dur-slow) var(--ease-spring) backwards;
}

/* retire the old left color bar — the icon chip carries the type now */
.toast.success, .toast.error, .toast.warning, .toast.info {
  border-left: 1px solid var(--border-light);
}

/* components.css sets `.toast span { flex: 1 }` — only the message may grow */
.toast span {
  flex: 0 0 auto;
}
.toast .toast-msg {
  flex: 1 1 auto;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-out {
  animation: toast-out var(--dur-base) var(--ease-out) forwards;
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

.toast-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast.success .toast-icon { background: color-mix(in srgb, var(--accent-success) 16%, transparent); color: var(--accent-success); }
.toast.error   .toast-icon { background: color-mix(in srgb, var(--accent-danger) 16%, transparent);  color: var(--accent-danger); }
.toast.warning .toast-icon { background: color-mix(in srgb, var(--accent-warning) 16%, transparent); color: var(--accent-warning); }
.toast.info    .toast-icon { background: var(--accent-soft); color: var(--accent-secondary); }

/* repeat counter chip ("×3") when the same toast fires again */
.toast-count {
  flex-shrink: 0;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  animation: badge-pop var(--dur-slow) var(--ease-spring);
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  animation: toast-progress linear forwards;
  /* duration set inline by toastSystem.js */
}
.toast.success .toast-progress { background: var(--accent-success); }
.toast.error   .toast-progress { background: var(--accent-danger); }
.toast.warning .toast-progress { background: var(--accent-warning); }
.toast.info    .toast-progress { background: var(--accent-primary); }
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.toast:hover .toast-progress {
  animation-play-state: paused;
}

.toast-close {
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.toast-close:active {
  transform: scale(0.85);
}

/* ================== NOTIFICATION POPUPS (top-right) ================== */
.notification {
  border: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: notif-pop-in var(--dur-slow) var(--ease-spring) backwards;
}
@keyframes notif-pop-in {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.notification.hiding {
  animation: notif-pop-out var(--dur-base) var(--ease-out) forwards;
}
@keyframes notif-pop-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px) scale(0.97); }
}
.notification-close {
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.notification-close:hover {
  color: var(--text-primary);
}
.notification-close:active {
  transform: scale(0.85);
}

/* ================== NOTIFICATIONS PAGE ================== */
.notif-card {
  transition: background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease,
              opacity var(--dur-base) ease;
}
@media (hover: hover) {
  .notif-card:hover {
    transform: translateX(2px);
  }
}
.notif-dismiss {
  transition: color var(--dur-fast) ease,
              background-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out);
}
.notif-dismiss:active {
  transform: scale(0.85);
}
.notif-pill {
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) ease;
}
.notif-pill:active {
  transform: scale(0.94);
}
.notif-pill.active {
  box-shadow: 0 4px 14px var(--accent-glow);
}
.notif-wd-bar {
  transition: height var(--dur-slow) var(--ease-out), background-color var(--dur-fast) ease;
}

/* ================== EMPTY STATES ================== */
.empty-state .empty-icon,
.freebets-empty .empty-icon,
.notif-empty-icon,
.odds-empty .icon-md,
.t-empty i,
.t-snipers-empty i {
  animation: empty-float 3.4s ease-in-out infinite;
}
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ================== ACTION BARS ================== */
.settings-action-bar,
.bulk-action-bar,
.bottom-bar:not(.hidden) {
  animation: bar-rise var(--dur-slow) var(--ease-out);
}
@keyframes bar-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bottom-actions .icon-btn {
  transition: background-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-spring);
}
.bottom-actions .icon-btn:active {
  transform: scale(0.85);
}

/* Pagination buttons */
.pagination-controls button,
.page-size-select {
  transition: background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out);
}
.pagination-controls button:active {
  transform: scale(0.92);
}

/* ================== RIPPLE (spans injected by js/ui/uiPolish.js) ================== */
.ripple-host {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: 0.18;
  transform: scale(0);
  animation: ripple-grow 480ms var(--ease-out) forwards;
}
@keyframes ripple-grow {
  to { transform: scale(1); opacity: 0; }
}

/* ================== RESPONSIVE FIXES ================== */
/* 640–1199px: two account columns don't fit — with the sidebar pinned
   (≥768px, 260px wide) the content area is ~500–940px, and the card's
   checkbox + status pill + profile chip overlap when squeezed.
   One comfortable column until there's real room for two (≥1200px). */
@media (min-width: 640px) and (max-width: 1199px) {
  .account-list {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
  }
  .stats-row .stat-card {
    min-width: 0;
  }
}

/* 1024–1199px: six stats fit in one row — fill it instead of cropping */
@media (min-width: 1024px) and (max-width: 1199px) {
  .stats-row {
    overflow-x: visible;
  }
  .stats-row .stat-card {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Phones keep the swipeable stats strip, but snap card-by-card */
@media (max-width: 767px) {
  .stats-row {
    scroll-snap-type: x proximity;
    scroll-padding-left: 16px;
  }
  .stats-row .stat-card {
    scroll-snap-align: start;
  }
}

/* Mobile .account-right cap: the 90px override in styles.css is written
   BEFORE the base rule that sets 160px, so it never wins the cascade and
   cards overflowed the viewport. */
@media (max-width: 639px) {
  .account-card .account-right {
    width: auto;
    max-width: 104px;
  }
}

/* The account identity block must never collapse — truncate instead */
.account-card .account-info {
  min-width: 130px;
}
.account-card .account-right {
  min-width: 0;
}
.account-card .status-pill {
  flex-shrink: 0; /* the name ellipsizes; the pill must never get mid-letter clipped */
}
.account-card .account-profile {
  min-width: 0;
  max-width: 100%;
}
.account-card .profile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================== SKELETONS ================== */
.skeleton {
  animation-duration: 1.2s;
}

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