/* Pipeline: the weekly read as a live track of six stations, then the sites, the log, the
   machines and recent reads. Chartreuse marks what is live (rings, flow, the reading sites);
   it is never text. */

.pl-hero { background: radial-gradient(120% 140% at 15% 0%, #12483f 0%, var(--pine) 55%, #072823 100%); color: #fff; }
.pl-in { max-width: 1240px; margin: 0 auto; padding: 30px 20px 22px; }
.pl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.pl-head h1 { color: #fff; font-size: 2.3rem; margin: 0; }
.pl-say { font-family: var(--serif); font-size: 1.22rem; line-height: 1.5; color: #e6efe9; max-width: 46em; margin: 6px 0 0; min-height: 1.5em; }
.pl-clock { text-align: right; flex: none; }
.pl-clock b { display: block; font-family: var(--serif); font-size: 2.1rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.pl-clock span { font-size: 0.8rem; color: #9fbcb1; }

/* the track */
.pl-track { list-style: none; margin: 34px 0 6px; padding: 0; display: flex; align-items: flex-start; }
.pl-st { flex: none; width: 128px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pl-end { flex: none; padding-top: 19px; }
.pl-pill { display: inline-block; border: 1px solid rgba(162, 205, 156, .45); color: #d9e8df; border-radius: 999px; padding: 4px 11px; font-size: 0.8rem; white-space: nowrap; text-decoration: none; }
a.pl-pill:hover { border-color: var(--chartreuse); color: #fff; }
#pl-out[data-ready] .pl-pill { background: var(--chartreuse); color: var(--pine); border-color: var(--chartreuse); font-weight: 700; }

.pl-seg { flex: 1; min-width: 14px; height: 4px; margin-top: 32px; position: relative; background: rgba(255, 255, 255, .13); border-radius: 2px; overflow: hidden; }
.pl-seg.is-done { background: rgba(162, 205, 156, .55); }
.pl-seg i { position: absolute; top: -1px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--chartreuse); opacity: 0; }
.pl-seg.is-flow i { animation: pl-run var(--dur, 1.8s) linear infinite; box-shadow: 0 0 8px rgba(183, 201, 88, .9); }
.pl-seg.is-flow i:nth-child(2) { animation-delay: calc(var(--dur, 1.8s) * -0.2); }
.pl-seg.is-flow i:nth-child(3) { animation-delay: calc(var(--dur, 1.8s) * -0.4); }
.pl-seg.is-flow i:nth-child(4) { animation-delay: calc(var(--dur, 1.8s) * -0.6); }
.pl-seg.is-flow i:nth-child(5) { animation-delay: calc(var(--dur, 1.8s) * -0.8); }
@keyframes pl-run { 0% { left: -6px; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

.pl-ring { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--chartreuse) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .14) 0); transition: background .6s; }
.pl-core { width: 56px; height: 56px; border-radius: 50%; background: var(--pine); display: grid; place-items: center; }
.pl-glyph { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: #9fbcb1; font-variant-numeric: tabular-nums; }
.pl-glyph svg { width: 22px; height: 22px; display: block; }
.pl-name { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; margin-top: 10px; color: #fff; line-height: 1.2; }
.pl-where { font-size: 0.74rem; color: #9fbcb1; margin-top: 2px; line-height: 1.3; }
.pl-metric { font-size: 0.86rem; color: #f2f7f3; font-weight: 600; margin-top: 7px; line-height: 1.3; min-height: 1.1em; }
.pl-sub { font-size: 0.76rem; color: #b9cfc6; line-height: 1.3; }

.pl-st[data-state="waiting"] .pl-name { color: #b9cfc6; }
.pl-st[data-state="done"] .pl-ring { background: var(--sage); }
.pl-st[data-state="done"] .pl-core { background: #134a41; }
.pl-st[data-state="done"] .pl-glyph { color: var(--sage); }
.pl-st[data-state="active"] .pl-ring::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--chartreuse); animation: pl-pulse 2.2s ease-out infinite; }
.pl-st[data-state="active"] .pl-glyph { color: #fff; font-size: 1rem; }
@keyframes pl-pulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.28); opacity: 0; } }
.pl-st[data-state="failed"] .pl-ring, .pl-st[data-state="stopped"] .pl-ring { background: var(--rose); }
.pl-st[data-state="failed"] .pl-glyph, .pl-st[data-state="stopped"] .pl-glyph { color: #f3c9d3; }
.pl-st[data-state="skipped"] .pl-ring { background: transparent; border: 2px dashed rgba(255, 255, 255, .3); }
.pl-meta { font-size: 0.8rem; color: #9fbcb1; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pl-meta b { color: #e6efe9; font-weight: 600; }

@media (max-width: 900px) {
  .pl-head { flex-direction: column; }
  .pl-clock { text-align: left; }
  .pl-track { flex-direction: column; align-items: stretch; margin-top: 22px; }
  .pl-st { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; column-gap: 14px; }
  .pl-st .pl-ring { width: 52px; height: 52px; flex: none; }
  .pl-st .pl-core { width: 42px; height: 42px; }
  .pl-st .pl-name { margin: 0; flex: 1; }
  .pl-st .pl-where, .pl-st .pl-metric, .pl-st .pl-sub { flex-basis: 100%; padding-left: 66px; margin: 0; }
  .pl-end { padding: 0; }
  .pl-seg { flex: none; width: 4px; height: 22px; margin: 4px 0 4px 24px; min-width: 0; }
  .pl-seg i { left: -1px; top: 0; }
  .pl-seg.is-flow i { animation-name: pl-down; }
  @keyframes pl-down { 0% { top: -6px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
}

/* the sites */
.pl-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pl-h h2 { margin-bottom: 0.3rem; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); margin: 4px 0 12px; }
.pl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--line); }
.lg.reading { background: var(--chartreuse); }
.lg.quiet { background: #c9d6c5; }
.lg.done { background: var(--pine-deep); }
.lg.waiting { background: transparent; border: 1.5px dashed #a9b5ae; }
.lg.missed { background: var(--rose); }
.pl-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.pl-site { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--line)); border-radius: 6px; padding: 7px 9px 8px; min-width: 0; text-decoration: none; color: var(--ink); display: block; }
.pl-site:hover { border-color: var(--accent); border-left-color: var(--c); }
.pl-site b { display: block; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-site .pl-bar { display: block; height: 5px; background: var(--band); border-radius: 3px; margin: 6px 0 4px; overflow: hidden; position: relative; }
.pl-site .pl-bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--pine-deep); border-radius: 3px; transition: width .8s ease; }
.pl-site .n { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 6px; }
.pl-site[data-state="reading"] { box-shadow: 0 0 0 1px var(--chartreuse); }
.pl-site[data-state="reading"] .bar i { background: linear-gradient(90deg, var(--accent), var(--chartreuse), var(--accent)); background-size: 200% 100%; animation: pl-sheen 1.6s linear infinite; }
@keyframes pl-sheen { to { background-position: -200% 0; } }
.pl-site[data-state="quiet"] .bar i { background: #9fb5a8; }
.pl-site[data-state="waiting"] { border-style: dashed; border-left-style: solid; background: transparent; }
.pl-site[data-state="waiting"] b { color: var(--muted); }
.pl-site[data-state="missed"] .bar { background: var(--rose-soft); }
.pl-site[data-state="failed"] { box-shadow: 0 0 0 1px var(--rose); }
.pl-site[data-state="failed"] .pl-bar { background: var(--rose-soft); }
.pl-site[data-state="failed"] .n span:last-child { color: var(--rose); font-weight: 600; }
.pl-site[data-state="none"] { opacity: .55; }

/* log and machines */
.pl-cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 960px) { .pl-cols { grid-template-columns: 1fr; gap: 0; } }
.pl-follow { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer; }
.pl-follow[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--pine-deep); }
.pl-log { background: #082621; color: #cfe0d6; border-radius: 10px; padding: 12px 14px; height: 440px; overflow: auto; font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.pl-log:focus-visible { outline: 2px solid var(--chartreuse); }
.pl-log .ln { display: block; }
.pl-log .t { color: #7f9c91; }
.pl-log .firm { color: var(--sage); }
.pl-log .money { color: #e3ec9f; }
.pl-log .warn { color: #f1c27a; }
.pl-log .bad { color: #f19ab0; }
.pl-log .stage { color: #fff; font-weight: 700; }
.pl-log .empty { color: #7f9c91; font-family: var(--sans); font-size: 0.9rem; }

.pl-mach { list-style: none; margin: 0; padding: 0; }
.pl-mach li { padding: 11px 0 12px 20px; border-bottom: 1px solid var(--line); position: relative; }
.pl-mach li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-mach li.off::before { background: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
.pl-mach b { font-family: var(--serif); font-size: 1.02rem; color: var(--pine-deep); }
.pl-mach .role { display: block; color: var(--ink-soft); font-size: 0.86rem; }
.pl-mach .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pl-meter { display: inline-flex; align-items: center; gap: 6px; }
.pl-meter i { width: 64px; height: 5px; border-radius: 3px; background: var(--band); position: relative; overflow: hidden; }
.pl-meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent); }
.pl-meter.hot i::after { background: var(--amber); }
.pl-chip { display: inline-block; background: var(--accent-soft); color: var(--pine-deep); border-radius: 5px; padding: 1px 7px; font-size: 0.78rem; }
.pl-next li { padding: 3px 0; }

/* recent reads */
.pl-hist { display: grid; gap: 2px; }
.pl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 260px; gap: 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.pl-row .when b { display: block; color: var(--pine-deep); }
.pl-row .when span { color: var(--muted); font-size: 0.8rem; }
.pl-row .gantt { height: 14px; display: flex; border-radius: 4px; overflow: hidden; background: var(--band); }
.pl-row .gantt i { display: block; height: 100%; }
.pl-row .gantt i.plain { background: var(--pine-deep); opacity: .75; }
.pl-row .gantt i.failed { background: var(--rose) !important; }
.pl-row .nums { display: flex; gap: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; justify-content: flex-end; flex-wrap: wrap; }
.pl-row.running .gantt { box-shadow: 0 0 0 1px var(--chartreuse); }
@media (max-width: 760px) { .pl-row { grid-template-columns: 1fr; gap: 4px; } .pl-row .nums { justify-content: flex-start; } }
.s-read { background: #245a7a; } .s-index { background: #2a7f86; } .s-label { background: #5b4b8a; }
.s-extract { background: #40803c; } .s-merge { background: #b06a00; } .s-weigh { background: #4256ab; } .s-publish { background: #9a3b52; }

/* how the read was spent: one row per way a page was handled; the number is always written */
.pl-how { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 4px; }
.pl-how li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 4.5rem 3rem; gap: 10px; align-items: center; font-size: 0.9rem; }
.pl-how .bar { height: 10px; background: var(--band); border-radius: 5px; overflow: hidden; }
.pl-how .bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.pl-how b { text-align: right; }
.pl-how-firms table { border-collapse: collapse; width: 100%; margin-top: 6px; }
.pl-how-firms th, .pl-how-firms td { text-align: right; padding: 3px 8px; border-bottom: 1px solid var(--line); }
.pl-how-firms th:first-child, .pl-how-firms td:first-child { text-align: left; }
.pl-bad { color: var(--rose); }
@media (max-width: 640px) { .pl-how li { grid-template-columns: minmax(0, 1fr) 4rem 2.6rem; } .pl-how .bar { display: none; } }
