/* ============================================================
   KovaTask — main stylesheet
   Color scheme: TraderScheme (traderscheme.com)
     Primary:    #001840  (deep navy)
     Secondary:  #010d21  (darkest navy — surfaces/sidebar)
     Accent:     #1a3a6e  (mid-navy for hovers/highlights)
     Gold:       #f0b429  (warm CTA gold — complements navy)
   Font:         IBM Plex Sans (matching TraderScheme)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;700&display=swap');

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── TraderScheme palette ── */
  --ts-primary:     #001840;   /* deep navy — brand primary */
  --ts-secondary:   #010d21;   /* darkest navy — dark bg, sidebar */
  --ts-accent:      #1a3a6e;   /* mid-navy — hover states, borders */
  --ts-accent2:     #0a2550;   /* slightly lighter navy */
  --ts-gold:        #f0b429;   /* CTA gold — buttons, active, highlights */
  --ts-gold-dark:   #d49c1e;   /* darker gold for hover */
  --ts-gold-soft:   rgba(240, 180, 41, 0.15);  /* translucent gold tint */

  /* ── Semantic tokens (light content areas) ── */
  --primary:        var(--ts-primary);
  --primary-dark:   var(--ts-secondary);
  --primary-light:  rgba(0, 24, 64, 0.08);  /* navy tint on white */

  /* ── Status colours ── */
  --success:  #22C55E;
  --warning:  #F59E0B;
  --error:    #EF4444;
  --info:     #3B82F6;

  /* ── Layout surfaces ── */
  --bg:         #f4f6fb;          /* light off-white page bg */
  --surface:    #ffffff;          /* white cards */
  --surface-2:  #eef1f8;          /* slightly tinted surface */
  --border:     #dde2ef;

  /* ── Typography ── */
  --text:       #0d1626;          /* very dark navy-tinted text */
  --text-muted: #4a5568;
  --text-light: #8898aa;
  --text-inv:   #ffffff;          /* text on dark/navy backgrounds */

  /* ── Spacing & shape ── */
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,24,64,.10);
  --shadow-sm:  0 1px 4px rgba(0,24,64,.06);
  --shadow-md:  0 8px 32px rgba(0,24,64,.14);

  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ts-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Messages ---------- */
.messages {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 360px;
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
}

.message--success  { background: #DCFCE7; color: #166534; border-left: 4px solid var(--success); }
.message--error    { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--error); }
.message--warning  { background: #FEF3C7; color: #92400E; border-left: 4px solid var(--warning); }
.message--info     { background: #DBEAFE; color: #1E40AF; border-left: 4px solid var(--info); }

.message__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: .6;
  padding: 0;
}
.message__close:hover { opacity: 1; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---------- Auth layout ---------- */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  /* TraderScheme navy gradient background */
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26, 58, 110, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(240, 180, 41, 0.10) 0%, transparent 50%),
    linear-gradient(160deg, var(--ts-secondary) 0%, var(--ts-primary) 50%, #002060 100%);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  border-top: 3px solid var(--ts-gold);
}

.auth-header { text-align: center; margin-bottom: 2rem; }

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--ts-primary);
  color: var(--ts-gold);
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0,24,64,.30);
  letter-spacing: .05em;
}
.auth-logo--sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  border-radius: 10px;
}

.auth-title   { font-size: 1.5rem; font-weight: 700; color: var(--ts-primary); }
.auth-subtitle { font-size: .9rem; color: var(--text-muted); margin-top: .25rem; }

.auth-footer {
  text-align: center;
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}
.auth-footer a { color: var(--ts-primary); font-weight: 600; }

/* ---------- Forms ---------- */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ts-accent);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form-input,
select.form-input {
  width: 100%;
  padding: .65rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
select.form-input:focus {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(0, 24, 64, .12);
}

.select-wrapper {
  position: relative;
}
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: .875rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ts-accent);
  font-size: .75rem;
}
.select-wrapper select { padding-right: 2.5rem; }

.form-error {
  font-size: .8rem;
  color: var(--error);
  font-weight: 500;
}
.form-error--block {
  padding: .625rem .875rem;
  background: #FEE2E2;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--error);
}

.form-hint {
  font-size: .75rem;
  color: var(--text-light);
  margin-top: .15rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Gold CTA button — matches TraderScheme brand */
.btn--primary {
  background: var(--ts-gold);
  color: var(--ts-secondary);
  box-shadow: 0 2px 10px rgba(240, 180, 41, .35);
  letter-spacing: .02em;
}
.btn--primary:hover {
  background: var(--ts-gold-dark);
  box-shadow: 0 4px 16px rgba(240, 180, 41, .45);
}

/* Ghost button on dark sidebar */
.btn--ghost {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  border: 1.5px solid rgba(255,255,255,.15);
}
.btn--ghost:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

.btn--full { width: 100%; }

/* ---------- Dashboard layout ---------- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar — TraderScheme dark navy ── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--ts-secondary);  /* #010d21 */
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar__brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-inv);
  letter-spacing: .04em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .875rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
  text-decoration: none;
}
.nav-item--active {
  background: rgba(240, 180, 41, .12);
  color: var(--ts-gold);
  border-left: 3px solid var(--ts-gold);
  padding-left: calc(.875rem - 3px);
}
.nav-icon { font-size: 1rem; }

.sidebar__footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 960px;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.topbar__title { font-size: 1.5rem; font-weight: 700; color: var(--ts-primary); }
.topbar__sub   { font-size: .875rem; color: var(--text-muted); }
.topbar__user  { display: flex; align-items: center; gap: .75rem; }
.topbar__username { font-weight: 600; font-size: .9rem; color: var(--ts-primary); }
.topbar__email    { font-size: .8rem; color: var(--text-muted); }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,24,64,.25);
}

