/* The situation room (sala.html): the grid of its panels by pane and the room each panel gives its content. What the panels draw comes
   from the app's own classes in tokens-ev.css and estilos-osint.css (the verdict chips of the Tabla, the rows of the Bitácora, the Línea de
   tiempo, the face crops of Fotos, the chips, the buttons, the dots); this file lays them out, with the design tokens only. index.html links
   it too, for the frame of the panels of its Sala view: every rule names a sala- class or the body of sala.html, so nothing else there moves. */

html:has(> body.sala-body), body.sala-body { height: 100%; }
body.sala-body { overflow: hidden; }
.sala { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; min-height: 0; }

/* ---- the bar: the case, the panes of the sala, the channel, read only, when the case was read */
.sala-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; border-bottom: 1px solid var(--ev-border); background: var(--ev-surface); }
.sala-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ev-text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.sala-brand:hover { color: var(--ev-text); }
.sala-mark { width: 22px; height: 22px; }
.sala-case { display: flex; flex-direction: column; min-width: 0; }
.sala-subject { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sala-code { color: var(--ev-text-3); font: 400 11px/1.3 var(--ev-font-mono); }
.sala-panes { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--ev-border); border-radius: 10px; background: var(--ev-surface-2); }
.sala-pane-link { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--ev-text-2); font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.sala-pane-link:hover { color: var(--ev-text); }
.sala-pane-link[aria-current="page"] { background: var(--seg-on); color: var(--ev-text); box-shadow: var(--ev-shadow-1); }
.sala-panes-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--ev-border-strong); }
.sala-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; color: var(--ev-text-2); font-size: 12px; }
.sala-chan, .sala-ro { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sala-ro .ev-ic { width: 14px; height: 14px; }
.sala-updated { color: var(--ev-text-3); font: 400 11.5px/1.3 var(--ev-font-mono); }
.sala-updated.is-bad { color: var(--ev-bad); font-family: var(--ev-font-ui); }

/* ---- the grid of a pane: its columns side by side, the panels of a column one over the other */
.sala-grid { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 12px; min-height: 0; padding: 12px; }
/* todo: the twelve panels in one column that flows into as many columns as the width holds, each panel tall enough for its glance; the
   grid scrolls (in the Sala view of the main window the view scrolls it) */
.sala-grid[data-pane="todo"] { grid-template-columns: minmax(0, 1fr); overflow: auto; }
.sala-grid[data-pane="todo"] > .sala-col { grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); grid-template-rows: none; grid-auto-rows: minmax(480px, 72vh); align-content: start; }
.ws-sala > .sala-grid[data-pane="todo"] { flex: none; overflow: visible; }
/* while the Sala view of the main window scrolls the twelve, its bar (the sub-views, the window of time, the strip) stays in sight; on a
   short screen (820 px or less, where the bar takes a third of the view) it scrolls away with the panels */
