/* Inspired by SRACC 2.1.2 by Yuki Matsuda, commit 27a6e34d093fa843e3137f7a0cbea0847e5b8512.
 * https://github.com/yukimatJP/SuccessRiverAcademicCareerChartJS
 * CC BY-NC 4.0: https://creativecommons.org/licenses/by-nc/4.0/
 * Modified: static annual unit bars, explicit award links, compact funding lanes and local shared records. */
.river-point:focus-visible, .river-legend-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.river-figure {
  --river-journal: #79558f;
  --river-journal-other: #a587b3;
  --river-international: var(--accent);
  --river-international-other: #7891bf;
  --river-domestic: #3c7c66;
  --river-domestic-other: #749a89;
  --river-invited: #a65573;
  --river-invited-other: #bc7d94;
  --river-funding: #5d7a86;
  --river-funding-other: #80959f;
  --river-education: #86919d;
  --river-work: #5c6977;
  --river-gold: #e2ad28;
  --river-award-gradient: linear-gradient(45deg, #b77914 0%, var(--river-gold) 52%, #fff1a1 100%);
  --river-award-mask: url('icons/star.svg');
  --river-award-size: 10px;
  --river-ribbon: #c94e53;
  --river-authorship-gap: 4px;
  --river-grant-pitch: 34px;
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.5;
}
.river-figure [data-medium="journal"] { --river-color: var(--river-journal); --river-color-other: var(--river-journal-other); }
.river-figure [data-medium="international"] { --river-color: var(--river-international); --river-color-other: var(--river-international-other); }
.river-figure [data-medium="domestic"] { --river-color: var(--river-domestic); --river-color-other: var(--river-domestic-other); }
.river-figure [data-medium="invited"] { --river-color: var(--river-invited); --river-color-other: var(--river-invited-other); }
.river-scroll { overflow-x: auto; width: 100%; max-width: 100%; border-inline: 1px solid var(--line); padding: 16px; }
.river-chart { --river-label: 128px; position: relative; width: 100%; min-width: calc(var(--river-label) + var(--river-column) * var(--river-years)); }
.river-plot { position: relative; }
.river-legend { display: grid; gap: 12px; margin-bottom: 18px; }
.river-legend-secondary { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.river-background { position: absolute; left: var(--river-label); right: 0; top: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--river-years),minmax(0,1fr)); pointer-events: none; }
.river-background>span { border-left: 1px solid var(--line); }
.river-background>span:last-child { border-right: 1px solid var(--line); }
.river-year-row, .river-career, .river-output, .river-funding { display: grid; grid-template-columns: var(--river-label) minmax(0,1fr); position: relative; }
.river-year-cells, .river-publication-columns, .river-event-columns { display: grid; grid-template-columns: repeat(var(--river-years),minmax(0,1fr)); }
.river-year-cells { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.river-year-row { padding: 0 0 8px; }
.river-year-cells .river-year-trigger { display: block; width: 100%; min-height: 28px; padding: 2px 0; text-align: center; }
.river-year-trigger:hover { color: var(--ink); background: var(--soft); }
.river-career { padding-top: 12px; }
.river-section-label { align-self: start; padding-right: 16px; }
.river-career-periods { position: relative; height: calc(var(--river-career-lanes) * var(--river-grant-pitch)); }
.river-output>.river-section-label { padding-top: 8px; }
.river-figure h3 { margin: 0; font-size: inherit; line-height: 1.6; font-weight: 600; }
.river-legend-trigger { display: inline; padding: 0; min-height: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: help; text-decoration: underline dotted var(--line); text-underline-offset: 4px; }
.river-media-legend { display: flex; align-items: center; gap: 24px; list-style: none; padding: 0; margin: 0; line-height: 1.4; }
.river-media-legend>li { flex: 0 0 auto; margin: 0; }
.river-media-legend .river-medium-label { gap: 7px; white-space: nowrap; }
.river-media-legend .river-medium-label>span { min-width: 0; }
.river-media-legend .river-key { width: 16px; }
.river-medium-label { display: flex; align-items: center; gap: 7px; }
.river-key { display: inline-block; flex-shrink: 0; width: 20px; height: var(--river-bar-height); }
.river-key.bar { --river-fill: var(--river-color, var(--muted)); border-radius: 999px; background: var(--river-fill); }
.river-key.bar.is-other { --river-fill: color-mix(in srgb, var(--muted) 65%, white); height: var(--river-other-bar-height); }
.river-key.awarded { width: var(--river-award-size); height: var(--river-award-size); -webkit-mask: var(--river-award-mask) center / contain no-repeat; mask: var(--river-award-mask) center / contain no-repeat; background: var(--river-award-gradient); }
.river-key.star { position: relative; color: var(--river-gold); width: 16px; height: auto; text-align: center; font-size: 16px; line-height: 1; }
.river-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 3px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.river-counts>span { display: inline-flex; align-items: center; gap: 7px; }
.river-counts b { font-weight: 650; }
.river-output-data { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.river-year-column { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-block: 10px; min-width: 0; }
.river-stack { display: flex; flex-direction: column-reverse; align-items: center; width: 100%; min-width: 0; }
.river-medium-stack { display: flex; flex-direction: column-reverse; width: 100%; flex: 0 0 auto; }
.river-medium-stack[data-first-author="true"]+.river-medium-stack[data-first-author="false"] { margin-bottom: var(--river-authorship-gap); }
.river-point { position: relative; text-decoration: none; }
.river-output-bar { --river-fill: var(--river-color); --river-output-height: var(--river-bar-height); --river-output-pitch: var(--river-unit-pitch); --river-award-marker-size: var(--river-award-size); display: grid; place-items: center; width: 100%; height: var(--river-output-pitch); flex: 0 0 var(--river-output-pitch); border-radius: 3px; }
.river-output-bar::before { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: var(--river-output-height); transform: translateY(-50%); border-radius: 999px; background: var(--river-fill); }
.river-output-bar.is-other { --river-fill: var(--river-color-other); --river-output-height: var(--river-other-bar-height); --river-output-pitch: var(--river-other-unit-pitch); --river-award-marker-size: calc(var(--river-other-bar-height) + 2px); }
.river-output-bar.is-awarded::after { content: ''; position: absolute; left: calc(4px + (var(--river-output-height) - var(--river-award-marker-size)) / 2); top: 50%; width: var(--river-award-marker-size); height: var(--river-award-marker-size); transform: translateY(-50%); -webkit-mask: var(--river-award-mask) center / contain no-repeat; mask: var(--river-award-mask) center / contain no-repeat; background: var(--river-award-gradient); }
.river-award-ribbon { position: absolute; left: 50%; top: 50%; z-index: 0; width: 16px; height: 9px; transform: translateX(-50%) scale(var(--river-ribbon-scale, 1)); transform-origin: 50% 0; pointer-events: none; }
.river-award-ribbon::before, .river-award-ribbon::after { content: ''; position: absolute; top: 0; width: 5px; height: 9px; background: var(--river-ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); transform-origin: 50% 0; }
.river-award-ribbon::before { left: 3px; transform: rotate(22deg); }
.river-award-ribbon::after { right: 3px; transform: rotate(-22deg); }
.river-star-symbol { position: relative; z-index: 1; display: inline-block; width: 1em; height: 1em; -webkit-mask: var(--river-award-mask) center / contain no-repeat; mask: var(--river-award-mask) center / contain no-repeat; background: var(--river-award-gradient); }
.river-output-bar:hover { background: #252a300d; }
.river-output-bar:focus-visible { z-index: 2; }
.river-symbol-legend { display: flex; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.river-symbol-legend>li { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 24px; }
.river-symbol-legend .river-legend-trigger { gap: 6px; white-space: nowrap; }
.river-symbol-legend .river-key { margin-inline: 2px; }
.river-event-columns { align-self: end; min-height: calc(var(--river-event-rows) * var(--river-unit-pitch) + 8px); padding-block: 4px; }
.river-event-column { display: flex; flex-direction: column-reverse; align-items: center; }
.river-star { --river-ribbon-scale: 1.25; display: grid; place-items: center; width: var(--river-unit-pitch); height: var(--river-unit-pitch); color: var(--river-gold); text-shadow: 0 0 4px #ffd65b99; font-size: 20px; line-height: 1; }
.river-star:hover { color: var(--river-gold); text-decoration: none; }
.river-funding { padding-top: 12px; padding-bottom: 12px; }
.river-fiscal-note { max-width: 320px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; text-align: right; }
.river-grants { position: relative; height: calc(var(--river-grant-lanes) * var(--river-grant-pitch)); }
.river-grant-row { position: absolute; inset-inline: 0; top: calc(var(--river-grant-lane) * var(--river-grant-pitch)); height: 34px; pointer-events: none; }
.river-grant { --river-stroke: var(--river-funding); position: absolute; display: flex; align-items: flex-end; justify-content: center; height: 34px; min-width: 0; color: var(--ink); line-height: 1.5; pointer-events: auto; }
.river-grant::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; border-radius: 999px; background: var(--river-stroke); }
.river-grant.co_investigator { --river-stroke: var(--river-funding-other); }
.river-grant-label { display: block; min-width: 0; margin-bottom: 9px; padding-inline: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.river-grant:hover { text-decoration: none; color: var(--accent); }
.river-grant.unknown-end { width: 4px; }
.river-grant.unknown-end::after { left: 0; right: auto; width: 4px; height: 8px; }
.river-career-period { --river-stroke: var(--river-career-color); color: var(--ink); }
.river-career-period[data-career-kind="education"] { --river-career-color: var(--river-education); }
.river-career-period[data-career-kind="work"] { --river-career-color: var(--river-work); }
.river-career-label { position: absolute; left: 50%; bottom: 9px; width: max-content; transform: translateX(-50%); white-space: nowrap; }
.river-career-period:hover { color: var(--accent); }
.river-career-period:hover .river-career-label { text-decoration: underline; text-underline-offset: 3px; }
.river-tooltip { position: fixed; z-index: 100; display: grid; gap: 8px; width: max-content; max-width: min(560px, calc(100vw - 24px)); padding: 12px 14px; border: 1px solid #455160; border-radius: 5px; background: var(--ink); color: #fff; box-shadow: 0 4px 18px #15244430; font-size: inherit; line-height: 1.5; font-weight: 400; text-align: left; white-space: normal; pointer-events: none; overflow-wrap: anywhere; }
.river-tooltip[hidden] { display: none; }
.river-legend-tooltip { background: white; color: var(--ink); border-color: var(--line); }
.river-legend-tooltip .river-counts { margin: 0; gap: 12px; font-size: inherit; }
.river-annual-tooltip table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.river-annual-tooltip caption { padding-bottom: 8px; color: var(--ink); font-weight: 600; text-align: left; }
.river-annual-tooltip th, .river-annual-tooltip td { padding: 4px 8px; font-weight: 400; text-align: right; }
.river-annual-tooltip thead th { color: var(--muted); white-space: nowrap; }
.river-annual-tooltip th:first-child { padding-left: 0; text-align: left; white-space: normal; }
.river-annual-tooltip td { min-width: 3ch; }
.river-tooltip strong { font-weight: 600; }
.river-figure figcaption { padding-top: 14px; color: var(--muted); }
.river-notes { margin-top: 12px; font-size: inherit; }
.river-notes summary { cursor: pointer; width: fit-content; }
.river-table-wrap { overflow-x: auto; }
.river-table-wrap table { width: 100%; border-collapse: collapse; font-size: inherit; }
.river-table-wrap th, .river-table-wrap td { padding: 8px 12px; text-align: right; white-space: nowrap; }
.river-table-wrap th:first-child { text-align: left; }
.river-table-wrap td[data-chart-count] { background: color-mix(in srgb, var(--river-international) calc(55% * var(--river-count-intensity)), white); color: var(--ink); }
.river-table-wrap td[data-chart-count="0"] { color: var(--muted); }
.river-count-scale { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 12px 0 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.river-count-ramp { display: block; width: 96px; height: 10px; background: linear-gradient(to right, white, color-mix(in srgb, var(--river-international) 55%, white)); }
.river-count-scale[data-chart-count-max="0"] .river-count-ramp { background: white; }
.river-credit { display: block; font-size: 11px; line-height: 1.6; text-align: right; color: var(--muted); }
.river-credit a { color: inherit; }
@media(max-width:600px) { .river-scroll { padding: 12px; } }
