/* Keep every scrollable area functional while removing native scrollbar chrome. */
html,
body,
#root,
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html {
  scrollbar-gutter: auto !important;
}

/* Custom visual layer for native selects. The original select remains in the form. */
select.xb-select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.xb-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  height: 2rem;
  padding: 0 0.625rem;
  border: 1px solid hsl(var(--input));
  border-radius: 0.5rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.xb-select-button:hover:not(:disabled) {
  border-color: hsl(var(--foreground) / 0.25);
  background: hsl(var(--accent) / 0.45);
}

.xb-select-button:focus-visible,
.xb-select-button[aria-expanded="true"] {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.16);
}

.xb-select-button:disabled {
  color: hsl(var(--foreground) / 0.4);
  background: hsl(var(--muted));
  cursor: not-allowed;
}

.xb-select-button[data-placeholder="true"] .xb-select-value {
  color: hsl(var(--foreground) / 0.5);
}

.xb-select-button.xb-invalid {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.12);
}

.xb-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xb-select-chevron {
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.2rem 0.2rem 0 0.75rem;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: hsl(var(--foreground) / 0.55);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}

.xb-select-button[aria-expanded="true"] .xb-select-chevron {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.xb-select-menu {
  position: fixed;
  z-index: 2147483000;
  max-height: min(16rem, calc(100vh - 1rem));
  padding: 0.25rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--popover));
  color: hsl(var(--foreground));
  box-shadow: 0 12px 28px hsl(var(--foreground) / 0.14), 0 2px 8px hsl(var(--foreground) / 0.08);
  transform-origin: top center;
  animation: xb-select-in 120ms ease-out;
}

.xb-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2rem;
  padding: 0.375rem 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.xb-select-option:hover:not(:disabled),
.xb-select-option:focus-visible,
.xb-select-option[data-active="true"] {
  background: hsl(var(--accent));
}

.xb-select-option[aria-selected="true"] {
  color: hsl(var(--primary));
  font-weight: 600;
}

.xb-select-option:disabled {
  color: hsl(var(--foreground) / 0.35);
  cursor: not-allowed;
}

