@import 'tailwindcss';
@import './themes.css';
@import './components.css';
@config '../../tailwind.config.js';
@source '../../src/views/**/*.ejs';
@source '../../public/miniapp/js/**/*.js';

@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--app-bg);
    font-family: var(--font-sans);
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    overflow-wrap: anywhere;
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: var(--app-text);
    overflow-x: hidden;
    background:
      radial-gradient(
        circle at 12% 0%,
        color-mix(in srgb, var(--app-primary) 15%, transparent),
        transparent 24rem
      ),
      radial-gradient(
        circle at 88% 14%,
        color-mix(in srgb, var(--app-accent) 12%, transparent),
        transparent 28rem
      ),
      var(--app-bg);
  }

  body.modal-open {
    overflow: hidden;
  }

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

  button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
  }

  img,
  svg {
    display: block;
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p {
    margin-top: 0;
  }

  a {
    color: var(--app-primary);
  }
}

@layer components {
  .skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.7rem;
    color: #fff;
    background: var(--app-primary);
    transform: translateY(-150%);
  }

  .skip-link:focus {
    transform: translateY(var(--app-safe-top));
  }

  .app-shell {
    width: min(100%, 45rem);
    min-height: 100dvh;
    margin: 0 auto;
  }

  .app-header {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    min-height: calc(4.25rem + var(--app-safe-top));
    align-items: center;
    justify-content: space-between;
    padding: calc(0.65rem + var(--app-safe-top)) calc(1rem + var(--app-safe-right)) 0.65rem
      calc(1rem + var(--app-safe-left));
    border-bottom: 1px solid var(--app-border);
    background: color-mix(in srgb, var(--app-bg) 83%, transparent);
    backdrop-filter: blur(18px) saturate(150%);
  }

  .header-brand,
  .header-actions,
  .balance-card-top,
  .balance-actions,
  .section-heading,
  .page-heading,
  .task-heading,
  .task-meta,
  .inline-actions,
  .attempt-status-row,
  .referral-name-row,
  .withdrawal-name-row {
    display: flex;
    align-items: center;
  }

  .header-brand {
    min-width: 0;
    gap: 0.65rem;
  }

  .header-brand img {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.72rem;
    box-shadow: 0 0.45rem 1.1rem color-mix(in srgb, var(--app-primary) 25%, transparent);
  }

  .header-brand-name {
    overflow: hidden;
    max-width: 14rem;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    flex: none;
    gap: 0.45rem;
  }

  .app-view {
    min-height: calc(100dvh - 9rem);
    padding: 0 1rem calc(6.5rem + var(--app-safe-bottom));
    outline: none;
  }

  .page {
    display: grid;
    gap: 1rem;
    padding: 1.1rem 0 2rem;
    animation: page-enter 260ms ease-out both;
  }

  .page-heading {
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0 0.15rem;
  }

  .page-heading h1 {
    margin-bottom: 0.3rem;
    font-size: clamp(1.5rem, 7vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
  }

  .page-heading p:last-child,
  .section-heading p {
    margin-bottom: 0;
    color: var(--app-text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .eyebrow {
    margin-bottom: 0.3rem;
    color: var(--app-primary);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  .eyebrow-inverse {
    color: rgb(255 255 255 / 0.7);
  }

  .section-heading {
    justify-content: space-between;
    gap: 1rem;
    margin: 0.2rem 0 0.75rem;
  }

  .section-heading h2,
  .standalone-section-title,
  .settings-card > h2,
  .rules-card h2,
  .withdraw-composer h2 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
    letter-spacing: -0.02em;
  }

  .standalone-section-title {
    margin: 0.35rem 0 0.75rem;
  }

  .button,
  .icon-button,
  .avatar-button,
  .button-link,
  .filter-chip,
  .nav-item,
  .method-card,
  .settings-link,
  .slider-dot {
    min-height: 2.75rem;
    border: 0;
    text-decoration: none;
    transition: 160ms ease;
  }

  .button:active:not(:disabled),
  .icon-button:active:not(:disabled),
  .avatar-button:active:not(:disabled),
  .filter-chip:active:not(:disabled),
  .method-card:active:not(:disabled) {
    transform: scale(0.975);
  }

  .button {
    display: inline-flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    border-radius: 0.9rem;
    font-size: 0.88rem;
    font-weight: 800;
  }

  .button-primary {
    color: #fff;
    background: linear-gradient(
      135deg,
      var(--app-primary),
      color-mix(in srgb, var(--app-primary) 58%, var(--app-accent))
    );
    box-shadow: 0 0.6rem 1.4rem color-mix(in srgb, var(--app-primary) 22%, transparent);
  }

  .button-secondary {
    border: 1px solid var(--app-border);
    color: var(--app-text);
    background: var(--app-surface-strong);
  }

  .button-on-gradient {
    color: #1e2a43;
    background: #fff;
  }

  .button-small {
    min-height: 2.35rem;
    padding: 0.52rem 0.8rem;
    border-radius: 0.72rem;
    font-size: 0.78rem;
  }

  .button-block {
    width: 100%;
  }

  .button-link {
    min-height: 2.5rem;
    padding: 0.35rem 0.2rem;
    color: var(--app-primary);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .icon-button,
  .avatar-button {
    position: relative;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    color: var(--app-text);
    background: var(--app-surface);
  }

  .avatar-button {
    border-color: color-mix(in srgb, var(--app-primary) 22%, transparent);
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-accent));
    font-size: 0.75rem;
    font-weight: 850;
  }

  .icon-button-on-gradient {
    border-color: rgb(255 255 255 / 0.2);
    color: #fff;
    background: rgb(255 255 255 / 0.13);
  }

  .notification-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    display: grid;
    min-width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    padding: 0 0.25rem;
    border: 2px solid var(--app-bg);
    border-radius: 999px;
    color: #fff;
    background: var(--app-danger);
    font-size: 0.75rem;
    font-weight: 900;
  }

  .bottom-navigation {
    position: fixed;
    z-index: 45;
    right: max(var(--app-safe-right), calc((100vw - 45rem) / 2));
    bottom: 0;
    left: max(var(--app-safe-left), calc((100vw - 45rem) / 2));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(4.7rem + var(--app-safe-bottom));
    padding: 0.45rem 0.5rem calc(0.45rem + var(--app-safe-bottom));
    border-top: 1px solid var(--app-border);
    background: color-mix(in srgb, var(--app-surface-strong) 90%, transparent);
    box-shadow: 0 -0.8rem 2rem rgb(15 23 42 / 0.08);
    backdrop-filter: blur(20px) saturate(160%);
  }

  .nav-item {
    display: flex;
    min-width: 0;
    min-height: 3.65rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    border-radius: 0.85rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    font-weight: 750;
  }

  .nav-item-active {
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 10%, transparent);
  }

  .balance-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    border-radius: 1.55rem;
    color: #fff;
    background:
      radial-gradient(circle at 90% -20%, rgb(255 255 255 / 0.28), transparent 42%),
      linear-gradient(135deg, #0369a1, var(--app-primary) 48%, var(--app-accent));
    box-shadow: 0 1.2rem 2.8rem color-mix(in srgb, var(--app-primary) 27%, transparent);
  }

  .balance-card::after {
    position: absolute;
    right: -2rem;
    bottom: -3.5rem;
    width: 9rem;
    height: 9rem;
    border: 1.5rem solid rgb(255 255 255 / 0.08);
    border-radius: 50%;
    content: '';
  }

  .balance-card-top,
  .balance-actions {
    position: relative;
    z-index: 1;
    justify-content: space-between;
  }

  .balance-amount {
    display: block;
    margin-top: 0.18rem;
    font-size: clamp(2rem, 10vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.06em;
  }

  .balance-icon {
    flex-shrink: 0;
    display: grid;
    width: 3.15rem;
    height: 3.15rem;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.12);
  }

  .balance-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.15rem 0;
    padding: 0.8rem;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.09);
  }

  .labeled-value {
    display: grid;
    gap: 0.18rem;
  }

  .labeled-value-label {
    color: rgb(255 255 255 / 0.65);
    font-size: 0.75rem;
  }

  .labeled-value-data {
    font-size: 0.9rem;
  }

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

  .stat-card,
  .daily-progress-card,
  .task-card,
  .rules-card,
  .withdraw-composer,
  .settings-card,
  .wallet-summary,
  .your-rank-card,
  .profile-facts,
  .profile-identity,
  .referral-row,
  .withdrawal-row,
  .history-row,
  .notification-page-item,
  .tutorial-card {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    box-shadow: 0 0.7rem 2rem rgb(15 23 42 / 0.055);
    backdrop-filter: blur(12px);
  }

  .stat-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem;
    border-radius: 1.1rem;
  }

  .stat-icon,
  .error-state-icon,
  .state-icon {
    display: grid;
    flex: none;
    place-items: center;
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 11%, transparent);
  }

  .stat-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
  }

  .stat-card-accent .stat-icon {
    color: var(--app-accent);
    background: color-mix(in srgb, var(--app-accent) 11%, transparent);
  }

  .stat-label,
  .stat-value {
    display: block;
  }

  .stat-label {
    overflow: hidden;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-value {
    margin-top: 0.1rem;
    font-size: 0.95rem;
  }

  .daily-progress-card,
  .rules-card,
  .settings-card,
  .withdraw-composer {
    padding: 1rem;
    border-radius: 1.15rem;
  }

  .progress-track {
    display: block;
    width: 100%;
    height: 0.48rem;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: color-mix(in srgb, var(--app-text-muted) 14%, transparent);
  }

  .progress-track::-webkit-progress-bar {
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-text-muted) 14%, transparent);
  }

  .progress-track::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
  }
  .progress-track::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
  }

  .progress-track-small {
    height: 0.34rem;
    margin-top: 0.5rem;
  }

  .free-reward-card {
    display: grid;
    grid-template-columns: minmax(6rem, 31%) 1fr;
    align-items: center;
    gap: 0.7rem;
    overflow: hidden;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--app-accent) 22%, transparent);
    border-radius: 1.35rem;
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--app-accent) 10%, var(--app-surface)),
      var(--app-surface)
    );
  }

  .free-reward-card img {
    width: 100%;
    max-height: 8rem;
    object-fit: contain;
  }

  .free-reward-copy h2 {
    margin: 0.4rem 0 0.25rem;
    font-size: 1rem;
  }

  .free-reward-copy p,
  .free-reward-copy small {
    margin-bottom: 0.5rem;
    color: var(--app-text-muted);
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .chip,
  .status-pill {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    border-radius: 999px;
    font-weight: 800;
  }

  .chip {
    padding: 0.28rem 0.5rem;
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 10%, transparent);
    font-size: 0.75rem;
  }

  .chip-free {
    color: var(--app-success);
    background: color-mix(in srgb, var(--app-success) 11%, transparent);
  }

  .status-pill {
    padding: 0.25rem 0.48rem;
    color: var(--app-text-muted);
    background: color-mix(in srgb, var(--app-text-muted) 10%, transparent);
    font-size: 0.75rem;
    text-transform: capitalize;
  }

  .status-active,
  .status-approved,
  .status-paid,
  .status-completed,
  .status-eligible {
    color: var(--app-success);
    background: color-mix(in srgb, var(--app-success) 11%, transparent);
  }

  .status-pending,
  .status-under-review,
  .status-processing,
  .status-verifying,
  .status-held {
    color: #b45309;
    background: rgb(245 158 11 / 0.12);
  }

  .status-rejected,
  .status-reversed,
  .status-expired {
    color: var(--app-danger);
    background: color-mix(in srgb, var(--app-danger) 10%, transparent);
  }

  .banner-slider,
  .banner-card {
    overflow: hidden;
    border-radius: 1.25rem;
  }

  .banner-card {
    display: grid;
    min-height: 8.5rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-strong);
  }

  .banner-card > img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
  }

  .banner-copy {
    padding: 1rem;
  }

  .banner-copy h2 {
    margin-bottom: 0.3rem;
    font-size: 1rem;
  }

  .banner-copy p {
    color: var(--app-text-muted);
    font-size: 0.78rem;
  }

  .slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0 0.15rem;
  }

  .slider-dot {
    min-width: 0;
    min-height: 0;
    width: 0.45rem;
    height: 0.45rem;
    padding: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-text-muted) 28%, transparent);
  }

  .slider-dot[aria-pressed='true'] {
    width: 1.35rem;
    background: var(--app-primary);
  }

  .announcement-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--app-primary) 20%, transparent);
    border-left: 0.24rem solid var(--app-primary);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
  }

  .announcement-warning {
    border-left-color: #f59e0b;
  }

  .announcement-critical {
    border-left-color: var(--app-danger);
  }

  .announcement-card h3 {
    margin-bottom: 0.2rem;
    font-size: 0.86rem;
  }

  .announcement-body,
  .notification-body {
    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .task-list,
  .activity-list,
  .referral-list,
  .withdrawal-list,
  .history-list,
  .notification-page-list,
  .tutorial-grid,
  .leader-list,
  .skeleton-list {
    display: grid;
    gap: 0.7rem;
  }

  .task-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 1.05rem;
  }

  .task-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    overflow: hidden;
    border-radius: 0.9rem;
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 10%, transparent);
  }

  .task-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .task-copy {
    min-width: 0;
  }

  .task-heading {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .task-heading h3 {
    margin-bottom: 0;
    font-size: 0.86rem;
  }

  .task-copy > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0.3rem 0;
    color: var(--app-text-muted);
    font-size: 0.7rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .task-meta {
    flex-wrap: wrap;
    gap: 0.45rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .task-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
  }

  .reward-text,
  .amount-positive {
    color: var(--app-success);
  }

  .amount-negative,
  .availability-note {
    color: var(--app-danger) !important;
  }

  .search-input,
  .field-group input,
  .field-group select,
  .amount-input-wrap {
    width: 100%;
    min-height: 3rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: var(--app-surface-strong);
    outline: none;
  }

  .search-input,
  .field-group input,
  .field-group select {
    padding: 0.72rem 0.85rem;
  }

  .search-input:focus,
  .field-group input:focus,
  .field-group select:focus,
  .amount-input-wrap:focus-within {
    border-color: var(--app-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-focus) 16%, transparent);
  }

  .chip-row,
  .method-rail {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.1rem 0 0.3rem;
    scrollbar-width: none;
  }

  .filter-chip {
    flex: none;
    min-height: 2.35rem;
    padding: 0.48rem 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-text-muted);
    background: var(--app-surface);
    font-size: 0.7rem;
    font-weight: 800;
  }

  .filter-chip-active {
    border-color: var(--app-primary);
    color: #fff;
    background: var(--app-primary);
  }

  .activity-item,
  .leader-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.2rem;
    border-bottom: 1px solid var(--app-border);
  }

  .activity-item:last-child,
  .leader-row:last-child {
    border-bottom: 0;
  }

  .activity-mark,
  .history-mark {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    background: var(--app-primary);
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--app-primary) 10%, transparent);
  }

  .activity-item strong,
  .activity-item small {
    display: block;
    font-size: 0.75rem;
  }

  .activity-item small {
    margin-top: 0.15rem;
    color: var(--app-text-muted);
  }

  .podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 0.5rem;
    padding-top: 1rem;
  }

  .podium-card {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.1rem 0.45rem 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 1.1rem;
    background: var(--app-surface);
    text-align: center;
  }

  .podium-1 {
    order: 2;
    min-height: 10.6rem;
    border-color: rgb(245 158 11 / 0.35);
    background: linear-gradient(180deg, rgb(245 158 11 / 0.12), var(--app-surface));
  }

  .podium-2 {
    order: 1;
    min-height: 9.3rem;
  }

  .podium-3 {
    order: 3;
    min-height: 8.7rem;
  }

  .podium-card.current-user,
  .leader-row.current-user {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
  }

  .podium-rank {
    color: var(--app-text-muted);
    font-size: 0.75rem;
    font-weight: 850;
  }

  .leader-avatar,
  .profile-avatar,
  .method-monogram {
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-accent));
    font-weight: 850;
  }

  .leader-avatar {
    width: 3.15rem;
    height: 3.15rem;
  }

  .leader-avatar-small {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 0.75rem;
  }

  .podium-card strong,
  .podium-card small,
  .podium-card b {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .podium-card b {
    margin-top: 0.25rem;
    color: var(--app-primary);
  }

  .your-rank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem;
    border-radius: 1rem;
  }

  .leader-list {
    padding: 0 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 1.1rem;
    background: var(--app-surface);
  }

  .leader-copy,
  .referral-copy,
  .withdrawal-copy,
  .history-copy,
  .notification-copy {
    min-width: 0;
  }

  .leader-copy strong,
  .leader-copy small {
    display: block;
  }

  .leader-copy small,
  .data-note,
  .form-safety-note,
  .limit-note,
  .method-instructions,
  .muted,
  .muted-centered {
    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .data-note,
  .form-safety-note,
  .muted-centered {
    margin: 0;
    text-align: center;
  }

  .referral-hero {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 1.3rem 1rem;
    border-radius: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, #0369a1, var(--app-primary), var(--app-accent));
    text-align: center;
  }

  .referral-hero-icon {
    display: grid;
    width: 3.6rem;
    height: 3.6rem;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 1.1rem;
    background: rgb(255 255 255 / 0.12);
  }

  .referral-hero > p {
    margin: 0;
    color: rgb(255 255 255 / 0.72);
    font-size: 0.75rem;
  }

  .referral-hero > strong {
    font-size: 1.8rem;
  }

  .share-link-box {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem 0.45rem 0.8rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 0.9rem;
    background: rgb(255 255 255 / 0.1);
  }

  .share-link-box > span {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .share-link-box .icon-button {
    width: 2.35rem;
    height: 2.35rem;
    min-height: 2.35rem;
    border-color: rgb(255 255 255 / 0.16);
    color: #fff;
    background: rgb(255 255 255 / 0.12);
  }

  .rules-card ul {
    display: grid;
    gap: 0.55rem;
    margin: 0.7rem 0 0;
    padding-left: 1.2rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .referral-row,
  .withdrawal-row,
  .history-row,
  .notification-page-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem;
    border-radius: 1rem;
  }

  .referral-name-row,
  .withdrawal-name-row {
    justify-content: space-between;
    gap: 0.5rem;
  }

  .referral-copy small,
  .withdrawal-copy small,
  .history-copy small,
  .notification-copy time {
    display: block;
    margin-top: 0.18rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .wallet-summary {
    display: grid;
    gap: 0.25rem;
    padding: 1.15rem;
    border-radius: 1.2rem;
    text-align: center;
  }

  .wallet-summary span,
  .wallet-summary small {
    color: var(--app-text-muted);
    font-size: 0.7rem;
  }

  .wallet-summary strong {
    color: var(--app-primary);
    font-size: 2rem;
  }

  .method-card {
    display: grid;
    min-width: 8.2rem;
    justify-items: center;
    gap: 0.3rem;
    padding: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    color: var(--app-text);
    background: var(--app-surface-strong);
  }

  .method-card-active {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary) 12%, transparent);
  }

  .method-monogram {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.78rem;
  }

  .method-card small {
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .amount-field,
  .field-group {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.85rem;
  }

  .amount-field > span,
  .field-group > span {
    font-size: 0.7rem;
    font-weight: 800;
  }

  .field-group small {
    min-height: 0.8rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .amount-input-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
  }

  .amount-input-wrap > span {
    color: var(--app-primary);
    font-size: 1.15rem;
    font-weight: 850;
  }

  .amount-input {
    min-width: 0;
    min-height: 3.15rem;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.45rem;
    font-weight: 850;
    outline: none;
  }

  .dynamic-fields {
    margin-bottom: 0.85rem;
  }

  .disclosure-box {
    padding: 0.7rem;
    border: 1px solid color-mix(in srgb, var(--app-primary) 17%, transparent);
    border-radius: 0.75rem;
    color: var(--app-text-muted);
    background: color-mix(in srgb, var(--app-primary) 6%, transparent);
    font-size: 0.7rem;
    line-height: 1.5;
  }

  .quote-breakdown,
  .attempt-details,
  .profile-facts {
    display: grid;
    gap: 0;
    margin: 0;
  }

  .quote-breakdown > div,
  .attempt-details > div,
  .profile-facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--app-border);
  }

  .quote-breakdown dt,
  .attempt-details dt,
  .profile-facts dt {
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .quote-breakdown dd,
  .attempt-details dd,
  .profile-facts dd {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .quote-net {
    color: var(--app-success);
  }

  .history-mark {
    width: 0.7rem;
    height: 0.7rem;
  }

  .history-referral {
    background: var(--app-accent);
  }

  .history-mystery {
    background: #f59e0b;
  }

  .history-copy strong {
    display: block;
    font-size: 0.76rem;
  }

  .tutorial-card {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    overflow: hidden;
    padding: 0.6rem;
    border-radius: 1rem;
    color: var(--app-text);
    text-decoration: none;
  }

  .tutorial-card img,
  .tutorial-placeholder {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border-radius: 0.75rem;
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 10%, transparent);
    object-fit: cover;
  }

  .tutorial-card h2 {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
  }

  .tutorial-card p {
    margin: 0;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .tutorial-cover {
    width: 100%;
    max-height: 18rem;
    border-radius: 1.1rem;
    object-fit: cover;
  }

  .tutorial-body {
    font-size: 0.86rem;
    line-height: 1.75;
  }

  .notification-page-item {
    align-items: start;
  }

  .notification-unread {
    border-color: color-mix(in srgb, var(--app-primary) 28%, transparent);
    background: color-mix(in srgb, var(--app-primary) 5%, var(--app-surface));
  }

  .notification-icon {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 0.8rem;
    color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 10%, transparent);
  }

  .notification-copy h2,
  .notification-copy h3 {
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
  }

  .notification-copy p {
    margin-bottom: 0.3rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .profile-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1.15rem;
  }

  .profile-avatar {
    width: 4rem;
    height: 4rem;
    flex: none;
    font-size: 1.1rem;
  }

  .profile-identity h2 {
    margin-bottom: 0.15rem;
    font-size: 1.1rem;
  }

  .profile-identity p {
    margin-bottom: 0.4rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .profile-facts {
    padding: 0.25rem 0.85rem;
    border-radius: 1.05rem;
  }

  .profile-form {
    display: grid;
    gap: 0.35rem;
  }

  .switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
  }

  .switch-row strong,
  .switch-row small {
    display: block;
  }

  .switch-row strong {
    font-size: 0.76rem;
  }

  .switch-row small {
    margin-top: 0.22rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
  }

  .switch-input {
    width: 2.8rem;
    height: 1.55rem;
    flex: none;
    accent-color: var(--app-primary);
  }

  .settings-links {
    display: grid;
  }

  .settings-link {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    background: transparent;
    font-size: 0.78rem;
  }

  .attempt-panel,
  .quote-review,
  .reward-details,
  .reward-result {
    display: grid;
    gap: 0.85rem;
  }

  .attempt-status-row {
    justify-content: space-between;
  }

  .task-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--app-text-muted);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
  }

  .reward-result {
    justify-items: center;
    text-align: center;
  }

  .reward-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .reward-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--app-border);
    font-size: 0.75rem;
  }

  .empty-state,
  .error-state,
  .state-page,
  .launch-screen {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .empty-state,
  .error-state {
    gap: 0.45rem;
    padding: 2rem 1rem;
    border: 1px dashed var(--app-border);
    border-radius: 1.1rem;
    background: color-mix(in srgb, var(--app-surface) 65%, transparent);
  }

  .empty-state h2,
  .error-state h1,
  .error-state h2,
  .state-page h1,
  .launch-screen h1 {
    margin-bottom: 0.1rem;
    font-size: 1.05rem;
  }

  .empty-state p,
  .error-state p,
  .state-page p,
  .launch-screen p {
    max-width: 25rem;
    margin-bottom: 0.5rem;
    color: var(--app-text-muted);
    font-size: 0.76rem;
    line-height: 1.55;
  }

  .empty-icon,
  .error-state-icon,
  .state-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.1rem;
  }

  .state-page,
  .launch-screen {
    min-height: calc(100dvh - var(--app-safe-top) - var(--app-safe-bottom));
    place-content: center;
    gap: 0.7rem;
    padding: calc(2rem + var(--app-safe-top)) 1.2rem calc(2rem + var(--app-safe-bottom));
  }

  .launch-logo {
    filter: drop-shadow(0 1rem 1.2rem color-mix(in srgb, var(--app-primary) 25%, transparent));
    animation: launch-pulse 1.8s ease-in-out infinite;
  }

  .launch-screen .progress-track {
    width: min(15rem, 70vw);
  }

  .launch-screen .progress-track span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
    animation: launch-progress 1.4s ease-in-out infinite;
  }

  .page-heading-skeleton,
  .skeleton-card,
  .skeleton-line {
    background: linear-gradient(
      90deg,
      rgb(148 163 184 / 0.08) 20%,
      rgb(148 163 184 / 0.17) 50%,
      rgb(148 163 184 / 0.08) 80%
    );
    background-size: 220% 100%;
    animation: shimmer 1.35s linear infinite;
  }

  .page-heading-skeleton {
    width: 55%;
    height: 2.8rem;
    border-radius: 0.9rem;
  }

  .skeleton-card {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 1rem;
  }

  .skeleton-line {
    width: 100%;
    height: 0.7rem;
    border-radius: 999px;
  }

  .skeleton-line-short {
    width: 38%;
  }

  .skeleton-line-medium {
    width: 68%;
  }

  .modal-backdrop,
  .drawer-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    padding: 1rem;
    background: rgb(2 6 23 / 0.58);
    backdrop-filter: blur(6px);
  }

  .modal-backdrop {
    place-items: center;
  }

  .modal-panel {
    width: min(100%, 31rem);
    max-height: min(82dvh, 42rem);
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: 1.4rem;
    background: var(--app-surface-strong);
    box-shadow: 0 2rem 6rem rgb(2 6 23 / 0.28);
    animation: modal-enter 200ms ease-out both;
  }

  .modal-header,
  .drawer-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-strong);
  }

  .modal-header h2,
  .drawer-header h2 {
    margin: 0;
    font-size: 1rem;
  }

  .modal-header .icon-button,
  .drawer-header .icon-button {
    width: 2.35rem;
    height: 2.35rem;
    min-height: 2.35rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .modal-actions {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.55rem;
    padding: 0 1rem 1rem;
  }

  .drawer-backdrop {
    place-items: stretch end;
    padding: 0;
  }

  .notification-drawer {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: min(92vw, 25rem);
    height: 100dvh;
    overflow: hidden;
    padding-top: var(--app-safe-top);
    border-left: 1px solid var(--app-border);
    background: var(--app-surface-strong);
    animation: drawer-enter 220ms ease-out both;
  }

  .drawer-list {
    overflow: auto;
    padding: 0.6rem;
  }

  .notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--app-border);
  }

  .notification-item .button-link {
    grid-column: 2;
    justify-self: start;
  }

  .drawer-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0.75rem calc(0.75rem + var(--app-safe-bottom));
    border-top: 1px solid var(--app-border);
  }

  .toast-region {
    position: fixed;
    z-index: 150;
    right: max(0.75rem, var(--app-safe-right));
    bottom: calc(5.7rem + var(--app-safe-bottom));
    left: max(0.75rem, var(--app-safe-left));
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    pointer-events: none;
  }

  .toast {
    display: flex;
    width: min(100%, 26rem);
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    color: var(--app-text);
    background: var(--app-surface-strong);
    box-shadow: 0 1rem 3rem rgb(2 6 23 / 0.2);
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(0.75rem);
    transition: 180ms ease;
  }

  .toast-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .toast-success svg {
    color: var(--app-success);
  }

  .toast-error svg {
    color: var(--app-danger);
  }

  .pagination {
    display: grid;
    justify-items: center;
  }

  .noscript-message {
    margin: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    color: #fff;
    background: #b91c1c;
    text-align: center;
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.98);
  }
}