/* ── Welcome banner — TraderScheme navy ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-accent2) 60%, var(--ts-accent) 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: var(--text-inv);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
/* Subtle gold accent line on banner */
.welcome-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ts-gold), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}
.welcome-banner h3 { font-size: 1.2rem; font-weight: 700; }
.welcome-banner p  { opacity: .8; font-size: .9rem; margin-top: .25rem; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
  border-bottom: 3px solid transparent;
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-bottom-color: var(--ts-gold);
}
.stat-card__icon  { font-size: 1.5rem; margin-bottom: .5rem; }
.stat-card__value { font-size: 1.4rem; font-weight: 700; color: var(--ts-primary); }
.stat-card__label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Info card ── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.info-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.info-grid { display: flex; flex-direction: column; gap: .75rem; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--surface-2);
}
.info-row:last-child { border-bottom: none; }
.info-row__label { color: var(--text-muted); font-weight: 500; }
.info-row__value { font-weight: 600; color: var(--ts-primary); }

/* ---------- Responsive ---------- */
/* =============================================================
   Responsive — Mobile first
   Breakpoints:
     sm:  480px  (small phones)
     md:  768px  (tablets / landscape phones)
     lg:  1024px (desktop)
   ============================================================= */

/* ── Hamburger toggle button (hidden on desktop) ── */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-toggle svg { width: 20px; height: 20px; }

/* ── Sidebar overlay backdrop (mobile) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  opacity: 0;
  transition: opacity .25s ease;
}
.sidebar-backdrop.is-open { opacity: 1; }

/* ─── Tablet & mobile (≤ 900px) ─── */
@media (max-width: 900px) {

  /* ── Dashboard layout ── */
  .dashboard { flex-direction: column; }

  /* ── Sidebar becomes a slide-in drawer ── */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 4px 0 32px rgba(0,0,0,.35);
    /* reset sticky */
    position: fixed;
    align-self: auto;
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { display: block; pointer-events: none; }
  .sidebar-backdrop.is-open { pointer-events: auto; }

  /* ── Mobile top header bar ── */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1.25rem;
    background: var(--ts-secondary);
    border-bottom: 1px solid rgba(255,255,255,.07);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .mobile-header__logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .04em;
  }
  .mobile-header__user {
    display: flex;
    align-items: center;
    gap: .625rem;
  }
  .sidebar-toggle { display: flex; }

  /* ── Main content ── */
  .main-content {
    padding: 1.25rem 1rem;
    max-width: 100%;
  }

  /* ── Topbar: hide the desktop topbar on mobile (we use mobile-header instead) ── */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: 1.25rem;
  }
  .topbar__user { display: none; } /* shown in mobile-header instead */

  /* ── Stats grid: 2 columns on tablet ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stats-grid--3 { grid-template-columns: 1fr 1fr; }

  /* ── Welcome banner ── */
  .welcome-banner { padding: 1.25rem 1.25rem; }

  /* ── Referral card header ── */
  .referral-card__header { flex-direction: column; gap: .75rem; }
  .btn--outline-gold { width: 100%; justify-content: center; }

  /* ── How-it-works: vertical on tablet ── */
  .how-steps { flex-direction: column; gap: .5rem; }
  .how-step__arrow svg { transform: rotate(90deg); }

  /* ── Auth card ── */
  .auth-card { padding: 2rem 1.5rem; }
}

/* ─── Small phones (≤ 480px) ─── */
@media (max-width: 480px) {

  /* Auth */
  .auth-wrapper { padding: 1rem .75rem; align-items: flex-start; padding-top: 2rem; }
  .auth-card { padding: 1.5rem 1rem; border-radius: var(--radius); }
  .auth-logo { width: 44px; height: 44px; font-size: 1.25rem; }
  .auth-title { font-size: 1.25rem; }

  /* Stats: full-width single column on tiny screens */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .625rem; }
  .stats-grid--3 { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 1rem; }
  .stat-card__value { font-size: 1.2rem; }

  /* Referral copy row: stack on very small */
  .referral-copy { flex-direction: column; }
  .referral-copy__btn { width: 100%; justify-content: center; }

  /* Share buttons: wrap tighter */
  .referral-share { gap: .35rem; }
  .share-btn { font-size: .75rem; padding: .35rem .65rem; }

  /* Table: hide less important columns */
  .ref-table th:nth-child(3),
  .ref-table td:nth-child(3) { display: none; }

  /* Topbar title */
  .topbar__title { font-size: 1.2rem; }

  /* How-it-works */
  .how-step { gap: .5rem; }
  .how-step__num { width: 28px; height: 28px; font-size: .8rem; }

  /* Referral hero */
  .referral-hero { padding: 1.5rem 1rem; }
  .referral-hero__title { font-size: 1.1rem; }

  /* Info card */
  .info-row { flex-direction: column; align-items: flex-start; gap: .2rem; }
  .info-row__value { font-size: .875rem; }

  /* Main content padding */
  .main-content { padding: 1rem .875rem; }
  .mobile-header { padding: .75rem 1rem; }
}


/* =============================================================
   Referral system styles
   ============================================================= */

/* ── Form label optional tag ── */
.form-label__optional {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-light);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .35rem;
  margin-left: .4rem;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
}

/* ── Referral card (used on dashboard + referrals page) ── */
.referral-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--ts-gold);
}
.referral-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.referral-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .25rem;
}
.referral-card__sub {
  font-size: .875rem;
  color: var(--text-muted);
}

