/* #/entries — owned by views/entries.js: side (site, day, chart, routes) | wall of faces by hour | detail drawer;
   privacy footer. Tokens only. Literal near-black/near-white appear only ON IMAGERY (caption scrims, door zones
   over the camera frame), per public/DESIGN.md. */

.enview { display: grid; grid-template-columns: 296px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.enview.has-sel { grid-template-columns: 296px minmax(0, 1fr) minmax(360px, 440px); }

/* ---- side: site, day, chart, routes --------------------------------------------------------------------------- */
.enside { border-right: 1px solid var(--line); background: var(--surface); overflow: auto; padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-5); }
.entitle { display: flex; flex-direction: column; gap: var(--sp-1); }
.ensite { color: var(--ink-2); font-size: var(--fs-sm); }
.ensum { display: block; }
.ensum > summary { display: none; }
.ensum[open] > section + section { margin-top: var(--sp-5); }
.enday { display: flex; flex-direction: column; gap: var(--sp-2); }
.enday-nav { display: flex; gap: var(--sp-1); align-items: center; }
.enday-nav input[type=date] { flex: 1; min-width: 0; }
.enday-tz { font-size: var(--fs-xs); }
.enquick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-1); }
.enquick button {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: var(--sp-1) 0; min-width: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.enquick button span { font-size: var(--fs-2xs); color: var(--ink-3); line-height: 1.3; white-space: nowrap; }
.enquick button b { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.2; }
.enquick button:hover { background: var(--surface-2); border-color: var(--line-strong); }
.enquick button.on { background: var(--accent-soft); border-color: var(--accent); }
.enquick button.on span { color: var(--ink-2); }

.enchart-wrap { display: flex; flex-direction: column; gap: var(--sp-2); }
.ensegs > button { padding: 2px var(--sp-2); font-size: var(--fs-xs); }
.enchart { position: relative; padding-top: var(--sp-4); }
.enkey { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); }
.enview .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.enview .k-in { background: var(--dir-in); } .enview .k-out { background: var(--dir-out); } .enview .k-inside { background: var(--dir-inside); } .enview .k-unknown { background: var(--dir-unknown); } .enview .k-at_door { background: var(--dir-at-door); }

/* hours: stacked bars on a 1-2-5 grid; bars with entries are buttons (filter to that hour) */
.enview .hplot { position: relative; height: 120px; margin-left: 22px; border-bottom: 1px solid var(--line-strong); }
.enview .hgrid { position: absolute; inset: 0; pointer-events: none; }
.enview .hgl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.enview .hgl span { position: absolute; right: calc(100% + 5px); top: 0; transform: translateY(-50%); font: var(--fs-2xs)/1 var(--font-mono); color: var(--ink-3); }
.enview .hbars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.enview .hbar { display: flex; align-items: flex-end; height: 100%; padding: 0; border: 0; border-radius: var(--r-xs) var(--r-xs) 0 0; background: none; transition: background-color var(--dur-1) var(--ease-out); }
.enview button.hbar:hover { background: var(--surface-3); }
.enview .hbar.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.enview .hstack { display: flex; flex-direction: column-reverse; width: 100%; min-height: 3px; border-radius: 2px 2px 0 0; overflow: hidden; }
.enview .hstack i { display: block; min-height: 2px; }
.enview .hnow { position: absolute; top: calc(-1 * var(--sp-3)); bottom: 0; width: 0; border-left: 1.5px dashed var(--ink-2); pointer-events: none; }
.enview .hnow span { position: absolute; top: -4px; left: 4px; font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-ui); color: var(--ink-2); }
.enview .haxis { position: relative; height: 18px; margin-left: 22px; }
.enview .haxis span { position: absolute; top: 4px; transform: translateX(-50%); font: var(--fs-2xs)/1 var(--font-mono); color: var(--ink-3); }
.enview .haxis span:first-child { transform: none; }
.enview .haxis span:last-child { transform: translateX(-100%); }
.enview .haxis span.minor { top: 0; width: 1px; height: 4px; background: var(--line-strong); }

