/* css/side.css: the side pane beside the stage: its tabs; the Events tab (toolbar, pickers, table); the Alerts and Stills
   tabs (a bar, the alerts table, the stills grid and its View… picture). The tabs were moved verbatim from style.css (UI
   plan step 20d); the rest is 20f's. */

/* ---------- side panel ------------------------------------------------- */

/* A tab's list (#eventList, #alertList, #stillList): it takes what the tab leaves and scrolls inside itself. */
.list { flex: 1; min-height: 0; overflow-y: auto; }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  position: relative;
  flex: 1; background: none; border: 0; border-bottom: 2px solid transparent;
  /* Top padding reserves the strip where a counter badge sits, so labels line
     up across tabs whether or not one carries a badge. */
  padding: 16px 8px 8px; color: var(--muted); cursor: pointer; font-size: 13px;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* Counter badge ABOVE the label, centred — it never pushes the text around. */
.tabbadge {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  min-width: 16px; padding: 0 4px;
  background: var(--err); color: var(--on-err); border-radius: 9px;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center;
}

.tabpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Events: the toolbar (stage/side/filters.js, follow.js) ---------- */
/* Wide: the filters on row 1, the count and Follow on row 2 of their own, so no label change ever re-wraps the bar
   (the list under it never moves). Below 1000 px one row (css/mobile.css). */
.ev-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); padding: var(--s1) var(--s2); border-bottom: 1px solid var(--line); }
.ev-filters, .ev-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); min-width: 0; }
.ev-status { flex: 1 1 100%; }
.ev-count { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-follow { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--fs-sm); color: var(--muted); }
.ev-tools .tbtn { display: inline-flex; align-items: center; gap: 2px; height: var(--ctl-h-sm); padding: 0 6px; font-size: var(--fs-sm); white-space: nowrap; }
.ev-tools .tbtn svg.i.caret { width: 12px; height: 12px; opacity: .8; }
.ev-tools .ev-score { min-width: 6em; justify-content: center; font-variant-numeric: tabular-nums; }   /* Score and ≥ 0.50 one width, with room */
.ev-tools .ev-alerts[aria-pressed="true"] { background: var(--err-bg); border-color: var(--err-line); color: var(--err-fg); }
.ev-fcount { margin-left: var(--s1); min-width: 16px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--accent);
  color: var(--on-accent); font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; }
@media not all and (max-width: 1000px) { #evFilters { display: none; } }

/* ---------- Events: the table (stage/side/events.js) on the kit's table.dt ---------- */
/* One tbody per day under a sticky header; separate borders, so the sticky cells keep theirs. Fixed columns: a cell
   ellipsizes and its tooltip carries the text; nothing scrolls sideways. */
.dt.ev-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
#eventList { scroll-padding-top: calc(var(--side-head-h) + 22px); }   /* a row focused by ↑ lands under the sticky rows, not behind them */
.ev-table .c-k { width: 18px; }
.ev-table .c-t { width: 72px; }
.ev-table .c-c { width: 26%; }
.ev-table .c-s { width: 50px; }   /* SCORE in the header fits */
.dt.ev-table th { height: var(--side-head-h); padding: 0 var(--s1); z-index: 2; }
.dt.ev-table td { height: var(--side-row-h); padding: 0 var(--s1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt.ev-table .ev-k { padding: 0 0 0 var(--s2); }
.dt.ev-table .ev-day th { top: var(--side-head-h); z-index: 1; height: 22px; padding: 0 var(--s2); background: var(--panel-2);
  font-weight: 400; text-transform: none; letter-spacing: .04em; }
.ev-row { cursor: pointer; }
.ev-row:hover > td { background: var(--panel-2); }
.ev-row.now > td { background: var(--row-now-bg); }
.ev-row.sel > td { background: var(--accent-bg); }
.ev-row.sel > td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.ev-row.now > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }      /* both: the blue ground, the green bar (as before) */
.ev-row:focus { outline: none; }
.ev-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ev-row.alert .kdot { box-shadow: 0 0 0 2px var(--alert-ring); }
.ev-t { font-family: var(--font-mono); color: var(--muted); }
.ev-c, .ev-s { color: var(--muted); }
.dt.ev-table .ev-w { white-space: normal; }
.ev-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--warn);
  font-size: var(--fs-sm); line-height: 1.3; }
.ev-row.has-note > td { vertical-align: top; padding-top: 6px; padding-bottom: 5px; }
.ev-tag { display: inline-block; margin-left: var(--s1); padding: 0 5px; border: 1px solid var(--ok-line); border-radius: var(--radius-pill);
  font-size: 10px; line-height: 14px; letter-spacing: .04em; vertical-align: 1px; }