@media (min-height: 821px) {
  .ws-sala:has(> .sala-grid[data-pane="todo"]) > .sala-bar { position: sticky; top: 0; z-index: 3; }
}
.sala-col { display: grid; grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); gap: 12px; min-height: 0; }
.sala-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--ev-border); border-radius: var(--ev-r-lg); background: var(--ev-surface); }
.sala-panel-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ev-border); }
.sala-panel-title { margin: 0; color: var(--ev-text-2); font-size: 12.5px; font-weight: 600; letter-spacing: var(--ev-tracking-caps); text-transform: uppercase; white-space: nowrap; }
.sala-panel-sub { min-width: 0; margin-left: auto; overflow: hidden; color: var(--ev-text-3); font-size: 11.5px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.sala-panel-body { flex: 1; min-height: 0; overflow: auto; container-type: inline-size; }

/* ---- what several panels share */
.sala-empty { margin: 24px auto; }
.sala-note { margin: 6px 0 0; color: var(--ev-text-3); font-size: 11.5px; line-height: 1.4; }
.sala-pad { padding: 12px 16px; }
.sala-meta { display: block; color: var(--ev-text-2); font-size: 12px; line-height: 1.4; }
.sala-groups { color: var(--ev-text-3); }
.sala-swatch { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--gc, var(--ev-text-3)); }
.sala-net { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.sala-addr { margin: 0; color: var(--ev-text-2); font: 400 12px/1.35 var(--ev-font-mono); overflow-wrap: anywhere; }
.sala-addr a { color: inherit; }
.sala-tag { padding: 1px 7px; border: 1px dashed var(--ev-border-strong); border-radius: var(--ev-r-pill); color: var(--ev-text-2); font-size: 11px; }
.sala-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* an action that runs only in the main window, or that cannot run now: shown, with its reason as its title */
:is(.sala, .sala-op) .ev-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ---- Tablero */
.sala-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; padding: 12px 14px; }
.sala-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--ev-border); border-radius: var(--ev-r-md); background: var(--ev-surface-2); }
.sala-kpi-l { color: var(--ev-text-2); font-size: 11.5px; }
.sala-kpi-n { color: var(--ev-text); font: 600 22px/1.15 var(--ev-font-mono); }
.sala-kpi.is-reviewed .sala-kpi-n { color: var(--ev-ok); }
.sala-kpi.is-doubt .sala-kpi-n { color: var(--ev-doubt); }
.sala-kpi-s { color: var(--ev-text-3); font-size: 11px; }
.sala-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0 14px 14px; }
.sala-box { min-width: 0; padding: 10px 12px; border: 1px solid var(--ev-border); border-radius: var(--ev-r-md); }
.sala-box-wide { grid-column: 1 / -1; }
.sala-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sala-row { display: grid; grid-template-columns: minmax(110px, auto) 1fr; align-items: baseline; gap: 2px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ev-border); }
.sala-row:last-child { padding-bottom: 0; border-bottom: 0; }
.sala-row .sala-when { justify-self: end; color: var(--ev-text-2); font-size: 12px; }
/* a reading whose account is in the graph selects it */
.sala-row.is-link { cursor: pointer; }
.sala-row.is-link:hover .sala-net { color: var(--ev-brand); }
.sala-row.is-selected { box-shadow: inset 3px 0 0 var(--ev-brand); padding-left: 8px; }
.sala-row .sala-addr, .sala-row .sala-meta { grid-column: 1 / -1; }
.sala-row.is-none .sala-when { color: var(--ev-text-3); }
.sala-svc { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.sala-svc-state { color: var(--ev-text-2); font-size: 12px; text-align: right; }
.sala-task { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.sala-task.is-idle { color: var(--ev-text-2); }
.sala-live { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ev-brand); animation: osintPulse 1.6s ease-in-out infinite; }

/* ---- Cuentas */
.sala-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 12px 14px; }
.sala-acc { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border-left: 3px solid var(--gc, var(--ev-border-strong)); }
.sala-acc.is-link { cursor: pointer; }
.sala-acc.is-selected { border-color: var(--ev-brand); box-shadow: 0 0 0 1px var(--ev-brand); }
.sala-acc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sala-acc-head .tbl-v { margin-left: auto; }
.sala-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 2px 0 0; font-size: 12.5px; }
.sala-dl dt { color: var(--ev-text-3); }
.sala-dl dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.sala-names { display: block; color: var(--ev-text-2); }
.sala-sel-note { display: none; margin: 0; color: var(--ev-brand); font-size: 11.5px; }
.sala-acc.is-selected .sala-sel-note { display: block; }

/* ---- Bitácora en vivo: the rows of the lower panel of the case, the newest first. The sala draws its rows again on every new reading of
   the case, so a line that arrived with the last reading keeps a still mark instead of the entry animation of the lower panel */
