/* ================= STORAGE EXPLORER — the shell, the cards and the filter bar =============
   One of four sheets; the prefix is the ownership boundary: `sx-` here (shell, summary cards, filter bar, chips, panel chrome),
   `sxc-` charts, `sxr-` retention, `sxp-` the drawer — css-class-collision-check.py fails the build on a shared bare class.
   The Traffic and Feature-usage panes reuse the chrome below (`.sx-head`, `.sx-panel*`, `.sx-f-*`, `.sx-chip*`, `.sx-more`, the drawer
   shell), so a change to it is a change to three panes. Tokens only (design-spec.json): light, dark and reduced motion are answered by
   alt-tokens.css, and `.sx` is an inline-size container, so every breakpoint is a container query on the PANE's width.
   The figure tile is `.a-stat` (DS-A02), the sub-view tabs `.a-tabs`/`.a-tab` (DS-24), the tree-mode switch `.a-seg-ctl` (DS-25),
   the filter bar `.a-filter-bar` (DS-A10): their rules are alt-components.css's and alt-admin-components.css's, not this file's. */

/* No sideways scroll: every grid track is `minmax(0,…)` and every item `min-width:0`. Selection is never colour alone (sys_design-system.md §20). */

.alt-app .sx{
  container-type:inline-size; container-name:sxpane;
  display:flex; flex-direction:column; gap:var(--a-4); min-width:0;
}

/* ---------- the header strip ---------- */

.alt-app .sx-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:var(--a-3) var(--a-4); flex-wrap:wrap; min-width:0;
}
.alt-app .sx-head-main{ min-width:0; flex:1 1 260px; }
.alt-app .sx-head-side{
  display:flex; align-items:center; gap:var(--a-2); flex-wrap:wrap; min-width:0; flex:0 1 auto;
}
/* The pane title is the overlay title (DS-14, DS-A13): display face, 16/600. */
.alt-app .sx-title{
  margin:0; font-family:var(--a-display); font-size:var(--a-fs-16); font-weight:600; line-height:var(--a-lh-tight); color:var(--a-text);
}
.alt-app .sx-sub{
  margin:var(--a-sp-2) 0 0; font-size:var(--a-fs-12); font-weight:400; line-height:var(--a-lh-ui); color:var(--a-faint); max-width:78ch;
}
/* WHEN IT WAS MEASURED, at the type floor and never as a badge. Tabular so the stamp does not jitter, and absent when nothing has been read:
   an absent stamp says "not yet", which is true, where "never" would be a claim. */
.alt-app .sx-stamp{
  font-size:var(--a-fs-11); line-height:var(--a-lh-tight); color:var(--a-faint); font-variant-numeric:tabular-nums; white-space:nowrap;
}

/* ---------- the three views ----------
   The Storage views, and now the Traffic and Feature-usage ones, are `.a-tabs.a-subviews` > `.a-tab` (alt-components.css, alt-admin-components.css). */

/* Shown/hidden via the `hidden` property with an explicit `[hidden]` rule: any display value of its own would beat the user-agent default. */
.alt-app .sx-view{ display:flex; flex-direction:column; gap:var(--a-4); min-width:0; }
.alt-app .sx-view[hidden]{ display:none; }
/* A panel focused because a card sent the reader to it is a destination, not a control: it gets the ring and nothing else. */
.alt-app .sx-view:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }

/* ---------- the summary cards (`.a-stat`, DS-A02) ----------
   auto-fit with a `min()` floor — the form that does not overflow at 320px. The state is the glyph's colour: green and amber appear only when
   something is measured clear or needs addressing, and `unknown` stays neutral ("measured, nothing found" differs from "not measured").
   Set by sxeCardTone() (JS/features/storage-explorer.js). */
.alt-app .sx-cards{
  display:grid; gap:var(--a-3); grid-template-columns:repeat(auto-fit, minmax(min(100%, 220px), 1fr)); min-width:0;
}
.alt-app .sx-cards > .a-stat.sx-tone-clear > .a-stat-glyph{ color:var(--a-green); }
.alt-app .sx-cards > .a-stat.sx-tone-attention > .a-stat-glyph{ color:var(--a-amber); }