.ev-tag.alert { color: var(--err-fg); border-color: var(--err-line); text-transform: uppercase; letter-spacing: .06em; }
.ev-tag.obj { color: var(--obj-fg); }
.ev-tag.desc { color: var(--desc-fg); border-color: var(--desc-line); }
.ev-empty { display: grid; justify-items: start; gap: var(--s2); padding: var(--s3); color: var(--muted); font-size: var(--fs-md); }
.ev-empty p { margin: 0; }

/* ---------- Events: the pickers (a popover under its button; the phone's one Filters sheet) ---------- */
.ev-pop .kit-pop-body { padding-top: 0; }
.ev-pop .pick + .pick { margin-top: var(--s2); border-top: 1px solid var(--line); }
.ev-pop .pick-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--s1); padding: var(--s2) 0 var(--s1);
  background: var(--panel); }
.ev-pop .pick-title { margin: 0 auto 0 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ev-pop .pick-state { font-size: var(--fs-sm); color: var(--muted); }
.ev-pop .pick-head .tbtn { padding: 2px 8px; font-size: var(--fs-xs); }
.ev-pop .pick-find { width: 100%; min-width: 0; margin: var(--s1) 0; }
.ev-pop .pick-list { display: grid; gap: 1px; }
.ev-pop .pick-row { display: flex; align-items: center; gap: var(--s1); min-height: 28px; padding: 0 var(--s1); border-radius: var(--radius-sm); }
.ev-pop .pick-row:hover { background: var(--panel-2); }
.ev-pop .pick-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: var(--fs-md); }
.ev-pop .pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-pop .pick-row input { flex: none; width: 16px; height: 16px; margin: 0; }
.ev-pop .pick-only { flex: none; visibility: hidden; padding: 0 6px; border: 0; background: none; color: var(--accent); font: inherit;
  font-size: var(--fs-xs); cursor: pointer; }
.ev-pop .pick-row:hover .pick-only, .ev-pop .pick-row:focus-within .pick-only { visibility: visible; }
@media (hover: none) { .ev-pop .pick-only { visibility: visible; } }
.ev-pop .pick-score { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s2); align-items: center; padding: var(--s1) 0;
  font-size: var(--fs-sm); color: var(--muted); }
.ev-pop .pick-score input { grid-column: 1 / -1; width: 100%; margin: 0; }
.ev-pop .pick-score output { font-family: var(--font-mono); color: var(--text); }
.ev-pop .pick-hint { margin: var(--s1) 0 var(--s2); font-size: var(--fs-xs); color: var(--faint); }
.kit-pop-layer .ev-pop .pick-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* the sheet: two columns of finger rows */
.kit-pop-layer .ev-pop .pick-row { min-height: 40px; }