.sala-log { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sala-log-list { flex: 1; min-height: 0; overflow: auto; }
.sala-log .dk-log-row.is-live { animation: none; box-shadow: inset 3px 0 0 var(--ev-brand); }
@container (max-width: 420px) {
  .sala-log .dk-log-row { grid-template-columns: 58px minmax(0, 1fr); row-gap: 4px; }
  .sala-log .dk-log-kind { grid-column: 2; grid-row: 1; }
  .sala-log .dk-log-text { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- Rostros: the people and their crops at the left, the face chosen at the right */
.sala-faces { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); height: 100%; min-height: 0; }
.sala-face-groups { min-height: 0; overflow: auto; padding: 4px 14px 14px; }
.sala-fgroup.is-selected { padding-left: 8px; box-shadow: inset 3px 0 0 var(--ev-brand); }
.sala-fgroup .osint-crop.is-chosen .img { outline: 2px solid var(--ev-focus); outline-offset: 2px; }
.sala-face-detail { min-height: 0; overflow: auto; padding: 12px 14px; border-left: 1px solid var(--ev-border); }
.sala-photo { position: relative; display: inline-block; max-width: 100%; margin: 4px 0 8px; line-height: 0; }
.sala-photo img { display: block; max-width: 100%; max-height: 300px; border-radius: 8px; }
.sala-photo-box { position: absolute; border: 2px solid var(--ev-text); border-radius: 4px; pointer-events: none; }
.sala-photo-box.prov-confirmed { border-color: var(--ev-ok); }
.sala-photo-box.prov-doubt, .sala-photo-box.prov-proposed { border: 2px dashed var(--ev-doubt); }
.sala-photo-box.prov-tagged { border: 2px dashed var(--ev-info); }
@container (max-width: 560px) {
  .sala-faces { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  .sala-face-groups { overflow: visible; }
  .sala-face-detail { border-top: 1px solid var(--ev-border); border-left: 0; }
}

/* ---- Línea de tiempo por red: the timeline of the app inside a panel, one lane per network */
.sala-tl { height: 100%; }
.sala-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sala-chips .lat-chip { height: 28px; }
:is(.sala, .sala-op) .tl-who { cursor: default; }
:is(.sala, .sala-op) .tl-who:hover .tl-name { color: inherit; text-decoration: none; }
/* the lanes are drawn again with every new reading of the case: the marks stand still instead of fading in each time */
.sala-tl .tl-dot { animation: none; }
/* a narrower name column (the networks are short words), so the axis keeps its room in a panel of a third of the screen */
.sala-tl .tl-axis, .sala-tl .tl-lane { grid-template-columns: 150px minmax(0, 1fr); }
.sala-tl .tl-gridlines { left: 166px; }
.sala-tl .tl-grid { min-width: 420px; }

/* ---- the list of saved cases (no case in the address) */
.sala-pick { height: 100vh; overflow: auto; }
.sala-pick .sala-mark { width: 32px; height: 32px; }
.sala-pick-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.sala-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 14px; }
.sala-pick-txt { display: flex; flex: 1 1 320px; flex-direction: column; gap: 2px; min-width: 0; }
.sala-pick-title { color: var(--ev-text); font-weight: 600; text-decoration: none; }
.sala-pick-title:hover { color: var(--ev-brand); }
.sala-pick-panes { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- the operational panes (sala-tema.css draws them): Horas puts its grid first and the reading beside it; in a narrow panel the two go
   one under the other, as every split of the theme does */
@container (max-width: 720px) {
  body.sala-op .so-split.is-start { grid-template-columns: minmax(0, 1fr); }
}

/* ---- a narrow window: the columns one under the other, the page scrolls */
@media (max-width: 1100px) {
  body.sala-body { overflow: auto; }
  .sala { height: auto; min-height: 100vh; }
  .sala-grid, .sala-grid[data-pane="todo"] { grid-template-columns: minmax(0, 1fr); }
  .sala-col { grid-template-rows: none; }
  .sala-panel { min-height: 420px; max-height: 90vh; }
  .sala-faces { grid-template-columns: minmax(0, 1fr); }
  .sala-face-detail { border-top: 1px solid var(--ev-border); border-left: 0; }
}

/* the line of a task of the main window in the Tablero (docs/progreso-de-tareas.md): with a real total, a thin bar of how far it went */
.sala-task-bar { display: block; height: 3px; margin-top: 4px; overflow: hidden; border-radius: 2px; background: var(--ev-border); }
.sala-task-fill { display: block; height: 100%; border-radius: 2px; background: var(--ev-brand); transition: width 400ms ease; }
@media (prefers-reduced-motion: reduce) { .sala-task-fill { transition: none; } }
