/* structam.sh demo (js/demos/estate.js): one application across the estate.
   Recreates, light theme: Applications (web/src/pages/Applications.tsx),
   Application detail (ApplicationDetail.tsx with base.css .split / .grid-kpi
   and app.css .inv-bar, .inv-hash-groups) and Hash search (HashSearch.tsx).
   Sizes are the product's px; every caption of 13px or less is written
   max(<px>, var(--sx-fmin, 0px)) so it never renders under 11px.
   Layout per tier: T1-T2 every column; T3 (< 1040px) the secondary columns
   (installs, binaries, last change, install path, size, container) drop and
   the grids are redrawn without them; T4 (< 800px) phone cards. The detail
   page wraps its hash panel under the main column as the product's .split
   does, and the demo scrolls to it. Motion comes from js, not CSS. */

.es-demo .sx-wrap { --sx-h: 560px; }

.es-demo .es-layer { position: absolute; inset: 0; overflow: hidden; }
.es-demo .es-contents { display: contents; }
.es-demo .es-rel { position: relative; }
.es-demo .es-r { text-align: right; }
.es-demo .es-nowrap { flex-wrap: nowrap; gap: 6px; }
.es-demo .es-detail, .es-demo .es-hash { will-change: transform; }

/* The sidebar follows the page: Applications, then Hash search. */
.es-demo[data-pg="hash"] .sx-nav > .sx-nav-a.is-active { background: none; color: var(--sx-ink-subtle); }
.es-demo[data-pg="hash"] .sx-nav > .sx-nav-a.is-active .sx-ic { color: inherit; }
.es-demo[data-pg="hash"] .sx-nav > :nth-child(5) { background: var(--sx-side-active); color: var(--sx-ink); }
.es-demo[data-pg="hash"] .sx-nav > :nth-child(5) .sx-ic { color: var(--sx-brand-text); }

/* ---------- Applications ---------- */
.es-demo .es-list { gap: 14px; }
.es-demo .es-filters { flex-wrap: nowrap; }
.es-demo .es-search { width: 280px; }
.es-demo .es-lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--sx-ink-muted); font-size: max(13px, var(--sx-fmin, 0px)); white-space: nowrap; }
.es-demo .es-lbl .sx-select { min-width: 130px; }
.es-demo .es-vendor { width: 180px; }
.es-demo .es-panel { overflow: hidden; }
.es-demo .es-apps .sx-cell-title { font-weight: 500; }

/* ---------- Application detail ---------- */
.es-demo .es-detail { gap: 14px; }
.es-demo .es-badges { gap: 6px; }
.es-demo .es-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.es-demo .es-kpis .sx-kpi { padding: 12px 18px; gap: 6px; }
.es-demo .es-kpis .sx-k-value { font-size: 24px !important; }
.es-demo .es-kpi { display: contents; }
/* base.css .split: main flex 999 1 640px, side flex 1 1 340px, wrapping. */
.es-demo .es-split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.es-demo .es-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.es-demo .es-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.es-demo .es-ph { padding: 12px 16px 10px; }
.es-demo .es-spread { overflow: hidden; }
.es-demo .es-sp { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 70px 80px; }
.es-demo .es-sp-r { display: contents; }
.es-demo .es-sp-r > span { display: flex; align-items: center; min-width: 0; padding: 7px 12px; border-top: 1px solid var(--sx-line); font-size: max(13px, var(--sx-fmin, 0px)); line-height: 18px; }
.es-demo .es-sp-r > span:first-child { padding-left: 16px; }
.es-demo .es-sp-r > span:last-child { padding-right: 16px; }
.es-demo .es-sp-r > .es-r { justify-content: flex-end; }
.es-demo .es-sp-r.is-head > span { background: var(--sx-surface); color: var(--sx-ink-muted); font: 500 max(12px, var(--sx-fmin, 0px))/16px var(--sx-sans); letter-spacing: .04em; text-transform: uppercase; }
/* .inv-bar: an 8px track; the fill is the share of hosts. */
.es-demo .es-bar { position: relative; display: block !important; width: 100%; height: 8px; padding: 0 !important; border-radius: 999px; background: var(--sx-surface-overlay); overflow: hidden; }
.es-demo .es-sp-r > .es-bar { align-self: center; margin: 0 12px; width: calc(100% - 24px); border-top: 0; }
.es-demo .es-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--sx-ink-subtle); }
.es-demo .es-hosts { overflow: hidden; }
/* Executables by hash (.inv-hash-groups): the anomaly framed in warn. */
.es-demo .es-hp { gap: 12px; padding: 14px 16px 16px; }
.es-demo .es-groups { display: flex; flex-direction: column; gap: 8px; }
.es-demo .es-g { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--sx-line); border-radius: 6px; }
.es-demo .es-g.is-anomaly { border-color: var(--sx-warn-line); background: var(--sx-warn-soft); }
/* Secondary text on the warn tint: --sx-ink-subtle would be 3.7:1 there. */
.es-demo .es-g.is-anomaly :is(.sx-caption, .sx-cell-sub, .sx-dim) { color: var(--sx-ink-muted); }
.es-demo .es-g-h { gap: 6px; flex-wrap: nowrap; }
.es-demo .es-hl { display: flex; align-items: center; gap: 8px; font-size: max(13px, var(--sx-fmin, 0px)); }
.es-demo .es-ring { position: absolute; inset: -3px; border: 2px solid var(--sx-warn); border-radius: 8px; opacity: 0; pointer-events: none; }