/* ---------- Alerts and Stills: a tab's bar, the About line ---------- */
/* One line that never wraps, so the list under it never moves; the text gives way first. */
.side-bar { display: flex; align-items: center; gap: var(--s2); min-height: calc(var(--ctl-h) + var(--s2));
  padding: var(--s1) var(--s2); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.side-bar-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.side-bar .tbtn, .side-bar .new-note, .side-bar-count { flex: none; }
.side-bar-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.side-bar .toolbar-search { flex: 1 1 auto; min-width: 0; }
.side-about { padding: var(--s2) var(--s2) 0; }
.side-about .about { margin: 0; }

/* ---------- Alerts (stage/side/alerts.js): a kit table of time, camera, rule, delivery ---------- */
/* 13 px, 30 px rows, one line each (ellipsis; the full text in a title), the kit's sticky head, fixed columns. A new
   alert has the red bar, and a dot that acknowledges it; the selection and the hover still show on it. */
.al-list .dt { table-layout: fixed; font-size: var(--fs-md); }
.al-list .dt th { height: var(--side-head-h); padding: 0 var(--s2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-list .dt td { height: var(--side-row-h); padding: 0 var(--s2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-list > p.empty { margin: 0; padding: var(--s3) var(--s2); }
.al-list > .error-block { margin: var(--s3) var(--s2); }
.al-list:focus { outline: none; }        /* a focus target after the person's own action */
.al-list .dt .al-mark { width: 26px; padding: 0; text-align: center; }
.al-list .dt .al-time { width: calc(var(--fs-md) * 7.4 + var(--s2) + var(--s1)); padding-right: var(--s1); }   /* "Oct 25 22:10" whole */
.al-list .dt .al-cam { width: 18%; }
.al-list .dt .al-deliv { width: 20%; }
.al-list .dt tr.al-new:not([aria-selected="true"]) td { background: var(--unread-bg); }
.al-list .dt tbody tr.clickable:hover td { background: var(--panel-2); }
.al-list .dt tr.al-new td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.al-list .dt tr.al-new .al-go { color: var(--text); font-weight: 600; }
.al-list .dt tr.al-hi .al-rule-t { color: var(--err-fg-hi); }
.al-go, .al-why, .al-ack { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.al-go { color: var(--text-2); font-variant-numeric: tabular-nums; }
.al-why { display: inline-flex; align-items: center; gap: var(--s1); max-width: 100%; }
.al-chan { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--fs-sm); }
.al-why:hover .al-chan, .al-why:focus-visible .al-chan { color: var(--text); text-decoration: underline; }
.al-ack { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-pill); color: var(--ok-fg); }
.al-ack::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--err); }
.al-ack svg.i { position: absolute; width: 16px; height: 16px; opacity: 0; }
.al-ack:hover, .al-ack:focus-visible { background: var(--ok-bg); outline: none; }
.al-ack:hover::before, .al-ack:focus-visible::before { opacity: 0; }
.al-ack:hover svg.i, .al-ack:focus-visible svg.i { opacity: 1; }
.al-list svg.al-clipmark { width: 13px; height: 13px; margin-right: var(--s1); vertical-align: -2px; color: var(--muted); }

/* ---------- Stills (stage/side/stills.js): two columns of the stills kept; a tile goes to its moment, its ⋯ holds the rest ---------- */
/* (rows at their content's height: auto rows would share the pane's height out and crop each tile, its overflow hidden) */
.stills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: var(--s2); align-content: start;
  padding: var(--s2) var(--s2) var(--s4); }
.stills-grid > p.empty, .stills-grid > .error-block { grid-column: 1 / -1; margin: 0; }
.still-tile { position: relative; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.still-tile:hover { border-color: var(--line-2); }
.still-tile:focus-within { border-color: var(--accent); }
.still-go { display: block; width: 100%; padding: 0 0 var(--s2); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.still-go:focus-visible { outline: none; }
.still-pic { display: block; aspect-ratio: 4 / 3; background: var(--black); }   /* (aspect-ratio: Chromium 88; the TV never shows the side pane) */
.still-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }   /* a crop keeps its own shape: never fill */
/* no browser image menu or text selection on a long press: the tile's own menu opens (stage/side/stills.js) */
.still-tile, .still-pic img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.still-name { display: block; padding: var(--s1) var(--s2) 0; font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.still-when { display: block; padding: 0 var(--s2); font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.still-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 2px var(--s2) 0;
  font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
.still-note.none { color: var(--faint); font-style: italic; }
/* An editable description (stills.js editNote): its own button under the picture's; a click opens the box in its place */
.still-tile.editable .still-go { padding-bottom: 0; }
.still-note-btn { display: block; width: 100%; padding: 0 0 var(--s2); border: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: text; }
.still-note-btn:hover .still-note, .still-note-btn:focus-visible .still-note { background: var(--panel-3); border-radius: var(--radius-sm); }
.still-note-btn:focus-visible { outline: none; }
.still-note-edit { display: block; padding: 2px var(--s1) var(--s2); }
.still-note-edit textarea { display: block; width: 100%; resize: vertical; font: inherit; font-size: var(--fs-sm); }
.still-note-hint { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.still-tile .still-more { position: absolute; top: var(--s1); right: var(--s1); display: inline-grid; place-items: center; width: 26px; height: 26px;
  padding: 0; background: var(--scrim); border-color: transparent; }
.still-tile .still-more:hover { background: var(--panel-3); }
.still-tile .still-more svg.i { width: 16px; height: 16px; }
/* View…: the still's picture is a zoom surface (js/stage/zoom.js: wheel, pinch, drag, its .zoombar), clipped to its box */
/* clipped by clip-path, not overflow: an overflow-hidden figure shrank to the dialog body and cut the still's bottom off */
.still-view { position: relative; margin: 0; clip-path: inset(0 round var(--radius)); border-radius: var(--radius); touch-action: none; user-select: none; }
.still-view.zoomed { cursor: grab; }
.still-view.grabbing { cursor: grabbing; }
.still-view img { display: block; width: 100%; max-height: 64vh; object-fit: contain; background: var(--black); transform-origin: 0 0;
  image-rendering: pixelated; }