/* ── Gold outline button (for "View all referrals") ── */
.btn--outline-gold {
  background: transparent;
  color: var(--ts-gold-dark);
  border: 1.5px solid var(--ts-gold);
  padding: .5rem 1rem;
  font-size: .875rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn--outline-gold:hover {
  background: var(--ts-gold-soft);
  text-decoration: none;
}

/* ── Copy row ── */
.referral-copy {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}
.referral-copy__input {
  flex: 1;
  padding: .6rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ts-accent);
  background: var(--surface-2);
  outline: none;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.referral-copy__btn {
  padding: .6rem 1.1rem;
  background: var(--ts-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
  white-space: nowrap;
}
.referral-copy__btn:hover { background: var(--ts-accent2); }
.referral-copy__btn--copied {
  background: var(--success) !important;
}

/* ── Referral code badge ── */
.referral-code-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .25rem;
}
.referral-code-badge {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ts-primary);
  background: var(--ts-gold-soft);
  border: 1px solid rgba(240, 180, 41, .35);
  border-radius: 6px;
  padding: .15rem .5rem;
  letter-spacing: .12em;
}
.referral-code-badge--lg {
  font-size: 1.1rem;
  padding: .3rem .75rem;
}
.referral-code-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.referral-code-label {
  font-size: .8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Share buttons ── */
.referral-share {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.referral-share__label {
  font-size: .8rem;
  color: var(--text-muted);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.share-btn:hover { opacity: .85; transform: translateY(-1px); text-decoration: none; }
.share-btn--wa  { background: #25D366; color: #fff; }
.share-btn--tg  { background: #0088cc; color: #fff; }
.share-btn--tw  { background: #1DA1F2; color: #fff; }

/* ── Stat card gold variant ── */
.stat-card--gold .stat-card__value { color: var(--ts-gold-dark); }
.stat-card--gold { border-bottom-color: var(--ts-gold) !important; }

/* ── stats-grid 3-col ── */
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ── Referral hero ── */
.referral-hero {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-accent2) 70%, var(--ts-accent) 100%);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-inv);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.referral-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ts-gold), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}
.referral-hero__icon { font-size: 2.5rem; margin-bottom: .5rem; }
.referral-hero__title { font-size: 1.4rem; font-weight: 700; }
.referral-hero__sub   { font-size: .95rem; opacity: .85; margin-top: .5rem; }
.referral-hero__sub strong { color: var(--ts-gold); }

/* ── How it works ── */
.how-it-works {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.how-it-works__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: 1.25rem;
}
.how-steps {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.how-step {
  flex: 1;
  min-width: 140px;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.how-step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}
.how-step__text { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.how-step__text strong { color: var(--text); display: block; margin-bottom: .2rem; }
.how-step__arrow { color: var(--ts-gold); font-size: 1.25rem; font-weight: 700; flex-shrink: 0; }

/* ── Referred users table ── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ts-gold-soft);
  color: var(--ts-gold-dark);
  border: 1px solid rgba(240,180,41,.3);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 .45rem;
  margin-left: .5rem;
  vertical-align: middle;
}

.table-wrap { overflow-x: auto; }

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.ref-table th {
  text-align: left;
  padding: .625rem .875rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
}
.ref-table td {
  padding: .75rem .875rem;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: middle;
}
.ref-table tbody tr:last-child td { border-bottom: none; }
.ref-table tbody tr:hover { background: var(--surface-2); }
.ref-table__num { color: var(--text-light); font-size: .8rem; }

.ref-user {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.ref-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.reward-badge {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .55rem;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}
.empty-state__icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state__text { color: var(--text-muted); font-size: .9rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .stats-grid--3 { grid-template-columns: 1fr 1fr; }
  .how-steps { flex-direction: column; }
  .how-step__arrow { transform: rotate(90deg); }
  .referral-card__header { flex-direction: column; }
  .referral-share { gap: .4rem; }
}

/* =============================================================
   Lucide icon sizing
   ============================================================= */

/* Lucide renders <svg> inside the <i> tag */
.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  vertical-align: middle;
  flex-shrink: 0;
}

.inline-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: .2rem;
}

/* Stat card icons */
.stat-card__icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
  color: var(--ts-accent);
}
.stat-card--gold .stat-card__icon svg {
  color: var(--ts-gold-dark);
}

/* Referral hero icon */
.referral-hero__icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
  color: var(--ts-gold);
  margin-bottom: .5rem;
}

/* How-it-works arrow */
.how-step__arrow svg {
  width: 20px;
  height: 20px;
  color: var(--ts-gold);
  stroke-width: 2;
}

/* Empty state icon */
.empty-state__icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.25;
  color: var(--text-light);
}

/* Share button icons */
.share-btn svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  vertical-align: middle;
}

/* =============================================================
   Mobile header & sidebar close button
   ============================================================= */

/* Mobile header: hidden on desktop, shown via media query */
.mobile-header { display: none; }

/* Mobile page title: hidden on desktop */
.mobile-page-title { display: none; }

/* Sidebar close button: hidden on desktop */
.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
}
.sidebar-close svg { width: 16px; height: 16px; }
.sidebar-close:hover { background: rgba(255,255,255,.15); color: #fff; }

@media (max-width: 900px) {
  /* Show mobile elements */
  .mobile-header { display: flex; }
  .mobile-page-title { display: block; margin-bottom: 1rem; }
  .sidebar-close { display: flex; }

  /* Hide desktop topbar on mobile */
  .topbar { display: none; }

  /* Sidebar logo: push close button to the right */
  .sidebar__logo { justify-content: flex-start; }

  /* Prevent body from showing behind open drawer */
  body.sidebar-open { overflow: hidden; }
}

/* Sidebar toggle icon sizing */
.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* =============================================================
   Wallet styles
   ============================================================= */

/* ── Wallet grid: 2 cards side by side ── */
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ── Wallet card ── */
.wallet-card {
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.wallet-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.wallet-card--deposit {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-accent2) 100%);
  color: #fff;
}
.wallet-card--withdrawal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(240,180,41,.25);
  color: #fff;
}

