/* mrktpro dashboard: "Your year" (src/dashboard/year.js, docs/your-year.md). Phone first: one column, figures in a grid that wraps, no horizontal scroll, 44 px targets. Charts are drawn in neutral colours
   from the design tokens: a gain is above the line and a loss below it, so the colour is never the only thing that says which. */
.yr-controls { display: flex; flex-direction: column; gap: 12px; }
.yr-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.yr-pick { min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.yr-pick.on { background: var(--accent-bg); border-color: var(--accent); color: var(--text); font-weight: 600; }
.yr-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yr-custom[hidden] { display: none; }
.yr-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.yr-custom .field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-label); color: var(--muted); }
.yr-custom .in, .yr-custom .btn { min-height: var(--tap); }
.yr-custom-note:empty { display: none; }
.yr-compare { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-size: var(--fs-body); cursor: pointer; }
.yr-compare input { width: 20px; height: 20px; }

/* Overview */
.yr-block + .yr-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.yr-block h3 { margin: 0 0 4px; font-size: var(--fs-head); }
.yr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; margin: 10px 0 6px; }
.yr-stat .k { font-size: var(--fs-label); color: var(--muted); }
.yr-stat .v { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--text); }
.yr-stat a.v { color: var(--accent); text-decoration: none; }
.yr-stat a.v:hover { text-decoration: underline; }
.yr-stat .s { font-size: var(--fs-label); color: var(--muted); overflow-wrap: anywhere; }
.yr-overview .btn { margin-top: 6px; }

/* Charts */
.yr-chart-part + .yr-chart-part { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.yr-chart-part h3 { margin: 0 0 8px; font-size: var(--fs-head); }
.yr-chart-part h4 { margin: 10px 0 6px; font-size: var(--fs-body); }
.yr-chart { min-height: 120px; }
.yr-chart svg { display: block; width: 100%; overflow: visible; }
.yr-chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.yr-chart text.strong { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.yr-chart text.val, .yr-chart text.zero-label { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.yr-chart text.val { fill: var(--muted); font-size: 10px; }
.yr-chart text.zero-label { fill: var(--muted); }
.yr-chart .grid { stroke: var(--line); stroke-width: 1; }
.yr-chart .zero { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3; }
.yr-chart .line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.yr-chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.yr-chart .bar.gain { fill: var(--accent); opacity: 0.85; }
.yr-chart .bar.loss { fill: var(--faint); opacity: 0.85; }
.yr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 0; color: var(--muted); }
.yr-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.yr-legend .sw.gain { background: var(--accent); }
.yr-legend .sw.loss { background: var(--faint); }
.yr-alt { margin-top: 8px; }
.yr-alt summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--muted); }
.yr-table { width: 100%; }
.yr-table th[scope="row"] { text-align: start; font-weight: 500; }
.yr-two { display: grid; grid-template-columns: 1fr; gap: 14px; }
.yr-round-list { margin: 0; }
.yr-round-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-top: 1px solid var(--line); min-height: 36px; }
.yr-round-list li:first-child { border-top: 0; }
.yr-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.yr-hbars { margin: 0; }
.yr-hbars li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.yr-hbars li:first-child { border-top: 0; }
.yr-hname { min-width: 0; overflow-wrap: anywhere; }
.yr-htrack { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.yr-hbar { height: 100%; border-radius: 5px; }
.yr-hbar.gain { background: var(--accent); }
.yr-hbar.loss { background: var(--faint); }
.yr-hamt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; }

/* Patterns and the two lists */
.yr-pattern, .yr-item { padding: 14px 0; border-top: 1px solid var(--line); }
.yr-patterns > .meta + .yr-pattern, .yr-list > .meta + .yr-item { border-top: 0; }
.yr-pattern-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.yr-pattern h3, .yr-item h3 { margin: 0; font-size: var(--fs-head); }
.yr-pattern p, .yr-item p { margin: 6px 0 0; }
.yr-pattern.not-enough { opacity: 0.92; }
.yr-research { font-style: normal; }
.yr-trades { margin-top: 6px; }
.yr-trades summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--accent); font-size: var(--fs-body); }
.yr-trade-list { margin: 0 0 4px; }
.yr-trade-list li { padding: 6px 0; border-top: 1px solid var(--line); min-height: 36px; }
.yr-trade-list li:first-child { border-top: 0; }
.yr-experiment { padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius-sm); }
.yr-why b, .yr-how b, .yr-experiment b { color: var(--text); }
.yr-item.well { border-inline-start: 3px solid var(--accent); padding-inline-start: 12px; }
.yr-item.look { border-inline-start: 3px solid var(--line-2); padding-inline-start: 12px; }

/* The written summary, the comparison and the notes */
.yr-summary { padding: 4px 0 8px; }
.yr-summary p { margin: 8px 0 0; line-height: 1.55; }
.yr-ai { display: inline-block; white-space: normal; }
.yr-summary-body .row { margin-top: 10px; }
.yr-summary-body .btn { min-height: var(--tap); }
.yr-compare-table { width: 100%; }
.yr-compare-table th[scope="row"] { text-align: start; font-weight: 500; }
.yr-compare-table .num { white-space: normal; }
.yr-about summary { cursor: pointer; padding: 14px 16px; list-style-position: inside; min-height: var(--tap); }
.yr-about summary h2 { display: inline; margin: 0; }
.yr-about-list { margin: 0; padding: 0 16px 14px 32px; display: grid; gap: 8px; }
.yr-link .btn { min-height: var(--tap); display: inline-flex; align-items: center; }

@media (min-width: 760px) {
  .yr-two { grid-template-columns: 1fr 1fr; }
  .yr-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

/* What the numbers are counted from: the executions, the round trips they group into, and the months to set against the broker's own list. */
.yr-counts .exec-counts { margin-top: var(--s2); }
.yr-counts > p.small { margin: var(--s3) 0 0; }
.yr-months { margin-top: var(--s2); }
.yr-months tr.total th, .yr-months tr.total td { font-weight: 650; border-top: 1px solid var(--line-2); }
.yr-guide { margin-top: var(--s1); }
