/* eastflows flow map — palette cribbed from gasalpha.com (GitHub-dark family) */
:root {
  --bg:        #0d1117;
  --panel:     #161b22;
  --panel-2:   #1e2530;
  --border:    #21262d;
  --border-2:  #30363d;
  --text:      #e6edf3;
  --text-2:    #c9d1d9;
  --muted:     #8b949e;
  --accent:    #e94560;
  --green:     #3fb950;
  --amber:     #d29922;
  --red:       #f85149;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text-2);
             font-family: var(--font); -webkit-font-smoothing: antialiased; }
/* FULL-HEIGHT COLUMN. <body> is the column: the GasAlpha site nav
   (an nginx SSI include in a .ga-pad) and, in the free 3-day-delayed view, a
   .ga-pad banner come first and keep their natural height; #app takes exactly
   what is left. Nothing here sizes itself to the window: once the nav and
   banner are above it, a 100%/100vh app would overflow the bottom. #app
   scrolls inside when its content is taller (the phone's stacked panels, the
   desk under 900px); the page itself never scrolls. Never rely on #app being
   body's first or second child: the banner adds one more element before it. */
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body > .ga-pad { flex: none; }
#app { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; position: relative;
       overflow-y: auto; overscroll-behavior: contain; }

/* ---------- staleness banner ----------
   Shown by both pages when the newest gas day in the data is older than
   `stale.after_days`. Deliberately loud and at the top of the flex column, above
   the header: a dashboard that has stopped updating is worse than no dashboard,
   because every number on it still looks like a live reading. */
