/* ==========================================================================
   YOUR INVESTMENT — the page an invested user lands on (js/holdings-view.js).
   Same tokens and components as the basket page; denser, number-first.
   ========================================================================== */

.rot-180 { transform: rotate(180deg); }

/* ----- Layout: main column + sticky "Manage basket" rail ----- */
.hv {
  grid-template-areas: "head side" "main side";
  grid-template-rows: auto 1fr;
  row-gap: 28px;
}
.hv-head { grid-area: head; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hv-head__logo { padding: 0; transition: transform 160ms var(--ease-out), box-shadow 200ms ease; }
.hv-head__logo:hover { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04); }
.hv-head__logo:active { transform: scale(0.96); }
.hv-head .hero__title button { font: inherit; color: inherit; }
.hv-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 48px; }

.hv-rail {
  grid-area: side;
  position: sticky; top: 101px;
  z-index: 5;
  background: var(--surface-elevated);
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 0.5px var(--border-secondary);
}
.hv-rail__head { padding: 18px 20px 6px; }
.hv-menu { display: flex; flex-direction: column; padding: 0 8px; }
.hv-menu__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.hv-menu__item:hover { background: var(--grey-100); }
.hv-menu__item:active { transform: scale(0.985); }
.hv-menu__icon {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--grey-200);
  transition: background-color 160ms ease;
}
.hv-menu__item:hover .hv-menu__icon { background: #fff; box-shadow: inset 0 0 0 0.5px var(--border-primary); }
.hv-menu__text { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; }
.hv-menu__text .t-para-xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-menu__chev { opacity: 0.4; transition: transform 200ms var(--ease-out), opacity 160ms ease; }
.hv-menu__item:hover .hv-menu__chev { opacity: 0.8; transform: translateX(2px); }
.hv-menu__item--exit:hover .t-label-sm { color: var(--content-loss); }
.hv-menu__item--exit:hover svg path { stroke: var(--content-loss); }
.hv-rail__status { margin: 10px 20px 0; padding-top: 14px; border-top: 1.5px dashed var(--border-primary); }
.hv-rail__cta { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }

/* ----- Investment card: value, graph, two numbers, More details ----- */
.hv-ov { display: flex; flex-direction: column; padding: 22px 24px 0; overflow: clip; }
.ov-top { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.ov-value { margin-top: 2px; letter-spacing: -0.8px; }

/* Graph: same language as the basket hero chart */
.ovc { position: relative; height: 184px; margin-top: 12px; cursor: crosshair; touch-action: pan-y; }
.ovc:focus-visible { outline-offset: 4px; }
.ovc__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ovc__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ovc__inv { fill: none; stroke: #c9c9cc; stroke-width: 1.5; stroke-dasharray: 4 4; }
.ovc__invlabel { position: absolute; right: 0; top: 0; color: var(--content-tertiary); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.ovc__cross { position: absolute; left: 0; bottom: 0; width: 1px; height: calc(100% - 6px); opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.ovc__dot { position: absolute; left: 0; top: 0; width: 16px; height: 16px; opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.ovc__tip { gap: 4px; padding: 6px 8px; transition: opacity 120ms ease; z-index: 2; }
.ovc__tip .chart-tip__val { font-variant-numeric: tabular-nums; }
.ovc__tipk { font-weight: 500; font-size: 12px; color: var(--content-tertiary); }
.ovc.is-hover .ovc__cross, .ovc.is-hover .ovc__dot, .ovc.is-hover .ovc__tip { opacity: 1; }
.ovc.is-hover .ovc__invlabel { opacity: 0.4; }
.ovc__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 18px; }
.ovc__ranges { gap: 2px; }

.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 0; border-top: 1.5px dashed var(--border-primary); }
.ov-grid--more { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px 0 12px; border-top: 0.5px solid var(--border-secondary); }
.ov-m { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-right: 12px; font-variant-numeric: tabular-nums; }
.ov-m + .ov-m { padding-left: 20px; box-shadow: inset 0.5px 0 0 var(--border-primary); }
.ov-m .link-dotted { cursor: help; }
.ov-m .t-label-lg { white-space: nowrap; }
.ov-since { padding-bottom: 16px; }
.ov-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 360ms var(--ease-out); }
.ov-more > div { min-height: 0; overflow: hidden; opacity: 0; transition: opacity 200ms ease; }
.ov-more.is-open { grid-template-rows: 1fr; }
.ov-more.is-open > div { opacity: 1; transition: opacity 280ms ease 80ms; }
.ov-toggle {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin: 0 -24px; padding: 11px 24px;
  border-top: 0.5px solid var(--border-secondary);
  color: var(--content-secondary);
  font-weight: 600; font-size: 13px; line-height: 20px;
  transition: background-color 160ms ease, color 160ms ease;
}
.ov-toggle:hover { background: var(--grey-100); color: var(--content-primary); }
.ov-toggle img { opacity: 0.6; transition: transform 260ms var(--ease-out); }
.ov-toggle[aria-expanded="true"] img { transform: rotate(180deg); }

/* ----- Rebalance ----- */
.reb { display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 0; overflow: clip; }
.reb__head { display: flex; align-items: center; gap: 12px; }
.reb__icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--green-50); box-shadow: inset 0 0 0 0.5px rgba(5, 179, 136, 0.25); color: var(--yellow-700); }
.reb__icon img { width: 16px; height: 16px; }
.reb--ready .reb__icon, .reb--missed .reb__icon { background: var(--amber-50); box-shadow: inset 0 0 0 0.5px var(--amber-200); }
.reb--ready .reb__icon img { width: 18px; height: 18px; }
.reb__icon .lock-ico { width: 14px; height: 14px; }
.reb__copy { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reb__copy .t-para-sm { max-width: 460px; text-wrap: pretty; }
.reb__copy b { font-weight: 600; }
.reb__head .btn-primary { width: auto; flex-shrink: 0; padding-left: 20px; padding-right: 20px; }
.reb__head .btn-secondary { flex-shrink: 0; }

.reb__changes { display: flex; gap: 8px; }
.reb__stat, .reb__affects { border-radius: 12px; background: var(--grey-100); box-shadow: inset 0 0 0 0.5px var(--border-secondary); }
.reb__stat { width: 76px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; }
.reb__n { font-weight: 700; font-size: 20px; line-height: 26px; font-variant-numeric: tabular-nums; }
.reb__n--sell { color: var(--content-loss); }
.reb__n--buy { color: var(--content-profit); }
.reb__affects { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 10px 14px; }
.reb__tag { display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: 5px; font-weight: 600; font-size: 11px; line-height: 18px; vertical-align: 1px; }
.reb__tag--sell { background: var(--red-50); color: var(--content-loss); }

/* Timeline: last → current → today → next */
.reb__track { position: relative; height: 76px; margin: 0 9px; }
.reb__line, .reb__fill { position: absolute; left: 0; top: 30px; height: 2px; border-radius: 2px; }
.reb__line { right: 0; background: repeating-linear-gradient(to right, var(--grey-400) 0 4px, transparent 4px 8px); }
.reb__fill { width: calc(var(--x) * 100%); background: var(--grey-700); transform-origin: left; animation: growX 800ms var(--ease-out) both; }
.reb__pt { position: absolute; left: calc(var(--x) * 100%); top: 22px; width: 0; }
.reb__dot {
  position: absolute; left: -9px; top: 0;
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--grey-500);
}
.reb__dot img { width: 10px; height: 10px; }
.reb__dot .lock-ico { width: 9px; height: 9px; color: var(--yellow-700); }
.reb__pt--done .reb__dot { background: var(--green-50); box-shadow: 0 0 0 1.5px rgba(5, 179, 136, 0.45); }
.reb__pt--ready .reb__dot { background: var(--amber-600); box-shadow: 0 0 0 3px var(--amber-50), 0 0 0 4px var(--amber-200); }
.reb__pt--ready .reb__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--amber-600); animation: ping 2.4s var(--ease-out) infinite; }
.reb__pt--locked .reb__dot { background: var(--amber-50); box-shadow: 0 0 0 1.5px var(--amber-200); }
.reb__pt--next .reb__dot { box-shadow: 0 0 0 1.5px var(--content-secondary); }
.reb__pt--next .reb__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--content-secondary); }
.reb__lbl {
  position: absolute; top: 26px; left: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  font-size: 12px; line-height: 16px; color: var(--content-tertiary); white-space: nowrap;
}
.reb__lbl b { font-weight: 600; color: var(--content-primary); }
.reb__pt.is-start .reb__lbl { transform: translateX(-9px); align-items: flex-start; }
.reb__pt.is-end .reb__lbl { transform: translateX(calc(-100% + 9px)); align-items: flex-end; }
.reb__pt--ready .reb__lbl { color: var(--yellow-700); }
.reb__today { position: absolute; left: calc(var(--x) * 100%); top: 0; width: 0; height: 34px; }
.reb__today::after { content: ""; position: absolute; left: -0.75px; top: 16px; width: 1.5px; height: 18px; border-radius: 2px; background: var(--content-primary); }
.reb__today span { position: absolute; left: 0; top: 0; transform: translateX(-50%); padding: 0 6px; border-radius: var(--radius-round); background: var(--content-primary); color: #fff; font-weight: 600; font-size: 10px; line-height: 14px; white-space: nowrap; }

.reb__foot { display: flex; align-items: flex-start; gap: 6px; margin: 0 -20px; padding: 10px 20px; border-top: 0.5px solid var(--border-secondary); }
.reb__foot img { flex-shrink: 0; margin-top: 3px; }
.reb__foot > span { flex: 1 0 0; min-width: 0; text-wrap: pretty; }
.reb__foot .sb-link { flex-shrink: 0; font-size: 12px; line-height: 18px; }

@media (prefers-reduced-motion: reduce) { .reb__fill, .reb__pt--ready .reb__dot::after { animation: none; } }

/* ----- Holdings ----- */
.hv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hv-count { margin-left: 2px; padding: 0 7px; border-radius: var(--radius-round); background: var(--grey-300); color: var(--content-secondary); font-weight: 600; font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; }
.hv-hold { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 18px; }
.hv-hold.is-entering .hvt { animation: panelIn 360ms var(--ease-out); }

.hv-movers { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.hv-mover, .hv-mix { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--grey-100); box-shadow: inset 0 0 0 0.5px var(--border-secondary); min-width: 0; }
.hv-mover__top { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.hv-mover__top b { font-weight: 600; }
.hv-mover__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hv-mover__name { flex: 1 0 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-mix__bar { display: flex; gap: 2px; height: 20px; align-items: center; }
.hv-mix__bar span { height: 12px; min-width: 6px; border-radius: 4px; border: 0.5px solid; transition: height 200ms var(--ease-out); cursor: default; }
.hv-mix__bar span:hover, .hv-mix__bar span:focus-visible { height: 18px; }


.hvt { display: flex; flex-direction: column; }
.hvt__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 108px 104px;
  align-items: center; gap: 12px;
  padding: 9px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease;
}
.hvt__row:not(.hvt__row--head):hover { background: var(--grey-100); }
.hvt__row + .hvt__row:not(:hover) { box-shadow: 0 -0.5px 0 var(--border-secondary); }
.hvt__row--head { padding-top: 0; padding-bottom: 6px; }
.hvt__row--head > :nth-child(n+2) { display: flex; justify-content: flex-end; }
.hvt__sort {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 4px; margin-right: -4px;
  border-radius: 6px;
  color: var(--content-tertiary);
  font-size: 12px; line-height: 18px;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}
.hvt__sort img { opacity: 0; transition: opacity 160ms ease, transform 200ms var(--ease-out); }
.hvt__sort:hover { color: var(--content-secondary); background: var(--grey-200); }
.hvt__sort:hover img { opacity: 0.4; }
.hvt__sort.is-on { color: var(--content-primary); }
.hvt__sort.is-on img { opacity: 0.8; }
.hvt__stock { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hvt__name { display: flex; flex-direction: column; min-width: 0; }
.hvt__name .t-para-xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hvt__name .stock__name { flex: none; }
.hvt__tag {
  display: inline-block; margin-left: 4px; padding: 0 6px;
  border-radius: var(--radius-round);
  background: var(--amber-50); color: var(--yellow-700);
  box-shadow: inset 0 0 0 0.5px var(--amber-200);
  font-weight: 600; font-size: 11px; line-height: 16px;
}
.hvt__w { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; border-radius: 6px; }
.hvt__wbar { position: relative; width: 64px; height: 4px; border-radius: 4px; background: var(--grey-300); }
.hvt__wbar span { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--w) * 100%); border-radius: inherit; background: var(--grey-700); transform-origin: left; animation: growX 600ms var(--ease-out) both; }
.hvt__wbar i { position: absolute; top: -2px; left: calc(var(--t) * 100%); width: 1.5px; height: 8px; border-radius: 1px; background: var(--content-primary); }
.hvt__num { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.hvt__row--sector { margin-top: 6px; background: var(--grey-100); }
.hvt__row--sector + .hvt__row:not(:hover) { box-shadow: none; }
.hvt__mark { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin: 0 5px; }
.hvt--sectors .hvt__row:not(.hvt__row--sector):not(.hvt__row--head) .hvt__stock { padding-left: 18px; }

.hv-hold__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hv-sync { display: inline-flex; align-items: center; gap: 6px; color: var(--content-secondary); font-size: 12px; line-height: 18px; border-radius: 6px; }
.hv-sync--warn { color: var(--yellow-700); }
button.hv-sync { padding: 2px 6px; margin: -2px -6px; transition: background-color 160ms ease; }
button.hv-sync:hover { background: var(--amber-50); }
.hv-sync .lock-ico { width: 11px; height: 11px; }
.hv-sync__ok { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--green-50); }
.hv-sync__ok img { width: 10px; height: 10px; }

/* ----- Monthly report banner ----- */
.hv-report {
  position: relative;
  display: flex; align-items: stretch; gap: 24px;
  min-height: 196px;
  padding: 0 0 0 24px;
  border-radius: var(--radius-card);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 150% at 100% 100%, #d9efe8 0%, #eff8f5 52%, #fbfdfc 100%);
  box-shadow: inset 0 0 0 0.5px rgba(5, 179, 136, 0.18);
}
.hv-report::after { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../assets/noise-tile.jpg") center / 408px auto; mix-blend-mode: overlay; opacity: 0.5; pointer-events: none; }
.hv-report__copy { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 24px 0; }
.hv-report__copy .t-label-xl { text-wrap: balance; }
.hv-report__copy .t-para-sm { max-width: 400px; text-wrap: pretty; }
.hv-report__copy .btn-secondary { align-self: flex-start; margin-top: 10px; }
.hv-report__kicker { display: flex; align-items: center; color: var(--green-700); }
.hv-new { margin-right: 8px; padding: 0 6px; border-radius: var(--radius-round); background: var(--content-profit); color: #fff; letter-spacing: 0.4px; }
.hv-report__art { position: relative; width: 236px; flex-shrink: 0; }
.paper {
  position: absolute; left: 44px; top: 30px;
  width: 152px; height: 196px;
  padding: 14px;
  display: flex; flex-direction: column;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 36px -14px rgba(3, 90, 66, 0.35), 0 0 0 0.5px rgba(5, 179, 136, 0.18);
  transform: rotate(5deg);
  transition: transform 520ms var(--ease-out);
}
.paper--back { left: 32px; top: 38px; padding: 0; background: #f4faf8; transform: rotate(-6deg); box-shadow: 0 10px 24px -14px rgba(3, 90, 66, 0.3), 0 0 0 0.5px rgba(5, 179, 136, 0.15); }
.hv-report:hover .paper:not(.paper--back) { transform: rotate(2deg) translateY(-6px); }
.hv-report:hover .paper--back { transform: rotate(-8deg) translateX(-4px); }
.paper__head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.paper__head img { width: 18px; height: 18px; border-radius: 5px; }
.paper__head span { height: 5px; width: 54px; border-radius: 3px; background: var(--grey-300); }
.paper__k { font-size: 10px; line-height: 14px; color: var(--content-tertiary); font-weight: 600; }
.paper__v { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.3px; }
.paper__bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; margin: 10px 0 12px; }
.paper__bars i { flex: 1; height: var(--h); border-radius: 3px 3px 1px 1px; background: linear-gradient(to top, rgba(5, 179, 136, 0.35), var(--content-profit)); transform-origin: bottom; }
.js .hv-report.reveal.is-in .paper__bars i { animation: barUp 700ms var(--ease-out) both; animation-delay: calc(240ms + var(--d)); }
@keyframes barUp { from { transform: scaleY(0); } }
.paper__line { display: block; height: 5px; width: 86%; border-radius: 3px; background: var(--grey-300); }
.paper__line--s { width: 58%; margin-top: 6px; }

/* ----- Report + orders modal ----- */
.rep__hero { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.rep__kpis { padding: 14px 0; border-top: 0.5px solid var(--border-secondary); border-bottom: 0.5px solid var(--border-secondary); }
.rep__rows { display: flex; flex-direction: column; gap: 8px; }
.rep__rows > div { display: flex; justify-content: space-between; gap: 16px; }
.rep__rows > div > :first-child { white-space: nowrap; }
.rep__top { text-align: right; }

.ord { display: flex; flex-direction: column; }
.ord__item + .ord__item { border-top: 0.5px solid var(--border-secondary); }
.ord__head {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border-radius: 10px;
  text-align: left;
  transition: background-color 160ms ease;
}
.ord__head:not(:disabled):hover { background: var(--grey-100); }
.ord__head:disabled { cursor: default; }
.ord__main { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; }
.ord__status { padding: 1px 8px; border-radius: var(--radius-round); font-weight: 600; font-size: 11px; line-height: 18px; white-space: nowrap; }
.ord__status--ok { background: var(--green-50); color: var(--green-700); }
.ord__status--warn { background: var(--amber-50); color: var(--yellow-700); box-shadow: inset 0 0 0 0.5px var(--amber-200); }
.ord__status--info { background: var(--grey-200); color: var(--content-secondary); }
.ord__chev { width: 12px; opacity: 0.5; transition: transform 240ms var(--ease-out); }
.ord__item.is-open .ord__chev { transform: rotate(180deg); }
.ord__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease-out); }
.ord__item.is-open .ord__more { grid-template-rows: 1fr; }
.ord__more > div { min-height: 0; overflow: hidden; }
.ord__lines { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 12px; }
.ord__line { display: grid; grid-template-columns: 40px minmax(0, 1fr) 52px 60px; align-items: center; gap: 8px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.ord__line > :nth-child(n+3) { text-align: right; }
.ord__line .t-para-sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord__side { justify-self: start; padding: 0 6px; border-radius: 5px; font-weight: 600; font-size: 11px; line-height: 18px; }
.ord__side--buy { background: var(--green-50); color: var(--green-700); }
.ord__side--sell { background: var(--red-50); color: var(--content-loss); }
.ord__cta { margin: 0 0 14px; }
.ord__note { padding-top: 2px; }

/* ----- Basket details page: way back to the holdings ----- */
.back-link {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: -20px;
  padding: 4px 12px 4px 8px;
  border-radius: var(--radius-round);
  background: var(--surface-elevated);
  box-shadow: inset 0 0 0 0.5px var(--border-primary);
  font-weight: 600; font-size: 13px; line-height: 20px;
  color: var(--content-secondary);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.back-link:hover { background: var(--grey-200); color: var(--content-primary); }
.back-link:hover img { transform: rotate(90deg) translateY(2px); }
.back-link img { transition: transform 200ms var(--ease-out); }
.back-link:active { transform: scale(0.97); }
.sb-back {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 12px; padding: 4px;
  border-radius: 8px;
  color: var(--content-secondary);
  font-weight: 600; font-size: 13px; line-height: 20px;
  transition: color 160ms ease, background-color 160ms ease;
}
.sb-back:hover { color: var(--content-primary); background: var(--grey-100); }
.sb-back img { transition: transform 200ms var(--ease-out); }
.sb-back:hover img { transform: translateX(2px); }

/* ----- Small-screen bottom bar ----- */
.hv-bar { display: none; }

@media (max-width: 1023px) {
  .hv-menu { padding-bottom: 8px; }
  .hv-main { gap: 40px; }
  .hv { grid-template-areas: "head" "main" "side"; grid-template-rows: none; padding-bottom: 140px; }
  .hv-rail { position: relative; top: 0; }
  .hv-rail__cta, .hv-rail__status { display: none; }
  .hv-bar:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -0.5px 0 var(--border-primary), 0 -12px 24px -18px rgba(30, 30, 32, 0.25);
  }
  .hv-bar__info { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
  .hv-bar .btn-primary { width: auto; padding-left: 28px; padding-right: 28px; }
  body[data-view="holdings"] .state-switch { bottom: 84px; }
  body[data-view="holdings"] .toast { bottom: 148px; }
}

@media (max-width: 720px) {
  .reb { padding: 16px 16px 0; }
  .reb__head { flex-wrap: wrap; }
  .reb__copy { flex-basis: calc(100% - 48px); }
  .reb__head .btn-primary, .reb__head .btn-secondary { width: 100%; }
  .reb__changes { flex-wrap: wrap; }
  .reb__stat { flex: 1; width: auto; }
  .reb__affects { flex-basis: 100%; }
  .reb__sub { display: none; }
  .reb__foot { margin: 0 -16px; padding: 10px 16px; }
  .hv-ov { padding: 18px 16px 0; }
  .ovc { height: 150px; }
  .ovc__foot { flex-wrap: wrap; justify-content: center; }
  .ovc__foot > .t-para-xs { display: none; }
  .ov-grid--more { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .ov-grid--more .ov-m:nth-child(3) { padding-left: 0; box-shadow: none; }
  .ov-toggle { margin: 0 -16px; padding: 11px 16px; }
  .hv-sec-head h2 { white-space: nowrap; }
  .hv-sec-head .segmented__btn { padding-left: 10px; padding-right: 10px; }
  .hv-hold { padding: 14px 16px 16px; }
  .hv-movers { grid-template-columns: 1fr 1fr; }
  .hv-mix { grid-column: 1 / -1; }
  .hvt__row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: start; }
  .hvt__row--head, .hvt__row--sector { align-items: center; }
  .hvt__row > :nth-child(2) { display: none; }
  .hvt__stock { align-items: flex-start; gap: 8px; }
  .hvt__stock .stock__logo { margin-top: 1px; }
  .hvt__name .stock__name, .hvt__name .t-para-xs { white-space: normal; }
  .hvt__mark { margin-top: 5px; }
  .hv-report { flex-direction: column; padding: 0 20px; gap: 0; }
  .hv-report__art { width: 100%; height: 150px; }
  .paper { left: calc(50% - 76px); top: 22px; }
  .paper--back { left: calc(50% - 88px); top: 30px; }
  .hv-bar:not([hidden]) { padding-left: 16px; padding-right: 16px; }
  .ord__line { grid-template-columns: 40px minmax(0, 1fr) 48px; }
  .ord__line > :nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hvt__wbar span, .js .hv-report.reveal.is-in .paper__bars i { animation: none; }
}

/* ----- Overview card: centered value, today pill, inset metrics ----- */
.hv-ov { position: relative; padding: 0 24px; background: radial-gradient(60% 55% at 50% 0%, rgba(120, 60, 90, 0.07), transparent 70%), var(--surface-elevated, #fff); }
.hv-ov .ov-top { align-items: center; text-align: center; gap: 6px; padding: 32px 0 28px; }
.hv-ov .ov-value { font-size: 64px; line-height: 72px; letter-spacing: -2px; margin: 0; }
.ov-today { display: flex; align-items: center; gap: 10px; }
.ov-pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px; font-size: 16px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ov-pill--up { background: var(--green-50); box-shadow: inset 0 0 0 1px rgba(5, 179, 136, 0.22); }
.ov-pill--down { background: var(--red-50); box-shadow: inset 0 0 0 1px rgba(220, 60, 60, 0.2); }
.ov-pill__tri { width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-bottom: 7px solid currentColor; }
.ov-pill--down .ov-pill__tri { border-bottom: 0; border-top: 7px solid currentColor; }
.hv-ov .ov-grid--main { margin: 0 24px 36px; padding: 28px 0; border: 1px solid var(--border-secondary); border-radius: 20px; background: var(--grey-100); }
.hv-ov .ov-grid--main .ov-m { align-items: center; text-align: center; gap: 4px; padding: 0 16px; }
.hv-ov .ov-grid--main .ov-m .t-para-xs:first-child { font-size: 16px; line-height: 24px; }
.hv-ov .ov-grid--main .ov-m .t-label-lg { font-size: 26px; line-height: 34px; }
.hv-ov .ov-grid--main .ov-m > .t-para-xs:last-child { font-size: 15px; line-height: 22px; }
.hv-ov .ov-toggle { font-size: 16px; line-height: 24px; padding: 18px 24px; }
@media (max-width: 640px) {
  .hv-ov .ov-value { font-size: 44px; line-height: 52px; letter-spacing: -1.2px; }
  .hv-ov .ov-grid--main { margin: 0 0 24px; padding: 20px 0; }
  .hv-ov .ov-grid--main .ov-m .t-label-lg { font-size: 20px; line-height: 28px; }
}
