/* Machines page: the line of what the machines running now cost, then three sections under rules, no boxes: the
   machines running now, the audit with its one table and its clean-up, the daemons. A machine wears its provider's
   line. Every rule is under the page, so nothing here reaches another page, but the audit's legend, which the
   clean-up's dialog (outside the page) repeats. Tokens from styles.css only. */

.page[data-page="machines"] { gap: 40px; }
.page[data-page="machines"] .machines-ledger { margin-top: -28px; }
/* A machine: its provider's line beside the first line of its words. Where the table is narrow, the words wrap
   between the parts of the name (never inside "us-east-2" or an id), so a row keeps its price and lease in view. */
.page[data-page="machines"] .machine { display: inline-flex; align-items: flex-start; gap: 10px; }
.page[data-page="machines"] .machine .pline { margin-top: calc(.75em - 1.5px); }
.page[data-page="machines"] .machine-words { white-space: normal; }
.page[data-page="machines"] .cell-fold .mono, .page[data-page="machines"] .cell-fold .fig,
.page[data-page="machines"] .machine-words .mono { white-space: nowrap; }
/* a sort button ends where its column does: its pad past the label would stick out of the last column shown and
   make the table scroll by those few pixels */
.page[data-page="machines"] .table .th-btn { margin-right: 0; padding-right: 0; }

/* Where a section is narrower than its table (a tablet, or a laptop window beside the nav), the table keeps its
   identifying and money columns and reads the rest under the first cell, as it does on a phone: the machines and
   what the audit found below 700px, the daemons (a column more) below 780px. */
.page[data-page="machines"] .held { container: held / inline-size; }
.page[data-page="machines"] .audit { container: audit / inline-size; }
.page[data-page="machines"] .nodes { container: nodes / inline-size; }
@container held (max-width: 699px) {
  .page[data-page="machines"] .table td.col-fold, .page[data-page="machines"] .table th.col-fold { display: none; }
  .page[data-page="machines"] .cell-fold {
    display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 1px; margin-top: 2px;
    font: 400 12.5px/1.45 var(--font-sans); color: var(--ink-2); white-space: normal;
  }
  .page[data-page="machines"] .table td:has(.cell-fold) { padding-top: 7px; padding-bottom: 7px; height: auto; }
}
@container audit (max-width: 699px) {
  .page[data-page="machines"] .table td.col-fold, .page[data-page="machines"] .table th.col-fold { display: none; }
  .page[data-page="machines"] .cell-fold {
    display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 1px; margin-top: 2px;
    font: 400 12.5px/1.45 var(--font-sans); color: var(--ink-2); white-space: normal;
  }
  .page[data-page="machines"] .table td:has(.cell-fold) { padding-top: 7px; padding-bottom: 7px; height: auto; }
  /* what the audit found is the first of the facts under the machine, in its own ink; the machine is then the
     table's first column, on the section's left edge as every table's first is */
  .page[data-page="machines"] .audit .cell-fold .badge { font-size: 12.5px; }
  .page[data-page="machines"] .audit .table :is(th, td):first-child + :is(th, td) { padding-left: 0; }
}
@container nodes (max-width: 779px) {
  .page[data-page="machines"] .table td.col-fold, .page[data-page="machines"] .table th.col-fold { display: none; }
  .page[data-page="machines"] .cell-fold {
    display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 1px; margin-top: 2px;
    font: 400 12.5px/1.45 var(--font-sans); color: var(--ink-2); white-space: normal;
  }
  .page[data-page="machines"] .table td:has(.cell-fold) { padding-top: 7px; padding-bottom: 7px; height: auto; }
}

/* A small phone (a section under 345px: a 375px screen and narrower): the columns that stay stand closer, so the
   last of them, the lease or when a daemon was last seen, is whole to its last letter. */
