/* Chips and rates (pages/chips.js): Fluid Compute's rate card as a list, and a chip's own page. A list of four
   columns reads as lines only in a column it does not have to cross, so the page is narrower than the window: the
   list 880px at the most, a chip's page 720px, as the steps to a first run are. Every rule is under the page, and
   tokens from styles.css only. */

.page[data-page="chips"] { gap: 20px; max-width: 880px; }
.page[data-page="chips"][data-view="chip"] { gap: 22px; max-width: 720px; }

/* the head: the title, with the one action a visitor with no session has at the end of its line at every width; a
   line of words under it (what the page is) or over it (the way back) */
.page[data-page="chips"] .chips-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.page[data-page="chips"] .page-head { align-items: center; flex-wrap: nowrap; }
/* (as tall as the action from the first paint, where a control is 40px: the title holds still when the action comes) */
@media (max-width: 899px) { .page[data-page="chips"] .page-head { min-height: 40px; } }
.page[data-page="chips"] .page-title { min-width: 0; overflow-wrap: anywhere; }
.page[data-page="chips"] .page-sub { max-width: 60ch; margin-top: 0; text-wrap: pretty; }
.page[data-page="chips"] .page-actions { flex: none; }
.page[data-page="chips"] .page-actions[hidden] { display: none; }
.page[data-page="chips"] a.btn { text-decoration: none; }
/* what the page asks of a visitor with no session is one thing, to sign in: the press that makes a key, which
   leads to the sign-in too, is quiet beside it */
:root[data-signed-out] .page[data-page="chips"] .start-act .btn-primary { background: var(--paper); border-color: var(--edge); color: var(--ink); }
@media (hover: hover) {
  :root[data-signed-out] .page[data-page="chips"] .start-act .btn-primary:hover { background: var(--paper-2); border-color: var(--ink-2); color: var(--ink); }
}
/* the way back to the list, over a chip's name: the shell's breadcrumb says it where it is shown (signed in, from
   600px), so this line is for the forms of the shell that show none */
.page[data-page="chips"] .chips-up {
  display: none; align-items: center; gap: 3px; width: fit-content; margin-left: -4px; font-size: 13px; color: var(--ink-2);
  text-decoration: none;
}
.page[data-page="chips"] .chips-up .icon { color: var(--ink-3); }
@media (hover: hover) { .page[data-page="chips"] .chips-up:hover, .page[data-page="chips"] .chips-up:hover .icon { color: var(--ink); } }
:root[data-signed-out] .page[data-page="chips"] .chips-up { display: inline-flex; }
@media (max-width: 599px) { .page[data-page="chips"] .chips-up { display: inline-flex; } }
@media (max-width: 899px) { .page[data-page="chips"] .chips-up { min-height: 40px; margin-top: -10px; margin-bottom: -6px; } }

/* the list: the search and the two filters on one line, the count under them, then the rows. What cannot be had now
   is quiet, as on the Connections sheet. While the card is read one line stands where the count and the rows will
   be, under a rule of ink as the rows' head is, so they come in under the filters and nothing above them moves. */
.page[data-page="chips"] .chips-toolbar .search-box { flex: 0 1 240px; min-width: 160px; }
.page[data-page="chips"] .chips-line {
  display: flex; align-items: baseline; gap: 12px; min-height: 20px; font-size: 12.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.page[data-page="chips"] .chips-clear { font-size: 12.5px; color: var(--ink-2); }
.page[data-page="chips"] .chips-state .empty { padding: 12px 0; border-top: 1px solid var(--ink); }
.page[data-page="chips"] .chips-state .loading { min-height: 48px; }
.page[data-page="chips"] .table td { height: 44px; }
.page[data-page="chips"] .table .row-link { font-weight: 600; }
.page[data-page="chips"] .table tr[data-off] td, .page[data-page="chips"] .table tr[data-off] .row-link { color: var(--ink-3); }
.page[data-page="chips"] .table tr[data-off] .row-link { font-weight: 500; }
.page[data-page="chips"] .table th:first-child { width: 28%; }
.page[data-page="chips"] .table th:nth-child(2) { width: 20%; }
.page[data-page="chips"] .chips-several { max-width: 72ch; }
.page[data-page="chips"] .chips-said > .notice { border-bottom: 0; padding-bottom: 2px; }

/* a chip's page: its facts as one line of figures under its name, the sentence about its bill under them, then the
   steps */
.page[data-page="chips"] .chips-about { display: grid; gap: 8px; min-width: 0; }
.page[data-page="chips"] .chips-facts .ledger-fig { font-size: 18px; letter-spacing: -.01em; }
.page[data-page="chips"] .chips-facts .chips-had .ledger-words { color: var(--ink); }
.page[data-page="chips"] .chips-facts .chips-off .ledger-words { color: var(--ink-3); }
.page[data-page="chips"] .chips-note { max-width: 72ch; text-wrap: pretty; }
.page[data-page="chips"] .chips-method[hidden] { display: none; }
.page[data-page="chips"] .chips-run { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--ink); }
.page[data-page="chips"] .start-guide { margin-top: 6px; }

@media (max-width: 599px) {
  /* a notice's link goes under its sentence, which keeps the line whole */
  .page[data-page="chips"] > .notice { flex-wrap: wrap; row-gap: 6px; }
  .page[data-page="chips"] > .notice .notice-text { flex: 1 1 100%; }
  .page[data-page="chips"] .chips-toolbar .search-box { flex-basis: 100%; max-width: none; }
  .page[data-page="chips"] .table th:first-child, .page[data-page="chips"] .table th:nth-child(2) { width: auto; }
}

/* Signed out on a site whose pages for a visitor stand on a ground of their own: this page is on that ground too,
   on the bar's column (the wordmark's edge), so nothing moves or changes colour between the first paint and the
   page. A hairline and a row's wash are a step darker there, to read on the ground as they do on paper, and a
   column's head has no paper behind it. In the dark the ground is the page's own, and nothing differs. */
:root[data-site="fluid"][data-signed-out] .content:has(> .page[data-page="chips"]) {
  padding: 28px max(24px, calc((100vw - 1120px) / 2)) 72px;
}
:root[data-site="fluid"][data-signed-out] .page[data-page="chips"] .table th { background: none; }
:root[data-site="fluid"][data-signed-out] .page[data-page="chips"] { --rule: var(--rule-2); --paper-2: var(--paper-3); }
:root[data-site="fluid"][data-signed-out][data-theme="dark"] .page[data-page="chips"] { --rule: inherit; --paper-2: inherit; }
@media (prefers-color-scheme: dark) {
  :root[data-site="fluid"][data-signed-out]:not([data-theme="light"]) .page[data-page="chips"] { --rule: inherit; --paper-2: inherit; }
}
@media (max-width: 700px) {
  :root[data-site="fluid"][data-signed-out] .content:has(> .page[data-page="chips"]) { padding: 12px 20px 56px; }
}