.xb-select-check {
  width: 1rem;
  flex: 0 0 1rem;
  color: hsl(var(--primary));
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

@keyframes xb-select-in {
  from {
    opacity: 0;
    transform: translateY(-0.25rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Full-screen loader shared by initial boot and hash-route transitions. */
.xb-app-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  visibility: hidden;
  background: hsl(var(--background) / 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.xb-app-loader[data-visible="true"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.xb-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  color: hsl(var(--foreground));
}

.xb-loader-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background: hsl(var(--primary));
  color: white;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 24px hsl(var(--primary) / 0.22);
}

.xb-loader-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: xb-loader-spin 700ms linear infinite;
}

.xb-loader-label {
  margin: 0;
  color: hsl(var(--foreground) / 0.62);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  .xb-select-menu,
  .xb-loader-spinner {
    animation: none;
  }

  .xb-app-loader,
  .xb-select-button,
  .xb-select-chevron {
    transition: none;
  }
}

[data-xb-trends-anchor="true"] {
  min-height: 19.5rem !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

[data-xb-stats-anchor="true"],
[data-xb-day-trends-anchor="true"] {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Keep the original 24-hour fan chart readable without browser focus boxes. */
[data-xb-original-trend="true"] .recharts-pie:focus,
[data-xb-original-trend="true"] .recharts-pie-sector:focus,
[data-xb-original-trend="true"] .recharts-sector:focus,
[data-xb-original-trend="true"] svg *:focus {
  outline: none !important;
}

[data-xb-original-trend="true"] .recharts-sector[fill="hsl(var(--muted))"] {
  opacity: 0.76 !important;
}

[data-xb-channel-anchor="true"] {
  min-height: 17.5rem !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#xb-stats-portal,
#xb-day-trends-portal,
#xb-trends-portal,
#xb-channel-portal {
  position: absolute;
  z-index: 20;
  display: none;
  min-width: 0;
}

#xb-stats-portal[data-visible="true"],
#xb-day-trends-portal[data-visible="true"],
#xb-trends-portal[data-visible="true"],
#xb-channel-portal[data-visible="true"] {
  display: block;
}

.xb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.xb-stats-grid[data-dashboard-role="checker"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.xb-stat-card {
  min-width: 0;
  min-height: 7rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 2px 10px hsl(var(--foreground) / 0.035);
  animation: xb-panel-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stat-index, 0) * 55ms);
}

.xb-stat-card:nth-child(1) { --stat-index: 0; }
.xb-stat-card:nth-child(2) { --stat-index: 1; }
.xb-stat-card:nth-child(3) { --stat-index: 2; }
.xb-stat-card:nth-child(4) { --stat-index: 3; }
.xb-stat-card:nth-child(5) { --stat-index: 4; }
.xb-stat-card:nth-child(6) { --stat-index: 5; }
.xb-stat-card:nth-child(7) { --stat-index: 6; }
.xb-stat-card:nth-child(8) { --stat-index: 7; }

.xb-stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.xb-stat-label {
  min-width: 0;
  margin: 0;
  color: hsl(var(--foreground) / 0.5);
  font-size: 0.75rem;
  line-height: 1.3;
}

.xb-stat-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: 0.5rem;
}

.xb-stat-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.xb-stat-icon-balance { color: #059669; background: #ecfdf5; }
.xb-stat-icon-fee { color: #2563eb; background: #eff6ff; }
.xb-stat-icon-wallet { color: #d97706; background: #fffbeb; }
.xb-stat-icon-orders { color: #2563eb; background: #eff6ff; }
.xb-stat-icon-compare { color: #0f766e; background: #ecfdf5; }
.xb-stat-icon-today { color: #0284c7; background: #e0f2fe; }
.xb-stat-icon-yesterday { color: #7c3aed; background: #f5f3ff; }
.xb-stat-icon-rate-today { color: #059669; background: #ecfdf5; }
.xb-stat-icon-rate-yesterday { color: #c2410c; background: #fff7ed; }

.dark .xb-stat-icon-balance { color: #34d399; background: rgb(16 185 129 / 0.14); }
.dark .xb-stat-icon-fee { color: #60a5fa; background: rgb(37 99 235 / 0.15); }
.dark .xb-stat-icon-wallet { color: #fbbf24; background: rgb(245 158 11 / 0.14); }
.dark .xb-stat-icon-orders { color: #60a5fa; background: rgb(37 99 235 / 0.15); }
.dark .xb-stat-icon-compare { color: #2dd4bf; background: rgb(20 184 166 / 0.14); }
.dark .xb-stat-icon-today { color: #38bdf8; background: rgb(2 132 199 / 0.16); }
.dark .xb-stat-icon-yesterday { color: #a78bfa; background: rgb(124 58 237 / 0.15); }
.dark .xb-stat-icon-rate-today { color: #34d399; background: rgb(16 185 129 / 0.14); }
.dark .xb-stat-icon-rate-yesterday { color: #fb923c; background: rgb(234 88 12 / 0.14); }

.xb-stat-value {
  margin: 0.5rem 0 0;
  overflow: hidden;
  color: hsl(var(--foreground));
  font-size: 1.375rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xb-stat-note {
  margin: 1rem 0 0;
  overflow: hidden;
  color: hsl(var(--foreground) / 0.44);
  font-size: 0.6875rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xb-stat-card-outcome {
  padding-bottom: 0.75rem;
}

.xb-outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
  min-width: 0;
}

.xb-outcome-day {
  min-width: 0;
  padding-right: 0.65rem;
}

.xb-outcome-day + .xb-outcome-day {
  padding: 0 0 0 0.65rem;
  border-left: 1px solid hsl(var(--border));
}

.xb-outcome-day-label {
  color: hsl(var(--foreground) / 0.68);
  font-size: 0.6875rem;
  font-weight: 650;
}

.xb-outcome-headline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.4rem 0 0.5rem;
}

.xb-outcome-big {
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1;
  color: #059669;
  font-variant-numeric: tabular-nums;
}

.dark .xb-outcome-big { color: #34d399; }

.xb-outcome-big-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: hsl(var(--foreground) / 0.6);
}

.xb-outcome-rows {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin-bottom: 0.55rem;
}

.xb-outcome-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.xb-outcome-row-k { color: hsl(var(--foreground) / 0.6); }

.xb-outcome-row-v { font-weight: 650; white-space: nowrap; }

.xb-outcome-rate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xb-outcome-rate .xb-outcome-bar {
  flex: 1;
  margin-top: 0;
}

.xb-outcome-rate-text {
  font-size: 0.66rem;
  font-weight: 650;
  color: hsl(var(--foreground) / 0.68);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.xb-outcome-bar {
  display: flex;
  width: 100%;
  height: 0.3rem;
  margin-top: 0.4rem;
  overflow: hidden;
  border-radius: 0.15rem;
  background: hsl(var(--muted));
}

.xb-outcome-bar-success,
.xb-outcome-bar-failed {
  display: block;
  transform: scaleX(0);
  transform-origin: left center;
  animation: xb-outcome-reveal 620ms cubic-bezier(0.22, 1, 0.36, 1) 240ms forwards;
}

.xb-outcome-bar-success {
  width: var(--success-share);
  background: #10b981;
}

.xb-outcome-bar-failed {
  width: var(--failed-share);
  background: #ef4444;
}

.xb-outcome-day[data-empty="true"] .xb-outcome-bar-success,
.xb-outcome-day[data-empty="true"] .xb-outcome-bar-failed {
  width: 0;
}

.xb-outcome-total { color: hsl(var(--foreground) / 0.85); }
.xb-outcome-failed { color: #dc2626; }
.dark .xb-outcome-failed { color: #f87171; }

@keyframes xb-outcome-reveal {
  to { transform: scaleX(1); }
}

.xb-trends-insights {
  display: block;
  min-width: 0;
}

.xb-trend-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.xb-trend-panel,
.xb-day-trends-card,
.xb-channel-board {
  min-width: 0;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 2px 12px hsl(var(--foreground) / 0.045), 0 14px 36px hsl(var(--foreground) / 0.025);
  animation: xb-panel-enter 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--panel-index, 0) * 90ms);
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.xb-channel-board {
  --panel-index: 0;
}

.xb-day-trends-card {
  display: flex;
  height: var(--xb-anchor-height, 21rem);
  flex-direction: column;
}

.xb-trend-panel:hover,
.xb-day-trends-card:hover,
.xb-channel-board:hover {
  border-color: hsl(var(--primary) / 0.2);
  box-shadow: 0 10px 30px hsl(var(--foreground) / 0.08), 0 2px 8px hsl(var(--foreground) / 0.04);
  transform: translateY(-1px);
}

.xb-insight-header,
.xb-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  padding: 0.875rem 1.125rem;
  gap: 0.875rem;
  border-bottom: 1px solid hsl(var(--border));
}

.xb-insight-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.75rem;
}

.xb-insight-title-wrap h2 {
  margin: 0;
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.xb-insight-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease;
}

.xb-trend-panel:hover .xb-insight-icon,
.xb-day-trends-card:hover .xb-insight-icon,
.xb-channel-board:hover .xb-insight-icon {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 7px 18px hsl(var(--foreground) / 0.08);
}

.xb-insight-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.xb-insight-icon-amount {
  color: #2563eb;
  background: #eff6ff;
}

.xb-insight-icon-orders {
  color: #7c3aed;
  background: #f5f3ff;
}

.xb-insight-icon-board {
  color: #0f766e;
  background: #ecfdf5;
}

.xb-insight-icon-day-trend {
  color: #0284c7;
  background: #e0f2fe;
}

.dark .xb-insight-icon-amount {
  color: #60a5fa;
  background: rgb(37 99 235 / 0.15);
}

.dark .xb-insight-icon-orders {
  color: #a78bfa;
  background: rgb(124 58 237 / 0.15);
}

.dark .xb-insight-icon-board {
  color: #34d399;
  background: rgb(16 185 129 / 0.14);
}

.dark .xb-insight-icon-day-trend {
  color: #38bdf8;
  background: rgb(2 132 199 / 0.16);
}

.xb-day-trends-title-text {
  min-width: 0;
}

.xb-day-trends-title-text p {
  margin: 0.18rem 0 0;
  color: hsl(var(--foreground) / 0.45);
  font-size: 0.7rem;
  line-height: 1.2;
}

.xb-day-trends-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
  min-height: 0;
  padding: 0.55rem 0.75rem 0.45rem;
}

.xb-day-trend-item {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.xb-day-trend-item + .xb-day-trend-item {
  border-left: 1px solid hsl(var(--border));
}

.xb-day-trend-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.8rem;
  padding: 0 0.7rem;
  gap: 0.5rem;
}

.xb-day-trend-item-header strong {
  color: hsl(var(--foreground) / 0.78);
  font-size: 0.75rem;
  letter-spacing: 0;
}

.xb-day-trend-item-header span {
  color: hsl(var(--foreground) / 0.4);
  font-size: 0.65rem;
  white-space: nowrap;
}

.xb-day-donut {
  position: relative;
  flex: 1;
  min-height: 0;
}

.xb-day-donut svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.xb-day-donut-segment {
  transform-box: view-box;
  transform-origin: 50% 50%;
  pointer-events: none;
  animation: xb-day-segment-enter 760ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(90ms + var(--segment-index) * 52ms);
  transition: opacity 160ms ease, filter 180ms ease, transform 180ms ease;
}

.xb-day-donut-hit {
  cursor: pointer;
  pointer-events: all;
}

.xb-day-donut-segment:hover,
.xb-day-donut-segment[data-active="true"] {
  filter: drop-shadow(0 5px 7px hsl(var(--foreground) / 0.14));
  transform: scale(1.035);
}

.xb-day-donut-center {
  position: absolute;
  left: 50%;
  top: 49%;
  width: 8.5rem;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: xb-day-center-enter 620ms cubic-bezier(0.22, 1, 0.36, 1) 420ms backwards;
}

.xb-day-donut-center p {
  margin: 0;
}

.xb-day-donut-amount {
  overflow: hidden;
  color: hsl(var(--foreground));
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xb-day-donut-meta {
  margin-top: 0.28rem !important;
  color: hsl(var(--foreground) / 0.44);
  font-size: 0.62rem;
  line-height: 1.25;
  white-space: nowrap;
}

.xb-day-donut-tooltip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0.15rem;
  max-width: calc(100% - 1rem);
  padding: 0.32rem 0.5rem;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--card) / 0.97);
  color: hsl(var(--foreground) / 0.8);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 20px hsl(var(--foreground) / 0.11);
  pointer-events: none;
  opacity: 1;
  transition: opacity 120ms ease;
}

.xb-day-donut-tooltip[aria-hidden="true"] {
  opacity: 0;
}

.xb-insight-unit {
  flex: 0 0 auto;
  color: hsl(var(--foreground) / 0.45);
  font-size: 0.75rem;
}

.xb-trend-chart {
  position: relative;
  height: 15rem;
  min-width: 0;
  padding: 0.75rem 1rem 0.5rem;
}

.xb-trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.xb-chart-grid line {
  stroke: hsl(var(--border));
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  animation: xb-grid-reveal 520ms ease both;
}

.xb-chart-grid text {
  fill: hsl(var(--foreground) / 0.43);
  font-size: 11px;
  font-family: inherit;
  letter-spacing: 0;
  animation: xb-grid-reveal 520ms ease 80ms both;
}

.xb-chart-line {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: xb-line-draw 1100ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards;
}

.xb-chart-area {
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: xb-area-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}

.xb-chart-point {
  transform-box: fill-box;
  transform-origin: center;
  animation: xb-point-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(520ms + var(--point-index) * 65ms);
}

.xb-chart-point circle:first-child {
  vector-effect: non-scaling-stroke;
  transition: r 160ms ease, stroke-width 160ms ease;
}

.xb-chart-point:hover circle:first-child,
.xb-chart-point:focus circle:first-child,
.xb-chart-point[data-active="true"] circle:first-child {
  r: 6;
  stroke-width: 4;
}

.xb-chart-point:focus {
  outline: none;
}

.xb-chart-guide {
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.xb-chart-guide[data-visible="true"] {
  opacity: 0.48;
}

.xb-chart-hit-zone {
  cursor: crosshair;
  pointer-events: all;
}

.xb-chart-tooltip {
  position: absolute;
  z-index: 2;
  top: 0.25rem;
  transform: translateX(-50%);
  max-width: calc(100% - 1rem);
  padding: 0.4rem 0.6rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--card) / 0.96);
  color: hsl(var(--foreground));
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
  pointer-events: none;
  opacity: 1;
  transition: opacity 120ms ease;
}

.xb-chart-tooltip[aria-hidden="true"] {
  opacity: 0;
}

.xb-channel-board {
  display: flex;
  flex-direction: column;
}

.xb-channel-header {
  min-height: 4.25rem;
}

.xb-channel-title-text {
  min-width: 0;
}

.xb-channel-count {
  margin: 0.2rem 0 0;
  color: hsl(var(--foreground) / 0.43);
  font-size: 0.7rem;
}

.xb-channel-sort {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  color: hsl(var(--foreground) / 0.45);
  font-size: 0.7rem;
}

.xb-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.72);
}

.xb-segmented button {
  min-height: 1.9rem;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: hsl(var(--foreground) / 0.52);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.xb-segmented button:hover {
  color: hsl(var(--foreground) / 0.78);
}

.xb-segmented button[aria-pressed="true"] {
  background: hsl(var(--card));
  color: hsl(var(--primary));
  box-shadow: 0 1px 4px hsl(var(--foreground) / 0.1);
  transform: translateY(-1px);
}

.xb-segmented button:focus-visible {
  outline: 2px solid hsl(var(--primary) / 0.55);
  outline-offset: 1px;
}

.xb-channel-table-wrap {
  height: auto;
  max-height: 30rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--foreground) / 0.2) transparent;
}

.xb-channel-table-wrap table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.75rem;
}

.xb-channel-table-wrap th,
.xb-channel-table-wrap td {
  height: 3.45rem;
  padding: 0 0.7rem;
  border-bottom: 1px solid hsl(var(--border));
  text-align: center;
  vertical-align: middle;
}

.xb-channel-table-wrap th {
  position: sticky;
  z-index: 1;
  top: 0;
  height: 2.8rem;
  background: hsl(var(--muted) / 0.48);
  color: hsl(var(--foreground) / 0.5);
  font-weight: 600;
}

.xb-channel-col-rank {
  width: 3rem;
}

.xb-channel-col-name {
  width: 43%;
}

.xb-channel-col-today,
.xb-channel-col-yesterday {
  width: 25%;
}

.xb-channel-table-wrap th:nth-child(1),
.xb-channel-table-wrap td:nth-child(1) {
  text-align: center;
}

.xb-channel-table-wrap th:nth-child(2),
.xb-channel-table-wrap td:nth-child(2) {
  text-align: left;
}

.xb-channel-today-head {
  border-left: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / 0.5) !important;
}

.xb-channel-yesterday-head {
  color: hsl(var(--foreground) / 0.5) !important;
}

.xb-channel-board[data-sort="today"] .xb-channel-today-head,
.xb-channel-board[data-sort="yesterday"] .xb-channel-yesterday-head {
  background: rgb(236 253 245);
  color: #047857 !important;
}

.xb-channel-board[data-sort="today"] .xb-channel-today-head::after,
.xb-channel-board[data-sort="yesterday"] .xb-channel-yesterday-head::after {
  content: " \2193";
  font-size: 0.68rem;
}

.dark .xb-channel-board[data-sort="today"] .xb-channel-today-head,
.dark .xb-channel-board[data-sort="yesterday"] .xb-channel-yesterday-head {
  background: rgb(6 78 59 / 0.34);
  color: #6ee7b7 !important;
}

.xb-channel-table-wrap tbody tr {
  transition: background-color 140ms ease;
  animation: xb-row-enter 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(150ms + var(--row-index) * 65ms);
}

.xb-channel-table-wrap tbody tr:hover {
  background: hsl(var(--muted) / 0.5);
}

.xb-channel-rank {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: hsl(var(--muted));
  color: hsl(var(--foreground) / 0.5);
  font-size: 0.7rem;
  font-weight: 700;
}

.xb-rank-1 {
  background: #fef3c7;
  color: #b45309;
}

.xb-rank-2 {
  background: #e5e7eb;
  color: #4b5563;
}

.xb-rank-3 {
  background: #ffedd5;
  color: #c2410c;
}

.xb-channel-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.xb-channel-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--channel-color) 28%, transparent);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--channel-color) 12%, hsl(var(--card)));
  color: var(--channel-color);
  font-size: 0.75rem;
  font-weight: 800;
}

.xb-channel-avatar {
  display: block;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.45rem;
  background: #fff;
  object-fit: contain;
  padding: 0.15rem;
}

.xb-channel-avatar--sdo {
  object-fit: contain;
  object-position: center;
  padding: 0;
}

.xb-channel-label {
  overflow: hidden;
  color: hsl(var(--foreground));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xb-channel-money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center !important;
  white-space: nowrap;
  transition: color 180ms ease;
}

.xb-channel-money-today {
  border-left: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / 0.52);
}

.xb-channel-money-yesterday {
  color: hsl(var(--foreground) / 0.52);
}

.xb-channel-board[data-sort="today"] .xb-channel-money-today,
.xb-channel-board[data-sort="yesterday"] .xb-channel-money-yesterday {
  background: rgb(236 253 245 / 0.42);
  color: #047857;
}

.dark .xb-channel-board[data-sort="today"] .xb-channel-money-today,
.dark .xb-channel-board[data-sort="yesterday"] .xb-channel-money-yesterday {
  color: #34d399;
}

.xb-channel-empty {
  height: 12rem !important;
  color: hsl(var(--foreground) / 0.42);
  text-align: center !important;
}

@keyframes xb-panel-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes xb-grid-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xb-line-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes xb-area-rise {
  from {
    opacity: 0;
    transform: scaleY(0.06);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes xb-point-pop {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes xb-row-enter {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes xb-day-segment-enter {
  from {
    opacity: 0;
    transform: rotate(-18deg) scale(0.76);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes xb-day-center-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.94);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
}

body .xb-cashier-card {
  position: relative;
  isolation: isolate;
  border-color: color-mix(in srgb, var(--xb-merchant-color) 22%, hsl(var(--border)));
  box-shadow: 0 2px 12px hsl(var(--foreground) / 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body .xb-cashier-card::before {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 0.2rem;
  border-radius: 0.5rem 0 0 0.5rem;
  background: var(--xb-merchant-color);
  content: "";
  opacity: 0.82;
  pointer-events: none;
}

body .xb-cashier-card:hover {
  border-color: color-mix(in srgb, var(--xb-merchant-color) 42%, hsl(var(--border)));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--xb-merchant-color) 9%, transparent);
  transform: translateY(-1px);
}

body .xb-cashier-card-head {
  min-height: 4.75rem !important;
  padding: 0.75rem 0.875rem !important;
}

body .xb-cashier-merchant {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.35rem !important;
  padding: 0.18rem 0.5rem 0.18rem 0.25rem;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--xb-merchant-color) 25%, transparent);
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--xb-merchant-color) 11%, hsl(var(--card)));
  color: var(--xb-merchant-color) !important;
  font-size: 0.6875rem !important;
  font-weight: 700;
  line-height: 1.25;
}

body .xb-cashier-merchant-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.25rem;
  background: var(--xb-merchant-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 800;
}

body .xb-cashier-merchant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .xb-cashier-card-stats > div {
  padding-block: 0.625rem !important;
}

body .xb-cashier-card-actions {
  min-height: 3.25rem !important;
  padding: 0.625rem 0.75rem !important;
}

.dark body .xb-cashier-merchant {
  background: color-mix(in srgb, var(--xb-merchant-color) 15%, hsl(var(--card)));
}

@media (min-width: 80rem) {
  .xb-channel-table-wrap table {
    min-width: 100%;
  }
}

@media (max-width: 79.9375rem) {
  .xb-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-xb-trends-anchor="true"] {
    min-height: 36rem !important;
  }

  .xb-trend-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .xb-channel-table-wrap {
    max-height: 30rem;
  }
}

@media (min-width: 64rem) and (max-width: 79.9375rem) {
  [data-xb-trends-anchor="true"] {
    min-height: 19.5rem !important;
  }

  .xb-trend-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .xb-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .xb-stats-grid[data-dashboard-role="checker"] {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-xb-channel-anchor="true"] {
    min-height: 20.625rem !important;
  }

  .xb-insight-header,
  .xb-channel-header {
    align-items: flex-start;
    padding: 0.75rem;
  }

  .xb-day-trends-grid {
    padding-inline: 0.35rem;
  }

  .xb-day-trend-item-header {
    padding-inline: 0.4rem;
    gap: 0.25rem;
  }

  .xb-day-trend-item-header strong {
    font-size: 0.68rem;
  }

  .xb-day-trend-item-header span {
    font-size: 0.58rem;
  }

  .xb-day-donut-center {
    width: 6.5rem;
  }

  .xb-day-donut-amount {
    font-size: 0.76rem;
  }

  .xb-day-donut-meta,
  .xb-day-donut-tooltip {
    font-size: 0.56rem;
  }

  .xb-channel-header {
    flex-direction: column;
  }

  .xb-channel-sort {
    width: 100%;
    justify-content: space-between;
  }

  .xb-segmented {
    flex: 1;
  }

  .xb-trend-chart {
    height: 12.75rem;
    padding: 0.5rem 0.5rem 0.35rem;
  }

  .xb-channel-table-wrap table {
    font-size: 0.7rem;
  }

  .xb-channel-table-wrap th,
  .xb-channel-table-wrap td {
    padding-inline: 0.35rem;
  }

  .xb-channel-col-rank {
    width: 2.5rem;
  }

  .xb-channel-col-name {
    width: 37%;
  }

  .xb-channel-col-today,
  .xb-channel-col-yesterday {
    width: 27%;
  }

  .xb-channel-mark {
    width: 1.75rem;
    height: 1.75rem;
  }

  .xb-channel-avatar {
    width: 1.75rem;
    height: 1.75rem;
    flex-basis: 1.75rem;
  }

  body .xb-cashier-card-head {
    padding-inline: 0.75rem !important;
  }

  body .xb-cashier-card-actions {
    padding-inline: 0.625rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xb-trend-panel,
  .xb-stat-card,
  .xb-day-trends-card,
  .xb-channel-board,
  .xb-chart-grid line,
  .xb-chart-grid text,
  .xb-chart-line,
  .xb-chart-area,
  .xb-chart-point,
  .xb-channel-table-wrap tbody tr,
  .xb-day-donut-segment,
  .xb-day-donut-center,
  .xb-outcome-bar-success,
  .xb-outcome-bar-failed,
  .xb-chart-point circle:first-child,
  .xb-chart-tooltip,
  .xb-channel-table-wrap tbody tr {
    animation: none;
    transition: none;
  }

  body .xb-cashier-card {
    transition: none;
  }

  .xb-chart-line {
    stroke-dashoffset: 0;
  }
}
