/* CEO Pipeline River, round 5 (owner Nov 3 11:30 and 11:45): an aquarium window.
   The band is FULLY transparent glass: no fill, no blur, only a thin glass border and a soft inner highlight, so the sea and its
   fish show through it. Text stays readable through a text halo on labels and numbers only (contrast >= 4.5:1, measured).
   Eight equal columns; in every column the alert badge, node, step + name, figure and label sit on the column's own axis,
   each on its own fixed row (badge row, channel row, name row, figure row, label row). Loaded last. The water itself is drawn
   by ceo-river.js on the canvas #rvNet behind the nodes. */
html body #main .card.river {
  --rv-badge: 24px; --rv-gap: 6px; --rv-chan: 120px; --rv-node-y: 19px; --rv-stage-y: 38px; --rv-name: 26px; --rv-val: 34px; --rv-lab: 20px; --rv-node: var(--platform-accent);
  --rv-halo: 0 0 1px rgba(1,26,38,1), 0 0 3px rgba(1,26,38,.95), 0 0 7px rgba(1,26,38,.9), 0 0 14px rgba(1,26,38,.75), 0 0 26px rgba(1,26,38,.5);
  --rv-border: rgba(150,255,245,.55);
  --rv-shadow: inset 0 1px 1px rgba(216,255,255,.55), inset 0 0 18px rgba(83,255,249,.16), 0 0 3px rgba(63,255,253,.55);
  --rv-chip: rgba(2,28,40,.62);
  background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border: 1px solid var(--rv-border) !important; box-shadow: var(--rv-shadow) !important;
  padding: var(--r4-pad); gap: 8px; display: flex; flex-direction: column; overflow: hidden;
}
html[data-theme=light] body #main .card.river {
  --rv-halo: 0 0 1px #fff, 0 0 3px rgba(255,255,255,.98), 0 0 7px rgba(255,255,255,.95), 0 0 14px rgba(255,255,255,.8), 0 0 26px rgba(255,255,255,.55);
  --rv-border: rgba(255,255,255,.75); --rv-chip: rgba(255,255,255,.82);
  --rv-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 0 18px rgba(255,255,255,.35), 0 0 12px rgba(120,225,240,.3);
}
html[data-theme=dark] body #main .card.river {
  --rv-halo: 0 0 1px #000, 0 0 3px rgba(0,0,0,.95), 0 0 7px rgba(0,0,0,.9), 0 0 14px rgba(0,0,0,.75), 0 0 26px rgba(0,0,0,.5);
  --rv-border: rgba(255,170,100,.6); --rv-chip: rgba(10,8,6,.5);
  --rv-shadow: inset 0 1px 1px rgba(255,214,176,.4), inset 0 0 18px rgba(244,121,32,.1), 0 0 8px rgba(244,121,32,.25);
}
html body #main .river .ch { margin: 0; padding: 0; min-height: var(--r4-chip); }
html body #main .river .ch :is(h2, .eyebrow, .rlegend, .rlegend li) { text-shadow: var(--rv-halo); }
html body #main .river .ch .eyebrow { color: var(--platform-ink); }