.wallet-card__header {
  display: flex;
  align-items: center;
  gap: .625rem;
}
.wallet-card__icon svg  { width: 20px; height: 20px; stroke-width: 1.75; opacity: .8; }
.wallet-card--withdrawal .wallet-card__icon svg { color: var(--ts-gold); opacity: 1; }

.wallet-card__label {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .75;
}

.wallet-card__balance {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}
.wallet-card--withdrawal .wallet-card__balance { color: var(--ts-gold); }

.wallet-card__sub {
  font-size: .8rem;
  opacity: .65;
  margin-top: -.25rem;
}

.wallet-card__actions {
  display: flex;
  gap: .5rem;
  margin-top: .25rem;
  flex-wrap: wrap;
}

/* ── Small button variants for wallet cards ── */
.btn--sm {
  padding: .45rem .875rem;
  font-size: .8125rem;
}
.btn--gold {
  background: var(--ts-gold);
  color: var(--ts-secondary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(240,180,41,.3);
}
.btn--gold:hover { background: var(--ts-gold-dark); }
.btn--gold:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--outline-sm {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  border: 1.5px solid rgba(255,255,255,.2);
  padding: .45rem .875rem;
  font-size: .8125rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: background .15s;
}
.btn--outline-sm:hover { background: rgba(255,255,255,.18); text-decoration: none; }

/* ── Wallet badges in tables ── */
.wallet-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 600;
  padding: .15rem .55rem;
  white-space: nowrap;
}
.wallet-badge--deposit    { background: rgba(0,24,64,.08);  color: var(--ts-primary);    border: 1px solid rgba(0,24,64,.15); }
.wallet-badge--withdrawal { background: var(--ts-gold-soft); color: var(--ts-gold-dark); border: 1px solid rgba(240,180,41,.25); }

/* ── Transaction type pills ── */
.txn-type {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  font-weight: 600;
}
.txn-type--credit { color: #16a34a; }
.txn-type--debit  { color: #dc2626; }
.txn-type svg     { width: 13px; height: 13px; }

/* ── Transaction amounts ── */
.txn-amount        { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.txn-amount--credit { color: #16a34a; }
.txn-amount--debit  { color: #dc2626; }

/* ── Transaction reference code ── */
.txn-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--ts-accent);
  background: var(--surface-2);
  padding: .1rem .35rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Transaction description ── */
.txn-desc { color: var(--text-muted); font-size: .85rem; max-width: 200px; }

/* ── Info card title row (title + view-all link) ── */
.info-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}
.info-card__title-row .info-card__title { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.view-all-link {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ts-primary);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  text-decoration: none;
}
.view-all-link:hover { text-decoration: underline; }
.view-all-link svg { width: 13px; height: 13px; }

/* ── Filter bar (transactions page) ── */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filter-bar__group { display: flex; flex-direction: column; gap: .3rem; }
.filter-bar__label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.filter-select { width: auto; min-width: 150px; }

/* ── Auth card wide variant (deposit/withdraw/transfer) ── */
.auth-card--wide { max-width: 500px; }

/* ── Wallet action icon (form pages) ── */
.wallet-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 1rem;
}
.wallet-action-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }
.wallet-action-icon--deposit    { background: rgba(0,24,64,.1);         color: var(--ts-primary);   }
.wallet-action-icon--withdrawal { background: var(--ts-gold-soft);      color: var(--ts-gold-dark); }
.wallet-action-icon--transfer   { background: rgba(26,58,110,.1);       color: var(--ts-accent);    }

/* ── Balance strip (deposit/withdraw/transfer forms) ── */
.wallet-balance-strip {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.wallet-balance-strip__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .875rem 1rem;
  gap: .2rem;
}
.wallet-balance-strip__divider {
  width: 1px;
  background: var(--border);
}
.wallet-balance-strip__label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.wallet-balance-strip__value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ts-primary);
}
.wallet-balance-strip__value--highlight { color: var(--ts-gold-dark); }

/* ── Amount input with $ prefix ── */
.amount-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.amount-input-wrap:focus-within {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(0,24,64,.12);
}
.amount-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 .875rem;
  background: var(--surface-2);
  border-right: 1.5px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ts-accent);
  flex-shrink: 0;
}
.amount-input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: 1.1rem;
  font-weight: 600;
}
.amount-input:focus { outline: none; }