/* timeline: every entry at its time — in above the line, out below, inside/unknown on it */
.enview .tplot { position: relative; height: 104px; margin-left: 22px; border-bottom: 1px solid var(--line); }
.enview .tlabels span { position: absolute; left: -22px; font: var(--fs-2xs)/1 var(--font-ui); color: var(--ink-3); }
.enview .tlabels span:first-child { top: 18%; } .enview .tlabels span:last-child { top: 72%; }
.enview .tmid { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-strong); }
.enview .tticks { position: absolute; inset: 0; }
.enview .tk { position: absolute; width: 3px; padding: 0; border: 0; border-radius: 2px; transform: translateX(-50%); transition: width var(--dur-1) var(--ease-out); }
.enview .tk::before { content: ""; position: absolute; inset: 0 -4px; }   /* a wider hit area than the mark */
.enview .tk.k-in { bottom: 50%; height: 40%; }
.enview .tk.k-out { top: 50%; height: 40%; }
.enview .tk.k-inside, .enview .tk.k-unknown, .enview .tk.k-at_door { top: 38%; height: 24%; }
.enview .tk.unsure { opacity: .5; }
.enview .tk:hover, .enview .tk:focus-visible { width: 5px; opacity: 1; }
.enview .tk.on { width: 5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); opacity: 1; }
.enview .tplot .hnow { top: calc(-1 * var(--sp-3)); }

.entip {
  position: absolute; top: 0; transform: translateY(-70%); z-index: var(--z-tooltip); pointer-events: none;
  display: flex; flex-direction: column; gap: 1px; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-size: var(--fs-xs); white-space: nowrap;
}
.entip[hidden] { display: none; }
.entip span { opacity: .8; }

/* routes: main door ⇄ each inside door; every count is a filter toggle */
.enroutes { display: flex; flex-direction: column; gap: var(--sp-2); }
.enroutes-none, .enloose { font-size: var(--fs-xs); }
.enview .flow { display: grid; grid-template-columns: minmax(60px, max-content) minmax(0, 1fr) minmax(72px, max-content); gap: var(--sp-2) 0; align-items: stretch; }
.enview .fnode {
  display: flex; flex-direction: column; justify-content: center; text-align: center; padding: var(--sp-1) var(--sp-2);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.25;
}
.enview .fnode small { display: block; font-size: var(--fs-2xs); font-weight: var(--fw-regular); color: var(--ink-3); }
.enview .fext { grid-column: 1; grid-row: 1 / span var(--lanes); }
.enview .flane { grid-column: 2; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 var(--sp-1); }
.enview .fint { grid-column: 3; }
.enview .flane button {
  display: flex; align-items: center; gap: var(--sp-1); width: 100%; padding: 2px var(--sp-1); border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); font-size: var(--fs-xs); white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out);
}
.enview .flane button b { color: var(--ink); font-size: var(--fs-sm); }
.enview .flane button:hover { background: var(--surface-2); }
.enview .flane button.on, .enview .fins.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.enview .farrow { position: relative; flex: 1; min-width: 12px; height: 2px; border-radius: 1px; }
.enview .farrow::after { content: ""; position: absolute; top: -3px; border: 4px solid transparent; border-top-width: 4px; border-bottom-width: 4px; }
.enview .fin .farrow { order: 2; background: var(--dir-in); }
.enview .fin .farrow::after { right: -5px; border-left: 6px solid var(--dir-in); border-right: 0; }
.enview .fout .farrow { background: var(--dir-out); }
.enview .fout .farrow::after { left: -5px; border-right: 6px solid var(--dir-out); border-left: 0; }
.enview .finside { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.enview .fins {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: 2px var(--sp-2); border-radius: var(--r-pill);
  background: var(--caution-soft); border: 1px solid var(--caution-line); color: var(--ink); font-size: var(--fs-xs);
}
.enview .fins b { font-size: var(--fs-sm); }

/* ---- main: head, filters, wall -------------------------------------------------------------------------------- */
.enmain { overflow: auto; padding: var(--sp-5) var(--gutter) var(--sp-6); min-width: 0; }
.enhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.enhead-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); }
.enhead-t h2 { font-size: var(--fs-xl); font-weight: var(--fw-bold); display: inline-flex; align-items: center; gap: var(--sp-2); }
.entoday { font-size: var(--fs-2xs); }
.encount { color: var(--ink); font-size: var(--fs-lg); }
.enhead-a { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.enlive { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.enpill { --btn-bg: var(--accent); --btn-ink: var(--on-accent); --btn-line: var(--accent); --btn-hover: var(--accent-hover); font-weight: var(--fw-semibold); border-radius: var(--r-pill); }
.enfilters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.enfilters .chips { margin-bottom: 0; }
.enplace { flex-direction: row; align-items: center; gap: var(--sp-2); }
.enplace select { min-width: 180px; color: var(--ink); font-weight: var(--fw-regular); }
.ennarrow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); padding: 2px 2px 2px var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--ink-2); }
.ennarrow b { color: var(--ink); }

.engrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: var(--sp-3); }
.engh {
  grid-column: 1 / -1; position: sticky; top: calc(-1 * var(--sp-5)); z-index: var(--z-sticky);
  display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-2) 0 calc(-1 * var(--sp-1)); padding: var(--sp-2) 0 var(--sp-1);
  background: var(--bg); border-bottom: 1px solid var(--line); font-size: var(--fs-sm);
}
.engh:first-child { margin-top: 0; }
.engh .mono { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ink); }
.engh .faint { font-size: var(--fs-xs); }

.encard {
  display: flex; flex-direction: column; padding: 0; min-width: 0; text-align: left; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.encard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.encard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.encimg { position: relative; display: block; aspect-ratio: 1; background: var(--media-bg); overflow: hidden; }
.encimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.encard.nf .encimg img { object-fit: contain; opacity: .85; }
.encimg .off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--media-ink-2); font-size: var(--fs-xs); }
.enctag { position: absolute; left: 6px; top: 6px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); padding: 1px 6px; border-radius: var(--r-xs); background: var(--media-scrim); color: var(--media-ink); }
.encard.wait .encimg img { opacity: .5; }
.encwait { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.encwait .skel { position: absolute; inset: 0; border-radius: 0; opacity: .35; }
.encwait span { position: relative; margin: 6px; padding: 1px 6px; border-radius: var(--r-xs); background: var(--media-scrim); color: var(--media-ink); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.encmeta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px var(--sp-1); padding: var(--sp-2) var(--sp-2) 0; }
.encmeta .mono { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.encroute { padding: 2px var(--sp-2) var(--sp-2); font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- drawer ----------------------------------------------------------------------------------------------------- */
.endrawer { display: none; border-left: 1px solid var(--line); background: var(--surface); overflow: auto; }
.enview.has-sel .endrawer { display: block; }
.endr-head { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); background: var(--surface); border-bottom: 1px solid var(--line); }
.endr-pos { font-size: var(--fs-xs); margin-left: var(--sp-1); }
.endr-body { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-4); }
.enhero { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.enface { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--media-bg); }
.enface img { width: 100%; height: 100%; object-fit: cover; display: block; }
.enface .off { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--sp-3); text-align: center; color: var(--media-ink-2); font-size: var(--fs-xs); }
.enface img.enface-frame { object-fit: contain; opacity: .85; }
.enface .enctag { left: var(--sp-2); top: auto; bottom: var(--sp-2); right: var(--sp-2); text-align: center; }
.enface .skel { position: absolute; inset: 0; border-radius: 0; opacity: .35; }
.enwhen { display: flex; flex-direction: column; gap: 2px; }
.enwhen .mono { font-size: var(--fs-2xl); line-height: 1.1; font-weight: var(--fw-bold); }
.enwhen .dim { font-size: var(--fs-sm); }
.enroute-l { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-2); }
.enroute-l > span:not(.chip) { font-weight: var(--fw-semibold); }
.enstory { font-size: var(--fs-md); line-height: var(--lh); max-width: 48ch; }
.enwait { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); }
.enwait b { color: var(--ink); font-family: var(--font-mono); font-weight: var(--fw-semibold); }
.enwait .enwait-arrow { color: var(--ink-3); }
.enwait .enwait-sw { width: 10px; height: 10px; border-radius: 2px; background: var(--dir-at-door); flex: none; align-self: center; }
.enwait > span:not(.enwait-arrow) { flex: 1 1 200px; }
.enfig { margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.enfig figcaption { font-size: var(--fs-xs); }
.enframe .off { color: var(--media-ink-2); }
/* door zones over the camera frame (imagery: near-white, faint); the route's doors take the direction colour */
.enview .dz-in { --dz: var(--dir-in); } .enview .dz-out { --dz: var(--dir-out); } .enview .dz-inside { --dz: var(--dir-inside); } .enview .dz-unknown { --dz: var(--dir-unknown); } .enview .dz-at_door { --dz: var(--dir-at-door); }
.enzone polygon { fill: var(--media-tint); stroke: var(--media-line); stroke-width: 1.5; stroke-dasharray: 6 5; }
.enzone text { fill: var(--media-ink); font-family: var(--font-ui); font-weight: var(--fw-semibold); paint-order: stroke; stroke: var(--media-scrim); stroke-width: .25em; stroke-linejoin: round; }
.enzone.from polygon, .enzone.to polygon { stroke: var(--dz); stroke-opacity: .95; stroke-dasharray: none; stroke-width: 2; fill: var(--dz); fill-opacity: .1; }
.enroute line { stroke: var(--dz); stroke-width: 2.5; stroke-dasharray: 10 6; }
.enroute polygon { fill: var(--dz); }
.enfacebox { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.enhow { display: flex; flex-direction: column; gap: var(--sp-2); }
.enhow p { font-size: var(--fs-sm); }
.enconf { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-2); }
.enconf b { color: var(--ink); }
.enmeter { flex: none; width: 112px; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.enmeter i { display: block; height: 100%; background: var(--ink-2); border-radius: inherit; }
.enmeter.low i { background: var(--caution); }
.endl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.endl dt { color: var(--ink-2); }
.endl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.enclip::before { display: inline-block; margin-right: var(--sp-2); vertical-align: 0; }
.enclip.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.enclip.gap::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--caution); }
.enclip .skel { display: inline-block; width: 28px; height: 8px; margin-right: var(--sp-2); border-radius: var(--r-pill); vertical-align: 0; }
.endel { border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.endel .confirm p { font-size: var(--fs-xs); }
.enkeys { font-size: var(--fs-xs); margin-top: calc(-1 * var(--sp-2)); }

.enempty { max-width: 640px; margin: 0 auto; }

/* ---- privacy footer ----------------------------------------------------------------------------------------------- */
.enfoot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); color: var(--ink-2); }
.enfoot b { color: var(--ink); font-weight: var(--fw-semibold); }
.enfoot a { margin-left: auto; font-weight: var(--fw-medium); }

