:root {
  color-scheme: light;
  --app-bg: #f5f5f7;
  --app-bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-secondary: rgba(255, 255, 255, 0.58);
  --surface-tertiary: rgba(118, 118, 128, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.96);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --separator: rgba(60, 60, 67, 0.16);
  --separator-strong: rgba(60, 60, 67, 0.25);
  --accent: #007aff;
  --accent-rgb: 0, 122, 255;
  --accent-soft: rgba(0, 122, 255, 0.11);
  --accent-strong: #0066d6;
  --green: #28a745;
  --green-rgb: 40, 167, 69;
  --green-soft: rgba(40, 167, 69, 0.12);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.12);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, 0.14);
  --purple: #af52de;
  --purple-soft: rgba(175, 82, 222, 0.12);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 14px 42px rgba(0, 0, 0, 0.07);
  --shadow-float: 0 18px 54px rgba(0, 0, 0, 0.14);
  --blur-material: blur(28px) saturate(1.35);
  --radius-large: 28px;
  --radius-card: 22px;
  --radius-control: 14px;
  --content-width: 1120px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #000000;
  --app-bg-elevated: #1c1c1e;
  --surface: rgba(28, 28, 30, 0.78);
  --surface-solid: #1c1c1e;
  --surface-secondary: rgba(44, 44, 46, 0.72);
  --surface-tertiary: rgba(118, 118, 128, 0.18);
  --surface-hover: rgba(58, 58, 60, 0.88);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --separator: rgba(84, 84, 88, 0.52);
  --separator-strong: rgba(99, 99, 102, 0.68);
  --accent: #0a84ff;
  --accent-rgb: 10, 132, 255;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-strong: #64a9ff;
  --green: #30d158;
  --green-rgb: 48, 209, 88;
  --green-soft: rgba(48, 209, 88, 0.16);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.17);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.18);
  --purple: #bf5af2;
  --purple-soft: rgba(191, 90, 242, 0.18);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 52px rgba(0, 0, 0, 0.34);
  --shadow-float: 0 22px 64px rgba(0, 0, 0, 0.54);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--app-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 50% -340px, rgba(var(--accent-rgb), 0.15), transparent 72%),
    var(--app-bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.55;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 48px;
  mask-image: linear-gradient(to bottom, black, transparent 45%);
}

html.auth-syncing body > *,
html.auth-blocked body > * {
  visibility: hidden !important;
}

html.auth-syncing body::after,
html.auth-blocked body::after {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--text-primary);
  background: var(--app-bg);
  visibility: visible;
  content: "Проверяем доступ…";
  font: 600 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  text-align: center;
}

html.auth-blocked body::after {
  content: "Сессия другого Telegram-аккаунта заблокирована. Закройте приложение и откройте его кнопкой нужного бота.";
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.22);
}

:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.38);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: calc(10px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  z-index: 10000;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  transform: translateY(-180%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

#app-content {
  min-height: 100vh;
  min-height: 100dvh;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding:
    calc(18px + var(--safe-top))
    max(16px, var(--safe-right))
    calc(34px + var(--safe-bottom))
    max(16px, var(--safe-left));
}

.has-app-tabbar .page-shell {
  padding-bottom: calc(112px + var(--safe-bottom));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-header__copy {
  min-width: 0;
}

.page-eyebrow,
.section-title {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title,
.lead-title {
  margin: 6px 0 0;
  color: var(--text-primary);
  font-size: clamp(32px, 7vw, 48px);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.page-subtitle {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.muted {
  color: var(--text-secondary) !important;
}

.surface,
.glass {
  background: var(--surface);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.surface-secondary,
.glass-soft {
  background: var(--surface-secondary);
  border: 1px solid var(--separator);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
}

.hero {
  position: relative;
  overflow: visible;
  padding: 22px;
  border-radius: var(--radius-large);
}

.panel {
  padding: 18px;
  border-radius: var(--radius-card);
}

.tile {
  display: block;
  padding: 18px;
  border-radius: var(--radius-card);
  transition:
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    transform 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

@media (hover: hover) {
  .tile:hover,
  .metric-card:hover {
    z-index: 1;
    background: var(--surface-hover);
    border-color: rgba(var(--accent-rgb), 0.28);
    box-shadow: var(--shadow-float);
    transform: translateY(-3px);
  }
}

.tile:active,
.metric-card:active {
  transform: scale(0.985);
}

.icon-badge,
.metric-card__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 13px;
}

.icon-badge svg,
.metric-card__icon svg {
  width: 23px;
  height: 23px;
}

.button,
.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 650;
  background: var(--surface-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 160ms var(--ease-out);
}

.button:hover,
.back-button:hover {
  background: var(--accent-soft);
}

.button:active,
.back-button:active {
  transform: scale(0.97);
}

.button--primary {
  color: #fff;
  background: var(--accent);
}

.button--primary:hover {
  background: var(--accent-strong);
}

.button--secondary {
  color: var(--text-primary);
  background: var(--surface-tertiary);
  border-color: var(--separator);
}

.back-button {
  width: 44px;
  padding: 0;
  border-radius: 50%;
}

.back-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 999px;
}

.status-pill--live {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(var(--green-rgb), 0.2);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), 0.1);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-width: 0;
  min-height: 168px;
  padding: 17px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
  transition:
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    transform 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.metric-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-card__arrow {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  color: var(--text-tertiary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 180ms var(--ease-out);
}

.metric-card:hover .metric-card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.metric-card__body {
  display: block;
  margin-top: 23px;
}

.metric-card__label {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card__value {
  display: block;
  margin: 5px 0 0;
  color: var(--text-primary);
  font-size: clamp(25px, 5vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.metric-card__value.metric-card__value--tariff {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 3.4vw, 25px);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.metric-card__meta {
  display: block;
  margin: 7px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.metric-card--green .metric-card__icon {
  color: var(--green);
  background: var(--green-soft);
}

.metric-card--orange .metric-card__icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric-card--purple .metric-card__icon {
  color: var(--purple);
  background: var(--purple-soft);
}

.period-picker,
.seg {
  display: flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 14px;
  scrollbar-width: none;
}

.period-picker::-webkit-scrollbar,
.seg::-webkit-scrollbar {
  display: none;
}

.period-picker__button,
.chip {
  flex: 1 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.period-picker__button[aria-pressed="true"],
.period-picker__button[data-active="1"],
.chip[data-active="1"] {
  color: var(--text-primary);
  background: var(--surface-solid);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.date-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.field {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text-primary);
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field:focus {
  background: var(--surface-solid);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.field::-webkit-calendar-picker-indicator {
  opacity: 0.72;
}

html[data-theme="dark"] .field::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.chart-card,
.chart-shell {
  padding: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-card__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.chart-card__subtitle {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.chart-frame {
  position: relative;
  min-height: 280px;
}

.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.inset-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.inset-list__row {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
}

.inset-list__row + .inset-list__row::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  content: "";
  background: var(--separator);
}

.empty-state,
.error-state,
.load-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 30px 18px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-tertiary);
  background: var(--surface-tertiary);
  border-radius: 18px;
}

.empty-state__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.empty-state__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 680;
}

.empty-state__text {
  max-width: 400px;
  margin: 6px auto 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-wait {
  display: grid;
  min-height: min(640px, calc(100vh - 96px));
  min-height: min(640px, calc(100dvh - 96px));
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: clamp(32px, 8vw, 64px) 20px;
  text-align: center;
}

.auth-wait__visual {
  position: relative;
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  color: var(--accent);
}

.auth-wait__ring {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 28px rgba(var(--accent-rgb), 0.12);
  animation: auth-ring-spin 1.15s linear infinite;
}

.auth-wait__visual::before {
  width: 54px;
  height: 54px;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.18)),
    var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(var(--accent-rgb), 0.18);
}

.auth-wait__visual::after {
  position: absolute;
  width: 25px;
  height: 25px;
  content: "";
  background: currentColor;
  clip-path: polygon(7% 45%, 92% 9%, 70% 90%, 47% 63%, 30% 78%, 35% 57%);
}

.auth-wait__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.34;
  animation: auth-dot-pulse 1.4s ease-in-out infinite;
}

.auth-wait__dot--one {
  top: 10px;
  right: 23px;
}

.auth-wait__dot--two {
  right: 8px;
  bottom: 30px;
  animation-delay: 0.2s;
}

.auth-wait__dot--three {
  bottom: 14px;
  left: 26px;
  animation-delay: 0.4s;
}

.auth-wait__copy {
  display: grid;
  max-width: 460px;
  gap: 8px;
}

.auth-wait .page-title,
.auth-wait .page-subtitle,
.auth-wait .page-eyebrow {
  margin-right: auto;
  margin-left: auto;
}

.auth-wait .load-state,
.auth-wait .error-state {
  width: min(100%, 430px);
  min-height: 84px;
  padding: 14px;
}

.auth-wait__bar {
  position: relative;
  width: min(100%, 260px);
  height: 5px;
  overflow: hidden;
  background: var(--surface-tertiary);
  border-radius: 999px;
}

.auth-wait__bar::after {
  position: absolute;
  inset: 0;
  width: 45%;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: inherit;
  animation: auth-bar-slide 1.2s ease-in-out infinite;
}

.auth-help[hidden] {
  display: none;
}

@keyframes auth-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes auth-dot-pulse {
  50% {
    opacity: 0.9;
    transform: scale(1.35);
  }
}

@keyframes auth-bar-slide {
  from {
    transform: translateX(-115%);
  }

  to {
    transform: translateX(255%);
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: var(--surface-tertiary);
  border-radius: 8px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.42) 50%, transparent 75%);
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}

html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.09) 50%, transparent 75%);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 247, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .loader {
  background: rgba(0, 0, 0, 0.58);
}

.loader.open {
  display: flex;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--separator);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overlay.open {
  display: flex;
}

.sheet {
  width: min(100%, 640px);
  max-height: min(86vh, 760px);
  padding: 20px;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--separator);
  border-radius: 28px;
  box-shadow: var(--shadow-float);
}

/* Dashboard */
.dashboard-page {
  padding-top: calc(22px + var(--safe-top));
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.dashboard-admin {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 999px;
}

.bot-picker {
  position: relative;
  z-index: 30;
  margin-bottom: 14px;
}

.bot-picker__button {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms var(--ease-out);
}

.bot-picker__button:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.bot-picker__button:active {
  transform: scale(0.99);
}

.bot-picker__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--accent);
  font-size: 20px;
  font-weight: 720;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 50%;
}

.bot-avatar--small {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.bot-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-picker__copy {
  min-width: 0;
}

.bot-picker__name {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 680;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-picker__meta {
  display: block;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-picker__chevron {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 180ms var(--ease-out);
}

.bot-picker__button[aria-expanded="true"] .bot-picker__chevron {
  transform: rotate(180deg);
}

.bot-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(58vh, 430px);
  padding: 6px;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--separator);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
}

.bot-menu__list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.bot-option {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  padding: 8px 9px;
  text-align: left;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
}

.bot-option:hover,
.bot-option:focus-visible,
.bot-option[aria-selected="true"] {
  background: var(--surface-tertiary);
}

.bot-option__copy {
  min-width: 0;
  flex: 1;
}

.bot-option__name,
.bot-option__meta {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-option__name {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
}

.bot-option__meta {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.bot-option__check {
  width: 20px;
  height: 20px;
  color: var(--accent);
  opacity: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.bot-option[aria-selected="true"] .bot-option__check {
  opacity: 1;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.online-card {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 28px;
  min-height: 112px;
  align-items: center;
  gap: 13px;
  padding: 16px 17px;
  overflow: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(260px 140px at 0% 50%, rgba(var(--accent-rgb), 0.09), transparent 78%),
    var(--surface);
  border-color: var(--separator);
}

.online-card::after {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  content: "";
  background: var(--accent);
  border-radius: 0 999px 999px 0;
  opacity: 0.72;
}

.online-card__icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 14px;
}

.online-card__icon svg {
  width: 23px;
  height: 23px;
}

.online-card__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.online-card__kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 620;
}

.online-card__dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.online-card__value {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.04em;
}

.online-card__meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-card__secondary {
  display: flex;
  min-width: 88px;
  flex-direction: column;
  align-items: flex-end;
  padding: 10px 12px;
  text-align: right;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 13px;
}

.online-card__secondary-label {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 560;
  white-space: nowrap;
}

.online-card__secondary-value {
  margin: 2px 0 0;
  color: var(--text-primary);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  line-height: 1.15;
}

.online-card__action {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.online-card__action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition:
    color 160ms ease,
    transform 180ms var(--ease-out);
}

.online-card:hover .online-card__action svg {
  color: var(--accent);
  transform: translateX(2px);
}

.empty-dashboard {
  display: grid;
  min-height: min(72vh, 560px);
  place-items: center;
}

.empty-dashboard__card {
  width: min(100%, 560px);
  padding: 34px 24px;
  text-align: center;
  border-radius: var(--radius-large);
}

.source-rank-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.source-rank-card {
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.source-rank-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1px 2px 14px;
}

.source-rank-card__icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 13px;
}

.source-rank-card__icon[data-tone="promo"] {
  color: var(--purple);
  background: var(--purple-soft);
}

.source-rank-card__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.source-rank-card__copy,
.source-rank-card__eyebrow,
.source-rank-card__subtitle {
  display: block;
}

.source-rank-card__copy {
  min-width: 0;
}

.source-rank-card__eyebrow {
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.source-rank-card__title {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 690;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-rank-card__subtitle {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.source-rank-list {
  overflow: hidden;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 17px;
}

.source-entry {
  position: relative;
}

.source-entry + .source-entry {
  border-top: 1px solid var(--separator);
}

.source-entry__trigger {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 28px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    opacity 150ms ease;
}

.source-entry__trigger:hover,
.source-entry__trigger[aria-expanded="true"] {
  background: rgba(var(--accent-rgb), 0.065);
}

.source-entry__trigger:disabled {
  cursor: wait;
  opacity: 0.68;
}

.source-entry__rank {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: var(--surface-solid);
  border: 1px solid var(--separator);
  border-radius: 9px;
}

.source-entry:first-child .source-entry__rank {
  color: #9a6900;
  background: rgba(255, 204, 0, 0.16);
  border-color: rgba(255, 190, 0, 0.24);
}

.source-entry__copy {
  display: block;
  min-width: 0;
}

.source-entry__title,
.source-entry__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-entry__title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.source-entry__meta {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.source-entry__count {
  display: flex;
  min-width: 45px;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.source-entry__count strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.source-entry__count small {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 560;
}

.source-entry__chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: transform 170ms var(--ease-out);
}

.source-entry__chevron svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.source-entry__trigger[aria-expanded="true"] .source-entry__chevron {
  color: var(--accent);
  transform: rotate(180deg);
}

.source-rank-more {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--accent);
  text-align: left;
  background: rgba(var(--accent-rgb), 0.045);
  border-top: 1px solid var(--separator);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.source-rank-more:hover {
  background: rgba(var(--accent-rgb), 0.09);
}

.source-rank-more__label {
  font-size: 12px;
  font-weight: 650;
}

.source-rank-more__count {
  color: var(--text-tertiary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.source-rank-more__chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: transform 170ms var(--ease-out);
}

.source-rank-more__chevron svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.source-rank-more[aria-expanded="true"] .source-rank-more__chevron {
  transform: rotate(180deg);
}

.source-entry__detail {
  margin: 0 8px 8px;
  padding: 10px;
  border-radius: 14px;
  box-shadow: none;
}

.source-entry__detail .metric-grid {
  gap: 8px;
}

.source-entry__detail .metric-card {
  min-height: 88px;
  padding: 11px;
  border-radius: 14px;
  box-shadow: none;
}

.source-entry__detail .metric-card__body {
  margin-top: 0;
}

.source-entry__detail .metric-card__label {
  font-size: 10px;
}

.source-entry__detail .metric-card__value {
  margin-top: 5px;
  font-size: 18px;
}

.source-entry__detail .metric-card__meta {
  margin-top: 5px;
  font-size: 10px;
}

.source-entry > .source-entry__detail.load-state,
.source-entry > .source-entry__detail.error-state {
  min-height: 112px;
}

.source-rank-card > .empty-state,
.source-rank-card > .error-state {
  min-height: 142px;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 17px;
  box-shadow: none;
}

.source-rank-skeleton {
  position: relative;
  height: 62px;
  overflow: hidden;
}

.source-rank-skeleton + .source-rank-skeleton {
  border-top: 1px solid var(--separator);
}

.source-rank-skeleton::before {
  position: absolute;
  top: 19px;
  right: 55px;
  left: 49px;
  height: 23px;
  content: "";
  background: var(--surface-solid);
  border-radius: 8px;
}

.source-rank-skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 12%, rgba(255, 255, 255, 0.34) 50%, transparent 88%);
  transform: translateX(-100%);
  animation: source-rank-shimmer 1.35s ease-in-out infinite;
}

@keyframes source-rank-shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (min-width: 780px) {
  .source-rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .source-rank-card {
    padding: 12px;
    border-radius: 21px;
  }

  .source-rank-card__header {
    padding-bottom: 12px;
  }

  .source-entry__trigger {
    grid-template-columns: 27px minmax(0, 1fr) auto 16px;
    gap: 7px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .source-entry__rank {
    width: 27px;
    height: 27px;
  }
}

/* Online */
.online-page {
  --content-width: 1040px;
}

.online-page__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.online-page__header-copy {
  min-width: 0;
}

.online-overview {
  position: relative;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(520px 250px at 92% 0%, rgba(255, 255, 255, 0.2), transparent 68%),
    linear-gradient(135deg, #0577f7 0%, #0a84ff 54%, #29a8ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-large);
  box-shadow: 0 24px 64px rgba(0, 102, 214, 0.24);
}

.online-overview::after {
  position: absolute;
  right: -62px;
  bottom: -88px;
  width: 290px;
  height: 220px;
  content: "";
  border: 34px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.online-overview__content {
  position: relative;
  z-index: 1;
}

.online-overview__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.online-overview .status-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
}

.online-overview .status-dot {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.online-overview__time {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.online-overview__value {
  margin: 28px 0 0;
  font-size: clamp(58px, 15vw, 92px);
  font-variant-numeric: tabular-nums;
  font-weight: 730;
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.online-overview__label {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.online-overview__total {
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.online-overview__total strong {
  margin-left: 4px;
  color: #fff;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.online-controls {
  margin-top: 14px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.online-kpis {
  margin-top: 14px;
}

.online-kpis .metric-card {
  min-height: 128px;
}

.online-kpis .metric-card__body {
  margin-top: 0;
}

.online-kpis .metric-card__value {
  margin-top: 8px;
}

.online-chart {
  margin-top: 14px;
}

.online-chart .chart-frame {
  height: 300px;
}

.online-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.online-nodes,
.online-details {
  padding: 18px;
  border-radius: var(--radius-large);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-heading__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.card-heading__subtitle {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.node-list {
  display: grid;
  gap: 7px;
}

.node-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  padding: 11px 12px;
  background: var(--surface-tertiary);
  border-radius: 14px;
}

.node-row__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.node-row__rank {
  display: inline-flex;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-solid);
  border: 1px solid var(--separator);
  border-radius: 9px;
}

.node-row__name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-row__value {
  color: var(--text-primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.node-row__track {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: var(--separator);
  border-radius: 999px;
}

.node-row__bar {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.details-list {
  display: grid;
  gap: 0;
}

.details-list__row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--separator);
}

.details-list__row:last-child {
  border-bottom: 0;
}

.details-list__label {
  color: var(--text-secondary);
  font-size: 14px;
}

.details-list__value {
  overflow: hidden;
  max-width: 62%;
  color: var(--text-primary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-loading {
  position: absolute;
  inset: 8px 0 0;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 28px 12px 30px;
}

.chart-loading__line {
  width: 100%;
  height: 12px;
  border-radius: 999px;
}

.chart-loading__line:nth-child(1) {
  width: 72%;
}

.chart-loading__line:nth-child(2) {
  width: 88%;
}

.chart-loading__line:nth-child(3) {
  width: 55%;
}

.summary-page {
  --summary-blue: #0a84ff;
  --summary-purple: #af52de;
  --summary-orange: #ff9500;
  --summary-green: #28a745;
  --summary-teal: #00a6a6;
}

.summary-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.summary-header__copy {
  min-width: 0;
}

.summary-header .page-title {
  margin-top: 5px;
}

.summary-header .page-subtitle {
  margin-top: 6px;
}

.summary-freshness {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 590;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 999px;
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.summary-freshness__dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.summary-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-kpi {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.summary-kpi::after {
  position: absolute;
  top: -54px;
  right: -44px;
  width: 138px;
  height: 138px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  opacity: 0.07;
}

.summary-kpi__icon {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: currentColor;
  border-radius: 12px;
}

.summary-kpi__icon svg {
  width: 20px;
  height: 20px;
  color: var(--surface-solid);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.summary-kpi__value,
.summary-kpi__label {
  position: relative;
  z-index: 1;
  display: block;
}

.summary-kpi__value {
  overflow: hidden;
  color: var(--text-primary);
  font-size: clamp(23px, 3vw, 31px);
  font-weight: 730;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-kpi__label {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 560;
}

.summary-kpi--blue {
  color: var(--summary-blue);
}

.summary-kpi--purple {
  color: var(--summary-purple);
}

.summary-kpi--orange {
  color: var(--summary-orange);
}

.summary-kpi--green {
  color: var(--summary-green);
}

.summary-kpi--teal {
  color: var(--summary-teal);
}

.summary-kpi--online {
  color: var(--accent);
  background:
    radial-gradient(360px 180px at 100% 0%, rgba(255, 255, 255, 0.2), transparent 72%),
    linear-gradient(135deg, #0577f7, #20a3ff);
  border-color: rgba(255, 255, 255, 0.28);
}

.summary-kpi--online::after {
  color: #fff;
  opacity: 0.11;
}

.summary-kpi--online .summary-kpi__icon {
  color: rgba(255, 255, 255, 0.2);
}

.summary-kpi--online .summary-kpi__icon svg,
.summary-kpi--online .summary-kpi__value {
  color: #fff;
}

.summary-kpi--online .summary-kpi__label {
  color: rgba(255, 255, 255, 0.76);
}

.summary-bots {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.summary-bots__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--separator);
}

.summary-bots__title {
  margin: 5px 0 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.summary-bots__count {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  border-radius: 999px;
}

.summary-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.summary-table {
  width: 100%;
  min-width: 940px;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--text-primary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.summary-table th,
.summary-table td {
  padding: 14px 12px;
  text-align: right;
  vertical-align: middle;
  border-bottom: 1px solid var(--separator);
}

.summary-table th {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.summary-table th:first-child,
.summary-table td:first-child {
  padding-left: 22px;
  text-align: left;
}

.summary-table th:last-child,
.summary-table td:last-child {
  padding-right: 18px;
}

.summary-table tbody tr {
  transition: background-color 150ms ease;
}

.summary-table tbody tr:hover {
  background: var(--surface-tertiary);
}

.summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.summary-bot {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 11px;
}

.summary-bot__copy {
  min-width: 0;
}

.summary-bot strong,
.summary-bot small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-bot strong {
  max-width: 230px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 660;
}

.summary-bot small,
.summary-table__muted {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
}

.summary-bot small {
  max-width: 230px;
  margin-top: 2px;
}

.summary-online {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.summary-online__dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--green-soft);
}

.summary-table__muted {
  display: block;
  margin-top: 2px;
  white-space: nowrap;
}

.summary-table__action a {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 11px;
  transition:
    background-color 150ms ease,
    transform 150ms var(--ease-out);
}

.summary-table__action a:hover {
  background: rgba(var(--accent-rgb), 0.18);
}

.summary-table__action a:active {
  transform: scale(0.94);
}

.summary-table__action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.summary-empty {
  display: flex;
  min-height: 290px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 38px 20px;
  text-align: center;
}

.summary-empty__icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  background: var(--surface-tertiary);
  border-radius: 18px;
}

.summary-empty__icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.summary-empty h2 {
  margin: 16px 0 0;
  font-size: 20px;
}

.summary-empty p {
  max-width: 380px;
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Shared bottom navigation */
.app-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5000;
  padding:
    7px
    max(8px, var(--safe-right))
    max(7px, var(--safe-bottom))
    max(8px, var(--safe-left));
  background: rgba(250, 250, 252, 0.82);
  border-top: 1px solid var(--separator);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
}

html[data-theme="dark"] .app-tabbar {
  background: rgba(16, 16, 18, 0.8);
}

.app-tabbar__inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  max-width: 640px;
  margin: 0 auto;
}

.app-tabbar__inner--superadmin {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.app-tabbar__inner--single {
  grid-template-columns: minmax(96px, 160px);
  justify-content: center;
}

.tabbar-item {
  display: flex;
  min-width: 0;
  min-height: 50px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 590;
  line-height: 1;
  border-radius: 12px;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    transform 150ms var(--ease-out);
}

.tabbar-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tabbar-item.is-active {
  color: var(--accent);
}

.tabbar-item:active {
  background: var(--accent-soft);
  transform: scale(0.95);
}

/* Compatibility for old Tailwind-heavy templates in light mode */
.text-white\/70,
.text-white\/80,
.text-white\/50 {
  color: var(--text-secondary) !important;
}

.border-white\/10,
.border-white\/8,
.border-white\/5 {
  border-color: var(--separator) !important;
}

.bg-white\/5 {
  background-color: var(--surface-tertiary) !important;
}

.divide-white\/5 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--separator) !important;
}

@media (min-width: 640px) {
  .page-shell {
    padding-right: max(22px, var(--safe-right));
    padding-left: max(22px, var(--safe-left));
  }

  .dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .online-card {
    min-height: 112px;
  }

  .online-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .page-shell {
    padding-top: calc(30px + var(--safe-top));
    padding-bottom: calc(46px + var(--safe-bottom));
  }

  .has-app-tabbar .page-shell {
    padding-bottom: calc(118px + var(--safe-bottom));
  }

  .metric-card {
    min-height: 180px;
    padding: 19px;
  }

  .online-card {
    min-height: 112px;
    padding: 16px 17px;
  }

  .online-overview {
    padding: 26px;
  }

  .online-controls {
    padding: 9px;
  }

  .online-chart .chart-frame {
    height: 380px;
  }

  .online-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  }
}

@media (min-width: 900px) {
  .has-app-tabbar .page-shell {
    padding-top: calc(106px + var(--safe-top));
    padding-bottom: calc(46px + var(--safe-bottom));
  }

  .app-tabbar {
    top: calc(14px + var(--safe-top));
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(620px, calc(100% - 40px));
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: 18px;
    box-shadow: var(--shadow-float);
    transform: translateX(-50%);
  }

  html[data-theme="dark"] .app-tabbar {
    background: var(--surface);
  }

  .tabbar-item {
    min-height: 46px;
    flex-direction: row;
    gap: 7px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .tabbar-item svg {
    width: 18px;
    height: 18px;
  }

  .tabbar-item.is-active {
    background: var(--accent-soft);
  }

  .dashboard-header {
    align-items: flex-end;
  }
}

@media (max-width: 430px) {
  .page-header {
    gap: 12px;
  }

  .page-title,
  .lead-title {
    font-size: 34px;
  }

  .dashboard-admin {
    display: none;
  }

  .metric-card {
    min-height: 156px;
    padding: 15px;
  }

  .metric-card__body {
    margin-top: 20px;
  }

  .metric-card__value {
    font-size: 25px;
  }

  .online-card {
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    min-height: 132px;
    align-items: start;
    row-gap: 7px;
    padding: 14px;
  }

  .online-card__icon {
    width: 42px;
    height: 42px;
    grid-column: 1;
    grid-row: 1;
  }

  .online-card__content {
    grid-column: 2;
    grid-row: 1;
  }

  .online-card__value {
    font-size: 28px;
  }

  .online-card__meta {
    white-space: normal;
  }

  .online-card__secondary {
    max-width: none;
    min-width: 0;
    grid-column: 2 / 4;
    grid-row: 2;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 5px;
    padding: 0;
    text-align: left;
    background: transparent;
    border: 0;
  }

  .online-card__secondary-value {
    font-size: 14px;
  }

  .online-card__action {
    grid-column: 3;
    grid-row: 1;
  }

  .online-page__header .page-title {
    font-size: 30px;
  }

  .online-overview {
    padding: 19px;
  }

  .online-overview__value {
    margin-top: 24px;
  }

  .chart-card,
  .chart-shell {
    padding: 15px;
  }
}

@media (max-width: 760px) {
  .summary-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .summary-freshness {
    align-self: flex-start;
  }

  .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-kpi {
    min-height: 146px;
    padding: 16px;
  }

  .summary-kpi__value {
    font-size: clamp(21px, 6vw, 27px);
  }

  .summary-bots {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .summary-bots__header {
    padding: 8px 2px 14px;
    border-bottom: 0;
  }

  .summary-table-wrap {
    overflow: visible;
  }

  .summary-table,
  .summary-table tbody,
  .summary-table tr,
  .summary-table td {
    display: block;
    width: 100%;
  }

  .summary-table {
    min-width: 0;
  }

  .summary-table thead {
    display: none;
  }

  .summary-table tbody {
    display: grid;
    gap: 12px;
  }

  .summary-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 18px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    backdrop-filter: var(--blur-material);
    -webkit-backdrop-filter: var(--blur-material);
  }

  .summary-table tbody tr:hover {
    background: var(--surface);
  }

  .summary-table td,
  .summary-table td:first-child,
  .summary-table td:last-child {
    padding: 0;
    text-align: left;
    border: 0;
  }

  .summary-table td[data-label]::before {
    display: block;
    margin-bottom: 3px;
    color: var(--text-tertiary);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .summary-table .summary-table__bot {
    grid-column: 1 / -1;
    padding-right: 48px;
  }

  .summary-bot {
    min-width: 0;
  }

  .summary-bot strong,
  .summary-bot small {
    max-width: min(62vw, 340px);
  }

  .summary-online {
    justify-content: flex-start;
  }

  .summary-table .summary-table__action {
    position: absolute;
    top: 20px;
    right: 16px;
    width: auto;
  }
}

@media (max-width: 390px) {
  .summary-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-kpi {
    min-height: 132px;
  }
}

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

.balance-page {
  max-width: 1040px;
}

.balance-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.balance-eyebrow {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.balance-title {
  margin: 5px 0 0;
  color: var(--text-primary);
  font-size: clamp(32px, 7vw, 46px);
  font-weight: 740;
  line-height: 1;
  letter-spacing: -0.045em;
}

.balance-bot-pill,
.balance-range-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  background: var(--surface-tertiary);
  border: 1px solid var(--separator);
  border-radius: 999px;
}

.balance-bot-pill__dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--green-soft);
}

.balance-hero {
  position: relative;
  isolation: isolate;
  min-height: 278px;
  padding: 24px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.23), transparent 34%),
    linear-gradient(145deg, #1689ff 0%, #006ee6 48%, #0055c8 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  box-shadow:
    0 2px 3px rgba(0, 72, 170, 0.16),
    0 24px 58px rgba(0, 90, 210, 0.24);
}

.balance-hero::after {
  position: absolute;
  right: -5%;
  bottom: -46%;
  z-index: -1;
  width: 72%;
  aspect-ratio: 1;
  content: "";
  background: radial-gradient(circle, rgba(126, 217, 255, 0.28), transparent 65%);
}

.balance-hero__glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.balance-hero__glow--one {
  top: -100px;
  left: -65px;
  width: 250px;
  height: 250px;
  background: rgba(102, 210, 255, 0.27);
}

.balance-hero__glow--two {
  right: 24%;
  bottom: -125px;
  width: 230px;
  height: 230px;
  background: rgba(75, 91, 255, 0.25);
}

.balance-hero__mark {
  position: absolute;
  top: 50%;
  right: clamp(-28px, 2vw, 18px);
  width: min(43vw, 220px);
  height: min(43vw, 220px);
  color: rgba(255, 255, 255, 0.16);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transform: translateY(-50%) rotate(-10deg);
}

.balance-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 228px;
  flex-direction: column;
  align-items: flex-start;
}

.balance-hero__top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-wallet-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.balance-wallet-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.balance-hero__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.balance-hero__status span {
  width: 7px;
  height: 7px;
  background: #6af08b;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(106, 240, 139, 0.16);
}

.balance-hero__label {
  margin: auto 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 580;
}

.balance-hero__value {
  margin: 4px 0 0;
  font-size: clamp(40px, 10vw, 66px);
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  line-height: 1;
  letter-spacing: -0.055em;
  text-shadow: 0 2px 16px rgba(0, 43, 112, 0.17);
}

.balance-hero__note {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.69);
  font-size: 12px;
}

.balance-summary,
.balance-history {
  margin-top: 28px;
}

.balance-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.balance-section-title {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: clamp(20px, 4vw, 25px);
  font-weight: 710;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.balance-updated {
  flex: 0 0 auto;
  padding-bottom: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

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

.balance-summary-card {
  display: flex;
  min-width: 0;
  min-height: 116px;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.balance-summary-card__icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}

.balance-summary-card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.balance-summary-card[data-tone="income"] .balance-summary-card__icon {
  color: var(--green);
  background: var(--green-soft);
}

.balance-summary-card[data-tone="payout"] .balance-summary-card__icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.balance-summary-card[data-tone="refund"] .balance-summary-card__icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.balance-summary-card[data-tone="operations"] .balance-summary-card__icon {
  color: var(--purple);
  background: var(--purple-soft);
}

.balance-summary-card__label {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 580;
}

.balance-summary-card__value {
  position: relative;
  max-width: 100%;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: clamp(19px, 4.5vw, 25px);
  font-variant-numeric: tabular-nums;
  font-weight: 710;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-summary-card__value--loading {
  width: min(108px, 80%);
  height: 23px;
  color: transparent;
  background: var(--surface-tertiary);
  border-radius: 7px;
}

.balance-summary-card__value--loading::after,
.balance-loading-group__date::after,
.balance-loading-group__card span::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 10%, rgba(255, 255, 255, 0.48) 48%, transparent 88%);
  transform: translateX(-100%);
  animation: balance-shimmer 1.35s ease-in-out infinite;
}

.balance-timeline {
  position: relative;
  min-height: 180px;
}

.balance-day {
  position: relative;
  padding-left: 28px;
}

.balance-day + .balance-day {
  margin-top: 19px;
}

.balance-day::before {
  position: absolute;
  top: 15px;
  bottom: -34px;
  left: 7px;
  width: 1px;
  content: "";
  background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.36), var(--separator));
}

.balance-day:last-child::before {
  bottom: calc(100% - 17px);
}

.balance-day__heading {
  position: relative;
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.balance-day__dot {
  position: absolute;
  top: 12px;
  left: -26px;
  width: 11px;
  height: 11px;
  background: var(--accent);
  border: 3px solid var(--app-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.balance-day__date-copy {
  min-width: 0;
}

.balance-day__date {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.2;
}

.balance-day__count {
  margin: 2px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

.balance-day__total {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 9px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  line-height: 1;
  border-radius: 999px;
}

.balance-day__total--positive {
  color: var(--green);
  background: var(--green-soft);
}

.balance-day__total--negative {
  color: var(--red);
  background: var(--red-soft);
}

.balance-day__card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
}

.balance-operation {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 72px;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
}

.balance-operation + .balance-operation::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 67px;
  height: 1px;
  content: "";
  background: var(--separator);
}

.balance-operation__icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
}

.balance-operation__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.balance-operation__icon--income {
  color: var(--green);
  background: var(--green-soft);
}

.balance-operation__icon--payout {
  color: var(--accent);
  background: var(--accent-soft);
}

.balance-operation__icon--refund {
  color: var(--orange);
  background: var(--orange-soft);
}

.balance-operation__content {
  min-width: 0;
}

.balance-operation__title {
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-operation__meta {
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

.balance-operation__amount {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.balance-operation__amount--positive {
  color: var(--green);
}

.balance-operation__amount--negative {
  color: var(--text-primary);
}

.balance-state {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.balance-state__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  background: var(--surface-tertiary);
  border-radius: 18px;
}

.balance-state--error .balance-state__icon {
  color: var(--red);
  background: var(--red-soft);
}

.balance-state__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.balance-state__copy {
  max-width: 380px;
}

.balance-state__title {
  margin: 14px 0 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 690;
}

.balance-state__text {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.balance-state__button {
  min-height: 42px;
  margin-top: 17px;
  padding: 9px 17px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  background: var(--accent);
  border-radius: 13px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 160ms var(--ease-out);
}

.balance-state__button:hover {
  background: var(--accent-strong);
}

.balance-state__button:active {
  transform: scale(0.97);
}

.balance-loading-group {
  position: relative;
  padding-left: 28px;
}

.balance-loading-group + .balance-loading-group {
  margin-top: 20px;
}

.balance-loading-group__date {
  position: relative;
  display: block;
  width: 132px;
  height: 28px;
  margin-bottom: 9px;
  overflow: hidden;
  background: var(--surface-tertiary);
  border-radius: 9px;
}

.balance-loading-group__card {
  padding: 0 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.balance-loading-group__card span {
  position: relative;
  display: block;
  height: 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--separator);
}

.balance-loading-group__card span:last-child {
  border-bottom: 0;
}

.balance-loading-group__card span::before {
  position: absolute;
  top: 25px;
  left: 0;
  width: min(210px, 65%);
  height: 21px;
  content: "";
  background: var(--surface-tertiary);
  border-radius: 8px;
}

@keyframes balance-shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (min-width: 720px) {
  .balance-hero {
    min-height: 300px;
    padding: 30px;
  }

  .balance-hero__content {
    min-height: 238px;
  }

  .balance-summary__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .balance-summary-card {
    min-height: 132px;
    flex-direction: column;
    gap: 14px;
    padding: 17px;
  }

  .balance-summary-card__value {
    font-size: clamp(20px, 2.5vw, 27px);
  }
}

@media (max-width: 520px) {
  .balance-header {
    align-items: center;
  }

  .balance-bot-pill {
    padding: 6px 9px;
    font-size: 11px;
  }

  .balance-hero {
    min-height: 250px;
    padding: 19px;
    border-radius: 25px;
  }

  .balance-hero__content {
    min-height: 210px;
  }

  .balance-hero__mark {
    right: -48px;
    width: 190px;
    height: 190px;
  }

  .balance-hero__value {
    font-size: clamp(37px, 12vw, 53px);
  }

  .balance-section-heading {
    align-items: center;
  }

  .balance-summary-card {
    min-height: 105px;
    gap: 9px;
    padding: 12px;
    border-radius: 18px;
  }

  .balance-summary-card__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .balance-summary-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .balance-summary-card__value {
    margin-top: 7px;
    font-size: clamp(17px, 5.2vw, 22px);
  }

  .balance-day {
    padding-left: 23px;
  }

  .balance-day::before {
    left: 5px;
  }

  .balance-day__dot {
    left: -22px;
  }

  .balance-operation {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 12px;
  }

  .balance-operation + .balance-operation::before {
    right: 12px;
    left: 59px;
  }

  .balance-operation__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .balance-operation__amount {
    font-size: 12px;
  }

  .balance-loading-group {
    padding-left: 23px;
  }
}

@media (max-width: 365px) {
  .balance-summary-card {
    display: block;
  }

  .balance-summary-card__icon {
    margin-bottom: 9px;
  }

  .balance-operation {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .balance-operation__amount {
    grid-column: 2;
    margin-top: -3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .balance-summary-card__value--loading::after,
  .balance-loading-group__date::after,
  .balance-loading-group__card span::after {
    animation: none;
  }
}