/* ── Quick amount chips ── */
.quick-amounts {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.quick-amounts__label {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.quick-chip {
  background: var(--primary-light);
  border: 1.5px solid rgba(0,24,64,.12);
  color: var(--ts-primary);
  border-radius: 999px;
  padding: .3rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, border-color .15s;
}
.quick-chip:hover {
  background: rgba(0,24,64,.12);
  border-color: var(--ts-primary);
}

/* ── Wallet notice (warning/info) ── */
.wallet-notice {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
}
.wallet-notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: .1rem; }
.wallet-notice--warn { background: #FEF3C7; color: #92400E; border-left: 3px solid var(--warning); }
.wallet-notice--info { background: #DBEAFE; color: #1E40AF; border-left: 3px solid var(--info); }

/* ── Transfer diagram ── */
.transfer-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  margin-bottom: 1.25rem;
}
.transfer-diagram__wallet {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.transfer-diagram__icon svg { width: 24px; height: 24px; stroke-width: 1.5; }
.transfer-diagram__wallet--from .transfer-diagram__icon svg { color: var(--ts-primary); }
.transfer-diagram__wallet--to   .transfer-diagram__icon svg { color: var(--ts-gold-dark); }
.transfer-diagram__name    { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.transfer-diagram__balance { font-size: 1.1rem; font-weight: 700; color: var(--ts-primary); }
.transfer-diagram__wallet--to .transfer-diagram__balance { color: var(--ts-gold-dark); }
.transfer-diagram__arrow { color: var(--ts-gold); flex-shrink: 0; }
.transfer-diagram__arrow svg { width: 24px; height: 24px; stroke-width: 2; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .wallet-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: .75rem; }
  .filter-select { width: 100%; }
}
@media (max-width: 480px) {
  .wallet-card__balance { font-size: 1.6rem; }
  .transfer-diagram { flex-direction: column; }
  .transfer-diagram__arrow svg { transform: rotate(90deg); }
  .txn-ref { font-size: .65rem; }
  /* Hide description column on small screens */
  .ref-table th:nth-child(6),
  .ref-table td:nth-child(6) { display: none; }
}

/* =============================================================
   PayHero M-Pesa Deposit Styles
   ============================================================= */

/* ── M-Pesa Provider Banner ── */
.mpesa-badge-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.mpesa-badge-banner__logo {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.mpesa-pill {
  background: #00875A;
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .06em;
  padding: .25rem .55rem;
  border-radius: 4px;
}
.payhero-pill {
  background: var(--ts-primary);
  color: var(--ts-gold);
  font-weight: 700;
  font-size: .75rem;
  padding: .25rem .5rem;
  border-radius: 4px;
}
.mpesa-badge-banner__text {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ── Live KES Preview in Amount Input ── */
.amount-kes-preview {
  display: flex;
  align-items: center;
  padding: 0 .875rem;
  font-size: .85rem;
  font-weight: 700;
  color: #00875A;
  background: #f0fdf4;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Phone Number Input Wrap ── */
.phone-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.phone-input-wrap:focus-within {
  border-color: #00875A;
  box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.15);
}
.phone-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 .875rem;
  background: var(--surface-2);
  border-right: 1.5px solid var(--border);
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
  white-space: nowrap;
}
.phone-input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .05em;
}
.phone-input:focus { outline: none; }

/* ── STK Waiting Screen Pulse Ring ── */
.stk-pulse-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(0, 135, 90, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: stkPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.stk-pulse-ring__inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #00875A;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stk-pulse-ring__inner svg {
  width: 26px;
  height: 26px;
}

@keyframes stkPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 135, 90, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 16px rgba(0, 135, 90, 0);
  }
}

/* ── STK Summary Box ── */
.stk-summary-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.stk-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
}
.stk-summary-label {
  color: var(--text-muted);
  font-weight: 500;
}
.stk-summary-val {
  font-weight: 700;
  color: var(--ts-primary);
}
.stk-summary-val--kes {
  color: #00875A;
  font-size: 1.05rem;
}

/* ── STK Steps Card ── */
.stk-steps-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
}
.stk-steps-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .5rem;
}
.stk-steps-list {
  padding-left: 1.25rem;
  font-size: .825rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  line-height: 1.45;
}
.stk-steps-list strong { color: var(--text); }

/* ── STK Polling Status & Spinner ── */
.stk-polling-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ts-accent);
  padding: .75rem 0;
  margin-bottom: 1rem;
}
.polling-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 24, 64, 0.2);
  border-top-color: var(--ts-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── STK Actions ── */
.stk-action-row {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── STK Success & Failed Icons ── */
.stk-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stk-success-icon svg { width: 36px; height: 36px; }

.stk-failed-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stk-failed-icon svg { width: 36px; height: 36px; }

/* =============================================================
   Spin & Win and Tasks Styles
   ============================================================= */

/* ── Sub Navigation Item ── */
.nav-item--sub {
  padding-left: 2rem !important;
  font-size: .85rem !important;
  opacity: .9;
}

/* ── Spin Hero Banner ── */
.spin-hero {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-accent2) 65%, var(--ts-accent) 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}
.spin-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ts-gold), transparent);
}
.spin-hero__left {
  flex: 1;
}
.spin-hero__tag {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ts-gold);
  background: rgba(240, 180, 41, 0.15);
  border: 1px solid rgba(240, 180, 41, 0.3);
  padding: .2rem .55rem;
  border-radius: 999px;
  margin-bottom: .4rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.spin-hero__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.spin-hero__desc {
  font-size: .875rem;
  opacity: .85;
}
.spin-hero__badges {
  display: flex;
  gap: .875rem;
}
.spin-badge-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  text-align: center;
  min-width: 120px;
}
.spin-badge-card__label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .75;
  margin-bottom: .2rem;
}
.spin-badge-card__val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.spin-badge-card__val--gold {
  color: var(--ts-gold);
}

/* ── Spin Arena Layout ── */
.spin-arena-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── Wheel Card & Canvas Stage ── */
.spin-wheel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.wheel-canvas {
  width: 100%;
  height: 100%;
  max-width: 440px;
  max-height: 440px;
  border-radius: 50%;
  box-shadow: 0 12px 36px rgba(0, 24, 64, 0.25);
  display: block;
}

/* ── Wheel Pointer ── */
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

/* ── Wheel Center Action Button ── */
.wheel-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ts-gold) 0%, var(--ts-gold-dark) 100%);
  border: 4px solid var(--ts-secondary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
  outline: none;
}
.wheel-center-btn:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 6px 22px rgba(240, 180, 41, 0.6);
}
.wheel-center-btn:active {
  transform: translate(-50%, -50%) scale(0.96);
}
.wheel-center-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: translate(-50%, -50%) scale(1);
}
.wheel-center-btn__text {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .08em;
  color: var(--ts-secondary);
}

