/* ================= THE STORAGE EXPLORER — RETENTION AND MAINTENANCE =================
   Scope selector, cutoff simulator, Retention Opportunity panel, policy-age shortcuts (JS/features/storage-retention-view.js; the policy form
   and purge row are admin-storage.js's), and the maintenance views' own parts: the totals and hotspots tiles, the team rows, the purge runs,
   the advisor and the purge preview (admin-storage.js, admin-lifecycle.js). Scoped under `.alt-app` (css-class-collision-check.py fails on a bare
   class redefined twice); `sx-` is the markup's prefix, `sxr-` this file's, and `storage-` the maintenance parts this file took over from
   alt-admin.css and the page's inline <style>, which retire them. Tokens only. Red means "can take live work"; the figure tile is `.a-stat`,
   the notice `.a-notice`, the table `.a-table`, the status chip `.a-chip-st`, the radio cards `.a-radio-card`, the list row `.a-record`
   (alt-components.css and alt-admin-components.css), so none of those is drawn here. */

/* ---------- the layout row, and the empty line ---------- */

/* A row of controls that wraps: a label, a field, a button. It replaces the classic `.control-row` and `.bulk-bar` on this pane. */
.alt-app .sx-row{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--a-2) var(--a-3); margin:var(--a-3) 0; min-width:0; }
.alt-app .sx-panel > .sx-panel-note + .sx-row{ margin-top:0; }
.alt-app .sx-empty{
  margin:0; padding:var(--a-4); border:1px dashed var(--a-line); border-radius:var(--a-r);
  font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); text-align:center;
}
/* A description under a panel head or a disclosure takes the space the prose used to. */
.alt-app .sx-panel > .sx-panel-note,
.alt-app .sx-more > .sx-panel-note{ margin-top:0; margin-bottom:var(--a-3); }
/* A typed phrase inside an eyebrow label reads as the exact characters to type, not as uppercase. */
.alt-app .a-eyebrow .a-code{ text-transform:none; letter-spacing:0; }

/* ---------- the scope row ---------- */

.alt-app .sx-ret-scope{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--a-2) var(--a-3); margin:0 0 var(--a-4); }
.alt-app .sx-ret-scope-note{
  flex:1 1 320px; min-width:0; color:var(--a-dim); font-size:var(--a-fs-12); line-height:var(--a-lh-ui);
}

/* ---------- the personal scope, marked rather than flagged ----------
   The note is `.a-notice`; the panels themselves pick up the purple edge, so the treatment reads once the note has scrolled past. */

.alt-app #storageRetentionPersonalNote{ margin:0 0 var(--a-4); }
.alt-app .sxr-personal .sx-sim,
.alt-app .sxr-personal .sx-opp,
.alt-app .sxr-personal .sx-policy{ border-left:3px solid var(--a-purple); }

/* ---------- the simulator ---------- */

.alt-app .sx-sim-row{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--a-2) var(--a-3); }
.alt-app .sx-sim-lbl,
.alt-app .sx-sim-unit{ color:var(--a-dim); font-size:var(--a-fs-13); line-height:var(--a-lh-ui); white-space:nowrap; }
.alt-app .sx-sim-range{ margin:var(--a-2) 0 0; color:var(--a-faint); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); }
.alt-app .sx-sim-out{ margin-top:var(--a-4); padding-top:var(--a-3); border-top:1px solid var(--a-line-soft); }

/* A number with a control either side of it, reading as ONE control rather than three: the inner radii are squared off so the group has a
   single outline, on the field edge and ground (DS-33). The figure is the body face with tabular figures (DS-53), never monospace. */
