/* Split from website/static/css/pages.css. Keep selector order compatible with the original cascade. */

.profile-shell,
.profile-transactions-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  min-width: 0;
}

.profile-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-info-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-settings-trigger,
.profile-transactions-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.038);
  color: #f5f7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.profile-settings-trigger svg,
.profile-transactions-back svg {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-settings-trigger:active,
.profile-transactions-back:active {
  transform: scale(0.97);
}

.profile-settings-trigger:focus-visible,
.profile-transactions-back:focus-visible {
  outline: none;
  border-color: rgba(132, 199, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
}

.profile-avatar,
.profile-settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #d9d9d9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.profile-avatar.has-image,
.profile-settings-avatar.has-image {
  background: transparent;
}

.profile-avatar-img,
.profile-settings-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar.has-image .profile-avatar-img,
.profile-settings-avatar.has-image .profile-settings-avatar-img {
  display: block;
}

.profile-avatar-initials,
.profile-settings-avatar-initials {
  font-size: 18px;
  font-weight: 600;
  color: #111111;
}

.profile-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
}

.profile-handle {
  font-size: 12px;
  line-height: 16px;
  color: #7d808d;
}

.profile-balance-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 92% 6%, rgba(64, 104, 224, 0.13) 0%, rgba(64, 104, 224, 0) 44%),
    linear-gradient(180deg, rgba(39, 42, 54, 0.96), rgba(28, 31, 40, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.profile-balance-header,
.profile-balance-row,
.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-balance-row {
  flex-wrap: nowrap;
}

.profile-balance-label,
.profile-section-title,
.profile-section-label {
  font-size: 12px;
  font-weight: 300;
  line-height: 22px;
  color: #b6b6b6;
}

.profile-balance-mark,
.profile-section-label {
  display: inline-flex;
  align-items: center;
}

.profile-balance-mark svg {
  width: 10px;
  height: 15px;
}

.profile-balance-value {
  font-size: 24px;
  line-height: 29px;
  color: #ffffff;
  letter-spacing: 0.5px;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(21, 44, 88, 0.94) 0%, rgba(47, 101, 205, 0.9) 100%);
  border: 1px solid rgba(113, 173, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.14s ease, background 0.14s ease;
  flex: 0 0 auto;
}

.profile-topup-icon svg {
  width: 15px;
  height: 15px;
}

.profile-topup:active {
  transform: scale(0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-topup:focus-visible {
  outline: none;
  border-color: rgba(118, 185, 255, 0.48);
  background: linear-gradient(90deg, rgba(24, 51, 102, 0.96) 0%, rgba(59, 113, 219, 0.92) 100%);
}

.profile-transactions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid #434550;
}

.profile-section-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.profile-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.profile-filter-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b6b6b6;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.profile-filter-toggle svg {
  width: 18px;
  height: 18px;
}

.profile-filter-toggle svg path {
  fill: currentColor;
}

.profile-filter-toggle:active {
  transform: scale(0.97);
}

.profile-filter-toggle:focus-visible {
  outline: none;
  border-color: rgba(20, 223, 122, 0.38);
}

.profile-filter-toggle.active {
  color: #14df7a;
  border-color: rgba(20, 223, 122, 0.35);
  background: rgba(20, 223, 122, 0.08);
}

.profile-transactions-list,
.profile-transactions-detail,
.profile-transaction-group__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-transaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
  overflow: hidden;
}

.profile-transaction--detail {
  padding: 14px 0;
}

.profile-transaction-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.profile-transaction-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(38, 40, 50, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-transaction-badge svg {
  width: auto;
  height: 16px;
  max-width: 22px;
  max-height: 22px;
  display: block;
  flex: none;
}

.profile-transaction-badge[data-badge='visa'] svg {
  width: 34px;
  height: 34px;
}

.profile-transaction-badge[data-badge='visa'] {
  background: transparent;
  border: none;
  box-shadow: none;
}

.profile-transaction-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.profile-transaction-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-transaction-time {
  font-size: 12px;
  font-weight: 300;
  line-height: 18px;
  color: #b6b6b6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-transaction-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  flex: 0 0 auto;
  max-width: 96px;
  min-width: 48px;
}

.profile-transaction-credits,
.profile-transaction-amount {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #b6b6b6;
}

.profile-transaction-amount:empty {
  display: none;
}

.profile-transaction-credits {
  color: #14df7a;
  white-space: nowrap;
}

.profile-transaction--negative .profile-transaction-credits {
  color: #f66164;
}

.profile-view-all-link {
  border: none;
  background: transparent;
  color: #f5f7ff;
  padding: 3px 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.78;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.15s ease;
}

.profile-view-all-link:active {
  transform: scale(0.97);
}

.profile-view-all-link:focus-visible {
  outline: none;
  color: #ffffff;
  opacity: 1;
}

.profile-empty {
  color: #a8b2d1;
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}

.profile-transaction-skeleton {
  display: grid;
  grid-template-columns: 34px 1fr 42px;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-transaction-skeleton span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  background-size: 180% 100%;
  animation: profile-skeleton-pulse 1.2s ease-in-out infinite;
}

.profile-transaction-skeleton span:first-child {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.profile-transaction-skeleton span:last-child {
  width: 42px;
  justify-self: end;
}

@keyframes profile-skeleton-pulse {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -80% 0;
  }
}

.profile-transactions-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-transactions-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-transaction-filters {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(44, 48, 62, 0.94), rgba(33, 37, 48, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: fit-content;
  isolation: isolate;
  overflow: hidden;
}

.profile-transaction-ranges {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 5px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(43, 47, 60, 0.92), rgba(31, 35, 45, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.045);
  overflow: hidden;
  isolation: isolate;
}

.profile-segmented-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--segmented-pill-w, 0px);
  height: var(--segmented-pill-h, 0px);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(26, 101, 71, 0.95), rgba(16, 78, 54, 0.98));
  border: 1px solid rgba(71, 216, 140, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translate3d(var(--segmented-pill-x, 0px), var(--segmented-pill-y, 0px), 0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
  will-change: transform, width, height, opacity;
}

.profile-transaction-filters.is-pill-ready .profile-segmented-pill,
.profile-transaction-ranges.is-pill-ready .profile-segmented-pill {
  opacity: 1;
}

.profile-transaction-filters.is-pill-static .profile-segmented-pill,
.profile-transaction-ranges.is-pill-static .profile-segmented-pill {
  transition: none;
}

.profile-transaction-ranges.is-custom-mode .profile-segmented-pill {
  opacity: 0;
}

.profile-transaction-filter,
.profile-transaction-range {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  min-height: 42px;
  border-radius: 13px;
  background: transparent;
  color: #a8b0c7;
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.profile-transaction-filter {
  padding: 0 18px;
}

.profile-transaction-range {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
}

.profile-transaction-filter.is-active,
.profile-transaction-range.is-active {
  color: #14df7a;
}

.profile-transaction-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-transaction-overview,
.profile-transactions-detail {
  will-change: height;
}

.profile-analytics-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(140% 180% at 100% 0%, rgba(77, 110, 228, 0.08) 0%, rgba(77, 110, 228, 0) 42%),
    radial-gradient(120% 140% at 0% 100%, rgba(27, 122, 81, 0.07) 0%, rgba(27, 122, 81, 0) 48%),
    linear-gradient(180deg, rgba(39, 43, 55, 0.96), rgba(25, 29, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  overflow: visible;
}

.profile-analytics-card.is-loading {
  min-height: 354px;
  background: linear-gradient(90deg, rgba(38, 40, 50, 0.92), rgba(55, 58, 72, 0.65), rgba(38, 40, 50, 0.92));
  background-size: 180% 100%;
  animation: profile-card-shimmer 1.2s linear infinite;
}

@keyframes profile-card-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.profile-analytics-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.profile-analytics-summary__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 220px;
}

.profile-analytics-summary__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.profile-analytics-summary__eyebrow {
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.03em;
  color: #9ca4ba;
}

.profile-analytics-summary__value {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 0.96;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.profile-analytics-summary__meta {
  font-size: 12px;
  line-height: 17px;
  color: #9da6bf;
}

.profile-analytics-summary__meta .profile-value-animate,
.profile-analytics-legend-item__meta .profile-value-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.profile-analytics-summary--positive .profile-analytics-summary__value {
  color: #14df7a;
}

.profile-analytics-summary--negative .profile-analytics-summary__value {
  color: #f66164;
}

.profile-analytics-range-shell {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

.profile-analytics-range-clear {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #c6cede;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-analytics-range-clear svg {
  width: 16px;
  height: 16px;
  display: block;
}

.profile-analytics-range-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e5e9f4;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-analytics-range-chip svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #aeb6c9;
  transition: transform 0.2s ease;
}

.profile-analytics-range-shell.is-open .profile-analytics-range-chip svg {
  transform: rotate(180deg);
}

.profile-analytics-range-chip:active,
.profile-analytics-range-clear:active,
.profile-range-dropdown__action:active {
  transform: scale(0.98);
}

.profile-analytics-range-chip:focus-visible,
.profile-analytics-range-clear:focus-visible,
.profile-range-dropdown__action:focus-visible {
  outline: none;
  border-color: rgba(124, 188, 255, 0.3);
  background: rgba(255, 255, 255, 0.065);
}

.profile-range-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  width: min(344px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(140% 180% at 100% 0%, rgba(77, 110, 228, 0.08) 0%, rgba(77, 110, 228, 0) 42%),
    radial-gradient(120% 140% at 0% 100%, rgba(27, 122, 81, 0.07) 0%, rgba(27, 122, 81, 0) 48%),
    linear-gradient(180deg, rgba(39, 43, 55, 0.985), rgba(24, 28, 37, 0.995));
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 24px 48px rgba(2, 6, 15, 0.34);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-range-dropdown[data-range-months="2"] {
  width: min(540px, calc(100vw - 32px));
}

.profile-analytics-range-shell.is-open .profile-range-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-range-dropdown__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.profile-range-dropdown__title {
  font-size: 14px;
  line-height: 19px;
  font-weight: 600;
  color: #f6f8ff;
}

.profile-range-dropdown__subtitle {
  font-size: 11px;
  line-height: 15px;
  color: #9ea8c2;
}

.profile-range-dropdown__calendar {
  position: relative;
}

.profile-range-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-range-dropdown__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.profile-range-dropdown__actions-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-range-dropdown__action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}

.profile-range-dropdown__action--primary {
  background: linear-gradient(180deg, rgba(60, 66, 84, 0.98), rgba(73, 79, 96, 0.98));
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-range-dropdown__action--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.profile-range-dropdown__action[disabled] {
  opacity: 0.45;
  cursor: default;
}

.profile-flatpickr.flatpickr-calendar {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #eef2ff;
  font-family: inherit;
}

.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .flatpickr-rContainer,
.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .flatpickr-days,
.profile-range-dropdown[data-range-months="1"] .profile-flatpickr .dayContainer {
  min-width: 100% !important;
  width: 100% !important;
}

.profile-flatpickr .flatpickr-months {
  margin-bottom: 8px;
}

.profile-flatpickr .flatpickr-month {
  color: #f5f7ff;
}

.profile-flatpickr .flatpickr-current-month {
  padding-top: 2px;
  font-size: 14px;
}

.profile-flatpickr .flatpickr-current-month .flatpickr-monthDropdown-months,
.profile-flatpickr .flatpickr-current-month input.cur-year {
  color: #f5f7ff;
  font-size: 14px;
  font-weight: 600;
}

.profile-flatpickr .flatpickr-prev-month,
.profile-flatpickr .flatpickr-next-month {
  top: 4px;
  color: #aeb7cb;
  fill: currentColor;
}

.profile-flatpickr .flatpickr-prev-month:hover,
.profile-flatpickr .flatpickr-next-month:hover {
  color: #ffffff;
}

.profile-flatpickr .flatpickr-weekdays {
  background: transparent;
}

.profile-flatpickr span.flatpickr-weekday {
  color: #7f89a3;
  font-size: 11px;
  font-weight: 600;
}

.profile-flatpickr .dayContainer {
  gap: 2px 0;
}

.profile-flatpickr .flatpickr-day {
  color: #dce2f0;
  border-radius: 12px;
  border: 1px solid transparent;
  max-width: none;
}

.profile-flatpickr .flatpickr-day.flatpickr-disabled,
.profile-flatpickr .flatpickr-day.flatpickr-disabled:hover,
.profile-flatpickr .flatpickr-day.prevMonthDay,
.profile-flatpickr .flatpickr-day.nextMonthDay {
  color: rgba(128, 137, 160, 0.38);
}

.profile-flatpickr .flatpickr-day:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-flatpickr .flatpickr-day.today {
  border-color: rgba(78, 164, 255, 0.28);
}

.profile-flatpickr .flatpickr-day.inRange,
.profile-flatpickr .flatpickr-day.prevMonthDay.inRange,
.profile-flatpickr .flatpickr-day.nextMonthDay.inRange {
  background: rgba(24, 220, 123, 0.12);
  border-color: transparent;
  box-shadow: none;
}

.profile-flatpickr .flatpickr-day.selected,
.profile-flatpickr .flatpickr-day.startRange,
.profile-flatpickr .flatpickr-day.endRange,
.profile-flatpickr .flatpickr-day.selected:hover,
.profile-flatpickr .flatpickr-day.startRange:hover,
.profile-flatpickr .flatpickr-day.endRange:hover {
  background: linear-gradient(180deg, rgba(24, 220, 123, 0.9), rgba(18, 173, 96, 0.92));
  border-color: rgba(24, 220, 123, 0.25);
  color: #07160f;
}

.profile-analytics-chart {
  display: grid;
  grid-template-columns: repeat(var(--chart-columns, 1), minmax(0, 1fr));
  align-items: end;
  gap: var(--chart-gap, 10px);
  min-height: 210px;
  min-width: 0;
  overflow: hidden;
}

.profile-chart-column {
  display: grid;
  grid-template-rows: 12px minmax(144px, 1fr) 16px;
  gap: 8px;
  min-width: 0;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms);
}

.profile-chart-value {
  font-size: 9px;
  line-height: 11px;
  color: #8892ad;
  text-align: center;
  white-space: nowrap;
}

.profile-chart-rail {
  position: relative;
  height: 160px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.profile-chart-stack {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: calc((100% - 10px) * var(--bar-height, 0) / 100);
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  transform-origin: bottom center;
  transform: scaleY(0.001);
  opacity: 0.55;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--chart-enter-delay, 0ms),
    opacity 0.24s ease var(--chart-enter-delay, 0ms),
    height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-chart-segment {
  border: none;
  padding: 0;
  width: 100%;
  height: calc(var(--segment-height, 0) * 1%);
  min-height: 7px;
  border-radius: 10px;
  background: var(--segment-color, #14df7a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.profile-chart-label {
  font-size: 11px;
  line-height: 15px;
  color: #a6aec3;
  text-align: center;
  min-width: 0;
}

.profile-analytics-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-analytics-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 176px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #a8b2d1;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.profile-transaction-overview.is-animating .profile-chart-column,
.profile-transaction-overview.is-animating .profile-analytics-empty {
  opacity: 1;
  transform: translateY(0);
}

.profile-transaction-overview.is-animating .profile-chart-stack {
  transform: scaleY(1);
  opacity: 1;
}

.profile-analytics-chart--compact .profile-chart-value,
.profile-analytics-chart--dense .profile-chart-value {
  font-size: 8px;
  line-height: 10px;
}

.profile-analytics-chart--compact .profile-chart-label {
  font-size: 10px;
  line-height: 14px;
}

.profile-analytics-chart--dense .profile-chart-label {
  font-size: 9px;
  line-height: 13px;
}

.profile-analytics-chart--dense .profile-chart-column {
  gap: 8px;
}

.profile-range-error {
  font-size: 12px;
  line-height: 16px;
  color: #f47b81;
  margin-top: 8px;
}

.profile-analytics-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.03);
  color: #f5f7ff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-analytics-legend-item__swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--legend-color, #14df7a);
}

.profile-analytics-legend-item__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.profile-analytics-legend-item__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: #ffffff;
}

.profile-analytics-legend-item__meta {
  font-size: 11px;
  line-height: 15px;
  color: #a5aec3;
}

.profile-chart-segment.is-selected,
.profile-analytics-legend-item.is-selected {
  opacity: 1;
}

.profile-chart-segment.is-selected {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

.profile-analytics-legend-item.is-selected {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.profile-chart-segment.is-dimmed,
.profile-analytics-legend-item.is-dimmed {
  opacity: 0.28;
  filter: saturate(0.72);
}

.profile-value-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transform-origin: center center;
  will-change: filter, transform, opacity;
  transition:
    filter 116ms var(--motion-ease-soft),
    transform 116ms var(--motion-ease-soft),
    opacity 116ms var(--motion-ease-soft);
}

.profile-value-animate.is-updating {
  filter: blur(2.8px);
  transform: scale(0.95);
  opacity: 0.8;
}

.profile-value-animate.is-overshooting {
  filter: blur(1.1px);
  transform: scale(1.045);
  opacity: 0.94;
}

.profile-transaction-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-transaction-group__header {
  padding-top: 6px;
}

.profile-transaction-group__label {
  font-size: 13px;
  line-height: 18px;
  color: #9ba2b7;
  letter-spacing: 0.01em;
}

.profile-settings-modal {
  z-index: 60;
}

.profile-settings-card {
  max-width: none;
  width: min(448px, calc(100vw - 14px));
  background:
    linear-gradient(180deg, rgba(31, 34, 44, 0.985), rgba(21, 24, 33, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
  border-radius: 24px;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.profile-settings-card .history-modal-header {
  padding: 13px 13px 10px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
}

.profile-settings-card .history-modal-heading {
  gap: 8px;
}

.profile-settings-card .modal-question {
  font-size: 17px;
  line-height: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-settings-card .modal-desc {
  max-width: 320px;
  font-size: 12px;
  line-height: 17px;
  color: #9ba3b8;
}

.profile-settings-card .history-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.profile-settings-card .history-modal-close svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
}

.profile-settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 13px 8px;
}

.profile-settings-avatar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.042);
  background:
    linear-gradient(135deg, rgba(91, 114, 255, 0.07), rgba(255, 255, 255, 0.016) 55%, rgba(116, 228, 196, 0.04));
}

.profile-settings-avatar-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-settings-avatar-title,
.profile-settings-linkage-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.profile-settings-avatar-desc {
  font-size: 12px;
  line-height: 16px;
  color: #9ba2b7;
}

.profile-settings-card .history-modal-label {
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8d95aa;
}

.profile-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.profile-settings-card .modal-input {
  min-height: 46px;
  padding: 0 13px;
  border-radius: 15px;
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.022);
}

.profile-settings-avatar-btn {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.profile-settings-avatar-btn:active,
.profile-session-action:active {
  transform: scale(0.98);
}

.profile-settings-avatar-btn:focus-visible,
.profile-session-action:focus-visible {
  outline: none;
  border-color: rgba(132, 199, 255, 0.28);
}

.profile-settings-chat-footer {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.024);
}

.profile-settings-chat-footer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-settings-chat-footer__title {
  font-size: 13px;
  font-weight: 650;
  color: #ffffff;
}

.profile-settings-chat-footer__desc {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: #9ba2b7;
}

.profile-settings-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-settings-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.025);
  color: #eef3ff;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease, color 0.16s ease;
}

.profile-settings-choice span {
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
}

.profile-settings-choice small {
  color: #939cb2;
  font-size: 11px;
  line-height: 14px;
}

.profile-settings-choice.is-active {
  color: #ffffff;
  background: rgba(124, 92, 255, 0.13);
  border-color: rgba(160, 140, 255, 0.26);
}

.profile-settings-choice.is-active small {
  color: rgba(226, 231, 255, 0.78);
}

.profile-settings-choice:active {
  transform: scale(0.985);
}

.profile-settings-choice:focus-visible {
  outline: none;
  border-color: rgba(132, 199, 255, 0.3);
}

.profile-settings-choice:disabled {
  cursor: default;
}

.profile-session-action--danger:focus-visible {
  border-color: rgba(244, 123, 129, 0.28);
}

.profile-settings-linkage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.022), rgba(97, 165, 255, 0.038) 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.profile-settings-linkage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #aeb3c4;
}