/* ── Spin Controls ── */
.spin-controls {
  width: 100%;
  max-width: 380px;
}
.spin-status-banner {
  margin-bottom: .875rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8125rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 999px;
}
.status-pill--free {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.status-pill--paid {
  background: var(--ts-gold-soft);
  color: var(--ts-gold-dark);
  border: 1px solid rgba(240, 180, 41, 0.3);
}
.status-pill--wait {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.spin-play-btn {
  font-size: 1.05rem;
  padding: .85rem 1.5rem;
  letter-spacing: .02em;
}

/* ── Prize Pool List ── */
.prizes-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.prize-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .65rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.prize-row__color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}
.prize-row__label {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}
.prize-row__val {
  font-weight: 700;
  color: #16a34a;
}

/* ── Winners Ticker ── */
.winners-ticker {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.winner-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--surface-2);
}
.winner-item:last-child { border-bottom: none; }
.winner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
.winner-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.winner-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.winner-time {
  font-size: .72rem;
  color: var(--text-light);
}
.winner-badge {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
}

/* ── Win Celebration Modal ── */
.spin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.spin-modal-overlay.is-open {
  display: flex;
  animation: fadeIn 0.2s ease;
}
.spin-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border-top: 4px solid var(--ts-gold);
  animation: scaleUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.spin-modal-confetti {
  font-size: 2.5rem;
  margin-bottom: .25rem;
}
.spin-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ts-gold-soft);
  color: var(--ts-gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
}
.spin-modal-icon svg { width: 32px; height: 32px; stroke-width: 2; }
.spin-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .25rem;
}
.spin-modal-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: #16a34a;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.spin-modal-sub {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Tasks Overview Page ── */
.task-featured-card {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-accent2) 65%, var(--ts-accent) 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.task-featured-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ts-gold), transparent);
}
.task-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ts-gold);
  background: rgba(240, 180, 41, 0.15);
  border: 1px solid rgba(240, 180, 41, 0.3);
  padding: .2rem .6rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.task-featured-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.task-featured-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.task-featured-icon svg { width: 34px; height: 34px; }
.task-featured-info { flex: 1; }
.task-featured-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.task-featured-desc {
  font-size: .9rem;
  opacity: .85;
  margin-bottom: .875rem;
  line-height: 1.5;
}
.task-featured-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: .25rem .65rem;
  font-size: .8rem;
  font-weight: 600;
}
.meta-tag--gold {
  color: var(--ts-gold);
  border-color: rgba(240, 180, 41, 0.3);
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.task-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.task-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.task-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(0, 24, 64, 0.08);
  color: var(--ts-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-item-icon svg { width: 22px; height: 22px; }
.task-item-icon--gold {
  background: var(--ts-gold-soft);
  color: var(--ts-gold-dark);
}
.task-item-reward {
  font-size: .78rem;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.task-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .35rem;
}
.task-item-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* ── Responsive adjustments for Spin & Win ── */
@media (max-width: 900px) {
  .spin-arena-grid { grid-template-columns: 1fr; }
  .spin-hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .spin-hero__badges { width: 100%; justify-content: space-between; }
  .spin-badge-card { flex: 1; }
  .wheel-stage { max-width: 360px; }
  .wheel-canvas { max-width: 360px; max-height: 360px; }
  .wheel-center-btn { width: 68px; height: 68px; }
}
@media (max-width: 480px) {
  .wheel-stage { max-width: 300px; }
  .wheel-canvas { max-width: 300px; max-height: 300px; }
  .wheel-center-btn { width: 60px; height: 60px; }
  .wheel-center-btn__text { font-size: .85rem; }
  .task-featured-body { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ============================================================
   Reviews Tasks Styling
   ============================================================ */
.reviews-hero {
  background: linear-gradient(135deg, var(--ts-secondary) 0%, var(--ts-primary) 65%, var(--ts-accent) 100%);
  color: var(--text-inv);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.reviews-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(240,180,41,0.18) 0%, rgba(240,180,41,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.reviews-hero__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-inv);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.reviews-hero__title .lucide { color: var(--ts-gold); }
.reviews-hero__sub {
  font-size: .95rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  line-height: 1.5;
}
.reviews-hero__stats {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}
.review-hero-stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  text-align: center;
  min-width: 110px;
  backdrop-filter: blur(8px);
}
.review-hero-stat__val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ts-gold);
}
.review-hero-stat__lbl {
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Filter bar */
.reviews-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.filter-tabs {
  display: flex;
  gap: .5rem;
  background: var(--surface);
  padding: .35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: all .15s ease;
  white-space: nowrap;
}
.filter-tab:hover {
  background: var(--surface-2);
  color: var(--ts-primary);
}
.filter-tab--active {
  background: var(--ts-primary) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-sm);
}
.filter-tab-count {
  font-size: .72rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: rgba(0, 24, 64, 0.08);
  color: var(--text-muted);
}
.filter-tab--active .filter-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
}
.search-box input {
  width: 100%;
  padding: .55rem 1rem .55rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .88rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease;
}
.search-box input:focus {
  border-color: var(--ts-primary);
}
.search-box .search-icon {
  position: absolute;
  left: .8rem;
  color: var(--text-light);
  pointer-events: none;
}

/* Category Badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.category-badge--hotel {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.category-badge--book {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.category-badge--software {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Reviews Grid */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.review-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--ts-accent);
}

