/* pf-polish.css — portfolio analysis, tighter and calmer (owner, 17 Nov 2026).
   A layer on top of the existing styles: spacing, sizes, colours and the small
   interactive pieces pf-polish.js adds. No content, data or behaviour depends on it. */

/* ── no ad slots on the portfolio analysis ─────────────────────────────────── */
.portfolio-content .pp-ad, #pf-xray .pp-ad { display: none !important; }

/* ── rhythm: smaller cards, less empty space ────────────────────────────────── */
#portfolio-workspace .portfolio-stats { gap: 10px; }
#portfolio-workspace .portfolio-stat { min-height: 0; padding: 14px 16px; border-radius: 12px; }
#portfolio-workspace .portfolio-stat strong { font-size: 22px; margin: 4px 0 2px; }
#portfolio-workspace .portfolio-stat small { font-size: 11px; line-height: 1.45; }
#portfolio-workspace .allocation-grid { gap: 10px; }
#portfolio-workspace .allocation-card { padding: 14px 16px; border-radius: 12px; }
#portfolio-workspace .allocation-card h3 { font-size: 14px; margin: 0 0 8px; }
#portfolio-workspace .review-panel { margin-bottom: 14px; }
#portfolio-workspace .context-note { margin: 8px 0 12px; font-size: 11.5px; }
#portfolio-analysis h2 { font-size: 21px; }

#pf-xray { margin-top: 14px; }
#pf-xray .xr-sec { padding: 18px 20px 16px; margin-bottom: 12px; border-radius: 14px; scroll-margin-top: 124px; }
#pf-xray .xr-head { margin-bottom: 12px; gap: 16px; }
#pf-xray .xr-head h3 { font-size: 18px; margin: 4px 0 2px; }
#pf-xray .xr-window { padding: 10px 12px; }
#pf-xray .xr-tiles { gap: 8px; }
#pf-xray .xr-tile { min-height: 0; padding: 12px 14px; }
#pf-xray .xr-tile strong { font-size: 21px; }
#pf-xray .xr-note { margin-top: 10px; }
#pf-xray .xr-table td, #pf-xray .xr-table th { padding-top: 7px; padding-bottom: 7px; }

