/* ═══ features-r2.css — polish round 2 (Sep 30 2026): the Screener's conveniences on the member's own pages ═══════
   Behaviour only; the approved looks of Portfolio, Risk mix and News stay as they are. Everything here is the pages'
   own parts reused (Trades' search box, the Screener's ☆ / ★, the fold chevron of panes.css, the pages' buttons),
   in their tokens, so the palette editor and light mode drive it. Loaded after the pages' own sheets. */

/* ── the watchlist star on a fund row (app.js watchStarHtml): the Screener's "☆ Watch / ★ Watching" as the star alone ── */
.wstar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; margin: 0 2px 0 5px; padding: 0;
  border: 0; border-radius: 5px; background: none; color: var(--text-3); font:400 15px/1 var(--sans); cursor: pointer; vertical-align: -3px;
  transition: color .12s ease, background-color .12s ease;
}
.wstar::before { content: "\2606"; }                /* ☆ */
.wstar.is-on::before { content: "\2605"; }          /* ★ */
.wstar.is-on { color: var(--accent); }
.wstar:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.wstar.is-on:hover { color: var(--accent); }
.wstar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body[data-theme="light"] .wstar { color: var(--text-2); }
body[data-theme="light"] .wstar.is-on { color: var(--accent-soft, var(--accent)); }
/* Holdings: at the end of the fund's name line, inside the name's own width, so the ticker line and the row keep their size */
#viewPortfolio .pb-nml { display: flex; align-items: center; min-width: 0; max-width: 240px; margin-top: 3px; }
#viewPortfolio .pb-hold.px-tbl .pb-nml .pb-nm { flex: 0 1 auto; min-width: 0; max-width: none; margin-top: 0; }
#viewPortfolio .pb-nml .wstar { width: 20px; height: 18px; margin: 0 0 0 4px; font-size:14px; }
#viewPortfolio.sv-simple .pb-nml { max-width: none; }
@media (min-width: 761px) and (max-width: 1500px) { #viewPortfolio .pb-hold.px-tbl .pb-nml { max-width: 158px; } }
@media (max-width: 760px) { #viewPortfolio .pb-hold.px-tbl .pb-nml { max-width: none; align-items: flex-start; } }
/* News: in the ticker's cell (the row is a button, so the star there is a mark; the pane's is the button) */
#viewNews .nwb-tk .wstar { width: 20px; height: 20px; margin-left: 4px; font-size:15px; vertical-align: 2px; }
#viewNews .nwb-fundline .wstar { align-self: center; margin: 0 0 0 -6px; }
/* Risk mix: after the ticker pill in the Universe row; where the name goes under the ticker (a phone, larger text),
   at the right end of the name's line, so the row keeps its two lines */
.pyx .pyx-cpt td.pyc-ticker .wstar { margin-left: 4px; vertical-align: -2px; }
@container pyx (max-width: 540px) {
  .pyx .pyx-cpt td.pyc-ticker { position: relative; }
  .pyx .pyx-cpt td.pyc-ticker .wstar { position: absolute; right: 2px; bottom: 7px; margin: 0; }
  .pyx .pyx-cpt td.pyc-ticker .pyc-sub { padding-right: 22px; }
}
@container pyx (max-width: 720px) {
  body[data-text-size="xlarge"] .pyx .pyx-cpt td.pyc-ticker { position: relative; }
  body[data-text-size="xlarge"] .pyx .pyx-cpt td.pyc-ticker .wstar { position: absolute; right: 2px; bottom: 7px; margin: 0; }
  body[data-text-size="xlarge"] .pyx .pyx-cpt td.pyc-ticker .pyc-sub { padding-right: 22px; }
}
@container pyx (max-width: 620px) {
  body[data-text-size="large"] .pyx .pyx-cpt td.pyc-ticker { position: relative; }
  body[data-text-size="large"] .pyx .pyx-cpt td.pyc-ticker .wstar { position: absolute; right: 2px; bottom: 7px; margin: 0; }
  body[data-text-size="large"] .pyx .pyx-cpt td.pyc-ticker .pyc-sub { padding-right: 22px; }
}

/* ── Holdings: the search box, Trades' own (trades-b.css .tb-find) in Holdings' tokens ── */
#viewPortfolio .px-find { position: relative; display: inline-flex; align-items: center; }
#viewPortfolio .px-find .tb-i { position: absolute; left: 12px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; color: var(--px-mute); pointer-events: none; }
#viewPortfolio .px-find input {
  width: 180px; height: 32px; padding: 0 12px 0 34px; border: 1px solid var(--px-line2); border-radius: 16px; background: transparent;
  color: var(--px-text); font:400 13.5px/1 var(--px-font); box-shadow: none; outline: none;
}
#viewPortfolio .px-find input::placeholder { color: var(--px-mute); }
#viewPortfolio .px-find input:focus { border-color: var(--px-sub); }
#viewPortfolio .px-find input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { #viewPortfolio .px-find, #viewPortfolio .px-find input { width: 100%; } }

/* ── the selected row (↑ / ↓ on Holdings and Trades): News's own mark, an amber edge and a light wash ── */
@media (min-width: 761px) {   /* the tables as tables; a phone's cards are not moved with keys */
  #viewPortfolio .pb-hold tbody.pb-g.fr2-sel > tr.pb-r1 > td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  #viewPortfolio .pb-hold tbody.pb-g.fr2-sel > tr.pb-r1 > td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 -1px 0 var(--pb-line); }
  #viewTradelog .tb-tbl tbody tr.fr2-sel td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  #viewTradelog .tb-tbl tbody tr.fr2-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
}
#viewPortfolio .pb-hold tbody.pb-g > tr.pb-r1:focus, #viewTradelog .tb-tbl tbody tr:focus { outline: none; }
#viewPortfolio .pb-hold tbody.pb-g > tr.pb-r1:focus-visible, #viewTradelog .tb-tbl tbody tr:focus-visible { outline: none; }

/* ── folds: Today's sections and News's day groups (panes.js), with panes.css's chevron and bent dash ── */
.tdd .tdd-sec.pn > .tdd-sec__bar { position: relative; padding-right: 40px; cursor: pointer; }
.tdd .tdd-sec.pn > .tdd-sec__bar .pn-tg { right: 0; top: 50%; margin-top: -17px; }
.tdd .tdd-sec.pn > .tdd-sec__bar .tdd-sec__t::before {
  width: 13px; height: 0; border-radius: 1px; background: transparent; opacity: .85; border: 0 solid var(--accent); border-top-width: 2px;
  transition: width .2s ease, height .2s ease, border-right-width .2s ease, transform .2s ease, margin .2s ease;
}
.tdd .tdd-sec.pn.is-folded > .tdd-sec__bar .tdd-sec__t::before { width: 6px; height: 6px; margin: 0 5px 0 0; border-right-width: 2px; transform: rotate(45deg); }
.tdd .tdd-sec.pn.is-folded .pn-tg__c, #viewNews .nwb-day.pn.is-folded .pn-tg__c { transform: rotate(135deg); margin-top: -3px; }
.tdd .tdd-sec.pn.is-folded > :not(.tdd-sec__bar) { display: none !important; }
.tdd .tdd-sec.pn.is-folded { margin-bottom: 10px; }
#viewNews .nwb-day.pn > .nwb-grp { position: relative; padding-right: 52px; cursor: pointer; }
#viewNews .nwb-day.pn > .nwb-grp:hover { background-color: color-mix(in srgb, var(--text) 3%, transparent); }
#viewNews .nwb-day.pn > .nwb-grp .pn-tg { right: 14px; top: 50%; margin-top: -14px; }
#viewNews .nwb-day.pn.is-folded > .nwb-row { display: none !important; }

/* ── Risk mix: Export beside the import button (the header's own .rkb-btn), in the order the Portfolio header has ── */
#viewRisk > .viewbar .fr2-exp { order: 1; margin-left: auto; margin-right: -14px; }
#viewRisk > .viewbar .rkb-cta { order: 2; }
#viewRisk > .viewbar:has(.fr2-exp) .rkb-cta, #viewRisk > .viewbar:has(.lk-reset:not([hidden])) .fr2-exp { margin-left: 0; }
#viewRisk > .viewbar .fr2-exp svg { color: var(--rk-sub, var(--text-2)); }
@media (max-width: 640px) { #viewRisk > .viewbar .fr2-exp { margin-right: 0; } }

/* ── News: Export in the header's actions (Income's button); on a phone it stays on the title's line ── */
@media (max-width: 640px) { #viewNews > .vhead .vhead__acts { width: auto; margin-left: auto; } }

/* ── Compact rows (Settings → Compact rows, body.cp-compact): Holdings, Trades, News and Today tighten too ── */
@media (min-width: 641px) {
  body.cp-compact #viewPortfolio .pb-hold tbody.pb-g > tr.pb-r1 > td { padding-top: 3px; padding-bottom: 3px; }
  body.cp-compact #viewPortfolio .pb-hold td small { margin-top: 0; }
  body.cp-compact #viewPortfolio .pb-hold .px-av { width: 30px; height: 30px; }
  body.cp-compact #viewTradelog .tb-tbl tbody td { padding-top: 5px; padding-bottom: 5px; }
  body.cp-compact #viewNews .nwb-row { padding-top: 6px; padding-bottom: 6px; row-gap: 1px; }
  body.cp-compact #viewNews .nwb-grp { padding-top: 9px; padding-bottom: 5px; }
}
body.cp-compact .tdd-row td { padding-top: 6px; padding-bottom: 6px; }
body.cp-compact .tdd-sec { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) { .wstar, .tdd .tdd-sec.pn > .tdd-sec__bar .tdd-sec__t::before { transition: none; } }
@media print { .wstar, #viewRisk .fr2-exp, #newsExport { display: none !important; } }