/* ---- band geometry ---- */
html body #main .river .rv { min-height: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-chan)); position: relative; margin: 0; padding-top: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-stage-y)); -webkit-mask-image: none; mask-image: none; }
@media (min-width: 1280px) { html body #main .river .rv { overflow: visible; } }
html body #main .river .rv-water { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-chan)); z-index: 4; pointer-events: none; }
html body #main .river #rvNet { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-chan)); z-index: 2; pointer-events: none; }
html body #main .river .rv-chan { position: absolute; left: 0; right: 0; top: calc(var(--rv-badge) + var(--rv-gap)); height: var(--rv-chan); }

/* ---- nodes: one per column, centred on the column axis, on the channel's upper line; the names, figures and labels stand on the wide band under them ---- */
html body #main .river .rnode { position: absolute; top: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-node-y)); width: 22px; height: 22px; margin: -11px 0 0 -11px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid var(--rv-node); background: radial-gradient(circle, var(--rv-node) 0 30%, transparent 34%), rgba(2,28,40,.32); box-shadow: 0 0 10px color-mix(in srgb, var(--rv-node) 65%, transparent); z-index: 5; }
html[data-theme=light] body #main .river .rnode { background: radial-gradient(circle, var(--rv-node) 0 30%, transparent 34%), rgba(255,255,255,.7); }
html body #main .river .rnode.bn { --rv-node: var(--warn); }
html body #main .river .rnode.bn::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--warn); opacity: 0; animation: rv-pool 2.8s ease-out infinite; }
@keyframes rv-pool { 0% { transform: scale(.55); opacity: .75; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---- alert badges: their own row above the channel, centred on the column axis, never wider than the column ---- */
html body #main .river .rv-water .flag { position: absolute; top: 0; transform: translateX(-50%); height: var(--rv-badge); box-sizing: border-box; max-width: calc(100% / 8 - 14px); display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 0 10px; margin: 0; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; color: var(--warn); background: var(--rv-chip) !important; border: 1px solid color-mix(in srgb, var(--warn) 65%, transparent);
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; text-shadow: none; pointer-events: auto; }
html body #main .river .rv-water .flag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html body #main .river .rv-water .flag .ic { flex: none; width: 14px; height: 14px; --ic-size: 14px; }
html body #main .river .rv-water .flag.review { color: var(--platform-ink); border-color: var(--platform-row-line); cursor: pointer; font-family: inherit; }

/* ---- the eight stage columns ---- */
html body #main .river .stages { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 0; padding: 0; background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border-radius: 0; }
html body #main .river .stages > li { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; }
html body #main .river .stages > li::before { display: none; }
html body #main .river .stages button { width: 100%; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--rv-name) var(--rv-val) var(--rv-lab); justify-items: center; align-items: center; align-content: start; row-gap: 0; padding: 0 4px; margin: 0; border-radius: 10px; position: relative; text-shadow: var(--rv-halo); }
html body #main .river .stages button .sh { grid-row: 1; grid-column: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; max-width: 100%; }
html body #main .river .stages button .num { flex: none; width: 22px; height: 22px; margin: 0; font-size: 12px; background: var(--rv-chip); text-shadow: none; }
html body #main .river .stages button .sn { min-width: 0; max-width: 100%; font-size: 14px; line-height: 1; font-weight: 700; white-space: nowrap; }
html body #main .river .stages button .sv { grid-row: 2; grid-column: 1; margin: 0; font-size: 26px; line-height: 1; font-weight: 780; max-width: 100%; }
html body #main .river .stages button .sv.none { font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--platform-muted); }
html body #main .river .stages button .sl.queue-label { grid-row: 3; grid-column: 1; margin: 0; font-size: 13px; font-weight: 600; line-height: var(--rv-lab); color: var(--platform-ink); opacity: .92; }
/* The median and the period's completed flow stay in the tooltip and for screen readers (they exist for only some stages, so they never break the rows). */
html body #main .river .stages button :is(.sa, .sf, .sl:not(.queue-label)) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html body #main .river .stages li.bn .sv { color: #ffd274; }
html[data-theme=light] body #main .river .stages li.bn .sv { color: #8f4d00; }
html[data-theme=light] body #main .river .rv-water .flag { color: #8f4d00; }
html[data-theme=dark] body #main .river .stages li.bn .sv { color: #ffb05a; }
html body #main .river .stages button:hover:not(:disabled), html body #main .river .stages button:focus-visible { background: color-mix(in srgb, var(--platform-accent) 10%, transparent); }

/* ---- selected stage pin sits on the node ---- */
html body #main .river .rpin { top: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-node-y) - 24px); z-index: 6; }
html body #main .river .rpin::before { display: none; }
html body #main .river .stages:not(:empty) + .stages-sk { display: none; }
html body #main .river .stages-sk { top: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-stage-y)); left: 0; right: 0; padding: 0; }

/* ---- compact: short screens and narrower desktops ---- */
@media (min-width: 1280px) and (max-height: 940px) {
  html body #main .card.river { --rv-badge: 20px; --rv-gap: 4px; --rv-chan: 100px; --rv-node-y: 16px; --rv-stage-y: 32px; --rv-name: 22px; --rv-val: 28px; --rv-lab: 16px; gap: 4px; }
  html body #main .river .rnode { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  html body #main .river .rv-water .flag { font-size: 11px; padding: 0 8px; }
  html body #main .river .stages button .num { width: 20px; height: 20px; font-size: 11px; }
  html body #main .river .stages button .sn { font-size: 13px; }
  html body #main .river .stages button .sv { font-size: 22px; }
  html body #main .river .stages button .sl.queue-label { font-size: 12px; }
  html body #main .river .rv { padding-top: calc(var(--rv-badge) + var(--rv-gap) + var(--rv-stage-y)); }
}
@media (min-width: 1280px) and (max-width: 1599px) {
  html body #main .river .rv-water .flag { font-size: 10.5px; padding: 0 7px; gap: 4px; }
  html body #main .river .rv-water .flag .ic { display: none; }
  html body #main .river .rv-water .flag { padding: 0 6px; }
  html body #main .river .stages button { padding: 0 2px; }
  html body #main .river .stages button .sh { gap: 6px; }
  html body #main .river .stages button .sn { font-size: 12.5px; }
}
@media (max-width: 1279px) {
  html body #main .card.river { padding: 14px; }
  html body #main .river .rv { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
  html body #main .river .rv > .rv-water, html body #main .river .rv > #rvNet, html body #main .river .rv > .stages, html body #main .river .rv > .stages-sk { min-width: 860px; }
}
@media (prefers-reduced-motion: reduce) { html body #main .river .rnode.bn::after { animation: none; opacity: .5; transform: scale(1); } }

/* One halo for every label and figure (the older amber glow on a bottleneck figure lowered its contrast). */
html body #main .river .stages button :is(.sn, .sv, .sl.queue-label), html body #main .river .stages li.bn .sv { text-shadow: var(--rv-halo); }
