/* Partner (Ref) PC only v2 - explicit grid lines: [banner | cooperation card], [promo | balance], Info title, stats, levels */
@media (min-width: 1024px) {
  .ref-page .ref-container {
    max-width: 1180px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 370px !important;
    grid-template-areas: none !important;
    grid-auto-flow: row !important;
    gap: 16px 20px !important;
    align-items: stretch !important;
  }
  .ref-page .ref-container > * { min-width: 0; margin: 0 !important; }

  /* row 1: banner | cooperation card (the tabs block, restyled) */
  .ref-page .ref-container > section.ref-card:nth-of-type(1) { grid-column: 1 !important; grid-row: 1 !important; padding: 28px 30px !important; }
  .ref-page .ref-container > .reftabs { grid-column: 2 !important; grid-row: 1 !important; display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: center !important; padding: 16px !important; border-radius: 22px !important; background: #fff !important; border: 1px solid #e6ebf2 !important; box-shadow: 0 1px 2px rgba(16,24,40,.04) !important; }
  body:not(.light-theme) .ref-page .ref-container > .reftabs { background: #1b2130 !important; border-color: #2b3247 !important; box-shadow: 0 12px 30px rgba(0,0,0,.4) !important; }
  .ref-page .ref-container > .reftabs .reftabs__btn { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 14px !important; width: 100% !important; height: 100% !important; min-height: 150px !important; padding: 16px !important; border-radius: 16px !important; background: transparent !important; box-shadow: none !important; color: #0f172a !important; font-size: 18px !important; font-weight: 800 !important; cursor: pointer !important; transition: background .2s !important; }
  body:not(.light-theme) .ref-page .ref-container > .reftabs .reftabs__btn { color: #fff !important; }
  .ref-page .ref-container > .reftabs .reftabs__btn:hover { background: #f7f9fc !important; }
  body:not(.light-theme) .ref-page .ref-container > .reftabs .reftabs__btn:hover { background: #242b3e !important; }
  .ref-page .ref-container > .reftabs .reftabs__btn::before { content: "\f2b5"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900; font-size: 26px; line-height: 1; width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: rgba(37,99,235,.10); color: #2563eb; }
  .ref-page .ref-container > .reftabs .reftabs__btn[data-tab="rev"]::before { content: "\f201"; }
  .ref-page .ref-container > .reftabs .reftabs__btn--active { display: none !important; }

  /* row 2: promo | balance */
  .ref-page .ref-container > section.ref-card:nth-of-type(2) { grid-column: 1 !important; grid-row: 2 !important; padding: 24px 30px !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) { display: contents; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-balance { grid-column: 2 !important; grid-row: 2 !important; margin: 0 !important; display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: space-between !important; gap: 8px !important; padding: 24px 22px !important; border-radius: 22px !important; background: var(--rl-surface, #fff) !important; border: 1px solid var(--rl-line, #e6ebf2) !important; box-shadow: var(--rl-shadow, 0 1px 2px rgba(16,24,40,.04)) !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-balance .ref-balance__label { font-size: 18px !important; font-weight: 800 !important; letter-spacing: -.3px !important; color: var(--rl-text, #0f172a) !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-balance .ref-balance__value { align-self: center !important; font-size: 36px !important; margin: 14px 0 !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-balance .ref-balance__btn { margin-top: auto !important; }

  /* row 3-4: "Info" heading + stats grid, full width */
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-card__title { grid-column: 1 / -1 !important; grid-row: 3 !important; margin: 6px 0 -2px 4px !important; font-size: 20px !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-stats { grid-column: 1 / -1 !important; grid-row: 4 !important; gap: 16px !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-stats .ref-stat { padding: 20px 22px !important; min-height: 94px !important; border-radius: 20px !important; background: var(--rl-surface, #fff) !important; border: 1px solid var(--rl-line, #e6ebf2) !important; box-shadow: var(--rl-shadow, 0 1px 2px rgba(16,24,40,.04)) !important; justify-content: center !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-stats .ref-stat__label { font-size: 13px !important; }
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > .ref-stats .ref-stat__value { font-size: 21px !important; }

  /* row 5: levels */
  .ref-page .ref-container > section.ref-card:nth-of-type(4) { grid-column: 1 / -1 !important; grid-row: 5 !important; }

  /* cooperation panel (shown only on that tab) takes the banner cell; anything unknown goes full width below */
  .ref-page .ref-container > .refpromo { grid-column: 1 !important; grid-row: 1 !important; }
  .ref-page .ref-container > *:not(.reftabs):not(section.ref-card):not(.refpromo),
  .ref-page .ref-container > section.ref-card:nth-of-type(3) > *:not(.ref-card__title):not(.ref-balance):not(.ref-stats) { grid-column: 1 / -1 !important; grid-row: auto !important; }

  /* banner + promo: bigger art on the right, text and input stay clear of it */
  .ref-page .ref-container > section.ref-card:nth-of-type(1) .ref-card__title { font-size: 26px !important; max-width: 68%; }
  .ref-page .ref-container > section.ref-card:nth-of-type(1) .ref-card__sub,
  .ref-page .ref-container > section.ref-card:nth-of-type(2) .ref-card__sub { max-width: 66%; }
  .ref-page .ref-container > section.ref-card:nth-of-type(1) .ref-copy,
  .ref-page .ref-container > section.ref-card:nth-of-type(2) .ref-copy { max-width: 64% !important; }
  .ref-page .ref-container > section.ref-card .ref-art-bg { width: 180px !important; right: 28px !important; top: 50% !important; transform: translateY(-50%); opacity: 1 !important; }
}