.stale-banner { flex: 0 0 auto; background: var(--red); color: #fff;
                font-size: 13px; font-weight: 600; letter-spacing: .06em;
                text-transform: uppercase; text-align: center;
                padding: 9px 16px; border-bottom: 1px solid #ff8a80; }
.stale-banner[hidden] { display: none; }

/* ---------- header ---------- */
header { flex: 0 0 auto; background: var(--panel); border-bottom: 1px solid var(--border);
         padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: baseline; }
/* cross-links between the three eastflows pages, same on each */
.xnav { display: flex; gap: 14px; align-items: baseline; }
.xnav.push { margin-left: auto; }
.h-scope { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.h-title { font-weight: 600; font-size: 13px; letter-spacing: .04em;
           text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.stat { display: flex; align-items: baseline; gap: 7px; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .v.tight { color: var(--accent); }
.stat .sub { font-size: 11px; color: var(--muted); }
.badge { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
         padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border-2);
         color: var(--muted); white-space: nowrap; }
.badge.prov { color: var(--amber); border-color: rgba(210,153,34,.45);
              background: rgba(210,153,34,.10); }
.badge.settled { color: var(--green); border-color: rgba(63,185,80,.35);
                 background: rgba(63,185,80,.08); }

/* ---------- map ---------- */
#map { flex: 1 1 auto; position: relative; min-height: 0; background: var(--bg); }
.maplibregl-ctrl-attrib { background: rgba(13,17,23,.82) !important; color: var(--muted) !important;
                          font-size: 10px !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

/* ---------- legend ---------- */
#legend { position: absolute; left: 12px; bottom: 34px; z-index: 5; background: rgba(22,27,34,.93);
          border: 1px solid var(--border-2); border-radius: 6px; padding: 9px 11px;
          font-size: 11px; line-height: 1.7; backdrop-filter: blur(4px); max-width: 210px; }
#legend .lg-title { font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
                    color: var(--muted); margin-bottom: 5px; }
#legend .row { display: flex; align-items: center; gap: 7px; }
#legend .sw { width: 20px; height: 3px; border-radius: 2px; flex: 0 0 auto; }
#legend .sw.dash { height: 0; border-top: 3px dashed currentColor; border-radius: 0; }
#legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
#legend hr { border: 0; border-top: 1px solid var(--border); margin: 7px 0; }

/* ---------- popup ---------- */
.maplibregl-popup-content { background: var(--panel) !important; color: var(--text-2) !important;
   border: 1px solid var(--border-2); border-radius: 7px; padding: 11px 13px !important;
   font-family: var(--font); font-size: 12px; box-shadow: 0 8px 26px rgba(0,0,0,.6);
   box-sizing: border-box; min-width: min(320px, calc(100vw - 32px));
   max-width: min(420px, calc(100vw - 32px)); }
.maplibregl-popup-tip { border-top-color: var(--border-2) !important;
                        border-bottom-color: var(--border-2) !important; }
.maplibregl-popup-close-button { color: var(--muted) !important; font-size: 16px; }
.pop-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pop-h .t { font-weight: 600; color: var(--text); font-size: 13px; line-height: 1.3;
             padding-right: 14px; /* the close button */
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-pipe { color: var(--muted); font-size: 10.5px; margin: 2px 0 6px; }
.pop-util { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pop-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 7px 0; }
.pop-grid .k { color: var(--muted); }
.pop-grid .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.pop-note { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border);
            color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.pop-bind { margin-top: 6px; padding: 5px 7px; border-radius: 4px; font-size: 11px;
            background: rgba(233,69,96,.11); border: 1px solid rgba(233,69,96,.32); color: #ffb3c0; }
.spark { margin-top: 8px; }
.spark-lbl { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.pop-flags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

/* ---------- footer ---------- */
footer { flex: 0 0 auto; background: var(--panel); border-top: 1px solid var(--border);
         padding: 7px 16px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

@media (max-width: 720px) {
  header { padding: 8px 11px; gap: 6px 16px; }
  .stat .v { font-size: 16px; }
  .h-title { width: 100%; }
  #legend { left: 8px; bottom: 30px; font-size: 10px; max-width: 160px; padding: 7px 9px; }
  footer { font-size: 9.5px; padding: 6px 11px; }
}

/* ===================== trader workstation additions ===================== */
#body { flex: 1 1 auto; display: flex; min-height: 0; }
#map { flex: 1 1 auto; }
header .push { margin-left: auto; }
#side-toggle { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border-2);
               border-radius: 5px; font-size: 14px; line-height: 1; padding: 5px 9px;
               cursor: pointer; }
#side-toggle:hover { color: var(--text); }
.stat .v.alert { color: var(--accent); }
.stat .v.alert.zero { color: var(--muted); }

/* ---- side panels ---- */
#side { flex: 0 0 322px; display: flex; flex-direction: column; background: var(--panel);
        border-left: 1px solid var(--border); min-height: 0; }
#side.hidden { display: none; }
.panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 50%;
         border-bottom: 1px solid var(--border); }
.panel:last-child { border-bottom: 0; flex: 0 0 40%; }
.panel-h { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: baseline;
           padding: 8px 11px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
           text-transform: uppercase; color: var(--text); border-bottom: 1px solid var(--border); }
.panel-sub { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted);
             font-size: 10.5px; }
.filters { flex: 0 0 auto; display: flex; gap: 5px; padding: 6px 9px; flex-wrap: wrap;
           align-items: center; border-bottom: 1px solid var(--border); }
.filters select { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border-2);
                  border-radius: 4px; font: inherit; font-size: 10.5px; padding: 3px 5px; }
.filters .chk { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ---- notice rows ---- */
.nrow { padding: 7px 11px; border-bottom: 1px solid var(--border); font-size: 11.5px;
        line-height: 1.35; cursor: default; }
.nrow:hover { background: var(--panel-2); }
.nrow.flag { border-left: 2px solid var(--accent); }
.nrow .top { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.nrow .pipe { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
              color: var(--muted); font-weight: 600; }
.nrow .when { font-size: 9.5px; color: var(--muted); margin-left: auto;
              font-variant-numeric: tabular-nums; }
.nrow .subj { color: var(--text-2); }
.nrow.flag .subj { color: var(--text); }
.tag { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 4px;
       border-radius: 3px; border: 1px solid var(--border-2); color: var(--muted); }
.tag.red { color: #ffb3c0; border-color: rgba(233,69,96,.45); background: rgba(233,69,96,.13); }

/* ---- mover rows ---- */
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 6px 11px;
        border-bottom: 1px solid var(--border); font-size: 11.5px; }
.mrow:hover { background: var(--panel-2); }
.mrow .nm { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .d { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mrow .d.up { color: var(--green); }
.mrow .d.dn { color: var(--red); }
.mrow .meta { font-size: 9.5px; color: var(--muted); }
.mrow .meta2 { font-size: 9.5px; color: var(--muted); text-align: right;
               font-variant-numeric: tabular-nums; }

/* ---- map controls ---- */
#controls { position: absolute; left: 10px; top: 10px; z-index: 5; background: rgba(22,27,34,.93);
            border: 1px solid var(--border-2); border-radius: 6px; padding: 8px 10px;
            font-size: 11px; backdrop-filter: blur(4px); }
#controls label { display: flex; align-items: center; gap: 6px; line-height: 1.9; cursor: pointer; }
#controls input { accent-color: #4aa3ff; }
.ctl-title { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em;
             color: var(--muted); margin-bottom: 3px; }
.ctl-note { font-size: 9px; color: var(--muted); margin-top: 4px; max-width: 150px; line-height: 1.35; }
.seg { display: flex; border: 1px solid var(--border-2); border-radius: 4px; overflow: hidden; }
.seg button { flex: 1 1 auto; background: transparent; color: var(--muted); border: 0;
              font: inherit; font-size: 10px; padding: 3px 5px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-2); }
.seg button.on { background: var(--panel-2); color: var(--text); }
.seg button.dim { opacity: .45; cursor: not-allowed; }

@media (max-width: 900px) {
  #side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; flex-basis: 290px;
          box-shadow: -8px 0 24px rgba(0,0,0,.55); }
  #controls { right: 8px; top: 8px; padding: 6px 8px; font-size: 10px; }
}
@media (max-width: 560px) {
  #side { flex-basis: 100%; }
  #controls { font-size: 9.5px; }
}

/* expandable rows: truncated by default, full text when opened or focused */
.nrow .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow.open .subj { white-space: normal; }
.nrow { cursor: pointer; }
.nrow:focus-visible, .mrow:focus-visible { outline: 1px solid var(--border-2);
                                           outline-offset: -1px; }
.mrow { cursor: pointer; }
.mrow.open .nm { white-space: normal; overflow: visible; }

/* cross-link to the schematic view */
.xlink { color: var(--muted); text-decoration: none; font-size: 11px;
         border: 1px solid var(--border-2); border-radius: 5px; padding: 4px 9px;
         white-space: nowrap; }
.xlink:hover { color: var(--text); }

/* the pipeline chip doubles as a filter control */
.nrow .pipe.as-filter { background: transparent; border: 1px solid transparent;
  border-radius: 3px; font: inherit; font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 1px 4px; cursor: pointer; }
.nrow .pipe.as-filter:hover { color: var(--text); border-color: var(--border-2);
                              background: var(--panel-2); }
.mrow[data-note]::after { content: attr(data-note); grid-column: 1 / -1;
  font-size: 9.5px; color: var(--amber); }

/* ---- maintenance calendar + exposure ---- */
#side .panel { flex: 1 1 33%; }
.mini { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border-2);
        border-radius: 4px; font: inherit; font-size: 9.5px; padding: 1px 6px;
        cursor: pointer; margin-left: 6px; }
.mini:hover { color: var(--text); }
.crow { display: grid; grid-template-columns: 46px 1fr; gap: 1px 8px; padding: 6px 11px;
        border-bottom: 1px solid var(--border); font-size: 11.5px; cursor: pointer; }
.crow:hover { background: var(--panel-2); }
.crow.soon { border-left: 2px solid var(--amber); }
.crow.corr { border-left: 2px solid var(--accent); }
.crow .when { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600;
              font-size: 10.5px; }
.crow .days { font-size: 9px; color: var(--muted); }
.crow .subj { color: var(--text-2); overflow: hidden; text-overflow: ellipsis;
              white-space: nowrap; }
.crow.open .subj { white-space: normal; }
.crow .meta { grid-column: 2; font-size: 9.5px; color: var(--muted); }
.crow .qty { color: var(--amber); font-variant-numeric: tabular-nums; }
.erow { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 5px 11px;
        border-bottom: 1px solid var(--border); font-size: 11px; }
.erow .nm { color: var(--text-2); overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; }
.erow .q { text-align: right; font-variant-numeric: tabular-nums; }
.erow .meta { grid-column: 1 / -1; font-size: 9.5px; color: var(--muted); }
.exp-badge { display: inline-block; font-size: 9px; padding: 1px 4px; border-radius: 3px;
             background: rgba(233,69,96,.16); border: 1px solid rgba(233,69,96,.4);
             color: #ffb3c0; margin-left: 6px; cursor: pointer; }

/* ---------- trader view ---------- */
#legend-wrap { position: absolute; left: 12px; bottom: 34px; z-index: 5;
               background: rgba(22,27,34,.93); border: 1px solid var(--border-2);
               border-radius: 6px; font-size: 11px; max-width: 220px; }
#legend-wrap > summary { cursor: pointer; padding: 5px 10px; color: var(--muted);
                         font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
#legend-wrap #legend { position: static; background: none; border: 0; padding: 0 10px 8px;
                       max-width: none; backdrop-filter: none; }