.alt-app .sx-step{
  display:inline-flex; align-items:stretch; border:1px solid var(--a-ctl-edge); border-radius:var(--a-r-sm);
  background:var(--a-field-bg); overflow:hidden;
}
.alt-app .sx-step-btn{
  min-width:var(--a-ctl); padding:0 var(--a-2); border:0; background:transparent; color:var(--a-text);
  font:inherit; font-size:var(--a-fs-16); line-height:var(--a-lh-ctl); cursor:pointer; transition:background var(--a-quick) var(--a-ease);
}
.alt-app .sx-step-btn:hover{ background:var(--a-raised); }
.alt-app .sx-step-btn:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-inset); }
.alt-app .sx-step-input{
  width:76px; height:var(--a-ctl); padding:0 var(--a-2); border:0; border-left:1px solid var(--a-line-soft); border-right:1px solid var(--a-line-soft);
  border-radius:0; background:var(--a-field-bg); color:var(--a-text);
  font-family:var(--a-body); font-size:var(--a-fs-ctl); line-height:var(--a-lh-ctl); font-variant-numeric:tabular-nums; text-align:center;
}
/* The policy field arrives with an inline width from admin-storage.js's own markup, so this has to win on specificity rather than order. */
.alt-app .sxr-policy-step .sx-step-input{ width:76px; box-sizing:border-box; }
.alt-app .sx-step-input:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-inset); }

/* ---------- the shortcuts ----------
   A preset is a pressable chip (DS-26). "Lit" means the field says this: removed the moment the number goes custom, since a preset glowing beside
   a different figure would be a false claim. */

.alt-app .sx-presets{ display:inline-flex; align-items:center; gap:var(--a-1); flex-wrap:wrap; }
.alt-app .sx-preset{
  min-width:var(--a-ctl); height:var(--a-chip-h); padding:0 9px; border:1px solid var(--a-line-soft); border-radius:var(--a-r-pill);
  background:var(--a-raised); color:var(--a-dim); font:inherit; font-size:var(--a-fs-11); font-weight:600; line-height:var(--a-lh-tight);
  font-variant-numeric:tabular-nums; cursor:pointer;
  transition:background var(--a-quick) var(--a-ease), color var(--a-quick) var(--a-ease), border-color var(--a-quick) var(--a-ease);
}
.alt-app .sx-preset:hover{ border-color:var(--a-line-strong); color:var(--a-text); }
.alt-app .sx-preset.is-on{ border-color:var(--a-blue); background:var(--a-blue-soft); color:var(--a-blue-text); }
.alt-app .sx-preset:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }

/* ---------- figures ----------
   The tiles are `.a-stat`; the grid and the headline are this file's. The exactness tag is each tile's sub line. */

.alt-app .sxr-headline{
  margin:0 0 var(--a-3); color:var(--a-text); font-family:var(--a-display); font-size:var(--a-fs-14); font-weight:600; line-height:var(--a-lh-ui);
}
.alt-app .sxr-figs{ display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:var(--a-2); }
.alt-app .sxr-note{ margin:var(--a-3) 0 0; color:var(--a-dim); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); }
.alt-app .sx-opp-grid{ display:flex; flex-direction:column; gap:0; }

/* ---------- what this applies to (`.a-radio-card`) ----------
   A choice that includes live work is dressed as one the moment it is taken, so the warning below is a second telling, not the first. */

