/* V2 primary surfaces. Theme tokens remain unchanged. */
.v2-owned > :not(.v2-root):not(.discussion-panel):not(#discussion-pm) { display:none !important; }
.v2-root { display:grid; gap:14px; }
.v2-pagehead { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.v2-pagehead h1 { margin:0; }
#v2-today-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.v2-wealth-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.v2-wealth-value { display:block; font-size:clamp(2rem,6vw,3.2rem); line-height:1.15; margin:6px 0; }
.v2-wealth-sub { display:flex; flex-wrap:wrap; gap:10px 22px; }
.v2-wealth-sub span { font-size:.9rem; }
.v2-today-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.v2-key { display:flex; flex-direction:column; gap:4px; }
.v2-key strong { font-size:clamp(1.4rem,3vw,2rem); line-height:1.15; }
.v2-key small { color:var(--muted,#687a70); }
.v2-market { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.v2-market div { display:flex; flex-direction:column; }
.v2-market-strip { display:flex !important; flex-direction:row !important; flex-wrap:wrap; gap:6px; width:100%; }
.v2-market-strip > span { display:flex; flex:1 1 75px; flex-direction:column; gap:2px; padding:7px; background:#f5f7f4; border-radius:7px; }
.v2-attention { display:grid; gap:7px; }
.v2-attention-row { display:grid; grid-template-columns:auto auto 1fr; align-items:center; gap:10px; width:100%; padding:10px; border:1px solid #dce6dd; border-radius:10px; background:#fff; text-align:left; color:inherit; }
.v2-attention-row small { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.v2-capital > strong { display:block; font-size:1.3rem; margin:4px 0; }
.v2-filters { display:flex; flex-wrap:wrap; gap:8px; }
.v2-filters input,.v2-filters select { min-width:0; flex:1 1 125px; }
.v2-holdings { display:grid; gap:9px; }
.v2-holding { padding:12px 15px; }
.v2-holding-head { display:flex; justify-content:space-between; align-items:flex-start; width:100%; padding:0; background:transparent; border:0; color:inherit; text-align:left; cursor:pointer; }
.v2-holding-head > span { display:flex; flex-direction:column; gap:2px; }
.v2-holding-head strong { font-size:1.2rem; }
.v2-holding-values { text-align:right; }
.v2-holding-values b { font-size:1.15rem; }
.v2-holding-bottom { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; margin-top:8px; font-size:.9rem; }
.v2-holding-market,.v2-holding-profit { display:flex; flex-direction:column; gap:2px; min-width:0; }
.v2-holding-profit { text-align:right; }
.v2-holding-profit > small { line-height:1; }
.v2-reconcile { display:block; color:var(--muted,#687a70); }
.v2-holding-detail { border-top:1px solid #dce6dd; margin-top:12px; padding-top:12px; }
.v2-trade-history { margin-bottom:16px; }
.v2-trade-history h3 { margin:0 0 8px; }
.v2-trade-history > p { margin:6px 0 10px; }
.v2-trade-list { display:grid; gap:7px; margin:9px 0; }
.v2-trade-row { padding:9px 11px; border:1px solid #e2e9e3; border-radius:8px; }
.v2-trade-row > div { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.v2-trade-row time { color:var(--muted,#687a70); font-size:.84rem; }
.v2-trade-row p { margin:4px 0 0; font-size:.9rem; }
.v2-closed summary { cursor:pointer; font-weight:700; }
.v2-closed-item { border-top:1px solid #e2e9e3; margin-top:12px; padding-top:10px; }
.v2-closed-item h3 { margin:0 0 3px; }
.v2-five > div:not(.dv) { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid #eef1ee; }
.v2-five > div:not(.dv) span { text-align:right; }
.v2-stock-chart { display:block; width:100%; height:180px; border-bottom:1px solid #dce6dd; }
.v2-perf-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0; }
.v2-perf-metrics > div { display:flex; flex-direction:column; background:#f5f7f4; border-radius:8px; padding:10px; }
.v2-perf-metrics b { font-size:1.15rem; }
.v2-line-chart { display:block; width:100%; height:180px; color:#15804c; border-bottom:1px solid #dce6dd; }
.v2-lot-compare { border-top:1px solid #dce6dd; margin-top:16px; padding-top:12px; }
.v2-research-answer { border:1px solid #dce6dd; border-radius:10px; padding:15px; background:#fff; }
.v2-answer-top { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.v2-research-answer > strong { display:block; font-size:1.1rem; }
.v2-answer-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.v2-answer-grid p { margin:9px 0; }
.v2-more-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.v2-more-grid button { padding:18px; background:#fff; border:1px solid #dce6dd; border-radius:10px; color:inherit; font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.v2-more-grid button:hover,.v2-attention-row:hover { border-color:#29885b; }
.positive { color:#008a36 !important; }
.negative { color:#ea1735 !important; }
@media(max-width:760px){
  .v2-five > div:not(.dv) { display:block; }
  .v2-five > div:not(.dv) b,.v2-five > div:not(.dv) span { display:block; text-align:left; }
  .v2-five > div:not(.dv) b { margin-bottom:4px; }
  .v2-holdings { gap:5px; }
  .v2-holding { padding:8px 10px; }
  .v2-holding-head strong { font-size:1.05rem; }
  .v2-holding-bottom { margin-top:3px; font-size:.82rem; }
  .v2-reconcile { font-size:.76rem; }
  .v2-today-grid { gap:8px; }
  .v2-key { padding:12px; }
  .v2-key strong { font-size:1.32rem; }
  .v2-attention-row { grid-template-columns:auto auto; }
  .v2-attention-row small { grid-column:1/-1; }
  .v2-answer-grid { grid-template-columns:1fr; gap:0; }
  .v2-pagehead { flex-wrap:wrap; }
  #v2-today-actions { justify-content:flex-start; }
  .v2-more-grid { grid-template-columns:1fr; }
}

/* WealthSight intelligence on Holdings (M16). Neutral styling: new information, never a direction. */
.intel-bar { font-size:11px; color:var(--muted); margin:0 0 8px; padding:6px 10px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.intel-bar.warn, .intel-line.warn { color:#694e1d; background:#fff8e7; border-color:#eedfae; }
.intel-markets { margin-bottom:10px; font-size:12px; }
.intel-markets summary { cursor:pointer; font-weight:700; }
.intel-markets ul, .intel-detail ul { margin:8px 0 0; padding-left:18px; }
.intel-markets li, .intel-detail li { margin-bottom:6px; line-height:1.45; }
.intel-line { display:block; width:100%; text-align:left; margin-top:8px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; background:#fafcf9; color:#48614f; font-size:11px; line-height:1.45; }
.intel-line.muted { color:var(--muted); }
.intel-new { display:inline-block; padding:0 5px; border:1px solid #9fb3a6; border-radius:8px; font-size:10px; font-weight:800; color:#345747; }
.intel-detail { margin-top:8px; padding:10px; border:1px dashed var(--line); border-radius:8px; font-size:12px; }
.intel-detail h4 { margin:6px 0 2px; font-size:12px; }
/* M16 usability: what happened first, history second, data behind a disclosure */
.intel-line span { display:block; }
.intel-line .intel-new { display:inline-block; margin-bottom:3px; }
.intel-what { font-weight:700; color:#214536; font-size:12px; }
.intel-history, .intel-next { color:var(--muted); }
.intel-explain { margin:3px 0 2px; font-size:12px; line-height:1.5; }
p.intel-history { margin:0 0 4px; font-size:11px; }
.intel-raw { margin:3px 0 6px; font-size:11px; color:var(--muted); }
.intel-raw summary { cursor:pointer; }
.intel-markets h4 { margin:10px 0 4px; font-size:12px; color:var(--teal); }
.intel-market { border-top:1px solid var(--line); padding:7px 0; }
.intel-market summary { cursor:pointer; list-style-position:outside; }
.intel-internals { margin:6px 0; font-size:11px; color:#48614f; }
.intel-context { margin:0 0 4px; font-size:11px; color:var(--muted); }
/* AI interpretation (ADR-0053): visibly separate from the WealthSight facts above it. Neutral: no direction colour. */
.intel-source, .ai-heading { font-size:10px; font-weight:800; letter-spacing:.04em; color:var(--muted); text-transform:none; }
.intel-facts { color:#214536; font-size:11px; }
.ai-line { display:block; width:100%; text-align:left; margin-top:6px; padding:6px 8px; border:1px solid #d9d6ea; border-left:3px solid #7a6fb0; border-radius:8px; background:#faf9fe; color:#2f2a4a; font-size:12px; line-height:1.45; }
.ai-line span { display:block; }
.ai-prov { font-size:10px; color:var(--muted); }
.ai-text { margin-top:2px; }
.ai-more { margin-top:3px; font-size:11px; color:#5a4f97; font-weight:700; }
.ai-detail { margin-top:8px; padding:10px; border:1px solid #d9d6ea; border-left:3px solid #7a6fb0; border-radius:8px; background:#faf9fe; font-size:12px; line-height:1.5; }
.ai-detail h4 { margin:0 0 4px; font-size:12px; color:#5a4f97; }
.ai-detail h5 { margin:8px 0 2px; font-size:11px; color:#2f2a4a; }
.ai-detail h6 { margin:6px 0 2px; font-size:11px; font-weight:700; color:var(--muted); }
.ai-detail ul { margin:0; padding-left:18px; }
.ai-detail p { margin:2px 0; }
.ai-headline { font-weight:700; }
.ai-meta, .ai-stale { margin-top:8px !important; font-size:11px; color:var(--muted); }
.ai-stale { color:#694e1d; }
.ai-again { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:8px 0 6px; font-size:11px; }
.ai-again button, .ai-toggle { padding:5px 10px; border:1px solid #b9b3da; border-radius:8px; background:#fff; font-size:11px; font-weight:700; color:#3e3670; }
.ai-toggle.on { background:#5a4f97; color:#fff; border-color:#5a4f97; }
.ai-set-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:7px 0; border-top:1px solid var(--line); font-size:12px; }
.ai-set-row select { max-width:55%; font-size:12px; }
.ai-discuss-open, .ai-discussion button { margin-top:8px; padding:6px 12px; border:1px solid #b9b3da; border-radius:8px; background:#fff; font-size:12px; font-weight:700; color:#3e3670; }
.ai-discussion { margin-top:8px; padding:10px; border:1px solid #d9d6ea; border-radius:8px; background:#fff; font-size:12px; line-height:1.5; }
.ai-discussion h6 { margin:8px 0 2px; font-size:11px; font-weight:700; color:var(--muted); }
.ai-discussion ul { margin:0; padding-left:18px; }
.ai-discussion p { margin:2px 0; }
.ai-original { padding:6px 8px; background:#faf9fe; border-left:3px solid #7a6fb0; border-radius:6px; }
.ai-turn { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.ai-you { padding:6px 8px; background:#f3f6f2; border-radius:8px; }
.ai-badge { display:inline-block; margin-top:6px; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:800; border:1px solid #b9b3da; color:#3e3670; background:#f1effa; }
.ai-claim { display:inline-block; padding:0 5px; border:1px solid var(--line); border-radius:6px; font-size:10px; color:var(--muted); }
.ai-rev { margin:6px 0; padding:6px 8px; border:1px dashed #b9b3da; border-radius:8px; }
.ai-discussion textarea { width:100%; box-sizing:border-box; margin-top:10px; padding:8px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.ai-void summary { cursor:pointer; font-size:11px; color:var(--muted); }
.ai-state { font-size:11px; color:var(--muted); }
.ai-job-state { font-size:12px; color:#3e3670; }
.ai-job.warn .ai-job-state { color:#694e1d; }
/* Mini chart and the security-and-market facts in the expanded holding (M16 closeout). */
.intel-chart { margin:0 0 8px; }
.intel-chart svg { display:block; width:100%; height:118px; background:#fbfcfa; border:1px solid var(--line); border-radius:8px; }
.intel-chart figcaption { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:4px; font-size:10px; color:var(--muted); }
.intel-chart .k::before { content:''; display:inline-block; width:10px; height:2px; margin-right:4px; vertical-align:middle; background:transparent; }
.intel-chart .k-close::before { background:#12543a; height:3px; } .intel-chart .k-ma10::before { background:#8a6fb0; }
.intel-chart .k-ma21::before { background:#247bc1; } .intel-chart .k-ma50::before { background:#d9931e; }
.intel-chart .k-level::before { background:repeating-linear-gradient(90deg,#8a5a00 0 3px,transparent 3px 5px); }
.intel-chart .k-dot::before { width:6px; height:6px; border:1.5px solid #12543a; border-radius:50%; background:#fff; }
.intel-context-block { margin-bottom:8px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:#fafcf9; }
.intel-context-block h4 { margin:0 0 2px; } .intel-context-block h4+ul { margin-top:2px; } .intel-context-block ul+h4 { margin-top:8px; }
.intel-levels { width:100%; border-collapse:collapse; font-size:11px; margin:6px 0; }
.intel-levels th, .intel-levels td { text-align:right; padding:3px 4px; border-bottom:1px solid var(--line); font-weight:400; }
.intel-levels th:first-child, .intel-levels td:first-child { text-align:left; }
.intel-levels th { color:var(--muted); font-size:10px; }
.ai-off { margin:4px 2px 0; font-size:10px; color:var(--muted); }
/* M17 decision view: why now, where (chart), what confirms / does not, what to watch, position. */
.dv { display:grid; gap:12px; }
.dv .dv-title { margin:0; font-size:13px; font-weight:800; } .dv-title small { font-weight:400; color:var(--muted); margin-left:4px; }
.dv-stale { margin-left:6px; padding:1px 6px; border-radius:6px; background:#fff3d6; color:#7a5200; font-size:11px; font-weight:600; }
.dv h4 { margin:0 0 2px; font-size:11px; font-weight:600; color:var(--muted); letter-spacing:.02em; }
.dv p { margin:0; font-size:13px; line-height:1.5; }
.dv-why p:first-of-type { font-size:15px; font-weight:700; }
.dv .dv-status { font-size:19px; font-weight:800; line-height:1.3; }
.dv .dv-rs { margin-top:2px; font-size:12px; } .dv-rs b { margin-right:6px; }
.dv-cols { display:grid; grid-template-columns:1fr; gap:10px; }
.dv ul { margin:0; padding:0; list-style:none; } .dv li { margin:0 0 3px; padding-left:18px; text-indent:-18px; font-size:13px; line-height:1.45; }
.dv-mark { display:inline-block; width:18px; text-indent:0; font-weight:800; }
.dv .dv-other { font-size:12px; color:var(--muted); }
.dv-watch p { margin-bottom:2px; } .dv-watch b { display:inline-block; min-width:38px; }
.dv-foot { margin:8px 0 0; font-size:11px; }
@media (min-width:760px){ .dv-cols { grid-template-columns:1fr 1fr; gap:20px; } }
.v2-five .dv + .intel-chart { margin-top:12px; }
.chg { padding:12px 14px; } .chg h2 { margin:0 0 6px; font-size:14px; }
.chg ul { margin:0; padding:0; list-style:none; } .chg li + li { border-top:1px solid #eef1ee; }
.chg-row { display:grid; gap:1px; width:100%; min-height:44px; padding:8px 0; border:0; background:none; text-align:left; font:inherit; color:inherit; cursor:pointer; }
.chg-row:focus-visible { outline:2px solid #247bc1; outline-offset:2px; }
.chg-top { display:flex; align-items:center; gap:8px; } .chg-top strong { font-size:15px; }
.chg-tag { padding:1px 6px; border-radius:6px; background:#e7f1ea; color:#12543a; font-size:11px; font-weight:600; }
.chg-what { font-size:13px; font-weight:600; } .chg-read { font-size:12px; color:var(--muted); }
.chg p { margin:0; font-size:13px; } .chg .chg-rest { margin-top:6px; font-size:12px; }
.chg .chg-sub { margin:-4px 0 6px; font-size:11px; }
/* M17 final QA: disclosure summaries inside an expanded holding were 16px tall on a phone */
@media (max-width:760px){ .v2-holding-detail summary { padding:8px 0; min-height:28px; box-sizing:content-box; } }

/* Mobile interaction stability. Keep the existing five destinations and theme. */
@media (max-width:760px){
  .mobile-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; inset:auto 0 0; width:100%; box-sizing:border-box; overflow:hidden; overscroll-behavior:contain; touch-action:none; padding:5px max(4px,env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-right)); z-index:50; }
  .mobile-nav button { min-width:0; white-space:nowrap; border-radius:9px; }
  .mobile-nav button span { white-space:nowrap; }
  .mobile-nav button.active { background:#e7f1ea; color:#12543a; }
  .content { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
  .v2-detail-head { position:sticky; top:0; z-index:3; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; background:#fff; border-bottom:1px solid var(--line); }
  .v2-detail-head .button { min-height:38px; }
  .v2-full-research > summary { position:sticky; top:0; z-index:3; padding:10px 6px; background:#fff; border-bottom:1px solid var(--line); }
  .v2-detail-done { display:block; width:100%; min-height:44px; margin:18px 0 4px; }
  .ri-return { position:sticky; top:0; z-index:4; margin:0 0 10px; background:#fff; min-height:42px; }
  #entry-dialog, #discussion-dialog, .research-decision { max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain; }
  #entry-dialog .dialog-head, #discussion-dialog .dialog-head, .research-decision .dialog-head { position:sticky; top:0; z-index:5; background:#fff; padding:7px 0; }
  .v2-close-hint { font-size:.8em; font-weight:400; }
}

/* Saved analysis hierarchy, within the existing V2 cards. */
.analysis-brief { min-width:0; overflow-wrap:anywhere; }
.analysis-brief > p { margin:.45rem 0; }
.analysis-disclosure { margin-top:.6rem; }