@keyframes drawer-enter {
  from {
    transform: translateX(100%);
  }
}

@keyframes launch-pulse {
  50% {
    transform: translateY(-0.3rem) scale(1.03);
  }
}

@keyframes launch-progress {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(225%);
  }
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

@media (min-width: 44rem) {
  .app-view {
    padding-right: 1.35rem;
    padding-left: 1.35rem;
  }

  .banner-card {
    grid-template-columns: 42% 1fr;
    align-items: stretch;
  }

  .banner-card > img {
    height: 100%;
    min-height: 10rem;
  }

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

@media (max-width: 359px) {
  .app-view {
    padding-right: 0.7rem;
    padding-left: 0.7rem;
  }

  .nav-item {
    font-size: 0.75rem;
  }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .free-reward-card {
    grid-template-columns: 1fr;
  }
}

:root[data-performance='reduced'] .app-header,
:root[data-performance='reduced'] .bottom-navigation,
:root[data-performance='reduced'] .modal-backdrop,
:root[data-performance='reduced'] .drawer-backdrop {
  backdrop-filter: none;
}

[hidden],
.app-header:empty,
.bottom-navigation:empty {
  display: none !important;
}
.bottom-navigation {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.leader-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}
.nav-item {
  font-size: 0.75rem;
}
.button-link,
.slider-dot {
  min-width: 2.75rem;
  min-height: 2.75rem;
}
.slider-dot {
  border-radius: 0.75rem;
}
.task-card,
.settings-card,
.daily-progress-card,
.modal-panel {
  border-radius: var(--app-radius, 1.125rem);
}
.notification-body,
.quote-breakdown dd {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.button-primary {
  background: var(--app-primary);
  color: var(--app-on-primary, #fff);
}
:root[data-theme='dark'] {
  --app-on-primary: #08111f;
}
:root[data-blur='none'] *,
:root[data-performance='reduced'] * {
  backdrop-filter: none !important;
}
:root[data-theme-motion='reduced'] *,
:root[data-performance='reduced'] * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