.profile-settings-linkage-row strong {
  color: #ffffff;
  font-weight: 500;
  text-align: right;
}

.profile-settings-session-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0;
}

.profile-session-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.024);
  color: #f5f7ff;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
}

.profile-session-action__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.92);
}

.profile-session-action__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-session-action--danger {
  color: #f47b81;
  border-color: rgba(244, 123, 129, 0.12);
  background: rgba(244, 123, 129, 0.04);
}

.profile-settings-card .history-modal-actions {
  padding: 10px 13px 13px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
}

.profile-settings-card .modal-btn {
  min-height: 44px;
  border-radius: 15px;
}

.profile-settings-card .modal-btn.secondary {
  background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 940px) {
  .profile-analytics-summary {
    flex-wrap: wrap;
  }

  .profile-analytics-summary__copy {
    flex-basis: 100%;
  }

  .profile-analytics-summary__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 540px) {
  .profile-balance-row {
    flex-direction: row;
    align-items: center;
  }

  .profile-topup {
    width: auto;
  }

  .profile-analytics-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-range-dropdown {
    width: min(344px, calc(100vw - 32px));
  }

  .profile-analytics-summary__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .profile-analytics-chart {
    gap: var(--chart-gap, 6px);
    min-height: 188px;
  }

  .profile-chart-column {
    grid-template-rows: 10px minmax(132px, 1fr) 15px;
    gap: 7px;
  }

  .profile-chart-rail {
    height: 142px;
    border-radius: 16px;
  }

  .profile-analytics-legend {
    grid-template-columns: 1fr;
  }

  .profile-settings-avatar-row {
    align-items: flex-start;
  }

  .profile-settings-card .history-modal-header,
  .profile-settings-body,
  .profile-settings-card .history-modal-actions {
    padding-left: 13px;
    padding-right: 13px;
  }
}

