/* OPCVM range — mobile "private banking app" layout (desktop unchanged).
   Rows instead of carousel cards, filter pills, sort switch, bottom sheet. */
.opm-sort, .opm-note, .opm-sheet { display: none; }

@media (max-width: 767px) {
  /* Hero: compact, three figure tiles. */
  .cf-opcvm-hero .cf-opcvm-hero__stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 18px !important;
    grid-auto-flow: row !important;
    grid-template-rows: none !important;
  }
  .cf-opcvm-hero .cf-opcvm-hero__stat {
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    gap: 2px !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .08) !important;
    text-align: left !important;
    grid-column: auto !important;
    grid-row: auto !important;
    order: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    transform: none !important;
    translate: none !important;
    margin: 0 !important;
  }
  .cf-opcvm-hero .cf-opcvm-hero__stat strong { font-size: 1.25rem !important; font-weight: 400 !important; line-height: 1.1 !important; }
  .cf-opcvm-hero .cf-opcvm-hero__stat .home-figure__unit { font-size: .6rem !important; font-weight: 700 !important; color: #7fe9ef !important; }
  .cf-opcvm-hero .cf-opcvm-hero__stat-label { font-size: .66rem !important; letter-spacing: .04em !important; text-transform: none !important; color: rgba(232, 240, 248, .82) !important; }

  /* Toolbar: scrolling pills + sort switch. */
  .cf-section--opcvm-range .cf-fundgrid__toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin: 0 0 14px !important;
    padding: 14px 0 12px !important;
    border: 1px solid #e3eaf1;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 43, 79, .05);
  }
  .cf-section--opcvm-range .cf-fundgrid__views { display: none !important; }
  .cf-section--opcvm-range .cf-fundgrid__filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 0 16px !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cf-section--opcvm-range .cf-fundgrid__filters::-webkit-scrollbar { display: none; }
  .cf-section--opcvm-range .cf-fund-tab {
    flex: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    border: 1px solid #d5dee8 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #1c355e !important;
    font-size: .82rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
  .cf-section--opcvm-range .cf-fund-tab::before,
  .cf-section--opcvm-range .cf-fund-tab::after { content: none !important; }
  .cf-section--opcvm-range .cf-fund-tab.is-active { border-color: #1c355e !important; background: #1c355e !important; color: #ffffff !important; font-weight: 600 !important; }
  .cf-section--opcvm-range .cf-fund-tab__count {
    display: inline-grid !important;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin: 0 !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: #eef2f6 !important;
    color: #5b6b82 !important;
    font-size: .68rem !important;
    font-weight: 600 !important;
  }
  .cf-section--opcvm-range .cf-fund-tab.is-active .cf-fund-tab__count { background: rgba(255, 255, 255, .18) !important; color: #ffffff !important; }

  .opm-sort { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; }
  .opm-sort__count { margin: 0; color: #5b6b82; font-size: .78rem; }
  .opm-sort__count b { color: #1c355e; font-weight: 600; }
  .opm-sort__group { display: flex; padding: 3px; border-radius: 11px; background: #eef2f6; }
  .opm-sort__btn { min-height: 34px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: #5b6b82; font: inherit; font-size: .75rem; font-weight: 500; cursor: pointer; }
  .opm-sort__btn[aria-pressed="true"] { background: #ffffff; color: #1c355e; font-weight: 600; box-shadow: 0 1px 4px rgba(16, 43, 79, .12); }

  /* List of compact rows. */
  .cf-section--opcvm-range .cf-fundgrid__list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }
  .cf-section--opcvm-range .cf-fund {
    display: grid !important;
    grid-template-columns: 44px auto minmax(0, 1fr) auto !important;
    grid-template-areas: "badge name name perf" "badge cat risk vl" ". asof asof asof" !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    flex: none !important;
    margin: 0 !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #e3eaf1 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 43, 79, .05) !important;
    scroll-snap-align: none !important;
  }
  .cf-section--opcvm-range .cf-fund.is-hidden { display: none !important; }
  .cf-section--opcvm-range .cf-fund::before {
    content: attr(data-opm-abbr) !important;
    position: static !important;
    inset: auto !important;
    opacity: 1 !important;
    transform: none !important;
    grid-area: badge;
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #bfeaee;
    color: #0b5560;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
  }
  .cf-section--opcvm-range .cf-fund[data-cat="short-term-bonds"]::before { background: #7fd3dc; color: #0b4a53; }
  .cf-section--opcvm-range .cf-fund[data-cat="bonds"]::before { background: #007f8c; color: #ffffff; }
  .cf-section--opcvm-range .cf-fund[data-cat="diversified"]::before { background: #2f6fa8; color: #ffffff; }
  .cf-section--opcvm-range .cf-fund[data-cat="equities"]::before { background: #1c355e; color: #ffffff; }
  .cf-section--opcvm-range .cf-fund::after { content: none !important; }

  .cf-section--opcvm-range .cf-fund__top,
  .cf-section--opcvm-range .cf-fund__stats { display: contents !important; }
  .cf-section--opcvm-range .cf-fund__desc,
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(3),
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(2) dt,
  .cf-section--opcvm-range .cf-fund__trend,
  .cf-section--opcvm-range .cf-fund__risk-label { display: none !important; }

  .cf-section--opcvm-range .cf-fund__name {
    grid-area: name;
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    color: #1c355e !important;
    font-size: .95rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cf-section--opcvm-range .cf-fund__cat {
    grid-area: cat;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #5b6b82 !important;
    font-size: .72rem !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
  }
  .cf-section--opcvm-range .cf-fund__risk {
    grid-area: risk;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    min-width: 0;
  }
  .cf-section--opcvm-range .cf-fund__risk::before { content: none !important; }
  .cf-section--opcvm-range .cf-fund__dots { display: inline-flex !important; gap: 2px !important; }
  .cf-section--opcvm-range .cf-fund__dot { width: 5px !important; height: 5px !important; margin: 0 !important; border-radius: 50% !important; background: #d5dee8 !important; box-shadow: none !important; transform: none !important; animation: none !important; }
  .cf-section--opcvm-range .cf-fund__dot.is-on { background: #00a3b4 !important; }

  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(2) { grid-area: perf; justify-self: end; margin: 0 !important; }
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(1) { grid-area: vl; justify-self: end; display: flex !important; gap: 4px; align-items: baseline; margin: 0 !important; }
  .cf-section--opcvm-range .cf-fund__stats dt,
  .cf-section--opcvm-range .cf-fund__stats dd { margin: 0 !important; padding: 0 !important; font-family: inherit !important; }
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(1) dt,
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(1) dd,
  .cf-section--opcvm-range .cf-fund__stats > div:nth-child(1) .cf-fund__num { color: #5b6b82 !important; font-size: .7rem !important; font-weight: 400 !important; letter-spacing: 0 !important; text-transform: none !important; }
  .cf-section--opcvm-range .cf-fund__perf,
  .cf-section--opcvm-range .cf-fund__perf .cf-fund__num { font-size: .92rem !important; font-weight: 600 !important; color: #14805a !important; white-space: nowrap; }
  .cf-section--opcvm-range .cf-fund__perf::before { content: "▲ +"; font-size: .7em; }
  .cf-section--opcvm-range .cf-fund__perf.is-down,
  .cf-section--opcvm-range .cf-fund__perf.is-down .cf-fund__num { color: #b4362d !important; }
  .cf-section--opcvm-range .cf-fund__perf.is-down::before { content: "▼ "; }

  .cf-section--opcvm-range .cf-fund__num { font-family: inherit !important; font-variant-numeric: tabular-nums; }

  .cf-section--opcvm-range .cf-fund__asof { grid-area: asof; justify-self: end; margin: 0 !important; color: #8794a7; font-size: .64rem; line-height: 1.2; }
  .opm-sheet__asof { margin: -6px 0 14px; color: #5b6b82; font-size: .72rem; }
  .cf-section--opcvm-range .cf-fundgrid__disclaimer { margin: 16px 4px 0 !important; font-size: .7rem !important; }
  .opm-note { display: block; margin: 16px 4px 0; color: #5b6b82; font-size: .7rem; line-height: 1.5; }

  /* Bottom sheet. */
  .opm-sheet { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; justify-content: flex-end; }
  .opm-sheet[hidden] { display: none !important; }
  .opm-sheet__backdrop { position: absolute; inset: 0; border: 0; background: rgba(7, 26, 46, .55); opacity: 0; transition: opacity .3s ease; cursor: pointer; }
  .opm-sheet__panel {
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 28px 28px 0 0;
    background: #ffffff;
    color: #1c355e;
    box-shadow: 0 -20px 50px rgba(7, 26, 46, .25);
    transform: translateY(100%);
    transition: transform .42s cubic-bezier(.2, .8, .2, 1);
    overscroll-behavior: contain;
  }
  .opm-sheet.is-open .opm-sheet__backdrop { opacity: 1; }
  .opm-sheet.is-open .opm-sheet__panel { transform: none; }
  .opm-sheet__grab { display: block; width: 42px; height: 5px; margin: 0 auto 14px; border-radius: 5px; background: #d5dee8; }
  .opm-sheet__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .opm-sheet__chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: #bfeaee; color: #0b5560; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .opm-sheet__chip[data-cat="short-term-bonds"] { background: #7fd3dc; color: #0b4a53; }
  .opm-sheet__chip[data-cat="bonds"] { background: #007f8c; color: #ffffff; }
  .opm-sheet__chip[data-cat="diversified"] { background: #2f6fa8; color: #ffffff; }
  .opm-sheet__chip[data-cat="equities"] { background: #1c355e; color: #ffffff; }
  .opm-sheet__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #eef2f6; cursor: pointer; }
  .opm-sheet__close svg { width: 14px; height: 14px; fill: none; stroke: #1c355e; stroke-width: 2.2; stroke-linecap: round; }
  .opm-sheet__name { margin: 14px 0 8px; color: #1c355e; font-size: 1.6rem; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; }
  .opm-sheet__desc { margin: 0; color: #4a5b72; font-size: .92rem; line-height: 1.55; }
  .opm-sheet__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
  .opm-sheet__kpi { padding: 12px; border-radius: 16px; background: #f3f6f9; }
  .opm-sheet__kpi span { display: block; color: #5b6b82; font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .opm-sheet__kpi b { display: block; margin-top: 6px; color: #1c355e; font-size: 1.02rem; font-weight: 500; white-space: nowrap; }
  .opm-sheet__kpi b.is-up { color: #14805a; }
  .opm-sheet__kpi b.is-down { color: #b4362d; }
  .opm-sheet__risk { margin-top: 16px; padding: 14px; border: 1px solid #e3eaf1; border-radius: 16px; }
  .opm-sheet__risk-head { display: flex; justify-content: space-between; color: #5b6b82; font-size: .75rem; }
  .opm-sheet__risk-head b { color: #1c355e; font-weight: 600; }
  .opm-sheet__scale { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
  .opm-sheet__scale i { display: block; height: 8px; border-radius: 4px; background: #e3eaf1; }
  .opm-sheet__scale i.is-on { background: #00a3b4; }
  .opm-sheet__scale-legend { display: flex; justify-content: space-between; margin-top: 6px; color: #5b6b82; font-size: .66rem; }
  .opm-sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
  .opm-sheet__btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 1px solid #c9d6e3; border-radius: 999px; color: #1c355e !important; font-size: .95rem; font-weight: 500; text-decoration: none !important; }
  .opm-sheet__btn--primary { border-color: #1c355e; background: #1c355e; color: #ffffff !important; }
  .opm-sheet__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html.opm-lock, html.opm-lock body { overflow: hidden !important; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .opm-sheet__panel, .opm-sheet__backdrop { transition: none; }
}
