/* ==========================================================================
   referrals.css — the v2 face of #referral-section.
   The structural styles still live in app.css (the ref-* block); this layer
   carries the v2 deltas and loads after it, winning on order at equal
   specificity. W7 of the promotion migrates the whole ref-* block here.
   ========================================================================== */

@media (min-width: 992px) {
  #referral-section .ref-title {
    font-family: var(--v2-display, 'Geist', sans-serif);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  /* round 10: filled controls, no borders */
  #referral-section .ref-btn {
    border: 0;
    background: var(--v2-chip, #232C42);
    box-shadow: var(--v2-chip-lift);
    color: var(--text-secondary);
  }
  #referral-section .ref-btn:hover { background: var(--v2-chip-hover, #2C3752); color: var(--text-primary); }
  #referral-section #referral-copy-btn,
  #referral-section #referral-create-btn { box-shadow: none; }

  #referral-section .ref-head-l {
    display: flex;
    align-items: baseline;
    gap: 16px;
    min-width: 0;
  }

  #referral-section .ref-tagline {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* the link row reads as one card: label chip, the link, the actions */
  #referral-section .ref-link-row {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    padding: 6px 6px 6px 12px;
  }

  /* the label chip in the link card */
  #referral-section .ref-link-chip {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
  }

  /* the link reads as text, not a form control (the input stays — copy
     reads its value) */
  #referral-section .ref-link-input {
    border: 0;
    background: transparent;
    font-family: var(--num, inherit);
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
  }

  /* COPY carries the white weight; SHARE rides outlined beside it */
  #referral-section #referral-copy-btn {
    background: #FDFDFD;
    border-color: #FDFDFD;
    color: #0F1520;
  }

  #referral-section #referral-share-btn[hidden] { display: none; }

  /* GET MY REFERRAL LINK is the page's one green action */
  #referral-section #referral-create-btn {
    background: #5EDD9C;
    border-color: #5EDD9C;
    color: #06130C;
  }

  /* the # rank column says nothing — dropped on desktop */
  #referral-section .referral-col-rank,
  #referral-section .t-table th:first-child {
    display: none;
  }

  /* the failed row's inline retry */
  #referral-section .ref-row-retry {
    border: 0;
    background: transparent;
    color: #D9A83C;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
  }

  #referral-section .ref-warn { color: #D9A83C; }
  /* the blank face in an error state reads as one: its title in the warn tone */
  #referral-section .ref-blank.is-warn .ref-blank-t { color: #D9A83C; }

  /* the head whispers its refresh cadence */
  /* (cadence note moved into the page-header meta — round 10) */

  #referral-section #referral-connect-btn { margin-top: 12px; }
  #referral-section #referral-connect-btn[hidden] { display: none; }

  #referral-section #referral-retry-btn { margin-top: 12px; }

  #referral-section .ref-defn {
    margin: 10px 0 0;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
  }
}

/* ==========================================================================
   ROUND 13 — the quiet system on Referrals (>=992px): the header carries
   Share + Copy link (moved there by referral-hub.js), the hero module is
   retired, the band is the stat panel with YOUR LINK as its wide first cell,
   the referees list is a panel (the .ref-tabs row is its head) whose rows
   are the trade strip's rows, the blank faces are one sentence + a button.
   ========================================================================== */