.alt-app .a-radio-cards{ margin:var(--a-2) 0 0; }
.alt-app .a-radio-card:has(#storageScopeAll:checked),
.alt-app .a-radio-card:has(#storageScopeOpen:checked){ border-color:var(--a-red); background:var(--a-red-soft); }
.alt-app .a-radio-card-t .a-chip{ margin-left:var(--a-2); vertical-align:middle; }

/* ---------- the open-work alert (`.a-notice.danger`) ---------- */

.alt-app .sx-openwarn{ margin:var(--a-3) 0 0; }

/* ---------- the policy form and the purge row ---------- */

/* Only `column-gap`: `.sx-row` supplies flex, wrap and the row gap. Eight controls at 8px read as one line, so only the column gap widens. */
.alt-app .sx-policy-row{ column-gap:var(--a-4); }
.alt-app .sxr-policy-presets{ margin-left:calc(var(--a-2) * -1); }

/* ---------- the save confirmation ----------
   One JS-built `.sxr-saved` for every save on this pane (policy, purge outcome, queue drain); `hidden` is the resting state. It stays until the
   form changes and wraps rather than truncates. An aria-hidden tick or exclamation precedes the text; `role="status"` announces it. While working it
   carries `.proc` (CSS/processing.css) and none of the three state classes. The families are the notice's (DS-A05). */

.alt-app .sxr-saved{
  display:inline-flex; align-items:baseline; gap:var(--a-2); flex:0 1 auto; max-width:100%; min-width:0; padding:var(--a-1) var(--a-3);
  border:1px solid var(--a-line); border-radius:var(--a-r-sm); background:var(--a-panel); color:var(--a-dim);
  font-family:var(--a-body); font-size:var(--a-fs-12); font-weight:600; line-height:var(--a-lh-ui); overflow-wrap:anywhere;
}
.alt-app .sxr-saved[hidden]{ display:none; }
.alt-app .sxr-saved.ok{ border-color:var(--a-green); background:var(--a-green-soft); color:var(--a-text); }
.alt-app .sxr-saved.warn{ border-color:var(--a-amber); background:var(--a-amber-soft); color:var(--a-text); }
.alt-app .sxr-saved.err{ border-color:var(--a-red); background:var(--a-red-soft); color:var(--a-text); }
/* The glyph is sized and coloured with the text so it is never the loudest thing in the row; generated content is not in the accessibility tree. */
.alt-app .sxr-saved.ok::before{ content:'\2713'; color:var(--a-green); font-weight:700; }
.alt-app .sxr-saved.warn::before,
.alt-app .sxr-saved.err::before{ content:'\0021'; font-weight:700; }
.alt-app .sxr-saved.warn::before{ color:var(--a-amber); }
.alt-app .sxr-saved.err::before{ color:var(--a-red); }

/* ---------- the figure grids on the maintenance views ----------
   The totals and the hotspots are `.a-stat` tiles. `minmax(0, …)` so a long figure shrinks its track instead of hanging off the right edge. */

.alt-app .storage-totals{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap:var(--a-2); margin-bottom:var(--a-3); }
.alt-app .storage-hotspots{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap:var(--a-3); }
/* Files awaiting removal is the one figure that asks the administrator to do something, so it is the one that is coloured. */
.alt-app .a-stat.is-action{ border-color:var(--a-amber); background:var(--a-amber-soft); }
.alt-app .storage-hotspots > .a-stat > .a-btn{ align-self:flex-start; margin-top:var(--a-1); }

/* ---------- the team rows (`.a-record`) ----------
   The row is a button for the whole scope, so the end cluster (health, footprint, Inspect) sits under its two facts and wraps; the pane is
   narrow where it lives. NO TEAM is a real scope holding real bytes, so it is not greyed out: only marked as not being a team, by the mute edge. */

.alt-app .a-record.storage-row{ grid-template-columns:minmax(0, 1fr); row-gap:var(--a-2); margin-bottom:var(--a-gap-row); }
.alt-app .a-record.storage-row .a-record-end{ flex-wrap:wrap; }
.alt-app .a-record.storage-row .a-record-end > .a-btn{ margin-left:auto; }
.alt-app .a-record.no-team{ --a-rec-edge:var(--a-line-strong); }
.alt-app .storage-name{ font-size:var(--a-fs-13); font-weight:600; line-height:var(--a-lh-ui); }
.alt-app .storage-figure{ font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-text); font-variant-numeric:tabular-nums; white-space:nowrap; }
.alt-app .storage-meta{ font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-faint); min-width:0; overflow-wrap:anywhere; }

/* ---------- the purge runs ---------- */