/* ---------- the filter bar (`.a-filter-bar` lays it out; this is its band) ---------- */

.alt-app .sx-filters{
  display:flex; align-items:center; gap:var(--a-2); flex-wrap:wrap; padding:var(--a-3); min-width:0;
  border:1px solid var(--a-line-soft); border-radius:var(--a-r); background:var(--a-raised);
}
/* WIDTH FROM THE CONTENT, capped. A team name can be long and a select that sizes to its longest option pushes the rest of the bar off the row. */
.alt-app .sx-f-sel{ width:auto; min-width:0; max-width:200px; }
.alt-app .sx-f-search{ flex:1 1 200px; min-width:0; max-width:320px; }
.alt-app .sx-f-days{ width:90px; }
.alt-app .sx-filters .control-spacer{ flex:1 1 auto; min-width:0; }
@container sxpane (max-width: 559px){
  .alt-app .sx-filters{ gap:var(--a-1) var(--a-2); }
  .alt-app .sx-f-sel{ max-width:none; flex:1 1 140px; }
  .alt-app .sx-f-search{ flex:1 1 100%; max-width:none; }
}

/* ---------- the chips and the scope line ---------- */

.alt-app .sx-chips{ display:flex; align-items:center; gap:var(--a-2); flex-wrap:wrap; min-width:0; }
.alt-app .sx-chips[hidden]{ display:none; }
/* AN ACTIVE FILTER, NAMED. The chip geometry (DS-26): the accent edge and text are two signals and the kind word in front of the value is a third. */
.alt-app .sx-chip{
  display:inline-flex; align-items:center; gap:var(--a-sp-6); height:var(--a-chip-h); padding:0 var(--a-sp-4) 0 9px; min-width:0; max-width:100%;
  border:1px solid var(--a-blue); border-radius:var(--a-r-pill); background:var(--a-blue-soft); color:var(--a-blue-text);
  font-size:var(--a-fs-11); font-weight:600; line-height:var(--a-lh-tight);
}
.alt-app .sx-chip-k{ font-size:var(--a-fs-11); font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--a-dim); flex:0 0 auto; }
.alt-app .sx-chip-t{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.alt-app .sx-chip-x{
  display:flex; align-items:center; justify-content:center; flex:0 0 auto; width:calc(var(--a-chip-h) - 6px); height:calc(var(--a-chip-h) - 6px); padding:0;
  border:none; border-radius:var(--a-r-pill); background:transparent; color:var(--a-blue-text);
  font-size:var(--a-fs-14); line-height:var(--a-lh-ctl); cursor:pointer;
}
.alt-app .sx-chip-x:hover{ background:var(--a-panel); }
.alt-app .sx-chip-x:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-sp-2); }

/* THE ONE ANNOUNCEMENT ON THIS PANE. Empty when nothing is filtered, and an empty `role="status"` announces nothing. */
.alt-app .sx-scope-line{
  margin:0; font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); min-width:0; overflow-wrap:anywhere;
}
.alt-app .sx-scope-line:empty{ display:none; }

/* ---------- the panels and the two grids ---------- */