/* ---------- Hash search ---------- */
.es-demo .es-hash { gap: 14px; }
.es-demo .es-form { display: flex; gap: 10px; padding: 14px 16px; }
.es-demo .es-shabox { flex: 1 1 0; width: auto; }
.es-demo .es-shabox .sx-field-v { overflow: hidden; text-overflow: ellipsis; font-size: max(13px, var(--sx-fmin, 0px)); }
.es-demo .es-results { display: flex; flex-direction: column; gap: 12px; }
.es-demo .es-copy { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 4px 4px 12px; border: 1px solid var(--sx-line); border-radius: 6px; background: var(--sx-surface); font-size: max(13px, var(--sx-fmin, 0px)); }
.es-demo .es-copy .sx-ellipsis { flex: 1 1 0; min-width: 0; }
.es-demo .es-found { font-size: 14px; }
.es-demo .es-hit { overflow: hidden; }
.es-demo .es-loading { display: flex; flex-direction: column; gap: 12px; }
/* base.css .skeleton, held still (the demo is a pure function of t; the product's shimmer is a CSS loop). */
.es-demo .es-skel { display: block; height: 28px; border-radius: 6px; background: linear-gradient(90deg, var(--sx-line) 0%, var(--sx-surface-overlay) 50%, var(--sx-line) 100%); background-size: 200% 100%; }
.es-demo .es-skel:nth-child(2) { height: 120px; }
.es-demo .es-skel:nth-child(3) { height: 160px; }

/* ---------- Narrower tiers ---------- */
@container sxapp (max-width: 1039px) {
  /* The secondary columns are gone (sx-hide-md): redraw each grid without them. */
  .es-demo .es-apps { --sx-cols: minmax(0, 1fr) 96px 88px 104px 92px !important; }
  .es-demo .es-apps .sx-thead > :is(:nth-child(4), :nth-child(7), :nth-child(8)) { display: none; }
  .es-demo .es-hostt { --sx-cols: minmax(0, 1.3fr) minmax(0, 1fr) 70px 100px !important; }
  .es-demo .es-hostt .sx-thead > :nth-child(4) { display: none; }
  .es-demo .es-exe { --sx-cols: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.4fr) 100px !important; }
  .es-demo .es-exe .sx-thead > :nth-child(4) { display: none; }
  .es-demo .es-proc { --sx-cols: minmax(0, 1.1fr) minmax(0, 1.3fr) 100px 96px !important; }
  .es-demo .es-proc .sx-thead > :nth-child(4) { display: none; }
  .es-demo .es-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .es-demo .es-search { width: 220px; }
}
@container sxapp (max-width: 799px) {
  .es-demo .es-list, .es-demo .es-detail, .es-demo .es-hash { gap: 10px; }
  .es-demo .sx-ph-sub { display: none; }
  .es-demo .es-detail .sx-ph-sub { display: block; font-size: max(13px, var(--sx-fmin, 0px)); }
  .es-demo .es-search { width: 100%; }
  .es-demo .es-filters > [data-r="search"] { display: flex; flex: 1 1 0; min-width: 0; }
  .es-demo .es-sp-r .es-nowrap { flex-wrap: wrap; gap: 2px 6px; }
  .es-demo .es-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .es-demo .es-kpis .sx-kpi { padding: 10px 12px; }
  .es-demo .es-kpis .sx-k-value { font-size: 20px !important; }
  .es-demo .es-sp { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 52px; }
  .es-demo .es-sp-r > span:last-child { display: none; }
  .es-demo .es-sp-r > span:nth-child(3) { padding-right: 12px; }
  .es-demo .es-sp-r > span { padding: 7px 8px; }
  .es-demo .es-sp-r > .es-bar { margin: 0 8px; width: calc(100% - 16px); }
  .es-demo .es-hosts { display: none; }
  .es-demo .es-form { padding: 10px; }
  .es-demo .es-form .sx-btn > span { display: none; }
  .es-demo .es-form .sx-btn { padding: 0 10px; }
}
@container sxapp (max-width: 559px) {
  .es-demo .es-kpis > :is(:nth-child(2), :nth-child(4)) { display: none; }
  .es-demo .es-hash .sx-h1, .es-demo .es-list .sx-h1 { font-size: 24px; }
}
/* The kit's hide-md / hide-sm win over this file's display rules. */
@container sxapp (max-width: 1039px) { .es-demo .sx-hide-md { display: none !important; } }
@container sxapp (max-width: 799px) { .es-demo .sx-hide-sm { display: none !important; } }