/* ---- phone ---------------------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .enview, .enview.has-sel { display: block; height: 100%; overflow: auto; overflow-x: hidden; }
  .enside { border-right: 0; border-bottom: 1px solid var(--line); padding: var(--sp-3) var(--gutter) var(--sp-4); gap: var(--sp-4); overflow: visible; }
  .enmain { overflow: visible; padding: var(--sp-4) var(--gutter); }
  .enhead-t h2 { font-size: var(--fs-lg); }
  .enplace { width: 100%; }
  .enplace select { flex: 1; min-width: 0; }
  .engrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); }
  .engh { top: 0; }
  .encmeta .mono { font-size: var(--fs-xs); }
  .encs { display: none; }
  .ensum > summary { display: list-item; cursor: pointer; padding: var(--sp-2) 0; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
  .ensum[open] > summary { margin-bottom: calc(-1 * var(--sp-2)); }
  .ensum[open] > section + section { margin-top: var(--sp-4); }
  .ensum[open] > summary + section { margin-top: var(--sp-2); }
  .encmeta .chip { padding: 0 6px; }
  .enview.has-sel .endrawer {
    position: fixed; top: var(--shell-top); left: 0; right: 0; bottom: var(--shell-bottom); z-index: var(--z-drawer); border-left: 0;
    animation: en-sheet var(--dur-3) var(--ease-out);
  }
  .endr-body { padding: var(--sp-3) var(--gutter) var(--sp-6); gap: var(--sp-4); }
  .enhero { grid-template-columns: 128px minmax(0, 1fr); gap: var(--sp-3); }
  .enwhen .mono { font-size: var(--fs-xl); }
  .enfoot { position: sticky; bottom: 0; z-index: var(--z-sticky); padding: var(--sp-2) var(--gutter); gap: 0 var(--sp-3); font-size: var(--fs-2xs); }
  .enfoot a { margin-left: 0; }
}
@keyframes en-sheet { from { transform: translateY(24px); opacity: 0; } }

/* Face recognition (faces.js) — only when the site has it on */
.encrec { display: flex; padding: 0 var(--sp-2) var(--sp-2); min-width: 0; }
.encrec .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.encard .envis, .enwho .envis { --chip-bg: var(--surface-2); --chip-ink: var(--ink-2); --chip-line: var(--line); }
.enwho { display: flex; flex-direction: column; gap: var(--sp-2); }
.enwho p { font-size: var(--fs-sm); }
.enenrol { display: flex; flex-direction: column; gap: var(--sp-2); }
.enenrol label:not(.inline) { display: flex; flex-direction: column; gap: var(--sp-1); }
.enidv b { color: var(--ink); }
.enwho-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.enwho-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--sp-1); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: inherit; font-size: var(--fs-xs); max-width: 76px; }
.enwho-pick button.on { border-color: var(--accent); }
.enwho-pick img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-xs); }
.enwho-pick span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