.alt-app .sx-panel{
  padding:var(--a-4); min-width:0; border:1px solid var(--a-line-soft); border-radius:var(--a-r-lg); background:var(--a-panel);
}
.alt-app .sx-panel-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:var(--a-2) var(--a-3); flex-wrap:wrap; min-width:0; margin-bottom:var(--a-3);
}
.alt-app .sx-panel-head > div{ min-width:0; }
.alt-app .sx-panel-title{
  margin:0; font-family:var(--a-display); font-size:var(--a-fs-16); font-weight:600; line-height:var(--a-lh-tight); color:var(--a-text); min-width:0;
}
.alt-app .sx-panel-note{
  margin:var(--a-sp-2) 0 0; font-size:var(--a-fs-12); font-weight:400; line-height:var(--a-lh-ui); color:var(--a-faint); max-width:78ch; min-width:0;
}
/* A title with no head row above its content (the simulator, the doors, the policy form) clears it by one step. */
.alt-app .sx-panel > .sx-panel-title{ margin-bottom:var(--a-2); }
/* A sub-head inside a panel is the eyebrow (DS-A13). */
.alt-app .sx-panel .a-eyebrow{ margin:var(--a-gap-section) 0 var(--a-gap-label); }
.alt-app .sx-panel .a-eyebrow:first-child{ margin-top:0; }
/* WHICH FIGURES ARE EXACT AND WHICH ARE ESTIMATES, under the primary chart rather than in a tooltip: it is the sentence that stops a reader
   believing a purge shrinks the database file. */
.alt-app .sx-exactness{
  margin:var(--a-3) 0 0; padding-top:var(--a-2); border-top:1px solid var(--a-line-soft);
  font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); max-width:78ch;
}
.alt-app .sx-exactness strong{ color:var(--a-text); font-weight:700; }

/* THE PRIMARY ROW — the treemap, the age chart and the type breakdown: one column, then two, then the treemap taking two thirds beside a
   stacked age and type column, then all three across. The steps are the pane's width, not the window's. */
.alt-app .sx-grid{
  display:grid; gap:var(--a-4); align-items:start; grid-template-columns:minmax(0, 1fr); min-width:0;
}
.alt-app .sx-grid > *{ min-width:0; }
@container sxpane (min-width: 720px){
  .alt-app .sx-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .alt-app .sx-grid > .sx-panel-tree{ grid-column:1 / -1; }
}
@container sxpane (min-width: 1080px){
  .alt-app .sx-grid{ grid-template-columns:minmax(0, 2fr) minmax(0, 1fr); }
  .alt-app .sx-grid > .sx-panel-tree{ grid-column:1; grid-row:1 / span 2; }
  .alt-app .sx-grid > .sx-panel-age{ grid-column:2; grid-row:1; }
  .alt-app .sx-grid > .sx-panel-type{ grid-column:2; grid-row:2; }
}
@container sxpane (min-width: 1480px){
  .alt-app .sx-grid{ grid-template-columns:minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .alt-app .sx-grid > .sx-panel-tree{ grid-column:1; grid-row:1; }
  .alt-app .sx-grid > .sx-panel-age{ grid-column:2; grid-row:1; }
  .alt-app .sx-grid > .sx-panel-type{ grid-column:3; grid-row:1; }
}

/* THE SUPPORTING ROW — largest attachments, storage by team, and the doors. Capped at three: past three the layout is using the width instead
   of the reader. The actions column is the narrow one because it holds five short labels. */
.alt-app .sx-grid2{
  display:grid; gap:var(--a-4); align-items:start; grid-template-columns:minmax(0, 1fr); min-width:0;
}
.alt-app .sx-grid2 > *{ min-width:0; }
@container sxpane (min-width: 860px){
  .alt-app .sx-grid2{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@container sxpane (min-width: 1360px){
  .alt-app .sx-grid2{ grid-template-columns:minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr); }
}

/* ---------- the disclosures ----------
   THE EXHAUSTIVE ANSWER, ONE PRESS AWAY RATHER THAN GONE. A `<details>` works with no script at all. The summary is the group header (DS-49):
   one 32px row, 13px/600, the whole row the button. */
.alt-app .sx-more{ border:1px solid var(--a-line-soft); border-radius:var(--a-r); background:var(--a-panel); min-width:0; }
.alt-app .sx-more > summary{
  display:flex; align-items:center; min-height:var(--a-ctl); padding:0 var(--a-4); cursor:pointer;
  font-size:var(--a-fs-13); font-weight:600; line-height:var(--a-lh-ui); color:var(--a-dim);
}
.alt-app .sx-more > summary:hover{ color:var(--a-text); }
.alt-app .sx-more > summary:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-inset); }
.alt-app .sx-more[open] > summary{ color:var(--a-text); border-bottom:1px solid var(--a-line-soft); margin-bottom:var(--a-3); }
.alt-app .sx-more > *:not(summary){ margin-left:var(--a-4); margin-right:var(--a-4); }
.alt-app .sx-more > *:last-child{ margin-bottom:var(--a-4); }