@media (min-width: 992px) {
  #referral-section .ref-head-l { align-items: center; gap: 14px; }
  #referral-section .ref-tagline { display: none !important; }
  #referral-section #referral-head-actions[hidden] { display: none !important; }
  #referral-section #referral-copy-btn i { display: none; }

  /* the hero module is retired: its nodes stay for the copy source */
  #referral-section .ref-hero { display: none !important; }

  /* the band */
  #referral-section .ref-stats.v2-band { margin-bottom: 12px !important; }
  #referral-section .ref-stat-phone { display: none !important; }
  #referral-section .ref-stat-desk:not(#referral-tile-link-cell) { display: none !important; }
  #referral-section .ref-stat-v { margin-top: 0; }
  #referral-section .ref-link-cell {
    font-size: 20px !important;
    letter-spacing: -0.01em !important;
  }
  #referral-section .ref-link-cell b { font-weight: 600; color: var(--v2-sky, #7DD3FC); }
  #referral-section .ref-link-cell[hidden] { display: none !important; }
  #referral-section .ref-link-cell.is-muted { color: var(--text-muted) !important; font-weight: 500 !important; }
  #referral-section #referral-tile-create[hidden],
  #referral-section #referral-head-create[hidden],
  #referral-section #referral-share-btn[hidden],
  #referral-section #referral-copy-btn[hidden] { display: none !important; }
  #referral-section #referral-tile-create { margin: 8px 0 0; }

  /* the list panel: the tabs row is the head, the pane is the body */
  #referral-section .ref-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid var(--v2-hair, rgba(255, 255, 255, .06));
    border-radius: 8px 8px 0 0;
    background: var(--card-bg, #0E1322);
  }
  #referral-section .ref-tabstrip { display: flex; }
  #referral-section .ref-tab {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-primary);
  }
  #referral-section .ref-tab-n {
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    padding: 0;
    color: var(--text-muted);
  }
  #referral-section #referral-partial { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
  #referral-section #referral-partial:empty { display: none; }
  #referral-section #referral-showing-top { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
  #referral-section #referral-partial:not(:empty) ~ #referral-showing-top { margin-left: 14px; }
  #referral-section .ref-pane {
    border: 0;
    background: var(--card-bg, #0E1322);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    min-height: 120px;
    padding: 0;
  }
  #referral-section #referral-table-wrap { display: none !important; }
  #referral-section #referral-strip { padding: 0; }
  #referral-section #referral-strip[hidden] { display: none; }
  #referral-section #referral-strip .v2-pos-who { color: var(--text-primary); font-weight: 600; }
  #referral-section #referral-strip .ref-warn { color: var(--text-muted); }
  #referral-section .ref-row-retry { color: var(--v2-sky, #7DD3FC); }
  #referral-section .ref-foot { border-top: 1px solid var(--v2-hair, rgba(255, 255, 255, .06)); justify-content: center; padding: 10px 16px; }
  #referral-section #referral-showing { display: none; }
  #referral-section .ref-defn { display: none; }

  /* the blank faces: a panel with one sentence and at most one button */
  #referral-section .ref-blank {
    gap: 6px;
    padding: 44px 30px;
    border: 0;
    border-radius: 8px;
    background: var(--card-bg, #0E1322);
  }
  #referral-section .ref-pane .ref-blank { border-radius: 0; }
  #referral-section .ref-pane-solo { border: 0; background: transparent; }
  #referral-section #referral-dash-status { display: contents; }
  #referral-section .v2-blank-glyph { display: none !important; }
  #referral-section .ref-blank-t {
    display: block;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-secondary);
  }
  #referral-section .ref-blank-s {
    display: block;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 360px;
  }
  #referral-section #referral-connect-btn,
  #referral-section #referral-retry-btn { margin-top: 10px; }
  #referral-section #referral-hint { display: none !important; }
}

/* the desktop-only pieces never show on the phone face */
@media (max-width: 991.98px) {
  #referral-section .ref-cadence,
  #referral-section .ref-hero-r,
  #referral-section .ref-stat-desk,
  #referral-section .ref-link-text,
  #referral-section #referral-strip,
  #referral-section #referral-head-actions,
  #referral-section .v2-blank-glyph { display: none !important; }
}

/* round 14 (2026-09-29): less grey text. The link cell's sub and the
   signed-out sentence ride on tooltips (app.html titles); the blank faces
   are one line — what is missing, then the one action. Existing colours. */
@media (min-width: 992px) {
  #referral-section #referral-tile-link-sub { display: none !important; }
  #referral-section .ref-blank {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px 12px !important;
    min-height: 0 !important;
    padding: 18px 16px !important;
  }
  #referral-section #referral-disconnected .ref-blank {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
  }
  #referral-section #referral-disconnected .ref-blank-t { margin-right: auto; color: var(--text-primary); }
  #referral-section #referral-disconnected .ref-blank-s {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  #referral-section #referral-connect-btn,
  #referral-section #referral-retry-btn { margin-top: 0 !important; }
  #referral-section .ref-pane { min-height: 0 !important; }
}
