/* ═════════════════════════════════════════════════════════════════════════
   Phase D — Dashboard /trader-profile visual fix (v2)
   ─────────────────────────────────────────────────
   Scope: ONLY inside /[locale]/(authed)/dashboard/trader-profile
   Hooks: [data-tp-dashboard-grid], .tp-live-preview
═════════════════════════════════════════════════════════════════════════ */

/* ── Two-column grid (content + Live Preview) ── */
[data-tp-dashboard-grid] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) !important;
  gap: 24px !important;
  align-items: start !important;
}

/* ── Live Preview wrapper ── */
.tp-live-preview {
  position: sticky !important;
  top: 96px !important;                /* Clear authed-layout header (~80px) */
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  align-self: start !important;
  z-index: 1 !important;               /* Below header (which is typically z:10+) */
  scrollbar-width: thin;
}
.tp-live-preview::-webkit-scrollbar {
  width: 6px;
}
.tp-live-preview::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

/* ── Stack on narrower viewports ── */
@media (max-width: 1100px) {
  [data-tp-dashboard-grid] {
    grid-template-columns: 1fr !important;
  }
  /* Force-override inline sticky on mobile */
  .tp-live-preview {
    position: relative !important;
    top: auto !important;
    max-width: 480px;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 auto;
  }
}

/* ── Tab labels: avoid cutoff ── */
[data-tp-dashboard-grid] [style*="overflowX"] button,
[data-tp-dashboard-grid] nav button,
[data-tp-dashboard-grid] [role="tablist"] button {
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* ── Avoid horizontal overflow in main column ── */
[data-tp-dashboard-grid] > div:first-child {
  min-width: 0 !important;
  overflow-x: hidden;
}