/* ---------- quick actions ----------
   The doors panel holds five short rows and must not stretch to the height of the tables beside it. One per row, full width, left-aligned: a list
   of destinations rather than a toolbar. */
.alt-app .sx-panel-actions{ align-self:start; }
.alt-app .sx-actions{ display:flex; flex-direction:column; gap:var(--a-2); min-width:0; }
.alt-app .sx-action{ width:100%; justify-content:flex-start; text-align:left; min-width:0; }

/* ---------- the content-kind row in Retention ---------- */

.alt-app .sx-types-row{
  display:flex; align-items:center; gap:var(--a-2) var(--a-3); flex-wrap:wrap; margin-top:var(--a-3); min-width:0;
}

/* ---------- a count beside controls ----------
   A status or count at the start of a row of buttons ("3 files are waiting"): the hint line, pushing the controls to the end. The `ok` and `err`
   kinds storageSay() adds colour it. It replaces the classic `.bulk-count` on this pane. */
.alt-app .sx-count{ margin-right:auto; font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-faint); }
.alt-app .sx-count.err{ color:var(--a-red); }
.alt-app .sx-count.ok{ color:var(--a-green); }

/* ---------- Recovery archive: its filter rows (JS/features/admin-recovery-archive.js) ----------
   The console's `.admin-filter-row` flex layout is scoped to other panes by id, so under #storagePane its fields would stack. A row of
   `.a-field` labels (label above control) that wraps, bottoms aligned, so a button lines up with the controls. */
.alt-app #storageViewRecovery .admin-filter-row{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--a-2) var(--a-3); padding:var(--a-2) 0; margin:0; min-width:0; }
.alt-app #storageViewRecovery .admin-filter-row > label{ min-width:0; max-width:100%; }
.alt-app #storageViewRecovery .admin-filter-row > label select,
.alt-app #storageViewRecovery .admin-filter-row > label input{ min-width:0; max-width:100%; }
.alt-app #storageViewRecovery .admin-filter-row input[type=search]{ width:220px; }

/* ---------- Recovery archive: its tables at phone width (JS/features/admin-recovery-archive.js) ----------
   `.a-table` has no narrow layout and these tables run to seven columns. Under 560px a row becomes a card: the first cell is its title, every other
   cell carries its column name (the cell's data-l) in front of the value. Same container query as the filter bar above. */
@container sxpane (max-width: 559px){
  .alt-app .sx-ra-table,
  .alt-app .sx-ra-table tbody,
  .alt-app .sx-ra-table tr,
  .alt-app .sx-ra-table td{ display:block; min-width:0; }
  .alt-app .sx-ra-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .alt-app .sx-ra-table tr{ padding:var(--a-2) 0; border-bottom:1px solid var(--a-line-soft); }
  .alt-app .sx-ra-table tbody tr:last-child{ border-bottom:0; }
  .alt-app .sx-ra-table td{ display:flex; align-items:baseline; justify-content:space-between; gap:var(--a-3); border-bottom:0; text-align:right; overflow-wrap:anywhere; }
  .alt-app .sx-ra-table td::before{ content:attr(data-l); flex:0 0 auto; text-align:left; color:var(--a-faint); font-size:var(--a-fs-11); font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
  .alt-app .sx-ra-table td:first-child{ justify-content:flex-start; text-align:left; font-weight:600; }
  .alt-app .sx-ra-table td:first-child::before,
  .alt-app .sx-ra-table td[data-l=""]::before{ display:none; }
  .alt-app .sx-ra-table td[data-l=""]{ justify-content:flex-start; }
}