/* ── calm colours: white cards on the cream page, one accent ───────────────── */
#portfolio-workspace .allocation-card, #pf-xray .xr-sec, #portfolio-workspace .pf-sip-card {
  background: #fff; border: 1px solid #e7dfcc; box-shadow: 0 1px 2px #0d15260a;
  transition: box-shadow .18s ease, border-color .18s ease;
}
#portfolio-workspace .allocation-card:hover, #pf-xray .xr-sec:hover { border-color: #d9cdb0; box-shadow: 0 6px 18px #0d15260f; }
#pf-xray .xr-tile { transition: transform .15s ease, box-shadow .15s ease; }
@media (hover: hover) { #pf-xray .xr-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 14px #0d152612; } }
#pf-xray .xr-table tbody tr:hover td { background: #faf6ec; }

/* ── the section menu ──────────────────────────────────────────────────────── */
.pfp-nav { position: sticky; top: var(--pfp-top, 64px); z-index: 30; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 12px; padding: 6px; background: #fffdf8f2; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid #e7dfcc; border-radius: 12px; box-shadow: 0 4px 14px #0d15260d; }
.pfp-nav::-webkit-scrollbar { display: none; }
.pfp-nav a { flex: none; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #4a4434; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease; }
.pfp-nav a:hover { background: #f3ecdc; color: #0d1526; }
.pfp-nav a.is-on { background: #0d1526; color: #fff; }
#portfolio-analysis > *, #pf-sips, .allocation-grid { scroll-margin-top: 124px; }

/* ── less text: notes fold to one line, section intros behind ⓘ ─────────────── */
.pfp-fold { position: relative; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; padding-right: 54px !important; }
.pfp-fold::after { content: 'more'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-weight: 700; color: #8a6a1f; background: inherit; padding-left: 6px; }
.pfp-fold.is-open { display: block; -webkit-line-clamp: unset; padding-right: 0 !important; }
.pfp-fold.is-open::after { content: none; }
.pfp-info { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; vertical-align: 2px; border: 1px solid #d9cdb0; border-radius: 50%;
  background: #fff; color: #8a6a1f; font: 700 11px/1 system-ui, sans-serif; cursor: pointer; }
.pfp-info:hover, .pfp-info[aria-expanded="true"] { background: #0d1526; border-color: #0d1526; color: #fff; }
.pfp-hidden { display: none !important; }

/* ── long tables show the first rows; the rest on request ───────────────────── */
.pfp-more-row { display: none !important; }
.pfp-show-all .pfp-more-row { display: table-row !important; }
.pfp-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border: 1px solid #d9cdb0; border-radius: 999px;
  background: #fff; color: #0d1526; font: 600 12px/1.2 inherit; cursor: pointer; transition: background-color .15s ease; }
.pfp-more:hover { background: #f3ecdc; }

@media (max-width: 760px) {
  #pf-xray .xr-sec { padding: 14px; }
  #portfolio-workspace .portfolio-stat { padding: 12px; }
  #portfolio-workspace .portfolio-stat strong { font-size: 19px; }
  .pfp-nav { top: var(--pfp-top, 56px); }
}
@media (prefers-reduced-motion: reduce) { #pf-xray .xr-tile, .pfp-nav a { transition: none; } #pf-xray .xr-tile:hover { transform: none; } }
@media print { .pfp-nav, .pfp-info, .pfp-more { display: none !important; } .pfp-more-row { display: table-row !important; } .pfp-fold { display: block; -webkit-line-clamp: unset; } }

/* ── edge to edge: no space held for the (switched-off) ad rails ───────────── */
main:has(> .portfolio-content) { margin-left: 0 !important; margin-right: 0 !important; max-width: none !important; }
.portfolio-content { max-width: 1600px !important; margin-left: auto !important; margin-right: auto !important;
  padding-left: 20px !important; padding-right: 20px !important; box-sizing: border-box; }
body:has(.portfolio-content) .pf-subnav { max-width: 1600px; padding-left: 20px; padding-right: 20px; box-sizing: border-box; }
@media (max-width: 760px) { .portfolio-content { padding-left: 12px !important; padding-right: 12px !important; } }

/* ── view switcher: As per CAS / As per Today / Today + running SIPs (17 Nov 2026) ── */
#pf-views { margin: 0 0 12px; }
.pfv-tabs { position: relative; display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 14px;
  background: #f3ecdc; border: 1px solid #e7dfcc; }
.pfv-tabs::-webkit-scrollbar { display: none; }
.pfv-btns { position: relative; z-index: 1; display: flex; gap: 2px; }
.pfv-ink { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px;
  background: linear-gradient(135deg, #0d1526 0%, #1d2b4a 100%); box-shadow: 0 6px 16px #0d152633, inset 0 -2px 0 #c9a24a;
  transition: transform .32s cubic-bezier(.23,1,.32,1), width .32s cubic-bezier(.23,1,.32,1); }
.pfv-btns button { flex: none; display: grid; gap: 1px; text-align: left; padding: 7px 16px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  color: #4a4434; font: inherit; transition: color .2s ease, transform .16s ease-out; }
.pfv-btns button b { font-size: 13px; font-weight: 700; }
.pfv-btns button small { font-size: 11px; color: #8a7d5c; transition: color .2s ease; }
.pfv-btns button:not([aria-selected="true"]):not(:disabled):hover { color: #0d1526; background: #ffffff8c; }
.pfv-btns button:active:not(:disabled) { transform: scale(.97); }
.pfv-btns button[aria-selected="true"] { color: #fff; }
.pfv-btns button[aria-selected="true"] small { color: #e5c97a; }
.pfv-btns button:disabled { cursor: not-allowed; opacity: .5; }
.pfv-btns button:focus-visible { outline: 2px solid #c9a24a; outline-offset: 2px; }
.pfv-note { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.5; color: #4a4434; animation: pfvIn .3s ease-out; }
.pfv-note b { color: #0d1526; }
@keyframes pfvIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
#portfolio-stats { animation: pfvIn .3s ease-out; }

/* ── SIP list you can change ───────────────────────────────────────────────── */
.pf-sip-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pf-sip-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid #d9cdb0; background: #fff; color: #0d1526; font: 600 12px/1.2 inherit; cursor: pointer;
  transition: background-color .15s ease, transform .16s ease-out; }
.pf-sip-btn:hover { background: #f3ecdc; }
.pf-sip-btn:active { transform: scale(.97); }
.pf-sip-btn.is-go { background: #0d1526; border-color: #0d1526; color: #fff; }
.pf-sip-btn.is-go:hover { background: #1d2b4a; }
.pf-sip-acts { white-space: nowrap; }
.pf-sip-next { margin-right: 8px; }
.pf-sip-ic { width: 26px; height: 26px; margin-left: 2px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: #8a7d5c; cursor: pointer; font-size: 13px;
  opacity: .55; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
.pf-sip-table tr:hover .pf-sip-ic, .pf-sip-ic:focus-visible { opacity: 1; }
.pf-sip-ic:hover { background: #f3ecdc; color: #0d1526; }
.pf-sip-ic.is-del:hover { background: #fde8e8; color: #b42318; }
@media (hover: none) { .pf-sip-ic { opacity: 1; } }
.pf-sip-table tr.is-user td { background: #fffaf0; }
.pf-sip-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #f3ecdc; color: #8a6a1f; font: 700 10px/1.6 inherit; font-style: normal; vertical-align: 1px; }
.pf-sip-form td { background: #fffaf0; }
.pf-sip-form input, .pf-sip-form select { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid #d9cdb0; border-radius: 8px; background: #fff; font: inherit; font-size: 13px; }
.pf-sip-form input[data-f="day"] { width: 64px; }
.pf-sip-form input[data-f="amount"] { width: 110px; text-align: right; }
.pf-sip-form select[data-f="hid"] { max-width: 340px; }
.pf-sip-removed { margin: 8px 0 0; font-size: 12px; color: #4a4434; }
.pf-sip-link { border: 0; background: none; padding: 0; color: #8a6a1f; font: 700 12px inherit; text-decoration: underline; cursor: pointer; }

/* ── compact cards: as tall as their words, no taller (owner, 17 Nov 2026) ──── */
#portfolio-workspace .portfolio-stats { align-items: start; }
#portfolio-workspace .portfolio-stat { min-height: 0 !important; padding: 10px 14px; }
#portfolio-workspace .portfolio-stat strong { font-size: 20px; margin: 2px 0 0; }
#portfolio-workspace .portfolio-stat small { margin-top: 2px; }
#portfolio-workspace .allocation-grid { align-items: start; }
#portfolio-workspace .allocation-card { padding: 12px 14px; }
#pf-xray .xr-tiles { align-items: start; }
#pf-xray .xr-tile { min-height: 0 !important; padding: 10px 12px; }
#pf-xray .xr-tile strong { font-size: 19px; margin: 2px 0; }
#pf-xray .xr-sec { padding: 14px 16px 12px; }
#pf-xray .xr-head { margin-bottom: 8px; }
#portfolio-workspace .pf-sip-card { padding: 12px 14px; }
@media (prefers-reduced-motion: reduce) { .pfv-ink, .pfv-btns button { transition: none; } .pfv-note, #portfolio-stats { animation: none; } }
@media print { #pf-views .pfv-tabs { display: none; } }
#valuation-note:empty { display: none !important; }
#portfolio-workspace .portfolio-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
#portfolio-workspace .allocation-row { margin: 7px 0; }
#portfolio-workspace .allocation-row meter { height: 6px; margin-top: 3px; }
#portfolio-workspace .portfolio-matrix td { padding: 9px 14px; }
#portfolio-workspace .portfolio-matrix th { padding: 9px 14px; }
#portfolio-workspace .portfolio-matrix small { margin-top: 2px; }
.pf-sip-ic svg { width: 14px; height: 14px; display: block; margin: auto; }
.pf-sip-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 8px 0 0; }
.pf-sip-foot .pf-sip-removed { margin: 0; }
@media (max-width: 760px) {
  .pfv-tabs { display: flex; width: 100%; box-sizing: border-box; }
  .pfv-btns { flex: 1; }
  .pfv-btns button { flex: 1 1 0; min-width: 0; padding: 7px 8px; }
  .pfv-btns button b { font-size: 12px; line-height: 1.25; }
  .pfv-btns button small { font-size: 10.5px; }
  #portfolio-workspace .portfolio-stats { grid-template-columns: 1fr 1fr; }
}

/* ── hero "Know what you own": slim navy band, gold accent (owner, 17 Nov 2026) ── */
.portfolio-content > .heading { position: relative; overflow: hidden; isolation: isolate; align-items: center; gap: 16px;
  margin-bottom: 14px !important; padding: 14px 22px !important; border: 1px solid #1d2b4a !important; border-left: 0 !important; border-radius: 16px !important;
  background: radial-gradient(120% 180% at 100% 0%, #c9a24a33 0%, transparent 45%), linear-gradient(115deg, #0b1324 0%, #13203d 55%, #1d2b4a 100%) !important;
  box-shadow: 0 10px 26px #0d152626 !important; }
.portfolio-content > .heading::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(#e5c97a, #b8862b); z-index: -1; }
.portfolio-content > .heading::after { content: ''; position: absolute; inset: -40% auto -40% -30%; width: 22%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, #ffffff14, transparent); transform: translateX(0) skewX(-18deg); will-change: transform;
  animation: pfHeroSheen 7s ease-in-out 1.5s 3 both; }
/* transform only (GPU), and three passes then it rests — an endless left: animation re-laid the page every frame */
@keyframes pfHeroSheen { 0% { transform: translateX(0) skewX(-18deg); } 45%, 100% { transform: translateX(800%) skewX(-18deg); } }
.portfolio-content > .heading > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px; }
.portfolio-content > .heading .eyebrow { flex-basis: 100%; margin: 0 !important; font-size: 10px !important; letter-spacing: .16em; color: #e5c97a !important; }
.portfolio-content > .heading h1 { margin: 0 !important; font-size: clamp(22px, 2.4vw, 28px) !important; line-height: 1.15 !important; letter-spacing: -.02em; color: #fff !important; }
.portfolio-content > .heading h1 span { color: #e5c97a !important; }
.portfolio-content > .heading p { margin: 0 !important; max-width: none !important; font-size: 12.5px !important; color: #b9c3d6 !important; }
.portfolio-content > .heading .privacy-badge { flex: none; padding: 7px 14px !important; border: 1px solid #e5c97a66 !important; border-radius: 999px;
  background: #e5c97a1a !important; color: #f3dfa6 !important; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 760px) { .portfolio-content > .heading { padding: 12px 14px !important; }
  .portfolio-content > .heading p { font-size: 11.5px !important; } }
@media (prefers-reduced-motion: reduce) { .portfolio-content > .heading::after { animation: none; display: none; } }

/* A 59-fund analysis is ~25,000px tall. Sections off screen are not painted until
   they come near the viewport; `auto` remembers each one's real height once seen,
   so the scrollbar does not jump (owner, 17 Nov 2026: "no smoothness while scrolling"). */
#pf-xray .xr-sec, #portfolio-analysis > .review-panel, #portfolio-workspace > .review-panel {
  content-visibility: auto; contain-intrinsic-size: auto 900px; }
@media print { #pf-xray .xr-sec, #portfolio-analysis > .review-panel, #portfolio-workspace > .review-panel { content-visibility: visible; } }

/* ── 17 Nov 2026 (owner): no chat launcher on the portfolio pages ─────────── */
.si-root { display: none !important; }

/* ── transactions: Folio and Search side by side, never on top of each other ── */
.transactions-panel .transaction-controls { display: grid !important; grid-template-columns: minmax(200px, 340px) 1fr; gap: 12px; align-items: end; }
.transactions-panel .transaction-controls label { display: grid; gap: 6px; min-width: 0; max-width: none !important; font-size: 12px; color: #6b6250; }
.transactions-panel .transaction-controls select, .transactions-panel .transaction-controls input { width: 100%; min-width: 0; box-sizing: border-box; height: 42px;
  padding: 0 12px; border: 1px solid #d9cdb0; border-radius: 10px; background: #fff; font: inherit; font-size: 13.5px; color: #0d1526; }
@media (max-width: 760px) { .transactions-panel .transaction-controls { grid-template-columns: 1fr; } }

/* ── "Download analysis report": the one button nobody should miss ────────── */
#download-analysis.pf-dl-btn { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border: 0 !important; border-radius: 999px; font-weight: 800; letter-spacing: .01em; color: #0d1526 !important;
  background: linear-gradient(135deg, #f7d774 0%, #e5b93c 50%, #c9922a 100%) !important;
  box-shadow: 0 6px 18px #c9922a59, inset 0 1px 0 #fff6; transition: transform .16s ease-out, box-shadow .2s ease; }
#download-analysis.pf-dl-btn::before { content: ''; position: absolute; inset: -40% auto -40% 0; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, #ffffffb3, transparent); transform: translateX(-120%) skewX(-20deg);
  animation: pfDlSheen 2.6s cubic-bezier(.23,1,.32,1) infinite; }
#download-analysis.pf-dl-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -2; box-shadow: 0 0 0 0 #e5b93c99;
  animation: pfDlRing 2.6s ease-out infinite; }
@keyframes pfDlSheen { 0% { transform: translateX(-120%) skewX(-20deg); } 55%, 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes pfDlRing { 0% { box-shadow: 0 0 0 0 #e5b93c99; } 70%, 100% { box-shadow: 0 0 0 12px #e5b93c00; } }
#download-analysis.pf-dl-btn .pf-dl-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0d1526; color: #f7d774;
  font-size: 13px; animation: pfDlBob 1.6s ease-in-out infinite; }
@keyframes pfDlBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }
#download-analysis.pf-dl-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px #c9922a73, inset 0 1px 0 #fff6; }
#download-analysis.pf-dl-btn:active { transform: scale(.97); }
#download-analysis.pf-dl-btn:disabled { filter: grayscale(.5); opacity: .7; }
#download-analysis.pf-dl-btn:disabled::before, #download-analysis.pf-dl-btn:disabled::after, #download-analysis.pf-dl-btn:disabled .pf-dl-ic { animation: none; }

/* ── after the CAS is read: a floating nudge to check, then analyse ────────── */
.pfp-nudge { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 14px; max-width: min(760px, calc(100vw - 24px));
  padding: 12px 14px 12px 18px; border-radius: 16px; background: linear-gradient(115deg, #0b1324, #1d2b4a); color: #fff; box-shadow: 0 18px 40px #0d152659;
  border: 1px solid #c9a24a66; transform: translate(-50%, 0); animation: pfNudgeIn .45s cubic-bezier(.23,1,.32,1); }
@keyframes pfNudgeIn { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pfp-nudge b { display: block; color: #f7d774; font-size: 14px; }
.pfp-nudge small { display: block; color: #c4cde0; font-size: 12.5px; line-height: 1.45; }
.pfp-nudge .pfp-n-btns { display: flex; gap: 8px; flex: none; }
.pfp-nudge button { border: 0; border-radius: 999px; padding: 9px 14px; font: 700 12.5px/1 inherit; cursor: pointer; transition: transform .16s ease-out, background-color .15s ease; }
.pfp-nudge button:active { transform: scale(.97); }
.pfp-nudge .pfp-n-go { background: linear-gradient(135deg, #f7d774, #e5b93c); color: #0d1526; }
.pfp-nudge .pfp-n-tx { background: #ffffff1f; color: #fff; }
.pfp-nudge .pfp-n-tx:hover { background: #ffffff33; }
.pfp-nudge .pfp-n-x { background: transparent; color: #c4cde0; padding: 6px 8px; font-size: 16px; }
.pfp-flash { animation: pfFlash 1.2s ease-out 2; }
@keyframes pfFlash { 0% { box-shadow: 0 0 0 0 #e5b93ccc; } 100% { box-shadow: 0 0 0 16px #e5b93c00; } }
@media (max-width: 760px) { .pfp-nudge { flex-direction: column; align-items: stretch; gap: 10px; bottom: 12px; } .pfp-nudge .pfp-n-btns { justify-content: stretch; } .pfp-nudge .pfp-n-btns button { flex: 1; } }
@media (prefers-reduced-motion: reduce) { #download-analysis.pf-dl-btn::before, #download-analysis.pf-dl-btn::after, #download-analysis.pf-dl-btn .pf-dl-ic, .pfp-nudge, .pfp-flash { animation: none !important; } }
@media print { .pfp-nudge { display: none !important; } }

/* ── XIRR help: a translucent box over the XIRR card when it reads N/A ───── */
#portfolio-stats .portfolio-stat { overflow: visible; }
.pf-xh { position: absolute; z-index: 25; top: 8px; right: 8px; width: min(420px, calc(100vw - 32px)); max-height: 440px; overflow: auto; padding: 14px 16px 12px;
  border-radius: 14px; background: #fffdf8d9; -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid #e5c97a; box-shadow: 0 18px 40px #0d152633; color: #2b2a26; font-size: 12.5px; line-height: 1.45; animation: pfvIn .3s ease-out; }
.pf-xh b { display: block; padding-right: 24px; color: #0d1526; font-size: 14px; margin-bottom: 6px; }
.pf-xh-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: #6b6250; font-size: 18px; cursor: pointer; }
.pf-xh-x:hover { background: #f3ecdc; }
.pf-xh-steps { margin: 0 0 8px; padding-left: 18px; color: #4a4434; }
.pf-xh-steps li { margin: 2px 0; }
.pf-xh-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #efe6d2; }
.pf-xh-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #efe6d2; }
.pf-xh-list li span { min-width: 0; font-weight: 600; color: #0d1526; }
.pf-xh-list li small { display: block; font-weight: 400; color: #8a7d5c; font-size: 11px; }
.pf-xh-list button { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; background: #0d1526; color: #fff; font: 700 11.5px/1 inherit; cursor: pointer; transition: transform .16s ease-out; }
.pf-xh-list button:active { transform: scale(.97); }
.pf-xh-more, .pf-xh-tip { display: block; margin-top: 8px; color: #6b6250; font-size: 11.5px; }
.pf-xh-tip { padding: 7px 9px; border-radius: 8px; background: #f3ecdc99; }
@media (max-width: 760px) { .pf-xh { position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 60vh; } }
@media (prefers-reduced-transparency: reduce) { .pf-xh { background: #fffdf8; -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media print { .pf-xh { display: none !important; } }

/* ── rows that do not add up: red until someone checks them (owner, 17 Nov 2026) ── */
#holdings-body tr.pf-bad > td, #transactions-body tr.pf-bad > td { background: #fbe3e1b3 !important; }
#holdings-body tr.pf-bad > td:first-child, #transactions-body tr.pf-bad > td:first-child { box-shadow: inset 4px 0 0 #c0392b; }
#holdings-body tr.pf-okd > td, #transactions-body tr.pf-okd > td { background: #eaf6ee99 !important; }
#holdings-body tr.pf-okd > td:first-child, #transactions-body tr.pf-okd > td:first-child { box-shadow: inset 4px 0 0 #2e8b57; }
.pf-chk { margin-top: 8px; font-size: 12px; line-height: 1.45; white-space: normal; }
.pf-chk ul { margin: 0 0 6px; padding-left: 16px; color: #8e2a20; }
.pf-chk li { margin: 2px 0; }
.pf-ok-lbl { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 12px;
  background: #fff6d6; border: 1.5px solid #e5b93c; color: #0d1526; box-shadow: 0 0 0 0 #e5b93c80; animation: pfOkPulse 2.2s ease-out infinite; }
.pf-ok-lbl input { width: 18px; height: 18px; accent-color: #2e8b57; cursor: pointer; margin: 0; }
tr.pf-okd .pf-ok-lbl { background: #eaf6ee; border-color: #8cc9a3; color: #1e5c3a; animation: none; font-weight: 600; }
@keyframes pfOkPulse { 0% { box-shadow: 0 0 0 0 #e5b93c80; } 70%, 100% { box-shadow: 0 0 0 8px #e5b93c00; } }
.pf-review-sum { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: #fbe3e1cc; border: 1px solid #e8b4ae; color: #7d2219; font-size: 13px; }
.pf-review-sum b { color: #a52b22; }
.pf-only-bad { display: inline-flex !important; align-items: center; gap: 8px; grid-column: 1 / -1; font-weight: 600; color: #8e2a20 !important; cursor: pointer; }
.pf-only-bad input { width: 16px !important; height: 16px !important; accent-color: #c0392b; }
.pf-only-bad[data-n="0"] { color: #2e8b57 !important; }
@media (prefers-reduced-motion: reduce) { .pf-ok-lbl { animation: none; } }
@media print { .pf-ok-lbl, .pf-only-bad { display: none !important; } }

/* ── XIRR N/A: a red tag on the card; the list opens only when pressed ─────── */
.pf-xh-tag { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 6px 12px 6px 6px; border: 0; border-radius: 999px; cursor: pointer;
  background: #c0392b; color: #fff; font: 700 12px/1 inherit; box-shadow: 0 0 0 0 #c0392b80; animation: pfXhPulse 2s ease-out infinite; transition: transform .16s ease-out; }
.pf-xh-tag span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #c0392b; font-weight: 900; }
.pf-xh-tag:hover { background: #a93226; }
.pf-xh-tag:active { transform: scale(.97); }
.pf-xh-tag[aria-expanded="true"] { animation: none; }
@keyframes pfXhPulse { 0% { box-shadow: 0 0 0 0 #c0392b80; } 70%, 100% { box-shadow: 0 0 0 10px #c0392b00; } }
.pf-xh { top: calc(100% + 8px); right: 0; background: #fffdf8f2; }
.pf-xh[hidden] { display: none !important; }

/* ── the three analysis views: bigger, unmistakable buttons ─────────────────── */
.pfv-tabs { padding: 6px; gap: 0; border: 1.5px solid #e5c97a; background: linear-gradient(180deg, #fff8e6, #f3ecdc); box-shadow: 0 6px 18px #c9922a26; }
.pfv-btns { gap: 6px; }
.pfv-btns button { padding: 10px 18px; border: 1px solid #e7dfcc; background: #fffdf8; box-shadow: 0 1px 2px #0d15260f; }
.pfv-btns button b { font-size: 14px; }
.pfv-btns button:not([aria-selected="true"]):not(:disabled):hover { background: #fff; border-color: #d9b45a; color: #0d1526; }
.pfv-btns button[aria-selected="true"] { border-color: transparent; background: transparent; box-shadow: none; }
.pfv-ink { top: 6px; bottom: 6px; box-shadow: 0 8px 20px #0d152640, inset 0 -3px 0 #e5b93c; }
@media (prefers-reduced-motion: reduce) { .pf-xh-tag { animation: none; } }
@media (max-width: 760px) { .pfv-btns button { padding: 8px 8px; } .pfv-btns button b { font-size: 12px; } }
.pf-xh-why { margin: 0 0 8px; color: #6b6250; font-size: 12px; }
.pf-xh-steps b { display: inline; font-size: inherit; margin: 0; color: #0d1526; }
.pf-xh .pf-xh-steps b { display: inline !important; padding: 0 !important; margin: 0 !important; font-size: inherit !important; }
