/* Position tab (js/position-view.js): your own position in the stock. Built on the
   Fundamentals and Results tabs' open sections (css/fundamentals.css, css/results.css)
   and the Price tabs' chart (css/timelines-v2.css); only what is new lives here. No
   boxes: sections divided by thin lines, the chart on the page. */
.position-view { min-width: 0; max-width: 100%; }

.pv-read .fv-lede { margin: 8px 0 0; max-width: 760px; color: var(--muted); }
.pv-read .neg { color: var(--negative); }
.pv-read .pos { color: var(--positive); }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.pv-btn { min-height: 36px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font: 600 .84rem var(--font-sans); cursor: pointer; }
.pv-btn:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--text) 4%, transparent); }
.pv-btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.pv-btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.pv-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pv .fv-fact > b.pos, .pv td.pos, .pv b.pos { color: var(--positive); }
.pv .fv-fact > b.neg, .pv td.neg, .pv b.neg { color: var(--negative); }
.pv-facts { gap: 14px 38px; }
/* the facts live in their own box for the live redraw; the next section keeps its line */
.pv [data-pv-facts]:not(:empty) + .fv-q { border-top: 1px solid var(--hairline); padding-top: 22px; }

/* the value over time */
.pv-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-top: 12px; }
.pv-ranges { width: auto; grid-template-columns: repeat(var(--time-range-columns), minmax(40px, auto)); }
.pv-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .76rem; color: var(--muted); }
.pv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pv-legend span::before { content: ""; display: inline-block; }
.pv-legend .v::before { width: 16px; height: 2px; background: var(--positive); }
.pv-legend .c::before { width: 16px; height: 0; border-top: 2px dashed var(--muted); }
.pv-legend .b::before { width: 0; height: 0; border: 5px solid transparent; border-top: 8px solid var(--positive); border-bottom: 0; }
.pv-legend .s::before { width: 0; height: 0; border: 5px solid transparent; border-bottom: 8px solid var(--negative); border-top: 0; }
.pv-chart { position: relative; margin-top: 10px; min-height: 220px; }
.pc-line.pv-cost { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 5; }
.pv-mark { stroke: var(--surface); stroke-width: 1; pointer-events: none; }
.pv-mark-buy { fill: var(--positive); }
.pv-mark-sell { fill: var(--negative); }

/* trades */
.pv-trades td.pv-side { font-family: var(--font-sans); font-weight: 650; }
.pv-trades td.pv-side.buy { color: var(--positive); }
.pv-trades td.pv-side.sell { color: var(--negative); }
.pv-trades td.pv-source { font-family: var(--font-sans); color: var(--muted); }

@media (max-width: 640px) {
  .pv-chart-head { flex-direction: column; align-items: stretch; }
  .pv-ranges { grid-template-columns: repeat(var(--time-range-columns), minmax(0, 1fr)); }
  .pv-facts { gap: 12px 24px; }
}
