/* ============================================================================
   page-system.css — the ONE page system for Odette's peripheral pages
   (Portfolio, Scoreboard, Referrals), round 13: "the quiet system". Desktop
   v2 only: everything here is inside the 992px query, and the pages ADD
   these classes beside their own (never replacing them), so the phone face
   is untouched.

     .v2-page-head    title (Geist 26) left, the actions right, ONE line — no meta
     .v2-bigtabs      the page's sections as 16px text tabs, hairline dividers
     .v2-panel        the one surface: card tone, radius 8, no border
     .v2-panel-head   a panel's 36px head line: name + muted count, one control right
     .v2-band         the stat panel: hairline-divided cells, 12px key / 22px figure / 11px sub
     .v2-blank        the page-tier blank face: one sentence + buttons
     .v2-section      a section label (12px sentence case, muted)
   Tables are the trade page's positions strip (V2Table, revamp.js/css).
   Buttons and switchers come from revamp.css ROUND 13.
   ========================================================================== */
@media (min-width: 992px) {

  /* ---- page header: one line, title left, actions right ---- */
  .v2-page-head {
    display: flex !important;
    align-items: center;
    gap: 14px;
    min-height: 34px;
    margin-bottom: 16px !important;
  }

  .v2-page-head .pf-head-l,
  .v2-page-head .ref-head-l,
  .v2-page-head .sbc-head-l { display: contents !important; }

  .v2-page-head h1,
  .v2-page-head .pf-title,
  .v2-page-head .sbc-page-title,
  .v2-page-head .ref-title {
    margin: 0 !important;
    font-family: var(--v2-display) !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.1 !important;
    color: var(--text-primary) !important;
  }

  /* the grey meta line is retired: titles stand alone */
  .v2-page-head .v2-page-meta { display: none !important; }

  .v2-page-head .v2-page-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }

  /* ---- big tabs: the page's sections ---- */
  .v2-bigtabs {
    display: flex !important;
    align-items: center;
    gap: 0 !important;
    height: 40px;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .v2-bigtabs > * {
    display: inline-flex !important;
    align-items: baseline;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: var(--sans) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    line-height: 1 !important;
    color: var(--text-muted) !important;
    cursor: pointer;
  }

  .v2-bigtabs > * + * {
    margin-left: 14px !important;
    padding-left: 14px !important;
    border-left: 1px solid var(--v2-hair-strong, rgba(255, 255, 255, .13)) !important;
    /* the divider is 14px tall: pad and clip via line-height */
    line-height: 14px !important;
  }
  .v2-bigtabs > * { line-height: 14px !important; }

  .v2-bigtabs > *:hover { color: var(--text-secondary) !important; }
  .v2-bigtabs > .active,
  .v2-bigtabs > .is-active { color: var(--text-primary) !important; font-weight: 600 !important; }

  .v2-bigtabs .pf-tab-n,
  .v2-bigtabs .sbc-tab-n,
  .v2-bigtabs .ref-tab-n,
  .v2-bigtabs .v2-bigtab-n {
    font-family: var(--num) !important;
    font-variant-numeric: tabular-nums;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .v2-bigtabs [hidden] { display: none !important; }

  /* ---- the panel ---- */
  .v2-panel {
    background: var(--card-bg, #0E1322) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden;
  }
  .v2-panel + .v2-panel { margin-top: 12px; }

  .v2-panel-head {
    display: flex !important;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--v2-hair, rgba(255, 255, 255, .06)) !important;
    background: transparent !important;
    border-radius: 0 !important;
  }
  .v2-panel-head .v2-panel-name,
  .v2-panel-head > b {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-primary);
  }
  .v2-panel-head .v2-panel-n,
  .v2-panel-head > i {
    font-style: normal;
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
  }
  .v2-panel-head .v2-panel-r {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .v2-panel-head .v2-panel-r b { font-weight: 500; color: var(--text-secondary); }
  .v2-panel-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--v2-hair, rgba(255, 255, 255, .06));
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--text-muted);
  }

  /* ---- the stat panel: hairline-divided cells ---- */
  .v2-band {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    background: var(--card-bg, #0E1322) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden;
  }

  .v2-band > * {
    flex: 1 1 0 !important;
    min-width: 0;
    display: block;
    padding: 14px 16px !important;
    border: 0 !important;
    border-left: 1px solid var(--v2-hair, rgba(255, 255, 255, .06)) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
  .v2-band > *:first-child,
  .v2-band > [hidden] + *,
  .v2-band > .pf-metric-retired + * { border-left: 0 !important; }
  .v2-band > .is-wide { flex: 2 1 0 !important; }

  .v2-band > [hidden],
  .v2-band > .pf-metric-retired { display: none !important; }

  /* keys and figures — the three pages' own classes map onto one look */
  .v2-band .pf-metric-l,
  .v2-band .sbc-strip-k,
  .v2-band .ref-stat-l,
  .v2-band .v2-band-k {
    display: block;
    font-family: var(--sans);
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--text-muted) !important;
    margin: 0 0 6px !important;
    white-space: nowrap;
  }

  .v2-band .pf-metric-v,
  .v2-band .sbc-strip-v,
  .v2-band .ref-stat-v,
  .v2-band .v2-band-v {
    display: block;
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
    font-size: 22px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.1 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .v2-band .v2-band-v.is-pos { color: var(--positive) !important; }
  .v2-band .v2-band-v.is-neg { color: var(--negative) !important; }
  .v2-band .v2-band-v.is-sky { color: var(--v2-sky) !important; }

  .v2-band .v2-band-sub {
    display: block;
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .v2-band .v2-band-sub:empty { display: none; }

  /* ---- section label ---- */
  .v2-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
  }

  .v2-section i { font-style: normal; font-weight: 500; letter-spacing: 0; }

  /* ---- the page-tier blank face: a panel with one sentence ---- */
  .v2-blank {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 44px 30px !important;
    text-align: center !important;
    background: var(--card-bg, #0E1322) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  .v2-blank[hidden] { display: none !important; }

  .v2-blank > div { display: contents; }

  .v2-blank .v2-blank-glyph { display: none !important; }

  .v2-blank .pf-blank-t,
  .v2-blank .ref-blank-t,
  .v2-blank .v2-blank-t {
    font-family: var(--sans) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
  }

  .v2-blank .pf-blank-s,
  .v2-blank .ref-blank-s,
  .v2-blank .v2-blank-s {
    font-size: 12px !important;
    line-height: 1.55 !important;
    color: var(--text-muted) !important;
    max-width: 360px;
    margin: 0 !important;
  }

  .v2-blank .v2-blank-acts {
    display: inline-flex;
    gap: 8px;
    margin-top: 10px;
  }
  .v2-blank .v2-blank-act,
  .v2-blank .v2-blank-alt { margin-top: 10px; }
  .v2-blank .v2-blank-acts .v2-blank-act,
  .v2-blank .v2-blank-acts .v2-blank-alt { margin-top: 0; }

  .v2-blank .v2-blank-alt[hidden] { display: none; }
}


/* ==========================================================================
   DESKTOP WIDTHS (boards 13/14). Rows are one line at every width; what
   yields is a column, a sub-line or a card per row — never a wrap.
   ========================================================================== */

/* controls never wrap or shrink */
@media (min-width: 992px) {
  #portfolio-section .pf-btn,
  #portfolio-section .pf-tool,
  #portfolio-section .pf-filter-btn,
  #scoreboard-cards .sbc-stage-btn,
  #scoreboard-cards .sbc-btn,
  #scoreboard-cards .sbc-sort,
  #referral-section .ref-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* wide: the page measures 1440 and centres */
@media (min-width: 1680px) {
  #portfolio-section .pf-wrap,
  #scoreboard-cards .sbc-wrap,
  #referral-section .ref-wrap { max-width: 1440px !important; }
}

/* 1280–1439: tighter band, smaller hero, one column yields per ledger */
@media (min-width: 992px) and (max-width: 1439px) {
  #portfolio-section .pf-wrap,
  #scoreboard-cards .sbc-wrap,
  #referral-section .ref-wrap { padding-left: 24px; padding-right: 24px; }

  .v2-band > * { padding: 12px 14px !important; }
  .v2-band .pf-metric-v,
  .v2-band .sbc-strip-v,
  .v2-band .ref-stat-v,
  .v2-band .v2-band-v { font-size: 20px !important; }

  #portfolio-section .pf-hero { font-size: 40px; }

  /* portfolio history: SIZE yields */
  #pf-hist-strip .v2-pos-cols,
  #pf-hist-strip .v2-pos-row { grid-template-columns: 72px minmax(0, 1fr) 96px 130px 120px 90px 24px !important; }
  #pf-hist-strip .v2-pos-cols > :nth-child(3),
  #pf-hist-strip .v2-pos-row > :nth-child(3) { display: none; }

  /* referrals: JOINED yields */
  #referral-strip .v2-pos-cols,
  #referral-strip .v2-pos-row { grid-template-columns: minmax(0, 1fr) 90px 130px 160px !important; }
  #referral-strip .v2-pos-cols > :nth-child(2),
  #referral-strip .v2-pos-row > :nth-child(2) { display: none; }
}

/* 1100–1279: subs go, cards two across, PREMIUM yields too */
@media (min-width: 992px) and (max-width: 1279px) {
  .v2-band .v2-band-sub { display: none; }

  .pf-cards:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pfc-ghost { display: none; }

  #pf-hist-strip .v2-pos-cols,
  #pf-hist-strip .v2-pos-row { grid-template-columns: 72px minmax(0, 1fr) 130px 120px 90px 24px !important; }
  #pf-hist-strip .v2-pos-cols > :nth-child(4),
  #pf-hist-strip .v2-pos-row > :nth-child(4) { display: none; }

  #referral-section .ref-link-text { font-size: 20px; }
  #referral-section .ref-hero-r { flex-basis: 220px; }
}


/* round 12/13: the pager rows and legacy tool rows the pages still carry */
@media (min-width: 992px) {
  #portfolio-section .pf-tools[hidden] { display: none !important; }
  #portfolio-section .pf-ops { display: none !important; }
  #portfolio-section .v2-pf-strip,
  #referral-section #referral-strip { padding: 0 !important; }
  #scoreboard-cards .sbc-pane { padding: 0 !important; }
}

/* round 12: the scoreboard's YOUR RANK puts its CONNECT beside the dash,
   not under it */
@media (min-width: 992px) {
  #scoreboard-cards .sbc-strip-you { display: flex !important; flex-direction: column; }
  #scoreboard-cards .sbc-strip-you .sbc-you-connect { margin-top: 4px; }
}

/* the blank portfolio keeps only the Everyone's-open tab (the round-11 rule,
   restated after the tab reset above) */
@media (min-width: 992px) {
  #portfolio-section .pf-is-blank #pf-tab-mine,
  #portfolio-section .pf-is-blank #pf-tab-hist { display: none !important; }
}
