/* Directory status tiles (18 Nov) · ?df=a|b|c, see dir-tiles.js.
   White tiles, hairlines, radius-sm, no shadows. Colour lives only in the 20px icon tiles, the B swatches/bar and the delta chips (DS status tokens).
   Selected: A = 1.5px ink border, B = ink underline, C = ink top edge. Focus = a soft wash (the app's pattern), never a ring box. */
.dt { margin: 0 0 var(--space-4); }
.dt-t { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm); background: var(--color-bg-canvas); color: var(--color-text-primary); text-align: left; cursor: pointer; font: inherit;
  transition: border-color 140ms ease, background-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.dt-t:active { transform: scale(0.985); }
.dt-t:focus-visible { outline: none; background: var(--color-bg-surface); box-shadow: 0 0 0 3px var(--color-alpha-black-8); }
@media (hover: hover) and (pointer: fine) { .dt-t:hover { border-color: var(--color-border-default); } }

.dt-h { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dt-l { font-size: var(--font-size-13); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-t[aria-pressed="true"] .dt-l { color: var(--color-text-primary); }
.dt-n { font-family: var(--font-family-display); font-weight: var(--font-weight-semibold); font-variant-numeric: tabular-nums; font-feature-settings: var(--font-feature-tabular); letter-spacing: -0.02em; line-height: 1; color: var(--color-text-primary); }
.dt-f { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.dt-c { min-width: 0; font-size: var(--font-size-12); color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Icon tile: 20px, a soft status tint */
.dt-ic { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 6px; }
.dt-ic svg { width: 12px; height: 12px; stroke-width: 2; }
.dt-ic--neutral { background: var(--color-lilac-50); color: var(--color-lilac-700); } /* 23 Nov: no grey icon chips (Mikky) */
.dt-ic--info { background: var(--color-status-info-bg); color: var(--color-status-info-fg); }
.dt-ic--success { background: var(--color-status-success-bg); color: var(--color-status-success-fg); }
.dt-ic--warning { background: var(--color-status-warning-bg); color: var(--color-status-warning-fg); }
.dt-ic--danger { background: var(--color-status-danger-bg); color: var(--color-status-danger-fg); }

/* Delta chip */
.dt-d { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--radius-xs); font-size: 11px; font-weight: var(--font-weight-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-d--neutral { box-shadow: inset 0 0 0 1px var(--color-border-subtle); color: var(--color-text-secondary); }
.dt-d--success { background: var(--color-status-success-bg); color: var(--color-status-success-fg); }
.dt-d--warning { background: var(--color-status-warning-bg); color: var(--color-status-warning-fg); }
.dt-d--danger { background: var(--color-status-danger-bg); color: var(--color-status-danger-fg); }

/* ── A · KPI cards ── */
.dt--a { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.dt-a { gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-3); }
.dt-a .dt-n { font-size: var(--font-size-32); margin-top: 2px; }
.dt-a[aria-pressed="true"] { border-color: var(--color-text-primary); box-shadow: 0 0 0 0.5px var(--color-text-primary); }
.dt-a[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 0.5px var(--color-text-primary), 0 0 0 4px var(--color-alpha-black-8); }

/* ── B · compact tiles + share bar ── */
.dt-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.dt-b { gap: 6px; padding: var(--space-3) var(--space-3) calc(var(--space-3) + 1px); overflow: hidden; }
.dt-b .dt-h { justify-content: space-between; align-items: baseline; }
.dt-b .dt-l { display: inline-flex; align-items: center; gap: 6px; }
.dt-b .dt-n { font-size: var(--font-size-24); }
.dt-b .dt-d { height: 18px; padding: 0 5px; }
.dt-b::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--color-text-primary); transform: scaleX(0); transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1); }
.dt-b[aria-pressed="true"]::after { transform: scaleX(1); }
.dt-sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dt-sw--info, .dt-s--info { background: var(--color-border-strong); }   /* the bulk stays neutral so the bar isn't a blue stripe */
.dt-sw--success, .dt-s--success { background: var(--color-status-success-solid); }
.dt-sw--warning, .dt-s--warning { background: var(--color-status-warning-solid); }
.dt-sw--danger, .dt-s--danger { background: var(--color-status-danger-solid); }
.dt-bar { display: flex; gap: 2px; height: 4px; margin-top: var(--space-2); }
.dt-s { flex-basis: 0; min-width: 3px; border-radius: 1px; }

/* ── C · lead tile + small tiles ── */
.dt--c { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.dt-c1 { gap: var(--space-3); overflow: hidden; }
.dt-c1 .dt-n { font-size: var(--font-size-24); }
.dt-c1::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--color-text-primary); opacity: 0; transition: opacity 140ms ease; }
.dt-c1[aria-pressed="true"]::before { opacity: 1; }
.dt-lead { flex-direction: row; align-items: stretch; justify-content: space-between; gap: var(--space-5); }
.dt-lb { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.dt-lead .dt-n { font-size: var(--font-size-40); }
.dt-lead .dt-f { justify-content: flex-start; }
.dt-sp { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 4px; flex: 1 1 140px; max-width: 200px; min-width: 0; }
.dt-sp svg { display: block; width: 100%; height: 36px; overflow: visible; }
.dt-sp polyline { fill: none; stroke: var(--color-text-primary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dt-spl { font-size: 11px; color: var(--color-text-tertiary); white-space: nowrap; }

/* ── Narrow panes ── */
@container page (max-width: 1100px) {
  /* the chip drops under the caption instead of squeezing it */
  .dt-a .dt-f, .dt-c1 .dt-f { flex-wrap: wrap; justify-content: flex-start; row-gap: 6px; }
  .dt--c { grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); }
  .dt-sp { display: none; }
}
@container page (max-width: 760px) {
  /* A and C: All full width, the four statuses 2-up */
  .dt--a, .dt--c { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .dt--a > :first-child, .dt--c > :first-child { grid-column: 1 / -1; }
  .dt-a { padding: var(--space-3); gap: var(--space-2); }
  .dt-a .dt-n { font-size: var(--font-size-24); }
  .dt-sp { display: flex; flex: 0 1 120px; }
  .dt-lead .dt-n { font-size: var(--font-size-32); }
  .dt-c1 { padding: var(--space-3); gap: var(--space-2); }
  /* B: one row that scrolls sideways */
  .dt--b { margin-left: calc(var(--pad) * -1); margin-right: calc(var(--pad) * -1); }
  .dt-row { display: flex; overflow-x: auto; padding: 0 var(--pad); scroll-padding: 0 var(--pad); scroll-snap-type: x proximity; }
  .dt-b { flex: 0 0 176px; scroll-snap-align: start; }
  .dt-b .dt-n { font-size: var(--font-size-20); }
  .dt-bar { margin-left: var(--pad); margin-right: var(--pad); }
}
@media (prefers-reduced-motion: reduce) { .dt-t:active { transform: none; } }

/* 18 Nov: Mikky — "remove outlines and too big". No borders on the tiles; selected = soft wash; smaller numbers and padding. */
.dt-a.dt-t, .dt-a.dt-t:hover { border-color: transparent; }
.dt-a { padding: var(--space-2) var(--space-3); gap: 4px; }
.dt-a .dt-n { font-size: var(--font-size-24); margin-top: 0; }
.dt-a[aria-pressed="true"], .dt-a[aria-pressed="true"]:focus-visible { border-color: transparent; box-shadow: none; background: var(--color-bg-surface); }
@media (hover: hover) and (pointer: fine) { .dt-a:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--color-bg-surface) 55%, var(--color-bg-canvas)); } }
.dt-d--neutral { box-shadow: none; background: var(--color-bg-surface); }

/* 18 Nov (later): Mikky — "have an outline, sharp and clear". Crisp 1px hairline on every tile, tighter radius,
   selected = 1px ink border (no grey wash), compact size kept. */
.dt-a.dt-t { border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); background: var(--color-bg-canvas); }
@media (hover: hover) and (pointer: fine) { .dt-a.dt-t:not([aria-pressed="true"]):hover { border-color: var(--color-border-strong, var(--color-text-tertiary)); background: var(--color-bg-canvas); } }
.dt-a[aria-pressed="true"], .dt-a[aria-pressed="true"]:focus-visible { border-color: var(--color-text-primary); background: var(--color-bg-canvas); box-shadow: none; }
.dt-a:focus-visible:not([aria-pressed="true"]) { border-color: var(--color-text-secondary); }
/* no dark ring on the selected tile: same hairline, one step darker, label in semibold */
.dt-a[aria-pressed="true"], .dt-a[aria-pressed="true"]:focus-visible { border-color: var(--color-neutral-400, var(--color-border-strong)); }
.dt-a[aria-pressed="true"] .dt-l { font-weight: var(--font-weight-semibold); color: var(--color-text-primary); }
/* legend on the toolbar line: left side, vertically centred with search + sort */
.toolbar > .lgh { margin: 0; flex: 1 1 auto; min-width: 0; align-self: center; }
@media (max-width: 1100px) { .toolbar > .lgh { flex-basis: 100%; order: 2; margin-top: var(--space-2); } }
/* 19 Nov: on narrow panes the legend drops under search + sort instead of overlapping them (hd.css sets nowrap) */
@media (max-width: 1100px) { .pad > .toolbar:has(> .lgh) { flex-wrap: wrap; row-gap: var(--space-2); } .pad > .toolbar:has(> .lgh) > .end { margin-left: auto; } }

/* 24 Nov · final audit: tile captions wrap instead of clipping when the drawer narrows the tiles */
.dt-c { white-space: normal; overflow: visible; text-overflow: clip; text-wrap: pretty; }