.review-card__cover {
  height: 160px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.review-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.review-card:hover .review-card__cover img {
  transform: scale(1.04);
}
.review-card__cover-overlay {
  position: absolute;
  top: .75rem;
  left: .75rem;
  right: .75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}
.review-card__reward-pill {
  background: #16a34a;
  color: #ffffff;
  font-weight: 700;
  font-size: .85rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: .25rem;
}

.review-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.review-card__title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .25rem;
  line-height: 1.35;
}
.review-card__subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  font-weight: 500;
}
.review-card__desc {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.review-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-bottom: 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.review-card__meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.review-card__stars {
  color: #f59e0b;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.review-card__footer {
  margin-top: auto;
}

/* Submission status chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .85rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  width: 100%;
  justify-content: center;
}
.status-chip--approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.status-chip--pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.status-chip--rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Review Detail Page */
.review-detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.75rem;
}
@media (max-width: 960px) {
  .review-detail-grid { grid-template-columns: 1fr; }
}

.review-task-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.review-task-hero__banner {
  height: 240px;
  position: relative;
  background: var(--surface-2);
}
.review-task-hero__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.review-task-hero__content {
  padding: 1.75rem;
}
.review-task-hero__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.review-task-hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .25rem;
}
.review-task-hero__subtitle {
  font-size: .95rem;
  color: var(--text-muted);
}
.review-reward-badge-lg {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  flex-shrink: 0;
}
.review-reward-badge-lg__lbl {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .9;
}
.review-reward-badge-lg__val {
  font-size: 1.35rem;
  font-weight: 800;
}

.review-guidelines-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ts-primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.review-guidelines-box h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.review-guidelines-box p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Interactive Star Rating Selector */
.star-rating-selector {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.star-rating-stars {
  display: flex;
  gap: .5rem;
}
.star-rating-star {
  font-size: 2rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
  line-height: 1;
}
.star-rating-star.is-active,
.star-rating-star:hover {
  color: #f59e0b;
  transform: scale(1.15);
}
.star-rating-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ts-primary);
}

/* Live Word Counter */
.word-counter-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.word-counter-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: .35rem;
  overflow: hidden;
}
.word-counter-progress__bar {
  height: 100%;
  width: 0%;
  background: #f59e0b;
  transition: width .2s ease, background-color .2s ease;
}
.word-counter-progress__bar.is-valid {
  background: #16a34a;
}
.word-count-text.is-valid {
  color: #16a34a;
  font-weight: 600;
}

/* Submitted Review Card on Detail View */
.submitted-review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.submitted-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.submitted-review-stars {
  color: #f59e0b;
  font-size: 1.25rem;
  margin-bottom: .25rem;
}
.submitted-review-headline {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ts-primary);
}
.submitted-review-body {
  font-size: .92rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 1.5rem;
}
.submitted-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
}

/* Social Ticker */
.reviews-ticker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}
.reviews-ticker-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.reviews-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.reviews-ticker-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.reviews-ticker-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.reviews-ticker-info {
  flex: 1;
  min-width: 0;
}
.reviews-ticker-user {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ts-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reviews-ticker-task {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reviews-ticker-reward {
  font-size: .85rem;
  font-weight: 700;
  color: #16a34a;
  flex-shrink: 0;
}

/* ============================================================
   Surveys Tasks Styling
   ============================================================ */
.category-badge--tech {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.category-badge--finance {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.category-badge--lifestyle {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.category-badge--consumer {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.category-badge--career {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Survey Question Interactive Tiles */
.survey-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.survey-question-card:focus-within {
  border-color: var(--ts-accent);
}
.survey-question-header {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.survey-q-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ts-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.survey-q-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ts-primary);
  line-height: 1.4;
}
.survey-q-help {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Option tiles */
.survey-options-grid {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.survey-option-tile {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.survey-option-tile:hover {
  background: var(--surface-2);
  border-color: var(--ts-accent);
}
.survey-option-tile.is-selected {
  background: rgba(0, 24, 64, 0.04);
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 1px var(--ts-primary);
}
.survey-option-tile input[type="radio"],
.survey-option-tile input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ts-primary);
  cursor: pointer;
}
.survey-option-text {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

/* Rating 1-5 scale tiles */
.survey-rating-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .65rem;
}
.survey-rating-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .85rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s ease;
}
.survey-rating-tile:hover {
  border-color: var(--ts-gold);
  background: rgba(240, 180, 41, 0.06);
}
.survey-rating-tile.is-selected {
  border-color: var(--ts-primary);
  background: var(--ts-primary);
  color: #ffffff;
}
.survey-rating-tile.is-selected .survey-rating-num,
.survey-rating-tile.is-selected .survey-rating-lbl {
  color: #ffffff;
}
.survey-rating-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ts-primary);
}
.survey-rating-lbl {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Yes No row */
.survey-yesno-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.survey-yesno-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all .15s ease;
}
.survey-yesno-tile:hover {
  background: var(--surface-2);
}
.survey-yesno-tile.is-selected {
  border-color: var(--ts-primary);
  background: var(--ts-primary);
  color: #ffffff;
}

/* Sticky survey progress bar */
.survey-progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.survey-progress-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.survey-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ts-gold) 0%, #16a34a 100%);
  border-radius: 999px;
  transition: width .25s ease;
}
.survey-progress-text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ts-primary);
  white-space: nowrap;
}

/* ============================================================
   Academic Writing Tasks Styling
   ============================================================ */
.category-badge--cs {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.category-badge--biz {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.category-badge--health {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.category-badge--law {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.category-badge--humanities {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.category-badge--eng {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.citation-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: rgba(0, 24, 64, 0.06);
  color: var(--ts-primary);
  font-size: .75rem;
  font-weight: 700;
  font-family: monospace;
}

.academic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.academic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--ts-accent);
}
.academic-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.academic-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ts-primary);
  line-height: 1.35;
  margin-bottom: .4rem;
}
.academic-card__desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}
.academic-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.academic-spec-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.academic-rubric-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ts-gold);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.academic-preview-paper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.75rem 2rem;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  font-size: 1rem;
  color: #1a202c;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}
