/* Explore's directory: one line per validator. Name and address share a cell, the status chip has its own
   column, and the actions sit side by side at the trailing edge, including in scrollable narrow tables. */
/* The card around the directory is its size container: the table needs ~920px with every column and ~860px
   without Uptime, so a narrow desktop beside the sidebar (a 1180px window gives an ~890px card) keeps the table
   without Uptime, and below 860px of card (phones, tablets) it switches to the card layout below. */
.sheet:has(> table.validator-directory) { container:directory / inline-size; }
table.validator-directory td.directory-action { text-align:right; white-space:nowrap; }
.validator-directory .directory-actions { justify-content:flex-end; flex-wrap:nowrap; margin:0; }
.validator-directory .directory-place { width:56px; }
.validator-directory .directory-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.validator-directory .directory-name { display:flex; flex-direction:column; gap:2px; min-width:0; }
.validator-directory .validator-identity { min-width:120px; max-width:240px; }
.validator-directory .directory-address { font-family:var(--font-m); font-size:.82em; letter-spacing:-.01em; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; color:var(--mute); }
.validator-directory td .help { margin-top:2px; }
/* Status takes only its chip's width; a reason wraps within a short measure instead of widening the column.
   The validator column is the widest and the others share the rest by their content: an amount and its Full
   toggle stay on one line. */
@container directory (width >= 860px) {
  .validator-directory td.directory-validator { width:24%; }
  .validator-directory td.num .gen-balance:not([open]) { white-space:nowrap; }
  .validator-directory td.directory-status { width:1%; }
  .validator-directory td.directory-status .selection-status__reason { min-width:20ch; }
}
/* A card narrower than the table: each validator is a card, as in layout A. The headers stay as a row
   of sort links above the cards; the place sits beside the name, uptime drops out, and every other cell takes
   the full width. */
@container directory (width < 860px) {
  table.validator-directory, table.validator-directory tbody { display:block; width:100%; }
  table.validator-directory thead tr { display:flex; flex-wrap:wrap; gap:0 14px; }
  table.validator-directory thead th { display:block; border:0; }
  table.validator-directory thead th:last-child { display:none; }
  table.validator-directory tbody tr { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:10px 12px;
    border-top:1px solid var(--line-soft); }
  table.validator-directory tbody td { display:block; height:auto; border:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
  /* The shared figure right-aligns its badges in number cells down to a phone viewport; a card is
     left-aligned at any viewport, so its badges follow the amount. */
  table.validator-directory td.r .stake-figure__changes { align-items:flex-start; }
  table.validator-directory td[data-label="Uptime"],
  table.validator-directory td[data-label="Registered in epoch"] { display:none; }
  table.validator-directory td { grid-column:1 / -1; }
  table.validator-directory td.directory-place { grid-column:1; align-self:center; }
  table.validator-directory td.directory-place + td { grid-column:2; }
  table.validator-directory td[data-label]::before { content:attr(data-label); display:block; margin-bottom:2px; }
  table.validator-directory td.directory-action .directory-actions > .btn { flex:1; }
  table.validator-directory td.directory-action .directory-actions { display:flex; }
}

/* A narrow desktop: the table leaves out what the cards leave out (Uptime, or Registered in epoch, the column before
   the actions), so the actions stay inside the card. */
@container directory (860px <= width < 940px) {
  table.validator-directory th:has(+ th:last-child),
  table.validator-directory td[data-label="Uptime"],
  table.validator-directory td[data-label="Registered in epoch"] { display:none; }
}

/* Directory column sizing; badge layout belongs to the shared component. */
@container directory (width >= 860px) {
  .validator-directory td.directory-validator { width:auto; }
  .validator-directory td.directory-status { width:150px; min-width:150px; }
  .validator-directory .validator-identity { min-width:0; }
  .validator-directory .directory-identity { gap:8px; }
  .validator-directory .directory-place { width:40px; }
}

@container directory (width >= 860px) {
 table.validator-directory th:nth-child(4), table.validator-directory th:nth-child(5) { width:1%; }
}

/* Registered · awaiting (no rank, no weight): fixed widths so Self and Delegated share the room and their
   Pending chips are not squeezed; the position rule above sizes the ranked table's Self and Delegated. */
@container directory (width >= 860px) {
 table.validator-directory--registered { table-layout:fixed; }
 table.validator-directory--registered th:nth-child(1) { width:auto; }
 table.validator-directory--registered th:nth-child(2) { width:150px; }
 table.validator-directory--registered th:nth-child(3), table.validator-directory--registered th:nth-child(4) { width:17%; }
 table.validator-directory--registered th:nth-child(5) { width:11.5%; }  /* fits its header, right-aligned like the value */
 table.validator-directory--registered th:nth-child(6) { width:132px; }
}

/* Exiting (no rank): Self and Delegated sized as the ranked table sizes them, one column earlier. */
@container directory (width >= 860px) {
 table.validator-directory--exiting th:nth-child(3), table.validator-directory--exiting th:nth-child(4) { width:1%; }
 table.validator-directory--exiting th:nth-child(5) { width:auto; }
}
/* The owner's own validator whose StakeGen node is being removed: the node's status under the chain status
   (task-20261119-214331), at the status chip's own gap. */
.directory-node { margin-top:4px; }
