/**
 * RivenHalo user visual system. Layout/components only.
 * Does not apply to Admin or Advertiser shells.
 */
body.rh-user-app {
  background: var(--rh-color-bg, #f4f6f9);
  color: var(--rh-color-text, #0f172a);
}

body.rh-user-app .container:not(.container--wide) {
  width: min(calc(100% - 32px), var(--rh-page-max, 1280px));
  max-width: var(--rh-page-max, 1280px);
  margin-inline: auto;
}

body.rh-user-app .page-header:not(.rh-detail-header) {
  padding: var(--rh-space-7, 32px) 0 0;
  margin-bottom: 0;
}

body.rh-user-app .page-header h1,
body.rh-user-app .page-header .page-title {
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--rh-color-text, #0f172a);
}

body.rh-user-app .page-header .muted,
body.rh-user-app .page-header .page-lead {
  margin: var(--rh-space-2, 8px) 0 0;
  color: var(--rh-color-text-muted, #64748b);
  font-size: 0.95rem;
}

body.rh-user-app .rh-page-main,
body.rh-user-app main > .section {
  padding-top: var(--rh-space-7, 32px);
  padding-bottom: var(--rh-space-8, 40px);
}

body.rh-user-app .card,
body.rh-user-app .stat-card,
body.rh-user-app .summary-card,
body.rh-user-app .wd-card {
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--rh-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  height: auto;
}

body.rh-user-app .stat-card,
body.rh-user-app .summary-card,
body.rh-user-app .wd-card,
body.rh-user-app .profile-page .card,
body.rh-user-app .profile-hero,
body.rh-user-app .profile-balance {
  padding: var(--rh-space-5, 20px);
}

body.rh-user-app .btn {
  min-height: var(--rh-control-h, 40px);
  white-space: nowrap;
  border-radius: var(--rh-radius-md, 12px);
}

body.rh-user-app .btn--sm {
  min-height: var(--rh-control-h-sm, 36px);
}

body.rh-user-app .filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rh-space-2, 8px);
  margin-bottom: var(--rh-space-5, 20px);
}

body.rh-user-app .filter-btn {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--rh-color-border, #e2e8f0);
  color: var(--text-secondary, #475569);
  min-height: var(--rh-control-h-sm, 36px);
  padding: 0.4rem 0.9rem;
  white-space: nowrap;
}

body.rh-user-app .filter-btn:hover {
  background: var(--primary-soft, #ccfbf1);
  border-color: var(--primary, #0d9488);
  color: var(--primary-dark, #0f766e);
}

body.rh-user-app .filter-btn.is-active,
body.rh-user-app .filter-btn.is-active:hover {
  background: var(--primary, #0d9488);
  border-color: var(--primary, #0d9488);
  color: #fff;
}

body.rh-user-app .badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.3;
}

body.rh-user-app .grid-2,
body.rh-user-app .grid-3,
body.rh-user-app .grid-4 {
  width: 100%;
  gap: var(--rh-space-5, 20px);
}

body.rh-user-app .grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body.rh-user-app .grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body.rh-user-app .grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body.rh-user-app .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rh-space-3, 12px);
  margin-bottom: var(--rh-space-5, 20px);
}

body.rh-user-app .toolbar input,
body.rh-user-app .toolbar select,
body.rh-user-app input[type="text"],
body.rh-user-app input[type="email"],
body.rh-user-app input[type="password"],
body.rh-user-app input[type="search"],
body.rh-user-app input[type="number"],
body.rh-user-app select,
body.rh-user-app textarea {
  min-height: var(--rh-control-h, 40px);
  max-width: 100%;
  border: 1px solid var(--rh-color-border, #e2e8f0);
  border-radius: var(--rh-radius-sm, 8px);
  background: #fff;
}

body.rh-user-app .toolbar input,
body.rh-user-app .toolbar select {
  flex: 1 1 180px;
  min-width: 0;
}

body.rh-user-app .empty-state,
body.rh-user-app .rh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.25rem 1.75rem;
  height: auto;
  min-height: 0;
  background: var(--rh-color-surface, #fff);
  border: 1px solid var(--rh-color-border, #e2e8f0);
  border-radius: var(--rh-radius-md, 12px);
  box-shadow: var(--rh-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  color: var(--rh-color-text-muted, #64748b);
}

body.rh-user-app .empty-state__icon,
body.rh-user-app .rh-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 0 14px;
  border-radius: 999px;
  background: var(--rh-color-surface-soft, #f8fafc);
  color: var(--rh-color-text-muted, #64748b);
}

body.rh-user-app .empty-state h2,
body.rh-user-app .rh-empty h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--rh-color-text, #0f172a);
}

body.rh-user-app .empty-state p,
body.rh-user-app .rh-empty p {
  margin: 0;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--rh-color-text-muted, #64748b);
}

body.rh-user-app .empty-state .btn,
body.rh-user-app .rh-empty .btn {
  margin-top: 14px;
}

body.rh-user-app .tx-list:has(> .empty-state),
body.rh-user-app .tx-list:has(> .rh-empty) {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

body.rh-user-app .grid-2 > .empty-state,
body.rh-user-app .grid-3 > .empty-state,
body.rh-user-app .grid-4 > .empty-state,
body.rh-user-app .grid-2 > .rh-empty,
body.rh-user-app .grid-3 > .rh-empty,
body.rh-user-app .grid-4 > .rh-empty {
  grid-column: 1 / -1;
  justify-self: center;
}

body.rh-user-app .profile-activity .empty-state,
body.rh-user-app .wd-history-card .empty-state {
  min-height: 0;
  max-height: none;
  justify-content: flex-start;
}

body.rh-user-app .rh-media-frame,
body.rh-user-app .rh-reward-media,
body.rh-user-app .reward-card__media {
  background: #f1f5f9;
}

body.rh-user-app .rh-reward-media img,
body.rh-user-app .reward-card__media img {
  object-fit: contain;
}

body.rh-user-app .modal__dialog {
  border-radius: var(--radius-md, 14px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.rh-user-app .points-card.card,
body.rh-user-app .stat-card.summary-card--highlight,
body.rh-user-app .summary-card.summary-card--highlight,
body.rh-user-app .profile-balance.card {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
  border: none;
}

body.rh-user-app .stat-card.summary-card--highlight .stat-label,
body.rh-user-app .summary-card--highlight .stat-label,
body.rh-user-app .summary-card--highlight .summary-card__label {
  color: rgba(255, 255, 255, 0.72);
}

body.rh-user-app .stat-card.summary-card--highlight .stat-value,
body.rh-user-app .summary-card--highlight .stat-value,
body.rh-user-app .points-card .points-card__value,
body.rh-user-app .points-card .points-card__label {
  color: #fff;
}

body.rh-user-app .tx-list,
body.rh-user-app .order-row,
body.rh-user-app .tx-item {
  min-width: 0;
}

body.rh-user-app .order-row,
body.rh-user-app .tx-item {
  border-radius: var(--radius-md, 14px);
}

@media (max-width: 1024px) {
  body.rh-user-app .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  body.rh-user-app .page-header:not(.rh-detail-header) {
    padding-top: var(--rh-space-6, 24px);
  }

  body.rh-user-app .page-header h1,
  body.rh-user-app .page-header .page-title {
    font-size: 1.55rem;
  }

  body.rh-user-app .rh-page-main,
  body.rh-user-app main > .section {
    padding-top: var(--rh-space-6, 24px);
    padding-bottom: calc(
      var(--rh-mobile-bottom-nav-height, 56px) + var(--rh-safe-bottom, env(safe-area-inset-bottom, 0px)) +
        var(--rh-space-5, 20px)
    );
  }

  body.rh-user-app main:not(:has(.rh-page-main)):not(:has(> .section)) {
    padding-bottom: calc(
      var(--rh-mobile-bottom-nav-height, 56px) + var(--rh-safe-bottom, env(safe-area-inset-bottom, 0px)) +
        var(--rh-space-5, 20px)
    );
  }

  body.rh-user-app .btn,
  body.rh-user-app .btn--sm,
  body.rh-user-app .filter-btn {
    min-height: var(--rh-control-h-lg, 44px);
  }

  body.rh-user-app .stat-card,
  body.rh-user-app .summary-card,
  body.rh-user-app .wd-card,
  body.rh-user-app .profile-page .card,
  body.rh-user-app .profile-hero,
  body.rh-user-app .profile-balance {
    padding: var(--rh-space-4, 16px);
  }

  body.rh-user-app .grid-2,
  body.rh-user-app .grid-3,
  body.rh-user-app .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--rh-space-4, 16px);
  }

  body.rh-user-app .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  body.rh-user-app .empty-state,
  body.rh-user-app .rh-empty {
    max-width: none;
    width: 100%;
    margin-inline: 0;
    padding: 1.5rem 1rem;
  }

  body.rh-user-app main input[type="text"],
  body.rh-user-app main input[type="email"],
  body.rh-user-app main input[type="password"],
  body.rh-user-app main input[type="search"],
  body.rh-user-app main input[type="number"],
  body.rh-user-app main select,
  body.rh-user-app main textarea {
    width: 100%;
  }
}

@media (max-width: 430px) {
  body.rh-user-app .container:not(.container--wide) {
    width: calc(100% - 32px);
    max-width: var(--rh-page-max, 1280px);
    margin-inline: auto;
  }

  body.rh-user-app .watch-controls .btn {
    min-height: 44px;
  }

  body.rh-user-app .watch-guidance,
  body.rh-user-app .watch-playback-status,
  body.rh-user-app .watch-maintenance {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