.alt-app .storage-run{
  display:flex; align-items:center; flex-wrap:wrap; gap:var(--a-2) var(--a-3); margin-bottom:var(--a-gap-row); padding:7px 10px 7px 8px;
  background:var(--a-panel); border:1px solid var(--a-line-soft); border-radius:var(--a-r);
}
.alt-app .storage-run .storage-meta{ min-width:100px; }

/* ---------- what a scope holds ---------- */

.alt-app .storage-class{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--a-2) var(--a-3); padding:var(--a-sp-6) 0; font-size:var(--a-fs-13); line-height:var(--a-lh-ui); }
.alt-app .storage-class + .storage-class{ border-top:1px solid var(--a-line-soft); }
.alt-app .storage-class-name{ flex:1 1 120px; min-width:0; font-weight:600; color:var(--a-text); overflow-wrap:anywhere; }
.alt-app .storage-bar{
  flex:1 1 60px; min-width:60px; display:block; height:var(--a-sp-8); background:var(--a-line-soft); border-radius:var(--a-r-pill); overflow:hidden;
}
.alt-app .storage-bar > span,
.alt-app .storage-bar > i{ display:block; height:100%; min-width:var(--a-sp-2); background:var(--a-chart-1); }
.alt-app .storage-bar-cell{ width:30%; min-width:80px; }

/* ---------- the analysis tables: only what `.a-table` does not do ---------- */

/* The recommended row, marked with weight as well as a wash: a pick shown by background alone is one a reader with any colour difficulty cannot see. */
.alt-app .a-table tr.is-pick > td{ background:var(--a-blue-soft); font-weight:600; }
.alt-app .a-table tr.is-pick > td:first-child{ box-shadow:inset 2px 0 0 var(--a-green); }
/* Open content is protected, and the row says so quietly. */
.alt-app .a-table tr.is-protected > td{ color:var(--a-dim); }

/* ---------- the advisor and the health summary ---------- */

.alt-app .storage-advice{ padding:var(--a-4); border:1px solid var(--a-blue); border-radius:var(--a-r); background:var(--a-blue-soft); }
/* NOTHING TO RECOMMEND IS A REAL ANSWER and must not look like a call to action: the quiet variant drops the accent edge and the wash. */
.alt-app .storage-advice.is-quiet{ border-color:var(--a-line-soft); background:var(--a-raised); }
/* THE HEALTH STATES. Colour carries the reading, and the word carries it too: the state is spelled out in the heading. */
.alt-app .storage-health.is-ok{ border-color:var(--a-green); background:var(--a-green-soft); }
.alt-app .storage-health.is-warn{ border-color:var(--a-amber); background:var(--a-amber-soft); }
.alt-app .storage-health.is-bad{ border-color:var(--a-red); background:var(--a-red-soft); }
.alt-app .storage-advice-head{ 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 .storage-advice-why{ margin:var(--a-sp-6) 0 0; max-width:78ch; font-size:var(--a-fs-13); line-height:var(--a-lh-ui); color:var(--a-dim); }
.alt-app .storage-advice-figures{
  margin:var(--a-2) 0 var(--a-3); max-width:78ch; font-size:var(--a-fs-13); line-height:var(--a-lh-ui); color:var(--a-text); font-variant-numeric:tabular-nums;
}
.alt-app .storage-loose-head{
  margin:var(--a-gap-section) 0 0; font-size:var(--a-fs-11); font-weight:700; line-height:var(--a-lh-tight); letter-spacing:.08em; text-transform:uppercase; color:var(--a-dim);
}
.alt-app .storage-loose-head.is-proven{ color:var(--a-red); }
.alt-app .storage-loose-head.is-possible{ color:var(--a-amber); }
.alt-app .storage-loose-head.is-pending{ color:var(--a-blue-text); }
.alt-app .storage-types{ display:flex; align-items:center; gap:var(--a-3); flex-wrap:wrap; }
.alt-app .storage-type{ font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); }