@media (max-width: 420px) {
  .profile-settings-fields {
    grid-template-columns: 1fr;
  }

  .profile-settings-toggle-group {
    grid-template-columns: 1fr;
  }

  .profile-session-action {
    flex-basis: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .profile-settings-trigger:hover,
  .profile-transactions-back:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .profile-topup:hover {
    transform: scale(0.99);
    opacity: 0.96;
    background: linear-gradient(90deg, rgba(23, 48, 97, 0.96) 0%, rgba(58, 112, 219, 0.92) 100%);
    border-color: rgba(124, 190, 255, 0.38);
  }

  .profile-filter-toggle:hover {
    opacity: 0.92;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
  }

  .profile-view-all-link:hover {
    color: #ffffff;
    opacity: 1;
  }

  .profile-transaction-filter:hover,
  .profile-transaction-range:hover {
    color: #d8def0;
  }

  .profile-analytics-range-chip:hover,
  .profile-analytics-range-clear:hover,
  .profile-range-dropdown__action:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .profile-range-dropdown__action--primary:hover {
    background: linear-gradient(180deg, rgba(74, 80, 99, 0.98), rgba(86, 93, 112, 0.98));
  }

  .profile-settings-avatar-btn:hover,
  .profile-session-action:hover {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.13);
  }

  .profile-session-action--danger:hover {
    background: rgba(244, 123, 129, 0.11);
    border-color: rgba(244, 123, 129, 0.28);
  }

  .profile-chart-segment:hover,
  .profile-analytics-legend-item:hover {
    opacity: 0.92;
  }

  .profile-analytics-legend-item:hover {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.042);
  }
}

.profile-auth-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0 8px;
}

/* Mini App UX: session ending controls are only relevant for browser sessions. */
body.tg-webapp .profile-auth-actions {
  display: none;
}

.profile-auth-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7ff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

.profile-auth-btn--danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}