.academic-preview-paper h2 {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: 1rem;
  text-align: center;
}
.academic-preview-abstract {
  font-style: italic;
  font-size: .92rem;
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--ts-primary);
  margin-bottom: 1.5rem;
}
.academic-preview-references {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .88rem;
  font-family: var(--font);
}

/* ── Transcription Tasks Styling ── */
.transcription-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all .2s ease;
  position: relative;
}
.transcription-card:hover {
  border-color: var(--ts-primary-lighter);
  box-shadow: 0 4px 16px rgba(0,24,64,0.06);
  transform: translateY(-2px);
}
.transcription-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.transcription-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .4rem;
  line-height: 1.4;
}
.transcription-card__desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}
.transcription-specs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.transcription-spec-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Audio Player Interactive Container */
.audio-player-panel {
  background: linear-gradient(135deg, #010d21 0%, #001840 60%, #002855 100%);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: #ffffff;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 24px rgba(1, 13, 33, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.audio-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.audio-track-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.audio-track-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(240, 180, 41, 0.2);
  color: var(--ts-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.audio-track-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}
.audio-track-subtitle {
  font-size: .8rem;
  color: #94a3b8;
}

/* Waveform / Progress slider */
.audio-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.audio-time-label {
  font-size: .85rem;
  font-family: monospace;
  color: #cbd5e1;
  min-width: 42px;
}
.audio-scrubber {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}
.audio-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ts-gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(240, 180, 41, 0.6);
}

/* Audio Controls Row */
.audio-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.audio-btn-group {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.audio-control-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}
.audio-control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}
.audio-play-main-btn {
  width: 48px;
  height: 48px;
  background: var(--ts-gold);
  color: #010d21;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all .2s ease;
  box-shadow: 0 4px 12px rgba(240, 180, 41, 0.4);
}
.audio-play-main-btn:hover {
  background: #f59e0b;
  transform: scale(1.08);
}

/* Speed pills */
.speed-pills {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(0, 0, 0, 0.3);
  padding: .25rem;
  border-radius: 20px;
}
.speed-pill-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .55rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}
.speed-pill-btn.is-active,
.speed-pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Hotkey cheatsheet bar */
.audio-hotkeys-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.hotkey-tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: .15rem .45rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  color: var(--ts-primary);
  font-size: .75rem;
  margin-right: .25rem;
}

/* Verbatim Badge */
.verbatim-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.transcript-preview-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  font-size: .92rem;
  line-height: 1.7;
  color: #1e293b;
  white-space: pre-line;
}

/* ============================================================
   AI Model Training & RLHF Evaluation Styles
   ============================================================ */

.ai-arena-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .ai-arena-grid {
    grid-template-columns: 1fr;
  }
}

.ai-model-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: all .2s ease;
}

.ai-model-card:hover {
  border-color: rgba(0, 24, 64, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.ai-model-card--a {
  border-top: 4px solid #0284c7;
}

.ai-model-card--b {
  border-top: 4px solid #8b5cf6;
}

.ai-model-header {
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-model-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ts-primary);
}

.ai-model-badge-a {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ai-model-badge-b {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ai-response-body {
  padding: 1.25rem;
  flex: 1;
  background: #ffffff;
  font-size: .92rem;
  line-height: 1.7;
  color: #1e293b;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: inherit;
}

.ai-response-body code {
  font-family: 'IBM Plex Mono', monospace;
  background: #f1f5f9;
  padding: .15rem .35rem;
  border-radius: 4px;
  font-size: .85em;
  color: #0f172a;
}

.ai-response-body pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem;
  line-height: 1.5;
  margin: .75rem 0;
}

.ai-prompt-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ai-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.ai-prompt-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ts-accent);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.ai-prompt-content {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-dark);
  white-space: pre-wrap;
}

/* Preference Cards Grid */
.ai-pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-pref-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s ease;
  user-select: none;
}

.ai-pref-card:hover {
  border-color: rgba(0, 24, 64, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ai-pref-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-pref-card.is-selected {
  border-color: var(--ts-primary);
  background: rgba(0, 24, 64, 0.03);
  box-shadow: 0 0 0 3px rgba(0, 24, 64, 0.15);
}

.ai-pref-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  font-size: 1.2rem;
  transition: all .2s;
}

.ai-pref-icon--a {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.ai-pref-icon--b {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.ai-pref-icon--tie {
  background: rgba(240, 180, 41, 0.15);
  color: var(--ts-gold-dark);
}

.ai-pref-icon--bad {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ai-pref-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--ts-primary);
  margin-bottom: .25rem;
}

.ai-pref-desc {
  font-size: .78rem;
  color: var(--text-muted);
}

/* Rating Matrix */
.ai-rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.ai-rating-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}

.ai-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}

.ai-rating-label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ts-primary);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.ai-rating-score {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ts-accent);
}

.ai-star-picker {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.ai-star-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 700;
  transition: all .15s ease;
}

.ai-star-btn:hover {
  border-color: var(--ts-gold);
  color: var(--ts-gold);
  transform: scale(1.05);
}

.ai-star-btn.is-active {
  background: var(--ts-gold);
  border-color: var(--ts-gold);
  color: #010d21;
}

/* Domain badges */
.ai-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: .2rem .6rem;
  border-radius: 4px;
}

.ai-domain--coding {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.ai-domain--math_logic {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.ai-domain--creative {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.ai-domain--finance {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ai-domain--healthcare {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ai-domain--safety {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}