.today-panel { flex: 0 1 auto; max-height: 52%; }
.panel[hidden] { display: none; }   /* .panel's display:flex was overriding [hidden] */
.today-sec { font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
             color: var(--muted); padding: 8px 11px 3px; }
.trow { padding: 6px 11px; border-bottom: 1px solid var(--border); font-size: 12px;
        cursor: pointer; line-height: 1.4; }
.trow:hover { background: var(--panel-2); }
.trow.nomap { cursor: default; }
.trow .tk { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 5px;
            border-radius: 3px; margin-right: 6px; border: 1px solid var(--border-2); }
.trow .tk.bound { color: #f85149; border-color: rgba(248,81,73,.5); }
.trow .tk.rel { color: #3fb950; border-color: rgba(63,185,80,.5); }
.trow .tk.mt { color: #d29922; border-color: rgba(210,153,34,.5); }
.trow .td { display: block; color: var(--muted); font-size: 11px; }
.tnone { padding: 6px 11px; font-size: 11.5px; color: var(--muted); }

/* constraint markers: the visual anchors */
.cm { display: flex; align-items: center; gap: 5px; padding: 2px 7px 2px 4px; border-radius: 12px;
      background: rgba(13,17,23,.9); border: 1.5px solid var(--c, #8b949e); color: #e6edf3;
      font: 600 11px/1.3 var(--font); white-space: nowrap; cursor: pointer;
      box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cm.approx { border-style: dashed; }
.cm .chev { display: inline-block; color: var(--c, #8b949e); font-size: 10px; line-height: 1; }
.cm .u { font-weight: 500; color: var(--c, #8b949e); }
.cm .b { font-size: 9px; letter-spacing: .05em; color: #fff; background: #f85149;
         border-radius: 3px; padding: 0 4px; }
/* hub badges: link to the desk */
.hb { display: block; padding: 3px 8px; border-radius: 4px; text-decoration: none;
      background: rgba(233,69,96,.16); border: 1px solid rgba(233,69,96,.65); color: #fff;
      font: 600 11.5px/1.3 var(--font); white-space: nowrap; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.hb.unv { border-style: dashed; }
.hb:hover { background: rgba(233,69,96,.32); }
#map.zfar .cm .b { display: none; }      /* compact far out: the NAME stays */
#map.zfar .cm { padding: 1px 6px; }

.trow .ti { display: block; font-size: 11px; color: #ffb3c0; }
.trow .ti.unm { color: var(--muted); font-style: italic; }
.standing { padding: 7px 11px; border-bottom: 1px solid var(--border); font-size: 11.5px;
            line-height: 1.4; color: var(--text-2); background: rgba(139,148,158,.06); }
.standing .tk { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 5px;
                border-radius: 3px; margin-right: 6px; border: 1px solid var(--border-2); color: var(--muted); }
.standing .dim, .cm .dim { color: var(--muted); }
/* right-edge clipping: the time column never shrinks or wraps, the row may */
.nrow .top { min-width: 0; flex-wrap: wrap; }
.nrow .when { flex: 0 0 auto; white-space: nowrap; padding-left: 6px; }
.panel-h { gap: 8px; }
.panel-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Dating: every utilization carries its own gas day + cycle,
   and a STALE tag when that gas day is older than the page header's. */
.ds { color: #8b949e; font-weight: 400; white-space: nowrap; }
.stale-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em;
  color: #f0883e; border: 1px solid rgba(240,136,62,.6); border-radius: 3px;
  padding: 0 3px; margin-left: 2px; line-height: 1.35; vertical-align: 1px; }
.cm .ds { font-size: 10px; }
.pop-util .ds { font-size: 11px; }

/* Nomination cycles: header clock, posting tracker, strips */
.cclock { display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.3;
  min-width: 0; max-width: 330px; }
.cclock .cc-day { font-weight: 600; color: #e6edf3; }
.cclock .cc-day.cc-locked { color: #8b949e; }
.cclock .cc-next { color: #d29922; }
.cclock .cc-cut { color: #8b949e; font-size: 10px; }
.tracker-panel details > summary { cursor: pointer; list-style: none; }
.tracker-panel details > summary::-webkit-details-marker { display: none; }
.tr-asof { font-size: 10px; color: #8b949e; padding: 4px 10px; }
.tr-grid { width: calc(100% - 16px); margin: 4px 8px 8px; border-collapse: collapse; font-size: 10.5px; }
.tr-grid th { text-align: left; color: #8b949e; font-weight: 500; padding: 2px 4px; border-bottom: 1px solid #30363d; }
.tr-grid td { padding: 2px 4px; white-space: nowrap; border-bottom: 1px solid rgba(48,54,61,.5); }
.tr-grid .tr-p { color: #c9d1d9; font-weight: 500; }
.tr-posted { color: #3fb950; }
.tr-pending { color: #8b949e; }
.tr-late { color: #f85149; font-weight: 700; }
.tr-unchecked, .tr-na, .tr-none { color: #484f58; }
.cstrip { font-size: 10.5px; color: #c9d1d9; margin: 2px 0; white-space: nowrap; overflow-x: auto; }
.cstrip .cs-gd, .trow .cs-gd { color: #8b949e; margin-right: 5px; }
.cstrip .cs-sep { color: #484f58; margin: 0 3px; }
.cstrip .cs-miss { color: #484f58; }
.cstrip .cs-bound { color: #f85149; font-weight: 600; }
.cstrip .cs-pr { color: #8b949e; font-style: italic; }
.pop-strips { margin-top: 6px; }
.cr-badge { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: #f0883e; border: 1px solid rgba(240,136,62,.55); border-radius: 3px; padding: 0 4px;
  margin: 4px 4px 0 0; }
.trow .tk.tight { color: #f0883e; border-color: rgba(240,136,62,.55); }
@media (max-width: 760px) { .cclock { max-width: none; width: 100%; } }
/* the tracker panel sizes to its content: collapsed it is just its header,
   open it scrolls inside a cap instead of drawing over TODAY */
#side .panel.tracker-panel { flex: 0 0 auto; overflow: hidden; }
.tracker-panel #tracker { max-height: 38vh; overflow-y: auto; }
/* settled history predating the end-of-day fix */
.eod-dag { color: #d29922; }

/* Detail cards: one two-column grid per card. The value column
   is sized to its content and never wraps; labels and prose take what is left. */
.pc-grid { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 3px 12px;
  margin: 6px 0; align-items: baseline; min-width: 0; }
.pc-k { color: var(--muted); min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.pc-v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pc-line { white-space: nowrap; }
.pc-k.pc-big { color: var(--text-2); }
.pc-v.pc-big { font-size: 15px; font-weight: 600; }
.pc-v.pc-big .ds { font-size: 11px; }
.pc-quiet { color: var(--muted) !important; font-size: 11px; }
.pc-quiet .uv.ref, .pc-quiet .ds.ref { color: var(--muted); }
.pc-grid.pc-s1 .pc-v { font-size: 11px; } .pc-grid.pc-s1 .pc-v.pc-big { font-size: 13.5px; }
.pc-grid.pc-s2 .pc-v { font-size: 10px; } .pc-grid.pc-s2 .pc-v.pc-big { font-size: 12px; }
.pc-wide { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pc-sec { grid-column: 1 / -1; color: var(--text); font-weight: 600; line-height: 1.3;
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.pc-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* footnotes: one line, pinned last; full text on hover or tap */
.pc-foot, .eod-note { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border);
  font-size: 10px; color: var(--muted); font-style: normal; line-height: 1.4; }
.pc-foot > summary, .eod-note > summary { cursor: help; list-style: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.pc-foot > summary::-webkit-details-marker, .eod-note > summary::-webkit-details-marker { display: none; }
.pc-foot-full { margin-top: 3px; }
.cor .eod-note { grid-column: 1 / -1; }

/* ===================== BALANCE / OFO ===================== */
/* on a short window BALANCE gives up height before TODAY does (it shrinks
   4x as fast); it scrolls inside its own box */
#side .panel.balance-panel { flex: 0 4 auto; max-height: 30%; min-height: 76px; }
#side .today-panel { flex-shrink: 1; min-height: 120px; }
.bal-row { padding: 7px 11px; border-bottom: 1px solid var(--border); font-size: 11.5px; line-height: 1.4; }
.bal-row.st-in_effect { border-left: 2px solid #f85149; }
.bal-row.st-unclear { border-left: 2px solid #d29922; }
.bal-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; }
.bal-p { color: var(--text); }
.bal-pill { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 0 5px; border-radius: 3px;
  border: 1px solid var(--border-2); color: var(--muted); }
.bal-pill.in { color: #f85149; border-color: rgba(248,81,73,.55); }
.bal-pill.unclear { color: #d29922; border-color: rgba(210,153,34,.55); }
.bal-pill.none { color: #3fb950; border-color: rgba(63,185,80,.4); }
.bal-dir { color: var(--text-2); }
.bal-tol { color: var(--text); font-variant-numeric: tabular-nums; }
.bal-sub { color: var(--muted); font-size: 11px; }
.bal-chg { font-size: 11px; margin-top: 2px; color: var(--text-2); }
.bal-chg.tight { color: #ff9b94; } .bal-chg.ease { color: #7ee2a0; }
.bal-list > summary { cursor: pointer; color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.bal-item { display: block; color: var(--text-2); text-decoration: none; font-size: 11px; padding: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-item.new { color: var(--text); }
.bal-item:hover { text-decoration: underline; }
.bal-k { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bal-w { color: var(--muted); font-size: 10px; }
.trow .bal-link { color: var(--muted); font-size: 11px; }

/* ===================== PHONE =====================
   390px is a first-class layout: the page scrolls vertically, the map comes
   first at a fixed height, and TODAY / BALANCE / NOTICES / MAINTENANCE stack
   below it instead of sliding over it. Every control is at least 44px tall;
   chips keep a 30px look with a 44px tap area. Chip placement is done in the
   browser at the real size (flowmap.js layoutPhone). */
.ctl-sum { cursor: pointer; font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); list-style: none; }
.ctl-sum::-webkit-details-marker { display: none; }
.cm-more { font-size: 10px; font-weight: 700; color: var(--bg); background: var(--text-2);
  border-radius: 8px; padding: 0 5px; margin-left: 2px; }
.grp-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.grp-row { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 6px; color: var(--text);
  font: 600 12px/1.3 var(--font); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; }
.grp-row .chev, .grp-row .b, .grp-row .cm-more { display: none; }
.grp-row .u { color: var(--text-2); }
@media (max-width: 600px) {
  /* the phone page grows with its content, now inside #app's own scroller: nothing in it may shrink to fit under the site nav */
  #app > * { flex-shrink: 0; }
  header { padding: 8px 12px; gap: 6px 14px; }
  header .stat { flex-wrap: wrap; }
  header .stat.push { margin-left: 0; }
  .xnav { width: 100%; gap: 8px; }
  .xnav.push { margin-left: 0; }
  .xlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 13px; }
  #side-toggle { display: none; }
  #body { flex: 0 0 auto; flex-direction: column; }
  #map { flex: 0 0 auto; height: 68vh; min-height: 420px; max-height: 640px; }
  #side, #side.hidden { display: flex; position: static; flex: 0 0 auto; width: 100%; box-shadow: none;
    border-left: 0; border-top: 1px solid var(--border-2); }
  #side .panel, #side .panel:last-child, .today-panel, #side .panel.balance-panel,
  #side .panel.tracker-panel { flex: 0 0 auto; max-height: none; }
  #side .scroll { max-height: 62vh; overflow-y: auto; }
  .tracker-panel #tracker { max-height: 62vh; overflow-x: auto; }
  .panel-h { min-height: 44px; align-items: center; font-size: 12px; }
  .mini { min-height: 44px; padding: 0 12px; font-size: 12px; }
  .filters select { min-height: 44px; font-size: 14px; }
  .filters .chk { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }
  .nrow, .trow, .crow, .mrow, .bal-row, .tnone { min-height: 44px; }
  .nrow .pipe.as-filter { min-height: 32px; }
  .bal-list > summary { min-height: 44px; display: flex; align-items: center; font-size: 12px; }
  .bal-item { min-height: 44px; display: flex; align-items: center; gap: 4px; }
  .trow .bal-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
  /* map overlays */
  #controls { left: 8px; right: auto; top: 8px; padding: 0 10px; font-size: 12px; max-width: calc(100% - 16px); }
  .ctl-sum { min-height: 44px; display: flex; align-items: center; font-size: 11px; }
  .seg button { min-height: 44px; font-size: 12px; padding: 0 10px; }
  #controls label { display: flex; align-items: center; min-height: 44px; gap: 8px; }
  /* above the attribution, which MapLibre shows expanded until first touch */
  #legend-wrap { left: 8px; bottom: 64px; max-width: calc(100% - 80px); }
  #legend-wrap > summary { min-height: 44px; display: flex; align-items: center; }
  .maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
  .maplibregl-popup-close-button { width: 44px; height: 44px; font-size: 22px; }
  /* chips: 30px to look at, 44px to tap */
  /* no position here: a marker is already position:absolute (MapLibre), which
     also anchors the ::before hit area; position:relative stretched every chip
     to the map's full width */
  .cm, .hb { min-height: 30px; font-size: 11px; }
  .cm { gap: 3px; padding: 2px 6px 2px 4px; }
  .cm .ds { font-size: 9.5px; }
  .hb { display: flex; align-items: center; }
  .cm::before, .hb::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px;
    transform: translateY(-50%); }
  footer { font-size: 10.5px; }
}

/* the map library failed to load: the box says so */
.map-down { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%;
  padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--panel);
  color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; }

/* ===== DESKTOP / TABLET RAIL =====
   The rail scrolls as ONE column, as the phone's stacked panels do, instead
   of dividing its height among six small scrollers that cut text mid-line.
   Today, Balance/OFO and Cycle postings show in full; the long lists cap at
   60vh (the phone caps them at 62vh) and scroll inside. Headers stay pinned
   while the rail scrolls, so a trader always sees which panel they are in.
   The map keeps its place on the left. Phone rules (max-width: 600px) are
   untouched: everything here is min-width: 601px. Scoped to the flow
   map's rail (#side.rail): system.html also loads this file and has a #side. */
@media (min-width: 601px) {
  #side.rail { overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
  #side.rail .panel, #side.rail .panel:last-child, #side.rail .today-panel, #side.rail .panel.balance-panel,
  #side.rail .panel.tracker-panel { flex: 0 0 auto; max-height: none; min-height: 0; overflow: visible; }
  #side.rail .scroll { flex: 0 0 auto; max-height: 60vh; overflow-y: auto; }
  #side.rail .today-panel > .scroll, #side.rail .balance-panel > .scroll,
  #side.rail .tracker-panel #tracker { max-height: none; overflow: visible; }
  #side.rail .panel-h { position: sticky; top: 0; z-index: 3; background: var(--panel); }
  #side.rail .tracker-panel summary.panel-h { cursor: pointer; }
  /* the rail is wide enough to show whole subjects and names: wrap them instead of
     cutting them with an ellipsis (; the phone keeps tap-to-expand) */
  #side.rail .nrow .subj, #side.rail .mrow .nm, #side.rail .erow .nm, #side.rail .crow .subj {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  #side.rail .panel-sub { white-space: normal; text-align: right; }
}
/* the rail's width: wide enough for the cycle tracker's table (~570px), so
   no column is hidden; the map takes the rest */
@media (min-width: 901px) {
  #side.rail { flex: 0 0 clamp(600px, 36vw, 680px); }
}