/* ---------- the purge preview ----------
   Bordered in the accent normally and in red when the selection includes open work, because "how bad is this" has to be answerable before reading a
   word. The banner is the notice (info); what is kept is the notice (good); the typed confirmation's warning is the notice (caution, or danger when open
   work is included). The three voices by hue: blue "nothing has happened", red "this deletes", green "this is kept". */

.alt-app .storage-preview{
  margin-top:var(--a-3); padding:var(--a-4); background:var(--a-panel); border:1px solid var(--a-blue); border-left-width:3px; border-radius:var(--a-r-sm);
}
.alt-app .storage-preview.danger{ border-color:var(--a-red); background:var(--a-red-soft); }
.alt-app .storage-preview-banner{ margin:0 0 var(--a-3); font-weight:600; letter-spacing:.04em; }
.alt-app .storage-preview-head{ margin-bottom:var(--a-2); font-family:var(--a-display); font-size:var(--a-fs-14); font-weight:600; line-height:var(--a-lh-ui); color:var(--a-text); }
.alt-app .storage-preview-scope{ margin:0 0 var(--a-3); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); overflow-wrap:anywhere; }
.alt-app .storage-preview-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(104px, 1fr)); gap:var(--a-2); }
.alt-app .storage-preview-grid > .a-stat{ min-height:0; cursor:default; }
.alt-app .storage-preview-grid > .storage-preview-wide{ grid-column:span 2; }
.alt-app .storage-preview-dates,
.alt-app .storage-preview-skips{ margin-top:var(--a-2); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-dim); }
.alt-app .storage-preview-protected{ margin:var(--a-3) 0; }
.alt-app .storage-preview-protected-head{ color:var(--a-green); }
/* Marker and indent are declared on purpose: there is no global list reset, and relying on today's default would lose the markers if one were added. */
.alt-app .storage-preview-protected-list{ margin:var(--a-2) 0 0; padding:0 0 0 18px; list-style:disc outside; }
.alt-app .storage-preview-protected-list > li{ margin:0 0 var(--a-1); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); color:var(--a-text); overflow-wrap:anywhere; }
.alt-app .storage-preview-protected-list > li::marker{ color:var(--a-green); }
.alt-app .storage-preview-sample{ margin-top:var(--a-3); font-size:var(--a-fs-12); line-height:var(--a-lh-ui); }
.alt-app .storage-preview-sample summary{ cursor:pointer; color:var(--a-blue-text); }
.alt-app .storage-preview-sample summary:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }
.alt-app .storage-sample-row{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--a-2); padding:var(--a-sp-6) 0; border-top:1px solid var(--a-line-soft); }
.alt-app .storage-sample-title{ flex:1; min-width:140px; font-size:var(--a-fs-12); line-height:var(--a-lh-ui); overflow-wrap:anywhere; }
.alt-app .storage-preview-confirm{ margin-top:var(--a-3); }
.alt-app .storage-preview-confirm > .a-notice{ margin-bottom:var(--a-3); }

/* ---------- narrow ---------- */

/* Nothing here may push the page sideways. The simulator row is the widest thing in the view, so below the shell's own breakpoint the label takes
   its own line and the shortcuts wrap under the number rather than beside it. */
@media (max-width:719px){
  .alt-app .sx-sim-row{ gap:var(--a-2); }
  .alt-app .sx-sim-lbl{ flex:1 0 100%; }
  .alt-app .sx-presets{ flex:1 1 100%; }
  .alt-app .sx-preset{ flex:1 1 0; min-width:var(--a-touch); }
  .alt-app .sxr-figs{ grid-template-columns:1fr 1fr; }
}

@media (max-width:479px){
  .alt-app .sxr-figs{ grid-template-columns:1fr; }
  .alt-app .sx-ret-scope{ align-items:stretch; flex-direction:column; }
  /* Its own line at phone width: beside a full-width button it would be a two-character column, and the sentence it carries is the point of it. */
  .alt-app .sxr-saved{ flex:1 1 100%; }
}