@container held (max-width: 345px) {
  .page[data-page="machines"] .table :is(th, td):not(:first-child) { padding-left: 6px; }
  .page[data-page="machines"] .table :is(th, td):not(:last-child) { padding-right: 6px; }
}
@container nodes (max-width: 345px) {
  .page[data-page="machines"] .table :is(th, td):not(:first-child) { padding-left: 6px; }
  .page[data-page="machines"] .table :is(th, td):not(:last-child) { padding-right: 6px; }
}
/* The smallest phone (a section under 300px: a 320px screen): a fact under a daemon may put its value under its
   label, so the first column gives the room the last one needs and the daemons do not scroll sideways. (A machine's
   own name is kept whole, so the machines running now still need 28px more than such a screen has.) */
@container nodes (max-width: 299px) {
  .page[data-page="machines"] .cell-fold .cell-fact { flex-wrap: wrap; white-space: normal; row-gap: 0; }
}

/* the audit: a sentence until it runs, then its verdict over the machines it found; under them, after one rule,
   what it left out, the clean-up and its result */
.page[data-page="machines"] .audit-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.page[data-page="machines"] .audit-intro { padding: 2px 0 12px; color: var(--ink-2); }
.page[data-page="machines"] .audit-progress {
  display: flex; align-items: center; gap: 10px; padding: 2px 0 12px; color: var(--ink-2);
}
.page[data-page="machines"] .audit-elapsed { color: var(--ink-3); }
.page[data-page="machines"] .audit-body > .notice { margin: 2px 0 14px; }
.page[data-page="machines"] .audit-head { display: grid; gap: 12px; padding: 2px 0 16px; }
.page[data-page="machines"] .audit-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.page[data-page="machines"] .audit-checked { color: var(--ink-3); font-size: 13px; }
/* What the audit's words mean (machines.js auditLegend): each word as the table wears it, its one sentence beside it,
   quieter than the tally over it. In the clean-up's dialog it stands under the machines it would end. */
.audit-legend { gap: 5px 18px; font-size: 12.5px; line-height: 1.5; max-width: 86ch; }
.audit-legend dt { display: flex; align-items: baseline; }
.audit-legend dt .badge { font-size: 12.5px; line-height: 1.5; }
.audit-legend dd { color: var(--ink-2); overflow-wrap: break-word; }
.dialog .audit-legend { margin-top: 14px; }
.page[data-page="machines"] .audit-foot {
  display: grid; gap: 14px; justify-items: start; padding: 14px 0 0; border-top: 1px solid var(--rule);
}
.page[data-page="machines"] .audit-foot > .notice { border: 0; padding: 0; justify-self: stretch; }
.page[data-page="machines"] .audit-gc { gap: 18px; }
/* what the clean-up stops by the hour, in its button after its name: a figure in the text's ink, quieter than the
   name, which keeps the button's red */
.page[data-page="machines"] .audit-gc-stops { margin-left: 2px; color: var(--ink-2); font-weight: 400; }
.page[data-page="machines"] .btn:disabled .audit-gc-stops { color: inherit; }
.page[data-page="machines"] .audit-gc .check:has(input:disabled) { color: var(--ink-3); cursor: default; }

@media (max-width: 599px) {
  .page[data-page="machines"] { gap: 32px; }
  .page[data-page="machines"] .machines-ledger { margin-top: -22px; }
  .page[data-page="machines"] .audit-summary { gap: 6px 16px; }
}

/* Nothing running, or no daemon listed: what will be here, in a sentence and a quieter one under it. Where the
   machines' columns show, their head stays over the sentences, so the page also says what it lists of a machine; a
   phone, and the daemons, read the sentences alone. */
.page[data-page="machines"] .machines-none { display: grid; gap: 3px; padding: 0; max-width: 72ch; }
.page[data-page="machines"] .machines-none a { font-weight: 550; white-space: nowrap; }
@container held (min-width: 700px) {
  .page[data-page="machines"] .held .table.is-empty thead { display: table-header-group; }
  .page[data-page="machines"] .held .table.is-empty + .table-empty { padding-top: 12px; }
}

/* the person's own computers: where they are, one quiet line under the figures, its action a link after it */
.page[data-page="machines"] .machines-own { margin-top: -6px; }
.page[data-page="machines"] .machines-own .machines-add { margin-left: 4px; font-weight: 550; }
/* an own machine's price is its owner's estimate, not a bill: quieter */
.page[data-page="machines"] .machines-estimate { color: var(--ink-3); }
